suoto/hdl_checker

View on GitHub

Showing 96 of 152 total issues

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

    def getLibrariesReferredByUnit(self, name):
        # type: (Identifier) -> List[Identifier]
        """
        Gets libraries that the (library, name) pair is used throughout the
        project
Severity: Minor
Found in hdl_checker/database.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 get_cmdclass has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def get_cmdclass():
    """Get the custom setuptools/distutils subclasses used by Versioneer."""
    if "versioneer" in sys.modules:
        del sys.modules["versioneer"]
        # this fixes the "python setup.py develop" case (also 'install' and
Severity: Minor
Found in versioneer.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 render_pep440 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def render_pep440(pieces):
    """Build up version string, with post-release "local version identifier".

    Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
    get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty
Severity: Minor
Found in hdl_checker/_version.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 _getCommentTags has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _getCommentTags(lines):
    """
    Generates diags from 'TODO', 'FIXME' and 'XXX' tags
    """
    result = []
Severity: Minor
Found in hdl_checker/static_check.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 __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(  # pylint: disable=too-many-arguments
Severity: Major
Found in hdl_checker/diagnostics.py - About 1 hr to fix

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

    def render_pep440_post(pieces):
        """TAG[.postDISTANCE[.dev0]+gHEX] .
    
        The ".dev0" means dirty. Note that .dev0 sorts backwards
        (a dirty tree will appear "older" than the corresponding clean one),
    Severity: Minor
    Found in versioneer.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 _getBuilderMessages has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def _getBuilderMessages(self, path):
            # type: (Path) -> Iterable[CheckerDiagnostic]
            """
            Builds the given path taking care of recursively building its
            dependencies first
    Severity: Minor
    Found in hdl_checker/core.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 _getServerByProjectFile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def _getServerByProjectFile(project_file):
        # type: (Optional[str]) -> Server
        """
        Returns the Server object that corresponds to the given project file. If
        the object doesn't exists yet it gets created and then returned
    Severity: Minor
    Found in hdl_checker/handlers.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 render_pep440_post has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def render_pep440_post(pieces):
        """TAG[.postDISTANCE[.dev0]+gHEX] .
    
        The ".dev0" means dirty. Note that .dev0 sorts backwards
        (a dirty tree will appear "older" than the corresponding clean one),
    Severity: Minor
    Found in hdl_checker/_version.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 _getUnusedObjects has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def _getUnusedObjects(lines, objects):
        """Generator that yields objects that are only found once at the
        given buffer and thus are considered unused (i.e., we only found
        its declaration"""
    
    
    Severity: Minor
    Found in hdl_checker/static_check.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 render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def render(pieces, style):
        """Render the given version pieces into the requested style."""
        if pieces["error"]:
            return {"version": "unknown",
                    "full-revisionid": pieces.get("long"),
    Severity: Minor
    Found in versioneer.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 getPathsDefining has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def getPathsDefining(self, name, library=None):
            # type: (Identifier, UnresolvedLibrary) -> Iterable[Path]
            """
            Search for paths that define a given name optionally inside a library.
            """
    Severity: Minor
    Found in hdl_checker/database.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 render_pep440_old has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def render_pep440_old(pieces):
        """TAG[.postDISTANCE[.dev0]] .
    
        The ".dev0" means dirty.
    
    
    Severity: Minor
    Found in versioneer.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 debounce has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def debounce(interval_s, keyed_by=None):
        """Debounce calls to this function until interval_s seconds have passed."""
    
        def wrapper(func):
            timers = {}
    Severity: Minor
    Found in hdl_checker/utils.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 _parseBuiltinLibraries has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def _parseBuiltinLibraries(self):
            # type: (...) -> Any
            """
            Discovers libraries that exist regardless before we do anything
            """
    Severity: Minor
    Found in hdl_checker/builders/ghdl.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 render_pep440_old has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def render_pep440_old(pieces):
        """TAG[.postDISTANCE[.dev0]] .
    
        The ".dev0" means dirty.
    
    
    Severity: Minor
    Found in hdl_checker/_version.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 _getDependencies has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def _getDependencies(self):  # type: () -> Generator[RequiredDesignUnit, None, None]
            library_names = {x.lower() for x in self.getLibraries()}
            library_names.add("work")
    
            dependencies = _PartialDependency()
    Severity: Minor
    Found in hdl_checker/parsers/vhdl_parser.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 generate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def generate(self):
            """
            Runs the child class algorithm to populate the parent object with the
            project info and writes the result to the project file
            """
    Severity: Minor
    Found in hdl_checker/config_generators/base_generator.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 parseArguments has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def parseArguments():
        "Argument parser for standalone hdl_checker"
    
        parser = argparse.ArgumentParser()
    
    
    Severity: Minor
    Found in hdl_checker/server.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 builtin_libraries has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def builtin_libraries(self):
            # type: (...) -> FrozenSet[Identifier]
            """
            Return a list of precompiled libraries this builder is aware of
            """
    Severity: Minor
    Found in hdl_checker/builders/base_builder.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

    Severity
    Category
    Status
    Source
    Language