@servisbot/npm-sb-flow-validation
Advanced tools
Comparing version
@@ -6,3 +6,3 @@ organization=servisbot | ||
dashboardUrl=https://sonarcloud.io/dashboard?id=servisbot%3Anpm-sb-flow-validation | ||
ceTaskId=AWk1PfdejuvFnyRQT6R1 | ||
ceTaskUrl=https://sonarcloud.io/api/ce/task?id=AWk1PfdejuvFnyRQT6R1 | ||
ceTaskId=AWk4j_pN9nd6xwWk9Jdq | ||
ceTaskUrl=https://sonarcloud.io/api/ce/task?id=AWk4j_pN9nd6xwWk9Jdq |
{ | ||
"name": "@servisbot/npm-sb-flow-validation", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Validates node red flows", | ||
@@ -35,4 +35,5 @@ "main": "src/index.js", | ||
"eslint-plugin-mocha": "^5.3.0", | ||
"loglevel": "^1.6.1", | ||
"require-directory": "^2.1.1" | ||
} | ||
} |
@@ -0,1 +1,3 @@ | ||
const logger = require('loglevel'); | ||
// Searches graph depth first | ||
@@ -30,3 +32,6 @@ const depthFirstSearch = (graph, vertex, visited, visiting) => { | ||
const ver = unvisted[i]; | ||
if (depthFirstSearch(graph, ver, visited, visiting)) return true; | ||
if (depthFirstSearch(graph, ver, visited, visiting)) { | ||
logger.error(`Cycle detected while investigating vertex ${ver}`); | ||
return true; | ||
} | ||
} | ||
@@ -33,0 +38,0 @@ return false; |
457636
0.03%16317
0.02%4
33.33%+ Added
+ Added