hackedteam/fuzzer-windows

View on GitHub

Showing 193 of 193 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if __name__ == '__main__':


    if len(sys.argv) == 2 and sys.argv[1] == 'setup':
        agentSetup()
Severity: Major
Found in fontfuzzer/hostagent.py and 1 other location - About 3 hrs to fix
fontfuzzer/serveragent.py on lines 476..481

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 72.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if t == 'fpgm':
                LOGGER.debug( '[*] Parsing table fpgm' )
                font_handle.seek(self.fontTableDirectories['fpgm'].offset)
                self.fontTableDirectories['fpgm'].table = FpgmTable(font_handle, self.fontTableDirectories['fpgm'].length)   
Severity: Major
Found in fontfuzzer/parsers/TTF.py and 1 other location - About 3 hrs to fix
fontfuzzer/parsers/TTF.py on lines 206..209

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if t == 'prep':
                LOGGER.debug( '[*] Parsing table prep' )
                font_handle.seek(self.fontTableDirectories['prep'].offset)
                self.fontTableDirectories['prep'].table = PrepTable(font_handle, self.fontTableDirectories['prep'].length)   
Severity: Major
Found in fontfuzzer/parsers/TTF.py and 1 other location - About 3 hrs to fix
fontfuzzer/parsers/TTF.py on lines 231..234

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

        def cleanUp():
            
            print '[*] Cleaning up fuzzed fonts'
            
            old   = 'old_testcases'
        Severity: Major
        Found in fontfuzzer/fuzzers/native_ben.py and 2 other locations - About 2 hrs to fix
        fontfuzzer/fuzzers/native.py on lines 370..381
        fontfuzzer/fuzzers/native_glyf.py on lines 437..448

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 60.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

        def cleanUp():
            
            print '[*] Cleaning up fuzzed fonts'
            
            old   = 'old_testcases'
        Severity: Major
        Found in fontfuzzer/fuzzers/native_glyf.py and 2 other locations - About 2 hrs to fix
        fontfuzzer/fuzzers/native.py on lines 370..381
        fontfuzzer/fuzzers/native_ben.py on lines 390..401

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 60.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

        def cleanUp():
            
            print '[*] Cleaning up fuzzed fonts'
            
            old   = 'old_testcases'
        Severity: Major
        Found in fontfuzzer/fuzzers/native.py and 2 other locations - About 2 hrs to fix
        fontfuzzer/fuzzers/native_ben.py on lines 390..401
        fontfuzzer/fuzzers/native_glyf.py on lines 437..448

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 60.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        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

          Identical blocks of code found in 3 locations. Consider refactoring.
          Open

          def deployMultiProcess(fontPath, queue):
              
              try:
                  charsRendered, charsNotRendered = deploy(fontPath, ttLib.TTFont(fontPath))
                  queue.put(charsRendered)
          Severity: Major
          Found in fontfuzzer/fuzzers/native_glyf.py and 2 other locations - About 2 hrs to fix
          fontfuzzer/fuzzers/native.py on lines 144..151
          fontfuzzer/fuzzers/native_ben.py on lines 150..157

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 57.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 3 locations. Consider refactoring.
          Open

          def deployMultiProcess(fontPath, queue):
              
              try:
                  charsRendered, charsNotRendered = deploy(fontPath, ttLib.TTFont(fontPath))
                  queue.put(charsRendered)
          Severity: Major
          Found in fontfuzzer/fuzzers/native_ben.py and 2 other locations - About 2 hrs to fix
          fontfuzzer/fuzzers/native.py on lines 144..151
          fontfuzzer/fuzzers/native_glyf.py on lines 197..204

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 57.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

                      if t == 'EBDT':
                          LOGGER.debug( '[*] Parsing table EBDT' )
                          font_handle.seek(self.fontTableDirectories['EBDT'].offset)
                          self.fontTableDirectories['EBDT'].table = EBDTTable(font_handle)   
          Severity: Major
          Found in fontfuzzer/parsers/TTF.py and 4 other locations - About 2 hrs to fix
          fontfuzzer/parsers/TTF.py on lines 217..220
          fontfuzzer/parsers/TTF.py on lines 224..227
          fontfuzzer/parsers/TTF.py on lines 236..239
          fontfuzzer/parsers/TTF.py on lines 241..244

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 57.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

                      if t == 'EBSC':
                          LOGGER.debug( '[*] Parsing table EBSC' )
                          font_handle.seek(self.fontTableDirectories['EBSC'].offset)
                          self.fontTableDirectories['EBSC'].table = EBSCTable(font_handle)   
          Severity: Major
          Found in fontfuzzer/parsers/TTF.py and 4 other locations - About 2 hrs to fix
          fontfuzzer/parsers/TTF.py on lines 211..214
          fontfuzzer/parsers/TTF.py on lines 217..220
          fontfuzzer/parsers/TTF.py on lines 236..239
          fontfuzzer/parsers/TTF.py on lines 241..244

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 57.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  class ClassTable():
          
                      def __init__(self, handle):
          
                          self.firstGlyph = unpack('>H', handle.read(2) )[0]
          Severity: Major
          Found in fontfuzzer/parsers/TTF.py and 1 other location - About 2 hrs to fix
          fontfuzzer/parsers/TTF.py on lines 1949..1953

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 57.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                          for row in res:
                              r = list(row)
                              r[5] = str(r[5]).split('.')[0]
                              availableResults.append(r)
          Severity: Major
          Found in fontfuzzer/hostagent.py and 1 other location - About 2 hrs to fix
          fontfuzzer/hostagent.py on lines 317..320

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 57.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              class LongHorMetric():
          
                  def __init__(self, handle):
                      self.advanceWidth = unpack('>H', handle.read(2))[0]
                      self.lsb = unpack('>h', handle.read(2))[0]
          Severity: Major
          Found in fontfuzzer/parsers/TTF.py and 1 other location - About 2 hrs to fix
          fontfuzzer/parsers/TTF.py on lines 2056..2061

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 57.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 5 locations. Consider refactoring.
          Open

                      if t == 'kern':
                          LOGGER.debug('parsing table kern')
                          font_handle.seek(self.fontTableDirectories['kern'].offset)
                          self.fontTableDirectories['kern'].table = KernTable(font_handle)   
          Severity: Major
          Found in fontfuzzer/parsers/TTF.py and 4 other locations - About 2 hrs to fix
          fontfuzzer/parsers/TTF.py on lines 211..214
          fontfuzzer/parsers/TTF.py on lines 217..220
          fontfuzzer/parsers/TTF.py on lines 224..227
          fontfuzzer/parsers/TTF.py on lines 241..244

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 57.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language