ea 0.6.153 → 0.6.155

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.
Files changed (178) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ea/cli/app.rb +8 -2
  3. data/lib/ea/cli/command/base.rb +1 -3
  4. data/lib/ea/cli/command/convert.rb +2 -2
  5. data/lib/ea/cli/command/diagrams.rb +4 -4
  6. data/lib/ea/cli/command/export.rb +1 -1
  7. data/lib/ea/cli/command/info.rb +1 -1
  8. data/lib/ea/cli/command/list.rb +2 -2
  9. data/lib/ea/cli/command/render.rb +1 -2
  10. data/lib/ea/cli/command/svg.rb +1 -1
  11. data/lib/ea/cli/command/validate.rb +1 -3
  12. data/lib/ea/cli/error.rb +1 -1
  13. data/lib/ea/cli/output.rb +1 -1
  14. data/lib/ea/diagram/display_config.rb +1 -1
  15. data/lib/ea/export/json/generator.rb +5 -5
  16. data/lib/ea/export/json_schema/generator.rb +2 -2
  17. data/lib/ea/export/plantuml/generator.rb +2 -2
  18. data/lib/ea/fonts/metrics.rb +3 -4
  19. data/lib/ea/lint/rules/cyclic_generalization.rb +1 -1
  20. data/lib/ea/lint/rules/duplicate_name.rb +1 -1
  21. data/lib/ea/lint/rules/missing_stereotype.rb +4 -3
  22. data/lib/ea/lint/rules/naming_convention.rb +11 -11
  23. data/lib/ea/lint/rules/orphan_element.rb +6 -6
  24. data/lib/ea/mdg/document.rb +0 -1
  25. data/lib/ea/mdg/loader.rb +0 -1
  26. data/lib/ea/mdg/xml/technology.rb +1 -1
  27. data/lib/ea/mdg/xml.rb +0 -1
  28. data/lib/ea/mdg.rb +0 -1
  29. data/lib/ea/model/document.rb +2 -2
  30. data/lib/ea/model/ghost_label.rb +0 -1
  31. data/lib/ea/model/legend.rb +1 -1
  32. data/lib/ea/model/property.rb +1 -1
  33. data/lib/ea/qea/benchmark.rb +9 -13
  34. data/lib/ea/qea/database.rb +26 -28
  35. data/lib/ea/qea/factory/association_builder.rb +5 -5
  36. data/lib/ea/qea/factory/association_transformer.rb +3 -6
  37. data/lib/ea/qea/factory/attribute_transformer.rb +3 -3
  38. data/lib/ea/qea/factory/base_transformer.rb +4 -4
  39. data/lib/ea/qea/factory/class_transformer.rb +5 -5
  40. data/lib/ea/qea/factory/constraint_transformer.rb +2 -2
  41. data/lib/ea/qea/factory/data_type_transformer.rb +5 -7
  42. data/lib/ea/qea/factory/diagram_transformer.rb +3 -7
  43. data/lib/ea/qea/factory/document_builder.rb +33 -37
  44. data/lib/ea/qea/factory/ea_to_uml_factory.rb +12 -18
  45. data/lib/ea/qea/factory/enum_transformer.rb +1 -2
  46. data/lib/ea/qea/factory/generalization_builder.rb +9 -9
  47. data/lib/ea/qea/factory/generalization_transformer.rb +3 -5
  48. data/lib/ea/qea/factory/instance_transformer.rb +3 -8
  49. data/lib/ea/qea/factory/operation_transformer.rb +2 -4
  50. data/lib/ea/qea/factory/package_transformer.rb +3 -3
  51. data/lib/ea/qea/factory/reference_resolver.rb +1 -1
  52. data/lib/ea/qea/factory/stereotype_loader.rb +1 -5
  53. data/lib/ea/qea/file_detector.rb +6 -12
  54. data/lib/ea/qea/infrastructure/database_connection.rb +1 -3
  55. data/lib/ea/qea/infrastructure/schema_reader.rb +4 -4
  56. data/lib/ea/qea/infrastructure/table_reader.rb +1 -1
  57. data/lib/ea/qea/models/ea_attribute.rb +1 -2
  58. data/lib/ea/qea/models/ea_attribute_tag.rb +1 -2
  59. data/lib/ea/qea/models/ea_author.rb +1 -1
  60. data/lib/ea/qea/models/ea_diagram_link.rb +4 -8
  61. data/lib/ea/qea/models/ea_diagram_object.rb +3 -4
  62. data/lib/ea/qea/models/ea_document.rb +4 -5
  63. data/lib/ea/qea/models/ea_glossary.rb +1 -1
  64. data/lib/ea/qea/models/ea_list.rb +1 -1
  65. data/lib/ea/qea/models/ea_object.rb +2 -2
  66. data/lib/ea/qea/models/ea_object_constraint.rb +1 -2
  67. data/lib/ea/qea/models/ea_object_property.rb +1 -2
  68. data/lib/ea/qea/models/ea_operation.rb +1 -2
  69. data/lib/ea/qea/models/ea_phase.rb +1 -1
  70. data/lib/ea/qea/models/ea_script.rb +5 -6
  71. data/lib/ea/qea/models/ea_tagged_value.rb +2 -3
  72. data/lib/ea/qea/models/ea_version.rb +1 -1
  73. data/lib/ea/qea/models/ea_xref.rb +6 -7
  74. data/lib/ea/qea/repositories/base_repository.rb +1 -1
  75. data/lib/ea/qea/services/database_loader.rb +2 -4
  76. data/lib/ea/qea/validation/association_validator.rb +12 -12
  77. data/lib/ea/qea/validation/attribute_validator.rb +25 -26
  78. data/lib/ea/qea/validation/base_validator.rb +5 -5
  79. data/lib/ea/qea/validation/class_validator.rb +34 -34
  80. data/lib/ea/qea/validation/database/circular_reference_validator.rb +7 -7
  81. data/lib/ea/qea/validation/database/ocl_constraint_validator.rb +3 -3
  82. data/lib/ea/qea/validation/database/orphan_validator.rb +5 -7
  83. data/lib/ea/qea/validation/database/referential_integrity_validator.rb +39 -39
  84. data/lib/ea/qea/validation/diagram_validator.rb +39 -39
  85. data/lib/ea/qea/validation/formatters/json_formatter.rb +16 -16
  86. data/lib/ea/qea/validation/formatters/text_formatter.rb +10 -10
  87. data/lib/ea/qea/validation/operation_validator.rb +13 -14
  88. data/lib/ea/qea/validation/package_validator.rb +18 -18
  89. data/lib/ea/qea/validation/validation_engine.rb +5 -5
  90. data/lib/ea/qea/validation/validation_message.rb +56 -73
  91. data/lib/ea/qea/validation/validation_result.rb +6 -6
  92. data/lib/ea/qea/verification/comparison_result.rb +13 -21
  93. data/lib/ea/qea/verification/document_normalizer.rb +6 -12
  94. data/lib/ea/qea/verification/document_verifier.rb +39 -39
  95. data/lib/ea/qea/verification/element_comparator.rb +27 -31
  96. data/lib/ea/qea/verification/structure_matcher.rb +10 -10
  97. data/lib/ea/qea.rb +5 -7
  98. data/lib/ea/query/builder.rb +3 -3
  99. data/lib/ea/render/image_converter.rb +5 -3
  100. data/lib/ea/shapescript/parser.rb +4 -4
  101. data/lib/ea/sources/qea/classifier_builder.rb +7 -3
  102. data/lib/ea/sources/qea/context_diagram_support.rb +2 -2
  103. data/lib/ea/sources/qea/diagram_builder/routing.rb +4 -4
  104. data/lib/ea/sources/qea/diagram_builder.rb +80 -51
  105. data/lib/ea/sources/qea/id_normalizer.rb +0 -1
  106. data/lib/ea/sources/qea/instance_builder.rb +2 -2
  107. data/lib/ea/sources/qea/legend_builder.rb +1 -1
  108. data/lib/ea/sources/qea/note_builder.rb +4 -4
  109. data/lib/ea/sources/xmi/diagram_builder/stereotype_profiles.rb +1 -1
  110. data/lib/ea/sources/xmi/extension_style_parser.rb +2 -2
  111. data/lib/ea/sources/xmi/property_builder.rb +10 -2
  112. data/lib/ea/sources/xmi/relationship_builder.rb +10 -2
  113. data/lib/ea/sources/xmi/relationship_type_map.rb +1 -1
  114. data/lib/ea/sources/xmi/tag_builder.rb +1 -1
  115. data/lib/ea/sources/xmi/type_classifier_map.rb +1 -1
  116. data/lib/ea/spa/configuration.rb +2 -4
  117. data/lib/ea/spa/generator.rb +3 -3
  118. data/lib/ea/spa/output/strategy.rb +7 -5
  119. data/lib/ea/spa/projector.rb +21 -17
  120. data/lib/ea/svg/connector_router.rb +5 -3
  121. data/lib/ea/svg/ea_emitter/background.rb +0 -1
  122. data/lib/ea/svg/ea_emitter/bounds_calculator.rb +8 -10
  123. data/lib/ea/svg/ea_emitter/canvas.rb +1 -1
  124. data/lib/ea/svg/ea_emitter/color_resolver.rb +1 -1
  125. data/lib/ea/svg/ea_emitter/compartment/note_body.rb +1 -1
  126. data/lib/ea/svg/ea_emitter/connector_redock.rb +6 -3
  127. data/lib/ea/svg/ea_emitter/diagram_frame.rb +2 -2
  128. data/lib/ea/svg/ea_emitter/document.rb +1 -1
  129. data/lib/ea/svg/ea_emitter/element/attribute_renderer.rb +2 -4
  130. data/lib/ea/svg/ea_emitter/element/compartment_geometry.rb +18 -14
  131. data/lib/ea/svg/ea_emitter/element/header_line_pipeline.rb +6 -5
  132. data/lib/ea/svg/ea_emitter/element/header_line_provider/name.rb +1 -3
  133. data/lib/ea/svg/ea_emitter/element/header_line_provider/stereotype_label.rb +1 -1
  134. data/lib/ea/svg/ea_emitter/element/icon_renderer.rb +1 -1
  135. data/lib/ea/svg/ea_emitter/element/legend_renderer.rb +1 -1
  136. data/lib/ea/svg/ea_emitter/element/note_shape_renderer.rb +5 -5
  137. data/lib/ea/svg/ea_emitter/element/operation_renderer.rb +2 -3
  138. data/lib/ea/svg/ea_emitter/element/package_shape_renderer.rb +3 -4
  139. data/lib/ea/svg/ea_emitter/element/stereotype_icon_renderer.rb +1 -1
  140. data/lib/ea/svg/ea_emitter/elements.rb +64 -63
  141. data/lib/ea/svg/ea_emitter/ghost_labels.rb +0 -1
  142. data/lib/ea/svg/ea_emitter/label/end_label.rb +7 -7
  143. data/lib/ea/svg/ea_emitter/labels.rb +1 -1
  144. data/lib/ea/svg/ea_emitter/layer_sequencer.rb +5 -5
  145. data/lib/ea/svg/ea_emitter/marker/arrow_path.rb +4 -2
  146. data/lib/ea/svg/ea_emitter/marker/open_triangle.rb +4 -4
  147. data/lib/ea/svg/ea_emitter/markers.rb +3 -1
  148. data/lib/ea/svg/ea_emitter/render_context.rb +1 -1
  149. data/lib/ea/svg/ea_emitter/text_renderer.rb +15 -4
  150. data/lib/ea/theme/definition.rb +17 -17
  151. data/lib/ea/transformers/qea_to_xmi/context.rb +1 -1
  152. data/lib/ea/transformers/qea_to_xmi/run_state.rb +1 -1
  153. data/lib/ea/transformers/qea_to_xmi/transformer.rb +44 -44
  154. data/lib/ea/transformers/qea_to_xmi/visibility.rb +3 -3
  155. data/lib/ea/version.rb +1 -1
  156. data/lib/ea/xmi/liquid_drops/connector_drop.rb +2 -2
  157. data/lib/ea/xmi/liquid_drops/enum_drop.rb +4 -4
  158. data/lib/ea/xmi/liquid_drops/generalization_attribute_drop.rb +2 -8
  159. data/lib/ea/xmi/liquid_drops/generalization_drop.rb +3 -3
  160. data/lib/ea/xmi/liquid_drops/package_drop.rb +9 -9
  161. data/lib/ea/xmi/liquid_drops/root_drop.rb +1 -1
  162. data/lib/ea/xmi/loader.rb +5 -11
  163. data/lib/ea/xmi/lookup_service.rb +3 -3
  164. data/lib/ea/xmi/parser.rb +75 -81
  165. data/lib/ea/xmi/slicer.rb +16 -12
  166. data/lib/ea/xref_format/legend_definition.rb +31 -0
  167. data/lib/ea/xref_format/parser.rb +146 -0
  168. data/lib/ea/xref_format/property_definition.rb +25 -0
  169. data/lib/ea/xref_format/record.rb +37 -0
  170. data/lib/ea/xref_format/stereotype_application.rb +33 -0
  171. data/lib/ea/xref_format.rb +36 -0
  172. data/lib/ea.rb +1 -0
  173. metadata +26 -25
  174. data/lib/ea/sources/qea/xref/legend_definition.rb +0 -35
  175. data/lib/ea/sources/qea/xref/parser.rb +0 -150
  176. data/lib/ea/sources/qea/xref/property_definition.rb +0 -29
  177. data/lib/ea/sources/qea/xref/record.rb +0 -41
  178. data/lib/ea/sources/qea/xref/stereotype_application.rb +0 -37
