rootslab/bolgia

View on GitHub

Showing 16 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

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

          , o1 = {
              0 : 0
              , a : null
              , b : undefined
              , c : Infinity
      Severity: Major
      Found in example/qs-filter-example.js and 3 other locations - About 3 hrs to fix
      example/flatten-example.js on lines 4..16
      example/qs-example.js on lines 4..16
      example/toArray-example.js on lines 5..17

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

          , o1 = {
              0 : 0
              , a : null
              , b : undefined
              , c : Infinity
      Severity: Major
      Found in example/flatten-example.js and 3 other locations - About 3 hrs to fix
      example/qs-example.js on lines 4..16
      example/qs-filter-example.js on lines 4..16
      example/toArray-example.js on lines 5..17

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

          , o = {
              0 : 0
              , a : null
              , b : undefined
              , c : Infinity
      Severity: Major
      Found in example/toArray-example.js and 3 other locations - About 3 hrs to fix
      example/flatten-example.js on lines 4..16
      example/qs-example.js on lines 4..16
      example/qs-filter-example.js on lines 4..16

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 4 locations. Consider refactoring.
      Open

          , o1 = {
              0 : 0
              , a : null
              , b : undefined
              , c : Infinity
      Severity: Major
      Found in example/qs-example.js and 3 other locations - About 3 hrs to fix
      example/flatten-example.js on lines 4..16
      example/qs-filter-example.js on lines 4..16
      example/toArray-example.js on lines 5..17

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                      if ( recur ) {
                          vtype = otype.call( v );
                          if ( ( vtype === o.obj ) ||
                               ( vtype === o.arr ) ) {
                              nest = [];
      Severity: Major
      Found in lib/bolgia.js and 1 other location - About 2 hrs to fix
      lib/bolgia.js on lines 92..101

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 79.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                      if ( recur ) {
                          vtype = otype.call( v );
                          if ( ( vtype === o.obj ) ||
                               ( vtype === o.arr ) ) {
                              nest = [];
      Severity: Major
      Found in lib/bolgia.js and 1 other location - About 2 hrs to fix
      lib/bolgia.js on lines 67..76

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 79.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              opta : {
                  100 : 0
                  , 200 : undefined
                  , 400 : ''
                  , 500 : NaN
      Severity: Major
      Found in example/update-example.js and 1 other location - About 2 hrs to fix
      example/clone-example.js on lines 5..14

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 75.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              opta : {
                  100 : 0
                  , 200 : undefined
                  , 400 : ''
                  , 500 : NaN
      Severity: Major
      Found in example/clone-example.js and 1 other location - About 2 hrs to fix
      example/update-example.js on lines 29..38

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 75.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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