Showing 193 of 258 total issues
Function resolve
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function resolve (plugins, emitter) {
const modules = []
function requirePlugin (name) {
log.debug(`Loading plugin ${name}.`)
Function _refresh
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_refresh () {
const matchedFiles = new Set()
let lastCompletedRefresh = this._refreshing
lastCompletedRefresh = Promise.all(
Function ProgressReporter
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ProgressReporter (formatError, reportSlow, useColors, browserConsoleLogOptions) {
BaseReporter.call(this, formatError, reportSlow, useColors, browserConsoleLogOptions)
this.EXCLUSIVELY_USE_COLORS = false
this._browsers = []
Function createReporters
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createReporters (names, config, emitter, injector) {
const errorFormatter = createErrorFormatter(config, emitter, SourceMapConsumer)
const reporters = []
names.forEach((name) => {
Function createPriorityPreprocessor
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
function createPriorityPreprocessor (config = {}, preprocessorPriority, basePath, instantiatePlugin) {
_.union.apply(_, Object.values(config)).forEach((name) => instantiatePlugin('preprocessor', name))
return async function preprocess (file) {
const buffer = await tryToRead(file.originalPath, log)
let isBinary = file.isBinary
- 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 navigateContextTo
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function navigateContextTo (url) {
if (self.config.useIframe === false) {
// run in new window
if (self.config.runInParent === false) {
// If there is a window already open, then close it
Function navigateContextTo
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function navigateContextTo (url) {
if (self.config.useIframe === false) {
// run in new window
if (self.config.runInParent === false) {
// If there is a window already open, then close it
Function run
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.run = async () => {
const cliOptions = exports.process()
const cmd = cliOptions.cmd // prevent config from changing the command
const cmdNeedsConfig = cmd === 'start' || cmd === 'run' || cmd === 'stop'
if (cmdNeedsConfig) {
Function extend
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function extend() {
var options, name, src, copy, copyIsArray, clone;
var target = arguments[0];
var i = 1;
var length = arguments.length;
Function extend
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function extend() {
var options, name, src, copy, copyIsArray, clone;
var target = arguments[0];
var i = 1;
var length = arguments.length;
Function _start
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
async _start (config, launcher, preprocess, fileList, capturedBrowsers, executor, done) {
if (config.detached) {
this._detach(config, done)
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
Function 7
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{}],7:[function(require,module,exports){
(function (global){
var NativeCustomEvent = global.CustomEvent;
Function 5
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./karma":3}],5:[function(require,module,exports){
(function (global){
var NativeCustomEvent = global.CustomEvent;
Function onLine
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onLine (line) {
if (currentQuestionId) {
this.rli.write(this.colors.RESET)
line = line.trim().replace(this.colors.ANSWER, '').replace(this.colors.RESET, '')
Function 7
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"custom-event":5,"ent/encode":7,"extend":9,"void-elements":11}],7:[function(require,module,exports){
var punycode = require('punycode');
var revEntities = require('./reversed.json');
module.exports = encode;
Function 9
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"custom-event":7,"ent/encode":9,"extend":11,"void-elements":13}],9:[function(require,module,exports){
var punycode = require('punycode');
var revEntities = require('./reversed.json');
module.exports = encode;
Function _close
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_close (exitCode) {
const webServer = this._injector.get('webServer')
const socketServer = this._injector.get('socketServer')
const done = this._injector.get('done')
Function createWebServer
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createWebServer (injector, config) {
const { mime = {} } = config
mimeType.define({ ...mime }, true)
const proxyMiddlewareInstance = injector.invoke(proxyMiddleware.create)
Function DotsReporter
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function DotsReporter (formatError, reportSlow, useColors, browserConsoleLogOptions) {
BaseReporter.call(this, formatError, reportSlow, useColors, browserConsoleLogOptions)
const DOTS_WRAP = 80
this.EXCLUSIVELY_USE_COLORS = false
Function setup
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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.