Showing 50 of 580 total issues
Function pureecontrollers
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function pureecontrollers(){
return {
setup: function* (next) {
debug("beginning controller middleware setup");
- 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
File models.js
has 521 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* This module creates a wrapper around the orientose orm
*
* @module lib/models
* @link OrientoseModelPlugin
Function OrientoseModelPlugin
has 199 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function OrientoseModelPlugin() {
/**
* @class OrientoseModelPlugin
*/
var obj = {
Function buildschema
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildschema(parent) {
var self = this;
parent = parent || Schema.V;
var schema = new parent(self._props, {
className: this._name
Function pureecontrollers
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function pureecontrollers(){
return {
setup: function* (next) {
debug("beginning controller middleware setup");
Function setup
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup: function* (next) {
debug("beginning controller middleware setup");
var app = this;
function* overrideMethodMiddleware(next){
var body, parts;
Function constructor
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(mod, config) {
super();
var closestPath = closest.sync(require("path").dirname(mod.filename));
this._basePath = require("path").dirname(closestPath);
var pkginfo = require("@shekhei/pkginfo")(mod);
Function decorate
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function decorate(req){
/**
* Intiate a login session for `user`.
*
- 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 exports
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(){
return {
setup: function *setupSIO(next) {
const puree = this;
const koaApp = puree.app;
Function OrientoseModelPlugin
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function OrientoseModelPlugin() {
/**
* @class OrientoseModelPlugin
*/
var obj = {
- 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 setupSIO
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup: function *setupSIO(next) {
const puree = this;
const koaApp = puree.app;
var nsp = puree.ns || "/";
function handler(origHeaders) {
Function exports
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(){
return {
setup: function *setupSIO(next) {
const puree = this;
const koaApp = puree.app;
- 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 setupModel
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup: function * setupModel(next) {
var app = this;
debug(`beginning model middleware`);
var dburl;
Function start
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
start(app, forConsole) {
var self = this;
self._forConsole = forConsole;
return new Promise(function(resolve, reject){
Function buildschema
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
buildschema(parent) {
var self = this;
parent = parent || Schema.V;
var schema = new parent(self._props, {
className: this._name
- 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
File index.js
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
require("any-promise/register")("bluebird");
var readYaml = require("read-yaml"), extend = require("extend");
var debug = require("debug")("koala-puree");
Function exports
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(){
function advertise(self) {
if ( self._ad ) { self._ad.stop(); }
debug("Starting mdns middleware");
debug(self._config);
- 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 request
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
request: function(method, path, data, headers) {
debug(`calling general request helper: start`);
var self = this;
function _request(sc, path, nsp, method, data, headers, resolve, reject) {
var realPath = "";
Function exports
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(){
function advertise(self) {
if ( self._ad ) { self._ad.stop(); }
debug("Starting mdns middleware");
debug(self._config);
Function overrideMethodMiddleware
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function* overrideMethodMiddleware(next){
var body, parts;
debug("body middleware", this.req.url);
// only parse if it is form, cause if not, this is not a problem
if ( /application\/x-www-form-urlencoded/.test(this.req.headers["content-type"])) {