betajs/betajs-data

View on GitHub
src/data/stores/invokers/rest_invokers.js

Summary

Maintainability
F
3 days
Test Coverage

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

            constructor: function (storeInvokee, options) {
                inherited.constructor.call(this);
                this.__storeInvokee = storeInvokee;
                this.__options = Objs.tree_extend({
                    dataMap: {
Severity: Minor
Found in src/data/stores/invokers/rest_invokers.js - About 1 hr to fix

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

                constructor: function (restInvokee, options) {
                    inherited.constructor.call(this);
                    this.__restInvokee = restInvokee;
                    this.__options = Objs.tree_extend({
                        methodMap: {
    Severity: Minor
    Found in src/data/stores/invokers/rest_invokers.js - About 1 hr to fix

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

                  constructor: function (storeInvokee, options) {
                      inherited.constructor.call(this, storeInvokee, Objs.tree_extend({
                          baseURI: "/",
                          methodMap: {
                              "insert": "POST",
      Severity: Minor
      Found in src/data/stores/invokers/rest_invokers.js - About 1 hr to fix

        Function _toContext has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                     _toContext: function (member, uriData, post, get, ctx) {
        Severity: Minor
        Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

          Function restInvoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                       restInvoke: function (method, uri, post, get, ctx) {
          Severity: Minor
          Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

            Function routeredRestInvoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                        routeredRestInvoke: function (member, uriData, post, get, ctx) {
            Severity: Minor
            Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

              Function toContext has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                                  toContext: function (member, uriData, post, get, ctx) {
              Severity: Minor
              Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

                Function insert has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                                        "insert": function (member, uriData, post, get, ctx) {
                Severity: Minor
                Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

                  Function query has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                                          "query": function (member, uriData, post, get, ctx) {
                  Severity: Minor
                  Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

                    Function _toData has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                                 _toData: function (member, uriData, post, get, ctx) {
                    Severity: Minor
                    Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

                      Function remove has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                                              "remove": function (member, uriData, post, get, ctx) {
                      Severity: Minor
                      Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

                        Function update has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                                "update": function (member, uriData, post, get, ctx) {
                        Severity: Minor
                        Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

                          Function get has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                                  "get": function (member, uriData, post, get, ctx) {
                          Severity: Minor
                          Found in src/data/stores/invokers/rest_invokers.js - About 35 mins to fix

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

                                         _toData: function (member, uriData, post, get, ctx) {
                                            var data = null;
                                            if (this.__options.toData)
                                                data = this.__options.toData.call(this.__options.context, member, uriData, post, get, ctx);
                                            return data || (member in this.__options.dataMap ? this.__options.dataMap[member].call(this.__options.context, member, uriData, post, get, ctx) : null);
                            Severity: Major
                            Found in src/data/stores/invokers/rest_invokers.js and 1 other location - About 4 hrs to fix
                            src/data/stores/invokers/rest_invokers.js on lines 173..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 128.

                            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

                                         _toContext: function (member, uriData, post, get, ctx) {
                                            var data = null;
                                            if (this.__options.toContext)
                                                data = this.__options.toContext.call(this.__options.context, member, uriData, post, get, ctx);
                                            return data || (member in this.__options.contextMap ? this.__options.contextMap[member].call(this.__options.context, member, uriData, post, get, ctx) : null);
                            Severity: Major
                            Found in src/data/stores/invokers/rest_invokers.js and 1 other location - About 4 hrs to fix
                            src/data/stores/invokers/rest_invokers.js on lines 166..171

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

                            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

                                        _toGet: function (member, data, context) {
                                            var result = null;
                                            if (this.__options.toGet)
                                                result = this.__options.toGet.call(this.__options.context, member, data, context);
                                            return result || (member in this.__options.getMap ? this.__options.getMap[member].call(this.__options.context, data, context) : null);
                            Severity: Major
                            Found in src/data/stores/invokers/rest_invokers.js and 1 other location - About 4 hrs to fix
                            src/data/stores/invokers/rest_invokers.js on lines 82..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 121.

                            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

                                        _toData: function (member, data, context) {
                                            var result = null;
                                            if (this.__options.toData)
                                                result = this.__options.toData.call(this.__options.context, member, data, context);
                                            return result || (member in this.__options.dataMap ? this.__options.dataMap[member].call(this.__options.context, data, context) : null);
                            Severity: Major
                            Found in src/data/stores/invokers/rest_invokers.js and 1 other location - About 4 hrs to fix
                            src/data/stores/invokers/rest_invokers.js on lines 89..94

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

                            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