---
title: "Cpanel::Plugins::Components::Rules::Random Dependency Diagram"
generateBy: augment
---
graph TD
    direction LR

    RF[Random.pm] --> F[Filter.pm]
    F --> B[Base.pm]
    F --> T[True.pm]
    B --> N[Normalize.pm]

    %% Direct imports in Random
    RF --> CFW[Cpanel::FileUtils::Write]
    RF --> CS[Cpanel::Slurper]
    RF --> CH[Cpanel::Hostname]
    RF --> DS[Digest::SHA]
    RF --> MOO[Moo]
    RF --> CI[Cpanel::Imports]
    RF --> CP[cPstrict]

    %% System dependencies
    RF --> DEV[dev_urandom]
    RF --> FS[File System]
    RF --> TIME[time function]
    RF --> PID[Process ID]
    RF --> RAND[Perl rand]
    RF --> UNPACK[unpack function]

    %% Nested rule dependencies
    RF --> NR[Any Nested Rule]
    NR --> CR[CompanyId Rule]
    NR --> FR[FeatureFlag Rule]
    NR --> DR[DateRange Rule]
    NR --> AR[And Rule]
    NR --> OR[Or Rule]
    NR --> NOT[Not Rule]

    %% Base class dependencies
    B --> DM[Dynamic Module Loading]
    B --> RP[Rule Processing]

    %% File operations
    CFW --> AW[Atomic Write Operations]
    CS --> FR2[File Reading]
    FS --> CF[Cache Files]

    %% Cryptographic chain
    CH --> HN[System Hostname]
    DS --> SHA[SHA-256 Hashing]
    DEV --> SR[Secure Random Bytes]

    %% Configuration dependencies
    RF --> SS[sample_size config]
    RF --> FLS[fleet_size config]
    RF --> CFG[cache_file config]
    RF --> RC[rule config]

    %% External system calls
    HN --> SYS[System Calls]
    DEV --> KERNEL[Linux Kernel]
    TIME --> SYSCLOCK[System Clock]

    %% Style the different types of dependencies
    classDef coreModule fill:#e1f5fe,stroke:#01579b,stroke-width:2px
    classDef externalLib fill:#f3e5f5,stroke:#4a148c,stroke-width:2px
    classDef systemDep fill:#fff3e0,stroke:#e65100,stroke-width:2px
    classDef configDep fill:#e8f5e8,stroke:#1b5e20,stroke-width:2px
    classDef ruleDep fill:#ffebee,stroke:#b71c1c,stroke-width:2px

    class RF,F,B,T,N coreModule
    class MOO,CI,CP,CFW,CS,CH,DS externalLib
    class DEV,FS,TIME,PID,RAND,UNPACK,HN,SYS,KERNEL,SYSCLOCK,AW,FR2,CF,SHA,SR,DM,RP systemDep
    class SS,FLS,CFG,RC configDep
    class NR,CR,FR,DR,AR,OR,NOT ruleDep
