rootslab/syllabus

View on GitHub

Showing 94 of 94 total issues

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

        , object : {

            refcount : {
                rtype : ':'
                , since : '2.2.3'
Severity: Major
Found in lib/infos/keys.js and 1 other location - About 3 hrs to fix
lib/infos/pubsub.js on lines 16..42

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 99.

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

        , zrange = function ( is ) {
            var cmd = is ? 'ZRANGE' : 'ZREVRANGE'
                ;
            return function ( key, start, stop, withscores, cback ) {
                var ws = withscores
Severity: Major
Found in lib/commands/sortedsets.js and 1 other location - About 3 hrs to fix
lib/commands/geo.js on lines 19..30

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 95.

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

        , zrange = function ( is ) {
            var cmd = is ? 'GEORADIUS' : 'GEORADIUSBYMEMBER'
                ;
            return function ( key, start, stop, withscores, cback ) {
                var ws = withscores
Severity: Major
Found in lib/commands/geo.js and 1 other location - About 3 hrs to fix
lib/commands/sortedsets.js on lines 41..52

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 95.

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 commands has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.commands = function ( encode, error ) {
    var Abaco = require( 'abaco' )
        , Bolgia = require( 'bolgia' )
        , parseIntArray = Abaco.parseIntArray
        , parseFloatArray = Abaco.parseFloatArray
Severity: Major
Found in lib/commands/geo.js - About 2 hrs to fix

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

        var Abaco = require( 'abaco' )
            , parseIntArray = Abaco.parseIntArray
            , Bolgia = require( 'bolgia' )
            , doString = Bolgia.doString
            , ooo = Bolgia.circles
    Severity: Major
    Found in lib/commands/sets.js and 1 other location - About 2 hrs to fix
    lib/commands/keys.js on lines 6..18

    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 92.

    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

        var Abaco = require( 'abaco' )
            , parseIntArray = Abaco.parseIntArray
            , Bolgia = require( 'bolgia' )
            , doString = Bolgia.doString
            , ooo = Bolgia.circles
    Severity: Major
    Found in lib/commands/keys.js and 1 other location - About 2 hrs to fix
    lib/commands/sets.js on lines 6..18

    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 92.

    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 exports has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = ( function () {
        var util = require( 'util' )
            , Bolgia = require( 'bolgia' )
            , mix = Bolgia.mix
            , ooo = Bolgia.circles
    Severity: Minor
    Found in lib/commands/index.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

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

                    if ( s && k && a ) {
                        list = [ keys.length ].concat( keys ).concat( args );
                        result = encode( 'EVALSHA', ddigest, list, null, cback );
                        result.isEvalSHA = 1;
                        result.digest = ddigest;
    Severity: Major
    Found in lib/lua/index.js and 1 other location - About 2 hrs to fix
    lib/commands/scripting.js on lines 37..43

    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 84.

    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 ( s && k && a ) {
                    list = [ keys.length ].concat( keys ).concat( args );
                    result = encode( 'EVALSHA', sha, list, null, cback );
                    result.isEvalSHA = 1;
                    result.digest = sha;
    Severity: Major
    Found in lib/commands/scripting.js and 1 other location - About 2 hrs to fix
    lib/lua/index.js on lines 139..145

    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 84.

    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 exports has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = ( function () {
        var isArray = Array.isArray
            ;
        return {
            // for monitor events / messages
    Severity: Major
    Found in lib/formatters/index.js - About 2 hrs to fix

      Function commands has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.commands = function ( encode, error ) {
          var Abaco = require( 'abaco' )
              , Bolgia = require( 'bolgia' )
              , parseIntArray = Abaco.parseIntArray
              , doString = Bolgia.doString
      Severity: Major
      Found in lib/commands/scripting.js - About 2 hrs to fix

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

                , zrevrangebylex : function ( key, min, max, limit, cback ) {
                    var list = [ min, max ];
                    if ( key === undefined ) return error( 'ZREVRANGEBYLEX', arguments );
                    if ( isArray( limit ) ) list.concat( 'LIMIT' ).concat( limit );
                    return encode( 'ZREVRANGEBYLEX', key, list, null, cback );
        Severity: Major
        Found in lib/commands/sortedsets.js and 1 other location - About 2 hrs to fix
        lib/commands/sortedsets.js on lines 98..103

        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

                , zrangebylex : function ( key, min, max, limit, cback ) {
                    var list = [ min, max ];
                    if ( key === undefined ) return error( 'ZRANGEBYLEX', arguments );
                    if ( isArray( limit ) ) list.concat( 'LIMIT' ).concat( limit );
                    return encode( 'ZRANGEBYLEX', key, list, null, cback );
        Severity: Major
        Found in lib/commands/sortedsets.js and 1 other location - About 2 hrs to fix
        lib/commands/sortedsets.js on lines 105..110

        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

        Function infos has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.infos = ( function () {
        
            return {
        
                psubscribe : {
        Severity: Major
        Found in lib/infos/pubsub.js - About 2 hrs to fix

          Function infos has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.infos = ( function () {
          
              return {
          
                  eval : {
          Severity: Minor
          Found in lib/infos/scripting.js - About 1 hr to fix

            Function commands has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            exports.commands = function ( encode, error ) {
                var Abaco = require( 'abaco' )
                    , parseIntArray = Abaco.parseIntArray
                    , isArray = Array.isArray
                    // handler for unsubscribe and punscubscripe
            Severity: Minor
            Found in lib/commands/pubsub.js - About 1 hr to fix

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

                      , sdiff : function ( keys, cback ) {
                          if ( ! keys ) return error( 'SDIFF', arguments );
                          if ( isArray( keys ) ) return encode( 'SDIFF', keys.slice( 0, 1 ), keys.slice( 1 ), null, cback );
                          return encode( 'SDIFF', keys );
                      }
              Severity: Major
              Found in lib/commands/sets.js and 2 other locations - About 1 hr to fix
              lib/commands/sets.js on lines 43..47
              lib/commands/sets.js on lines 111..115

              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 70.

              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 3 locations. Consider refactoring.
              Open

                      , sinter : function ( keys, cback ) {
                          if ( ! keys ) return error( 'SINTER', arguments );
                          if ( isArray( keys ) ) return encode( 'SINTER', keys.slice( 0, 1 ), keys.slice( 1 ), null, cback );
                          return encode( 'SINTER', keys );
                      }
              Severity: Major
              Found in lib/commands/sets.js and 2 other locations - About 1 hr to fix
              lib/commands/sets.js on lines 32..36
              lib/commands/sets.js on lines 111..115

              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 70.

              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 3 locations. Consider refactoring.
              Open

                      , sunion : function ( keys, cback ) {
                          if ( ! keys ) return error( 'SUNION', arguments );
                          if ( isArray( keys ) ) return encode( 'SUNION', keys.slice( 0, 1 ), keys.slice( 1 ), null, cback );
                          return encode( 'SUNION', keys );
                      }
              Severity: Major
              Found in lib/commands/sets.js and 2 other locations - About 1 hr to fix
              lib/commands/sets.js on lines 32..36
              lib/commands/sets.js on lines 43..47

              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 70.

              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 info has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      , info = function ( cname ) {
                          var carr = cname ? cname.toLowerCase().split( ' ' ) : [ 'NONE' ]
                              , c = 0
                              , o = syllabus.commands
                              , x = infos
              Severity: Minor
              Found in lib/syllabus.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language