zackehh/oryx

View on GitHub

Showing 10 of 87 total issues

File model_routes.js has 981 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var async = require('async');
var bodyParser = require('body-parser');
var express = require('express');
var merge = require('lodash.merge');
var path = require('path');
Severity: Major
Found in test/model_routes.js - About 2 days to fix

    File routes.js has 594 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var express = require('express');
    var path = require('path');
    var should = require('should');
    var supertest = require('supertest');
    
    
    Severity: Major
    Found in test/routes.js - About 1 day to fix

      Function routes has 125 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Oryx.prototype.routes = function routes(opts, cb) {
        // ensure we parse function args correctly, in
        // case there are no options defined
        if (!cb && typeof opts === 'function') {
          cb = opts;
      Severity: Major
      Found in lib/oryx.js - About 5 hrs to fix

        File oryx.js has 282 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // core modules
        var fs = require('fs');
        var path = require('path');
        
        // npm modules
        Severity: Minor
        Found in lib/oryx.js - About 2 hrs to fix

          Function models has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Oryx.prototype.models = function models(opts, cb) {
            // ensure we parse function args correctly, in
            // case there are no options defined
            if (!cb && typeof opts === 'function') {
              cb = opts;
          Severity: Major
          Found in lib/oryx.js - About 2 hrs to fix

            File models.js has 258 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            var express = require('express');
            var path = require('path');
            var should = require('should');
            
            var Oryx = require('../');
            Severity: Minor
            Found in test/models.js - About 2 hrs to fix

              Function parameters has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function parameters(req, def) {
              
                // create and return a new Bluebird Promise
                // object to allow chaining onto this method
                return new Bluebird(function (resolve, reject) {
              Severity: Minor
              Found in lib/routes.js - About 1 hr to fix

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

                function Oryx(app, opts) {
                  // check for a valid application or agent
                  if(!app || !app.listen) {
                    throw new OryxError('Invalid app passed to Oryx!');
                  }
                Severity: Minor
                Found in lib/oryx.js - About 1 hr to fix

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

                  Oryx.prototype.routes = function routes(opts, cb) {
                    // ensure we parse function args correctly, in
                    // case there are no options defined
                    if (!cb && typeof opts === 'function') {
                      cb = opts;
                  Severity: Minor
                  Found in lib/oryx.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 models has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Oryx.prototype.models = function models(opts, cb) {
                    // ensure we parse function args correctly, in
                    // case there are no options defined
                    if (!cb && typeof opts === 'function') {
                      cb = opts;
                  Severity: Minor
                  Found in lib/oryx.js - About 25 mins 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

                  Severity
                  Category
                  Status
                  Source
                  Language