@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
53 lines • 1.79 kB
TypeScript
import { ValueObject } from "./ValueObject";
interface AnemicModelViolationProps {
readonly className: string;
readonly filePath: string;
readonly layer: string;
readonly line?: number;
readonly methodCount: number;
readonly propertyCount: number;
readonly hasOnlyGettersSetters: boolean;
readonly hasPublicSetters: boolean;
}
/**
* Represents an anemic domain model violation in the codebase
*
* Anemic domain model occurs when entities have only getters/setters
* without business logic. This violates Domain-Driven Design principles
* and leads to procedural code instead of object-oriented design.
*
* @example
* ```typescript
* // Bad: Anemic model with only getters/setters
* const violation = AnemicModelViolation.create(
* 'Order',
* 'src/domain/entities/Order.ts',
* 'domain',
* 10,
* 4,
* 2,
* true,
* true
* )
*
* console.log(violation.getMessage())
* // "Class 'Order' is anemic: 4 methods (all getters/setters) for 2 properties"
* ```
*/
export declare class AnemicModelViolation extends ValueObject<AnemicModelViolationProps> {
private constructor();
static create(className: string, filePath: string, layer: string, line: number | undefined, methodCount: number, propertyCount: number, hasOnlyGettersSetters: boolean, hasPublicSetters: boolean): AnemicModelViolation;
get className(): string;
get filePath(): string;
get layer(): string;
get line(): number | undefined;
get methodCount(): number;
get propertyCount(): number;
get hasOnlyGettersSetters(): boolean;
get hasPublicSetters(): boolean;
getMessage(): string;
getSuggestion(): string;
getExampleFix(): string;
}
export {};
//# sourceMappingURL=AnemicModelViolation.d.ts.map