portfoliome/foil

View on GitHub

Showing 7 of 7 total issues

Function json_decoder_hook has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def json_decoder_hook(dct, str_decoders=STRING_DECODERS,
                      converters=MappingProxyType(dict())) -> dict:
    """Decoder for parsing typical objects like uuid's and dates."""

    for k, v in dct.items():
Severity: Minor
Found in foil/deserializers.py - About 1 hr 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 from_zipfile has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def from_zipfile(cls, path, filename, encoding, dialect, fields,
Severity: Major
Found in foil/fileio.py - About 50 mins to fix

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

        def from_file(cls, path, encoding, dialect, fields, converters, field_index):
    Severity: Minor
    Found in foil/fileio.py - About 45 mins to fix

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

          def from_zipfile(cls, path, filename, encoding, dialect, fields, converters):
      Severity: Minor
      Found in foil/fileio.py - About 45 mins to fix

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

            def from_file(cls, path, encoding, dialect, fields, converters):
        Severity: Minor
        Found in foil/fileio.py - About 35 mins to fix

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

              def __init__(self, stream, dialect: csv.Dialect, fields: list,
          Severity: Minor
          Found in foil/fileio.py - About 35 mins to fix

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

            def ftp_walk(ftpconn: FTP, rootpath=''):
                """Recursively traverse an ftp directory to discovery directory listing."""
            
                current_directory = rootpath
            
            
            Severity: Minor
            Found in foil/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

            Severity
            Category
            Status
            Source
            Language