Showing 19 of 21 total issues
Function _processKeypress
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
_processKeypress (e) {
this._checkEscape(e)
if (e.ctrlKey && [KEY_CODE.DOT, KEY_CODE.SPACE].indexOf(e.keyCode) >= 0) {
return this.toggleEnable()
- 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 _processKeypress
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
_processKeypress (e) {
this._checkEscape(e)
if (e.ctrlKey && [KEY_CODE.DOT, KEY_CODE.SPACE].indexOf(e.keyCode) >= 0) {
return this.toggleEnable()
Function insertAtCursor
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function insertAtCursor ($elem, text) {
if (!$elem) return
text = text || ''
// focus on input
- 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 insertAtCursor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function insertAtCursor ($elem, text) {
if (!$elem) return
text = text || ''
// focus on input
Function bangla
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.bangla = function (key, val) {
const selector = this.each(function () {
if (!this[BANGLA]) {
this[BANGLA] = new Bangla(this, key)
}
Function bangla
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
$.fn.bangla = function (key, val) {
const selector = this.each(function () {
if (!this[BANGLA]) {
this[BANGLA] = new Bangla(this, key)
}
- 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 _isWordKey
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_isWordKey (e) {
if (e.altKey || e.ctrlKey) return false
if (e.keyCode === KEY_CODE.DOT) return true
if (e.keyCode >= KEY_CODE.A && e.keyCode <= KEY_CODE.Z) return true
if (e.keyCode >= KEY_CODE.ZERO && e.keyCode <= KEY_CODE.NINE) return !e.shiftKey
- 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 true
Avoid too many return
statements within this function. Open
if (this.view.active >= 0) return false
Avoid too many return
statements within this function. Open
if (!word) return true
Avoid too many return
statements within this function. Open
return false
Avoid too many return
statements within this function. Open
if (e.keyCode >= KEY_CODE.NUMPAD_ZERO && e.keyCode <= KEY_CODE.NUMPAD_NINE) return true
Avoid too many return
statements within this function. Open
if (!word) return true
Avoid too many return
statements within this function. Open
if (!word) return true
Avoid too many return
statements within this function. Open
return false
Avoid too many return
statements within this function. Open
return true
Avoid too many return
statements within this function. Open
return false
Avoid too many return
statements within this function. Open
return false
Avoid too many return
statements within this function. Open
return true