@@ -21,16 +21,12 @@ module Ea
21
21
  # Map classifier (the class this is an instance of)
22
22
  if ea_object.classifier&.positive?
23
23
  classifier_obj = find_classifier(ea_object.classifier)
24
- if classifier_obj
25
- instance.classifier = classifier_obj.name
26
- end
24
+ instance.classifier = classifier_obj.name if classifier_obj
27
25
  elsif ea_object.classifier_guid && !ea_object.classifier_guid.empty?
28
26
  classifier_obj = find_classifier_by_guid(
29
- ea_object.classifier_guid,
27
+ ea_object.classifier_guid
30
28
  )
31
- if classifier_obj
32
- instance.classifier = classifier_obj.name
33
- end
29
+ instance.classifier = classifier_obj.name if classifier_obj
34
30
  end
35
31
 
36
32
  # Map definition/notes
@@ -61,7 +57,6 @@ module Ea
61
57
 
62
58
  database.find_object_by_guid(classifier_guid)
63
59
  end
64
-
65
60
  end
66
61
  end
67
62
  end
@@ -25,9 +25,7 @@ module Ea
25
25
  ea_operation.notes.nil? || ea_operation.notes.empty?
26
26
 
27
27
  # Map stereotype if present
28
- if ea_operation.stereotype && !ea_operation.stereotype.empty?
29
- op.stereotype = [ea_operation.stereotype]
30
- end
28
+ op.stereotype = [ea_operation.stereotype] if ea_operation.stereotype && !ea_operation.stereotype.empty?
31
29
  end
