Showing 193 of 258 total issues
Function 4
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"../common/util":6,"./constants":1,"./karma":2,"./updater":4}],4:[function(require,module,exports){
var VERSION = require('./constants').VERSION
function StatusUpdater (socket, titleElement, bannerElement, browsersElement) {
function updateBrowsersInfo (browsers) {
Function run
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function run (cliOptionsOrConfig, done) {
cliOptionsOrConfig = cliOptionsOrConfig || {}
done = helper.isFunction(done) ? done : process.exit
let config
Function StatusUpdater
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function StatusUpdater (socket, titleElement, bannerElement, browsersElement) {
function updateBrowsersInfo (browsers) {
if (!browsersElement) {
return
}
Function StatusUpdater
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function StatusUpdater (socket, titleElement, bannerElement, browsersElement) {
function updateBrowsersInfo (browsers) {
if (!browsersElement) {
return
}
Function createServeFile
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createServeFile (fs, directory, config) {
const cache = Object.create(null)
return function (filepath, rangeHeader, response, transform, content, doNotCache) {
let responseData
Function constructor
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor () {
this.LOG_DISABLE = constant.LOG_DISABLE
this.LOG_ERROR = constant.LOG_ERROR
this.LOG_WARN = constant.LOG_WARN
this.LOG_INFO = constant.LOG_INFO
Browser
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Browser {
constructor (id, fullName, collection, emitter, socket, timer, disconnectDelay,
noActivityTimeout, singleRun, clientConfig) {
this.id = id
this.fullName = fullName
Function createErrorFormatter
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createErrorFormatter (config, emitter, SourceMapConsumer) {
const basePath = config.basePath
const urlRoot = config.urlRoot === '/' ? '' : (config.urlRoot || '')
let lastServedFiles = []
Function serialize
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function serialize (node, context, fn, eventTarget) {
if (!node) return '';
if ('function' === typeof context) {
fn = context;
context = null;
Function serialize
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function serialize (node, context, fn, eventTarget) {
if (!node) return '';
if ('function' === typeof context) {
fn = context;
context = null;
Function parseProxyConfig
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseProxyConfig (proxies, config) {
proxies = proxies || []
return _.sortBy(_.map(proxies, function (proxyConfiguration, proxyPath) {
if (typeof proxyConfiguration === 'string') {
proxyConfiguration = { target: proxyConfiguration }
Function setupContext
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.setupContext = function (contextWindow) {
// If we clear the context after every run and we already had an error
// then stop now. Otherwise, carry on.
if (self.config.clearContext && hasError) {
return
Function setupContext
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.setupContext = function (contextWindow) {
// If we clear the context after every run and we already had an error
// then stop now. Otherwise, carry on.
if (self.config.clearContext && hasError) {
return
Function stop
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.stop = function (cliOptionsOrConfig, done) {
cliOptionsOrConfig = cliOptionsOrConfig || {}
const log = logger.create('stopper')
done = helper.isFunction(done) ? done : process.exit
Function decode
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function decode(input) {
// Don't use UCS-2
var output = [],
inputLength = input.length,
out,
Function decode
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function decode(input) {
// Don't use UCS-2
var output = [],
inputLength = input.length,
out,
Function BaseLauncher
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
function BaseLauncher (id, emitter) {
if (this.start) {
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 exports
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (wallaby) {
return {
files: [
{
pattern: 'package.json',
Function StatusUpdater
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
function StatusUpdater (socket, titleElement, bannerElement, browsersElement) {
function updateBrowsersInfo (browsers) {
if (!browsersElement) {
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 launchSingle
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
launchSingle (protocol, hostname, port, urlRoot, upstreamProxy, processKillTimeout) {
if (upstreamProxy) {
protocol = upstreamProxy.protocol
hostname = upstreamProxy.hostname
port = upstreamProxy.port