Showing 8 of 8 total issues
Function constructor
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor () {
/**
* Lists of logger levels custom for your own usage
*
* @memberof Logger
Function constructor
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
constructor () {
/**
* Lists of logger levels custom for your own usage
*
* @memberof Logger
- 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 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
const winston = require('winston');
const _ = require('lodash');
const chalk = require('chalk');
Function addDailyRotateTransport
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
addDailyRotateTransport (options = {}, isWeb = false) {
// Try to normalize options
_.set(options, 'changeChangeLevel', options.canChangeLevel || true);
_.set(options, 'extname', options.extname || 'combined');
_.set(options, 'destination',
Function enableRequestToDailyRotateFiles
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
enableRequestToDailyRotateFiles (options = {}) {
// Add default options
options.extname = 'access';
options.level = 'info';
options.canChangeLevel = false;
Function banner
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
banner (message, ... meta) {
// Default step value
const step = 20;
// Define separtor element
- 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 addDailyRotateTransport
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
addDailyRotateTransport (options = {}, isWeb = false) {
// Try to normalize options
_.set(options, 'changeChangeLevel', options.canChangeLevel || true);
_.set(options, 'extname', options.extname || 'combined');
_.set(options, 'destination',
- 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 process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
process (level, message, meta) {
// Try to find correct level
level = _.find(this.levels, [ 'name', level ]);
// Level allow callback usage ?
- 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"