atsid/circuits-js

View on GitHub

Showing 90 of 90 total issues

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

            it("testOnItemWithUndeclared",  function () {
                var service = factory.getService(CaseService, {}),
                    shouldBe40,
                    shouldBeNewStr,
                    shouldBeNull,
Severity: Major
Found in test/TestGetValuePlugin.js and 1 other location - About 1 day to fix
test/TestGetValuePlugin.js on lines 67..89

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

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

            it("testOnItemWithDeclaredButUndefinedProps",  function () {
                var service = factory.getService(CaseService, {}),
                    shouldBe40,
                    shouldBeNewStr,
                    shouldBeNull,
Severity: Major
Found in test/TestGetValuePlugin.js and 1 other location - About 1 day to fix
test/TestGetValuePlugin.js on lines 110..132

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

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

            it("testWithNoFilterAndSortAscendingId",  function () {
                var filter = function (obj) { return true; };

                    sort = [{attribute: 'id', descending: false}],
                    newData;
Severity: Major
Found in test/TestDojoSimpleQueryFilterSortPlugin.js and 1 other location - About 1 day to fix
test/TestDojoSimpleQueryFilterSortPlugin.js on lines 88..104

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

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

            it("testWithNoFilterAndSortDescendingName",  function () {
                var filter = function (obj) { return true; };

                    sort = [{attribute: 'name', descending: true}],
                    newData;
Severity: Major
Found in test/TestDojoSimpleQueryFilterSortPlugin.js and 1 other location - About 1 day to fix
test/TestDojoSimpleQueryFilterSortPlugin.js on lines 110..126

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

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

            update: function (params) {

                var payload = dojo.toJson(params.payload),
                    request = new Request({
                        url: params.url,
Severity: Major
Found in js/DojoXhrDataProvider.js and 1 other location - About 6 hrs to fix
js/DojoXhrDataProvider.js on lines 34..53

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

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

            create: function (params) {

                var payload = dojo.toJson(params.payload),
                    request = new Request({
                        url: params.url,
Severity: Major
Found in js/DojoXhrDataProvider.js and 1 other location - About 6 hrs to fix
js/DojoXhrDataProvider.js on lines 73..92

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

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

            constructor: function (schema, refResolver) {

                logger.debug("Creating reader for schema", schema);

                if (!refResolver) {
Severity: Major
Found in js/ZypSMDReader.js - About 4 hrs to fix

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

                it("testDelete",  function () {
                    this.mockDelegate.offline = true;
                    var req = this.provider.del({
                        url: "delete/resource/1",
                        payload: {
    Severity: Major
    Found in test/TestOfflineTolerantProvider.js and 1 other location - About 4 hrs to fix
    test/TestOfflineTolerantProvider.js on lines 69..84

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

    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

                it("testUpdate",  function () {
                    this.mockDelegate.offline = true;
                    var req = this.provider.update({
                        url: "update/resource/1",
                        payload: {
    Severity: Major
    Found in test/TestOfflineTolerantProvider.js and 1 other location - About 4 hrs to fix
    test/TestOfflineTolerantProvider.js on lines 87..102

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

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

                constructor: function (reader, provider, factoryPlugins, servicePlugins) {
    
                    var that = this,
                        methodsHash = {},
                        methodsArr = [],
    Severity: Major
    Found in js/Service.js - About 3 hrs to fix

      Function constructor has 94 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                      constructor: function () {
                          this.type = "mixin";
      
                          this.fn = function (service) {
                              service.methodName = this.methodName;
      Severity: Major
      Found in js/plugins/DojoReadApiPlugin.js - About 3 hrs to fix

        Function fn has 91 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                            this.fn = function (service) {
                                service.methodName = this.methodName;
                                service.methodArgs = this.methodArgs;
                                service.identityAttributes = this.identityAttributes;
        
        Severity: Major
        Found in js/plugins/DojoReadApiPlugin.js - About 3 hrs to fix

          File ZypSMDReader.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          "use strict";
          /**
           * Parses an SMD and provides methods to read information from it for working with RESTful services.
           * Uses the format defined by Kris Zyp and utilized by Dojo for RPC stores
           */
          Severity: Minor
          Found in js/ZypSMDReader.js - About 3 hrs to fix

            Function constructor has 80 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    constructor: function (config) {
                        var calls = [], executed = false,
                            requests = [];
            
                        this.autoRefreshInterval = config.autoRefreshInterval || 0;
            Severity: Major
            Found in js/ServiceQueue.js - About 3 hrs to fix

              Function constructor has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          constructor: function (delegate) {
              
                              var storage = new WebStorage(),
                                  cacheId = "circuits.retrycache",
              
              Severity: Major
              Found in js/OfflineTolerantProvider.js - About 3 hrs to fix

                Function invoke has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            invoke: function (params, plugins) {
                                logger.debug("Calling service method: " + this.name + " with params", params);
                
                                var that = this,
                                    provider = this.provider,
                Severity: Major
                Found in js/ServiceMethod.js - About 2 hrs to fix

                  File TestPluginMatcher.js has 280 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  define([
                      "circuits/PluginMatcher",
                      "circuits/util",
                      "circuits/declare"
                  ], function (
                  Severity: Minor
                  Found in test/TestPluginMatcher.js - About 2 hrs to fix

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

                                    update: function (params) {
                                        var ret = sclone(this.resp);
                                        ret.model.updatedByMock = true;
                                        params.request = new Request({}, function () {
                                            params.handler.call(b, 200, ret, params);
                    Severity: Major
                    Found in test/TestServicePlugins.js and 2 other locations - About 2 hrs to fix
                    test/TestServicePlugins.js on lines 58..65
                    test/TestServicePlugins.js on lines 88..95

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

                    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

                                    del: function (params) {
                                        var ret = sclone(this.resp);
                                        ret.model.deletedByMock = true;
                                        params.request = new Request({}, function () {
                                            params.handler.call(b, 200, ret, params);
                    Severity: Major
                    Found in test/TestServicePlugins.js and 2 other locations - About 2 hrs to fix
                    test/TestServicePlugins.js on lines 58..65
                    test/TestServicePlugins.js on lines 80..87

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

                    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

                                    create: function (params) {
                                        var ret = sclone(this.resp);
                                        ret.model.ceatedByMock = true;
                                        params.request = new Request({}, function () {
                                            params.handler.call(b, 200, ret, params);
                    Severity: Major
                    Found in test/TestServicePlugins.js and 2 other locations - About 2 hrs to fix
                    test/TestServicePlugins.js on lines 80..87
                    test/TestServicePlugins.js on lines 88..95

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

                    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