Skip to content

Commit fab4dfe

Browse files
committed
Refine description and threshold variable names
1 parent 1eaf834 commit fab4dfe

9 files changed

+42
-42
lines changed

domains/anomaly-detection/queries/AnomalyDetectionDependencyHungryOrchestrators.cypher

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Anomaly Detection Query: Find dependency hungry orchestrators by listing the top 20 entries with the highest Article Rank >= 90% percentile and a Betweeenness centrality >= 90% percentile.
1+
// Anomaly Detection Query: Find dependency hungry orchestrators by listing the top (at most) 20 entries with the highest Article Rank >= 90% percentile and a Betweeenness centrality >= 90% percentile.
22
// Shows key code that depend on many others and also controls flow — likely orchestrators or managers.
33

44
MATCH (codeUnit)
@@ -8,12 +8,12 @@
88
AND codeUnit.incomingDependencies IS NOT NULL
99
AND codeUnit.outgoingDependencies IS NOT NULL
1010
WITH collect(codeUnit) AS codeUnits
11-
,percentileDisc(codeUnit.centralityArticleRank, 0.90) AS articleRank90Percentile
12-
,percentileDisc(codeUnit.centralityBetweenness, 0.90) AS betweenness90Percentile
11+
,percentileDisc(codeUnit.centralityArticleRank, 0.90) AS articleRankThreshold
12+
,percentileDisc(codeUnit.centralityBetweenness, 0.90) AS betweennessThreshold
1313
UNWIND codeUnits AS codeUnit
1414
WITH *, codeUnit.incomingDependencies + codeUnit.outgoingDependencies AS degree
15-
WHERE codeUnit.centralityArticleRank >= articleRank90Percentile
16-
AND codeUnit.centralityBetweenness >= betweenness90Percentile
15+
WHERE codeUnit.centralityArticleRank >= articleRankThreshold
16+
AND codeUnit.centralityBetweenness >= betweennessThreshold
1717
OPTIONAL MATCH (artifact:Java:Artifact)-[:CONTAINS]->(codeUnit)
1818
WITH *, artifact.name AS artifactName
1919
OPTIONAL MATCH (projectRoot:Directory)<-[:HAS_ROOT]-(proj:TS:Project)-[:CONTAINS]->(codeUnit)

domains/anomaly-detection/queries/AnomalyDetectionFragileStructuralBridges.cypher

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Anomaly Detection Query: Find fragile structural bridges, potential boundary-spanning modules and cohesion violations by listing the top 20 entries with the highest Betweeenness centrality >= 90% percentile and a local clustering coefficient <= 10% percentile.
1+
// Anomaly Detection Query: Find fragile structural bridges, potential boundary-spanning modules and cohesion violations by listing the (at most) top 20 entries with the highest Betweeenness centrality >= 90% percentile and a local clustering coefficient <= 10% percentile.
22
// Shows code that connects otherwise unrelated parts of the graph — potential architectural risks.
33

44
MATCH (codeUnit)
@@ -8,12 +8,12 @@
88
AND codeUnit.incomingDependencies IS NOT NULL
99
AND codeUnit.outgoingDependencies IS NOT NULL
1010
WITH collect(codeUnit) AS codeUnits
11-
,percentileDisc(codeUnit.communityLocalClusteringCoefficient, 0.10) AS localClusteringCoefficient10Percentile
12-
,percentileDisc(codeUnit.centralityBetweenness, 0.90) AS betweenness90Percentile
11+
,percentileDisc(codeUnit.communityLocalClusteringCoefficient, 0.10) AS localClusteringCoefficientThreshold
12+
,percentileDisc(codeUnit.centralityBetweenness, 0.90) AS betweennessThreshold
1313
UNWIND codeUnits AS codeUnit
1414
WITH *, codeUnit.incomingDependencies + codeUnit.outgoingDependencies AS degree
15-
WHERE codeUnit.communityLocalClusteringCoefficient <= localClusteringCoefficient10Percentile
16-
AND codeUnit.centralityBetweenness >= betweenness90Percentile
15+
WHERE codeUnit.communityLocalClusteringCoefficient <= localClusteringCoefficientThreshold
16+
AND codeUnit.centralityBetweenness >= betweennessThreshold
1717
OPTIONAL MATCH (artifact:Java:Artifact)-[:CONTAINS]->(codeUnit)
1818
WITH *, artifact.name AS artifactName
1919
OPTIONAL MATCH (projectRoot:Directory)<-[:HAS_ROOT]-(proj:TS:Project)-[:CONTAINS]->(codeUnit)

