hackedteam/fuzzer-windows

View on GitHub

Showing 56 of 193 total issues

File TTF.py has 1411 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import os
import sys
import math
import mmap
import random
Severity: Major
Found in fontfuzzer/parsers/TTF.py - About 3 days to fix

    Function __init__ has a Cognitive Complexity of 41 (exceeds 5 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 6 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 hostagent.py has 391 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python
    
    import os
    import imp
    import sys
    Severity: Minor
    Found in fontfuzzer/hostagent.py - About 5 hrs to fix

      File native_glyf.py has 334 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/bin/env python
      
      # awful
      import sys
      sys.path.append('../')
      Severity: Minor
      Found in fontfuzzer/fuzzers/native_glyf.py - About 4 hrs to fix

        File native_ben.py has 305 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #!/usr/bin/env python
        
        # awful
        import sys
        sys.path.append('../')
        Severity: Minor
        Found in fontfuzzer/fuzzers/native_ben.py - About 3 hrs to fix

          File windows_h.py has 299 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # generated by 'xml2py'
          
          #
          # $Id: windows_h.py 194 2007-04-05 15:31:53Z cameron $
          #
          Severity: Minor
          Found in ie_sandbox/broker_trace/windows_h.py - About 3 hrs to fix

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

                    def __init__(self, handle, header):
            
                        self.bytecodeStartFileOffset = None
                        self.bytecodeEndFileOffset   = None 
            
            
            Severity: Minor
            Found in fontfuzzer/parsers/TTF.py - About 3 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 native.py has 294 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            #!/usr/bin/env python
            
            # awful
            import sys
            sys.path.append('../')
            Severity: Minor
            Found in fontfuzzer/fuzzers/native.py - About 3 hrs to fix

              Function fuzzBufferBenFuzz has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

                  def fuzzBufferBenFuzz(buf, fuzzFactor2):
                      buf = list(buf)
              
              
                      # a] mutations
              Severity: Minor
              Found in fontfuzzer/parsers/TTF.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

              File broker_calls.py has 283 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              shdocvw_calls = [
              
                  "CShdocvwBroker::QueryInterface(_GUID const &,void * *)",
                  "CInternetShortcutPropertyStore::AddRef(void)",
                  "CShdocvwBroker::Release(void)",
              Severity: Minor
              Found in ie_sandbox/broker_trace/broker_calls.py - About 2 hrs to fix

                Function gen_funcs has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                def gen_funcs():
                
                    for i in iface_dict.keys():
                        print "\n\nFUNCTIONS FOR %s \n\n" %i
                
                Severity: Minor
                Found in ie_sandbox/broker_trace/get_funcs.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

                Function fuzzBytecode has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                    def fuzzBytecode(self, fileInMemory):
                
                        print '[DD] Start fuzz GLYPH'
                
                        if self.glyph.bytecodeStartFileOffset is None or self.glyph.bytecodeEndFileOffset is None:
                Severity: Minor
                Found in fontfuzzer/parsers/TTF.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

                File serveragent.py has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                #!/usr/bin/env python
                
                import os
                import sys
                import time
                Severity: Minor
                Found in fontfuzzer/serveragent.py - About 2 hrs to fix

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

                  def shortName(font):
                      name = "default"
                      family = "default"
                  
                      try:
                  Severity: Minor
                  Found in fontfuzzer/fuzzers/native_ben.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

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

                  def shortName(font):
                  
                      try:
                  
                          for record in font['name'].names:
                  Severity: Minor
                  Found in fontfuzzer/fuzzers/native_glyf.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

                  Function rebuildFont has 51 lines of code (exceeds 25 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: Major
                  Found in fontfuzzer/parsers/TTF.py - About 2 hrs to fix

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

                    def gen_funcs():
                    
                        for i in iface_dict.keys():
                            print "\n\nFUNCTIONS FOR %s \n\n" %i
                    
                    Severity: Minor
                    Found in ie_sandbox/broker_trace/get_funcs2.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 a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                            def __init__(self, handle, header):
                                self.endPtsOfCountour = []
                                for i in range(0, header.numberOfCountours):
                                    self.endPtsOfCountour.append( unpack('>H', handle.read(2))[0] )
                                #    LOGGER.debug('\tend of countours: {}'.format(self.endPtsOfCountour[-1]) )
                    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 shortName has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def shortName(font):
                        name = ""
                        family = ""
                    
                        for record in font['name'].names:
                    Severity: Minor
                    Found in fontfuzzer/fuzzers_downloaded/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 shortNameMine has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def shortNameMine(fontPath):
                    
                    
                        try:
                            font = TTF.TTFont(fontPath, simpleParsing=True)
                    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

                    Severity
                    Category
                    Status
                    Source
                    Language