rapid7/metasploit-framework

View on GitHub
data/exploits/firefox_smil_uaf/worker.js

Summary

Maintainability
D
2 days
Test Coverage

File worker.js has 312 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var window = self;

  function Memory(b,a,f) 
  { 
      this._base_addr=b; 
Severity: Minor
Found in data/exploits/firefox_smil_uaf/worker.js - About 3 hrs to fix

    Function PE has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

      function PE(b,a) { 
          this.mem = b;
          this.export_table = this.module_base = void 0;
          this.export_table_size = 0;
          this.import_table = void 0;
    Severity: Minor
    Found in data/exploits/firefox_smil_uaf/worker.js - 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

    Function sprayArrays has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var sprayArrays=function() {
      var mArray = new Array(0x1fffe)  
      var arrBuf = new ArrayBuffer(0x100000);
      var dwArray =  new Uint32Array(arrBuf)
      var qwArray = new Float64Array(arrBuf, 0x10)
    Severity: Major
    Found in data/exploits/firefox_smil_uaf/worker.js - About 2 hrs to fix

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

        function Memory(b,a,f) 
        { 
            this._base_addr=b; 
            this._read=a; 
            this._write=f; 
      Severity: Minor
      Found in data/exploits/firefox_smil_uaf/worker.js - 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 ROP has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function ROP(mem,a){
             this.mem = mem;
             this.pe = new PE(mem,a);
             this.pe._resolve_pe_structures();
             this.module_base = this.pe.module_base + 0x1000;
      Severity: Minor
      Found in data/exploits/firefox_smil_uaf/worker.js - About 1 hr to fix

        Function PE has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function PE(b,a) { 
              this.mem = b;
              this.export_table = this.module_base = void 0;
              this.export_table_size = 0;
              this.import_table = void 0;
        Severity: Minor
        Found in data/exploits/firefox_smil_uaf/worker.js - About 1 hr to fix

          Function ROP has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              function ROP(mem,a){
                 this.mem = mem;
                 this.pe = new PE(mem,a);
                 this.pe._resolve_pe_structures();
                 this.module_base = this.pe.module_base + 0x1000;
          Severity: Minor
          Found in data/exploits/firefox_smil_uaf/worker.js - 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 Memory has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function Memory(b,a,f) 
            { 
                this._base_addr=b; 
                this._read=a; 
                this._write=f; 
          Severity: Minor
          Found in data/exploits/firefox_smil_uaf/worker.js - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status