Angular Modernizer
    Preparing search index...

    Pattern discovery result.

    interface LearnPatternsResult {
        artifacts?: {
            fixtures?: { path: string; patterns: string[] }[];
            rules?: { path: string; ruleIds: string[] }[];
        };
        confidenceAnalysis?: {
            averageConfidence: number;
            highConfidence: number;
            lowConfidence: number;
            mediumConfidence: number;
            styleAlignedPatterns: number;
        };
        generatedRules?: {
            alignedWithStyle: boolean;
            confidence: number;
            path: string;
            rationale: string;
            ruleId: string;
        }[];
        learningEvolution?: {
            confidenceImprovement?: number;
            deprecatedPatterns: number;
            isFirstScan: boolean;
            newPatternsDiscovered: number;
            patternStability: number;
            patternVelocity: number;
            styleShift?: { confidence: number; from: string; to: string };
        };
        patterns: {
            alignsWithStyle?: boolean;
            category: string;
            complexity: "low"
            | "medium"
            | "high";
            confidence?: number;
            confidenceExplanation?: string;
            description: string;
            dominancePercentage?: number;
            examples: {
                code: string;
                filePath: string;
                metadata: Record<string, unknown>;
            }[];
            id: string;
            name: string;
            occurrences: number;
            scanCount?: number;
            styleAlignment?: number;
            suggestedRule?: { detection: string; ruleId: string; severity: string };
            trending?: "rising" | "stable" | "declining";
        }[];
        statistics: {
            byCategory: Record<string, number>;
            byComplexity: Record<string, number>;
            duration: number;
            filesAnalyzed: number;
            totalPatternsFound: number;
        };
        styleProfile?: {
            architectureStyle: "clean"
            | "feature-modules"
            | "ddd"
            | "standard";
            changeDetectionPreference: "default" | "mixed" | "onpush";
            confidence: number;
            diPreference: "mixed" | "inject" | "constructor";
            diRatio: { constructor: number; inject: number };
            dominantPatterns: string[];
            moduleStyle: "mixed" | "standalone" | "ngmodule";
            namingConventions: { count: number; suffix: string }[];
            rxjsPreference: "signal" | "mixed" | "behaviorsubject";
            rxjsRatio: { behaviorSubject: number; signal: number };
            stateManagement: "none" | "ngrx" | "akita" | "ngxs" | "custom";
        };
        summary: string;
        validation?: { patternsValidated: number; validationErrors: string[] };
    }
    Index

    Properties

    artifacts?: {
        fixtures?: { path: string; patterns: string[] }[];
        rules?: { path: string; ruleIds: string[] }[];
    }

    Generated artifacts.

    Type Declaration

    • Optionalfixtures?: { path: string; patterns: string[] }[]

      Fixture files written.

    • Optionalrules?: { path: string; ruleIds: string[] }[]

      Rule files written.

    confidenceAnalysis?: {
        averageConfidence: number;
        highConfidence: number;
        lowConfidence: number;
        mediumConfidence: number;
        styleAlignedPatterns: number;
    }

    Confidence analysis summary.

    Type Declaration

    • averageConfidence: number

      Average confidence of all patterns.

    • highConfidence: number

      Patterns with confidence 0.8 or more.

    • lowConfidence: number

      Patterns with confidence below 0.6.

    • mediumConfidence: number

      Patterns with confidence from 0.6 to below 0.8.

    • styleAlignedPatterns: number

      Patterns aligned with the style profile.

    generatedRules?: {
        alignedWithStyle: boolean;
        confidence: number;
        path: string;
        rationale: string;
        ruleId: string;
    }[]

    Generated rules (if generateRules=true).

    Type Declaration

    • alignedWithStyle: boolean

      true when the rule aligns with the style profile.

    • confidence: number

      Confidence of the rule.

    • path: string

      Output folder (ruleOutputPath, default ./learned-rules).

    • rationale: string

      Why the rule was generated.

    • ruleId: string

      Generated rule id.

    learningEvolution?: {
        confidenceImprovement?: number;
        deprecatedPatterns: number;
        isFirstScan: boolean;
        newPatternsDiscovered: number;
        patternStability: number;
        patternVelocity: number;
        styleShift?: { confidence: number; from: string; to: string };
    }

    Learning evolution tracking.

    Type Declaration

    • OptionalconfidenceImprovement?: number

      Confidence gain reported by the knowledge base.

    • deprecatedPatterns: number

      Earlier patterns no longer found.

    • isFirstScan: boolean

      true when the knowledge base had no earlier scan.

    • newPatternsDiscovered: number

      Patterns not seen in earlier scans.

    • patternStability: number

      Stability of the patterns compared with earlier scans.

    • patternVelocity: number

      Rate of pattern change between scans.

    • OptionalstyleShift?: { confidence: number; from: string; to: string }

      Change of the style profile since the earlier scan.

      • confidence: number

        Confidence of the shift.

      • from: string

        Earlier style.

      • to: string

        Current style.

    patterns: {
        alignsWithStyle?: boolean;
        category: string;
        complexity: "low" | "medium" | "high";
        confidence?: number;
        confidenceExplanation?: string;
        description: string;
        dominancePercentage?: number;
        examples: {
            code: string;
            filePath: string;
            metadata: Record<string, unknown>;
        }[];
        id: string;
        name: string;
        occurrences: number;
        scanCount?: number;
        styleAlignment?: number;
        suggestedRule?: { detection: string; ruleId: string; severity: string };
        trending?: "rising" | "stable" | "declining";
    }[]

    Discovered patterns.

    Type Declaration

    • OptionalalignsWithStyle?: boolean

      true when the pattern matches the detected style profile.

    • category: string

      Pattern category.

    • complexity: "low" | "medium" | "high"

      Estimated complexity.

    • Optionalconfidence?: number

      Confidence score (0 to 1).

    • OptionalconfidenceExplanation?: string

      Why the confidence has its value.

    • description: string

      What the pattern is.

    • OptionaldominancePercentage?: number

      Occurrences per analyzed file, in percent.

    • examples: { code: string; filePath: string; metadata: Record<string, unknown> }[]

      Example occurrences.

    • id: string

      Pattern id.

    • name: string

      Pattern name.

    • occurrences: number

      Number of occurrences.

    • OptionalscanCount?: number

      Number of scans that saw the pattern.

    • OptionalstyleAlignment?: number

      Degree of alignment with the style profile (0 to 1).

    • OptionalsuggestedRule?: { detection: string; ruleId: string; severity: string }

      Analysis rule suggested for the pattern.

      • detection: string

        How the rule would detect the pattern.

      • ruleId: string

        Suggested rule id.

      • severity: string

        Suggested severity.

    • Optionaltrending?: "rising" | "stable" | "declining"

      Trend across scans.

    statistics: {
        byCategory: Record<string, number>;
        byComplexity: Record<string, number>;
        duration: number;
        filesAnalyzed: number;
        totalPatternsFound: number;
    }

    Pattern statistics.

    Type Declaration

    • byCategory: Record<string, number>

      Patterns per category.

    • byComplexity: Record<string, number>

      Patterns per complexity.

    • duration: number

      Duration in milliseconds.

    • filesAnalyzed: number

      Number of analyzed files.

    • totalPatternsFound: number

      Number of patterns found.

    styleProfile?: {
        architectureStyle: "clean" | "feature-modules" | "ddd" | "standard";
        changeDetectionPreference: "default" | "mixed" | "onpush";
        confidence: number;
        diPreference: "mixed" | "inject" | "constructor";
        diRatio: { constructor: number; inject: number };
        dominantPatterns: string[];
        moduleStyle: "mixed" | "standalone" | "ngmodule";
        namingConventions: { count: number; suffix: string }[];
        rxjsPreference: "signal" | "mixed" | "behaviorsubject";
        rxjsRatio: { behaviorSubject: number; signal: number };
        stateManagement: "none" | "ngrx" | "akita" | "ngxs" | "custom";
    }

    Detected style profile for the codebase.

    Type Declaration

    • architectureStyle: "clean" | "feature-modules" | "ddd" | "standard"

      Detected architecture style.

    • changeDetectionPreference: "default" | "mixed" | "onpush"

      Preferred change detection strategy.

    • confidence: number

      Confidence of the profile.

    • diPreference: "mixed" | "inject" | "constructor"

      Preferred dependency injection style.

    • diRatio: { constructor: number; inject: number }

      Usage share of constructor injection and inject().

      • constructor: number

        Share of constructor injection.

      • inject: number

        Share of inject().

    • dominantPatterns: string[]

      Most frequent patterns.

    • moduleStyle: "mixed" | "standalone" | "ngmodule"

      Standalone components, NgModules or both.

    • namingConventions: { count: number; suffix: string }[]

      Class name suffixes and their counts.

    • rxjsPreference: "signal" | "mixed" | "behaviorsubject"

      Preferred state primitive: BehaviorSubject, signal or both.

    • rxjsRatio: { behaviorSubject: number; signal: number }

      Usage share of BehaviorSubject and signal.

      • behaviorSubject: number

        Share of BehaviorSubject.

      • signal: number

        Share of signal.

    • stateManagement: "none" | "ngrx" | "akita" | "ngxs" | "custom"

      Detected state management library.

    summary: string

    Human-readable summary for LLM consumption.

    validation?: { patternsValidated: number; validationErrors: string[] }

    Validation results.

    Type Declaration

    • patternsValidated: number

      Number of validated patterns.

    • validationErrors: string[]

      Quality problems found.