Showing 28 of 28 total issues

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

def find_package_data(where='.', package='',
Severity: Minor
Found in setup.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if not package:
                            new_package = name
                        else:
                            new_package = package + '.' + name
                        stack.append((fn, '', new_package, False))
    Severity: Major
    Found in setup.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if (fnmatchcase(name, pattern)
                              or fn.lower() == pattern.lower()):
                              bad_name = True
                              if show_ignored:
                                  sys.stderr.write(
      Severity: Major
      Found in setup.py - About 45 mins to fix

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

            def readlines(self, n=None, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True,
                          opener=None, breaklines=True):
                if n is not None and not isinstance(n, int):
                    mode = n
                    n = 0
        Severity: Minor
        Found in os3/fs/file.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 get_terminal_size has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def get_terminal_size():
            # http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python
            import os
            env = os.environ
            def ioctl_GWINSZ(fd):
        Severity: Minor
        Found in os3/utils/console.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 set_cache_tree has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def set_cache_tree(tree):
            tree = list(tree)
            process_by_pid = {process.pid:process for process in tree}
            for process in tree:
                process._parent = None
        Severity: Minor
        Found in os3/ps/processes.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 bak has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def bak(self):
                if not self.lexists():
                    return self
                i = -1
                bak_name = self.path + '.bak'
        Severity: Minor
        Found in os3/fs/entry.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 check_filters has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def check_filters(self, *args, **kwargs):
                for fn_filter in args:
                    if not fn_filter(self):
                        return False
                for name, value in kwargs.items():
        Severity: Minor
        Found in os3/core/item.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