Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
471bd2c0
Commit
471bd2c0
authored
Feb 26, 2015
by
Ben Patterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable code complexity reporting.
parent
30291e75
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
pavelib/quality.py
+19
-0
scripts/all-tests.sh
+1
-0
No files found.
pavelib/quality.py
View file @
471bd2c0
...
...
@@ -175,6 +175,25 @@ def _count_pep8_violations(report_file):
@task
@needs
(
'pavelib.prereqs.install_python_prereqs'
)
def
run_complexity
():
"""
Uses radon to examine cyclomatic complexity.
For additional details on radon, see http://radon.readthedocs.org/
"""
system_string
=
'cms/ lms/ common/ openedx/'
print
"--> Calculating cyclomatic complexity of files..."
try
:
sh
(
"radon cc {system_string} --total-average"
.
format
(
system_string
=
system_string
)
)
except
BuildFailure
:
print
"ERROR: Unable to calculate python-only code-complexity."
@task
@needs
(
'pavelib.prereqs.install_python_prereqs'
)
@cmdopts
([
(
"compare-branch="
,
"b"
,
"Branch to compare against, defaults to origin/master"
),
(
"percentage="
,
"p"
,
"fail if diff-quality is below this percentage"
),
...
...
scripts/all-tests.sh
View file @
471bd2c0
...
...
@@ -80,6 +80,7 @@ case "$TEST_SUITE" in
# Run quality task. Pass in the 'fail-under' percentage to diff-quality
paver run_quality
-p
100
paver run_complexity
>
code_complexity.log
||
echo
"Unable to calculate code complexity. Ignoring error."
# Need to create an empty test result so the post-build
# action doesn't fail the build.
mkdir
-p
reports
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment