karimsa/solver.js

View on GitHub

Showing 18 of 26 total issues

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

    module.exports = function (options, callback) {
        // defaults
        options = options || {};
        options.type = options.type || 'linear';
        options.indep = options.indep || 'x';
Severity: Major
Found in lib/dataset/createSolver.js - About 2 hrs to fix

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

    module.exports = (function () {
        "use strict";
    
        // Continous integration using
        // Riemann's sum.
    Severity: Minor
    Found in lib/math/integration.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 exports has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        module.exports = function (type) {
            var reqs = sRequired[type],
                sums = {},
                n = 0,
                collect = function (sol) {
    Severity: Major
    Found in lib/dataset/createSolverStream.js - About 2 hrs to fix

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

      module.exports = function () {
          "use strict";
      
          var i, x, data = this,
              Data = this.construct();
      Severity: Minor
      Found in lib/data/summary.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 Probability has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              Probability = function (map, match) {
                  var that = this;
      
                  // the event map should be an array,
                  // let's convert it to an object
      Severity: Minor
      Found in lib/probability/map.js - About 1 hr to fix

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

        module.exports = function (data) {
            "use strict";
        
            var e, i, o = {},
                toData = require('../../data.js'),
        Severity: Minor
        Found in lib/eq/solvers/linear.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 exports has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function () {
            "use strict";
        
            var i, x, data = this,
                Data = this.construct();
        Severity: Minor
        Found in lib/data/summary.js - About 1 hr to fix

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

          module.exports = function (n) {
              "use strict";
          
              // .constant()
              // Converts a given number into an object that
          Severity: Minor
          Found in lib/math/constant.js - About 1 hr to fix

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

            module.exports = function (data) {
                "use strict";
            
                var e, i, o = {},
                    toData = require('../../data.js'),
            Severity: Minor
            Found in lib/eq/solvers/linear.js - About 1 hr to fix

              Function stream has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          this.stream = mapstream(function (occured, next) {
                              // occured can be a map of frequencies, or
                              // an array of events
                              var i, j, k = false,
                                  fmap = {};
              Severity: Minor
              Found in lib/probability/map.js - About 1 hr to fix

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

                module.exports = (function () {
                    "use strict";
                
                    // Continous integration using
                    // Riemann's sum.
                Severity: Minor
                Found in lib/math/integration.js - About 1 hr to fix

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

                  module.exports = function (data) {
                      "use strict";
                  
                      var e, o = {},
                          toData = require('../../data.js'),
                  Severity: Minor
                  Found in lib/eq/solvers/exponential.js - About 1 hr to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if (that.equal(i, map[j])) {
                                                        that.map[map[j]] += fmap[i];
                                                        k = true;
                                                        break;
                                                    }
                    Severity: Major
                    Found in lib/probability/map.js - About 45 mins to fix

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

                      module.exports = function (n) {
                          "use strict";
                      
                          // .constant()
                          // Converts a given number into an object that
                      Severity: Minor
                      Found in lib/math/constant.js - About 45 mins 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 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = function (reqs, from) {
                          "use strict";
                      
                          var path = require('path'),
                              sep = path.join('./a', 'b').substr(1, 1),
                      Severity: Minor
                      Found in lib/require-all.js - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = function () {
                          "use strict";
                      
                          var i, sum, data = this;
                      
                      
                      Severity: Minor
                      Found in lib/data/deviation.js - About 35 mins 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 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = function () {
                          "use strict";
                      
                          var i, av, data = this;
                      
                      
                      Severity: Minor
                      Found in lib/data/average.js - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = function (exp) {
                          "use strict";
                      
                          var i, e, Data, data = this;
                      
                      
                      Severity: Minor
                      Found in lib/data/error.js - About 25 mins 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