32
30
  end
33
31
 
@@ -58,7 +56,7 @@ module Ea
58
56
  return [] if operation_id.nil?
59
57
 
60
58
  database.operation_params_for(operation_id)
61
- .sort_by { |p| p.pos || 0 }
59
+ .sort_by { |p| p.pos || 0 }
62
60
  end
63
61
  end
64
62
  end
@@ -28,7 +28,7 @@ module Ea
28
28
  stereotype = load_stereotype(ea_package.ea_guid)
29
29
  pkg.stereotype = [stereotype] if stereotype
30
30
 
31
- # Note: Child packages and contents will be loaded separately
31
+ # NOTE: Child packages and contents will be loaded separately
32
32
  # to avoid circular dependencies and allow lazy loading
33
33
  # Don't initialize collections - they have default values
34
34
  end
@@ -63,7 +63,7 @@ module Ea
63
63
  return [] if parent_id.nil?
64
64
 
65
65
  database.child_packages_for(parent_id)
66
- .sort_by { |p| p.tpos || 0 }
66
+ .sort_by { |p| p.tpos || 0 }
67
67
  end
68
68
 
69
69
  # Load package contents (objects and diagrams)
@@ -84,7 +84,7 @@ module Ea
84
84
  class: :classes,
85
85
  enumeration: :enums,
