Showing 6 of 6 total issues
Function resolveValue
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function resolveValue(sourceData, reference, options, callback) {
var fetchData = options.fetchData;
// We got a null reference, meaning that the resolving of a reverse
// reference is done
Function resolveFragment
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function resolveFragment(data, fragment, options, callback) {
var resolveValue = options.resolveValue;
var fetchData = options.fetchData;
var reference = fragment.reference;
Function shapeData
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function shapeData(data, shape, options, callback) {
var resolveValue = options.resolveValue;
var resolveFragment = options.resolveFragment;
var responseData = {};
Function dataShaper
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function dataShaper(data, shape, options, callback) {
var shaperOptions = merge({
shapeData: shapeData,
resolveValue: resolveValue,
resolveFragment: resolveFragment,
Function getReverseReferenceData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getReverseReferenceData(reference) {
var match = reference.match(refRegex);
// Return null if the reference is malformed in some way
if (match === null) {
Function getReverseReferenceData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
function getReverseReferenceData(reference) {
var match = reference.match(refRegex);
// Return null if the reference is malformed in some way
if (match === null) {
- 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"