Showing 7 of 25 total issues
Function exports
has 382 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(options){
this.add('role:schedule,cmd:createSchedule', async function create (msg,respond) {
// schedule Entity
var schedule = this.make(schedule_db);
// scheduleSettings Entity
Function api
has 308 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function api(options){
//#############################################################################
this.add('role:api,path:createSchedule', function(msg, respond){
// result variable store attribute errors or the success created schedule
Function create
has 242 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.add('role:schedule,cmd:createSchedule', async function create (msg,respond) {
// schedule Entity
var schedule = this.make(schedule_db);
// scheduleSettings Entity
var scheduleSettings = this.make(schedule_settings_db);
File plg_schedule.js
has 416 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var Promise = require('bluebird');
// BDs names
var schedule_db = 'schedules'
var schedule_settings_db = 'scheduleSettings'
File api.js
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
currentWeekNumber = require('current-week-number');
// The RegExp Object above validates MongoBD ObjectIds
function IsInvalidObjectId(objectIdString){
Function format
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
String.prototype.format = function(){
var replaceable_count = (this.match(/{}/g) || []).length;
if(arguments.length < replaceable_count){
console.log(
"Expecting " + replaceable_count + "arguments, " +
- 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 format
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
String.prototype.format = function(){
var args = arguments;
var replaceable_count = (this.match(/{}/g) || []).length;
if(args.length < replaceable_count){
console.log(
- 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"