endpoints/endpoints

View on GitHub

Showing 31 of 109 total issues

Function JsonApiFormat has 193 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var JsonApiFormat = (function () {

  /**
   * The constructor.
   *
Severity: Major
Found in es5/format-jsonapi/index.js - About 7 hrs to fix

    Function JsonApiFormat has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Open

    var JsonApiFormat = (function () {
    
      /**
       * The constructor.
       *
    Severity: Minor
    Found in es5/format-jsonapi/index.js - About 6 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function RequestHandler has 134 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var RequestHandler = (function () {
    
      /**
        The constructor.
         @constructs RequestHandler
    Severity: Major
    Found in es5/request-handler/index.js - About 5 hrs to fix

      Function RequestHandler has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

      var RequestHandler = (function () {
      
        /**
          The constructor.
           @constructs RequestHandler
      Severity: Minor
      Found in es5/request-handler/index.js - About 4 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function Controller has 106 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var Controller = (function () {
        Controller.extend = function extend() {
          var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
      
          return (function (_ref) {
      Severity: Major
      Found in es5/controller/index.js - About 4 hrs to fix

        Function PayloadHandler has 105 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var PayloadHandler = (function () {
          function PayloadHandler(formatter) {
            _classCallCheck(this, PayloadHandler);
        
            this.formatter = formatter;
        Severity: Major
        Found in es5/payload-handler/index.js - About 4 hrs to fix

          Function Application has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var Application = (function () {
            function Application(opts) {
              _classCallCheck(this, Application);
          
              this._resources = {};
          Severity: Major
          Found in es5/application/index.js - About 2 hrs to fix

            Function Application has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            var Application = (function () {
              function Application(opts) {
                _classCallCheck(this, Application);
            
                this._resources = {};
            Severity: Minor
            Found in es5/application/index.js - About 2 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function Controller has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            var Controller = (function () {
              Controller.extend = function extend() {
                var props = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
            
                return (function (_ref) {
            Severity: Minor
            Found in es5/controller/index.js - About 2 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function _interopRequireWildcard has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
            Severity: Minor
            Found in es5/controller/lib/handle.js - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function PayloadHandler has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            var PayloadHandler = (function () {
              function PayloadHandler(formatter) {
                _classCallCheck(this, PayloadHandler);
            
                this.formatter = formatter;
            Severity: Minor
            Found in es5/payload-handler/index.js - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function default has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function (file, searchPaths) {
              if (!searchPaths) {
                throw new Error('No searchPaths specified.');
              }
              var result = null;
            Severity: Minor
            Found in src/application/lib/require_search.js - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function process has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              JsonApiFormat.prototype.process = function process(input) {
                var _this = this;
            
                var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
                var singleResult = opts.singleResult;
            Severity: Minor
            Found in es5/format-jsonapi/index.js - About 1 hr to fix

              Function error has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                PayloadHandler.prototype.error = function error(errs, defaultErr) {
                  var resp;
              
                  defaultErr = defaultErr || 400;
                  errs = errs || [_kapow2['default'](defaultErr)];
              Severity: Minor
              Found in es5/payload-handler/index.js - About 1 hr to fix

                Function destructure has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function destructure(model) {
                  var params = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
                
                  var relationships = params.relationships || {};
                  var relationshipNames = _lodash2['default'].keys(relationships);
                Severity: Minor
                Found in es5/store-bookshelf/lib/destructure.js - About 1 hr to fix

                  Function error has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    error (errs, defaultErr) {
                      var resp;
                  
                      defaultErr = defaultErr || 400;
                      errs = errs || [Kapow(defaultErr)];
                  Severity: Minor
                  Found in src/payload-handler/index.js - About 1 hr to fix

                    Function validate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      validate (request) {
                    
                        var err;
                        var validators = [];
                    
                    
                    Severity: Minor
                    Found in src/request-handler/index.js - About 1 hr to fix

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

                      export default function destructure (model, params={}) {
                        const relationships = params.relationships || {};
                        const relationshipNames = _.keys(relationships);
                        const allRels = allRelations(model);
                        const toOneRelsMap = toOneRelations(model);
                      Severity: Minor
                      Found in src/store-bookshelf/lib/destructure.js - About 1 hr to fix

                        Function validate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                          validate (request) {
                        
                            var err;
                            var validators = [];
                        
                        
                        Severity: Minor
                        Found in src/request-handler/index.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function read has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function read(model) {
                          var query = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
                          var mode = arguments.length <= 2 || arguments[2] === undefined ? 'read' : arguments[2];
                        
                          return _columns2['default'](model).then(function (modelColumns) {
                        Severity: Minor
                        Found in es5/store-bookshelf/lib/read.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language