Class: Lutaml::UmlRepository::StatisticsCalculator
- Inherits:
-
Object
- Object
- Lutaml::UmlRepository::StatisticsCalculator
- Defined in:
- lib/lutaml/uml_repository/statistics_calculator.rb
Overview
StatisticsCalculator provides comprehensive statistics about a UML repository
Calculates detailed metrics including:
-
Package statistics (depth distribution, sizes)
-
Class statistics (by stereotype, complexity)
-
Attribute statistics (type distribution, multiplicity)
-
Association statistics
-
Diagram statistics
-
Model quality metrics
Instance Method Summary collapse
-
#calculate ⇒ Hash
Calculate comprehensive statistics for the repository.
-
#initialize(document, indexes) ⇒ StatisticsCalculator
constructor
A new instance of StatisticsCalculator.
Constructor Details
#initialize(document, indexes) ⇒ StatisticsCalculator
Returns a new instance of StatisticsCalculator.
26 27 28 29 |
# File 'lib/lutaml/uml_repository/statistics_calculator.rb', line 26 def initialize(document, indexes) @document = document @indexes = indexes end |
Instance Method Details
#calculate ⇒ Hash
Calculate comprehensive statistics for the repository
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/lutaml/uml_repository/statistics_calculator.rb', line 34 def calculate # rubocop:disable Metrics/AbcSize,Metrics/MethodLength { # Basic counts total_packages: package_count, total_classes: class_count, total_data_types: data_type_count, total_enums: enum_count, total_diagrams: diagram_count, # Package statistics packages_by_depth: packages_by_depth, max_package_depth: max_depth, avg_package_depth: avg_package_depth, # Class statistics classes_by_stereotype: classes_by_stereotype, most_complex_classes: most_complex_classes(limit: 10), avg_class_complexity: avg_class_complexity, # Attribute statistics total_attributes: attribute_count, attribute_type_distribution: attribute_type_distribution, # Association statistics total_associations: association_count, # Inheritance statistics total_inheritance_relationships: inheritance_count, max_inheritance_depth: max_inheritance_depth, # Model quality metrics abstract_class_count: abstract_class_count, classes_without_documentation: undocumented_classes_count, classes_without_attributes: classes_without_attributes_count, } end |