emory-libraries/eulxml

View on GitHub

Showing 71 of 192 total issues

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

    def __init__(self, node=None, context=None, **kwargs):
        if node is None:
            node = self._build_root_element()

        self.node = node
Severity: Minor
Found in eulxml/xmlmap/core.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

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

    def _serialize(self):
        if self.axis == '@':
            yield '@'
        elif self.axis:
            yield self.axis
Severity: Minor
Found in eulxml/xpath/ast.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

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

    def _init_formsets(self, data=None, prefix=None):
        self.formsets = {}
        for name, formset in six.iteritems(self.__class__.formsets):
            if self.instance is not None:
                subinstances = getattr(self.instance, name, None)
Severity: Minor
Found in eulxml/forms/xmlobject.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

Avoid too many return statements within this function.
Open

                return False
Severity: Major
Found in eulxml/xmlmap/fields.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return True
    Severity: Major
    Found in eulxml/xmlmap/fields.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return False
      Severity: Major
      Found in eulxml/xmlmap/fields.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return False
        Severity: Major
        Found in eulxml/xmlmap/fields.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return False
          Severity: Major
          Found in eulxml/xmlmap/fields.py - About 30 mins to fix

            Function download_schema has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            def download_schema(uri, path, comment=None):
                """Download a schema from a specified URI and save it locally.
            
                :param uri: url where the schema should be downloaded
                :param path: local file path where the schema should be saved
            Severity: Minor
            Found in eulxml/catalog.py - About 25 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 _serialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def _serialize(self):
                    for tok in _serialize(self.left):
                        yield tok
            
                    if self.op in KEYWORDS:
            Severity: Minor
            Found in eulxml/xpath/ast.py - About 25 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 _serialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def _serialize(self):
                    yield '('
                    for tok in _serialize(self.base):
                        yield tok
                    yield ')'
            Severity: Minor
            Found in eulxml/xpath/ast.py - About 25 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