86
86
  data_type: :data_types,
87
- instance: :instances,
87
+ instance: :instances
88
88
  }.freeze
89
89
 
90
90
  # Load objects for a package
@@ -79,7 +79,7 @@ module Ea
79
79
  def stats
80
80
  {
81
81
  total_elements: @guid_to_element.size,
82
- total_objects: @object_id_to_name.size,
82
+ total_objects: @object_id_to_name.size
83
83
  }
84
84
  end
85
85
 
@@ -27,11 +27,7 @@ module Ea
27
27
  end
28
28
 
29
29
  def extract_stereotype_name(description)
30
- return nil if description.nil? || description.empty?
31
-
32
- if description =~ /@STEREO;Name=([^;]+);/
33
- Regexp.last_match(1)
34
- end
30
+ Ea::XrefFormat.stereotype_name(description)
35
31
  end
36
32
  end
37
33
  end
@@ -52,14 +52,12 @@ module Ea
52
52
  return {
53
53
  valid: false,
54
54
  errors: ["File not found: #{path}"],
55
- warnings: [],
55
+ warnings: []
56
56
  }
57
57
  end
58
58
 
59
59
  # Check file extension
60
- unless path.end_with?(".qea")
61
- warnings << "File does not have .qea extension"
62
- end
60
+ warnings << "File does not have .qea extension" unless path.end_with?(".qea")
63
61
 
