Commit graph

15 commits

Author SHA1 Message Date
Eli Peter
8497800b13
test: Add unit tests for config merging and project name sanitization (#6)
* test: Add unit tests for config merging and project name sanitization

* Update src/utils/project.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* test: Update assertion for follow_symlinks in scanner configuration

* test: Fix typo in test function name for project info retrieval

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-24 23:18:01 +02:00
elipeter
b3870997d7 Add Ruby AST support using tree-sitter-ruby
- Added `tree-sitter-ruby` dependency to `Cargo.toml` and `Cargo.lock`.
- Introduced `patterns/ruby.rs` with Ruby-specific AST patterns for vulnerability detection.
- Updated `patterns/mod.rs` and `ast.rs` to support Ruby AST parsing and pattern registry initialization.
2025-06-24 18:53:31 +02:00
elipeter
0a66a0ae2d Add error handling with NyxError and refactor console output formatting
- Introduced `NyxError` and `NyxResult` for unified error handling across modules.
- Refactored `scan.rs`, `index.rs`, and `walk.rs` with improved error management and consistent formatting.
- Replaced existing error handling in `database.rs` with `NyxResult`.
- Improved database maintenance by integrating `vacuum` and `clear` methods into workflows.
- Added `dashmap` for efficient parallel diagnostics result aggregation in `scan_with_index_parallel`.
- Enhanced readability and formatting of console outputs in multiple modules.
2025-06-23 20:27:16 +02:00
elipeter
17d327a572 Add bytesize and chrono, improve console output formatting
- Added `bytesize` and `chrono` dependencies in `Cargo.toml` and `Cargo.lock` for enhanced size and time formatting.
- Enhanced console output in `list.rs`, `index.rs`, `clean.rs`, and `config.rs` with improved styles for readability.
- Updated file size and modified time formatting across commands using `ByteSize` and `chrono`.
2025-06-23 19:37:19 +02:00
elipeter
487ccbba8b Add thiserror and improve console output formatting
- Added `thiserror` dependency in `Cargo.toml` and `Cargo.lock` for enhanced error handling.
- Improved execution time tracking and output formatting in `main.rs`.
- Refactored console output in `scan.rs` for better readability with grouped warnings.
- Simplified error handling in `scan_filesystem`.
2025-06-23 18:25:10 +02:00
elipeter
0a62b6f40c Refactor database connection handling with connection pooling and parallel processing
- Introduced `r2d2` connection pooling for SQLite in `database.rs`.
- Updated `Indexer` to use pooled connections for improved concurrency.
- Replaced sequential processing with `rayon` for parallel file scanning.
- Added a `clear` method to `Indexer` for reindexing support.
- Enhanced database initialization with `init` and `from_pool` methods.
- Updated `Cargo.toml` and `Cargo.lock` to include `r2d2`, `r2d2_sqlite`, and new dependencies.
2025-06-17 20:45:33 +02:00
elipeter
1933082b41 Add rayon for parallel file scanning in for no indexingscan.rs
- Integrated `rayon` for concurrent iteration in `scan_filesystem`, enhancing performance.
- Updated `Cargo.toml` and `Cargo.lock` to include `rayon` and its dependencies.
- Adjusted `scan.rs` to utilize `rayon`'s `par_bridge` for parallel file processing with error handling.
2025-06-17 19:54:03 +02:00
elipeter
0eecf886f2 Refactor database schema and scanning process:
- Introduced `issues` table for detailed vulnerability storage.
- Enhanced `files` table with project scoping and unique constraints.
- Replaced `OutputFormat` enum with `String` for flexibility.
- Added support for formatted console output of scan results.
- Integrated file and issue updating logic for incremental scans.
- Optimized scanning by leveraging database-stored issues.
2025-06-17 16:46:45 +02:00
elipeter
a96bcd5982 Renamed project from "Nano" to "Nyx" across codebase and configuration files. 2025-06-17 10:56:00 +02:00
elipeter
0b465bdacb Renamed project from "Nano" to "Nyx" across codebase and configuration files. 2025-06-17 10:55:50 +02:00
elipeter
7bfce3ad7f Update dependencies and enhance pattern handling
- Added `tracing-appender` and `log` dependencies to improve error logging.
- Enhanced `walk.rs` to add error handling with warning logs for ignore patterns.
- Expanded Rust and JavaScript patterns with additional security vulnerability checks.
- Simplified and updated pattern queries for improved accuracy and consistency.
- Removed unused print statement in `index.rs`.
2025-06-17 02:22:14 +02:00
elipeter
22369cc404 Add multi-language AST-pattern scanning support
- Introduced `patterns` module with language-specific vulnerability patterns.
- Added `query_cache` utility for caching compiled queries.
- Expanded `scan.rs` to support scanning multiple languages dynamically.
- Updated `Cargo.toml` with additional tree-sitter dependencies.
- Added severity filtering to `ScannerConfig` for better configuration.
2025-06-17 01:17:48 +02:00
elipeter
15920328d7 Add unit tests for Indexer and update dependencies
- Introduced comprehensive tests for `Indexer` to validate file scan behavior.
- Added `tempfile` and `filetime` as dependencies for testing.
- Removed unused dependencies (`anyhow`, `nix`, `regex`).
2025-06-17 00:02:32 +02:00
elipeter
ada7835efa - Remove unused filetypes.rs and walk.rs modules
- Introduce `index.rs` for file indexing using SQLite
- Expand configuration options in `config.rs`, including `excluded_files`
- Update dependencies in `Cargo.toml` to include SQLite, hashing, and regex libraries
2025-06-16 23:48:04 +02:00
elipeter
ab5558f537 Added foundational modules for core functionalities:
- Introduced `walk.rs` as a parallel directory walker for search operations.
- Implemented basic index handling in `commands/index.rs`.
- Created `utils/config.rs` for configuration management with placeholders for future enhancements.
2025-06-16 16:46:22 +02:00