mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Lint for cyclomatic complexity in BE packages (no-changelog) (#9111)
This commit is contained in:
@@ -9,6 +9,8 @@ module.exports = {
|
||||
...sharedOptions(__dirname),
|
||||
|
||||
rules: {
|
||||
complexity: 'error',
|
||||
|
||||
// TODO: remove these
|
||||
'import/order': 'off',
|
||||
'@typescript-eslint/no-base-to-string': 'warn',
|
||||
|
||||
@@ -104,6 +104,7 @@ export class Expression {
|
||||
* @param {boolean} [returnObjectAsString=false]
|
||||
*/
|
||||
// TODO: Clean that up at some point and move all the options into an options object
|
||||
// eslint-disable-next-line complexity
|
||||
resolveSimpleParameterValue(
|
||||
parameterValue: NodeParameterValue,
|
||||
siblingParameters: INodeParameters,
|
||||
|
||||
@@ -127,6 +127,7 @@ export const extendTransform = (expression: string): { code: string } | undefine
|
||||
|
||||
// Polyfill optional chaining
|
||||
visit(ast, {
|
||||
// eslint-disable-next-line complexity
|
||||
visitChainExpression(path) {
|
||||
this.traverse(path);
|
||||
const chainNumber = currentChain;
|
||||
|
||||
@@ -607,6 +607,7 @@ export function getParameterResolveOrder(
|
||||
* @param {boolean} [dataIsResolved=false] If nodeValues are already fully resolved (so that all default values got added already)
|
||||
* @param {INodeParameters} [nodeValuesRoot] The root node-parameter-data
|
||||
*/
|
||||
// eslint-disable-next-line complexity
|
||||
export function getNodeParameters(
|
||||
nodePropertiesArray: INodeProperties[],
|
||||
nodeValues: INodeParameters | null,
|
||||
@@ -1388,6 +1389,7 @@ function isINodeParameterResourceLocator(value: unknown): value is INodeParamete
|
||||
* @param {INodeParameters} nodeValues The values of the node
|
||||
* @param {string} path The path to the properties
|
||||
*/
|
||||
// eslint-disable-next-line complexity
|
||||
export function getParameterIssues(
|
||||
nodeProperties: INodeProperties,
|
||||
nodeValues: INodeParameters,
|
||||
|
||||
@@ -121,6 +121,7 @@ function parseRegexPattern(pattern: string): RegExp {
|
||||
return regex;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line complexity
|
||||
export function executeFilterCondition(
|
||||
condition: FilterConditionValue,
|
||||
filterOptions: FilterOptionsValue,
|
||||
|
||||
@@ -743,6 +743,7 @@ export class RoutingNode {
|
||||
return parameterValue;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line complexity
|
||||
getRequestOptionsFromParameters(
|
||||
executeSingleFunctions: IExecuteSingleFunctions,
|
||||
nodeProperties: INodeProperties | INodePropertyOptions,
|
||||
|
||||
@@ -151,6 +151,7 @@ export function generateNodesGraph(
|
||||
};
|
||||
});
|
||||
|
||||
// eslint-disable-next-line complexity
|
||||
otherNodes.forEach((node: INode, index: number) => {
|
||||
nodeGraph.node_types.push(node.type);
|
||||
const nodeItem: INodeGraphItem = {
|
||||
|
||||
@@ -178,6 +178,7 @@ type ValidateFieldTypeOptions = Partial<{
|
||||
parseStrings: boolean;
|
||||
}>;
|
||||
// Validates field against the schema and tries to parse it to the correct type
|
||||
// eslint-disable-next-line complexity
|
||||
export const validateFieldType = (
|
||||
fieldName: string,
|
||||
value: unknown,
|
||||
|
||||
@@ -1264,6 +1264,7 @@ export class Workflow {
|
||||
* Executes the given node.
|
||||
*
|
||||
*/
|
||||
// eslint-disable-next-line complexity
|
||||
async runNode(
|
||||
executionData: IExecuteData,
|
||||
runExecutionData: IRunExecutionData,
|
||||
|
||||
@@ -738,6 +738,7 @@ export class WorkflowDataProxy {
|
||||
});
|
||||
};
|
||||
|
||||
// eslint-disable-next-line complexity
|
||||
const getPairedItem = (
|
||||
destinationNodeName: string,
|
||||
incomingSourceData: ISourceData | null,
|
||||
|
||||
@@ -115,6 +115,7 @@ const STATUS_CODE_MESSAGES: IStatusCodeMessages = {
|
||||
export class NodeApiError extends NodeError {
|
||||
httpCode: string | null;
|
||||
|
||||
// eslint-disable-next-line complexity
|
||||
constructor(
|
||||
node: INode,
|
||||
errorResponse: JsonObject,
|
||||
|
||||
Reference in New Issue
Block a user