maael/node-ann

View on GitHub
lib/ann.js

Summary

Maintainability
F
5 days
Test Coverage

Function ann has a Cognitive Complexity of 122 (exceeds 5 allowed). Consider refactoring.
Open

var ann = function(options) {
    /*
    *   Network options, that shortcircuit to defaults
    */
    options = options || {};
Severity: Minor
Found in lib/ann.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

Function ann has 316 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var ann = function(options) {
    /*
    *   Network options, that shortcircuit to defaults
    */
    options = options || {};
Severity: Major
Found in lib/ann.js - About 1 day to fix

    File ann.js has 321 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var perceptron = require('./perceptron');
    var ann = function(options) {
        /*
        *   Network options, that shortcircuit to defaults
        */
    Severity: Minor
    Found in lib/ann.js - About 3 hrs to fix

      Function train has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function train(trainingSet, validationSet) {
              var exampleNumber = -1,
                  error, previousError,
                  count = 0, continueLoop = true, outputs = [], 
                  example;
      Severity: Major
      Found in lib/ann.js - About 3 hrs to fix

        Function initialise has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function initialise() {
                /* Recommended Initialisation */
                function startWeightsNormal(n) {
                    var max = -2/n,
                        min = 2/n;
        Severity: Minor
        Found in lib/ann.js - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status