64
62
  # Check SQLite format
65
63
  unless sqlite_file?(path)
@@ -73,17 +71,13 @@ module Ea
73
71
  tables = get_table_names(db)
74
72
 
75
73
  REQUIRED_EA_TABLES.each do |required_table|
76
- unless tables.include?(required_table)
77
- errors << "Missing required EA table: #{required_table}"
78
- end
74
+ errors << "Missing required EA table: #{required_table}" unless tables.include?(required_table)
79
75
  end
80
76
 
81
77
  # Check for data
82
78
  if tables.include?("t_object")
83
79
  count = db.execute("SELECT COUNT(*) FROM t_object").first.first
84
- if count.zero?
85
- warnings << "No objects found in t_object table"
86
- end
80
+ warnings << "No objects found in t_object table" if count.zero?
87
81
  end
88
82
  rescue SQLite3::Exception => e
89
83
  errors << "Failed to open database: #{e.message}"
@@ -94,7 +88,7 @@ module Ea
94
88
  {
95
89
  valid: errors.empty?,
96
90
  errors: errors,
97
- warnings: warnings,
91
+ warnings: warnings
98
92
  }
99
93
  end
100
94
 
@@ -115,7 +109,7 @@ module Ea
115
109
  size_bytes: File.size(path),
116
110
  size_mb: (File.size(path) / 1024.0 / 1024.0).round(2),
117
111
  modified: File.mtime(path),
118
- is_qea: qea_file?(path),
112
+ is_qea: qea_file?(path)
119
113
  }
120
114
 
121
115
  if sqlite_file?(path)
@@ -51,9 +51,7 @@ module Ea
51
51
  # @raise [Ea::Error] if the file is neither SQLite nor a ZIP archive
52
52
  # @raise [SQLite3::Exception] if connection fails
53
53
  def connect
54
- unless File.exist?(@file_path)
55
- raise Errno::ENOENT, "QEA file not found: #{@file_path}"
56
- end
54
+ raise Errno::ENOENT, "QEA file not found: #{@file_path}" unless File.exist?(@file_path)
57
55
 
58
56
  @connection = SQLite3::Database.new(openable_path, readonly: true)
59
57
  @connection.results_as_hash = true
@@ -71,7 +71,7 @@ module Ea
71
71
  def table_exists?(table_name)
72
72
  result = @database.execute(
73
73
  "SELECT name FROM sqlite_master WHERE type='table' AND name=?",
74
- table_name,
74
+ table_name
75
75
  )
76
76
  !result.empty?
77
77
  end
@@ -94,7 +94,7 @@ module Ea
94
94
  def table_schema(table_name)
95
95
  result = @database.execute(
96
96
  "SELECT sql FROM sqlite_master WHERE type='table' AND name=?",
97
- table_name,
97
+ table_name
98
98
  )
99
99
  result.first&.fetch("sql", nil)
100
100
  end
@@ -107,7 +107,7 @@ module Ea
107
107
  @database.execute(
108
108
  "SELECT name, sql FROM sqlite_master " \
109
109
  "WHERE type='index' AND tbl_name=?",
110
- table_name,
110
+ table_name
111
111
  )
112
112
  end
113
113
 
@@ -117,7 +117,7 @@ module Ea
117
117
  # @return [Integer] Number of rows in the table
118
118
  def row_count(table_name)
119
119
  result = @database.execute(
120
- "SELECT COUNT(*) as count FROM #{table_name}",
120
+ "SELECT COUNT(*) as count FROM #{table_name}"
121
121
  )
122
122
  result.first["count"]
123
123
  end
@@ -118,7 +118,7 @@ module Ea
118
118
  # @return [Integer] Total number of records
119
119
  def count
120
120
  result = @database.execute(
121
- "SELECT COUNT(*) as count FROM #{@table_name}",
121
+ "SELECT COUNT(*) as count FROM #{@table_name}"
122
122
  )
123
123
  result.first["count"]
124
124
  end
