vesln/robber.py

View on GitHub

Showing 5 of 13 total issues

Function __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in robber/explanation.py - About 1 hr to fix

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

        def __init__(self, actual, expected=None, is_negative=False, *args, **kwargs):
    Severity: Minor
    Found in robber/matchers/base.py - About 35 mins to fix

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

          def __init__(
                  self, actual=object, is_negative=False, action=None, expected=object,
                  another_action=None, another_expected=object, more_detail=None, negative_action=None,
                  force_disable_repr=False, need_to_build_diffs=False, other=object
          ):
      Severity: Minor
      Found in robber/explanation.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 explanation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def explanation(self):
              types = [dict, list, str]
              diffs = ['dict_diffs', 'list_diffs', 'str_diffs']
              more_detail = None
      
      
      Severity: Minor
      Found in robber/matchers/equal.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 dict_diffs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def dict_diffs(self):
              if len(self.actual) != len(self.expected):
                  return 'A and B does not have the same length'
      
              for k in self.actual:
      Severity: Minor
      Found in robber/matchers/equal.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