Development Guide

February 10, 2026 · View on GitHub

Prerequisites

  • Go 1.24+ - Download
  • golangci-lint - Required for linting (make lint)

Getting Started

# Clone the repository
git clone https://github.com/ludo-technologies/jscan.git
cd jscan

# Download dependencies
go mod download

# Build the binary
make build

Makefile Targets

TargetDescription
make buildBuild the jscan binary
make testRun all tests with verbose output
make test-shortRun short tests only (skip long-running tests)
make benchRun benchmarks with memory allocation stats
make coverageGenerate HTML coverage report (coverage.html)
make lintRun golangci-lint
make fmtFormat all Go source files
make cleanRemove build artifacts, coverage files, and dist/
make installBuild and install the binary via go install
make runBuild and run against testdata/javascript/simple/
make versionPrint version, commit, and build date
make build-allCross-compile for linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64
make depsDownload and verify module dependencies
make tidyTidy go.mod and go.sum

Project Structure

jscan/
├── cmd/jscan/          # CLI entry point (main.go, analyze.go, check.go, deps.go, init.go)
├── domain/             # Domain models (complexity, dead code, clone, coupling, output)
├── app/                # Application use cases
├── service/            # Service layer
├── internal/
│   ├── parser/         # tree-sitter JavaScript/TypeScript parser
│   ├── analyzer/       # Analysis engines (CFG, complexity, dead code, clones, deps)
│   ├── config/         # Configuration management
│   ├── reporter/       # Output formatting (text, JSON, HTML, CSV, DOT)
│   ├── constants/      # Shared constants
│   ├── testutil/       # Test utilities
│   └── version/        # Version information
├── npm/                # npm package wrapper
└── testdata/           # Test fixtures (javascript/)

Build Details

The build injects version metadata via linker flags (-ldflags):

  • Version - from git describe --tags --always --dirty
  • Commit - from git rev-parse --short HEAD
  • Date - build date
  • BuiltBy - set to make when built via Makefile