Showing 25 of 46 total issues
Function onContextChange
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onContextChange (type, fn) {
if (type !== 'contextChange' || typeof fn !== 'function' || this.listener === fn) {
return
}
if (this.off === noop) {
- Create a ticketCreate a ticket
Function ____n
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ____n (node, singular, plural, count, namedValues, a, b, c, d, e, f, g, h, i, j) {
var args
if (j !== undefined) {
args = [count, a, b, c, d, e, f, g, h, i, j]
} else if (i !== undefined) {
- Create a ticketCreate a ticket
Function _____n
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function _____n (node, singular, plural, count, namedValues, args) {
- Create a ticketCreate a ticket
Function onContextChange
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
function onContextChange (type, fn) {
if (type !== 'contextChange' || typeof fn !== 'function' || this.listener === fn) {
return
}
if (this.off === noop) {
- Read upRead up
- Create a ticketCreate a ticket
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 mustacheSimple
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
render: function mustacheSimple (value, namedValues) {
return value.replace(/{{\s?({?[^}]*}?)\s?}}/ig, function (match, param) {
var unescaped = /^{.*}$/.test(param)
if (unescaped) {
param = param.substring(1, param.length - 1)
- Read upRead up
- Create a ticketCreate a ticket
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"