Showing 8 of 292 total issues
Function onKeypress
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
onKeypress (e) {
var keybindPauseModifier = this.stutterOptions.getProp('keybindPauseModifier')
var keybindRestartModifier = this.stutterOptions.getProp('keybindRestartModifier')
var keybindPreviousModifier = this.stutterOptions.getProp('keybindPreviousModifier')
var keybindForwardModifier = this.stutterOptions.getProp('keybindForwardModifier')
- 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 breakLongWord
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
breakLongWord (word, maxWordLength) {
let ret = []
let start = ''
let end = ''
let hyphenParts = word.split(this._hyphens)
- 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 constructor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
constructor (locale = null) {
if (instance) {
if (locale) {
instance.locale = locale
}
- 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 drawSettings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function drawSettings () {
document.getElementById('wpm').value = options.getProp('wpm')
document.getElementById('slowStartCount').value = options.getProp('slowStartCount')
document.getElementById('sentenceDelay').value = options.getProp('sentenceDelay')
document.getElementById('otherPuncDelay').value = options.getProp('otherPuncDelay')
- 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 listenForKey
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function listenForKey (keyboardEvent) {
keyboardEvent.stopPropagation()
var key = keyboardEvent.key || ''
if (['Alt', 'OS', 'Control', 'Meta', 'Shift'].some(s => key === s)) return
var modifier = ''
- 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 parseWord
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
parseWord () {
let match = this.val.match(locale.textRegex)
this.length = (match) ? match.length : 0
let lastChar = this.val.substr(-1)
let firstChar = this.val[0]
- 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 reveal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async reveal () {
if (!this.holder.parentNode) {
document.body.insertBefore(this.holder, document.body.childNodes[0])
// prevent screen timeout when stutter runs if supported
- 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 toHHMMSS
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function toHHMMSS (t) {
t = Math.round(t / 1000)
let hours = Math.floor(t / 3600)
let minutes = Math.floor((t - (hours * 3600)) / 60)
let seconds = t - (hours * 3600) - (minutes * 60)
- 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"