jeremiah-c-leary/hdl-component-manager

View on GitHub

Showing 7 of 34 total issues

Function main has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def main():
    '''
    Main routine of the HDL Component Manager (HCM) application.
    '''

Severity: Minor
Found in hcm/__main__.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 install_dependencies has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def install_dependencies(oCommandLineArguments, lInstalledDependencies):

    lDependencies = get_dependencies(oCommandLineArguments.component)
    for sDependent in lDependencies:
        if sDependent in lInstalledDependencies:
Severity: Minor
Found in hcm/subcommand/install.py - About 45 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 remove_external has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def remove_external(sComponent):
    lExternals = get_externals('.').split('\n')[:-1]
    lNewExternals = []
    for sExternal in lExternals:
        if sExternal == '':
Severity: Minor
Found in hcm/svn/svn.py - About 45 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 install_component has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def install_component(oCommandLineArguments):
    sUrl = oCommandLineArguments.url
    sComponent = oCommandLineArguments.component
    sVersion = oCommandLineArguments.version
    fForce = oCommandLineArguments.force
Severity: Minor
Found in hcm/subcommand/install.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 update_externals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def update_externals(sUrlPath, sComponent):
    logging.info('Updating externals')
    lExternals = svn.get_externals('.').split('\n')[:-1]
    lFile = []
    fExternalFound = False
Severity: Minor
Found in hcm/subcommand/install.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 sort_component_versions_by_revision_number has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def sort_component_versions_by_revision_number(lVersions, dConfig):

    dRevision_to_version_map = {}
    lRevisions = []
    lReturn = []
Severity: Minor
Found in hcm/utils.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 build_url_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def build_url_path(sUrl, sComponent, sVersion):
    sReturn = sUrl + '/' + sComponent + '/'
    if sVersion is None:
        try:
            sLatestVersion = get_latest_version(sUrl + '/' + sComponent)
Severity: Minor
Found in hcm/utils.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