knipknap/Gelatin

View on GitHub

Showing 8 of 33 total issues

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

    def add(self, path, data=None, replace=False):
        """
        Creates the given node if it does not exist.
        Returns the (new or existing) node.
        """
Severity: Minor
Found in Gelatin/generator/Builder.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 parse has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def parse(self, context, debug=0):
        self._enter(context, debug)
        statements = self.get_statements(context)
        matched = True
        while matched:
Severity: Minor
Found in Gelatin/compiler/Grammar.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 _suite has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _suite(self, token, buffer):
        tag, left, right, sublist = token
        statements = []
        for token in sublist:
            tag = token[0]
Severity: Minor
Found in Gelatin/compiler/SyntaxCompiler.py - About 45 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 skip has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def skip(app, what, name, obj, skip, options):
Severity: Minor
Found in docs/conf.py - About 45 mins to fix

    Function generate_to_file has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def generate_to_file(converter,
    Severity: Minor
    Found in Gelatin/util.py - About 45 mins to fix

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

      def generate_string_to_file(converter,
      Severity: Minor
      Found in Gelatin/util.py - About 35 mins to fix

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

            def create(self, path, data=None):
                """
                Creates the given node, regardless of whether or not it already
                exists.
                Returns the new node.
        Severity: Minor
        Found in Gelatin/generator/Builder.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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def parse(self, context, debug=0):
                # Function names that have NO dot in them are references to another
                # grammar.
                if '.' not in self.name:
                    start = context.start
        Severity: Minor
        Found in Gelatin/compiler/Function.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