konsumer/Protracker

View on GitHub

Showing 41 of 90 total issues

Function mix has a Cognitive Complexity of 143 (exceeds 5 allowed). Consider refactoring.
Open

Protracker.prototype.mix = function(ape) {
  var f;
  var p, pp, n, nn;
  var mod;
  if (ape.srcElement) {
Severity: Minor
Found in index.js - About 2 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

File index.js has 785 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
  amiga protracker module player for web audio api
  (c) 2012-2014 firehawk/tda  (firehawk@haxor.fi)
  
  originally hacked together in a weekend, so please excuse
Severity: Major
Found in index.js - About 1 day to fix

    Function exports has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function(Protracker){
      Protracker.prototype.parseIT = function()
      {
        console.log('Parse IMPULSE TRACKER file');
        console.log('unfinished');
    Severity: Minor
    Found in formats/it.js - 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 exports has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function(Protracker){
      Protracker.prototype.parseXM = function()
      {
        console.log('Parse FT2 file');
        console.log('unfinished');
    Severity: Minor
    Found in formats/xm.js - 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 exports has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function(Protracker){
      Protracker.prototype.parseMOD = function()
      {
        var i,j;
        this.vu=[];
    Severity: Minor
    Found in formats/mod.js - 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 parse has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
    Open

    Protracker.prototype.parse = function()
    {
      var i,j,c;
      
      if (!this.buffer){
    Severity: Minor
    Found in index.js - About 7 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 exports has 129 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function(Protracker){
      Protracker.prototype.parseIT = function()
      {
        console.log('Parse IMPULSE TRACKER file');
        console.log('unfinished');
    Severity: Major
    Found in formats/it.js - About 5 hrs to fix

      Function parseIT has 126 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        Protracker.prototype.parseIT = function()
        {
          console.log('Parse IMPULSE TRACKER file');
          console.log('unfinished');
          var i,j,d;
      Severity: Major
      Found in formats/it.js - About 5 hrs to fix

        Function exports has 120 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(Protracker){
          Protracker.prototype.parseXM = function()
          {
            console.log('Parse FT2 file');
            console.log('unfinished');
        Severity: Major
        Found in formats/xm.js - About 4 hrs to fix

          Function parseXM has 117 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            Protracker.prototype.parseXM = function()
            {
              console.log('Parse FT2 file');
              console.log('unfinished');
              this.stop();
          Severity: Major
          Found in formats/xm.js - About 4 hrs to fix

            Function mix has 112 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Protracker.prototype.mix = function(ape) {
              var f;
              var p, pp, n, nn;
              var mod;
              if (ape.srcElement) {
            Severity: Major
            Found in index.js - About 4 hrs to fix

              Function advance has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

              Protracker.prototype.advance=function(mod) {
                var spd=(((mod.samplerate*60)/mod.bpm)/4)/6;
              
                // advance player
                if (mod.offset>spd) { mod.tick++; mod.offset=0; mod.flags|=1; }
              Severity: Minor
              Found in index.js - About 4 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 parse has 100 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Protracker.prototype.parse = function()
              {
                var i,j,c;
                
                if (!this.buffer){
              Severity: Major
              Found in index.js - About 4 hrs to fix

                Function exports has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = function(Protracker){
                  Protracker.prototype.parseMOD = function()
                  {
                    var i,j;
                    this.vu=[];
                Severity: Major
                Found in formats/mod.js - About 2 hrs to fix

                  Function parseMOD has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    Protracker.prototype.parseMOD = function()
                    {
                      var i,j;
                      this.vu=[];
                      for(i=0;i<this.channels;i++) this.vu[i]=0.0;
                  Severity: Major
                  Found in formats/mod.js - About 2 hrs to fix

                    Function Protracker has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function Protracker()
                    {
                      var i, t;
                    
                      this.initialize();
                    Severity: Major
                    Found in index.js - About 2 hrs to fix

                      Function advance has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Protracker.prototype.advance=function(mod) {
                        var spd=(((mod.samplerate*60)/mod.bpm)/4)/6;
                      
                        // advance player
                        if (mod.offset>spd) { mod.tick++; mod.offset=0; mod.flags|=1; }
                      Severity: Minor
                      Found in index.js - About 1 hr to fix

                        Function initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        Protracker.prototype.initialize = function()
                        {
                          this.syncqueue=[];
                        
                          this.tick=0;
                        Severity: Minor
                        Found in index.js - About 1 hr to fix

                          Function Protracker has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function Protracker()
                          {
                            var i, t;
                          
                            this.initialize();
                          Severity: Minor
                          Found in index.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 createContext has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          Protracker.prototype.createContext = function()
                          {
                            if ( typeof AudioContext !== 'undefined') {
                              this.context = new AudioContext();
                            } else {
                          Severity: Minor
                          Found in index.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language