From aef5317af860dffa478fa5bbdff1387a20bf0a9c Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Mon, 7 Aug 2023 10:11:24 -0700 Subject: [PATCH 1/3] notify-api-386 scan projects for code complexity --- Makefile | 10 ++++++++++ Pipfile | 2 ++ 2 files changed, 12 insertions(+) diff --git a/Makefile b/Makefile index de400611b..861f86439 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,16 @@ bootstrap-with-docker: ## Build the image to run the app in Docker run-procfile: pipenv run honcho start -f Procfile.dev +.PHONY: avg-complexity +avg-complexity: + echo "*** Shows average complexity in radon of all code ***" + pipenv run radon cc ./app -a -na + +.PHONY: too-complex +too-complex: + echo "*** Shows code that got a rating of D or F in radon ***" + pipenv run radon cc ./app -a -nd + .PHONY: run-flask run-flask: ## Run flask pipenv run newrelic-admin run-program flask run -p 6011 --host=0.0.0.0 diff --git a/Pipfile b/Pipfile index 9f24d7a23..b38e7a7d7 100644 --- a/Pipfile +++ b/Pipfile @@ -52,6 +52,8 @@ notifications-python-client = "==6.3.0" oscrypto = "==1.3.0" psycopg2-binary = "==2.9.3" pyjwt = "==2.7.0" +pylint = "==2.17.5" +radon = "==6.0.1" python-dotenv = "==1.0.0" sqlalchemy = "==1.4.40" werkzeug = "~=2.3" From 9222cc994288895cbcac1cd11929d3a30c85b3ae Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Mon, 7 Aug 2023 10:12:03 -0700 Subject: [PATCH 2/3] fix Pipfile --- Pipfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index b38e7a7d7..0846c0201 100644 --- a/Pipfile +++ b/Pipfile @@ -52,9 +52,8 @@ notifications-python-client = "==6.3.0" oscrypto = "==1.3.0" psycopg2-binary = "==2.9.3" pyjwt = "==2.7.0" -pylint = "==2.17.5" -radon = "==6.0.1" python-dotenv = "==1.0.0" +radon = "==6.0.1" sqlalchemy = "==1.4.40" werkzeug = "~=2.3" # gds metrics packages From 8fe5ca202a8bc02c487e8b5a658eaebdf4b1413c Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Mon, 7 Aug 2023 10:59:51 -0700 Subject: [PATCH 3/3] change failure to be C, D or F --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 861f86439..6bf8a2058 100644 --- a/Makefile +++ b/Makefile @@ -31,8 +31,8 @@ avg-complexity: .PHONY: too-complex too-complex: - echo "*** Shows code that got a rating of D or F in radon ***" - pipenv run radon cc ./app -a -nd + echo "*** Shows code that got a rating of C, D or F in radon ***" + pipenv run radon cc ./app -a -nc .PHONY: run-flask run-flask: ## Run flask