rootslab/bolgia

View on GitHub

Showing 8 of 16 total issues

Function Bolgia has a Cognitive Complexity of 196 (exceeds 5 allowed). Consider refactoring.
Open

exports.Bolgia = ( function () {
    var isArray = Array.isArray
        , slice = Array.prototype.slice
        , otype = Object.prototype.toString
        , abs = Math.abs
Severity: Minor
Found in lib/bolgia.js - About 4 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 Bolgia has 357 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.Bolgia = ( function () {
    var isArray = Array.isArray
        , slice = Array.prototype.slice
        , otype = Object.prototype.toString
        , abs = Math.abs
Severity: Major
Found in lib/bolgia.js - About 1 day to fix

    File bolgia.js has 359 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Bolgia, an helper module for the config hell.
     * It recursively clones, mixes, updates and improves configuration 
     * objects/hashes with nested properties.
     * '..non ragioniam di lor, ma guarda e passa..' ",
    Severity: Minor
    Found in lib/bolgia.js - About 4 hrs to fix

      Function toHash has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              , toHash = function ( arr, recur, obj, convert ) {
                  var h = obj || {}
                      , c = convert
                      , a = isArray( arr ) ? arr : []
                      , alen = a.length
      Severity: Minor
      Found in lib/bolgia.js - About 1 hr to fix

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

                , update = function ( dest, src ) {
                    var d = dest
                        , s = src
                        , sector = s && s.constructor || {}
                        , doctor = d && d.constructor
        Severity: Minor
        Found in lib/bolgia.js - About 1 hr to fix

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

                  , improve = function ( dest, src ) {
                      var d = dest
                          , s = src
                          , ctor = s && s.constructor || {}
                          , stype = otype.call( s )
          Severity: Minor
          Found in lib/bolgia.js - About 1 hr to fix

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

                    , qs = function ( field, value, opt, hash ) {
                        var cfg = opt
                            , f = field
                            , h = hash || ''
                            , v = value
            Severity: Minor
            Found in lib/bolgia.js - About 1 hr to fix

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

                       , flatten = function ( field, value, hash ) {
                          var f = field
                              , h = hash || {}
                              , v = value
                              , vtype = otype.call( v )
              Severity: Minor
              Found in lib/bolgia.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language