feat: add comprehensive code metrics tracking#448
Merged
Conversation
|
@bytebinders Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Xhristin3
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Pull Request
📋 Description
This PR implements a comprehensive code metrics tracking system for the TeachLink smart contract repository. It provides systematic monitoring for code complexity, duplication, and test coverage, and generates a unified quality report to ensure long-term maintainability.
🔗 Related Issue(s)
🎯 Type of Change
📝 Changes Made
jscpd(.jscpd.json) and addedscripts/metrics-duplication.shto track code clones.testing/quality/complexity_analyzer.rsand updatedmetrics_collector.rsto measure cognitive and cyclomatic complexity.scripts/generate_metrics_report.shwhich aggregates all metrics into a consolidated Markdown report.install-deps.shandvalidate-env.shto include mandatory checks for coverage and metrics tools.rust-code-analysisandchronodependencies to the workspace and testing packages.🧪 Testing
✅ Pre-Merge Checklist (Required)
cargo test --liband all tests passcargo buildand the project builds successfullycargo build --target wasm32-unknown-unknown --releaseand WASM builds successfullycargo fmt --all -- --checkand code is properly formattedcargo clippyand there are no new warnings🧪 Additional Testing (Recommended)
cargo doc --no-depsand documentation builds without errorscargo auditand no critical vulnerabilities foundscripts/generate_metrics_report.shcorrectly identifies existing coverage and duplication data.📋 Test Results
./scripts/validate-env.sh # Verified that cargo-llvm-cov, cargo-tarpaulin, and jscpd are correctly detected../scripts/generate_metrics_report.sh # Verified the creation of reports/metrics_summary.md with integrated data.🔍 Review Checklist
📝 Code Quality
🧪 Testing Requirements
📚 Documentation
🔒 Security
🏗️ Contract-Specific (if applicable)
📸 Screenshots/Recordings
N/A - CLI and Markdown reports.
💥 Breaking Changes
📊 Performance Impact
🔒 Security Considerations
📖 Additional Context
This implementation provides a solid foundation for tracking "Technical Debt" and "Maintainability Index" as the contracts grow in complexity.
🚀 Deployment Notes
🎯 Ready for Review: