bronycub/sugarcub

View on GitHub

Showing 3,238 of 3,238 total issues

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

test('yyyy: Year, four-digit.', function(){
    this.input
        .val('2012-03-5')
        .datepicker({format: 'yyyy-mm-dd'})
        .datepicker('setValue');
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 11..17
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 19..25
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 27..33
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 35..41
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 43..49
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 51..57
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 59..65
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 67..73
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 75..81
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 83..89
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 91..97

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

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

test('mm: Month, leading zero.', function(){
    this.input
        .val('2012-3-5')
        .datepicker({format: 'yyyy-mm-dd'})
        .datepicker('setValue');
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 11..17
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 19..25
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 27..33
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 35..41
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 43..49
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 59..65
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 67..73
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 75..81
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 83..89
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 91..97
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 99..105

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

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

test('MM: Month full name.', function(){
    this.input
        .val('2012-March-5')
        .datepicker({format: 'yyyy-MM-dd'})
        .datepicker('setValue');
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 11..17
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 19..25
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 27..33
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 35..41
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 43..49
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 51..57
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 59..65
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 67..73
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 83..89
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 91..97
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 99..105

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

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

test('dd: Day of month, leading zero.', function(){
    this.input
        .val('2012-03-5')
        .datepicker({format: 'yyyy-mm-dd'})
        .datepicker('setValue');
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 11..17
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 27..33
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 35..41
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 43..49
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 51..57
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 59..65
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 67..73
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 75..81
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 83..89
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 91..97
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 99..105

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

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

test('M: Month shortname.', function(){
    this.input
        .val('2012-Mar-05')
        .datepicker({format: 'yyyy-M-dd'})
        .datepicker('setValue');
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 11..17
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 19..25
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 27..33
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 35..41
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 43..49
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 51..57
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 67..73
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 75..81
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 83..89
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 91..97
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 99..105

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

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

test('yy: Year, two-digit.', function(){
    this.input
        .val('2012-03-05')
        .datepicker({format: 'yy-mm-dd'})
        .datepicker('setValue');
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 11..17
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 19..25
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 27..33
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 35..41
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 43..49
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 51..57
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 59..65
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 67..73
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 75..81
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 83..89
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 99..105

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

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

test('D: Day of week, short.', function(){
    this.input
        .val('2012-03-05')
        .datepicker({format: 'yyyy-mm-dd-D'})
        .datepicker('setValue');
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 11..17
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 19..25
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 35..41
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 43..49
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 51..57
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 59..65
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 67..73
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 75..81
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 83..89
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 91..97
core/static/vendor/bootstrap-datepicker/tests/suites/formats.js on lines 99..105

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

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

function manipulationTarget( elem, content ) {
    if ( jQuery.nodeName( elem, "table" ) &&
        jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {

        return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
Severity: Major
Found in core/static/vendor/jquery/src/manipulation.js and 2 other locations - About 2 hrs to fix
core/static/vendor/jquery/dist/jquery.js on lines 5628..5636
core/static/vendor/jquery/dist/jquery.slim.js on lines 5628..5636

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

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

function manipulationTarget( elem, content ) {
    if ( jQuery.nodeName( elem, "table" ) &&
        jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {

        return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
Severity: Major
Found in core/static/vendor/jquery/dist/jquery.slim.js and 2 other locations - About 2 hrs to fix
core/static/vendor/jquery/dist/jquery.js on lines 5628..5636
core/static/vendor/jquery/src/manipulation.js on lines 50..58

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

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

function manipulationTarget( elem, content ) {
    if ( jQuery.nodeName( elem, "table" ) &&
        jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {

        return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
Severity: Major
Found in core/static/vendor/jquery/dist/jquery.js and 2 other locations - About 2 hrs to fix
core/static/vendor/jquery/dist/jquery.slim.js on lines 5628..5636
core/static/vendor/jquery/src/manipulation.js on lines 50..58

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

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

        for ( i = 0; i < this.assertions.length; i++ ) {
            if ( !this.assertions[ i ].result ) {
                bad++;
                config.stats.bad++;
                config.moduleStats.bad++;
core/static/vendor/bootstrap-datepicker/tests/assets/qunit.js on lines 224..230

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

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

            for ( i = 0; i < this.assertions.length; i++ ) {
                if ( !this.assertions[i].result ) {
                    bad++;
                    config.stats.bad++;
                    config.moduleStats.bad++;
core/static/vendor/jquery-expander/test/qunit/qunit.1.19.0.js on lines 887..893

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

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

function isDaylightSavingTime () {
    return (
        this.utcOffset() > this.clone().month(0).utcOffset() ||
        this.utcOffset() > this.clone().month(5).utcOffset()
    );
Severity: Major
Found in core/static/vendor/moment/moment.js and 2 other locations - About 2 hrs to fix
core/static/vendor/moment/min/moment-with-locales.js on lines 2772..2777
core/static/vendor/moment/src/lib/units/offset.js on lines 197..202

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

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

export function isDaylightSavingTime () {
    return (
        this.utcOffset() > this.clone().month(0).utcOffset() ||
        this.utcOffset() > this.clone().month(5).utcOffset()
    );
Severity: Major
Found in core/static/vendor/moment/src/lib/units/offset.js and 2 other locations - About 2 hrs to fix
core/static/vendor/moment/min/moment-with-locales.js on lines 2772..2777
core/static/vendor/moment/moment.js on lines 2778..2783

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

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

function isDaylightSavingTime () {
    return (
        this.utcOffset() > this.clone().month(0).utcOffset() ||
        this.utcOffset() > this.clone().month(5).utcOffset()
    );
Severity: Major
Found in core/static/vendor/moment/min/moment-with-locales.js and 2 other locations - About 2 hrs to fix
core/static/vendor/moment/moment.js on lines 2778..2783
core/static/vendor/moment/src/lib/units/offset.js on lines 197..202

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

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

function getUrlConfigHtml() {
    var i, j, val,
        escaped, escapedTooltip,
        selection = false,
        len = config.urlConfig.length,
Severity: Major
Found in core/static/vendor/jquery-expander/test/qunit/qunit.1.19.0.js - About 2 hrs to fix

    File formats.js has 261 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module('Formats', {
        setup: function(){
            this.input = $('<input type="text">').appendTo('#qunit-fixture');
            this.date = UTCDate(2012, 2, 15, 0, 0, 0, 0); // March 15, 2012
        },
    Severity: Minor
    Found in core/static/vendor/bootstrap-datepicker/tests/suites/formats.js - About 2 hrs to fix

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

      function eifelerRegelAppliesToNumber(number) {
          number = parseInt(number, 10);
          if (isNaN(number)) {
              return false;
          }
      Severity: Minor
      Found in core/static/vendor/moment/src/locale/lb.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

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

      export function createDuration (input, key) {
          var duration = input,
              // matching against regexp is expensive, do it on demand
              match = null,
              sign,
      Severity: Minor
      Found in core/static/vendor/moment/src/lib/duration/create.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 3 locations. Consider refactoring.
      Open

      function normalizeObjectUnits(inputObject) {
          var normalizedInput = {},
              normalizedProp,
              prop;
      
      
      Severity: Major
      Found in core/static/vendor/moment/moment.js and 2 other locations - About 2 hrs to fix
      core/static/vendor/moment/min/moment-with-locales.js on lines 494..509
      core/static/vendor/moment/src/lib/units/aliases.js on lines 14..29

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

      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