@@ -42,9 +42,8 @@ module Ea
42
42
  "t_attribute"
43
43
  end
44
44
 
45
-
46
45
  COLUMN_MAP = {
47
- "Object_ID" => :ea_object_id,
46
+ "Object_ID" => :ea_object_id
48
47
  }.freeze
49
48
 
50
49
  def self.column_map
@@ -37,10 +37,9 @@ module Ea
37
37
  "t_attributetag"
38
38
  end
39
39
 
40
-
41
40
  COLUMN_MAP = {
42
41
  "PropertyID" => :property_id,
43
- "ElementID" => :element_id,
42
+ "ElementID" => :element_id
44
43
  }.freeze
45
44
 
46
45
  def self.column_map
@@ -32,4 +32,4 @@ module Ea
32
32
  end
33
33
  end
34
34
  end
35
- end
35
+ end
@@ -44,21 +44,17 @@ module Ea
44
44
 
45
45
  # Parse the Geometry string to extract routing points
46
46
  # @return [Hash] Parsed geometry data
47
- def parsed_geometry # rubocop:disable Metrics/MethodLength
47
+ def parsed_geometry
48
48
  return {} unless geometry
49
49
 
50
50
  parts = geometry.split(",")
51
51
  result = {}
52
52
 
53
53
  # First 4 values are typically coordinates
54
- if parts.length >= 4
55
- result[:coords] = parts[0..3].map(&:strip).map(&:to_i)
56
- end
54
+ result[:coords] = parts[0..3].map(&:strip).map(&:to_i) if parts.length >= 4
57
55
 
58
56
  # Remaining parts contain additional metadata
59
- if parts.length > 4
60
- result[:metadata] = parts[4..].join(",")
61
- end
57
+ result[:metadata] = parts[4..].join(",") if parts.length > 4
62
58
 
63
59
  result
64
60
  end
@@ -69,7 +65,7 @@ module Ea
69
65
  parsed = parsed_style
70
66
  {
71
67
  source_oid: parsed["SOID"],
72
- dest_oid: parsed["EOID"],
68
+ dest_oid: parsed["EOID"]
73
69
  }
74
70
  end
75
71
  end
@@ -26,9 +26,8 @@ module Ea
26
26
  "t_diagramobjects"
27
27
  end
28
28
 
29
-
30
29
  COLUMN_MAP = {
31
- "Object_ID" => :ea_object_id,
30
+ "Object_ID" => :ea_object_id
32
31
  }.freeze
33
32
 
34
33
  def self.column_map
@@ -44,7 +43,7 @@ module Ea
44
43
  right: rectright,
45
44
  bottom: rectbottom,
46
45
  width: rectright - rectleft,
47
- height: rectbottom - recttop,
46
+ height: rectbottom - recttop
48
47
  }
49
48
  end
50
49
 
@@ -53,7 +52,7 @@ module Ea
53
52
  def center_point
54
53
  {
55
54
  x: (rectleft + rectright) / 2,
56
- y: (recttop + rectbottom) / 2,
55
+ y: (recttop + rectbottom) / 2
57
56
  }
58
57
  end
59
58
 
@@ -21,14 +21,13 @@ module Ea
21
21
  "t_document"
22
22
  end
23
23
 
24
-
25
24
  COLUMN_MAP = {
26
25
  "DocID" => :doc_id,
27
26
  "DocName" => :doc_name,
28
27
  "DocType" => :doc_type,
29
28
  "StrContent" => :str_content,
30
29
  "BinContent" => :bin_content,
31
- "ElementID" => :element_id,
30
+ "ElementID" => :element_id
32
31
  }.freeze
33
32
 
34
33
  def self.column_map
@@ -36,9 +35,9 @@ module Ea
36
35
  end
37
36
 
38
37
  # Convenience aliases
39
- alias_method :id, :doc_id
40
- alias_method :name, :doc_name
41
- alias_method :type, :doc_type
38
+ alias id doc_id
39
+ alias name doc_name
40
+ alias type doc_type
42
41
 
43
42
  # Check if this is a style document
44
43
  # @return [Boolean]
@@ -31,4 +31,4 @@ module Ea
31
31
  end
32
32
  end
33
33
  end
34
- end
34
+ end
@@ -39,4 +39,4 @@ module Ea
39
39
  end
40
40
  end
41
41
  end
42
- end
42
+ end
@@ -119,7 +119,7 @@ module Ea
119
119
  "Multiplicity" => :multiplicity,
