rootslab/sermone

View on GitHub

Showing 5 of 5 total issues

Function Sermone has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

exports.Sermone = ( function () {
    var emptyFn = function () {}
        , Bolgia = require( 'bolgia' )
        , doString =  Bolgia.doString
        , reveal = Bolgia.reveal
Severity: Minor
Found in lib/sermone.js - About 3 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 Sermone has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.Sermone = ( function () {
    var emptyFn = function () {}
        , Bolgia = require( 'bolgia' )
        , doString =  Bolgia.doString
        , reveal = Bolgia.reveal
Severity: Major
Found in lib/sermone.js - About 3 hrs to fix

    Function encode has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            , encode = function ( cmd, key, obj, fn, zn ) {
                var list = [ 1, '$' + cmd.length, cmd ]
                    , btype = doString( obj )
                    , bulks = 0
                    , ecmd = null
    Severity: Major
    Found in lib/sermone.js - About 2 hrs to fix

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

                      , encodeArgs = function () {
                          var k = null
                              , v = 0
                              , o = 0
                              , olen = 0
      Severity: Minor
      Found in lib/sermone.js - About 1 hr to fix

        Function encode has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                , encode = function ( cmd, key, obj, fn, zn ) {
        Severity: Minor
        Found in lib/sermone.js - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language