aureooms/sak

View on GitHub

Showing 271 of 350 total issues

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

def walk(src, d=None, f=print):
    """
        Recursively walks a list of files/directories different
        callback functions depending if the item is a file
        or a directory.
Severity: Minor
Found in lib/dir.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 pretty has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def pretty(d, lo, fr, to):
        r = [] if len(lo) == 0 else ['local[%d]' % len(lo)]
        for key in fr:
            if len(fr[key]) > 0 or len(to[key]) > 0:
                r.append('%s[pull:%d, push:%d]' %
Severity: Minor
Found in sak/git.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 list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def list(target=YOU, name=None, t=None, token=None):

    lib.check.OptionNotInListException(TARGET, target, TARGETS)

    if t is None:
Severity: Minor
Found in lib/github.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 entrypoints has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def entrypoints(cwd, entrypoint):
    # Goes recursive if entrypoint is None
    with os.scandir(cwd) as entries:
        yield from chain.from_iterable(
            map(
Severity: Minor
Found in lib/js.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 FindNextMultiLineCommentStart has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def FindNextMultiLineCommentStart(lines, lineix):
    """Find the beginning marker for a multiline comment."""
    while lineix < len(lines):
        if lines[lineix].strip().startswith('/*'):
            # Only return this marker if the comment goes beyond this line
Severity: Minor
Found in lib/cpplint.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 hash has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def hash(self, root, htree, tree, skip, current=''):

        for t, item in self.ls(current):

            if skip(current, item):
Severity: Minor
Found in lib/nice/ftp.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 FilesBelongToSameModule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def FilesBelongToSameModule(filename_cc, filename_h):
    """Check if these two filenames belong to the same module.

    The concept of a 'module' here is a as follows:
    foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the
Severity: Minor
Found in lib/cpplint.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 IsBlockInNameSpace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def IsBlockInNameSpace(nesting_state, is_forward_declaration):
    """Checks that the new block is directly in a namespace.

    Args:
            nesting_state: The _NestingState object that contains info about our state.
Severity: Minor
Found in lib/cpplint.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 CheckAccess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def CheckAccess(filename, clean_lines, linenum, nesting_state, error):
    """Checks for improper use of DISALLOW* macros.

    Args:
            filename: The name of the current file.
Severity: Minor
Found in lib/cpplint.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 local_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def local_file(online, hash_t, tree_i, tree, dir_list, item, minipath, path):
        base, ext = os.path.splitext(minipath)
        if ext == online:
            if os.path.basename(minipath) in tree:
                return
Severity: Minor
Found in lib/site.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 FindCheckMacro has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def FindCheckMacro(line):
    """Find a replaceable CHECK-like macro.

    Args:
            line: line to search on.
Severity: Minor
Found in lib/cpplint.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