MCPcopy Index your code
hub / github.com/nodejs/node / reportIfMissingCheck

Function reportIfMissingCheck

tools/eslint-rules/crypto-check.js:68–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66 }
67
68 function reportIfMissingCheck() {
69 if (hasSkipCall) {
70 // There is a skip, which is good, but verify that the require() calls
71 // in question come after at least one check.
72 if (missingCheckNodes.length > 0) {
73 requireNodes.forEach((requireNode) => {
74 const beforeAllChecks = missingCheckNodes.every((checkNode) => {
75 return requireNode.range[0] < checkNode.range[0];
76 });
77
78 if (beforeAllChecks) {
79 context.report({
80 node: requireNode,
81 message: msg,
82 });
83 }
84 });
85 }
86 return;
87 }
88
89 if (requireNodes.length > 0) {
90 if (missingCheckNodes.length > 0) {
91 report(missingCheckNodes);
92 } else {
93 report(requireNodes);
94 }
95 }
96 }
97
98 function report(nodes) {
99 nodes.forEach((node) => {

Callers 1

createFunction · 0.85

Calls 4

everyMethod · 0.80
reportFunction · 0.70
forEachMethod · 0.65
reportMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…