hackedteam/core-linux

View on GitHub

Showing 141 of 141 total issues

Avoid deeply nested control flow statements.
Open

                        if not in_para:
                            body += '<para>'
                            in_para = True
                        body += orig_line + '\n'

    Function post_process has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def post_process(self, interface_prefix, cns, cns_upper, cns_lower):
            if len(self.doc_string) == 0:
                self.doc_string = utils.lookup_docs(self.annotations)
            if len(self.since) == 0:
                self.since = utils.lookup_since(self.annotations)

    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 deeply nested control flow statements.
    Open

                            if len(rest_of_line) > 0:
                                body += '<para>' + rest_of_line + '</para>'
                            comment_state = DBusXMLParser.COMMENT_STATE_PARAMS
    Severity: Major
    Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/parser.py - About 45 mins to fix

      Function next has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

              def next(self):
                  if self.ht == 0:
                      raise StopIteration
                  if self.value != None:
                      v = self.value
      Severity: Minor
      Found in core/multilib/x86_64/usr/share/glib-2.0/gdb/glib.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

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

          def post_process(self, interface_prefix, cns, cns_upper, cns_lower, arg_number):

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

            def post_process(self, interface_prefix, cns, cns_upper, cns_lower, arg_number):
        Severity: Minor
        Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/dbustypes.py - About 35 mins to fix

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

          def g_type_to_name (gtype):
              def lookup_fundamental_type (typenode):
                  if typenode == 0:
                      return None
                  val = read_global_var ("static_fundamental_type_nodes")
          Severity: Minor
          Found in core/multilib/i386/usr/share/glib-2.0/gdb/gobject.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 generate_expand_dicts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def generate_expand_dicts(self):
                  self.expand_member_dict = {}
                  self.expand_iface_dict = {}
                  for i in self.ifaces:
                      key = '#%s'%(i.name)

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

              def generate_signal_emitters(self, i):
                  for s in i.signals:
                      self.c.write(self.docbook_gen.expand(
                              '/**\n'
                              ' * %s_emit_%s:\n'
          Severity: Minor
          Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/codegen.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 g_type_to_name has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def g_type_to_name (gtype):
              def lookup_fundamental_type (typenode):
                  if typenode == 0:
                      return None
                  val = read_global_var ("static_fundamental_type_nodes")
          Severity: Minor
          Found in core/multilib/x86_64/usr/share/glib-2.0/gdb/gobject.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 generate_expand_dicts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def generate_expand_dicts(self):
                  self.expand_member_dict = {}
                  self.expand_iface_dict = {}
                  for i in self.ifaces:
                      key = '#%s'%(i.name)

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

              def generate_signal_emitters(self, i):
                  for s in i.signals:
                      self.c.write(self.docbook_gen.expand(
                              '/**\n'
                              ' * %s_emit_%s:\n'

          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 None
          Severity: Major
          Found in core/multilib/x86_64/usr/share/glib-2.0/gdb/glib.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return GListPrinter(val, "GSList")
            Severity: Major
            Found in core/multilib/x86_64/usr/share/glib-2.0/gdb/glib.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return None
              Severity: Major
              Found in core/multilib/i386/usr/share/glib-2.0/gdb/glib.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return GListPrinter(val, "GSList")
                Severity: Major
                Found in core/multilib/i386/usr/share/glib-2.0/gdb/glib.py - About 30 mins to fix

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

                  def lookup_annotation(annotations, key):
                      if annotations:
                          for a in annotations:
                              if a.key == key:
                                  return a.value
                  Severity: Minor
                  Found in core/multilib/x86_64/usr/lib/x86_64-linux-gnu/gdbus-2.0/codegen/utils.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 lookup_annotation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def lookup_annotation(annotations, key):
                      if annotations:
                          for a in annotations:
                              if a.key == key:
                                  return a.value
                  Severity: Minor
                  Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/utils.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 read_object has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def read_object (self, frame, name, array = None):
                          try:
                              v = frame.read_var (name)
                              if v == None or v.is_optimized_out:
                                  return None
                  Severity: Minor
                  Found in core/multilib/i386/usr/share/glib-2.0/gdb/gobject.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 read_object has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def read_object (self, frame, name, array = None):
                          try:
                              v = frame.read_var (name)
                              if v == None or v.is_optimized_out:
                                  return None
                  Severity: Minor
                  Found in core/multilib/x86_64/usr/share/glib-2.0/gdb/gobject.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