Showing 830 of 830 total issues
Function firstFieldHasBetterPrepubEncodingLevel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function firstFieldHasBetterPrepubEncodingLevel(field1, field2) {
if (fieldRefersToKoneellisestiTuotettuTietue(field2)) {
return false;
}
if (fieldRefersToKoneellisestiTuotettuTietue(field1)) {
- 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 recordFixSubfield6OccurrenceNumbers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function recordFixSubfield6OccurrenceNumbers(record) {
const fieldsContainingSubfield6 = record.fields.filter(field => fieldHasSubfield(field, '6'));
const orphanedFields = getOrphanedFields(fieldsContainingSubfield6);
orphanedFields.forEach(field => fieldFixOrphanedSubfields(field));
- 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 default
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function () {
return {
description: 'Normalizes indicator values',
validate, fix
- 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 ruleAppliesToNextSubfield
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function ruleAppliesToNextSubfield(rule, nextSubfield) {
if (!('followedBy' in rule)) { // Return true, if we are not interested in the next subfield
return true;
}
// The '#' existence check applies only to the RHS field. LHS always exists.
- 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 deriveInferiorChains
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function deriveInferiorChains(fields, record) {
//nvdebug(`======= GOT ${fields.length} FIELDS TO CHAINIFY`);
const hash = {};
fields.forEach(f => fieldToChainToDeletables(f));
- 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 default
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function () {
return {
description: 'Handles empty fields',
validate,
fix
- 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 acceptFieldsWithSubfield8
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function acceptFieldsWithSubfield8(fieldsWithSubfield8, requireSingleTag = false) {
const linkingNumbers = fieldsGetAllSubfield8LinkingNumbers(fieldsWithSubfield8);
if (linkingNumbers.some(linkingNumber => anomaly8(linkingNumber))) {
return false;
}
- 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 recordGetNumberOfUniqueSubfield6OccurrenceNumbers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function recordGetNumberOfUniqueSubfield6OccurrenceNumbers(record) {
// Calculates the number of used different occurrence numbers
/* eslint-disable */
let indexArray = [];
record.fields.forEach(field => gatherFieldData(field));
- 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 translateFieldToFinnish
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function translateFieldToFinnish(field) {
if (!['020', '300'].includes(field.tag)) {
return;
}
field.subfields?.forEach(sf => translateSubfieldToFinnish(sf));
- 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 default
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function (tagPatterns) {
if (Array.isArray(tagPatterns)) {
return {
description:
'Checks whether the configured fields are present in the record',
- 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"