ayemos/akagi

View on GitHub

Showing 7 of 63 total issues

Function _pgpass has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _pgpass(self):
        if self.__pgpass is None:
            self.__pgpass = {
                'db_host': '',
                'db_port': '',
Severity: Minor
Found in akagi/data_sources/redshift_data_source.py - About 55 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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, bucket_name, prefix=None, keys=None, file_format='binary', no_cache=False):
Severity: Minor
Found in akagi/data_sources/s3_data_source.py - About 35 mins to fix

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

        def next(self):
            try:
                return next(self._iterator)
            except StopIteration as e:
                raise e
    Severity: Minor
    Found in akagi/iterators/spreadsheet_iterator.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 _credential_string has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def _credential_string(self):
            credentials = []
    
            if self._credential is not None:
                if self._credential.access_key:
    Severity: Minor
    Found in akagi/data_sources/redshift_data_source.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 next has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def next(self):
            try:
                return next(self._iterator)
            except StopIteration as e:
                raise e
    Severity: Minor
    Found in akagi/iterators/csv_iterator.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 _save_data_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def _save_data_file(self, data_file):
            path = os.path.join(self._local_cache_dir, data_file.key)
            dirname = os.path.dirname(path)
    
            if not os.path.isdir(dirname):
    Severity: Minor
    Found in akagi/data_source.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 _cache_content has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def _cache_content(self):
            '''Cache its content and return its path on local file system.'''
    
            dirname = os.path.dirname(self.path)
    
    
    Severity: Minor
    Found in akagi/data_file.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