Shoobx/shoobx.junitxml

View on GitHub

Showing 8 of 16 total issues

Function writeXMLReports has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def writeXMLReports(self, properties=None):
        testSuiteNode = lxml.etree.Element(
            'testsuite',
            tests=str(self.testSuite.tests),
            errors=str(self.testSuite.errors),
Severity: Minor
Found in src/shoobx/junitxml/formatter.py - About 2 hrs 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

File formatter.py has 270 lines of code (exceeds 250 allowed). Consider refactoring.
Open

###############################################################################
#
# Copyright 2017 by Plone Foundation and Shoobx, Inc.
#
###############################################################################
Severity: Minor
Found in src/shoobx/junitxml/formatter.py - About 2 hrs to fix

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

    def filename_to_suite_name_parts(filename):
        # lop off whatever portion of the path we have in common
        # with the current working directory; crude, but about as
        # much as we can do :(
        filenameParts = filename.split(os.path.sep)
    Severity: Minor
    Found in src/shoobx/junitxml/formatter.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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, test, time, testClassName, testName, failure=None,
    Severity: Major
    Found in src/shoobx/junitxml/formatter.py - About 50 mins to fix

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

          def test_error(self, test, seconds, exc_info, stdout=None, stderr=None):
      Severity: Minor
      Found in src/shoobx/junitxml/formatter.py - About 35 mins to fix

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

            def test_failure(self, test, seconds, exc_info, stdout=None, stderr=None):
        Severity: Minor
        Found in src/shoobx/junitxml/formatter.py - About 35 mins to fix

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

              def _record(self, test, seconds, failure=None, error=None,
          Severity: Minor
          Found in src/shoobx/junitxml/formatter.py - About 35 mins to fix

            Function _record has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def _record(self, test, seconds, failure=None, error=None,
                            extraData=None):
                    for parser in [parse_layer,
                                   parse_doc_file_case,
                                   parse_doc_test_case,
            Severity: Minor
            Found in src/shoobx/junitxml/formatter.py - About 35 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

            Severity
            Category
            Status
            Source
            Language