Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cypher/Typescript_Enrichment/Verify_module_dependencies.cypher
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Verify that there are either no Typescript modules at all or that there is at least one module dependency.

MATCH (source:TS:Module)
OPTIONAL MATCH (source)-[moduleDependency:DEPENDS_ON2]->(:TS:Module)
WITH count(DISTINCT source) AS moduleCount
,count(moduleDependency) AS moduleDependencyCount
WITH *, ((moduleCount = 0) OR (moduleDependencyCount > 0)) AS valid
RETURN moduleCount AS typescriptModuleCount
,moduleDependencyCount AS typescriptModuleDependencyCount
,toInteger(valid) AS typescriptModuleDependenciesValid
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ anomaly_detection_finalize_report() {
source "${SCRIPTS_DIR}/cleanupAfterReportGeneration.sh" "${report_include_directory}"

# Collect static Markdown includes (after cleanup to not remove one-liner)
cp -f "${ANOMALY_DETECTION_SUMMARY_DIR}/report_no_dependency_data.template.md" "${report_include_directory}/report_no_dependency_data.md"
cp -f "${ANOMALY_DETECTION_SUMMARY_DIR}/report_no_anomaly_detection_treemaps.template.md" "${report_include_directory}/report_no_anomaly_detection_treemaps.md"

# Assemble final report by applying includes to the main template
Expand Down
4 changes: 2 additions & 2 deletions domains/anomaly-detection/summary/report.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ The goal is to detect potential **software quality, design, and architecture iss

### 1.3 Overview Charts

<!-- include:TreemapChartsReference.md|report_no_anomaly_detection_treemaps.md> -->
<!-- include:TreemapChartsReference.md|report_no_anomaly_detection_treemaps.md -->

## 2. Deep Dives by Abstraction Level

Each abstraction level includes anomaly statistics, SHAP feature importance, archetype distribution, and example anomalies.

<!-- include:AnomalyDetectionDeepDive.md -->
<!-- include:AnomalyDetectionDeepDive.md|report_no_dependency_data.md -->

## 3. Plot Interpretation Guide

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
⚠️ _No dependent code units found to analyze._
9 changes: 9 additions & 0 deletions scripts/prepareAnalysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_IS_IMPLEMENTED_IN_relationship_for_
execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_IS_IMPLEMENTED_IN_relationship_for_matching_declarations.cypher"
execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_DEPENDS_ON_relationship_to_resolved_modules.cypher"

dataVerificationResult=$( execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Verify_module_dependencies.cypher" "${@}")
if ! is_csv_column_greater_zero "${dataVerificationResult}" "typescriptModuleDependenciesValid"; then
# Warning: Very small Typescript projects might not have dependencies between their modules.
# Therefore, it will only be a warning even though for example anomaly detection will not lead to any useable results.
echo -e "${COLOR_YELLOW}prepareAnalysis: Data verification warning: Typescript module dependencies are missing! Results based on those will be missing or empty:${COLOR_DEFAULT}"
echo -e "${COLOR_YELLOW}${dataVerificationResult}${COLOR_DEFAULT}"
# Since this is now only a warning, execution will be continued.
fi

# Preparation - Add weights to Java Package DEPENDS_ON relationships
execute_cypher_summarized "${DEPENDS_ON_CYPHER_DIR}/Add_weight_property_for_Java_Interface_Dependencies_to_Package_DEPENDS_ON_Relationship.cypher"
execute_cypher_summarized "${DEPENDS_ON_CYPHER_DIR}/Add_weight_property_to_Java_Package_DEPENDS_ON_Relationship.cypher"
Expand Down
Loading