hackedteam/core-linux

View on GitHub

Showing 117 of 141 total issues

Function camel_case_to_uscore has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def camel_case_to_uscore(s):
    ret = ''
    insert_uscore = False
    prev_was_lower = False
    initial = True;

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

def camel_case_to_uscore(s):
    ret = ''
    insert_uscore = False
    prev_was_lower = False
    initial = True;

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

Method retrieve_factory has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def retrieve_factory(ident, show, jsonfile)
    raise("you must specify a factory") if ident.nil?

    resp = @http.request_get('/factory', {'Cookie' => @cookie})
    resp.kind_of? Net::HTTPSuccess or raise(resp.body)
Severity: Minor
Found in build/script/rcs-core.rb - About 1 hr to fix

    Function generate_args has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def generate_args(self, prefix, args):
            for a in args:
                num_anno = self.generate_annotations('%s_arg_%s_annotation_info'%(prefix, a.name), a.annotations)
    
                self.c.write('static const _ExtendedGDBusArgInfo %s_%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

    Function generate_args has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def generate_args(self, prefix, args):
            for a in args:
                num_anno = self.generate_annotations('%s_arg_%s_annotation_info'%(prefix, a.name), a.annotations)
    
                self.c.write('static const _ExtendedGDBusArgInfo %s_%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

    Function apply_annotation has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def apply_annotation(iface_list, iface, method, signal, prop, arg, key, value):

      Function apply_annotation has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def apply_annotation(iface_list, iface, method, signal, prop, arg, key, value):

        Function post_process has a Cognitive Complexity of 9 (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

        Method build has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def build(param_file)
            jcontent = File.open(param_file, 'r') {|f| f.read}
            params = JSON.parse(jcontent)
        
            raise("factory not found") if factory.nil?
        Severity: Minor
        Found in build/script/rcs-core.rb - 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 generate_object has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def generate_object(self):
                self.c.write('/* ------------------------------------------------------------------------\n'
                             ' * Code for Object, ObjectProxy and ObjectSkeleton\n'
                             ' * ------------------------------------------------------------------------\n'
                             ' */\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

        Function is_g_type_instance has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def is_g_type_instance (val):
            def is_g_type_instance_helper (type):
                if str(type) == "GTypeInstance":
                    return True
        
        
        Severity: Minor
        Found in core/multilib/i386/usr/share/glib-2.0/gdb/gobject.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 generate_object has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def generate_object(self):
                self.c.write('/* ------------------------------------------------------------------------\n'
                             ' * Code for Object, ObjectProxy and ObjectSkeleton\n'
                             ' * ------------------------------------------------------------------------\n'
                             ' */\n'
        Severity: Minor
        Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/codegen.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 post_process has a Cognitive Complexity of 9 (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 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 is_g_type_instance has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def is_g_type_instance (val):
            def is_g_type_instance_helper (type):
                if str(type) == "GTypeInstance":
                    return True
        
        
        Severity: Minor
        Found in core/multilib/x86_64/usr/share/glib-2.0/gdb/gobject.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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, ifaces, namespace, interface_prefix, generate_objmanager, docbook_gen, h, c):

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

              def __init__(self, ifaces, namespace, interface_prefix, generate_objmanager, docbook_gen, h, c):
          Severity: Major
          Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/codegen.py - About 50 mins to fix

            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

              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

              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