suoto/hdl_checker

View on GitHub
hdl_checker/builders/msim.py

Summary

Maintainability
B
4 hrs
Test Coverage

File msim.py has 259 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# This file is part of HDL Checker.
#
# Copyright (c) 2015 - 2019 suoto (Andre Souto)
#
# HDL Checker is free software: you can redistribute it and/or modify
Severity: Minor
Found in hdl_checker/builders/msim.py - About 2 hrs to fix

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

        def _makeRecords(self, line):
            # type: (str) -> Iterable[BuilderDiag]
            for match in self._stdout_message_scanner(line):  # type: ignore
                info = match.groupdict()
    
    
    Severity: Minor
    Found in hdl_checker/builders/msim.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 _searchForRebuilds has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def _searchForRebuilds(self, path, line):
            # type: (Path, str) -> Iterable[Mapping[str, str]]
            if line.startswith("** Warning: ") and "Waiting for lock by" in line:
                yield {"rebuild_path": path.abspath}
            for match in MSim._iter_rebuild_units(line):
    Severity: Minor
    Found in hdl_checker/builders/msim.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

    There are no issues that match your filters.

    Category
    Status