18F/forest-service-prototype

View on GitHub

Showing 46 of 46 total issues

Function 17 has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{"../../../node_modules/politespace/src/politespace":2,"../utils/verify-jquery":24}],17:[function(require,module,exports){
/**
 * This file defines key ECMAScript 5 methods that are used by the Standards
 * but may be missing in older browsers.
 */
Severity: Minor
Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix

    Function 9 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    },{}],9:[function(require,module,exports){
    var toggleFieldMask = require('./toggle-field-mask');
    var select = require('../utils/select');
    
    /**
    Severity: Minor
    Found in third-party/uswds-0.13.1/js/uswds.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 10 has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    },{"../utils/select":23,"./toggle-field-mask":8}],10:[function(require,module,exports){
    var select = require('../utils/select');
    var addClass = require('../utils/add-class');
    var removeClass = require('../utils/remove-class');
    var dispatch = require('../utils/dispatch');
    Severity: Minor
    Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix

      Function dispatch has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function dispatch (element, eventTypes, listener, options) {
        var eventTypeArray = eventTypes.split(/\s+/);
      
        var attach = function (e, t, d) {
          if (e.attachEvent) {
      Severity: Minor
      Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix

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

          var detach = function (e, t, d) {
            if (e.detachEvent) {
              e.detachEvent('on' + t, d, options);
            }
            if (e.removeEventListener) {
        Severity: Major
        Found in third-party/uswds-0.13.1/js/uswds.js and 1 other location - About 1 hr to fix
        third-party/uswds-0.13.1/js/uswds.js on lines 1239..1246

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

        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 attach = function (e, t, d) {
            if (e.attachEvent) {
              e.attachEvent('on' + t, d, options);
            }
            if (e.addEventListener) {
        Severity: Major
        Found in third-party/uswds-0.13.1/js/uswds.js and 1 other location - About 1 hr to fix
        third-party/uswds-0.13.1/js/uswds.js on lines 1263..1270

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

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

        },{}],9:[function(require,module,exports){
        var toggleFieldMask = require('./toggle-field-mask');
        var select = require('../utils/select');
        
        /**
        Severity: Minor
        Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix

          Function 16 has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{"../components/header/mobile":6,"../components/header/search":7,"../utils/when-dom-ready":25}],16:[function(require,module,exports){
          var verifyjQuery = require('../utils/verify-jquery');
          
          // jQuery Plugin
          
          
          Severity: Minor
          Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix

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

            },{"../utils/add-class":20,"../utils/dispatch":21,"../utils/remove-class":22,"../utils/select":23}],5:[function(require,module,exports){
            var select = require('../utils/select');
            var addClass = require('../utils/add-class');
            var removeClass = require('../utils/remove-class');
            var dispatch = require('../utils/dispatch');
            Severity: Minor
            Found in third-party/uswds-0.13.1/js/uswds.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 6 has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            },{"../utils/add-class":20,"../utils/dispatch":21,"../utils/remove-class":22,"../utils/select":23}],6:[function(require,module,exports){
            var select = require('../../utils/select');
            var addClass = require('../../utils/add-class');
            var removeClass = require('../../utils/remove-class');
            var dispatch = require('../../utils/dispatch');
            Severity: Minor
            Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix

              Function _divideIntoArray has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  Politespace.prototype._divideIntoArray = function( value ) {
                      var split = ( '' + this.groupLength ).split( ',' ),
                          isUniformSplit = split.length === 1,
                          dividedValue = [],
                          loopIndex = 0,
              Severity: Minor
              Found in third-party/uswds-0.13.1/js/uswds.js - About 1 hr to fix

                Function 7 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                },{"../../utils/add-class":20,"../../utils/dispatch":21,"../../utils/remove-class":22,"../../utils/select":23}],7:[function(require,module,exports){
                var select = require('../../utils/select');
                var addClass = require('../../utils/add-class');
                var removeClass = require('../../utils/remove-class');
                var dispatch = require('../../utils/dispatch');
                Severity: Minor
                Found in third-party/uswds-0.13.1/js/uswds.js - About 55 mins 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 submit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                def submit(request, id=None,
                           template_name='specialuseform/submit.html'):
                    if id:
                        permit = get_object_or_404(NonCommercialUsePermit, id=id)
                        submit_button_text = 'Save Changes'
                Severity: Minor
                Found in forestserviceprototype/specialuseform/views.py - About 45 mins 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

                        migrations.AlterField(
                            model_name='noncommercialusepermit',
                            name='end_date',
                            field=models.DateTimeField(default=django.utils.timezone.now, help_text='Format: MM/DD/YYYY HH:MM', verbose_name='End date and time'),
                forestserviceprototype/specialuseform/migrations/0018_auto_20170301_1952.py on lines 54..57

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

                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

                        migrations.AlterField(
                            model_name='noncommercialusepermit',
                            name='start_date',
                            field=models.DateTimeField(default=django.utils.timezone.now, help_text='Format: MM/DD/YYYY HH:MM', verbose_name='Start date and time'),
                forestserviceprototype/specialuseform/migrations/0018_auto_20170301_1952.py on lines 29..32

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

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

                        migrations.AlterField(
                            model_name='permit',
                            name='end_date',
                            field=models.DateTimeField(default=django.utils.timezone.now, help_text='For example: 04 28 1986'),
                forestserviceprototype/specialuseform/migrations/0004_auto_20160922_1552.py on lines 40..43
                forestserviceprototype/specialuseform/migrations/0012_auto_20161006_1617.py on lines 16..19
                forestserviceprototype/specialuseform/migrations/0012_auto_20161006_1617.py on lines 26..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 32.

                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

                                ('status', models.CharField(choices=[('needs_approval', 'Needs Approval'), ('approved', 'Approved'), ('in_review', 'In Review'), ('not_approved', 'Not Approved')], default='needs_approval', max_length=10)),
                forestserviceprototype/specialuseform/migrations/0003_auto_20160922_1404.py on lines 15..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 32.

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

                        migrations.AlterField(
                            model_name='permit',
                            name='start_date',
                            field=models.DateTimeField(default=django.utils.timezone.now, help_text='For example: 04 28 1986'),
                forestserviceprototype/specialuseform/migrations/0004_auto_20160922_1552.py on lines 30..33
                forestserviceprototype/specialuseform/migrations/0012_auto_20161006_1617.py on lines 16..19
                forestserviceprototype/specialuseform/migrations/0012_auto_20161006_1617.py on lines 26..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 32.

                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

                        migrations.AlterField(
                            model_name='noncommercialusepermit',
                            name='spectator_number',
                            field=models.IntegerField(blank=True, help_text='If your event will have spectators (such as at a sporting event), please note how many additional people will be spectators', null=True, verbose_name='Number of spectators'),
                forestserviceprototype/specialuseform/migrations/0017_auto_20161221_1608.py on lines 14..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 32.

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

                        migrations.AlterField(
                            model_name='permit',
                            name='end_date',
                            field=models.DateTimeField(default=django.utils.timezone.now, help_text='Format: MM/DD/YYYY'),
                forestserviceprototype/specialuseform/migrations/0004_auto_20160922_1552.py on lines 30..33
                forestserviceprototype/specialuseform/migrations/0004_auto_20160922_1552.py on lines 40..43
                forestserviceprototype/specialuseform/migrations/0012_auto_20161006_1617.py on lines 26..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 32.

                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