From b1f4cfeeaddfb97bd02fbbed9faca9a345a4d4cf Mon Sep 17 00:00:00 2001 From: Ben Patterson Date: Tue, 14 Jul 2015 08:17:54 -0400 Subject: [PATCH 1/2] Add plato JS static code analysis tool. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c7f7232cb4..62e0affb90 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ }, "devDependencies": { "jshint": "^2.7.0", - "edx-custom-a11y-rules": "edx/edx-custom-a11y-rules" + "edx-custom-a11y-rules": "edx/edx-custom-a11y-rules", + "plato": "1.2.2" } } From c41b67f503dead3cc773ea13e824c9ff46baa805 Mon Sep 17 00:00:00 2001 From: Ben Patterson Date: Tue, 1 Dec 2015 14:38:16 -0500 Subject: [PATCH 2/2] Add documentation. --- docs/en_us/internal/testing.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/en_us/internal/testing.rst b/docs/en_us/internal/testing.rst index 4e34692c3b..cab4b4c834 100644 --- a/docs/en_us/internal/testing.rst +++ b/docs/en_us/internal/testing.rst @@ -732,6 +732,27 @@ To view JavaScript code style quality run this command. +Code Complexity Tools +---------------------- + +Two tools are available for evaluating complexity of edx-platform code: + +- `radon `__ for Python code complexity. + * To obtain complexity, run + +:: + + paver run_complexity + +- `plato `__ for JavaScript code complexity. Several options are available on the command line; see documentation. + * Below, the following command will produce an html report in a subdirectory called "jscomplexity" + +:: + + plato -q -x common/static/js/vendor/ -t common -l .jshintrc -r -d jscomplexity common/static/js/ + + + Testing using queue servers ---------------------------