Showing 10 of 87 total issues
File model_routes.js
has 981 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var async = require('async');
var bodyParser = require('body-parser');
var express = require('express');
var merge = require('lodash.merge');
var path = require('path');
File routes.js
has 594 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var express = require('express');
var path = require('path');
var should = require('should');
var supertest = require('supertest');
Function routes
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
File oryx.js
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// core modules
var fs = require('fs');
var path = require('path');
// npm modules
Function models
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
File models.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var express = require('express');
var path = require('path');
var should = require('should');
var Oryx = require('../');
Function parameters
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function Oryx
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Oryx(app, opts) {
// check for a valid application or agent
if(!app || !app.listen) {
throw new OryxError('Invalid app passed to Oryx!');
}
Function routes
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
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;
- Read upRead up
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
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;
- Read upRead up
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"