@samiyev/guardian
Version:
Research-backed code quality guardian for AI-assisted development. Detects hardcodes, secrets, circular deps, framework leaks, entity exposure, and 9 architecture violations. Enforces Clean Architecture/DDD principles. Works with GitHub Copilot, Cursor, W
38 lines • 1.28 kB
TypeScript
import Parser from "tree-sitter";
import { HardcodedValue } from "../../domain/value-objects/HardcodedValue";
import { AstContextChecker } from "./AstContextChecker";
/**
* AST-based analyzer for detecting configuration objects with hardcoded values
*
* Detects objects that contain multiple hardcoded values that should be
* extracted to a configuration file.
*
* Example:
* const config = { timeout: 5000, retries: 3, url: "http://..." }
*/
export declare class AstConfigObjectAnalyzer {
private readonly contextChecker;
private readonly MIN_HARDCODED_VALUES;
constructor(contextChecker: AstContextChecker);
/**
* Analyzes an object expression and returns a violation if it contains many hardcoded values
*/
analyze(node: Parser.SyntaxNode, lines: string[]): HardcodedValue | null;
/**
* Counts hardcoded values in an object
*/
private countHardcodedValues;
/**
* Checks if a node is a hardcoded value
*/
private isHardcodedValue;
/**
* Creates a HardcodedValue violation for a config object
*/
private createViolation;
/**
* Gets a preview of the object for the violation message
*/
private getObjectPreview;
}
//# sourceMappingURL=AstConfigObjectAnalyzer.d.ts.map