lakos 1.2.1 copy "lakos: ^1.2.1" to clipboard
lakos: ^1.2.1 copied to clipboard

outdated

Visualize Dart library dependencies in Graphviz dot. Detect dependency cycles.

example/example.dart

import 'dart:io';
import 'package:lakos/lakos.dart';

void main() {
  var model = buildModel(Directory('.'), ignoreGlob: 'test/**');
  print(model.getOutput(OutputFormat.Dot));
  print(model.getOutput(OutputFormat.Json));

  if (!model.metrics.isAcyclic) {
    print('Dependency cycle detected.');
  }

  var nodesSortedBySloc = model.nodes.values.toList();
  nodesSortedBySloc.sort((a, b) => a.sloc.compareTo(b.sloc));
  for (var node in nodesSortedBySloc) {
    print('${node.sloc}: ${node.id}');
  }

  // Further analysis with the directed_graph library
  var digraph = model.toDirectedGraph();
  print(digraph.topologicalOrdering);
}
105
likes
0
pub points
70%
popularity

Publisher

verified publisherolegalexander.com

Visualize Dart library dependencies in Graphviz dot. Detect dependency cycles.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

args, directed_graph, glob, path, string_scanner

More

Packages that depend on lakos