maxwu/cistat

View on GitHub

Showing 7 of 7 total issues

Xunitrpt has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

class Xunitrpt(object):
    """ The XUnit Test Report Class.
    Which represents an XML file as a test report in XUnit format.
    The XSD refers to below document:
    https://github.com/apache/maven-surefire/blob/master/maven-surefire-plugin/src/site/resources/xsd/surefire-test-report.xsd
Severity: Minor
Found in src/cistat/model/xunit_report.py - About 3 hrs to fix

    Function __call__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def __call__(self, *args, **kwargs):
            """
            Here it is assumed all URLs are for "GET" request, AKA. Safe and Idempotent operation.
            :param func: The method to instrument with cache
            :return: Wrapped method with cache
    Severity: Minor
    Found in src/cistat/cache.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function accumulate_xunit_str has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def accumulate_xunit_str(self, xunit=None):
            """ Update data in given XUnit str to current XUnitReport Object
            If supplied with malformed str or None, silently do nothing but return itself.
            :param xunit: XUnit in a string
            :return: XunitReport Object itself after the accumulation
    Severity: Minor
    Found in src/cistat/model/xunit_report.py - About 55 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function get_recent_artifacts has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def get_recent_artifacts(cls, token=None, vcs='gh', username=None, project=None, limit=None):
    Severity: Minor
    Found in src/cistat/reqs/circleci_request.py - About 35 mins to fix

      Function imgcat has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def imgcat(width=None, height=None, preserve_aspect_ratio=False, inline=True, img_path=None):
      Severity: Minor
      Found in src/cistat/img/iterm2_imgcat.py - About 35 mins to fix

        Function get_build_artifacts has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def get_build_artifacts(cls, token, vcs, username, project, build_num):
        Severity: Minor
        Found in src/cistat/reqs/circleci_request.py - About 35 mins to fix

          Function get_recent_builds has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def get_recent_builds(cls, token=None, vcs='gh', username=None, project=None, limit=None):
          Severity: Minor
          Found in src/cistat/reqs/circleci_request.py - About 35 mins to fix
            Severity
            Category
            Status
            Source
            Language