suoto/hdl_checker

View on GitHub
hdl_checker/core.py

Summary

Maintainability
D
1 day
Test Coverage

File core.py has 453 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/core.py - About 6 hrs to fix

    HdlCheckerCore has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class HdlCheckerCore:
        """
        HDL Checker project builder class
        """
    
    
    Severity: Minor
    Found in hdl_checker/core.py - About 2 hrs to fix

      Function getMessagesByPath has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def getMessagesByPath(self, path):
              # type: (Path) -> Iterable[CheckerDiagnostic]
              """
              Returns the messages for the given path, including messages
              from the configured builder (if available) and static checks
      Severity: Minor
      Found in hdl_checker/core.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 _handleRebuilds has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def _handleRebuilds(self, rebuilds):
              # type: (Iterable[RebuildInfo]) -> None
              """
              Resolves hints found in the rebuild list into path objects
              and rebuild them
      Severity: Minor
      Found in hdl_checker/core.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 _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 configure has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def configure(self, config):
              # type: (Dict[Any, Any]) -> None
              "Updates configuration from a dictionary"
      
              _logger.debug("Updating with base config:\n%s", pformat(config))
      Severity: Minor
      Found in hdl_checker/core.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

      There are no issues that match your filters.

      Category
      Status