fcis 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -36,6 +36,8 @@ type ExtractedFunction = {
36
36
  hasAwait: boolean;
37
37
  propertyAccessChains: string[];
38
38
  kind: 'function' | 'method' | 'arrow' | 'function-expression' | 'getter' | 'setter';
39
+ enclosingFunctionStartLine: number | null;
40
+ isInlineCallback: boolean;
39
41
  };
40
42
  /**
41
43
  * Represents imports in a file
@@ -52,7 +54,7 @@ type FileImports = {
52
54
  * Note: 'async-function' removed — async alone is not an impurity marker
53
55
  * Note: React hook markers deferred to v2
54
56
  */
55
- type MarkerType = 'await-expression' | 'database-call' | 'network-fetch' | 'network-http' | 'fs-import' | 'fs-call' | 'env-access' | 'console-log' | 'logging' | 'telemetry' | 'queue-enqueue' | 'event-emit';
57
+ type MarkerType = 'await-expression' | 'database-call' | 'network-fetch' | 'network-http' | 'fs-call' | 'env-access' | 'console-log' | 'logging' | 'telemetry' | 'queue-enqueue' | 'event-emit';
56
58
  /**
57
59
  * Represents a detected impurity marker in a function
58
60
  */
@@ -153,6 +155,7 @@ type ProjectScore = {
153
155
  subset?: boolean;
154
156
  filesGlob?: string;
155
157
  errors?: AnalysisError[];
158
+ rolledUpDirectories?: DirectoryScore[];
156
159
  };
157
160
  /**
158
161
  * Error encountered during analysis
@@ -174,6 +177,7 @@ type AnalyzerConfig = {
174
177
  outputPath?: string;
175
178
  quiet?: boolean;
176
179
  verbose?: boolean;
180
+ dirDepth?: number;
177
181
  };
178
182
  /**
179
183
  * Quality scoring thresholds (configurable)
@@ -457,9 +461,14 @@ declare function getStatusColor(status: Status): 'green' | 'yellow' | 'red';
457
461
  * all functions take data in and return data out with no I/O.
458
462
  *
459
463
  * Metrics:
460
- * - Purity: percentage of pure functions
464
+ * - Purity: percentage of pure functions (top-level only, excluding inline callbacks)
461
465
  * - Impurity Quality: average quality score of impure functions
462
466
  * - Health: percentage of functions with status 'ok'
467
+ *
468
+ * Compositional Scoring (Plan 007):
469
+ * - Inline callbacks are absorbed into their parent function's score
470
+ * - Function counts only include top-level functions
471
+ * - Line counts don't double-count (parent bodyLineCount includes nested callbacks)
463
472
  */
464
473
 
465
474
  /**
@@ -537,6 +546,7 @@ declare function getDiagnosticInsights(score: Pick<ProjectScore, 'purity' | 'imp
537
546
  * - Directory and file breakdowns
538
547
  * - Refactoring candidates
539
548
  * - Any errors encountered during analysis
549
+ * - Rolled-up directories (when --dir-depth is used)
540
550
  */
541
551
 
542
552
  /**
@@ -545,6 +555,8 @@ declare function getDiagnosticInsights(score: Pick<ProjectScore, 'purity' | 'imp
545
555
  type JsonReportOptions = {
546
556
  pretty?: boolean;
547
557
  includeFunction?: boolean;
558
+ dirDepth?: number;
559
+ projectRoot?: string;
548
560
  };
549
561
  /**
550
562
  * Generate JSON report string from project score
@@ -635,6 +647,7 @@ declare function generateComparisonReport(current: ProjectScore, previous: Proje
635
647
  */
636
648
  declare function printConsoleReport(score: ProjectScore, options?: {
637
649
  verbose?: boolean;
650
+ dirDepth?: number;
638
651
  }): void;
639
652
  /**
640
653
  * Generate a single-line summary suitable for CI output