suoto/hdl_checker

View on GitHub

Showing 96 of 152 total issues

File versioneer.py has 1297 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Version: 0.16

"""The Versioneer - like a rocketeer, but for versions.

The Versioneer
Severity: Major
Found in versioneer.py - About 3 days to fix

    File database.py has 643 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: Major
    Found in hdl_checker/database.py - About 1 day to fix

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

        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

          File _version.py has 352 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # This file helps to compute a version number in source trees obtained from
          # git-archive tarball (such as those provided by githubs download-from-tag
          # feature). Distribution tarballs (built by setup.py sdist) and build
          # directories (produced by setup.py build) will contain a much shorter file
          # that just contains the computed version number.
          Severity: Minor
          Found in hdl_checker/_version.py - About 4 hrs to fix

            File base_builder.py has 342 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/base_builder.py - About 4 hrs to fix

              Function _findObjects has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

              def _findObjects(lines):
                  """
                  Returns an iterator with the object name and a dict with info about its
                  location
                  """
              Severity: Minor
              Found in hdl_checker/static_check.py - About 3 hrs 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

              File utils.py has 329 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/utils.py - About 3 hrs to fix

                Database has 31 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Database(HashableByKey):  # pylint: disable=too-many-instance-attributes
                    "Stores info on and provides operations for a project file set"
                
                    def __init__(self):  # type: () -> None
                        self._lock = RLock()
                Severity: Minor
                Found in hdl_checker/database.py - About 3 hrs to fix

                  File diagnostics.py has 321 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/diagnostics.py - About 3 hrs to fix

                    BaseBuilder has 26 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class BaseBuilder(object):  # pylint: disable=useless-object-inheritance
                        """
                        Class that implements the base builder flow
                        """
                    
                    
                    Severity: Minor
                    Found in hdl_checker/builders/base_builder.py - About 3 hrs to fix

                      Function do_setup has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def do_setup():
                          """Main VCS-independent setup function for installing Versioneer."""
                          root = get_root()
                          try:
                              cfg = get_config_from_root(root)
                      Severity: Minor
                      Found in versioneer.py - About 2 hrs 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

                      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 get_versions has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def get_versions(verbose=False):
                            """Get the project version from whatever source is available.
                        
                            Returns dict with two keys: 'version' and 'full'.
                            """
                        Severity: Minor
                        Found in versioneer.py - About 2 hrs 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 run_command has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
                            """Call the given command(s)."""
                            assert isinstance(commands, list)
                            p = None
                            for c in commands:
                        Severity: Minor
                        Found in hdl_checker/_version.py - About 2 hrs 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 run_command has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
                            """Call the given command(s)."""
                            assert isinstance(commands, list)
                            p = None
                            for c in commands:
                        Severity: Minor
                        Found in versioneer.py - About 2 hrs 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 _getBuildSequence has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _getBuildSequence(self, path, builtin_libraries):
                                # type: (Path, FrozenSet[Identifier]) -> Iterable[Tuple[Identifier, Path]]
                                """
                                Gets the build sequence that satisfies the preconditions to compile the
                                given path
                        Severity: Minor
                        Found in hdl_checker/database.py - About 2 hrs 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 _getRebuilds has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _getRebuilds(self, path, line, library):
                                # type: (Path, str, Identifier) -> Set[RebuildInfo]
                                """
                                Gets info on what should be rebuilt to satisfy the builder
                                """
                        Severity: Minor
                        Found in hdl_checker/builders/base_builder.py - About 2 hrs 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

                        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 git_pieces_from_vcs has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
                              """Get version from 'git describe' in the root of the source tree.
                          
                              This only gets called if the git-archive 'subst' keywords were *not*
                              expanded, and _version.py hasn't already been rewritten with a short
                          Severity: Minor
                          Found in hdl_checker/_version.py - About 2 hrs 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