Function getHelperMetadata
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getHelperMetadata(file) {
const globals = new Set();
const localBindingNames = new Set();
// Maps imported identifier -> helper name
const dependencies = new Map();
Function getHelperMetadata
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function getHelperMetadata(file) {
const globals = new Set();
const localBindingNames = new Set();
// Maps imported identifier -> helper name
const dependencies = new Map();
- 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 permuteHelperAST
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function permuteHelperAST(file, metadata, id, localBindings, getDependency) {
if (localBindings && !id) {
throw new Error("Unexpected local bindings for module-based helpers.");
}
- 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 permuteHelperAST
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
function permuteHelperAST(file, metadata, id, localBindings, getDependency) {
if (localBindings && !id) {
throw new Error("Unexpected local bindings for module-based helpers.");
}
Function Program
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Program(path) {
// We need to compute these in advance because removing nodes would
// invalidate the paths.
const exp = path.get(exportPath);
const imps = importPaths.map(p => path.get(p));
Function loadHelper
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadHelper(name) {
if (!helperData[name]) {
const helper = helpers[name];
if (!helper) {
throw Object.assign(new ReferenceError(`Unknown helper ${name}`), {
Function permuteHelperAST
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function permuteHelperAST(file, metadata, id, localBindings, getDependency) {
Function loadHelper
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function loadHelper(name) {
if (!helperData[name]) {
const helper = helpers[name];
if (!helper) {
throw Object.assign(new ReferenceError(`Unknown helper ${name}`), {
- 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"