domains/anomaly-detection/queries/AnomalyDetectionHiddenBridgeNodes.cypher

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Anomaly Detection Query: Find hidden bridge code or misplaced responsibilities by listing the top 20 entries with the highest Betweeenness centrality >= 90% percentile and a Page Rank <= 10% percentile.
1+
// Anomaly Detection Query: Find hidden bridge code or misplaced responsibilities by listing the (at most) top 20 entries with the highest Betweeenness centrality >= 90% percentile and a Page Rank <= 10% percentile.
22
// Shows code that mediates flow, but isn’t highly depended on — structural surprise.
33

44
MATCH (codeUnit)
@@ -8,12 +8,12 @@
88
AND codeUnit.incomingDependencies IS NOT NULL
99
AND codeUnit.outgoingDependencies IS NOT NULL
1010
WITH collect(codeUnit) AS codeUnits
11-
,percentileDisc(codeUnit.centralityPageRank, 0.10) AS pageRank10Percentile
12-
,percentileDisc(codeUnit.centralityBetweenness, 0.90) AS betweenness90Percentile
11+
,percentileDisc(codeUnit.centralityPageRank, 0.10) AS pageRankThreshold
12+
,percentileDisc(codeUnit.centralityBetweenness, 0.90) AS betweennessThreshold
1313
UNWIND codeUnits AS codeUnit
1414
WITH *, codeUnit.incomingDependencies + codeUnit.outgoingDependencies AS degree
15-
WHERE codeUnit.centralityPageRank <= pageRank10Percentile
16-
AND codeUnit.centralityBetweenness >= betweenness90Percentile
15+
WHERE codeUnit.centralityPageRank <= pageRankThreshold
16+
AND codeUnit.centralityBetweenness >= betweennessThreshold
1717
OPTIONAL MATCH (artifact:Java:Artifact)-[:CONTAINS]->(codeUnit)
1818
WITH *, artifact.name AS artifactName
1919
OPTIONAL MATCH (projectRoot:Directory)<-[:HAS_ROOT]-(proj:TS:Project)-[:CONTAINS]->(codeUnit)

domains/anomaly-detection/queries/AnomalyDetectionOverReferencesUtilities.cypher

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Anomaly Detection Query: Find over-referenced utility code by listing the top 20 entries with the highest Page Rank >= 90% percentile and a low local clustering coefficient below the 10% percentile.
1+
// Anomaly Detection Query: Find over-referenced utility code by listing the (at most) top 20 entries with the highest Page Rank >= 90% percentile and a low local clustering coefficient below the 10% percentile.
22
// Shows code that is widely referenced, but loosely coupled in neighborhood — could be over-generalized or abused.
33

44
MATCH (codeUnit)
@@ -8,12 +8,12 @@
88
AND codeUnit.incomingDependencies IS NOT NULL
99
AND codeUnit.outgoingDependencies IS NOT NULL
1010
WITH collect(codeUnit) AS codeUnits
11-
,percentileDisc(codeUnit.communityLocalClusteringCoefficient, 0.10) AS localClusteringCoefficient10PercentPercentile
12-
,percentileDisc(codeUnit.centralityPageRank, 0.90) AS pageRank90PercentPercentile
11+
,percentileDisc(codeUnit.communityLocalClusteringCoefficient, 0.10) AS localClusteringCoefficientThreshold
12+
,percentileDisc(codeUnit.centralityPageRank, 0.90) AS pageRankThreshold
1313
UNWIND codeUnits AS codeUnit
1414
WITH *, codeUnit.incomingDependencies + codeUnit.outgoingDependencies AS degree
15-
WHERE codeUnit.communityLocalClusteringCoefficient <= localClusteringCoefficient10PercentPercentile
16-
AND codeUnit.centralityPageRank >= pageRank90PercentPercentile
15+
WHERE codeUnit.communityLocalClusteringCoefficient <= localClusteringCoefficientThreshold
16+
AND codeUnit.centralityPageRank >= pageRankThreshold
1717
OPTIONAL MATCH (artifact:Java:Artifact)-[:CONTAINS]->(codeUnit)
1818
WITH *, artifact.name AS artifactName
1919
OPTIONAL MATCH (projectRoot:Directory)<-[:HAS_ROOT]-(proj:TS:Project)-[:CONTAINS]->(codeUnit)

