v2

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package v2 — world-class static analysis platform. Three layers:

  1. External tool adapters (golangci-lint/semgrep/ruff/shellcheck/eslint)
  2. Self-built semantic analyzers (nil-path/race/leak/SQLi/crypto)
  3. Architecture scanners (god-pkg/cycle/layer/gap)

Single `ok-verify` command covers Go/Python/JS-TS/Rust/Shell/mixed repos. Output: terminal table or structured JSON with severity grading + fix patches.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectLanguages

func DetectLanguages(root string) []string

DetectLanguages guesses the primary languages in a project directory by checking for marker files.

Types

type Analyzer

type Analyzer interface {
	Name() string
	Layer() string
	Languages() []string
	Run(ctx context.Context, root string) ([]Finding, error)
}

type Finding

type Finding struct {
	Analyzer string   `json:"analyzer"`
	Layer    string   `json:"layer"`
	Severity Severity `json:"severity"`
	File     string   `json:"file"`
	Line     int      `json:"line"`
	Column   int      `json:"column"`
	Message  string   `json:"message"`
	Category string   `json:"category,omitempty"`
	Fix      string   `json:"fix,omitempty"`
	Rule     string   `json:"rule,omitempty"`
}

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewDefaultRegistry

func NewDefaultRegistry() *Registry

NewDefaultRegistry creates a Registry pre-loaded with all analyzers. External adapters are added based on tool availability; self-built analyzers are always added for the languages they support.

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Add

func (r *Registry) Add(a Analyzer)

func (*Registry) All

func (r *Registry) All() []Analyzer

func (*Registry) RunAll

func (r *Registry) RunAll(ctx context.Context, root string, lang string) []Finding

type Report

type Report struct {
	Findings []Finding `json:"findings"`
	Summary  Summary   `json:"summary"`
}

func Scan

func Scan(ctx context.Context, root string) (*Report, error)

Scan runs all analyzers against root, auto-detecting languages. Returns a ready-to-display Report.

func (*Report) JSON

func (r *Report) JSON() string

func (*Report) Terminal

func (r *Report) Terminal() string

type Severity

type Severity int
const (
	SevInfo     Severity = 0
	SevLow      Severity = 1
	SevMedium   Severity = 2
	SevHigh     Severity = 3
	SevCritical Severity = 4
)

func (Severity) String

func (s Severity) String() string

type Summary

type Summary struct {
	Total      int            `json:"total"`
	Critical   int            `json:"critical"`
	High       int            `json:"high"`
	Medium     int            `json:"medium"`
	Low        int            `json:"low"`
	Info       int            `json:"info"`
	ByLayer    map[string]int `json:"by_layer"`
	ByCategory map[string]int `json:"by_category"`
}

func BuildSummary

func BuildSummary(ff []Finding) Summary

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL