Showing 25 of 46 total issues
Function convertToAPI
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function convertToAPI (node) {
var api = function __ (key, namedValues, a, b, c, d, e, f, g, h, i, j) {
if (typeof namedValues === 'object' && namedValues !== null) {
return ___(node, key, namedValues, a, b, c, d, e, f, g, h, i, j)
}
- 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 convertToAPI
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
function convertToAPI (node) {
var api = function __ (key, namedValues, a, b, c, d, e, f, g, h, i, j) {
if (typeof namedValues === 'object' && namedValues !== null) {
return ___(node, key, namedValues, a, b, c, d, e, f, g, h, i, j)
}
- Create a ticketCreate a ticket
Function _____n
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function _____n (node, singular, plural, count, namedValues, args) {
var keys
var fallbackKey
if (count > 1) {
if (typeof plural === 'object' && plural !== null) {
- 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 exports
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (folder, strategy) {
// need to load here, because it needs a mock for testing.
var fs = require('fs')
var getRaw = function getRaw (file) {
try {
- 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 i18nChain
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function i18nChain () {
var first = null
var current
for (var i = 0; i < arguments.length; i++) {
var handler = arguments[i]
- 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 exports
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (folder, strategy) {
// need to load here, because it needs a mock for testing.
var fs = require('fs')
var getRaw = function getRaw (file) {
try {
- Create a ticketCreate a ticket
Function ____n
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
function ____n (node, singular, plural, count, namedValues, a, b, c, d, e, f, g, h, i, j) {
- Create a ticketCreate a ticket
Function ___n
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
function ___n (node, singular, plural, count, namedValues, a, b, c, d, e, f, g, h, i, j) {
- Create a ticketCreate a ticket
Function __n
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
api.__n = function __n (singular, plural, count, namedValues, a, b, c, d, e, f, g, h, i, j) {
- Create a ticketCreate a ticket
Function absN
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
api.absN = function absN (singular, plural, count, namedValues, a, b, c, d, e, f, g, h, i, j) {
- Create a ticketCreate a ticket
Function _____n
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _____n (node, singular, plural, count, namedValues, args) {
var keys
var fallbackKey
if (count > 1) {
if (typeof plural === 'object' && plural !== null) {
- Create a ticketCreate a ticket
Function ___
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
function ___ (node, key, namedValues, a, b, c, d, e, f, g, h, i, j) {
- Create a ticketCreate a ticket
Function i18nChain
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function i18nChain () {
var first = null
var current
for (var i = 0; i < arguments.length; i++) {
var handler = arguments[i]
- Create a ticketCreate a ticket
Function createNode
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function createNode (prefix, parent, translator, allowModification) {
var node = Object.create(API)
node.currentPrefix = prefix
node.parent = parent
node.translator = translator
- 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 abs
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
api.abs = function abs (key, namedValues, a, b, c, d, e, f, g, h, i, j) {
- Create a ticketCreate a ticket
Function api
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
var api = function __ (key, namedValues, a, b, c, d, e, f, g, h, i, j) {
- Create a ticketCreate a ticket
Function createNode
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createNode (prefix, parent, translator, allowModification) {
var node = Object.create(API)
node.currentPrefix = prefix
node.parent = parent
node.translator = translator
- Create a ticketCreate a ticket
Function offContextChange
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function offContextChange (type, fn) {
if (type !== 'contextChange') {
return
}
if (this.listener === fn) {
- 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 ____n
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. 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) {
- 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 ___
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function ___ (node, key, namedValues, a, b, c, d, e, f, g, h, i, j) {
var args
if (j !== undefined) {
args = [a, b, c, d, e, f, g, h, i, j]
} else if (i !== undefined) {
- 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"