domains/anomaly-detection/queries/AnomalyDetectionPopularBottlenecks.cypher

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Anomaly Detection Query: Find popular bottlenecks by listing the top 20 entries with the highest Betweeenness centrality >= 90% percentile and a Page Rank >= 90% percentile.
1+
// Anomaly Detection Query: Find popular bottlenecks by listing the (at most) top 20 entries with the highest Betweeenness centrality >= 90% percentile and a Page Rank >= 90% percentile.
22
// Shows key code that is both heavily depended on and control flow — critical hubs.
33

44
MATCH (codeUnit)
@@ -8,12 +8,12 @@
88
AND codeUnit.incomingDependencies IS NOT NULL
99
AND codeUnit.outgoingDependencies IS NOT NULL
1010
WITH collect(codeUnit) AS codeUnits
11-
,percentileDisc(codeUnit.centralityPageRank, 0.90) AS pageRank90Percentile
12-
,percentileDisc(codeUnit.centralityBetweenness, 0.90) AS betweenness90Percentile
11+
,percentileDisc(codeUnit.centralityPageRank, 0.90) AS pageRankThreshold
12+
,percentileDisc(codeUnit.centralityBetweenness, 0.90) AS betweennessThreshold
1313
UNWIND codeUnits AS codeUnit
1414
WITH *, codeUnit.incomingDependencies + codeUnit.outgoingDependencies AS degree
15-
WHERE codeUnit.centralityPageRank >= pageRank90Percentile
16-
AND codeUnit.centralityBetweenness >= betweenness90Percentile
15+
WHERE codeUnit.centralityPageRank >= pageRankThreshold
16+
AND codeUnit.centralityBetweenness >= betweennessThreshold
1717
OPTIONAL MATCH (artifact:Java:Artifact)-[:CONTAINS]->(codeUnit)
1818
WITH *, artifact.name AS artifactName
1919
OPTIONAL MATCH (projectRoot:Directory)<-[:HAS_ROOT]-(proj:TS:Project)-[:CONTAINS]->(codeUnit)

domains/anomaly-detection/queries/AnomalyDetectionPotentialImbalancedRoles.cypher

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Anomaly Detection Query: Find potential imbalanced roles in the codebase by listing the top 40 most significant Page Rank to Article Rank differences.
1+
// Anomaly Detection Query: Find potential imbalanced roles in the codebase by listing the (at most) top 20 most significant Page Rank to Article Rank differences.
22

33
MATCH (codeUnit)
44
WHERE $projection_node_label IN labels(codeUnit)
@@ -31,4 +31,4 @@ OPTIONAL MATCH (projectRoot:Directory)<-[:HAS_ROOT]-(proj:TS:Project)-[:CONTAINS
3131
//,pageToArticleRankDifferenceMean
3232
//,pageToArticleRankDifferenceStandardDeviation
3333
ORDER BY abs(pageToArticleRankDifferenceZScore) DESC
34-
LIMIT 40
34+
LIMIT 20

domains/anomaly-detection/queries/AnomalyDetectionPotentialOverEngineerOrIsolated.cypher

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Anomaly Detection Query: Find potential over-engineered or isolated code unit by listing the top 20 entries with the highest local clustering coefficient and a Page Rank below the 5% percentile.
1+
// Anomaly Detection Query: Find potential over-engineered or isolated code unit by listing the (at most) top 20 entries with the highest local clustering coefficient and a Page Rank below the 5% percentile.
22

33
MATCH (codeUnit)
44
WHERE $projection_node_label IN labels(codeUnit)
@@ -7,12 +7,12 @@
77
AND codeUnit.incomingDependencies IS NOT NULL
88
AND codeUnit.outgoingDependencies IS NOT NULL
99
WITH collect(codeUnit) AS codeUnits
10-
,percentileDisc(codeUnit.centralityPageRank, 0.10) AS pageRank10PercentPercentile
11-
,percentileDisc(codeUnit.communityLocalClusteringCoefficient, 0.90) AS localClusteringCoefficient90PercentPercentile
10+
,percentileDisc(codeUnit.centralityPageRank, 0.10) AS pageRankThreshold
11+
,percentileDisc(codeUnit.communityLocalClusteringCoefficient, 0.90) AS localClusteringCoefficientThreshold
1212
UNWIND codeUnits AS codeUnit
1313
WITH *, codeUnit.incomingDependencies + codeUnit.outgoingDependencies AS degree
14-
WHERE codeUnit.centralityPageRank <= pageRank10PercentPercentile
15-
AND codeUnit.communityLocalClusteringCoefficient >= localClusteringCoefficient90PercentPercentile
14+
WHERE codeUnit.centralityPageRank <= pageRankThreshold
15+
AND codeUnit.communityLocalClusteringCoefficient >= localClusteringCoefficientThreshold
1616
OPTIONAL MATCH (artifact:Java:Artifact)-[:CONTAINS]->(codeUnit)
1717
WITH *, artifact.name AS artifactName
1818
OPTIONAL MATCH (projectRoot:Directory)<-[:HAS_ROOT]-(proj:TS:Project)-[:CONTAINS]->(codeUnit)

domains/anomaly-detection/queries/AnomalyDetectionSilentCoordinators.cypher

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Anomaly Detection Query: Find silent coordinators by listing the top 20 entries with the highest betweeenness >= 90% percentile and a in-degree <= 10% percentile.
1+
// Anomaly Detection Query: Find silent coordinators by listing the (at most) top 20 entries with the highest betweeenness >= 90% percentile and a in-degree <= 10% percentile.
22
// Shows code that controls lots of interactions, yet not many modules depend on it — hidden complexity
33

44
MATCH (codeUnit)
@@ -7,12 +7,12 @@
77
AND codeUnit.incomingDependencies IS NOT NULL
88
AND codeUnit.outgoingDependencies IS NOT NULL
99
WITH collect(codeUnit) AS codeUnits
10-
,percentileDisc(codeUnit.incomingDependencies, 0.10) AS incomingDependencies10Percentile
11-
,percentileDisc(codeUnit.centralityBetweenness, 0.90) AS betweenness90Percentile
10+
,percentileDisc(codeUnit.incomingDependencies, 0.10) AS incomingDependenciesThreshold
11+
,percentileDisc(codeUnit.centralityBetweenness, 0.90) AS betweennessThreshold
1212
UNWIND codeUnits AS codeUnit
1313
WITH *, codeUnit.incomingDependencies + codeUnit.outgoingDependencies AS degree
14-
WHERE codeUnit.incomingDependencies <= incomingDependencies10Percentile
15-
AND codeUnit.centralityBetweenness <= betweenness90Percentile
14+
WHERE codeUnit.incomingDependencies <= incomingDependenciesThreshold
15+
AND codeUnit.centralityBetweenness <= betweennessThreshold
1616
OPTIONAL MATCH (artifact:Java:Artifact)-[:CONTAINS]->(codeUnit)
1717
WITH *, artifact.name AS artifactName
1818
OPTIONAL MATCH (projectRoot:Directory)<-[:HAS_ROOT]-(proj:TS:Project)-[:CONTAINS]->(codeUnit)

domains/anomaly-detection/queries/AnomalyDetectionUnexpectedCentralNodes.cypher

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Anomaly Detection Query: Find hidden bottlenecks or hubs by listing the top 20 entries with the highest betweeenness >= 90% percentile and a degree <= 10% percentile.
1+
// Anomaly Detection Query: Find hidden bottlenecks or hubs by listing the (at most) top 20 entries with the highest betweeenness >= 90% percentile and a degree <= 10% percentile.
22
// Shows code with high structural importance and only a few incoming and outgoing dependencies — often unexpected.
33

44
MATCH (codeUnit)
@@ -8,12 +8,12 @@
88
AND codeUnit.outgoingDependencies IS NOT NULL
99
WITH *, codeUnit.incomingDependencies + codeUnit.outgoingDependencies AS degree
1010
WITH collect(codeUnit) AS codeUnits
11-
,percentileDisc(degree, 0.10) AS degree10Percentile
12-
,percentileDisc(codeUnit.centralityBetweenness, 0.90) AS betweenness90Percentile
11+
,percentileDisc(degree, 0.10) AS degreeThreshold
12+
,percentileDisc(codeUnit.centralityBetweenness, 0.90) AS betweennessThreshold
1313
UNWIND codeUnits AS codeUnit
1414
WITH *, codeUnit.incomingDependencies + codeUnit.outgoingDependencies AS degree
15-
WHERE degree <= degree10Percentile
16-
AND codeUnit.centralityBetweenness <= betweenness90Percentile
15+
WHERE degree <= degreeThreshold
16+
AND codeUnit.centralityBetweenness <= betweennessThreshold
1717
OPTIONAL MATCH (artifact:Java:Artifact)-[:CONTAINS]->(codeUnit)
1818
WITH *, artifact.name AS artifactName
1919
OPTIONAL MATCH (projectRoot:Directory)<-[:HAS_ROOT]-(proj:TS:Project)-[:CONTAINS]->(codeUnit)

0 commit comments

Comments
 (0)