120
120
  "StyleEx" => :styleex,
121
121
  "ActionFlags" => :actionflags,
122
- "EventFlags" => :eventflags,
122
+ "EventFlags" => :eventflags
123
123
  }.freeze
124
124
 
125
125
  def self.column_map
@@ -202,7 +202,7 @@ module Ea
202
202
  "Interface" => :class,
203
203
  "Signal" => :signal,
204
204
  "Object" => :instance,
205
- "Association" => :association_element,
205
+ "Association" => :association_element
206
206
  }.freeze
207
207
 
208
208
  # @return [Symbol, nil] Registry key or nil if not a UML model element
@@ -37,11 +37,10 @@ module Ea
37
37
  "t_objectconstraint"
38
38
  end
39
39
 
40
-
41
40
  COLUMN_MAP = {
42
41
  "ConstraintID" => :constraint_id,
43
42
  "Object_ID" => :ea_object_id,
44
- "ConstraintType" => :constraint_type,
43
+ "ConstraintType" => :constraint_type
45
44
  }.freeze
46
45
 
47
46
  def self.column_map
@@ -37,10 +37,9 @@ module Ea
37
37
  "t_objectproperties"
38
38
  end
39
39
 
40
-
41
40
  COLUMN_MAP = {
42
41
  "PropertyID" => :property_id,
43
- "Object_ID" => :ea_object_id,
42
+ "Object_ID" => :ea_object_id
44
43
  }.freeze
45
44
 
46
45
  def self.column_map
@@ -42,9 +42,8 @@ module Ea
42
42
  "t_operation"
43
43
  end
44
44
 
45
-
46
45
  COLUMN_MAP = {
47
- "Object_ID" => :ea_object_id,
46
+ "Object_ID" => :ea_object_id
48
47
  }.freeze
49
48
 
50
49
  def self.column_map
@@ -37,4 +37,4 @@ module Ea
37
37
  end
38
38
  end
39
39
  end
40
- end
40
+ end
@@ -21,12 +21,11 @@ module Ea
21
21
  "t_script"
22
22
  end
23
23
 
24
-
25
24
  COLUMN_MAP = {
26
25
  "ScriptID" => :script_id,
27
26
  "ScriptCategory" => :script_category,
28
27
  "ScriptName" => :script_name,
29
- "ScriptAuthor" => :script_author,
28
+ "ScriptAuthor" => :script_author
30
29
  }.freeze
31
30
 
32
31
  def self.column_map
@@ -34,10 +33,10 @@ module Ea
34
33
  end
35
34
 
36
35
  # Convenience aliases
37
- alias_method :id, :script_id
38
- alias_method :name, :script_name
39
- alias_method :category, :script_category
40
- alias_method :author, :script_author
36
+ alias id script_id
37
+ alias name script_name
38
+ alias category script_category
39
+ alias author script_author
41
40
 
42
41
  # Check if this is a debugging script
43
42
  # @return [Boolean]
@@ -34,12 +34,11 @@ module Ea
34
34
  "t_taggedvalue"
35
35
  end
36
36
 
37
-
38
37
  COLUMN_MAP = {
39
38
  "PropertyID" => :property_id,
40
39
  "ElementID" => :element_id,
41
40
  "BaseClass" => :base_class,
42
- "TagValue" => :tag_value,
41
+ "TagValue" => :tag_value
43
42
  }.freeze
44
43
 
45
44
  def self.column_map
@@ -85,7 +84,7 @@ module Ea
85
84
  # Extract ea_notes if present in TagValue
86
85
  #
87
86
  # @return [String, nil] Extracted notes
88
- def parsed_notes # rubocop:disable Metrics/CyclomaticComplexity
87
+ def parsed_notes
89
88
  return notes if notes && !notes.empty?
90
89
  return nil unless tag_value&.include?("$ea_notes=")
91
90
 
@@ -36,4 +36,4 @@ module Ea
36
36
  end
37
37
  end
38
38
  end
39
- end
39
+ end
@@ -25,10 +25,9 @@ module Ea
25
25
  "t_xref"
26
26
  end
27
27
 
28
-
29
28
  COLUMN_MAP = {
30
29
  "XrefID" => :xref_id,
31
- "Type" => :xref_type,
30
+ "Type" => :xref_type
32
31
  }.freeze
33
32
 
34
33
  def self.column_map
@@ -36,8 +35,8 @@ module Ea
36
35
  end
37
36
 
