Olanta Scanner is a static code analysis tool designed to find code smells and bugs in Java and Python projects. It uses embedded YAML rules to detect issues in the code and can either submit these issues to the Olanta Core server or print them to the console.
- Detects code smells and bugs in Java and Python code.
- Uses embedded YAML rules for flexibility and ease of customization.
- Can submit issues to the Olanta Core server or print them to the console.
To build the Olanta Scanner, you need to have Go installed on your machine. Follow these steps to build and run the scanner:
-
Clone the repository:
git clone https://github.com/olanta/olanta.git cd olanta/scanner
-
Install the required Go dependencies:
go mod tidy
-
Build the project using Mage:
mage -d build build
To use the Olanta Scanner, run the built binary with the scan
command, specifying the language and the path to the code to be analyzed.
-
Scan a Java project:
./bin/scanner scan java /path/to/your/java/project
-
Scan a Python project:
./bin/scanner scan python /path/to/your/python/project
--core-url
: Specify the URL of the Olanta Core server to submit the issues. If the server is not available, the issues will be printed to the console.
cmd/scanner/main.go
: The main entry point for the scanner command-line tool.internal/scanner
: Contains the core scanning logic and language-specific scanners.internal/models
: Defines the data models used in the project.internal/utils
: Utility functions for loading YAML rules and other common tasks.internal/scanner/rules
: Contains the embedded YAML rules for Java and Python.build
: Contains build scripts and configuration for Mage.
-
Clean the build:
mage -d build clean
-
Build the project:
mage -d build build
-
Run the project:
./bin/scanner scan java /path/to/your/java/project