adamrenklint/bap

View on GitHub

Showing 42 of 70 total issues

Function effects has 151 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function effects () {

  var baseSample = bap.sample({
    src: 'sounds/plong1.wav',
    duration: 96,
Severity: Major
Found in examples/effects.js - About 6 hrs to fix

    Function boombap has 125 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function boombap () {
      var drumKit = bap.kit();
      var drumCompressor = bap.compressor({
        threshold: -12,
        gain: 110
    Severity: Major
    Found in examples/boombap.js - About 5 hrs to fix

      Function sequences has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function sequences () {
      
        var lowPianoKit = bap.sample({
          src: 'sounds/own_barricade_end.wav',
          attack: 0.01,
      Severity: Major
      Found in examples/sequences.js - About 3 hrs to fix

        Function slices has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function slices () {
          var sampleKit = bap.kit();
          var base = bap.sample({
            src: 'sounds/slices.wav',
            attack: 0.01,
        Severity: Major
        Found in examples/slices.js - About 2 hrs to fix

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

            _getCollectionEventBubblingHandler: function (propertyName) {
              return function (eventName, model, newValue, collection) {
                var validNames = ['change', 'add', 'remove'];
                if (~validNames.indexOf(eventName)) {
                  this.trigger('change:' + propertyName, model, newValue);
          Severity: Minor
          Found in lib/Model.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 sequences has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function sequences () {
          
            var lowPianoKit = bap.sample({
              src: 'sounds/own_barricade_end.wav',
              attack: 0.01,
          Severity: Minor
          Found in examples/sequences2.js - About 1 hr to fix

            Function start has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              start: function (time, note, channel, pattern, kit, slot) {
                if (this.mute) { return; }
            
                if (typeof time !== 'number') {
                  pattern = channel;
            Severity: Minor
            Found in lib/Layer.js - About 1 hr to fix

              Function start has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                start: function (time, note, channel, pattern, kit, slot) {
                  if (this.mute) { return; }
              
                  if (typeof time !== 'number') {
                    pattern = channel;
              Severity: Minor
              Found in lib/Layer.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 makeBuffer has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              BufferHelper.makeBuffer = memoize(function (params, originalBuffer, context) {
              
                var start = new Date();
                var sampleRate = originalBuffer.sampleRate;
                var numberOfChannels = BufferHelper.getChannelCount(params, originalBuffer);
              Severity: Minor
              Found in lib/BufferHelper.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 _loadSample has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                _loadSample: function (countLoading) {
                  var buffer = buffers[this.src];
                  if (!buffer) {
                    this.loaded = false;
              
              
              Severity: Minor
              Found in lib/Sample.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 patterns has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                patterns: function (bar, outerOffset) {
                  if (typeof bar !== 'number') throw new Error('Invalid argument: bar is not a number');
                  if (bar < 1 || bar > this.bars) throw new Error('Invalid argument: bar is not within sequence length');
                  var patterns = {};
                  var sequences = this.sequences.slice();
              Severity: Minor
              Found in lib/Sequence.js - About 1 hr to fix

                Function makeBuffer has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                BufferHelper.makeBuffer = memoize(function (params, originalBuffer, context) {
                
                  var start = new Date();
                  var sampleRate = originalBuffer.sampleRate;
                  var numberOfChannels = BufferHelper.getChannelCount(params, originalBuffer);
                Severity: Minor
                Found in lib/BufferHelper.js - About 1 hr to fix

                  Function _loadSample has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _loadSample: function (countLoading) {
                      var buffer = buffers[this.src];
                      if (!buffer) {
                        this.loaded = false;
                  
                  
                  Severity: Minor
                  Found in lib/Sample.js - About 1 hr to fix

                    Function mergeSources has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Params.mergeSources = memoize(function (params, sources) {
                      var multipliers = ['volume'];
                      var adders = ['pitch', 'pan'];
                      var keys = Object.keys(Params.prototype._definition);
                    
                    
                    Severity: Minor
                    Found in lib/Params.js - About 1 hr to fix

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

                      function instanceOf (type, Constructor) {
                      
                        return {
                          set: function (newVal) {
                            if (newVal instanceof Constructor) {
                      Severity: Minor
                      Found in lib/types/instanceOf.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 overloadedAccessor has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function overloadedAccessor (name, Ctor) {
                      
                        var mixin = {};
                      
                        mixin[name] = function (id, model) {
                      Severity: Minor
                      Found in lib/mixins/overloadedAccessor.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 instanceOfType has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function instanceOfType (type, types) {
                      
                        return {
                          set: function (newVal) {
                            if (~types.indexOf(newVal.type)) {
                      Severity: Minor
                      Found in lib/types/instanceOfType.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 instanceOfType has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function instanceOfType (type, types) {
                      
                        return {
                          set: function (newVal) {
                            if (~types.indexOf(newVal.type)) {
                      Severity: Minor
                      Found in lib/types/instanceOfType.js - About 1 hr to fix

                        Function instanceOf has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function instanceOf (type, Constructor) {
                        
                          return {
                            set: function (newVal) {
                              if (newVal instanceof Constructor) {
                        Severity: Minor
                        Found in lib/types/instanceOf.js - About 1 hr to fix

                          Function _triggerPlaybackStateEvent has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            _triggerPlaybackStateEvent: function(event, time, params, note, channel, pattern, kit, slot) {
                          Severity: Major
                          Found in lib/Layer.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language