Showing 5 of 9 total issues
File reporter.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import events from 'events'
import chalk from 'chalk'
import humanizeDuration from 'humanize-duration'
const DURATION_OPTIONS = {
Function constructor
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor (baseReporter, config, options = {}) {
super()
this.chalk = chalk
this.baseReporter = baseReporter
Function getBrowserCombo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
getBrowserCombo (caps, verbose = true) {
const device = caps.deviceName
const browser = caps.browserName || caps.browser
const version = caps.version || caps.platformVersion || caps.browser_version
const platform = caps.os ? (caps.os + ' ' + caps.os_version) : (caps.platform || caps.platformName)
- 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 getSuiteResult
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getSuiteResult (runner) {
const cid = runner.cid
const stats = this.baseReporter.stats
const results = stats.runners[cid]
const preface = `[${this.getBrowserCombo(results.capabilities, false)} #${cid}]`
Function getResultList
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
getResultList (cid, suites, preface = '') {
let output = ''
for (const specUid in suites) {
// Remove "before all" tests from the displayed results
- 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"