hackedteam/core-linux

View on GitHub

Showing 117 of 141 total issues

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

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

    def write_gtkdoc_deprecated_and_since_and_close(self, obj, f, indent):
        if len(obj.since) > 0:
            f.write('%*s *\n'
                    '%*s * Since: %s\n'
                    %(indent, '', indent, '', obj.since))
Severity: Minor
Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/codegen.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

Avoid deeply nested control flow statements.
Open

                    if pos != -1:
                        arg = what[pos + 1:]
                        pos = arg.find(']')
                        arg = arg[0:pos]
                        apply_annotation(iface_list, iface, method, None, None, arg, key, value)

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

        def parse_args (self, arg):
            i = arg.find(" ")
            if i <= 0:
                raise Exception ("No var specified")
            var = arg[:i]
    Severity: Minor
    Found in core/multilib/i386/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

    Avoid deeply nested control flow statements.
    Open

                            if not in_para:
                                body += '<para>'
                                in_para = True
                            body += orig_line + '\n'
    Severity: Major
    Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/parser.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if line.endswith(':'):
                                  symbol = line[0:len(line)-1]
                                  comment_state = DBusXMLParser.COMMENT_STATE_PARAMS
                              else:
                                  comment_state = DBusXMLParser.COMMENT_STATE_SKIP

        Avoid deeply nested control flow statements.
        Open

                            if pos != -1:
                                arg = what[pos + 1:]
                                pos = arg.find(']')
                                arg = arg[0:pos]
                                apply_annotation(iface_list, iface, method, None, None, arg, key, value)

          Avoid deeply nested control flow statements.
          Open

                                  if p.deprecated:
                                      self.h.write('G_GNUC_DEPRECATED ')
                                  self.h.write('%s%s_dup_%s (%s *object);\n'%(p.arg.ctype_in_dup, i.name_lower, p.name_lower, i.camel_name))

            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 line.endswith(':'):
                                        symbol = line[0:len(line)-1]
                                        comment_state = DBusXMLParser.COMMENT_STATE_PARAMS
                                    else:
                                        comment_state = DBusXMLParser.COMMENT_STATE_SKIP
            Severity: Major
            Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/parser.py - About 45 mins to fix

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

                  def parse_args (self, arg):
                      i = arg.find(" ")
                      if i <= 0:
                          raise Exception ("No var specified")
                      var = arg[:i]
              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

              Avoid deeply nested control flow statements.
              Open

                                      if p.deprecated:
                                          self.h.write('G_GNUC_DEPRECATED ')
                                      self.h.write('%s%s_dup_%s (%s *object);\n'%(p.arg.ctype_in_dup, i.name_lower, p.name_lower, i.camel_name))
              Severity: Major
              Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/codegen.py - About 45 mins to fix

                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)
                Severity: Minor
                Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/dbustypes.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

                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

                  Avoid deeply nested control flow statements.
                  Open

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

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

                    def strip_dots(s):
                        ret = ''
                        force_upper = False
                        for c in s:
                            if c == '.':
                    Severity: Minor
                    Found in core/multilib/x86_64/usr/lib/x86_64-linux-gnu/gdbus-2.0/codegen/utils.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 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)
                    Severity: Minor
                    Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/dbustypes.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 strip_dots has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def strip_dots(s):
                        ret = ''
                        force_upper = False
                        for c in s:
                            if c == '.':
                    Severity: Minor
                    Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/utils.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 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

                    Avoid deeply nested control flow statements.
                    Open

                                            if not in_para:
                                                body += '<para>'
                                                in_para = True
                                            body += orig_line + '\n'
                    Severity: Major
                    Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/parser.py - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language