bbc/flashheart

View on GitHub

Showing 73 of 73 total issues

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

(function() {
    var source = document.getElementsByClassName('prettyprint source linenums');
    var i = 0;
    var lineNumber = 0;
    var lineId;
Severity: Major
Found in docs/scripts/linenumber.js and 1 other location - About 1 day to fix
docconfig/template/static/scripts/linenumber.js on lines 2..25

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

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

(function() {
    var source = document.getElementsByClassName('prettyprint source linenums');
    var i = 0;
    var lineNumber = 0;
    var lineId;
Severity: Major
Found in docconfig/template/static/scripts/linenumber.js and 1 other location - About 1 day to fix
docs/scripts/linenumber.js on lines 2..25

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

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

exports.publish = function(taffyData, opts, tutorials) {
    var docdash = env && env.conf && env.conf.docdash || {};
    data = taffyData;

    var conf = env.conf.templates || {};
Severity: Major
Found in docconfig/template/publish.js - About 1 day to fix

    File probe.js has 489 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    "use strict";
    /**
     @fileOverview Queries objects in memory using a mongo-like notation for reaching into objects and filtering for records
    
     @module documents/probe
    Severity: Minor
    Found in docconfig/template/fixtures/documents/probe.js - About 7 hrs to fix

      File publish.js has 487 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*global env: true */
      'use strict';
      
      var doop = require('jsdoc/util/doop');
      var fs = require('jsdoc/fs');
      Severity: Minor
      Found in docconfig/template/publish.js - About 7 hrs to fix

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

        exports.findOne = function ( obj, qu ) {
            var expression, _i, _len;
        
            var query = parseQueryExpression( qu );
            for ( _i = 0, _len = query.length; _i < _len; _i++ ) {
        Severity: Major
        Found in docconfig/template/fixtures/documents/probe.js and 1 other location - About 6 hrs to fix
        docconfig/template/fixtures/documents/probe.js on lines 813..829

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

        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

        exports.findOneKey = function ( obj, qu ) {
            var expression, _i, _len;
        
            var query = parseQueryExpression( qu );
            for ( _i = 0, _len = query.length; _i < _len; _i++ ) {
        Severity: Major
        Found in docconfig/template/fixtures/documents/probe.js and 1 other location - About 6 hrs to fix
        docconfig/template/fixtures/documents/probe.js on lines 788..804

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

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

        function pushin( path, record, setter, newValue ) {
            var context = record;
            var parent = record;
            var lastPart = null;
            var _i;
        Severity: Minor
        Found in docconfig/template/fixtures/documents/probe.js - About 5 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

            $not       : function ( qu, value, record ) {
        
                var result = false;
                sys.each( qu.operands, function ( expr ) {
                    if ( expr.path ) {
        Severity: Major
        Found in docconfig/template/fixtures/documents/probe.js and 1 other location - About 5 hrs to fix
        docconfig/template/fixtures/documents/probe.js on lines 647..661

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

        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

            $nor       : function ( qu, value, record ) {
                var isOr = false;
                sys.each( qu.operands, function ( expr ) {
                    if ( expr.path ) {
                        expr.splitPath = expr.splitPath || splitPath( expr.path );
        Severity: Major
        Found in docconfig/template/fixtures/documents/probe.js and 1 other location - About 5 hrs to fix
        docconfig/template/fixtures/documents/probe.js on lines 671..687

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

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

        exports.bind = function ( path, record, options ) {
            options = sys.extend( {}, dataBinderOptions, options );
            var context = record;
            var lastParent = context;
            var parts = path.split( probe.delimiter );
        Severity: Minor
        Found in docconfig/template/fixtures/documents/binder.js - About 4 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

        exports.findKeys = function ( obj, qu ) {
            var expression, _i, _len;
        
            var query = parseQueryExpression( qu );
            for ( _i = 0, _len = query.length; _i < _len; _i++ ) {
        Severity: Major
        Found in docconfig/template/fixtures/documents/probe.js and 1 other location - About 4 hrs to fix
        docconfig/template/fixtures/documents/probe.js on lines 750..761

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

        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

        exports.find = function ( obj, qu ) {
            var expression, _i, _len;
        
            var query = parseQueryExpression( qu );
            for ( _i = 0, _len = query.length; _i < _len; _i++ ) {
        Severity: Major
        Found in docconfig/template/fixtures/documents/probe.js and 1 other location - About 4 hrs to fix
        docconfig/template/fixtures/documents/probe.js on lines 769..780

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

        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

            $ne        : function ( qu, value ) {
                if ( sys.isArray( value ) ) {
                    return sys.find( value, function ( entry ) {
                        return JSON.stringify( qu.operands[0] ) !== JSON.stringify( entry );
                    } ) !== void 0;
        Severity: Major
        Found in docconfig/template/fixtures/documents/probe.js and 1 other location - About 4 hrs to fix
        docconfig/template/fixtures/documents/probe.js on lines 360..368

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

        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

            $eq        : function ( qu, value ) {
                if ( sys.isArray( value ) ) {
                    return sys.find( value, function ( entry ) {
                        return JSON.stringify( qu.operands[0] ) === JSON.stringify( entry );
                    } ) !== void 0;
        Severity: Major
        Found in docconfig/template/fixtures/documents/probe.js and 1 other location - About 4 hrs to fix
        docconfig/template/fixtures/documents/probe.js on lines 380..388

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

        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

            on       : function ( listener, listenerContext, priority ) {
                if ( sys.isNumber( listenerContext ) ) {
                    priority = listenerContext;
                    listenerContext = null;
                }
        Severity: Major
        Found in docconfig/template/fixtures/mixins/signalable.js and 1 other location - About 4 hrs to fix
        docconfig/template/fixtures/mixins/signalable.js on lines 102..113

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

        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

            once     : function ( listener, listenerContext, priority ) {
                if ( sys.isNumber( listenerContext ) ) {
                    priority = listenerContext;
                    listenerContext = null;
                }
        Severity: Major
        Found in docconfig/template/fixtures/mixins/signalable.js and 1 other location - About 4 hrs to fix
        docconfig/template/fixtures/mixins/signalable.js on lines 83..94

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

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

        exports.bind = function ( path, record, options ) {
            options = sys.extend( {}, dataBinderOptions, options );
            var context = record;
            var lastParent = context;
            var parts = path.split( probe.delimiter );
        Severity: Major
        Found in docconfig/template/fixtures/documents/binder.js - About 3 hrs to fix

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

              min           : function ( query, iterator, thisobj ) {
                  if ( sys.isPlainObject( query ) ) {
                      thisobj = thisobj || this;
                      return sys.min( this.find( query ), iterator, thisobj );
                  } else {
          Severity: Major
          Found in docconfig/template/fixtures/documents/collector.js and 6 other locations - About 2 hrs to fix
          docconfig/template/fixtures/documents/collector.js on lines 99..107
          docconfig/template/fixtures/documents/collector.js on lines 138..146
          docconfig/template/fixtures/documents/collector.js on lines 157..165
          docconfig/template/fixtures/documents/collector.js on lines 193..201
          docconfig/template/fixtures/documents/collector.js on lines 211..219
          docconfig/template/fixtures/documents/collector.js on lines 338..346

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

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

              countBy       : function ( query, iterator, thisobj ) {
                  if ( sys.isPlainObject( query ) ) {
                      thisobj = thisobj || this;
                      return sys.countBy( this.find( query ), iterator, thisobj );
                  } else {
          Severity: Major
          Found in docconfig/template/fixtures/documents/collector.js and 6 other locations - About 2 hrs to fix
          docconfig/template/fixtures/documents/collector.js on lines 99..107
          docconfig/template/fixtures/documents/collector.js on lines 157..165
          docconfig/template/fixtures/documents/collector.js on lines 193..201
          docconfig/template/fixtures/documents/collector.js on lines 211..219
          docconfig/template/fixtures/documents/collector.js on lines 229..237
          docconfig/template/fixtures/documents/collector.js on lines 338..346

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

          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

          Severity
          Category
          Status
          Source
          Language