gecos-team/gecoscc-ui

View on GitHub
gecoscc/static/js/app.js

Summary

Maintainability
F
1 wk
Test Coverage

File app.js has 759 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*jslint browser: true, vars: false, nomen: true */
/*global App: true, Backbone, jQuery, _, gettext, MessageManager */

/*
* Copyright 2013, Junta de Andalucia
Severity: Major
Found in gecoscc/static/js/app.js - About 1 day to fix

    Function loadItem has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                loadItem: function (containerid, type, itemid, tab) {
                    var Model, model, View, view, skipFetch;
    
                    this._prepare(containerid, type, itemid);
                    App.tree.currentView.activeNode = itemid;
    Severity: Minor
    Found in gecoscc/static/js/app.js - About 1 hr to fix

      Function onRender has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              onRender: function() {
                  var $button = this.$el.find('div.seeAll'),
                      that = this;
                  if ($button.hasClass('admin') == false) {
                      $button.addClass('hidden');
      Severity: Minor
      Found in gecoscc/static/js/app.js - About 1 hr to fix

        Function newItem has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    newItem: function (containerid, type) {
                        var Model, model, View, view, parent, path, domain,
                            that = this;
        
                        //First Level Ous can create onlly OUs
        Severity: Minor
        Found in gecoscc/static/js/app.js - About 1 hr to fix

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

                      _fetchModel: function (model) {
                          model.fetch().done(function () {
                              var children = App.instances.tree.get("tree").children,
                                  isRoot = _.some(children, function (child) {
                                      return child.model.id === model.id;
          Severity: Minor
          Found in gecoscc/static/js/app.js - About 1 hr to fix

            Function serializeData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    serializeData: function () {
                        var paginator = [],
                            inRange = this.collection.pagesInRange,
                            pages = inRange * 2 + 1,
                            current = this.collection.currentPage,
            Severity: Minor
            Found in gecoscc/static/js/app.js - About 1 hr to fix

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

                          search: function (keyword, parameters) {
                              var params = parameters.split('&');
                              var dparameters = []
                              for (var p in params) {
                                  var res = params[p].split("=");
              Severity: Minor
              Found in gecoscc/static/js/app.js - About 1 hr to fix

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

                        archiveTasks: function (evt) {
                            var that = this;
                            evt.preventDefault();
                            $.ajax({
                                url: '/api/archive_jobs/',
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 6 hrs to fix
                gecoscc/static/js/app.js on lines 304..322

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

                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

                        archiveTasks: function (evt) {
                            var that = this;
                            evt.preventDefault();
                            $.ajax({
                                url: '/api/archive_jobs/',
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 6 hrs to fix
                gecoscc/static/js/app.js on lines 148..166

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

                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

                            if ($el.is(".previous")) {
                                page = this.collection.currentPage - 1;
                            } else if ($el.is(".next")) {
                                page = this.collection.currentPage + 1;
                            } else {
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 2 hrs to fix
                gecoscc/static/js/policies.js on lines 456..462

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 92.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                        serializeData: function () {
                            return {
                                "finished": this.model.attributes.finished,
                                "errors": this.model.attributes.errors,
                                "processing": this.model.attributes.processing,
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 2 hrs to fix
                gecoscc/static/js/app.js on lines 375..382

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

                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

                        serializeData: function () {
                            return {
                                "finished": this.model.attributes.finished,
                                "errors": this.model.attributes.errors,
                                "processing": this.model.attributes.processing,
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 2 hrs to fix
                gecoscc/static/js/app.js on lines 344..351

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

                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

                        minimize: function (evt) {
                            evt.preventDefault();
                            
                            // Hide maximized events container
                            $('#events-container').hide();            
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 2 hrs to fix
                gecoscc/static/js/app.js on lines 324..335

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

                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

                        maximize: function (evt) {
                            evt.preventDefault();
                            
                            // Hide events summary
                            $('#events-summary-container').hide();
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 2 hrs to fix
                gecoscc/static/js/app.js on lines 168..179

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

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

                                if (_.isUndefined(App.instances.myjob_statistics)) {
                                    App.instances.myjob_statistics = new App.Job.Models.MyJobStatistics();
                                    App.instances.myjob_statistics.fetch();
                                }
                Severity: Major
                Found in gecoscc/static/js/app.js and 7 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 435..438
                gecoscc/static/js/app.js on lines 439..442
                gecoscc/static/js/app.js on lines 443..446
                gecoscc/static/js/app.js on lines 468..471
                gecoscc/static/js/app.js on lines 472..475
                gecoscc/static/js/app.js on lines 817..820
                gecoscc/static/js/app.js on lines 821..824

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

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

                        if (_.isUndefined(App.instances.myjob_statistics)) {
                            App.instances.myjob_statistics = new App.Job.Models.MyJobStatistics();
                            App.instances.myjob_statistics.fetch();
                        }
                Severity: Major
                Found in gecoscc/static/js/app.js and 7 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 435..438
                gecoscc/static/js/app.js on lines 439..442
                gecoscc/static/js/app.js on lines 443..446
                gecoscc/static/js/app.js on lines 468..471
                gecoscc/static/js/app.js on lines 472..475
                gecoscc/static/js/app.js on lines 476..479
                gecoscc/static/js/app.js on lines 817..820

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

                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; i < pages; i += 1) {
                                page = current - inRange + i;
                                if (page > 0 && page <= total) {
                                    paginator.push([page, page === current]);
                                }
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 1 hr to fix
                gecoscc/static/js/policies.js on lines 428..433

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

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

                                if (_.isUndefined(App.instances.job_statistics)) {
                                    App.instances.job_statistics = new App.Job.Models.JobStatistics();
                                    App.instances.job_statistics.fetch();
                                }
                Severity: Major
                Found in gecoscc/static/js/app.js and 7 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 435..438
                gecoscc/static/js/app.js on lines 443..446
                gecoscc/static/js/app.js on lines 468..471
                gecoscc/static/js/app.js on lines 472..475
                gecoscc/static/js/app.js on lines 476..479
                gecoscc/static/js/app.js on lines 817..820
                gecoscc/static/js/app.js on lines 821..824

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

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

                                if (_.isUndefined(App.instances.job_collection)) {
                                    App.instances.job_collection = new App.Job.Models.JobCollection();
                                    App.instances.job_collection.fetch();
                                }
                Severity: Major
                Found in gecoscc/static/js/app.js and 7 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 435..438
                gecoscc/static/js/app.js on lines 439..442
                gecoscc/static/js/app.js on lines 443..446
                gecoscc/static/js/app.js on lines 472..475
                gecoscc/static/js/app.js on lines 476..479
                gecoscc/static/js/app.js on lines 817..820
                gecoscc/static/js/app.js on lines 821..824

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

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

                                if (_.isUndefined(App.instances.myjob_statistics)) {
                                    App.instances.myjob_statistics = new App.Job.Models.MyJobStatistics();
                                    App.instances.myjob_statistics.fetch();
                                }
                Severity: Major
                Found in gecoscc/static/js/app.js and 7 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 435..438
                gecoscc/static/js/app.js on lines 439..442
                gecoscc/static/js/app.js on lines 468..471
                gecoscc/static/js/app.js on lines 472..475
                gecoscc/static/js/app.js on lines 476..479
                gecoscc/static/js/app.js on lines 817..820
                gecoscc/static/js/app.js on lines 821..824

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

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

                        if (_.isUndefined(App.instances.job_collection)) {
                            App.instances.job_collection = new App.Job.Models.JobCollection();
                            App.instances.job_collection.fetch();
                        }
                Severity: Major
                Found in gecoscc/static/js/app.js and 7 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 435..438
                gecoscc/static/js/app.js on lines 439..442
                gecoscc/static/js/app.js on lines 443..446
                gecoscc/static/js/app.js on lines 468..471
                gecoscc/static/js/app.js on lines 472..475
                gecoscc/static/js/app.js on lines 476..479
                gecoscc/static/js/app.js on lines 821..824

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

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

                                if (_.isUndefined(App.instances.job_collection)) {
                                    App.instances.job_collection = new App.Job.Models.JobCollection();
                                    App.instances.job_collection.fetch();
                                }
                Severity: Major
                Found in gecoscc/static/js/app.js and 7 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 439..442
                gecoscc/static/js/app.js on lines 443..446
                gecoscc/static/js/app.js on lines 468..471
                gecoscc/static/js/app.js on lines 472..475
                gecoscc/static/js/app.js on lines 476..479
                gecoscc/static/js/app.js on lines 817..820
                gecoscc/static/js/app.js on lines 821..824

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

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

                                if (_.isUndefined(App.instances.job_statistics)) {
                                    App.instances.job_statistics = new App.Job.Models.JobStatistics();
                                    App.instances.job_statistics.fetch();
                                }
                Severity: Major
                Found in gecoscc/static/js/app.js and 7 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 435..438
                gecoscc/static/js/app.js on lines 439..442
                gecoscc/static/js/app.js on lines 443..446
                gecoscc/static/js/app.js on lines 468..471
                gecoscc/static/js/app.js on lines 476..479
                gecoscc/static/js/app.js on lines 817..820
                gecoscc/static/js/app.js on lines 821..824

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

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                            var paginator = [],
                                inRange = this.collection.pagesInRange,
                                pages = inRange * 2 + 1,
                                current = this.collection.currentPage,
                                total = this.collection.totalPages,
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 1 hr to fix
                gecoscc/static/js/policies.js on lines 420..426

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

                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

                        refresh: function () {
                            App.instances.job_collection.fetch();
                            App.instances.job_statistics.fetch();
                            App.instances.myjob_statistics.fetch();
                        },
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 1 hr to fix
                gecoscc/static/js/app.js on lines 92..96

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

                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

                        refresh: function () {
                            App.instances.job_collection.fetch();
                            App.instances.job_statistics.fetch();
                            App.instances.myjob_statistics.fetch();
                        },
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 1 hr to fix
                gecoscc/static/js/app.js on lines 298..302

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

                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

                        tasksAll: function (evt) {
                            evt.preventDefault();
                            this.collection.status = '';
                            this.collection.archived = false;
                            this.tasksFilter();
                Severity: Major
                Found in gecoscc/static/js/app.js and 6 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 107..112
                gecoscc/static/js/app.js on lines 113..118
                gecoscc/static/js/app.js on lines 119..124
                gecoscc/static/js/app.js on lines 125..130
                gecoscc/static/js/app.js on lines 131..136
                gecoscc/static/js/app.js on lines 137..142

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

                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

                        tasksProcessing: function (evt) {
                            evt.preventDefault();
                            this.collection.status = 'processing';
                            this.collection.archived = false;
                            this.tasksFilter();
                Severity: Major
                Found in gecoscc/static/js/app.js and 6 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 101..106
                gecoscc/static/js/app.js on lines 113..118
                gecoscc/static/js/app.js on lines 119..124
                gecoscc/static/js/app.js on lines 125..130
                gecoscc/static/js/app.js on lines 131..136
                gecoscc/static/js/app.js on lines 137..142

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

                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

                        tasksFinished: function (evt) {
                            evt.preventDefault();
                            this.collection.status = 'finished';
                            this.collection.archived = false;
                            this.tasksFilter();
                Severity: Major
                Found in gecoscc/static/js/app.js and 6 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 101..106
                gecoscc/static/js/app.js on lines 107..112
                gecoscc/static/js/app.js on lines 119..124
                gecoscc/static/js/app.js on lines 125..130
                gecoscc/static/js/app.js on lines 131..136
                gecoscc/static/js/app.js on lines 137..142

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

                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

                        tasksErrors: function (evt) {
                            evt.preventDefault();
                            this.collection.status = 'errors';
                            this.collection.archived = false;
                            this.tasksFilter();
                Severity: Major
                Found in gecoscc/static/js/app.js and 6 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 101..106
                gecoscc/static/js/app.js on lines 107..112
                gecoscc/static/js/app.js on lines 113..118
                gecoscc/static/js/app.js on lines 125..130
                gecoscc/static/js/app.js on lines 131..136
                gecoscc/static/js/app.js on lines 137..142

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

                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

                        tasksActives: function (evt) {
                            evt.preventDefault();
                            this.collection.status = '';
                            this.collection.archived = false;
                            this.tasksFilter();
                Severity: Major
                Found in gecoscc/static/js/app.js and 6 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 101..106
                gecoscc/static/js/app.js on lines 107..112
                gecoscc/static/js/app.js on lines 113..118
                gecoscc/static/js/app.js on lines 119..124
                gecoscc/static/js/app.js on lines 125..130
                gecoscc/static/js/app.js on lines 137..142

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

                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

                        tasksWarnings: function (evt) {
                            evt.preventDefault();
                            this.collection.status = 'warnings';
                            this.collection.archived = false;
                            this.tasksFilter();
                Severity: Major
                Found in gecoscc/static/js/app.js and 6 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 101..106
                gecoscc/static/js/app.js on lines 107..112
                gecoscc/static/js/app.js on lines 113..118
                gecoscc/static/js/app.js on lines 119..124
                gecoscc/static/js/app.js on lines 131..136
                gecoscc/static/js/app.js on lines 137..142

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

                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

                        tasksArchived: function (evt) {
                            evt.preventDefault();
                            this.collection.status = '';
                            this.collection.archived = true;
                            this.tasksFilter();
                Severity: Major
                Found in gecoscc/static/js/app.js and 6 other locations - About 1 hr to fix
                gecoscc/static/js/app.js on lines 101..106
                gecoscc/static/js/app.js on lines 107..112
                gecoscc/static/js/app.js on lines 113..118
                gecoscc/static/js/app.js on lines 119..124
                gecoscc/static/js/app.js on lines 125..130
                gecoscc/static/js/app.js on lines 131..136

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

                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

                        App.instances.message_manager.bind('change', function (result) {
                            App.instances.cache.drop(result.objectId);
                            App.trigger('action_change', result);
                        });
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 1 hr to fix
                gecoscc/static/js/app.js on lines 838..841

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

                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

                        App.instances.message_manager.bind('delete', function (result) {
                            App.instances.cache.drop(result.objectId);
                            App.trigger('action_delete', result);
                        });
                Severity: Major
                Found in gecoscc/static/js/app.js and 1 other location - About 1 hr to fix
                gecoscc/static/js/app.js on lines 834..837

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

                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

                            this.collection.workstation = this.$el.find('#tasksByWorkstation').val().trim() || undefined;
                Severity: Minor
                Found in gecoscc/static/js/app.js and 2 other locations - About 30 mins to fix
                gecoscc/static/js/app.js on lines 75..75
                gecoscc/static/js/app.js on lines 77..77

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

                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

                            this.collection.userfilter  = this.$el.find('#tasksByUser').val().trim() || undefined;
                Severity: Minor
                Found in gecoscc/static/js/app.js and 2 other locations - About 30 mins to fix
                gecoscc/static/js/app.js on lines 76..76
                gecoscc/static/js/app.js on lines 77..77

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

                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

                            this.collection.source      = this.$el.find("#tasksBySource").val().trim() || undefined; 
                Severity: Minor
                Found in gecoscc/static/js/app.js and 2 other locations - About 30 mins to fix
                gecoscc/static/js/app.js on lines 75..75
                gecoscc/static/js/app.js on lines 76..76

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

                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

                There are no issues that match your filters.

                Category
                Status