Showing 10 of 10 total issues
Function shortestPath
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
shortestPath(source, target) {
if (source === target) {
return source
}
- 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 shortestPath
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
shortestPath(source, target) {
if (source === target) {
return source
}
Function translateJson
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
translateJson(jsonTree, parentNode) {
Object.keys(jsonTree).forEach(treeKey => {
const keyValue = jsonTree[treeKey]
let selector = {
Function generateJoin
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function generateJoin(selector, tableToJoin, tableToJoinColumn, parentTable, parentColumn) {
Avoid too many return
statements within this function. Open
return new InnerJoin(tableToJoin, tableToJoinColumn, parentTable, parentColumn)
Function applySelectKeysToQuery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function applySelectKeysToQuery(query, fieldsToSelect, dataSource) {
if (!query) {
query = ''
} else {
query += ', '
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(baseQuery, joinsToAppend, condition) {
if (typeof baseQuery === 'object' && baseQuery.constructor.name === 'SelectBase') {
this.query = baseQuery.getSelectBase()
} else {
this.query = baseQuery || ''
- 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 generateJoin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function generateJoin(selector, tableToJoin, tableToJoinColumn, parentTable, parentColumn) {
if (selector.innerJoin || selector.InnerJoin) {
return new InnerJoin(tableToJoin, tableToJoinColumn, parentTable, parentColumn)
}
if (selector.rightJoin || selector.RightJoin) {
- 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 initGraphEdges
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
initGraphEdges() {
for (let i = 0; i < this.nodes.length - 1; i++) {
for (let j = i + 1; j < this.nodes.length; j++) {
const firstTable = this.nodes[i].tableName
const secondTable = this.nodes[j].tableName
- 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 manipulateSelectQuery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function manipulateSelectQuery(selectQuery, insertedId) {
let select = null
if (selectQuery.sql) {
select = selectQuery.sql
} else {
- 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"