hackedteam/fuzzer-windows

View on GitHub

Showing 56 of 193 total issues

Function shortName has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def shortName(font):

    for record in font['name'].names:
        if record.nameID == FONT_SPECIFIER_NAME_ID and not name:
            if '\000' in record.string:
Severity: Minor
Found in fontfuzzer/fuzzers/native.py - About 1 hr 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 bp_set_hw has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def bp_set_hw(self, address, length, condition):
        
        # Check for a valid length value
        if length not in (1, 2, 4):
            return False
Severity: Minor
Found in ie_sandbox/grayhat/my_debugger.py - About 1 hr 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 generateTestCases has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def generateTestCases(fontSourceDir, dbConnection):
    fonts = {}
    testcasesFolder = 'testcases'

    print '[D] Generating testcases: ', os.path.abspath( fontSourceDir )
Severity: Minor
Found in fontfuzzer/fuzzers/native_ben.py - About 1 hr 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 generateTestCases has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def generateTestCases(fontSourceDir, dbConnection):
    fonts = {}
    testcasesFolder = 'testcases'

    print '[D] Generating testcases: ', os.path.abspath( fontSourceDir )
Severity: Minor
Found in fontfuzzer/fuzzers/native_glyf.py - About 1 hr 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 rebuildFont has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def rebuildFont(self, tag, newTagTable, originalFontBuffer):


        assert len(originalFontBuffer) % 4 == 0, 'File must be 4 byte aligned'
        assert len(newTagTable) % 4 == 0, 'New table must be 4 byte aligned'
Severity: Minor
Found in fontfuzzer/parsers/TTF.py - About 1 hr 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 get has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def get(self, uri):

        uriFields = uri.split('/')
        
        # server queries agent capabilities
Severity: Minor
Found in fontfuzzer/hostagent.py - About 1 hr 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 get has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def get(self, uri):

        uriFields = uri.split('/')

        # path of folder containing fonts 
Severity: Minor
Found in fontfuzzer/serveragent.py - About 1 hr 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 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def post(self, uri):


        uriFields = uri.split('/')
        
Severity: Minor
Found in fontfuzzer/serveragent.py - About 1 hr 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 generateTestCases has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def generateTestCases(fontSourceDir, dbConnection):
    fonts = {}
    testcasesFolder = 'testcases'

    print '[D] ', os.path.abspath( fontSourceDir )
Severity: Minor
Found in fontfuzzer/fuzzers/native.py - About 1 hr 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 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def __init__(self, filename, simpleParsing = False):
        font_handle = open(filename,'rb')
        self.filename = filename
        self.fontOffsetTable = FontOffsetTable(font_handle)
        self.fontOffsetTableLength = font_handle.tell()
Severity: Minor
Found in fontfuzzer/parsers/TTF.py - About 1 hr to fix

    Function __init__ has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __init__(self, handle):
    
            self.version = unpack('>H', handle.read(2) )[0]
            self.xAvgCharWidth = unpack('>h', handle.read(2) )[0]
            self.usWeightClass = unpack('>H', handle.read(2) )[0]
    Severity: Minor
    Found in fontfuzzer/parsers/TTF.py - About 1 hr to fix

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

          def get(self, uri):
              
              uriFields = uri.split('/')
      
              if uri == '':
      Severity: Minor
      Found in fontfuzzer/serveragent.py - About 1 hr 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 handler_breakpoint has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def handler_breakpoint(pydbg):
          f = open("iface_log", "a")
      
          # ignore the first windows driven breakpoint.
          if pydbg.first_breakpoint:
      Severity: Minor
      Found in ie_sandbox/broker_trace/ieuser_tracer.py - About 1 hr 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

      Consider simplifying this complex logical expression.
      Open

              if uriFields[0] == 'agents' and len(uriFields) == 3 and uriFields[2] != 'capabilities' \
                                                                  and uriFields[2] != 'jobs': #FIXME: awful, change negative check
      
                  # FIXME: nicer way to get localhost public ip
                  try:
      Severity: Major
      Found in fontfuzzer/serveragent.py - About 1 hr to fix

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

            def get(self, uri):
        
                uriFields = uri.split('/')
        
                # print the list of connected agents and let the user connect a new agent
        Severity: Minor
        Found in fontfuzzer/serveragent.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 get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def get(self, uri):
                
                uriFields = uri.split('/')
                 
                if uri == '':
        Severity: Minor
        Found in fontfuzzer/hostagent.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 get_debug_event has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_debug_event(self):
                
                debug_event    = DEBUG_EVENT()
                continue_status = DBG_CONTINUE
                
        Severity: Minor
        Found in ie_sandbox/grayhat/my_debugger.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 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def post(self, uri):
        
                uriFields = uri.split('/')
                      
                # extract from json array the list of nodes
        Severity: Minor
        Found in fontfuzzer/serveragent.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 jmp_handler has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def jmp_handler(emu, mnemonic, eip, op1, op2, op3):
        Severity: Minor
        Found in ie_sandbox/grayhat/upx_unpacker.py - About 45 mins to fix

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

                  def __init__(self, handle):
          
                      self.count          = unpack('>H', handle.read(2))[0]
                      #print 'Count {}'.format(self.count)
          
          
          Severity: Minor
          Found in fontfuzzer/parsers/TTF.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

          Severity
          Category
          Status
          Source
          Language