Showing 54 of 106 total issues
Function redirect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function redirect(request, response, requestProcessor, baseUrl, options){
Function cli
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function cli(args) {
if (args[2] === "--help" || args[2] === "-h") {
console.log(fs.readFileSync(__dirname + "/man/stubmatic.1", 'utf-8'));
} else if (args[2] === "--version") {
console.log(require(__dirname + "/package.json").version);
- 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 assignPath
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function assignPath(originalPath, basePaths){
if(fileutil.isExist(originalPath)){
return originalPath;
}else{
for(let i=0; i< basePaths.length; i++){
- 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 resolveDBSetKey
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var resolveDBSetKey = function (table, tables){
if(table.key){
var row = tables[table.name].get(table.key);
if(row){
return table.key;
- 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 resolveDBSetKey
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var resolveDBSetKey = function (table, tables){
if(table.key){
var row = tables[table.name].get(table.key);
if(row){
return table.key;
- 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
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
else return;
Avoid too many return
statements within this function. Open
return this.getRoundRobinFirstFound(res, matchedentry, matches,matchedentry.index);
Avoid too many return
statements within this function. Open
return this.getRandomFirstFound(res, matchedentry, matches);
Avoid too many return
statements within this function. Open
if(!matches) return;
Avoid too many return
statements within this function. Open
return matched;
Avoid too many return
statements within this function. Open
return clips;
Function buildMappingFileContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function buildMappingFileContent(req,res, options){
const mappingFileContent = {
request: {
method: req.method,
url: req.url,
- 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 buildSecureServerConfig
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function buildSecureServerConfig(config){
let options = {};
if( config.server.key && config.server.cert ){
options = {
- 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"