ablanco/yith-library-web-client

View on GitHub
yithwebclient/static/js/prod/yith-1.0.2.js

Summary

Maintainability
F
1 mo
Test Coverage

File yith-1.0.2.js has 800 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Source: yithwebclient/static/js/app.js


// Yith Library web client
// Copyright (C) 2012 - 2013  Alejandro Blanco <alejandro.b.e@gmail.com>
Severity: Major
Found in yithwebclient/static/js/prod/yith-1.0.2.js - About 1 day to fix

    Function askMasterPassword has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            askMasterPassword: function (callback, changeMaster) {
                var firstTime = Yith.ViewsUtils.masterModal === undefined,
                    keyHandler,
                    $master,
                    $newMaster;
    Severity: Major
    Found in yithwebclient/static/js/prod/yith-1.0.2.js - About 2 hrs to fix

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

              click: function (evt) {
                  var that = this;
      
                  Yith.ViewsUtils.askMasterPassword(function (masterPassword) {
                      var $node = $(evt.target).parents("tr"),
      Severity: Minor
      Found in yithwebclient/static/js/prod/yith-1.0.2.js - About 1 hr to fix

        Function processedPasswordList has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                processedPasswordList: Ember.computed(function () {
                    var filters = this.activeFilters,
                        that = this,
                        result;
        
        
        Severity: Minor
        Found in yithwebclient/static/js/prod/yith-1.0.2.js - About 1 hr to fix

          Function save has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  save: function ($form) {
                      if (this.validate($form)) {
                          var data = this.getFormData($form, (new Date()).getTime()),
                              that = this,
                              callback;
          Severity: Minor
          Found in yithwebclient/static/js/prod/yith-1.0.2.js - About 1 hr to fix

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

            (function () {
                "use strict";
            
                Yith.ViewsUtils = {
                    askMasterPassword: function (callback, changeMaster) {
            Severity: Major
            Found in yithwebclient/static/js/prod/yith-1.0.2.js and 2 other locations - About 3 wks to fix
            yithwebclient/static/js/prod/yith-1.0.0.js on lines 614..1070
            yithwebclient/static/js/prod/yith-1.0.1.js on lines 618..1074

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

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

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

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

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

            Refactorings

            Further Reading

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

            (function () {
                "use strict";
            
                Yith.ControllersUtils = {
                    oneDayInMilliseconds: 86400000,
            Severity: Major
            Found in yithwebclient/static/js/prod/yith-1.0.2.js and 1 other location - About 2 wks to fix
            yithwebclient/static/js/prod/yith-1.0.1.js on lines 257..595

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

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

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

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

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

            Refactorings

            Further Reading

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

            (function () {
                "use strict";
                window.Yith = Ember.Application.create({});
                // Wait until we have the access code
                Yith.deferReadiness();
            Severity: Major
            Found in yithwebclient/static/js/prod/yith-1.0.2.js and 2 other locations - About 4 days to fix
            yithwebclient/static/js/prod/yith-1.0.0.js on lines 20..106
            yithwebclient/static/js/prod/yith-1.0.1.js on lines 20..106

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

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

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

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

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

            Refactorings

            Further Reading

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

            (function () {
                "use strict";
            
                Yith.SettingsObject = Ember.Object.extend({
                    disableCountdown: false,
            Severity: Major
            Found in yithwebclient/static/js/prod/yith-1.0.2.js and 2 other locations - About 2 days to fix
            yithwebclient/static/js/prod/yith-1.0.0.js on lines 128..176
            yithwebclient/static/js/prod/yith-1.0.1.js on lines 128..176

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

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

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

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

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

            Refactorings

            Further Reading

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

            (function () {
                "use strict";
            
                Yith.Password = DS.Model.extend({
                    account: DS.attr(),
            Severity: Major
            Found in yithwebclient/static/js/prod/yith-1.0.2.js and 2 other locations - About 2 days to fix
            yithwebclient/static/js/prod/yith-1.0.0.js on lines 197..235
            yithwebclient/static/js/prod/yith-1.0.1.js on lines 197..235

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

            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