From 5af7e54037f1141121f6926fc933358289c79772 Mon Sep 17 00:00:00 2001 From: blaschke <blaschke@FOR2848.fortiss.fortiss.org> Date: Wed, 27 Sep 2023 17:07:19 +0200 Subject: [PATCH] Adding quality documentation in logic for file distribution in packages. Issue-Ref: 4310 Issue-Url: https://git.fortiss.org/af3/af3/-/issues/4310 Signed-off-by: Konstantin Blaschke <blaschke@fortiss.org> --- .../fortiss/tooling/ext/quality/ui/.ratings | 2 +- .../tooling/ext/quality/ui/view/fx/.ratings | 2 +- .../ui/view/fx/ModelQualityFXController.java | 11 +- .../html/developer/.ratings | 1 + .../html/developer/documentation.html | 363 ++++++++++++------ .../org/fortiss/tooling/ext/quality/.ratings | 5 +- ...stener.java => IMetricUpdateListener.java} | 2 +- .../fortiss/tooling/ext/quality/data/.ratings | 3 +- .../tooling/ext/quality/service/.ratings | 4 +- .../quality/service/IModelQualityService.java | 6 +- .../quality/service/ModelQualityService.java | 8 +- .../tooling/ext/quality/storage/.ratings | 2 +- .../ext/quality/storage/CSVFileWriter.java | 4 - 13 files changed, 267 insertions(+), 146 deletions(-) create mode 100644 org.fortiss.tooling.ext.quality/html/developer/.ratings rename org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/{MetricUpdateListener.java => IMetricUpdateListener.java} (97%) diff --git a/org.fortiss.tooling.ext.quality.ui/src/org/fortiss/tooling/ext/quality/ui/.ratings b/org.fortiss.tooling.ext.quality.ui/src/org/fortiss/tooling/ext/quality/ui/.ratings index b156be9c8..e5e3fec61 100644 --- a/org.fortiss.tooling.ext.quality.ui/src/org/fortiss/tooling/ext/quality/ui/.ratings +++ b/org.fortiss.tooling.ext.quality.ui/src/org/fortiss/tooling/ext/quality/ui/.ratings @@ -1,2 +1,2 @@ ModelQualityExtractionMenu.java 87cdfa5d4f939cc9f21afc8d6361a2089f440f20 YELLOW -ModelQualityUIActivator.java 47787eb293198014ba5a5a9b21d004a379117f5e YELLOW +ModelQualityUIActivator.java 2f47db82bc088072dbfe53f82d3ed417d77fd23c YELLOW diff --git a/org.fortiss.tooling.ext.quality.ui/src/org/fortiss/tooling/ext/quality/ui/view/fx/.ratings b/org.fortiss.tooling.ext.quality.ui/src/org/fortiss/tooling/ext/quality/ui/view/fx/.ratings index 7bcec2aad..4bc1cc6f7 100644 --- a/org.fortiss.tooling.ext.quality.ui/src/org/fortiss/tooling/ext/quality/ui/view/fx/.ratings +++ b/org.fortiss.tooling.ext.quality.ui/src/org/fortiss/tooling/ext/quality/ui/view/fx/.ratings @@ -1,3 +1,3 @@ IModelQualityViewPart.java 708f8089645df12098ea67190805cce343045d2e YELLOW -ModelQualityFXController.java 4272d7043944effc9532d4a122fd50b63b79fb82 YELLOW +ModelQualityFXController.java ec593e9c70ce70f4f2734cf6750cec8a844e6a47 YELLOW ModelQualityFXViewPart.java 179abf18d6e3b6c844076620f53b43ac8a42c217 YELLOW diff --git a/org.fortiss.tooling.ext.quality.ui/src/org/fortiss/tooling/ext/quality/ui/view/fx/ModelQualityFXController.java b/org.fortiss.tooling.ext.quality.ui/src/org/fortiss/tooling/ext/quality/ui/view/fx/ModelQualityFXController.java index 501a2b369..ec593e9c7 100644 --- a/org.fortiss.tooling.ext.quality.ui/src/org/fortiss/tooling/ext/quality/ui/view/fx/ModelQualityFXController.java +++ b/org.fortiss.tooling.ext.quality.ui/src/org/fortiss/tooling/ext/quality/ui/view/fx/ModelQualityFXController.java @@ -41,7 +41,7 @@ import org.fortiss.tooling.common.ui.javafx.layout.CompositeFXControllerBase; import org.fortiss.tooling.common.ui.javafx.style.FillStyle; import org.fortiss.tooling.common.ui.javafx.style.FontStyle; import org.fortiss.tooling.common.ui.javafx.style.LineStyle; -import org.fortiss.tooling.ext.quality.MetricUpdateListener; +import org.fortiss.tooling.ext.quality.IMetricUpdateListener; import org.fortiss.tooling.ext.quality.data.MetricDataManager; import org.fortiss.tooling.ext.quality.data.MetricKey; import org.fortiss.tooling.ext.quality.data.MetricTreeNode; @@ -77,7 +77,7 @@ import javafx.scene.text.Text; @SuppressWarnings("unchecked") public class ModelQualityFXController extends CompositeFXControllerBase<SplitPane, Node> - implements ISelectionListener, MetricUpdateListener { + implements ISelectionListener, IMetricUpdateListener { /** ChoiceBox for selecting the metric which shall be displayed. */ @FXML @@ -115,8 +115,7 @@ public class ModelQualityFXController extends CompositeFXControllerBase<SplitPan } /** - * The last {@link EObject} which the user has clicked. Might be null when no or an invalid - * Object is selected. + * The last {@link EObject} which the user has clicked. Might be null when no or an invalid Object is selected. */ private EObject lastSelectedElement; @@ -161,9 +160,7 @@ public class ModelQualityFXController extends CompositeFXControllerBase<SplitPan updateCharts("Selection does not have metric information"); } - /** - * Is triggered when the choice box changes. - */ + /** Is triggered when the choice box changes. */ public void onChoiceBoxChange() { updateCharts("Invalid selection or metrics not available"); } diff --git a/org.fortiss.tooling.ext.quality/html/developer/.ratings b/org.fortiss.tooling.ext.quality/html/developer/.ratings new file mode 100644 index 000000000..615211454 --- /dev/null +++ b/org.fortiss.tooling.ext.quality/html/developer/.ratings @@ -0,0 +1 @@ +documentation.html a9df919adc2e879d79775a358a858f77ebbbaf86 YELLOW diff --git a/org.fortiss.tooling.ext.quality/html/developer/documentation.html b/org.fortiss.tooling.ext.quality/html/developer/documentation.html index d97b0a20c..a9df919ad 100644 --- a/org.fortiss.tooling.ext.quality/html/developer/documentation.html +++ b/org.fortiss.tooling.ext.quality/html/developer/documentation.html @@ -4,131 +4,256 @@ </head> <body lang="en-US" dir="ltr"> + <h1>Developer Documentation for <i>Quality Functionality (</i><i>org.fortiss.tooling.ext.quality</i><i>)</i></h1> +<h2>Metrics List </h2> <p>Below is a list of all collected metrics. They are represented by the enum <code> org.fortiss.tooling.ext.quality.data.MetricKey</code></p> <p>They are categorized by the respective provider collecting the metric</p> -<h2>HierarchicElementProvider</h2> -<code>org.fortiss.tooling.ext.quality.HierarchicElementProvider</code> - -<h4>UNQIUE_ID</h4> -<p><code>Integer</code>: This is an unique identifier for each element as specified in <code>org.fortiss.tooling.kernel.model.IIdLabeled</code>. </p> - -<h4>NUMBER_OF_CONNECTORS</h4> -<p><code>Integer</code>: Number of connectors in the respective element</p> - -<h4>NUMBER_OF_CONTAINED_ELEMENTS</h4> -<p><code>Integer</code>: Number of entries in the containedElements list.</p> - -<h4>NUMBER_OF_CONNECTIONS</h4> -<p><code>Integer</code>: Number of connections in this element. List of aggregated connection model elements. Usually a aggregates all connections of its direct sub-structure.</p> - -<h4>NUMBER_OF_TOTAL_CONNECTORS</h4> -<p><code>Integer</code>: Total number of connectors in this element and all contained elements</p> - -<h4>NUMBER_OF_TOTAL_ENTRY_CONNECTORS</h4> -<p><code>Integer</code>: Sum of all connectors which implement <code>org.fortiss.tooling.base.model.base.EntryConnectorBase</code></p> - -<h4>NUMBER_OF_TOTAL_EXIT_CONNECTORS</h4> -<p><code>Integer</code>: Sum of all connectors which implement <code>org.fortiss.tooling.base.model.base.ExitConnectorBase</code>. Usually the sum over this and <code>NUMBER_OF_TOTAL_ENTRY_CONNECTORS</code> should equal <code>NUMBER_OF_TOTAL_CONNECTORS</code></p> - -<h4>NUMBER_OF_TOTAL_ELEMENTS</h4> -<p><code>Integer</code>: Total number of elements contained in this element. Includes the element for which this metric is recorded.</p> - -<h4>NUMBER_OF_TOTAL_COMMENTABLE_ELEMENTS</h4> -<p><code>Integer</code>: Total number of elements implementing <code>org.fortiss.tooling.kernel.model.INamedCommentedElement</code> in this element. Includes the element for which this metric is recorded. Never exceeds <code>NUMBER_OF_TOTAL_ELEMENTS</code>.</p> - -<h4>NUMBER_OF_TOTAL_COMMENTED_ELEMENTS</h4> -<p><code>Integer</code>: Total number of elements which are commentable and do not have <code>null</code> or an empty string as comment</p> - -<h4>NUMBER_OF_TOTAL_LEAF_ELEMENTS</h4> -<p><code>Integer</code>: Total number of elements contained in this element which do not contain elements. Includes self</p> - - -<h2>GraphMetricsProvider</h2> -<code>org.fortiss.tooling.ext.quality.GraphMetricsProvider</code> - - -<h4>BETWEENESS_CENTRALITY</h4> -<p><code>Double</code>: Value of the betweenness centrality of this element embedded in a graph of consisting of all elements which are contained in the element which contains this element, as well as all neighbours of these elements</p> -<p>The direction of the connections are respected, and it is assumed that all connections connect to a ExitConnectorBase or EntryConnectorBase</p> - - -<h4>BETWEENESS_CENTRALITY_RECURSIVELY</h4> -<p><code>Double</code>: Same as above, but all connections are resolved to leaf elements, i.e. elements which do not contain other elements</p> - - -<h4>CLUSTERING_COEFFICIENT</h4> -<p><code>Double</code>: Clustering coefficient of this element. Ignores connection direction and resolves all neighbours to leaf elements.</p> - - - - -<h2>ComponentMetricProvider</h2> -<code>org.fortiss.af3.component.quality.ComponentMetricProvider</code> - -<h4>NUMBER_OF_TOTAL_CODE_CONSTANTS</h4> -<p><code>Integer</code>: Total number of constants in code specifications in this element and all contained elements</p> - -<h4>NUMBER_OF_TOTAL_CODE_CYCLOMATIC_COMPLEXITY</h4> -<p><code>Integer</code>: The total cyclomatic complexity of all code specifications in this element and all contained elements</p> - -<h4>NUMBER_OF_TOTAL_CODE_LINES</h4> -<p><code>Integer</code>: Total number of lines of code in all code specifications in this element and all contained elements</p> - -<h4>NUMBER_OF_TOTAL_CODE_COMMENTS</h4> -<p><code>Integer</code>: Total number of comment blocks in all code specifications in this element and all contained elements</p> - - -<h2>ComponentMetricProvider</h2> -<code>org.fortiss.af3.component.quality.ComponentMetricProvider</code> - - -<h2>DataDictonaryProvider</h2> -<code>org.fortiss.af3.component.quality.DataDictonaryProvider</code> -<p> Provides Metrics also collected by the HierarchicElementProvider, but for the DataDictionary.</p> - - -<h2>SafetyMetricProvider</h2> -<code>org.fortiss.af3.safety.quality.SafetyMetricProvider</code> - -<h4>SAFETY_LEVEL</h4> -<p><code>String</code>: String representation of the assigned safety level of this element</p> - - -<h2>AllocationTableProvider</h2> -<code>org.fortiss.af3.task.quality.AllocationTableProvider</code> - -<h4>TASK_ALLOCATED_COMPONENTS</h4> -<p><code>Integer</code>: Number of allocated Components on this Task. This metric can only be non-null for <code>org.fortiss.af3.task.model.Task</code> Elements</p> - -<h4>HARDWARE_ALLOCATED_TASKS</h4> -<p><code>Integer</code>: Number of allocated Tasks on this ExecutionUnit. This metric can only be non-null for <code>org.fortiss.af3.platform.model.ExecutionUnit</code> Elements</p> - - - -<h2>ModelQualityService</h2> -<code>org.fortiss.tooling.ext.quality.service.ModelQualityService</code> - -<h4>NESTING_LEVEL</h4> -<p><code>Integer</code>: The depth of this element. Defined by the number of elements which have to be traversed to reach this element from the root</p> - - -<h4>CONSTRAINT_VIOLATIONS_ERROR</h4> -<p><code>Integer</code>: Number of constraint violations of the severity error which have this element as source</p> - - -<h4>CONSTRAINT_VIOLATIONS_WARNING</h4> -<p><code>Integer</code>: Number of constraint violations of the severity warning which have this element as source</p> - - - - - - - +<table border="1"> + <thead> + <tr> + <th>Number</th> + <th>Provider</th> + <th>Qualified Name</th> + <th>Metric</th> + <th>Type</th> + <th>Description</th> + </tr> + </thead> + <tbody> + <tr> + <td>1</td> + <td>HierarchicElementProvider</td> + <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td> + <td>UNIQUE_ID</td> + <td>Integer</td> + <td>This is an unique identifier for each element as specified in org.fortiss.tooling.kernel.model.IIdLabeled.</td> + </tr> + <tr> + <td>2</td> + <td>HierarchicElementProvider</td> + <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td> + <td>NUMBER_OF_CONNECTORS</td> + <td>Integer</td> + <td>Number of connectors in the respective element.</td> + </tr> + <tr> + <td>3</td> + <td>HierarchicElementProvider</td> + <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td> + <td>NUMBER_OF_CONTAINED_ELEMENTS</td> + <td>Integer</td> + <td>Number of entries in the containedElements list.</td> + </tr> + <tr> + <td>4</td> + <td>HierarchicElementProvider</td> + <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td> + <td>NUMBER_OF_CONNECTIONS</td> + <td>Integer</td> + <td>Number of connections in this element. List of aggregated connection model elements. Usually aggregates all connections of its direct sub-structure.</td> + </tr> + <tr> + <td>5</td> + <td>HierarchicElementProvider</td> + <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td> + <td>NUMBER_OF_TOTAL_CONNECTORS</td> + <td>Integer</td> + <td>Total number of connectors in this element and all contained elements.</td> + </tr> + <tr> + <td>6</td> + <td>HierarchicElementProvider</td> + <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td> + <td>NUMBER_OF_TOTAL_ENTRY_CONNECTORS</td> + <td>Integer</td> + <td>Sum of all connectors which implement org.fortiss.tooling.base.model.base.EntryConnectorBase.</td> + </tr> + <tr> + <td>7</td> + <td>HierarchicElementProvider</td> + <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td> + <td>NUMBER_OF_TOTAL_EXIT_CONNECTORS</td> + <td>Integer</td> + <td>Sum of all connectors which implement org.fortiss.tooling.base.model.base.ExitConnectorBase. Usually, the sum over this and NUMBER_OF_TOTAL_ENTRY_CONNECTORS should equal NUMBER_OF_TOTAL_CONNECTORS.</td> + </tr> + <tr> + <td>8</td> + <td>HierarchicElementProvider</td> + <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td> + <td>NUMBER_OF_TOTAL_ELEMENTS</td> + <td>Integer</td> + <td>Total number of elements contained in this element. Includes the element for which this metric is recorded.</td> + </tr> + <tr> + <td>9</td> + <td>HierarchicElementProvider</td> + <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td> + <td>NUMBER_OF_TOTAL_COMMENTABLE_ELEMENTS</td> + <td>Integer</td> + <td>Total number of elements implementing org.fortiss.tooling.kernel.model.INamedCommentedElement in this element. Includes the element for which this metric is recorded. Never exceeds NUMBER_OF_TOTAL_ELEMENTS.</td> + </tr> + <tr> + <td>10</td> + <td>HierarchicElementProvider</td> + <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td> + <td>NUMBER_OF_TOTAL_COMMENTED_ELEMENTS</td> + <td>Integer</td> + <td>Total number of elements which are commentable and do not have null or an empty string as a comment.</td> + </tr> + <tr> + <td>11</td> + <td>HierarchicElementProvider</td> + <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td> + <td>NUMBER_OF_TOTAL_LEAF_ELEMENTS</td> + <td>Integer</td> + <td>Total number of elements contained in this element which do not contain elements. Includes self.</td> + </tr> + <tr> + <td>12</td> + <td>GraphMetricsProvider</td> + <td>org.fortiss.tooling.ext.quality.GraphMetricsProvider</td> + <td>BETWEENESS_CENTRALITY</td> + <td>Double</td> + <td>Value of the betweenness centrality of this element embedded in a graph of consisting of all elements which are contained in the element which contains this element, as well as all neighbors of these elements.</td> + </tr> + <tr> + <td>13</td> + <td>GraphMetricsProvider</td> + <td>org.fortiss.tooling.ext.quality.GraphMetricsProvider</td> + <td>BETWEENESS_CENTRALITY_RECURSIVELY</td> + <td>Double</td> + <td>Same as above, but all connections are resolved to leaf elements, i.e. elements which do not contain other elements.</td> + </tr> + <tr> + <td>14</td> + <td>GraphMetricsProvider</td> + <td>org.fortiss.tooling.ext.quality.GraphMetricsProvider</td> + <td>CLUSTERING_COEFFICIENT</td> + <td>Double</td> + <td>Clustering coefficient of this element. Ignores connection direction and resolves all neighbors to leaf elements.</td> + </tr> + <tr> + <td>15</td> + <td>ComponentMetricProvider</td> + <td>org.fortiss.af3.component.quality.ComponentMetricProvider</td> + <td>NUMBER_OF_TOTAL_CODE_CONSTANTS</td> + <td>Integer</td> + <td>Total number of constants in code specifications in this element and all contained elements.</td> + </tr> + <tr> + <td>16</td> + <td>ComponentMetricProvider</td> + <td>org.fortiss.af3.component.quality.ComponentMetricProvider</td> + <td>NUMBER_OF_TOTAL_CODE_CYCLOMATIC_COMPLEXITY</td> + <td>Integer</td> + <td>The total cyclomatic complexity of all code specifications in this element and all contained elements.</td> + </tr> + <tr> + <td>17</td> + <td>ComponentMetricProvider</td> + <td>org.fortiss.af3.component.quality.ComponentMetricProvider</td> + <td>NUMBER_OF_TOTAL_CODE_LINES</td> + <td>Integer</td> + <td>Total number of lines of code in all code specifications in this element and all contained elements.</td> + </tr> + <tr> + <td>18</td> + <td>ComponentMetricProvider</td> + <td>org.fortiss.af3.component.quality.ComponentMetricProvider</td> + <td>NUMBER_OF_TOTAL_CODE_COMMENTS</td> + <td>Integer</td> + <td>Total number of comment blocks in all code specifications in this element and all contained elements.</td> + </tr> + <tr> + <td>19</td> + <td>DataDictonaryProvider</td> + <td>org.fortiss.af3.component.quality.DataDictonaryProvider</td> + <td>-</td> + <td>-</td> + <td>Provides Metrics also collected by the HierarchicElementProvider, but for the DataDictionary.</td> + </tr> + <tr> + <td>20</td> + <td>SafetyMetricProvider</td> + <td>org.fortiss.af3.safety.quality.SafetyMetricProvider</td> + <td>SAFETY_LEVEL</td> + <td>String</td> + <td>String representation of the assigned safety level of this element.</td> + </tr> + <tr> + <td>21</td> + <td>SafetyMetricProvider</td> + <td>org.fortiss.af3.safety.quality.SafetyMetricProvider</td> + <td>SAFETY_LEVEL</td> + <td>String</td> + <td>String representation of the assigned safety level of this element.</td> + </tr> + <tr> + <td>22</td> + <td>SafetyMetricProvider</td> + <td>org.fortiss.af3.safety.quality.SafetyMetricProvider</td> + <td>SAFETY_LEVEL</td> + <td>String</td> + <td>String representation of the assigned safety level of this element.</td> + </tr> + <tr> + <td>23</td> + <td>AllocationTableProvider</td> + <td>org.fortiss.af3.task.quality.AllocationTableProvider</td> + <td>TASK_ALLOCATED_COMPONENTS</td> + <td>Integer</td> + <td>Number of allocated Components on this Task. This metric can only be non-null for org.fortiss.af3.task.model.Task Elements.</td> + </tr> + <tr> + <td>24</td> + <td>AllocationTableProvider</td> + <td>org.fortiss.af3.task.quality.AllocationTableProvider</td> + <td>HARDWARE_ALLOCATED_TASKS</td> + <td>Integer</td> + <td>Number of allocated Tasks on this ExecutionUnit. This metric can only be non-null for org.fortiss.af3.platform.model.ExecutionUnit Elements.</td> + </tr> + <tr> + <td>25</td> + <td>ModelQualityService</td> + <td>org.fortiss.tooling.ext.quality.service.ModelQualityService</td> + <td>NESTING_LEVEL</td> + <td>Integer</td> + <td>The depth of this element. Defined by the number of elements which have to be traversed to reach this element from the root.</td> + </tr> + <tr> + <td>26</td> + <td>ModelQualityService</td> + <td>org.fortiss.tooling.ext.quality.service.ModelQualityService</td> + <td>CONSTRAINT_VIOLATIONS_ERROR</td> + <td>Integer</td> + <td>Number of constraint violations of the severity error which have this element as source.</td> + </tr> + <tr> + <td>27</td> + <td>ModelQualityService</td> + <td>org.fortiss.tooling.ext.quality.service.ModelQualityService</td> + <td>CONSTRAINT_VIOLATIONS_WARNING</td> + <td>Integer</td> + <td>Number of constraint violations of the severity warning which have this element as source.</td> + </tr> + </tbody> +</table> + +<h2></h2> + +The included packages are: +<ul> +<li><i>org.fortiss.tooling.ext.quality</i>: containing the GraphMetrics and HierarchicElement providers. The other providers are therefore located on the +necessary plugin level to support the extraction of meta information from other elements. All metric providers implement the IMetricProvider interface.</li> +<li><i>org.fortiss.tooling.ext.quality.data</i>: contains the classes to handle the data structure and map of metrics. It manages the data during runtime + so the visualizations can receive the necessary data.</li> +<li><i>org.fortiss.tooling.ext.quality.service</i>: The interface and implementation of the registered service.</li> +<li><i>org.fortiss.tooling.ext.quality.storage</i>: The classes here manage the csv extraction to archive the metrics.</li> +</ul> </body> </html> \ No newline at end of file diff --git a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/.ratings b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/.ratings index 4ee865b20..27c82a4bd 100644 --- a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/.ratings +++ b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/.ratings @@ -1,4 +1,5 @@ AF3QualityActivator.java 353c3d99f423997e4e99a896b3c095fd77d81431 YELLOW -GraphMetricsProvider.java d2d0db1d00adeffeeb55b881a2ed81b7107cdbe2 YELLOW -HierarchicElementProvider.java 3c114abd47ecc0d7da751c3f05c83fd49a30717b YELLOW +GraphMetricsProvider.java b00a3b47acfcb6df3ab948f1258ff256ab07728c YELLOW +HierarchicElementProvider.java 721c03e40f618955867e662a46e55b4b6a8cd7bc YELLOW IMetricProvider.java 99fc8993b0e65b2f8757978eeb0481d912f5608c YELLOW +IMetricUpdateListener.java c24dc7c0f282623bbf1eefac1fbbb6752c97ddf0 YELLOW diff --git a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/MetricUpdateListener.java b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/IMetricUpdateListener.java similarity index 97% rename from org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/MetricUpdateListener.java rename to org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/IMetricUpdateListener.java index f72bf91fe..c24dc7c0f 100644 --- a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/MetricUpdateListener.java +++ b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/IMetricUpdateListener.java @@ -22,7 +22,7 @@ import org.fortiss.tooling.kernel.model.IProjectRootElement; * * @author groh */ -public interface MetricUpdateListener { +public interface IMetricUpdateListener { /** * Callback for metric update. This method will get called every time the metrics are updated. * diff --git a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/data/.ratings b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/data/.ratings index 2ad4c1889..87fbb5c24 100644 --- a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/data/.ratings +++ b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/data/.ratings @@ -1,3 +1,4 @@ -MetricDataManager.java 36dc2d04485702ce18dd914789d06d873eb99564 YELLOW +DataRootElement.java d54ab629fc0dc9069586a3c7edfec0734e35dd86 YELLOW +MetricDataManager.java f9e2d04edeb31f0af094d5ad92f6a573c1b90373 YELLOW MetricKey.java aeca14c4ee3ee4bdcb7d18d8332981aa3d04604d YELLOW MetricTreeNode.java d89ef9aab7171a66ff7fc30c904e06f50d164ff9 YELLOW diff --git a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/service/.ratings b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/service/.ratings index eef481260..77b450610 100644 --- a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/service/.ratings +++ b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/service/.ratings @@ -1,2 +1,2 @@ -IModelQualityService.java 5168db33728ae6ea4cae4a698ce21a26dce5ec79 YELLOW -ModelQualityService.java 75d1301f64d64c273a1f649ff7a02e396eb98b35 YELLOW +IModelQualityService.java b530e32826340efaa3872e110d71e1c3a720dc07 YELLOW +ModelQualityService.java da65b2e0e657f13a01b914e7090dc7fa0b60eb87 YELLOW diff --git a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/service/IModelQualityService.java b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/service/IModelQualityService.java index f653e228c..b530e3282 100644 --- a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/service/IModelQualityService.java +++ b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/service/IModelQualityService.java @@ -17,7 +17,7 @@ package org.fortiss.tooling.ext.quality.service; import org.eclipse.emf.ecore.EObject; import org.fortiss.tooling.ext.quality.IMetricProvider; -import org.fortiss.tooling.ext.quality.MetricUpdateListener; +import org.fortiss.tooling.ext.quality.IMetricUpdateListener; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; /** @@ -39,11 +39,11 @@ public interface IModelQualityService { void scheduleMetricCollection(ITopLevelElement top); /** - * Registers the provided {@link MetricUpdateListener} to be called when the metrics are + * Registers the provided {@link IMetricUpdateListener} to be called when the metrics are * updated. * * @param listener * to be registered */ - void registerMetricUpdateListener(MetricUpdateListener listener); + void registerMetricUpdateListener(IMetricUpdateListener listener); } diff --git a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/service/ModelQualityService.java b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/service/ModelQualityService.java index d02483b84..da65b2e0e 100644 --- a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/service/ModelQualityService.java +++ b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/service/ModelQualityService.java @@ -38,7 +38,7 @@ import org.eclipse.emf.ecore.EObject; import org.fortiss.tooling.base.model.element.IHierarchicElement; import org.fortiss.tooling.ext.quality.GraphMetricsProvider; import org.fortiss.tooling.ext.quality.IMetricProvider; -import org.fortiss.tooling.ext.quality.MetricUpdateListener; +import org.fortiss.tooling.ext.quality.IMetricUpdateListener; import org.fortiss.tooling.ext.quality.data.DataRootElement; import org.fortiss.tooling.ext.quality.data.MetricDataManager; import org.fortiss.tooling.ext.quality.data.MetricKey; @@ -89,8 +89,8 @@ public class ModelQualityService extends EObjectAwareServiceBase<IMetricProvider /** Instance of the MetricDataManager. */ private MetricDataManager metricDataManagerInstance = new MetricDataManager(); - /** List of {@link MetricUpdateListener} which are called when the metrics are updated */ - private List<MetricUpdateListener> metricUpdateListeners = new ArrayList<>(); + /** List of {@link IMetricUpdateListener} which are called when the metrics are updated */ + private List<IMetricUpdateListener> metricUpdateListeners = new ArrayList<>(); /** Top-level elements queued to be processed by the metric collector. */ private final Queue<ITopLevelElement> queuedProcessableElements = @@ -126,7 +126,7 @@ public class ModelQualityService extends EObjectAwareServiceBase<IMetricProvider /** {@inheritDoc} */ @Override - public void registerMetricUpdateListener(MetricUpdateListener listener) { + public void registerMetricUpdateListener(IMetricUpdateListener listener) { this.metricUpdateListeners.add(listener); } diff --git a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/storage/.ratings b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/storage/.ratings index d54c7aa59..2be8b125d 100644 --- a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/storage/.ratings +++ b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/storage/.ratings @@ -1,2 +1,2 @@ -CSVFileWriter.java 3798d6cfd828cf103885c168066853b28fac85f7 YELLOW +CSVFileWriter.java 6476dbb630bab3592cb68541ceb1535c0a920a66 YELLOW ModelQualityStorageManager.java 124faddb3d297d23448c15379446cc847a2790a9 YELLOW diff --git a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/storage/CSVFileWriter.java b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/storage/CSVFileWriter.java index 45559ca85..6476dbb63 100644 --- a/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/storage/CSVFileWriter.java +++ b/org.fortiss.tooling.ext.quality/src/org/fortiss/tooling/ext/quality/storage/CSVFileWriter.java @@ -106,7 +106,6 @@ public class CSVFileWriter { private static void writeMetricsToFile(Map<IProjectRootElement, DataRootElement> map, List<String> allKeys, Path path, boolean createNewIndex) { try(var writer = new BufferedWriter(new FileWriter(path.toFile(), true))) { - if(createNewIndex) { // Create new index and write it into the first line of the file allKeys.add("timestamp"); @@ -133,12 +132,10 @@ public class CSVFileWriter { map.forEach((rootElement, dataRootElement) -> { // iterate over all project roots String rootName = rootElement.getClass().getSimpleName(); - var topLevelElement = dataRootElement.getTopLevelElement(); String projectName = topLevelElement.getSaveableName(); var rootNode = dataRootElement.getRootNode(); - rootNode.traverseTree(node -> { var integers = node.getStoredIntegers(); var doubles = node.getStoredDoubles(); @@ -160,7 +157,6 @@ public class CSVFileWriter { return doubles.get(k); return integers.get(k); }).map(String::valueOf)).collect(Collectors.joining(",")); - try { // write values writer.write(values); -- GitLab