Why is this an issue?

The Cyclomatic Complexity of functions should not exceed a defined threshold. Complex code may perform poorly and can be difficult to test thoroughly.

Exceptions

The rule excludes non-generator function and arrow literals used as direct calls or template tags. It also excludes synchronous, non-generator function expressions used with new. Function expressions invoked with call or apply, or bound with bind, remain reportable.

(function () { /* initialization */ })();
(() => { /* initialization */ })();
(function () { /* initialization */ })`initialize`;
new (function () { /* initialization */ })();

For AMD define, the rule excludes only a direct, non-generator function-expression factory in an unshadowed call with a supported signature. The call must not use optional chaining. Any module name and dependency entries must be string literals. Arrow factories, nested helper functions, and locally bound define calls remain reportable.

define(function () { /* module */ });
define(["dependency"], function () { function helper() {} });
define("module", ["dependency"], function () { /* module */ });

The rule also excludes a direct, synchronous, non-generator function expression with a nested function when it is the loader function in sap.ui.define, require, sap.ui.require, or unnamed System.register calls. Dependencies must be static strings. Only the loader function is excluded. Nested helper functions, error callbacks, setters, and execute functions remain reportable. Arrow, asynchronous, and generator loader functions, as well as named System.register calls, do not qualify for this exception.

sap.ui.define(["dependency"], function () { function helper() {} });
require(["dependency"], function () { function helper() {} });
sap.ui.require(["dependency"], function () { function helper() {} });
System.register(["dependency"], function () {
  return { setters: [], execute: function () {} };
});

Each call must use the exact, unshadowed loader name shown above. A write to the loader name, or to a property in a dotted loader path, blocks the exception. The rule assumes ambient loader names refer to documented APIs; external changes, alias writes, and reflective writes can invalidate this assumption. TypeScript type aliases and interfaces named define, sap, require, or System do not bind runtime values. They do not block these exceptions.