hackedteam/core-linux

View on GitHub

Showing 117 of 141 total issues

Function print_method_prototype has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def print_method_prototype(self, i, m, in_synopsis):
        max_method_len = 0
        if in_synopsis:
            for _m in i.methods:
                max_method_len = max(len(_m.name), max_method_len)

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

    def print_method_prototype(self, i, m, in_synopsis):
        max_method_len = 0
        if in_synopsis:
            for _m in i.methods:
                max_method_len = max(len(_m.name), max_method_len)

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

    def generate(self):
        for i in self.ifaces:
            self.out = file('%s-%s.xml'%(self.docbook, i.name), 'w')
            self.out.write(''%())
            self.out.write('<?xml version="1.0" encoding="utf-8"?>\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 has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def generate(self):
        for i in self.ifaces:
            self.out = file('%s-%s.xml'%(self.docbook, i.name), 'w')
            self.out.write(''%())
            self.out.write('<?xml version="1.0" encoding="utf-8"?>\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_proxy has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_proxy(self, i):
        # class boilerplate
        self.c.write('/* ------------------------------------------------------------------------ */\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 apply_annotations has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def apply_annotations(iface_list, annotation_list):
    # apply annotations given on the command line
    for (what, key, value) in annotation_list:
        pos = what.find('::')
        if pos != -1:

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

def apply_annotations(iface_list, annotation_list):
    # apply annotations given on the command line
    for (what, key, value) in annotation_list:
        pos = what.find('::')
        if pos != -1:

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

    def generate_proxy(self, i):
        # class boilerplate
        self.c.write('/* ------------------------------------------------------------------------ */\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 generate_method_completers has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_method_completers(self, i):
        for m in i.methods:
            unix_fd = False
            if utils.lookup_annotation(m.annotations, 'org.gtk.GDBus.C.UnixFD'):
                unix_fd = 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 post_process has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def post_process(self, interface_prefix, cns, cns_upper, cns_lower, arg_number):
        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 post_process has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def post_process(self, interface_prefix, cns, cns_upper, cns_lower, arg_number):
        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 generate_method_completers has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_method_completers(self, i):
        for m in i.methods:
            unix_fd = False
            if utils.lookup_annotation(m.annotations, 'org.gtk.GDBus.C.UnixFD'):
                unix_fd = 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

File rcs-core.rb has 283 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'net/http'
require 'json'
require 'open-uri'
require 'pp'
require 'cgi'
Severity: Minor
Found in build/script/rcs-core.rb - About 2 hrs to fix

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

        def post_process(self, interface_prefix, c_namespace):
            if len(self.doc_string) == 0:
                self.doc_string = utils.lookup_docs(self.annotations)
            if len(self.doc_string_brief) == 0:
                self.doc_string_brief = utils.lookup_brief_docs(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 post_process has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def post_process(self, interface_prefix, c_namespace):
            if len(self.doc_string) == 0:
                self.doc_string = utils.lookup_docs(self.annotations)
            if len(self.doc_string_brief) == 0:
                self.doc_string_brief = utils.lookup_brief_docs(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 generate_object has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def generate_object(self):
            self.c.write('/* ------------------------------------------------------------------------\n'
                         ' * Code for Object, ObjectProxy and ObjectSkeleton\n'
                         ' * ------------------------------------------------------------------------\n'
                         ' */\n'

      Function generate_object has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def generate_object(self):
              self.c.write('/* ------------------------------------------------------------------------\n'
                           ' * Code for Object, ObjectProxy and ObjectSkeleton\n'
                           ' * ------------------------------------------------------------------------\n'
                           ' */\n'

        Function generate_skeleton has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def generate_skeleton(self, i):
                # class boilerplate
                self.c.write('/* ------------------------------------------------------------------------ */\n'
                             '\n')
        
        

          Function generate_skeleton has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def generate_skeleton(self, i):
                  # class boilerplate
                  self.c.write('/* ------------------------------------------------------------------------ */\n'
                               '\n')
          
          

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

                def next (self):
                    # Ensure we have enough frames for a full signal emission
                    self.fill()
            
                    # Are we at the end?
            Severity: Minor
            Found in core/multilib/i386/usr/share/glib-2.0/gdb/gobject.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