Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 40 additions & 30 deletions src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,22 @@ export interface ExampleSecretWarning {
severity: 'high' | 'medium' | 'low';
}

/**
* Statistics for codebase scanning
*/
export interface ScanStats {
/** Total number of files scanned during the scan process */
filesScanned: number;
/** Total number of environment variable references found across all scanned files */
totalUsages: number;
/** Total number of unique environment variables referenced across all scanned files */
uniqueVariables: number;
/** Total number of warnings found during the scan process */
warningsCount: number;
/** Total duration of the scan process in seconds */
duration: number;
}

/**
* Options for scanning the codebase
*/
Expand Down Expand Up @@ -195,13 +211,7 @@ export interface ScanResult {
used: EnvUsage[];
missing: string[];
unused: string[];
stats: {
filesScanned: number;
totalUsages: number;
uniqueVariables: number;
warningsCount: number;
duration: number;
};
stats: ScanStats;
secrets: SecretFinding[];
duplicates: {
env?: Duplicate[];
Expand Down Expand Up @@ -266,6 +276,29 @@ export interface ComparisonOptions {
inconsistentNamingWarnings?: boolean;
}

/**
* Resolved comparison file with absolute path and display name.
*/
export interface ComparisonFile {
path: string;
name: string;
}

/**
* Represents the discovery of environment files in a project.
* Contains information about the current working directory, found environment files,
* and the primary environment and example files.
*/
export interface Discovery {
cwd: string;
envFiles: string[];
primaryEnv: string;
primaryExample: string;
envFlag: string | null;
exampleFlag: string | null;
alreadyWarnedMissingEnv: boolean;
}

/**
* Represents a resolved pair of environment files used for comparison.
*
Expand Down Expand Up @@ -336,26 +369,3 @@ export interface InconsistentNamingWarning {
key2: string;
suggestion: string;
}

/**
* Represents the discovery of environment files in a project.
* Contains information about the current working directory, found environment files,
* and the primary environment and example files.
*/
export interface Discovery {
cwd: string;
envFiles: string[];
primaryEnv: string;
primaryExample: string;
envFlag: string | null;
exampleFlag: string | null;
alreadyWarnedMissingEnv: boolean;
}

/**
* Resolved comparison file with absolute path and display name.
*/
export interface ComparisonFile {
path: string;
name: string;
}
17 changes: 1 addition & 16 deletions src/ui/scan/printStats.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
import chalk from 'chalk';

/**
* Statistics for codebase scanning
*/
interface ScanStats {
/** Total number of files scanned during the scan process */
filesScanned: number;
/** Total number of environment variable references found across all scanned files */
totalUsages: number;
/** Total number of unique environment variables referenced across all scanned files */
uniqueVariables: number;
/** Total number of warnings found during the scan process */
warningsCount: number;
/** Total duration of the scan process in seconds */
duration: number;
}
import type { ScanStats } from '../../config/types.js';

/**
* Print scan statistics for codebase scanning.
Expand Down
9 changes: 2 additions & 7 deletions src/ui/scan/scanJsonOutput.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type {
ScanResult,
ScanStats,
EnvUsage,
Duplicate,
ExpireWarning,
Expand All @@ -15,13 +16,7 @@ import { normalizePath } from '../../core/helpers/normalizePath.js';
* JSON structure for scan results output
*/
interface ScanJsonOutput {
stats?: {
filesScanned: number;
totalUsages: number;
uniqueVariables: number;
warningsCount: number;
duration: number;
};
stats?: ScanStats;
missing?: Array<{
variable: string;
usages: Array<{
Expand Down
Loading