codeint 0.8.0
codeint: ^0.8.0 copied to clipboard
Programmatic Dart client SDK and CLI runner for codeint, measuring Software entropy and Hazards.
codeint #
Official pure Dart client SDK and CLI runner for codeint.
codeint measures the Software entropy of a codebase and reports Hazards next to Software entropy across TypeScript, JavaScript, Rust, PHP, Dart, Python, Go, SQL, and Shell.
Installation #
Add codeint to your pubspec.yaml:
dev_dependencies:
codeint: ^0.8.0
Pre-warm the verified native binary cache if desired:
dart run codeint:install
Run the CLI directly through Dart:
dart run codeint check
Programmatic usage #
import 'package:codeint/codeint.dart';
Future<void> main() async {
final client = CodeintClient(cwd: '.');
final result = await client.check();
if (!result.passed) {
throw StateError('codeint failed: ${result.failures.join(', ')}');
}
final production = result.report.sourceSets['production'];
print('Erosion ratio: ${production?.erosion.ratio}');
}
Binary resolution #
ensureBinary() resolves the native codeint binary in four deterministic steps:
- Explicit
binaryPathoption. CODEINT_BINenvironment variable.- Version-matching
codeintexecutable onPATH. - Version-pinned GitHub Release archive verified against
SHA256SUMSbefore extraction and stored in the local user cache.
Set allowDownload: false in offline CI environments to fail fast without network access when no local binary is available.