florath/rmtoo

View on GitHub

Showing 66 of 177 total issues

Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, config, input_handler, commit, object_cache,
Severity: Minor
Found in rmtoo/lib/TopicSet.py - About 35 mins to fix

    Function main_impl has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def main_impl(args, mstdout, mstderr, local_main_func=main_func,
    Severity: Minor
    Found in rmtoo/lib/main/NormalizeDependencies.py - About 35 mins to fix

      Function inc_stats has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def inc_stats(result_vec, start_date, idx, invented_on, today, efe):
      Severity: Minor
      Found in rmtoo/lib/Statistics.py - About 35 mins to fix

        Function main has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def main(args, mstdout, mstderr, main_func=main_impl, exitfun=sys.exit):
        Severity: Minor
        Found in rmtoo/gui1/view_only2.py - About 35 mins to fix

          Function main has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def main(args, mstdout, mstderr, main_func=main_impl, exitfun=sys.exit):
          Severity: Minor
          Found in rmtoo/gui1/view_only.py - About 35 mins to fix

            Function main_impl has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def main_impl(args, mstdout, mstderr, mainfunc=main_func, exitfun=sys.exit):
            Severity: Minor
            Found in rmtoo/lib/RmtooMain.py - About 35 mins to fix

              Function __read_one_element has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __read_one_element(self, fileinfo, input_mods, object_cache,
              Severity: Minor
              Found in rmtoo/lib/RequirementSet.py - About 35 mins to fix

                Function create_from_dict has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def create_from_dict(self, digraph_as_dict, node_gen_func=Node):
                        """Low level creation method, which really does the job of
                        converting a given dictionary to a digraph.
                        """
                        # First run: create all nodes
                Severity: Minor
                Found in rmtoo/lib/digraph/Digraph.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 rewrite has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def rewrite(reqset):
                        """Do a DFS and compute the priority during that way.
                        If there is a node which was already visited, only recompute the
                        subtree, if the new priority is higher.
                        """
                Severity: Minor
                Found in rmtoo/inputs/RDepPriority.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

                Avoid too many return statements within this function.
                Open

                    return True
                Severity: Major
                Found in rmtoo/lib/RmtooMain.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return None
                  Severity: Major
                  Found in rmtoo/gui1/view_only2.py - About 30 mins to fix

                    Function write_analytics_result has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def write_analytics_result(self, mstderr):
                            '''Write out the analytics results.'''
                            for k, val in sorted(self.analytics.items(),
                                                 key=operator.itemgetter(0)):
                                if val[0] < 0:
                    Severity: Minor
                    Found in rmtoo/lib/Requirement.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

                    Function __common_topic_continuum_pre has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def __common_topic_continuum_pre(self, topic_continuum, special):
                            '''Common method used by cmad_ and normal callback.'''
                            tracer.info("Called.")
                            output_config = topic_continuum.get_output_config()
                    
                    
                    Severity: Minor
                    Found in rmtoo/lib/Output.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

                    Function add_values has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def add_values(soptions, name):
                            '''Add all the new command line parameter values.'''
                            if soptions is None:
                                return {}
                    
                    
                    Severity: Minor
                    Found in rmtoo/lib/configuration/CmdLineParams.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

                    Function _add_topic_relation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _add_topic_relation(self, topic_a, topic_b):
                            '''Add the relation between topic_a and topic_b.
                               (Here only one _ is used because this is used by the unit tests.)'''
                            # If not there, add the initial count [0, 0]
                            for topic in [topic_a.name, topic_b.name]:
                    Severity: Minor
                    Found in rmtoo/lib/analytics/TopicCohe.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

                    Function __restrict_to_topics_one_req has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def __restrict_to_topics_one_req(self, restricted_reqs, req):
                            tracer.debug("Restricting requirement [%s]", req.get_id())
                            # Add to the internal map
                            restricted_reqs.add_requirement(req)
                            # Add to the common digraph structure
                    Severity: Minor
                    Found in rmtoo/lib/RequirementSet.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

                    Function connected_components has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def connected_components(digraph):
                        """Compute the connected components of the given digraph"""
                        # This hold the components:
                        #  the lists of the nodes which are in one component
                        components = ConnectedComponents()
                    Severity: Minor
                    Found in rmtoo/lib/digraph/ConnectedComponents.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

                    Function _setup_directories has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _setup_directories(self, cfg):
                            '''Cleans up and unifies the directories.'''
                            all_dirs = {}
                            tracer.debug("Called.")
                            for dir_type in ["requirements", "topics", "constraints", "testcases"]:
                    Severity: Minor
                    Found in rmtoo/lib/vcs/FileInterface.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

                    Function __resolve_depends_on_one_req_impl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def __resolve_depends_on_one_req_impl(self, req):
                            tag_content = req.brmo["Depends on"]
                    
                            # If available, it must not empty
                            if not tag_content.get_content():
                    Severity: Minor
                    Found in rmtoo/lib/RequirementSet.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

                    Function topic_set_post has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def topic_set_post(self, topic_set):
                            '''This is call in the TopicsSet post-phase.'''
                            # pylint: disable=consider-iterating-dictionary
                            for req_id in self.__req2topics.keys():
                                req_a = topic_set.get_topic_set().get_requirement_set().\
                    Severity: Minor
                    Found in rmtoo/lib/analytics/TopicCohe.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