Enable code complexity reporting.
This commit is contained in:
@@ -173,6 +173,25 @@ def _count_pep8_violations(report_file):
|
||||
return num_lines
|
||||
|
||||
|
||||
@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([
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user