atsid/circuits-js

View on GitHub

Showing 90 of 90 total issues

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

                            if (isList) {
                                payload.some(function (item, idx) {
                                    intermediate = plugin.fn.call(plugin.scope || plugin, item, that);
                                    payload[idx] = intermediate || payload[idx];
                                }, that);
Severity: Major
Found in js/ServiceMethod.js and 1 other location - About 1 hr to fix
js/ServiceMethod.js on lines 170..178

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

            it("testAddQueryParamsToUrl",  function () {
                var firstUrl = "blah/{noteName}/{caseNumber}/{documentId}/",
                    expectedUrl =
                        "blah/{noteName}/{caseNumber}/{documentId}/?caseNumber=90009528&documentId=17",
                    newUrl;
Severity: Major
Found in test/TestZypSMDReader.js and 1 other location - About 1 hr to fix
test/TestZypSMDReader.js on lines 326..337

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

            it("testReplacePathParamsInUrl",  function () {
                var firstUrl = "blah/noteName={noteName}/caseNum={caseNumber}/docId={documentId}/",
                    expectedUrl = "blah/noteName={noteName}/caseNum=90009528/docId=17/",
                    newUrl;
Severity: Major
Found in test/TestZypSMDReader.js and 1 other location - About 1 hr to fix
test/TestZypSMDReader.js on lines 345..357

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

            "readModel": {
                "target": "{modelNumber}",
                "transport": "GET",
                "description": "Get the details for a specific model.",
                "parameters": [
Severity: Major
Found in test/data/schema/SimpleTestServiceSchema.js and 1 other location - About 1 hr to fix
test/data/schema/JsTestDriverServiceSchema.js on lines 13..30

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

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

            "readModel": {
                "target": "{modelname}",
                "transport": "GET",
                "description": "Get the details for a specific model.",
                "parameters": [
Severity: Major
Found in test/data/schema/JsTestDriverServiceSchema.js and 1 other location - About 1 hr to fix
test/data/schema/SimpleTestServiceSchema.js on lines 44..61

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

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

            processResponse: function (statusCode, data, plugins, ioArgs) {
                var isList = this.reader.isListResponse(this.name),
                //TODO: "any" is JSONSchema default if no type is defined. this should come through a model though so we aren't tacking it on everywhere
                    returnType = this.reader.getResponseSchema(this.name).type || "any", //this could fail if there is no "returns" block on the method
                    payload,
Severity: Minor
Found in js/ServiceMethod.js - About 1 hr to fix

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

            invokeJsonpRequest: function (params) {
                var element = document.createElement('script'),
                    headElement = document.getElementsByTagName('head')[0],
                    load = params.load,
                    error = params.error,
    Severity: Minor
    Found in test/MockJsonpDataProvider.js - About 1 hr to fix

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

                  "readCase": {
                      "target": "{caseNumber}",
                      "transport": "GET",
                      "parameters": [
                          {
      Severity: Major
      Found in test/data/schema/services/CaseService.js and 1 other location - About 1 hr to fix
      test/data/schema/MinimalTestServiceSchema.js on lines 26..42

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

      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

                  "withEnvelope": {
                      "target": "{modelNumber}",
                      "description": "Get the details for a specific model.",
                      "parameters": [
                          {
      Severity: Major
      Found in test/data/schema/MinimalTestServiceSchema.js and 1 other location - About 1 hr to fix
      test/data/schema/services/CaseService.js on lines 25..41

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

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

                  this.execute = function (callback, scope) {
                      var that = this;
      
                      if (this.hasBeenExecuted()) {
                          if (!this.executionComplete()) {
      Severity: Minor
      Found in js/ServiceQueue.js - About 1 hr to fix

        Function invokeJsonpRequest has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    invokeJsonpRequest: function (params) {
                        var element = document.createElement('script'),
                            headElement = document.getElementsByTagName('head')[0],
                            load = params.load,
                            error = params.error,
        Severity: Minor
        Found in js/NativeJsonpDataProvider.js - About 1 hr to fix

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

                          handleError = function (err) {
                              window.clearTimeout(timeoutId);
                              delete window[jsonpCallback];
                              headElement.removeChild(element);
                              if (error) {
          Severity: Major
          Found in test/MockJsonpDataProvider.js and 1 other location - About 1 hr to fix
          js/NativeJsonpDataProvider.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 63.

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

                      function resolveProperties(schema) {
          
                          logger.debug("Resolving sub-properties for " + schema.id);
          
                          // resolve inherited global parameters
          Severity: Minor
          Found in js/ZypSMDReader.js - About 1 hr to fix

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

                                handleError = function (err) {
                                    window.clearTimeout(timeoutId);
                                    delete window[jsonpCallback];
                                    headElement.removeChild(element);
                                    if (error) {
            Severity: Major
            Found in js/NativeJsonpDataProvider.js and 1 other location - About 1 hr to fix
            test/MockJsonpDataProvider.js on lines 36..43

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

            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

                        getServiceByName: function (serviceName, plugins) {
                            logger.debug("Getting service: " + serviceName);
                            var smd = this.config.resolver(serviceName);
                            return this.getService(smd, plugins);
                        },
            Severity: Major
            Found in js/ServiceFactory.js and 1 other location - About 1 hr to fix
            js/ServiceFactory.js on lines 75..79

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

            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

                        getServiceForModel: function (modelName, plugins) {
                            logger.debug("Getting service for model: " + modelName);
                            var smd = this.config.resolverByModel(modelName);
                            return this.getService(smd, plugins);
                        },
            Severity: Major
            Found in js/ServiceFactory.js and 1 other location - About 1 hr to fix
            js/ServiceFactory.js on lines 88..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 60.

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

            module.exports = function(config){
              config.set({
                // base path, that will be used to resolve files and exclude
                basePath: '',
            
            
            Severity: Minor
            Found in karma.conf.js - About 1 hr to fix

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

                      it("testMatchMethodNameTrue",  function () {
                          assert.isTrue(matcher.match("CaseService.readCase", "*.readCase"));
                          assert.isTrue(matcher.match("CaseService.readCase", "*.*Case"));
                      });
              Severity: Major
              Found in test/TestPluginMatcher.js and 2 other locations - About 1 hr to fix
              test/TestPluginMatcher.js on lines 184..187
              test/TestPluginMatcher.js on lines 190..193

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

              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

                      it("testMatchServiceAndMethodNameEmptyString",  function () {
                          assert.isTrue(matcher.match("", "*"));
                          assert.isFalse(matcher.match("", "*.*"));
                      });
              Severity: Major
              Found in test/TestPluginMatcher.js and 2 other locations - About 1 hr to fix
              test/TestPluginMatcher.js on lines 173..176
              test/TestPluginMatcher.js on lines 184..187

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

              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

              define([
                  "../declare",
                  "./HandlerPlugin"
              ], function (
                  declare,
              Severity: Major
              Found in js/plugins/HandlerSuccessPlugin.js and 2 other locations - About 1 hr to fix
              js/plugins/HandlerErrorPlugin.js on lines 6..23
              js/plugins/HandlerTimeoutPlugin.js on lines 6..23

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

              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