hackedteam/core-linux

View on GitHub

Showing 117 of 141 total issues

File codegen.py has 3092 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- Mode: Python -*-

# GDBus - GLib D-Bus Library
#
# Copyright (C) 2008-2011 Red Hat, Inc.

    File codegen.py has 3092 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- Mode: Python -*-
    
    # GDBus - GLib D-Bus Library
    #
    # Copyright (C) 2008-2011 Red Hat, Inc.

      Function declare_types has a Cognitive Complexity of 176 (exceeds 5 allowed). Consider refactoring.
      Open

          def declare_types(self):
              for i in self.ifaces:
                  self.h.write('\n')
                  self.h.write('/* ------------------------------------------------------------------------ */\n')
                  self.h.write('/* Declarations for %s */\n'%i.name)
      Severity: Minor
      Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/codegen.py - About 3 days 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 declare_types has a Cognitive Complexity of 176 (exceeds 5 allowed). Consider refactoring.
      Open

          def declare_types(self):
              for i in self.ifaces:
                  self.h.write('\n')
                  self.h.write('/* ------------------------------------------------------------------------ */\n')
                  self.h.write('/* Declarations for %s */\n'%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 handle_start_element has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
      Open

          def handle_start_element(self, name, attrs):
              old_state = self.state
              old_cur_object = self._cur_object
              if self.state == DBusXMLParser.STATE_IGNORED:
                  self.state = DBusXMLParser.STATE_IGNORED
      Severity: Minor
      Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/parser.py - About 1 day 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 handle_start_element has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
      Open

          def handle_start_element(self, name, attrs):
              old_state = self.state
              old_cur_object = self._cur_object
              if self.state == DBusXMLParser.STATE_IGNORED:
                  self.state = DBusXMLParser.STATE_IGNORED

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

          def generate_interface(self, i):
              self.c.write('\n')
      
              self.c.write(self.docbook_gen.expand(
                      '/**\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_interface has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
      Open

          def generate_interface(self, i):
              self.c.write('\n')
      
              self.c.write(self.docbook_gen.expand(
                      '/**\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_introspection_for_interface has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
      Open

          def generate_introspection_for_interface(self, i):
                  self.c.write('/* ---- Introspection data for %s ---- */\n'
                               '\n'%(i.name))
      
                  if len(i.methods) > 0:

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

          def generate_introspection_for_interface(self, i):
                  self.c.write('/* ---- Introspection data for %s ---- */\n'
                               '\n'%(i.name))
      
                  if len(i.methods) > 0:

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

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

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

          def handle_comment(self, data):
              comment_state = DBusXMLParser.COMMENT_STATE_BEGIN;
              lines = data.split('\n')
              symbol = ''
              body = ''

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

          def handle_comment(self, data):
              comment_state = DBusXMLParser.COMMENT_STATE_BEGIN;
              lines = data.split('\n')
              symbol = ''
              body = ''
      Severity: Minor
      Found in core/multilib/i386/usr/lib/i386-linux-gnu/gdbus-2.0/codegen/parser.py - About 1 day 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 describe has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          def describe (self, stream, full):
              instances = []
              signals = []
      
              for frame in self.frames:
      Severity: Minor
      Found in core/multilib/i386/usr/share/glib-2.0/gdb/gobject.py - About 5 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

      Function describe has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          def describe (self, stream, full):
              instances = []
              signals = []
      
              for frame in self.frames:
      Severity: Minor
      Found in core/multilib/x86_64/usr/share/glib-2.0/gdb/gobject.py - About 5 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

      File dbustypes.py has 363 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- Mode: Python -*-
      
      # GDBus - GLib D-Bus Library
      #
      # Copyright (C) 2008-2011 Red Hat, Inc.

        File dbustypes.py has 363 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- Mode: Python -*-
        
        # GDBus - GLib D-Bus Library
        #
        # Copyright (C) 2008-2011 Red Hat, Inc.

          Function apply_annotation has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          def apply_annotation(iface_list, iface, method, signal, prop, arg, key, value):
              for i in iface_list:
                  if i.name == iface:
                      iface_obj = i
                      break

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

          def apply_annotation(iface_list, iface, method, signal, prop, arg, key, value):
              for i in iface_list:
                  if i.name == iface:
                      iface_obj = i
                      break

          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