Showing 28 of 79 total issues
Function getDefinitions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
getDefinitions(config, doc) {
const definitions = {}
definitions['x-any'] = {
'properties': {}
- 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 getPathLocalLogin
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPathLocalLogin(paths, config) {
const pathItem = {}
const localStrategy = config.passport.strategies.local
let usernameField = 'username'
Function extractExampleDirective
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
extractExampleDirective (propertyExample) {
const directive = {}
// Clean Example
let propertyExampleClean = propertyExample.replace(/^{{|}}$/g, '')
Function getPaths
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getPaths(config, doc) {
let paths = {}
if (config.passport && config.passport.strategies) {
for (const authType in config.passport.strategies) {
- 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 extractExampleDirective
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
extractExampleDirective (propertyExample) {
const directive = {}
// Clean Example
let propertyExampleClean = propertyExample.replace(/^{{|}}$/g, '')
- 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 deeply nested control flow statements. Open
if (path1[p] === path2[p]) {
basePath.push(path1[p])
}
else {
break
Function getResponses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getResponses(config, doc) {
const responses = {}
responses['x-GenericSuccess'] = {
description: 'Generic Successful Response',
- 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 genResponseObject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
genResponseObject(httpCode, responseName, description) {
const responseObject = {}
switch (httpCode) {
case '200':
- 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"