38
37
  # Convenience aliases
39
- alias_method :id, :xref_id
40
- alias_method :type, :xref_type
38
+ alias id xref_id
39
+ alias type xref_type
41
40
 
42
41
  # Parse the Description field into structured data (legacy hash form).
43
42
  # Kept for backward compatibility. New code should use
@@ -51,11 +50,11 @@ module Ea
51
50
  end
52
51
 
53
52
  # Parse Description into a typed Record with named accessors.
54
- # @return [Ea::Sources::Qea::Xref::Record]
53
+ # @return [Ea::XrefFormat::Record]
55
54
  def parsed_record
56
55
  return @parsed_record if defined?(@parsed_record)
57
56
 
58
- @parsed_record = Sources::Qea::Xref::Parser.parse(description)
57
+ @parsed_record = Ea::XrefFormat::Parser.parse(description)
59
58
  end
60
59
 
61
60
  # Check if this xref is for stereotypes
@@ -105,7 +104,7 @@ module Ea
105
104
  #
106
105
  # @param desc [String] Description field content
107
106
  # @return [Hash] Parsed data
108
- def parse_description_field(desc) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
107
+ def parse_description_field(desc) # rubocop:disable Metrics/MethodLength
109
108
  return {} if desc.nil? || desc.empty?
110
109
 
111
110
  result = { raw: desc }
@@ -76,7 +76,7 @@ module Ea
76
76
  #
77
77
  # @example Block condition
78
78
  # repository.where { |r| r.name.start_with?("Test") }
79
- def where(conditions = nil, &block) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
79
+ def where(conditions = nil, &block) # rubocop:disable Metrics/MethodLength
80
80
  if block
81
81
  @records.select(&block)
82
82
  elsif conditions.is_a?(Hash)
@@ -70,7 +70,7 @@ module Ea
70
70
  "t_diagramtypes" => Models::EaDiagramType,
71
71
  "t_objecttypes" => Models::EaObjectType,
72
72
  "t_statustypes" => Models::EaStatusType,
73
- "t_complexitytypes" => Models::EaComplexityType,
73
+ "t_complexitytypes" => Models::EaComplexityType
74
74
  }.freeze
75
75
 
76
76
  # Initialize loader
@@ -168,9 +168,7 @@ module Ea
168
168
  # @return [Array] Array of model instances
169
169
  def load_table_records(db, table_name) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
170
170
  model_class = MODEL_CLASSES[table_name]
171
- unless model_class
172
- raise ArgumentError, "No model class for table #{table_name}"
173
- end
171
+ raise ArgumentError, "No model class for table #{table_name}" unless model_class
174
172
 
175
173
  reader = Infrastructure::TableReader.new(db, table_name)
176
174
  return [] unless reader.table_exists?
@@ -30,7 +30,7 @@ module Ea
30
30
  entity_name: connector.name || "Unnamed",
31
31
  field: "start_object_id",
32
32
  reference: connector.start_object_id.to_s,
33
- message: "Start object #{connector.start_object_id} does not exist",
33
+ message: "Start object #{connector.start_object_id} does not exist"
34
34
  )
35
35
  end
36
36
 
@@ -45,22 +45,22 @@ module Ea
45
45
  entity_name: connector.name || "Unnamed",
46
46
  field: "end_object_id",
47
47
  reference: connector.end_object_id.to_s,
48
- message: "End object #{connector.end_object_id} does not exist",
48
+ message: "End object #{connector.end_object_id} does not exist"
49
49
  )
50
50
  end
51
51
 
52
- def validate_connector_endpoints # rubocop:disable Metrics/MethodLength
52
+ def validate_connector_endpoints
53
53
  connectors.each do |conn|
54
54
  # Validate both endpoints exist
55
- unless conn.start_object_id && conn.end_object_id
56
- result.add_error(
57
- category: :invalid_data,
58
- entity_type: :connector,
59
- entity_id: conn.connector_id.to_s,
60
- entity_name: conn.name || "Unnamed",
61
- message: "Connector missing start or end object reference",
62
- )
63
- end
55
+ next if conn.start_object_id && conn.end_object_id
56
+
57
+ result.add_error(
58
+ category: :invalid_data,
59
+ entity_type: :connector,
60
+ entity_id: conn.connector_id.to_s,
61
+ entity_name: conn.name || "Unnamed",
62
+ message: "Connector missing start or end object reference"
63
+ )
64
64
  end
65
65
  end
66
66