Skip to content
Snippets Groups Projects
Commit 5af7e540 authored by blaschke's avatar blaschke
Browse files

Adding quality documentation in logic for file distribution in packages.

Issue-Ref: 4310
Issue-Url: af3#4310


Signed-off-by: default avatarKonstantin Blaschke <blaschke@fortiss.org>
parent 9b8743b5
No related branches found
No related tags found
1 merge request!210Setting up Metric extraction plugin for AF3 : Issue 4310
Showing
with 267 additions and 146 deletions
ModelQualityExtractionMenu.java 87cdfa5d4f939cc9f21afc8d6361a2089f440f20 YELLOW ModelQualityExtractionMenu.java 87cdfa5d4f939cc9f21afc8d6361a2089f440f20 YELLOW
ModelQualityUIActivator.java 47787eb293198014ba5a5a9b21d004a379117f5e YELLOW ModelQualityUIActivator.java 2f47db82bc088072dbfe53f82d3ed417d77fd23c YELLOW
IModelQualityViewPart.java 708f8089645df12098ea67190805cce343045d2e YELLOW IModelQualityViewPart.java 708f8089645df12098ea67190805cce343045d2e YELLOW
ModelQualityFXController.java 4272d7043944effc9532d4a122fd50b63b79fb82 YELLOW ModelQualityFXController.java ec593e9c70ce70f4f2734cf6750cec8a844e6a47 YELLOW
ModelQualityFXViewPart.java 179abf18d6e3b6c844076620f53b43ac8a42c217 YELLOW ModelQualityFXViewPart.java 179abf18d6e3b6c844076620f53b43ac8a42c217 YELLOW
...@@ -41,7 +41,7 @@ import org.fortiss.tooling.common.ui.javafx.layout.CompositeFXControllerBase; ...@@ -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.FillStyle;
import org.fortiss.tooling.common.ui.javafx.style.FontStyle; import org.fortiss.tooling.common.ui.javafx.style.FontStyle;
import org.fortiss.tooling.common.ui.javafx.style.LineStyle; 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.MetricDataManager;
import org.fortiss.tooling.ext.quality.data.MetricKey; import org.fortiss.tooling.ext.quality.data.MetricKey;
import org.fortiss.tooling.ext.quality.data.MetricTreeNode; import org.fortiss.tooling.ext.quality.data.MetricTreeNode;
...@@ -77,7 +77,7 @@ import javafx.scene.text.Text; ...@@ -77,7 +77,7 @@ import javafx.scene.text.Text;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public class ModelQualityFXController extends CompositeFXControllerBase<SplitPane, Node> public class ModelQualityFXController extends CompositeFXControllerBase<SplitPane, Node>
implements ISelectionListener, MetricUpdateListener { implements ISelectionListener, IMetricUpdateListener {
/** ChoiceBox for selecting the metric which shall be displayed. */ /** ChoiceBox for selecting the metric which shall be displayed. */
@FXML @FXML
...@@ -115,8 +115,7 @@ public class ModelQualityFXController extends CompositeFXControllerBase<SplitPan ...@@ -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 * The last {@link EObject} which the user has clicked. Might be null when no or an invalid Object is selected.
* Object is selected.
*/ */
private EObject lastSelectedElement; private EObject lastSelectedElement;
...@@ -161,9 +160,7 @@ public class ModelQualityFXController extends CompositeFXControllerBase<SplitPan ...@@ -161,9 +160,7 @@ public class ModelQualityFXController extends CompositeFXControllerBase<SplitPan
updateCharts("Selection does not have metric information"); updateCharts("Selection does not have metric information");
} }
/** /** Is triggered when the choice box changes. */
* Is triggered when the choice box changes.
*/
public void onChoiceBoxChange() { public void onChoiceBoxChange() {
updateCharts("Invalid selection or metrics not available"); updateCharts("Invalid selection or metrics not available");
} }
......
documentation.html a9df919adc2e879d79775a358a858f77ebbbaf86 YELLOW
...@@ -4,131 +4,256 @@ ...@@ -4,131 +4,256 @@
</head> </head>
<body lang="en-US" dir="ltr"> <body lang="en-US" dir="ltr">
<h1>Developer Documentation for <i>Quality Functionality <h1>Developer Documentation for <i>Quality Functionality
(</i><i>org.fortiss.tooling.ext.quality</i><i>)</i></h1> (</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>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> <p>They are categorized by the respective provider collecting the metric</p>
<h2>HierarchicElementProvider</h2> <table border="1">
<code>org.fortiss.tooling.ext.quality.HierarchicElementProvider</code> <thead>
<tr>
<h4>UNQIUE_ID</h4> <th>Number</th>
<p><code>Integer</code>: This is an unique identifier for each element as specified in <code>org.fortiss.tooling.kernel.model.IIdLabeled</code>. </p> <th>Provider</th>
<th>Qualified Name</th>
<h4>NUMBER_OF_CONNECTORS</h4> <th>Metric</th>
<p><code>Integer</code>: Number of connectors in the respective element</p> <th>Type</th>
<th>Description</th>
<h4>NUMBER_OF_CONTAINED_ELEMENTS</h4> </tr>
<p><code>Integer</code>: Number of entries in the containedElements list.</p> </thead>
<tbody>
<h4>NUMBER_OF_CONNECTIONS</h4> <tr>
<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> <td>1</td>
<td>HierarchicElementProvider</td>
<h4>NUMBER_OF_TOTAL_CONNECTORS</h4> <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td>
<p><code>Integer</code>: Total number of connectors in this element and all contained elements</p> <td>UNIQUE_ID</td>
<td>Integer</td>
<h4>NUMBER_OF_TOTAL_ENTRY_CONNECTORS</h4> <td>This is an unique identifier for each element as specified in org.fortiss.tooling.kernel.model.IIdLabeled.</td>
<p><code>Integer</code>: Sum of all connectors which implement <code>org.fortiss.tooling.base.model.base.EntryConnectorBase</code></p> </tr>
<tr>
<h4>NUMBER_OF_TOTAL_EXIT_CONNECTORS</h4> <td>2</td>
<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> <td>HierarchicElementProvider</td>
<td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td>
<h4>NUMBER_OF_TOTAL_ELEMENTS</h4> <td>NUMBER_OF_CONNECTORS</td>
<p><code>Integer</code>: Total number of elements contained in this element. Includes the element for which this metric is recorded.</p> <td>Integer</td>
<td>Number of connectors in the respective element.</td>
<h4>NUMBER_OF_TOTAL_COMMENTABLE_ELEMENTS</h4> </tr>
<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> <tr>
<td>3</td>
<h4>NUMBER_OF_TOTAL_COMMENTED_ELEMENTS</h4> <td>HierarchicElementProvider</td>
<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> <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td>
<td>NUMBER_OF_CONTAINED_ELEMENTS</td>
<h4>NUMBER_OF_TOTAL_LEAF_ELEMENTS</h4> <td>Integer</td>
<p><code>Integer</code>: Total number of elements contained in this element which do not contain elements. Includes self</p> <td>Number of entries in the containedElements list.</td>
</tr>
<tr>
<h2>GraphMetricsProvider</h2> <td>4</td>
<code>org.fortiss.tooling.ext.quality.GraphMetricsProvider</code> <td>HierarchicElementProvider</td>
<td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td>
<td>NUMBER_OF_CONNECTIONS</td>
<h4>BETWEENESS_CENTRALITY</h4> <td>Integer</td>
<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> <td>Number of connections in this element. List of aggregated connection model elements. Usually aggregates all connections of its direct sub-structure.</td>
<p>The direction of the connections are respected, and it is assumed that all connections connect to a ExitConnectorBase or EntryConnectorBase</p> </tr>
<tr>
<td>5</td>
<h4>BETWEENESS_CENTRALITY_RECURSIVELY</h4> <td>HierarchicElementProvider</td>
<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> <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td>
<td>NUMBER_OF_TOTAL_CONNECTORS</td>
<td>Integer</td>
<h4>CLUSTERING_COEFFICIENT</h4> <td>Total number of connectors in this element and all contained elements.</td>
<p><code>Double</code>: Clustering coefficient of this element. Ignores connection direction and resolves all neighbours to leaf elements.</p> </tr>
<tr>
<td>6</td>
<td>HierarchicElementProvider</td>
<td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td>
<h2>ComponentMetricProvider</h2> <td>NUMBER_OF_TOTAL_ENTRY_CONNECTORS</td>
<code>org.fortiss.af3.component.quality.ComponentMetricProvider</code> <td>Integer</td>
<td>Sum of all connectors which implement org.fortiss.tooling.base.model.base.EntryConnectorBase.</td>
<h4>NUMBER_OF_TOTAL_CODE_CONSTANTS</h4> </tr>
<p><code>Integer</code>: Total number of constants in code specifications in this element and all contained elements</p> <tr>
<td>7</td>
<h4>NUMBER_OF_TOTAL_CODE_CYCLOMATIC_COMPLEXITY</h4> <td>HierarchicElementProvider</td>
<p><code>Integer</code>: The total cyclomatic complexity of all code specifications in this element and all contained elements</p> <td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td>
<td>NUMBER_OF_TOTAL_EXIT_CONNECTORS</td>
<h4>NUMBER_OF_TOTAL_CODE_LINES</h4> <td>Integer</td>
<p><code>Integer</code>: Total number of lines of code in all code specifications in this element and all contained elements</p> <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>
<h4>NUMBER_OF_TOTAL_CODE_COMMENTS</h4> <tr>
<p><code>Integer</code>: Total number of comment blocks in all code specifications in this element and all contained elements</p> <td>8</td>
<td>HierarchicElementProvider</td>
<td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td>
<h2>ComponentMetricProvider</h2> <td>NUMBER_OF_TOTAL_ELEMENTS</td>
<code>org.fortiss.af3.component.quality.ComponentMetricProvider</code> <td>Integer</td>
<td>Total number of elements contained in this element. Includes the element for which this metric is recorded.</td>
</tr>
<h2>DataDictonaryProvider</h2> <tr>
<code>org.fortiss.af3.component.quality.DataDictonaryProvider</code> <td>9</td>
<p> Provides Metrics also collected by the HierarchicElementProvider, but for the DataDictionary.</p> <td>HierarchicElementProvider</td>
<td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td>
<td>NUMBER_OF_TOTAL_COMMENTABLE_ELEMENTS</td>
<h2>SafetyMetricProvider</h2> <td>Integer</td>
<code>org.fortiss.af3.safety.quality.SafetyMetricProvider</code> <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>
<h4>SAFETY_LEVEL</h4> <tr>
<p><code>String</code>: String representation of the assigned safety level of this element</p> <td>10</td>
<td>HierarchicElementProvider</td>
<td>org.fortiss.tooling.ext.quality.HierarchicElementProvider</td>
<h2>AllocationTableProvider</h2> <td>NUMBER_OF_TOTAL_COMMENTED_ELEMENTS</td>
<code>org.fortiss.af3.task.quality.AllocationTableProvider</code> <td>Integer</td>
<td>Total number of elements which are commentable and do not have null or an empty string as a comment.</td>
<h4>TASK_ALLOCATED_COMPONENTS</h4> </tr>
<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> <tr>
<td>11</td>
<h4>HARDWARE_ALLOCATED_TASKS</h4> <td>HierarchicElementProvider</td>
<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> <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>
<h2>ModelQualityService</h2> </tr>
<code>org.fortiss.tooling.ext.quality.service.ModelQualityService</code> <tr>
<td>12</td>
<h4>NESTING_LEVEL</h4> <td>GraphMetricsProvider</td>
<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> <td>org.fortiss.tooling.ext.quality.GraphMetricsProvider</td>
<td>BETWEENESS_CENTRALITY</td>
<td>Double</td>
<h4>CONSTRAINT_VIOLATIONS_ERROR</h4> <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>
<p><code>Integer</code>: Number of constraint violations of the severity error which have this element as source</p> </tr>
<tr>
<td>13</td>
<h4>CONSTRAINT_VIOLATIONS_WARNING</h4> <td>GraphMetricsProvider</td>
<p><code>Integer</code>: Number of constraint violations of the severity warning which have this element as source</p> <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> </body>
</html> </html>
\ No newline at end of file
AF3QualityActivator.java 353c3d99f423997e4e99a896b3c095fd77d81431 YELLOW AF3QualityActivator.java 353c3d99f423997e4e99a896b3c095fd77d81431 YELLOW
GraphMetricsProvider.java d2d0db1d00adeffeeb55b881a2ed81b7107cdbe2 YELLOW GraphMetricsProvider.java b00a3b47acfcb6df3ab948f1258ff256ab07728c YELLOW
HierarchicElementProvider.java 3c114abd47ecc0d7da751c3f05c83fd49a30717b YELLOW HierarchicElementProvider.java 721c03e40f618955867e662a46e55b4b6a8cd7bc YELLOW
IMetricProvider.java 99fc8993b0e65b2f8757978eeb0481d912f5608c YELLOW IMetricProvider.java 99fc8993b0e65b2f8757978eeb0481d912f5608c YELLOW
IMetricUpdateListener.java c24dc7c0f282623bbf1eefac1fbbb6752c97ddf0 YELLOW
...@@ -22,7 +22,7 @@ import org.fortiss.tooling.kernel.model.IProjectRootElement; ...@@ -22,7 +22,7 @@ import org.fortiss.tooling.kernel.model.IProjectRootElement;
* *
* @author groh * @author groh
*/ */
public interface MetricUpdateListener { public interface IMetricUpdateListener {
/** /**
* Callback for metric update. This method will get called every time the metrics are updated. * Callback for metric update. This method will get called every time the metrics are updated.
* *
......
MetricDataManager.java 36dc2d04485702ce18dd914789d06d873eb99564 YELLOW DataRootElement.java d54ab629fc0dc9069586a3c7edfec0734e35dd86 YELLOW
MetricDataManager.java f9e2d04edeb31f0af094d5ad92f6a573c1b90373 YELLOW
MetricKey.java aeca14c4ee3ee4bdcb7d18d8332981aa3d04604d YELLOW MetricKey.java aeca14c4ee3ee4bdcb7d18d8332981aa3d04604d YELLOW
MetricTreeNode.java d89ef9aab7171a66ff7fc30c904e06f50d164ff9 YELLOW MetricTreeNode.java d89ef9aab7171a66ff7fc30c904e06f50d164ff9 YELLOW
IModelQualityService.java 5168db33728ae6ea4cae4a698ce21a26dce5ec79 YELLOW IModelQualityService.java b530e32826340efaa3872e110d71e1c3a720dc07 YELLOW
ModelQualityService.java 75d1301f64d64c273a1f649ff7a02e396eb98b35 YELLOW ModelQualityService.java da65b2e0e657f13a01b914e7090dc7fa0b60eb87 YELLOW
...@@ -17,7 +17,7 @@ package org.fortiss.tooling.ext.quality.service; ...@@ -17,7 +17,7 @@ package org.fortiss.tooling.ext.quality.service;
import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.ext.quality.IMetricProvider; 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; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
/** /**
...@@ -39,11 +39,11 @@ public interface IModelQualityService { ...@@ -39,11 +39,11 @@ public interface IModelQualityService {
void scheduleMetricCollection(ITopLevelElement top); 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. * updated.
* *
* @param listener * @param listener
* to be registered * to be registered
*/ */
void registerMetricUpdateListener(MetricUpdateListener listener); void registerMetricUpdateListener(IMetricUpdateListener listener);
} }
...@@ -38,7 +38,7 @@ import org.eclipse.emf.ecore.EObject; ...@@ -38,7 +38,7 @@ import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.base.model.element.IHierarchicElement; import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.ext.quality.GraphMetricsProvider; import org.fortiss.tooling.ext.quality.GraphMetricsProvider;
import org.fortiss.tooling.ext.quality.IMetricProvider; 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.DataRootElement;
import org.fortiss.tooling.ext.quality.data.MetricDataManager; import org.fortiss.tooling.ext.quality.data.MetricDataManager;
import org.fortiss.tooling.ext.quality.data.MetricKey; import org.fortiss.tooling.ext.quality.data.MetricKey;
...@@ -89,8 +89,8 @@ public class ModelQualityService extends EObjectAwareServiceBase<IMetricProvider ...@@ -89,8 +89,8 @@ public class ModelQualityService extends EObjectAwareServiceBase<IMetricProvider
/** Instance of the MetricDataManager. */ /** Instance of the MetricDataManager. */
private MetricDataManager metricDataManagerInstance = new MetricDataManager(); private MetricDataManager metricDataManagerInstance = new MetricDataManager();
/** List of {@link MetricUpdateListener} which are called when the metrics are updated */ /** List of {@link IMetricUpdateListener} which are called when the metrics are updated */
private List<MetricUpdateListener> metricUpdateListeners = new ArrayList<>(); private List<IMetricUpdateListener> metricUpdateListeners = new ArrayList<>();
/** Top-level elements queued to be processed by the metric collector. */ /** Top-level elements queued to be processed by the metric collector. */
private final Queue<ITopLevelElement> queuedProcessableElements = private final Queue<ITopLevelElement> queuedProcessableElements =
...@@ -126,7 +126,7 @@ public class ModelQualityService extends EObjectAwareServiceBase<IMetricProvider ...@@ -126,7 +126,7 @@ public class ModelQualityService extends EObjectAwareServiceBase<IMetricProvider
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public void registerMetricUpdateListener(MetricUpdateListener listener) { public void registerMetricUpdateListener(IMetricUpdateListener listener) {
this.metricUpdateListeners.add(listener); this.metricUpdateListeners.add(listener);
} }
......
CSVFileWriter.java 3798d6cfd828cf103885c168066853b28fac85f7 YELLOW CSVFileWriter.java 6476dbb630bab3592cb68541ceb1535c0a920a66 YELLOW
ModelQualityStorageManager.java 124faddb3d297d23448c15379446cc847a2790a9 YELLOW ModelQualityStorageManager.java 124faddb3d297d23448c15379446cc847a2790a9 YELLOW
...@@ -106,7 +106,6 @@ public class CSVFileWriter { ...@@ -106,7 +106,6 @@ public class CSVFileWriter {
private static void writeMetricsToFile(Map<IProjectRootElement, DataRootElement> map, private static void writeMetricsToFile(Map<IProjectRootElement, DataRootElement> map,
List<String> allKeys, Path path, boolean createNewIndex) { List<String> allKeys, Path path, boolean createNewIndex) {
try(var writer = new BufferedWriter(new FileWriter(path.toFile(), true))) { try(var writer = new BufferedWriter(new FileWriter(path.toFile(), true))) {
if(createNewIndex) { if(createNewIndex) {
// Create new index and write it into the first line of the file // Create new index and write it into the first line of the file
allKeys.add("timestamp"); allKeys.add("timestamp");
...@@ -133,12 +132,10 @@ public class CSVFileWriter { ...@@ -133,12 +132,10 @@ public class CSVFileWriter {
map.forEach((rootElement, dataRootElement) -> { map.forEach((rootElement, dataRootElement) -> {
// iterate over all project roots // iterate over all project roots
String rootName = rootElement.getClass().getSimpleName(); String rootName = rootElement.getClass().getSimpleName();
var topLevelElement = dataRootElement.getTopLevelElement(); var topLevelElement = dataRootElement.getTopLevelElement();
String projectName = topLevelElement.getSaveableName(); String projectName = topLevelElement.getSaveableName();
var rootNode = dataRootElement.getRootNode(); var rootNode = dataRootElement.getRootNode();
rootNode.traverseTree(node -> { rootNode.traverseTree(node -> {
var integers = node.getStoredIntegers(); var integers = node.getStoredIntegers();
var doubles = node.getStoredDoubles(); var doubles = node.getStoredDoubles();
...@@ -160,7 +157,6 @@ public class CSVFileWriter { ...@@ -160,7 +157,6 @@ public class CSVFileWriter {
return doubles.get(k); return doubles.get(k);
return integers.get(k); return integers.get(k);
}).map(String::valueOf)).collect(Collectors.joining(",")); }).map(String::valueOf)).collect(Collectors.joining(","));
try { try {
// write values // write values
writer.write(values); writer.write(values);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment