andry81/tacklelib

View on GitHub

Showing 45 of 64 total issues

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

  def expand(self, search_in_expand_dict_at_second = None, search_by_pred_at_third = None, ignore_types = None, list_as_cmdline = False, update = False):
Severity: Minor
Found in python/tacklelib/tacklelib.yaml.py - About 35 mins to fix

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

      def pop_unexpanded_vars(self, reexpand_vars, remove_pred = None, list_as_cmdline = False):
        if len(self.unexpanded_stack) == 0:
          raise Exception('unexpanded_stack is empty to pop')
        last_stack_record = self.unexpanded_stack[-1]
        self.unexpanded_vars = last_stack_record[0]
    Severity: Minor
    Found in python/tacklelib/tacklelib.yaml.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 __delitem__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def __delitem__(self, key):
            ekey = self._encode_key(key)
            filename = self._key_to_filename(ekey)
            if not self._sync:
                try:
    Severity: Minor
    Found in python_patches/fcache/cache.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 _rename has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def _rename(src, dst):
                if not isinstance(src, unicode):
                    src = unicode(src, sys.getfilesystemencoding())
                if not isinstance(dst, unicode):
                    dst = unicode(dst, sys.getfilesystemencoding())
    Severity: Minor
    Found in python_patches/fcache/posixemulation.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 pop_expanded_vars has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def pop_expanded_vars(self, remove_pred = None):
        if len(self.expanded_stack) == 0:
          raise Exception('expanded_stack is empty to pop')
        last_stack_record = self.expanded_stack[-1]
        self.expanded_vars = last_stack_record[0]
    Severity: Minor
    Found in python/tacklelib/tacklelib.yaml.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