bigdatr/bd-stampy

View on GitHub

Showing 61 of 61 total issues

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

    renderSelectorPeriodYear: function() {
        var prevYearButton;
        var prevYear = moment(this.state.displayDate).subtract(1, 'year').endOf('year');

        if (this.getIsInRange(prevYear)) {
Severity: Major
Found in components/DatePicker.jsx and 1 other location - About 2 days to fix
components/DatePicker.jsx on lines 185..213

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

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

    renderSelectorPeriodMonth: function() {
        var prevMonthButton;
        var prevMonth = moment(this.state.displayDate).subtract(1, 'month').endOf('month');

        if (this.getIsInRange(prevMonth)) {
Severity: Major
Found in components/DatePicker.jsx and 1 other location - About 2 days to fix
components/DatePicker.jsx on lines 214..242

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

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

        queryString
            .split('&')
            .forEach(function(q) {
                var pair = q.split('=');

Severity: Major
Found in utils/UrlStore.js and 1 other location - About 3 hrs to fix
utils/Url.js on lines 21..33

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

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

        hashComponents[1]
            .split('&')
            .forEach(function(q) {
                var pair = q.split('=');

Severity: Major
Found in utils/Url.js and 1 other location - About 3 hrs to fix
utils/UrlStore.js on lines 23..36

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

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

var Tr = React.createClass({
    displayName: 'Tr',
    shouldComponentUpdate: function (nextProps) {
        if(nextProps.children !== this.props.children) {
            return true;
Severity: Major
Found in components/Tr.jsx and 1 other location - About 3 hrs to fix
components/Td.jsx 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 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

var Td = React.createClass({
    displayName: 'Td',
    shouldComponentUpdate: function (nextProps) {
        if(nextProps.data !== this.props.data) {
            return true;
Severity: Major
Found in components/Td.jsx and 1 other location - About 3 hrs to fix
components/Tr.jsx 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 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

File DatePicker.jsx has 277 lines of code (exceeds 250 allowed). Consider refactoring.
Open


/*global document */

var React = require('react'),
    moment = require('moment');
Severity: Minor
Found in components/DatePicker.jsx - About 2 hrs to fix

    Function navigate has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        navigate: function(fragment, options) {
          if (!History.started) return false;
          if (!options || options === true) options = {trigger: !!options};
    
          var url = this.root + (fragment = this.getFragment(fragment || ''));
    Severity: Minor
    Found in utils/History.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

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

            paramList.sort(function(a, b) {
                var x = a.key.toLowerCase();
                var y = b.key.toLowerCase();
                return x<y ? -1 : x>y ? 1 : 0;
            });
    Severity: Major
    Found in utils/UrlStore.js and 1 other location - About 2 hrs to fix
    utils/Url.js on lines 82..86

    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

            paramList.sort(function(a, b) {
                var x = a.key.toLowerCase();
                var y = b.key.toLowerCase();
                return x<y ? -1 : x>y ? 1 : 0;
            });
    Severity: Major
    Found in utils/Url.js and 1 other location - About 2 hrs to fix
    utils/UrlStore.js on lines 47..51

    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(currentPage > 1) {
                prev = <button className={`${buttonClass} ${buttonClass}-previous`} onClick={this.onClick.bind(this, currentPage - 1)}>{this.props.previousButton}</button>;
            }
    Severity: Major
    Found in components/Pagination.jsx and 1 other location - About 2 hrs to fix
    components/Pagination.jsx on lines 136..138

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

    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(currentPage  < numberOfPages) {
                next = <button className={`${buttonClass} ${buttonClass}-next`} onClick={this.onClick.bind(this, currentPage + 1)}>{this.props.nextButton}</button>;
            }
    Severity: Major
    Found in components/Pagination.jsx and 1 other location - About 2 hrs to fix
    components/Pagination.jsx on lines 132..134

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

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

        start: function(options) {
          if (History.started) {
            // throw new Error("Backbone.history has already been started")
            console.warn('Backbone.history has already been started');
            return false;
    Severity: Minor
    Found in utils/History.js - About 1 hr 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 exports has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function(config) {
        config.set({
            browsers: ['Firefox'],
            frameworks: ['jasmine'],
            files: [
    Severity: Minor
    Found in karma.conf.js - About 1 hr to fix

      Function render has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          render: function() {
              var classes = this.createClassName('Input')
                  .add((this.props.isValid === false || this.props.error), 'is-error')
                  .modifier(this.props.type)
              ;
      Severity: Minor
      Found in components/Input.jsx - About 1 hr to fix

        Function start has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            start: function(options) {
              if (History.started) {
                // throw new Error("Backbone.history has already been started")
                console.warn('Backbone.history has already been started');
                return false;
        Severity: Minor
        Found in utils/History.js - About 1 hr to fix

          Function render has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              render: function() {
                  var src = '';
                  var height;
                  var width;
          
          
          Severity: Minor
          Found in components/Img.jsx - About 1 hr 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 render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render: function() {
                  var src = '';
                  var height;
                  var width;
          
          
          Severity: Minor
          Found in components/Img.jsx - About 1 hr to fix

            Function FormMixin_getData has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                FormMixin_getData: function() {
                    var data = this.state.formData ? Immutable.fromJS(this.state.formData).toJS() : {};
            
                    if (this.transformData) {
                        for (var key in this.transformData) {
            Severity: Minor
            Found in mixins/FormMixin.jsx - About 1 hr 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 setQueryParams has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                setQueryParams: function(params, config) {
                    if (!params || typeof params !== 'object') {
                        console.warn('::UrlStore.setQueryParams', 'Missing or invalid argument `params`.', params || '');
                        return false;
                    }
            Severity: Minor
            Found in utils/UrlStore.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language