Showing 193 of 258 total issues
Function createProxyHandler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function createProxyHandler (proxies, urlRoot) {
if (!proxies.length) {
const nullProxy = (request, response, next) => next()
nullProxy.upgrade = () => {}
return nullProxy
- 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 (ele.tagName && ele.tagName.toLowerCase() === 'script') {
var tmp = ele
ele = document.createElement('script')
ele.src = policy.createScriptURL(tmp.src)
ele.crossOrigin = tmp.crossOrigin
Avoid deeply nested control flow statements. Open
if (obj.constructor && typeof obj.constructor === 'function') {
constructor = obj.constructor.name
}
Function setup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function setup (level, colors, appenders) {
// Turn color on/off on the console appenders with pattern layout
const pattern = colors ? constant.COLOR_PATTERN : constant.NO_COLOR_PATTERN
if (appenders) {
// Convert Array to Object for backwards compatibility.
- 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 error
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
this.error = function (messageOrEvent, source, lineno, colno, error) {
Function baseBrowserDecoratorFactory
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
baseLauncherDecorator,
captureTimeoutLauncherDecorator,
retryLauncherDecorator,
processLauncherDecorator,
processKillTimeout
Function error
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
this.error = function (messageOrEvent, source, lineno, colno, error) {
Function watch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function watch (patterns, excludes, fileList, usePolling, emitter) {
Function BaseReporter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
const BaseReporter = function (formatError, reportSlow, useColors, browserConsoleLogOptions, adapter) {
Function main
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const main = async () => {
if (process.argv[2] === 'build') {
await bundleResourceToFile('client/main.js', 'static/karma.js')
await bundleResourceToFile('context/main.js', 'static/context.js')
} else if (process.argv[2] === 'check') {
- 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 resolve
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function resolve (plugins, emitter) {
const modules = []
function requirePlugin (name) {
log.debug(`Loading plugin ${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
Function onKeypress
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
onKeypress (key) {
if (!currentOptions || !key) {
return
}
- 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 strs.join('')
Avoid too many return
statements within this function. Open
return obj.outerHTML
Avoid too many return
statements within this function. Open
return obj.nodeValue
Avoid too many return
statements within this function. Open
return obj.outerHTML
Avoid too many return
statements within this function. Open
return next()
Avoid too many return
statements within this function. Open
return obj.toString()
Avoid too many return
statements within this function. Open
return obj.toString()
Avoid too many return
statements within this function. Open
return obj.nodeValue