diff --git a/.classpath b/.classpath
index ac61794..2c19a14 100644
--- a/.classpath
+++ b/.classpath
@@ -11,5 +11,8 @@
+
+
+
diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF
index 11f79b4..a858489 100644
--- a/META-INF/MANIFEST.MF
+++ b/META-INF/MANIFEST.MF
@@ -16,149 +16,532 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Activator: io.github.mariazevedo88.o3smeasures.plugin.Activator
Bundle-ActivationPolicy: lazy
Export-Package: com.keypoint,
- io.github.mariazevedo88.o3smeasures.astvisitors,
- io.github.mariazevedo88.o3smeasures.builder,
- io.github.mariazevedo88.o3smeasures.builder.generic,
- io.github.mariazevedo88.o3smeasures.javamodel,
+ io.github.mariazevedo88.o3smeasures.astvisitors;uses:="org.eclipse.jdt.core.dom",
+ io.github.mariazevedo88.o3smeasures.builder;
+ uses:="org.eclipse.jdt.core,
+ org.eclipse.core.resources,
+ io.github.mariazevedo88.o3smeasures.structures,
+ org.apache.log4j,
+ io.github.mariazevedo88.o3smeasures.builder.generic",
+ io.github.mariazevedo88.o3smeasures.builder.generic;uses:="io.github.mariazevedo88.o3smeasures.structures",
+ io.github.mariazevedo88.o3smeasures.javamodel;uses:="org.eclipse.jdt.core,io.github.mariazevedo88.o3smeasures.javamodel.generic",
io.github.mariazevedo88.o3smeasures.javamodel.generic,
- io.github.mariazevedo88.o3smeasures.main,
- io.github.mariazevedo88.o3smeasures.measures.main,
- io.github.mariazevedo88.o3smeasures.measures.secondary,
+ io.github.mariazevedo88.o3smeasures.main;
+ uses:="org.eclipse.jdt.core,
+ org.eclipse.jdt.core.dom,
+ org.eclipse.core.resources,
+ org.eclipse.collections.api.list,
+ io.github.mariazevedo88.o3smeasures.structures",
io.github.mariazevedo88.o3smeasures.measures.enumeration,
- io.github.mariazevedo88.o3smeasures.plugin,
- io.github.mariazevedo88.o3smeasures.plugin.chart,
- io.github.mariazevedo88.o3smeasures.plugin.views,
- io.github.mariazevedo88.o3smeasures.popup.actions,
- io.github.mariazevedo88.o3smeasures.preferences,
- io.github.mariazevedo88.o3smeasures.statistic,
+ io.github.mariazevedo88.o3smeasures.measures.main;uses:="io.github.mariazevedo88.o3smeasures.structures",
+ io.github.mariazevedo88.o3smeasures.measures.secondary;uses:="io.github.mariazevedo88.o3smeasures.astvisitors,io.github.mariazevedo88.o3smeasures.structures",
+ io.github.mariazevedo88.o3smeasures.plugin;
+ uses:="org.osgi.framework,
+ org.eclipse.jface.util,
+ org.eclipse.jface.resource,
+ org.eclipse.ui.plugin",
+ io.github.mariazevedo88.o3smeasures.plugin.chart;uses:="org.jfree.chart,io.github.mariazevedo88.o3smeasures.structures,org.apache.log4j",
+ io.github.mariazevedo88.o3smeasures.plugin.views;
+ uses:="org.eclipse.swt.widgets,
+ org.eclipse.core.resources,
+ org.jfree.chart,
+ io.github.mariazevedo88.o3smeasures.structures,
+ io.github.mariazevedo88.o3smeasures.main,
+ org.eclipse.jface.viewers,
+ org.eclipse.ui.part",
+ io.github.mariazevedo88.o3smeasures.popup.actions;uses:="org.eclipse.swt.widgets,org.eclipse.core.commands",
+ io.github.mariazevedo88.o3smeasures.preferences;
+ uses:="org.eclipse.ui,
+ org.eclipse.jface.preference,
+ org.eclipse.core.runtime.preferences,
+ org.eclipse.core.commands",
+ io.github.mariazevedo88.o3smeasures.statistic;uses:="io.github.mariazevedo88.o3smeasures.statistic.generic,io.github.mariazevedo88.o3smeasures.structures",
io.github.mariazevedo88.o3smeasures.statistic.generic,
- io.github.mariazevedo88.o3smeasures.structures,
+ io.github.mariazevedo88.o3smeasures.structures;uses:="org.eclipse.jdt.core.dom",
io.github.mariazevedo88.o3smeasures.test,
- io.github.mariazevedo88.o3smeasures.util,
+ io.github.mariazevedo88.o3smeasures.util;
+ uses:="org.jsefa.common.converter,
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.core.dom,
+ io.github.mariazevedo88.o3smeasures.structures,
+ org.apache.log4j",
io.github.mariazevedo88.o3smeasures.util.exception,
org.apache.commons.csv,
- org.apache.log4j,
- org.apache.log4j.chainsaw,
- org.apache.log4j.config,
- org.apache.log4j.helpers,
- org.apache.log4j.jdbc,
- org.apache.log4j.jmx,
- org.apache.log4j.lf5,
+ org.apache.log4j;uses:="org.apache.log4j.helpers,org.apache.log4j.or,org.apache.log4j.spi",
+ org.apache.log4j.chainsaw;
+ uses:="org.xml.sax.helpers,
+ javax.swing.table,
+ org.xml.sax,
+ javax.swing.event,
+ org.apache.log4j,
+ org.apache.log4j.spi,
+ javax.swing",
+ org.apache.log4j.config;uses:="org.apache.log4j",
+ org.apache.log4j.helpers;uses:="org.apache.log4j,org.apache.log4j.spi",
+ org.apache.log4j.jdbc;uses:="org.apache.log4j,org.apache.log4j.spi",
+ org.apache.log4j.jmx;uses:="javax.management,org.apache.log4j,org.apache.log4j.spi",
+ org.apache.log4j.lf5;uses:="org.apache.log4j.lf5.viewer,org.apache.log4j,org.apache.log4j.spi",
org.apache.log4j.lf5.config,
- org.apache.log4j.lf5.util,
- org.apache.log4j.lf5.viewer,
- org.apache.log4j.lf5.viewer.categoryexplorer,
- org.apache.log4j.lf5.viewer.configure,
+ org.apache.log4j.lf5.util;uses:="org.apache.log4j.lf5.viewer,org.apache.log4j.lf5",
+ org.apache.log4j.lf5.viewer;
+ uses:="org.apache.log4j.lf5.viewer.categoryexplorer,
+ javax.swing.table,
+ javax.swing.event,
+ org.apache.log4j.lf5.viewer.configure,
+ org.apache.log4j.lf5,
+ org.apache.log4j.lf5.util,
+ javax.swing",
+ org.apache.log4j.lf5.viewer.categoryexplorer;
+ uses:="javax.swing.table,
+ javax.swing.tree,
+ javax.swing.event,
+ org.apache.log4j.lf5,
+ javax.swing",
+ org.apache.log4j.lf5.viewer.configure;uses:="org.w3c.dom,javax.swing.tree,org.apache.log4j.lf5.viewer",
org.apache.log4j.lf5.viewer.images,
- org.apache.log4j.net,
- org.apache.log4j.nt,
- org.apache.log4j.or,
- org.apache.log4j.or.jms,
- org.apache.log4j.or.sax,
- org.apache.log4j.pattern,
- org.apache.log4j.rewrite,
- org.apache.log4j.spi,
- org.apache.log4j.varia,
- org.apache.log4j.xml,
- org.jfree,
- org.jfree.base,
- org.jfree.base.config,
- org.jfree.base.log,
- org.jfree.base.modules,
- org.jfree.chart,
- org.jfree.chart.annotations,
- org.jfree.chart.axis,
- org.jfree.chart.block,
- org.jfree.chart.demo,
- org.jfree.chart.editor,
+ org.apache.log4j.net;
+ uses:="org.w3c.dom,
+ org.apache.log4j.helpers,
+ javax.jms,
+ javax.mail.internet,
+ javax.naming,
+ javax.mail,
+ org.apache.log4j.xml,
+ org.apache.log4j,
+ org.apache.log4j.spi",
+ org.apache.log4j.nt;uses:="org.apache.log4j,org.apache.log4j.spi",
+ org.apache.log4j.or;uses:="org.apache.log4j.spi",
+ org.apache.log4j.or.jms;uses:="org.apache.log4j.or",
+ org.apache.log4j.or.sax;uses:="org.apache.log4j.or",
+ org.apache.log4j.pattern;uses:="org.apache.log4j.helpers,org.apache.log4j,org.apache.log4j.spi",
+ org.apache.log4j.rewrite;
+ uses:="org.apache.log4j.xml,
+ org.w3c.dom,
+ org.apache.log4j,
+ org.apache.log4j.spi",
+ org.apache.log4j.spi;uses:="org.apache.log4j.or,org.apache.log4j",
+ org.apache.log4j.varia;uses:="org.apache.log4j,org.apache.log4j.spi",
+ org.apache.log4j.xml;
+ uses:="org.apache.log4j.config,
+ org.w3c.dom,
+ org.apache.log4j.helpers,
+ org.xml.sax,
+ org.apache.log4j,
+ javax.xml.parsers,
+ org.apache.log4j.spi",
+ org.jfree;uses:="org.jfree.ui.about",
+ org.jfree.base;uses:="org.jfree.util,org.jfree.base.modules,org.jfree.base.config",
+ org.jfree.base.config;uses:="org.jfree.util",
+ org.jfree.base.log;uses:="org.jfree.util,org.jfree.base.modules",
+ org.jfree.base.modules;uses:="org.jfree.util,org.jfree.base,org.jfree.base.config",
+ org.jfree.chart;
+ uses:="org.jfree.ui,
+ org.jfree.chart.panel,
+ org.jfree.chart.renderer.xy,
+ org.jfree.chart.renderer.category,
+ org.jfree.chart.block,
+ org.jfree.ui.about,
+ org.jfree.util,
+ org.jfree.chart.renderer,
+ org.jfree.data.category,
+ org.jfree.chart.annotations,
+ org.jfree.chart.plot,
+ org.jfree.data.general,
+ org.jfree.chart.event,
+ org.jfree.data.xy,
+ org.jfree.chart.imagemap,
+ org.jfree.chart.title,
+ org.jfree.chart.entity,
+ org.jfree.chart.axis,
+ org.jfree.data.statistics,
+ javax.swing",
+ org.jfree.chart.annotations;
+ uses:="org.jfree.data,
+ org.jfree.chart.util,
+ org.jfree.ui,
+ org.jfree.chart.plot,
+ org.jfree.chart.event,
+ org.jfree.util,
+ org.jfree.chart.title,
+ org.jfree.chart.axis",
+ org.jfree.chart.axis;
+ uses:="org.jfree.data,
+ org.jfree.ui,
+ org.jfree.chart.plot,
+ org.jfree.chart.event,
+ org.jfree.data.time,
+ org.jfree.util,
+ org.jfree.data.category,
+ org.jfree.text",
+ org.jfree.chart.block;
+ uses:="org.jfree.util,
+ org.jfree.data,
+ org.jfree.ui,
+ org.jfree.text,
+ org.jfree.chart.entity",
+ org.jfree.chart.demo;uses:="org.jfree.ui,javax.swing",
+ org.jfree.chart.editor;
+ uses:="org.jfree.ui,
+ org.jfree.chart.title,
+ org.jfree.chart.plot,
+ org.jfree.chart,
+ org.jfree.chart.axis,
+ javax.swing",
org.jfree.chart.encoders,
- org.jfree.chart.entity,
- org.jfree.chart.event,
- org.jfree.chart.imagemap,
- org.jfree.chart.labels,
+ org.jfree.chart.entity;
+ uses:="org.jfree.chart.plot,
+ org.jfree.data.general,
+ org.jfree.data.xy,
+ org.jfree.util,
+ org.jfree.chart.imagemap,
+ org.jfree.chart.title,
+ org.jfree.data.category,
+ org.jfree.chart,
+ org.jfree.chart.axis",
+ org.jfree.chart.event;
+ uses:="org.jfree.chart.title,
+ org.jfree.chart.plot,
+ org.jfree.chart,
+ org.jfree.chart.annotations,
+ org.jfree.chart.axis",
+ org.jfree.chart.imagemap;uses:="org.jfree.chart",
+ org.jfree.chart.labels;
+ uses:="org.jfree.data.xy,
+ org.jfree.util,
+ org.jfree.data.contour,
+ org.jfree.ui,
+ org.jfree.chart.plot,
+ org.jfree.data.category,
+ org.jfree.data.general",
org.jfree.chart.needle,
- org.jfree.chart.panel,
- org.jfree.chart.plot,
- org.jfree.chart.plot.dial,
- org.jfree.chart.renderer,
- org.jfree.chart.renderer.category,
- org.jfree.chart.renderer.xy,
+ org.jfree.chart.panel;
+ uses:="org.jfree.util,
+ org.jfree.chart.plot,
+ org.jfree.chart.event,
+ org.jfree.chart",
+ org.jfree.chart.plot;
+ uses:="org.jfree.chart.util,
+ org.jfree.ui,
+ org.jfree.chart.renderer.xy,
+ org.jfree.chart.renderer.category,
+ org.jfree.util,
+ org.jfree.data.contour,
+ org.jfree.chart.renderer,
+ org.jfree.data.category,
+ org.jfree.chart.annotations,
+ org.jfree.chart.urls,
+ org.jfree.data,
+ org.jfree.chart.event,
+ org.jfree.data.general,
+ org.jfree.chart.labels,
+ org.jfree.data.xy,
+ org.jfree.chart.title,
+ org.jfree.text,
+ org.jfree.chart,
+ org.jfree.chart.axis,
+ org.jfree.chart.needle,
+ javax.swing",
+ org.jfree.chart.plot.dial;
+ uses:="org.jfree.util,
+ org.jfree.ui,
+ org.jfree.chart.plot,
+ org.jfree.chart.event,
+ org.jfree.data.general",
+ org.jfree.chart.renderer;
+ uses:="org.jfree.chart.urls,
+ org.jfree.chart.plot,
+ org.jfree.chart.labels,
+ org.jfree.chart.event,
+ org.jfree.data.xy,
+ org.jfree.util,
+ org.jfree.chart,
+ org.jfree.chart.entity,
+ org.jfree.chart.axis",
+ org.jfree.chart.renderer.category;
+ uses:="org.jfree.chart.urls,
+ org.jfree.data,
+ org.jfree.ui,
+ org.jfree.data.gantt,
+ org.jfree.chart.plot,
+ org.jfree.chart.labels,
+ org.jfree.chart.event,
+ org.jfree.util,
+ org.jfree.chart.renderer,
+ org.jfree.data.category,
+ org.jfree.chart,
+ org.jfree.chart.entity,
+ org.jfree.chart.axis,
+ javax.swing,
+ org.jfree.data.statistics",
+ org.jfree.chart.renderer.xy;
+ uses:="org.jfree.chart.urls,
+ org.jfree.data,
+ org.jfree.ui,
+ org.jfree.chart.plot,
+ org.jfree.chart.labels,
+ org.jfree.chart.event,
+ org.jfree.data.general,
+ org.jfree.data.xy,
+ org.jfree.util,
+ org.jfree.chart.renderer,
+ org.jfree.chart,
+ org.jfree.chart.annotations,
+ org.jfree.chart.entity,
+ org.jfree.chart.axis",
org.jfree.chart.resources,
- org.jfree.chart.servlet,
- org.jfree.chart.title,
- org.jfree.chart.urls,
+ org.jfree.chart.servlet;uses:="javax.servlet.http,org.jfree.chart",
+ org.jfree.chart.title;
+ uses:="org.jfree.data,
+ org.jfree.ui,
+ org.jfree.data.general,
+ org.jfree.chart.event,
+ org.jfree.chart.block,
+ org.jfree.util,
+ org.jfree.chart.renderer,
+ org.jfree.chart,
+ org.jfree.chart.axis",
+ org.jfree.chart.urls;
+ uses:="org.jfree.data.xy,
+ org.jfree.util,
+ org.jfree.data.category,
+ org.jfree.data.general",
org.jfree.chart.util,
- org.jfree.data,
- org.jfree.data.category,
- org.jfree.data.contour,
+ org.jfree.data;uses:="org.jfree.util,org.jfree.data.general",
+ org.jfree.data.category;uses:="org.jfree.data,org.jfree.util,org.jfree.data.general",
+ org.jfree.data.contour;uses:="org.jfree.data.xy,org.jfree.data",
org.jfree.data.function,
- org.jfree.data.gantt,
- org.jfree.data.general,
- org.jfree.data.io,
- org.jfree.data.jdbc,
+ org.jfree.data.gantt;
+ uses:="org.jfree.data.time,
+ org.jfree.data.xy,
+ org.jfree.util,
+ org.jfree.data.category,
+ org.jfree.data.general",
+ org.jfree.data.general;
+ uses:="org.jfree.data.xy,
+ org.jfree.data,
+ org.jfree.util,
+ org.jfree.chart.renderer,
+ org.jfree.data.category,
+ org.jfree.data.function",
+ org.jfree.data.io;uses:="org.jfree.data.category",
+ org.jfree.data.jdbc;
+ uses:="org.jfree.data.xy,
+ org.jfree.data,
+ org.jfree.data.category,
+ org.jfree.data.general",
org.jfree.data.resources,
- org.jfree.data.statistics,
- org.jfree.data.time,
- org.jfree.data.time.ohlc,
- org.jfree.data.xml,
- org.jfree.data.xy,
+ org.jfree.data.statistics;
+ uses:="org.jfree.data.xy,
+ org.jfree.data,
+ org.jfree.util,
+ org.jfree.data.category,
+ org.jfree.data.general",
+ org.jfree.data.time;
+ uses:="org.jfree.data.xy,
+ org.jfree.data,
+ org.jfree.util,
+ javax.swing.table,
+ org.jfree.data.general,
+ org.jfree.date",
+ org.jfree.data.time.ohlc;uses:="org.jfree.data.time,org.jfree.data.xy,org.jfree.data",
+ org.jfree.data.xml;
+ uses:="org.xml.sax.helpers,
+ org.jfree.data.category,
+ org.xml.sax,
+ org.jfree.data.general",
+ org.jfree.data.xy;
+ uses:="org.jfree.data,
+ org.jfree.util,
+ javax.swing.table,
+ org.jfree.data.general",
org.jfree.date,
- org.jfree.experimental.chart.swt,
- org.jfree.experimental.chart.swt.demo,
- org.jfree.experimental.chart.swt.editor,
- org.jfree.experimental.swt,
+ org.jfree.experimental.chart.swt;
+ uses:="org.eclipse.swt.events,
+ org.eclipse.swt.graphics,
+ org.eclipse.swt.widgets,
+ org.jfree.chart.event,
+ org.jfree.chart",
+ org.jfree.experimental.chart.swt.demo;uses:="javax.swing",
+ org.jfree.experimental.chart.swt.editor;
+ uses:="org.eclipse.swt.events,
+ org.eclipse.swt.graphics,
+ org.jfree.chart.plot,
+ org.eclipse.swt.widgets,
+ org.jfree.chart.editor,
+ org.jfree.experimental.swt,
+ org.jfree.chart.title,
+ org.jfree.chart,
+ org.jfree.chart.axis",
+ org.jfree.experimental.swt;
+ uses:="org.eclipse.swt.events,
+ org.eclipse.swt.graphics,
+ org.eclipse.swt.widgets,
+ javax.swing",
org.jfree.io,
org.jfree.layout,
org.jfree.resources,
- org.jfree.text,
+ org.jfree.text;uses:="org.jfree.util,org.jfree.ui",
org.jfree.threads,
- org.jfree.ui,
- org.jfree.ui.about,
+ org.jfree.ui;
+ uses:="javax.swing.table,
+ javax.swing.text,
+ javax.swing.event,
+ org.jfree.util,
+ javax.swing.filechooser,
+ org.jfree.date,
+ javax.swing",
+ org.jfree.ui.about;
+ uses:="org.jfree.ui,
+ javax.swing.table,
+ javax.swing.border,
+ org.jfree.base,
+ javax.swing",
org.jfree.ui.about.resources,
- org.jfree.ui.action,
- org.jfree.ui.tabbedui,
- org.jfree.util,
- org.jsefa,
+ org.jfree.ui.action;uses:="javax.swing",
+ org.jfree.ui.tabbedui;uses:="javax.swing",
+ org.jfree.util;uses:="org.jfree.ui,org.jfree.base.config,javax.swing",
+ org.jsefa;uses:="org.jsefa.common.lowlevel",
org.jsefa.common.accessor,
- org.jsefa.common.annotation,
- org.jsefa.common.config,
- org.jsefa.common.converter,
- org.jsefa.common.converter.provider,
+ org.jsefa.common.annotation;
+ uses:="org.jsefa.common.accessor,
+ org.jsefa.common.converter,
+ org.jsefa.common.validator,
+ org.jsefa.common.validator.provider,
+ org.jsefa.common.converter.provider,
+ org.jsefa.common.mapping",
+ org.jsefa.common.config;
+ uses:="org.jsefa.common.accessor,
+ org.jsefa.common.validator.provider,
+ org.jsefa.common.converter.provider,
+ org.jsefa.common.util,
+ org.jsefa.common.mapping",
+ org.jsefa.common.converter;uses:="javax.xml.datatype",
+ org.jsefa.common.converter.provider;uses:="org.jsefa.common.converter",
org.jsefa.common.lowlevel,
org.jsefa.common.lowlevel.config,
org.jsefa.common.lowlevel.filter,
- org.jsefa.common.lowlevel.io,
- org.jsefa.common.mapping,
+ org.jsefa.common.lowlevel.io;uses:="org.jsefa.common.lowlevel",
+ org.jsefa.common.mapping;uses:="org.jsefa.common.accessor,org.jsefa.common.converter,org.jsefa.common.validator",
org.jsefa.common.util,
- org.jsefa.common.validator,
- org.jsefa.common.validator.provider,
- org.jsefa.common.validator.traversal,
- org.jsefa.csv,
- org.jsefa.csv.annotation,
- org.jsefa.csv.config,
- org.jsefa.csv.lowlevel,
- org.jsefa.csv.lowlevel.config,
- org.jsefa.csv.mapping,
- org.jsefa.flr,
- org.jsefa.flr.annotation,
- org.jsefa.flr.config,
- org.jsefa.flr.lowlevel,
- org.jsefa.flr.lowlevel.config,
- org.jsefa.flr.mapping,
- org.jsefa.rbf,
- org.jsefa.rbf.annotation,
- org.jsefa.rbf.config,
- org.jsefa.rbf.lowlevel,
- org.jsefa.rbf.lowlevel.config,
- org.jsefa.rbf.mapping,
- org.jsefa.xml,
- org.jsefa.xml.annotation,
- org.jsefa.xml.config,
- org.jsefa.xml.lowlevel,
- org.jsefa.xml.lowlevel.config,
- org.jsefa.xml.lowlevel.model,
- org.jsefa.xml.mapping,
- org.jsefa.xml.mapping.support,
+ org.jsefa.common.validator;uses:="org.jsefa.common.converter,org.jsefa",
+ org.jsefa.common.validator.provider;uses:="org.jsefa.common.validator",
+ org.jsefa.common.validator.traversal;uses:="org.jsefa.common.accessor,org.jsefa.common.validator,org.jsefa.common.mapping",
+ org.jsefa.csv;
+ uses:="org.jsefa.common.config,
+ org.jsefa,
+ org.jsefa.rbf,
+ org.jsefa.rbf.mapping,
+ org.jsefa.rbf.lowlevel,
+ org.jsefa.csv.lowlevel,
+ org.jsefa.csv.config,
+ org.jsefa.common.mapping",
+ org.jsefa.csv.annotation;
+ uses:="org.jsefa.common.annotation,
+ org.jsefa.rbf.annotation,
+ org.jsefa.common.mapping,
+ org.jsefa.common.accessor,
+ org.jsefa.common.converter,
+ org.jsefa.common.validator.provider,
+ org.jsefa.rbf.mapping,
+ org.jsefa.csv.lowlevel.config,
+ org.jsefa.common.converter.provider",
+ org.jsefa.csv.config;
+ uses:="org.jsefa.common.config,
+ org.jsefa.csv.lowlevel.config,
+ org.jsefa.rbf.config,
+ org.jsefa.rbf.lowlevel.config",
+ org.jsefa.csv.lowlevel;uses:="org.jsefa.csv.lowlevel.config,org.jsefa.rbf.lowlevel,org.jsefa.common.lowlevel",
+ org.jsefa.csv.lowlevel.config;uses:="org.jsefa.common.lowlevel.config,org.jsefa.rbf.lowlevel.config",
+ org.jsefa.csv.mapping;uses:="org.jsefa.common.converter,org.jsefa.csv.lowlevel.config,org.jsefa.common.mapping",
+ org.jsefa.flr;
+ uses:="org.jsefa.common.config,
+ org.jsefa.flr.lowlevel,
+ org.jsefa,
+ org.jsefa.rbf,
+ org.jsefa.rbf.mapping,
+ org.jsefa.flr.config,
+ org.jsefa.rbf.lowlevel,
+ org.jsefa.common.mapping",
+ org.jsefa.flr.annotation;
+ uses:="org.jsefa.common.annotation,
+ org.jsefa.rbf.annotation,
+ org.jsefa.common.mapping,
+ org.jsefa.common.accessor,
+ org.jsefa.common.converter,
+ org.jsefa.flr.lowlevel,
+ org.jsefa.common.validator.provider,
+ org.jsefa.rbf.mapping,
+ org.jsefa.common.converter.provider",
+ org.jsefa.flr.config;
+ uses:="org.jsefa.common.config,
+ org.jsefa.flr.lowlevel.config,
+ org.jsefa.rbf.config,
+ org.jsefa.rbf.lowlevel.config",
+ org.jsefa.flr.lowlevel;uses:="org.jsefa.flr.lowlevel.config,org.jsefa.rbf.lowlevel,org.jsefa.common.lowlevel",
+ org.jsefa.flr.lowlevel.config;uses:="org.jsefa.common.lowlevel.config,org.jsefa.rbf.lowlevel.config",
+ org.jsefa.flr.mapping;uses:="org.jsefa.common.converter,org.jsefa.flr.lowlevel,org.jsefa.common.mapping",
+ org.jsefa.rbf;
+ uses:="org.jsefa.common.config,
+ org.jsefa,
+ org.jsefa.rbf.mapping,
+ org.jsefa.rbf.config,
+ org.jsefa.rbf.lowlevel,
+ org.jsefa.common.lowlevel,
+ org.jsefa.common.mapping",
+ org.jsefa.rbf.annotation;
+ uses:="org.jsefa.common.accessor,
+ org.jsefa.common.converter,
+ org.jsefa.common.annotation,
+ org.jsefa.common.validator.provider,
+ org.jsefa.rbf.mapping,
+ org.jsefa.common.converter.provider,
+ org.jsefa.common.mapping",
+ org.jsefa.rbf.config;
+ uses:="org.jsefa.common.config,
+ org.jsefa.rbf.mapping,
+ org.jsefa.rbf.lowlevel.config,
+ org.jsefa.common.lowlevel.filter,
+ org.jsefa.common.mapping",
+ org.jsefa.rbf.lowlevel;uses:="org.jsefa.common.lowlevel.io,org.jsefa.rbf.lowlevel.config,org.jsefa.common.lowlevel",
+ org.jsefa.rbf.lowlevel.config;uses:="org.jsefa.common.lowlevel.config,org.jsefa.common.lowlevel.filter",
+ org.jsefa.rbf.mapping;uses:="org.jsefa.common.accessor,org.jsefa.common.validator,org.jsefa.common.mapping",
+ org.jsefa.xml;
+ uses:="org.jsefa.xml.lowlevel,
+ org.jsefa,
+ org.jsefa.common.lowlevel,
+ org.jsefa.xml.config",
+ org.jsefa.xml.annotation;
+ uses:="org.jsefa.common.accessor,
+ org.jsefa.xml.namespace,
+ org.jsefa.xml.lowlevel,
+ org.jsefa.common.annotation,
+ org.jsefa.common.validator.provider,
+ org.jsefa.xml.mapping.support,
+ org.jsefa.xml.mapping,
+ org.jsefa.common.converter.provider",
+ org.jsefa.xml.config;
+ uses:="org.jsefa.xml.namespace,
+ org.jsefa.common.config,
+ org.jsefa.xml.lowlevel.config,
+ org.jsefa.xml.mapping.support,
+ org.jsefa.xml.mapping,
+ org.jsefa.common.util,
+ org.jsefa.common.mapping",
+ org.jsefa.xml.lowlevel;
+ uses:="org.jsefa.xml.namespace,
+ org.jsefa.xml.lowlevel.config,
+ org.jsefa.xml.lowlevel.model,
+ org.jsefa.common.lowlevel",
+ org.jsefa.xml.lowlevel.config;uses:="org.jsefa.xml.namespace,org.jsefa.common.lowlevel.config,org.jsefa.common.util",
+ org.jsefa.xml.lowlevel.model;uses:="org.jsefa.xml.namespace",
+ org.jsefa.xml.mapping;
+ uses:="org.jsefa.common.accessor,
+ org.jsefa.xml.namespace,
+ org.jsefa.common.converter,
+ org.jsefa.common.validator,
+ org.jsefa.xml.lowlevel,
+ org.jsefa.common.mapping",
+ org.jsefa.xml.mapping.support;uses:="org.jsefa.xml.namespace",
org.jsefa.xml.namespace
Bundle-ClassPath: lib/jcommon-1.0.16.jar,
lib/jcommon-1.0.17.jar,
@@ -167,5 +550,8 @@ Bundle-ClassPath: lib/jcommon-1.0.16.jar,
.,
lib/commons-csv-1.0.jar,
lib/jsefa-1.0.0.RELEASE.jar,
- lib/log4j-1.2.17.jar
+ lib/log4j-1.2.17.jar,
+ lib/eclipse-collections-10.0.0.jar,
+ lib/eclipse-collections-api-10.0.0.jar,
+ lib/j2html-1.4.0.jar
Automatic-Module-Name: O3SMeasures
diff --git a/build.properties b/build.properties
index dbec856..cc0f3b5 100644
--- a/build.properties
+++ b/build.properties
@@ -16,7 +16,10 @@ bin.includes = plugin.xml,\
log4j.properties,\
src/,\
OSGI-INF/,\
- .classpath
+ .classpath,\
+ lib/eclipse-collections-10.0.0.jar,\
+ lib/eclipse-collections-api-10.0.0.jar,\
+ lib/j2html-1.4.0.jar
jars.compile.order = .
jars.extra.classpath = lib/commons-csv-1.0.jar,\
lib/jcommon-1.0.16.jar,\
@@ -24,5 +27,8 @@ jars.extra.classpath = lib/commons-csv-1.0.jar,\
lib/jfreechart-1.0.14-swt.jar,\
lib/jfreechart-1.0.14.jar,\
lib/jsefa-1.0.0.RELEASE.jar,\
- lib/log4j-1.2.17.jar
+ lib/log4j-1.2.17.jar,\
+ lib/eclipse-collections-10.0.0.jar,\
+ lib/eclipse-collections-api-10.0.0.jar,\
+ lib/j2html-1.4.0.jar
src.includes = bin/
diff --git a/lib/eclipse-collections-api-10.0.0.jar b/lib/eclipse-collections-api-10.0.0.jar
new file mode 100644
index 0000000..38c4c5a
Binary files /dev/null and b/lib/eclipse-collections-api-10.0.0.jar differ
diff --git a/lib/j2html-1.4.0.jar b/lib/j2html-1.4.0.jar
new file mode 100644
index 0000000..7fba87c
Binary files /dev/null and b/lib/j2html-1.4.0.jar differ
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/ClassVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/ClassVisitor.java
index 16f75ae..5c80470 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/ClassVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/ClassVisitor.java
@@ -8,8 +8,8 @@
import org.eclipse.jdt.core.dom.TypeDeclaration;
/**
- * A visitor for abstract syntax trees, that visits the given
- * node to perform the calculation of the number of classes.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the number of classes
*
* @see ASTVisitor
*
@@ -53,8 +53,7 @@ public boolean visit(CompilationUnit unit) {
}
/**
- * Method that calculates the number of classes of
- * a specific project.
+ * Method that calculates the number of classes of a specific project
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -84,23 +83,21 @@ private void calculateNumberOfClasses(CompilationUnit unit) {
}
/**
- * Method to get the number of project classes. This method is
- * used to other measures to calculate the average value per class
- * of all measures in the plug-in.
+ * Method to get the number of project classes. This method is used to other measures
+ * to calculate the average value per class of all measures in the plug-in
*
* @author Mariana Azevedo
* @since 13/07/2014
*
- * @return static int
+ * @return int
*/
public static int getNumOfProjectClasses() {
return numOfProjectClasses;
}
/**
- * Method to set the number of project classes. This method is
- * used to other measures to calculate the average value per class
- * of all measures in the plug-in.
+ * Method to set the number of project classes. This method is used to other measures
+ * to calculate the average value per class of all measures in the plug-in
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -122,7 +119,7 @@ public int getNumOfClasses() {
}
/**
- * Method that clean the variable to calculate Number of Classes value.
+ * Method that clean the variable to calculate Number of Classes value
*
* @author Mariana Azevedo
* @since 13/07/2014
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/CouplingBetweenObjectsVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/CouplingBetweenObjectsVisitor.java
index 96dbe26..e0277a2 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/CouplingBetweenObjectsVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/CouplingBetweenObjectsVisitor.java
@@ -14,9 +14,8 @@
import org.eclipse.jdt.core.dom.TypeDeclaration;
/**
- * A visitor for abstract syntax trees, that visits the given
- * node to perform the calculation of the CBO (Coupling between
- * Objects) measure.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the CBO (Coupling between Objects) measure
*
* @see ASTVisitor
*
@@ -62,8 +61,7 @@ public boolean visit(CompilationUnit node) {
}
/**
- * Method that calculates the number of classes of
- * a specific project.
+ * Method that calculates the number of classes of a specific project
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -99,8 +97,7 @@ private void checkMethodStatements(MethodDeclaration method, Block firstMethodBo
}
/**
- * Method that verify how many times a method is referenced
- * by another method body declaration
+ * Method that verify how many times a method is referenced by another method body declaration
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -134,7 +131,7 @@ public void addListOfTypes(IType[] types){
}
/**
- * Method that clean the array used to calculate CBO value.
+ * Method that clean the array used to calculate CBO value
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -150,9 +147,9 @@ public void cleanArrayAndVariable(){
* @author Mariana Azevedo
* @since 13/07/2014
*
- * @return Double
+ * @return double
*/
- public Double getCouplingBetweenObjectsIndex(){
+ public double getCouplingBetweenObjectsIndex(){
return Double.valueOf(iTypeList.length) + Double.valueOf(numCalls);
}
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/CyclomaticComplexityVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/CyclomaticComplexityVisitor.java
index 2ed1349..9ff6e17 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/CyclomaticComplexityVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/CyclomaticComplexityVisitor.java
@@ -1,7 +1,6 @@
package io.github.mariazevedo88.o3smeasures.astvisitors;
import java.math.BigDecimal;
-import java.math.MathContext;
import java.math.RoundingMode;
import org.eclipse.jdt.core.dom.ASTVisitor;
@@ -27,9 +26,8 @@
import org.eclipse.jdt.core.dom.WhileStatement;
/**
- * A visitor for abstract syntax trees, that visits the given node
- * to perform the calculation of the CC (Cyclomatic Complexity)
- * measure, excluding getters and setters invocation.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the CC (Cyclomatic Complexity) measure, excluding getters and setters invocation
*
* @see ASTVisitor
*
@@ -40,10 +38,9 @@ public class CyclomaticComplexityVisitor extends ASTVisitor{
private static CyclomaticComplexityVisitor instance;
- private Double cyclomaticComplexityIndex;
- private Double sumCyclomaticComplexity;
+ private double cyclomaticComplexityIndex;
+ private double sumCyclomaticComplexity;
private boolean isFirstVisitingPerMethod;
-
private String methodName;
public CyclomaticComplexityVisitor(){
@@ -206,7 +203,7 @@ public boolean visit(ExpressionStatement node) {
}
/**
- * McCabe CC is computed as method level.
+ * McCabe CC is computed as method level
* @see ASTVisitor#visit(AnonymousClassDeclaration)
*/
@Override
@@ -215,7 +212,7 @@ public boolean visit(AnonymousClassDeclaration node) {
}
/**
- * McCabe CC is computed as method level.
+ * McCabe CC is computed as method level
* @see ASTVisitor#visit(AnnotationTypeDeclaration)
*/
@Override
@@ -224,7 +221,7 @@ public boolean visit(AnnotationTypeDeclaration node) {
}
/**
- * McCabe CC is computed as method level.
+ * McCabe CC is computed as method level
* @see ASTVisitor#visit(EnumDeclaration)
*/
@Override
@@ -324,7 +321,7 @@ private void inspectExpression(Expression exprs) {
/**
* Method that returns the cyclomatic complexity index in a class. For a single routine
- * in the method, cyclomaticComplexityIndex is always equal to 1.
+ * in the method, cyclomaticComplexityIndex is always equal to 1
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -333,11 +330,11 @@ private void inspectExpression(Expression exprs) {
*/
public double getCyclomaticComplexityIndex(){
if(cyclomaticComplexityIndex == 0d) cyclomaticComplexityIndex++;
- return new BigDecimal(cyclomaticComplexityIndex, new MathContext(2, RoundingMode.UP)).doubleValue();
+ return BigDecimal.valueOf(this.cyclomaticComplexityIndex).setScale(2, RoundingMode.UP).doubleValue();
}
/**
- * Method that clean all the variables used to calculate CC value.
+ * Method that clean all the variables used to calculate CC value
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -350,7 +347,7 @@ public void cleanVariables(){
/**
* Method that returns the sum of all complexities. For a single routine
- * in the method, sumCyclomaticComplexity is always equal to 1.
+ * in the method, sumCyclomaticComplexity is always equal to 1
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -363,7 +360,7 @@ public double getAllCyclomaticComplexity() {
}
/**
- * Method to set the name of the method evaluated.
+ * Method to set the name of the method evaluated
*
* @author Mariana Azevedo
* @since 06/07/2019
@@ -376,12 +373,12 @@ public void setMethodName(String methodName) {
/**
* Method to check whether the evaluated Statement is of the
- * same builder method or is of a class.
+ * same builder method or is of a class
*
* @author Mariana Azevedo
* @since 06/07/2019
*
- * @param node
+ * @param node - Statement
*
* @return boolean
*/
@@ -396,12 +393,12 @@ private boolean isSameMethod(Statement node) {
/**
* Method to check whether the evaluated CatchClause is of the
- * same builder method or is of a class.
+ * same builder method or is of a class
*
* @author Mariana Azevedo
* @since 06/07/2019
*
- * @param node
+ * @param node - CatchClause
*
* @return boolean
*/
@@ -416,12 +413,12 @@ private boolean isSameMethod(CatchClause node) {
/**
* Method to check whether the evaluated expression is of the
- * same builder method or is of a class.
+ * same builder method or is of a class
*
* @author Mariana Azevedo
* @since 06/07/2019
*
- * @param node
+ * @param node - Expression
*
* @return boolean
*/
@@ -434,7 +431,7 @@ private boolean isSameMethod(Expression node) {
}
/**
- * Method that checks whether a TryStatement has a catch clause.
+ * Method that checks whether a TryStatement has a catch clause
*
* @author Mariana Azevedo
* @since 06/07/2019
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/FanOutVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/FanOutVisitor.java
index 885bdc1..5a86e56 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/FanOutVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/FanOutVisitor.java
@@ -1,18 +1,17 @@
package io.github.mariazevedo88.o3smeasures.astvisitors;
import java.math.BigDecimal;
-import java.math.MathContext;
import java.math.RoundingMode;
-import java.util.ArrayList;
-import java.util.List;
+import org.eclipse.collections.api.list.MutableList;
+import org.eclipse.collections.impl.factory.Lists;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.TypeDeclaration;
/**
- * A visitor for abstract syntax trees, that visits the given node
- * to perform the calculation of the FOUT (Fan-out) measure.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the FOUT (Fan-out) measure
*
* @see ASTVisitor
*
@@ -21,12 +20,12 @@
*/
public class FanOutVisitor extends ASTVisitor{
- private List typesList;
+ private MutableList typesList;
private static FanOutVisitor instance;
public FanOutVisitor(){
super();
- typesList = new ArrayList<>();
+ typesList = Lists.mutable.empty();
}
/**
@@ -54,8 +53,7 @@ public boolean visit(CompilationUnit node) {
}
/**
- * Method to calculate FOUT checking the number of types
- * the class references.
+ * Method to calculate FOUT checking the number of types the class references
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -71,25 +69,25 @@ private void calculateFanOut(CompilationUnit unit){
}
/**
- * Method that clean the array used to calculate FOUT value.
+ * Method that clean the array used to calculate FOUT value
*
* @author Mariana Azevedo
* @since 13/07/2014
*/
public void cleanArray(){
- this.typesList = new ArrayList<>();
+ this.typesList = Lists.mutable.empty();
}
/**
- * Method to get the FOUT value for a class.
+ * Method to get the FOUT value for a class
*
* @author Mariana Azevedo
* @since 13/07/2014
*
- * @return Double
+ * @return double
*/
- public Double getFanOutValue(){
+ public double getFanOutValue(){
int value = typesList.size();
- return new BigDecimal(value, new MathContext(2, RoundingMode.UP)).doubleValue();
+ return BigDecimal.valueOf(value).setScale(2, RoundingMode.UP).doubleValue();
}
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/InterfaceVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/InterfaceVisitor.java
index 9e2582f..1eba118 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/InterfaceVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/InterfaceVisitor.java
@@ -5,8 +5,8 @@
import org.eclipse.jdt.core.dom.TypeDeclaration;
/**
- * A visitor for abstract syntax trees, that visits the given node to perform
- * the calculation of the number of interfaces.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the number of interfaces
*
* @see ASTVisitor
*
@@ -16,7 +16,6 @@
public class InterfaceVisitor extends ASTVisitor {
private double numberOfInterfaces;
-
private static InterfaceVisitor instance;
public InterfaceVisitor(){
@@ -50,7 +49,7 @@ public boolean visit(TypeDeclaration unit) {
}
/**
- * Method that returns the number of interfaces of a project.
+ * Method that returns the number of interfaces of a project
*
* @author Mariana Azevedo
* @since 05/10/2019
@@ -62,7 +61,7 @@ public double getNumberOfInterfaces() {
}
/**
- * Method that clean the variable to calculate Number of Interfaces value.
+ * Method that clean the variable to calculate Number of Interfaces value
*
* @author Mariana Azevedo
* @since 05/10/2019
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/LambdaVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/LambdaVisitor.java
index cf9b0ab..6848291 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/LambdaVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/LambdaVisitor.java
@@ -1,18 +1,17 @@
package io.github.mariazevedo88.o3smeasures.astvisitors;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
+import org.eclipse.collections.api.factory.Lists;
+import org.eclipse.collections.api.factory.Maps;
+import org.eclipse.collections.api.list.MutableList;
+import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.Expression;
import org.eclipse.jdt.core.dom.LambdaExpression;
/**
- * A visitor for abstract syntax trees, that visits the given node to perform
- * the calculation of the number of lambda expressions.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the number of lambda expressions
*
* @see ASTVisitor
*
@@ -22,12 +21,11 @@
public class LambdaVisitor extends ASTVisitor{
private static LambdaVisitor instance;
-
- private Map> expressionsMap;
+ private MutableMap> expressionsMap;
public LambdaVisitor(){
super();
- this.expressionsMap = new HashMap<>();
+ this.expressionsMap = Maps.mutable.empty();
}
/**
@@ -55,8 +53,8 @@ public boolean visit(LambdaExpression node) {
}
/**
- * Method to check whether the evaluated expression is of the
- * same builder method or is of a class.
+ * Method to check whether the evaluated expression is of the same builder
+ * method or is of a class
*
* @author Mariana Azevedo
* @since 05/10/2019
@@ -67,10 +65,10 @@ public boolean visit(LambdaExpression node) {
private boolean calculateNumberOfLambdas(Expression node) {
String lambdaClassName = ((CompilationUnit) node.getRoot()).getJavaElement().getElementName();
if(!expressionsMap.containsKey(lambdaClassName)) {
- expressionsMap.put(lambdaClassName, new ArrayList<>());
+ expressionsMap.put(lambdaClassName, Lists.mutable.empty());
}
- List expressionsList = expressionsMap.get(lambdaClassName);
+ MutableList expressionsList = expressionsMap.get(lambdaClassName);
if(!expressionsList.contains(node.toString())) {
expressionsList.add(node.toString());
return false;
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/LinesOfCodeVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/LinesOfCodeVisitor.java
index b027445..9ad361c 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/LinesOfCodeVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/LinesOfCodeVisitor.java
@@ -1,7 +1,6 @@
package io.github.mariazevedo88.o3smeasures.astvisitors;
import java.math.BigDecimal;
-import java.math.MathContext;
import java.math.RoundingMode;
import java.util.List;
@@ -10,8 +9,8 @@
import org.eclipse.jdt.core.dom.CompilationUnit;
/**
- * A visitor for abstract syntax trees, that visits the given node
- * to perform the calculation of the LOC (Lines of Code) measure.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the LOC (Lines of Code) measure
*
* @see ASTVisitor
*
@@ -20,7 +19,7 @@
*/
public class LinesOfCodeVisitor extends ASTVisitor{
- private Double numberOfLinesOfCode;
+ private double numberOfLinesOfCode;
private static LinesOfCodeVisitor instance;
public LinesOfCodeVisitor(){
@@ -58,19 +57,19 @@ public boolean visit(CompilationUnit unit) {
}
/**
- * Method to get the number of lines for a class.
+ * Method to get the number of lines for a class
*
* @author Mariana Azevedo
* @since 13/07/2014
*
- * @return Double
+ * @return double
*/
- public Double getNumberOfLinesOfCode(){
- return new BigDecimal(this.numberOfLinesOfCode, new MathContext(2, RoundingMode.UP)).doubleValue();
+ public double getNumberOfLinesOfCode(){
+ return BigDecimal.valueOf(this.numberOfLinesOfCode).setScale(2, RoundingMode.UP).doubleValue();
}
/**
- * Method that clean the variable used to calculate LOC value.
+ * Method that clean the variable used to calculate LOC value
*
* @author Mariana Azevedo
* @since 13/07/2014
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/LooseClassCohesionVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/LooseClassCohesionVisitor.java
index feb202a..fea2e4d 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/LooseClassCohesionVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/LooseClassCohesionVisitor.java
@@ -3,10 +3,11 @@
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
-import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.collections.api.factory.Lists;
+import org.eclipse.collections.api.list.MutableList;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.Block;
import org.eclipse.jdt.core.dom.CompilationUnit;
@@ -17,9 +18,8 @@
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
/**
- * A visitor for abstract syntax trees, that visits the given node
- * to perform the calculation of the LCC (Loose Class Cohesion)
- * measure.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the LCC (Loose Class Cohesion) measure
*
* @see ASTVisitor
*
@@ -28,18 +28,18 @@
*/
public class LooseClassCohesionVisitor extends ASTVisitor{
- private List listOfMethods;
- private List listOfAttributes;
- private Double numDirectConnections;
- private Double numIndirectConnections;
+ private MutableList listOfMethods;
+ private MutableList listOfAttributes;
+ private double numDirectConnections;
+ private double numIndirectConnections;
private static LooseClassCohesionVisitor instance;
public LooseClassCohesionVisitor(){
super();
- listOfMethods = new ArrayList<>();
- listOfAttributes = new ArrayList<>();
numDirectConnections = 0d;
numIndirectConnections = 0d;
+ listOfMethods = Lists.mutable.empty();
+ listOfAttributes = Lists.mutable.empty();
}
/**
@@ -62,21 +62,18 @@ public static LooseClassCohesionVisitor getInstance(){
*/
@Override
public boolean visit(CompilationUnit node) {
-
getClassAttributes(node);
-
calculateNumberOfMethods(node);
-
return false;
}
/**
- * Method to get all attributes or fields of a class.
+ * Method to get all attributes or fields of a class
*
* @author Mariana Azevedo
* @since 13/07/2014
*
- * @param node
+ * @param node - CompilationUnit
*/
@SuppressWarnings("unchecked")
private void getClassAttributes(CompilationUnit node){
@@ -100,16 +97,16 @@ private void getClassAttributes(CompilationUnit node){
/**
* Method to calculate the number of methods of a class and set lists
- * of methods with direct connections and method with indirect connections.
+ * of methods with direct connections and method with indirect connections
*
* @author Mariana Azevedo
* @since 13/07/2014
*
- * @param unit
+ * @param unit - CompilationUnit
*/
private void calculateNumberOfMethods(CompilationUnit unit){
- List methodsWithDirectConn = new ArrayList<>();
+ MutableList methodsWithDirectConn = Lists.mutable.empty();
for (Object type : unit.types()){
if (type instanceof TypeDeclaration){
@@ -123,15 +120,13 @@ private void calculateNumberOfMethods(CompilationUnit unit){
}
Iterator itMethods = this.listOfMethods.iterator();
-
methodsWithDirectConn = getNumberOfDirectConnections(methodsWithDirectConn, itMethods);
-
getNumberOfIndirectConnections(methodsWithDirectConn, itMethods);
}
/**
- * Method to get the number of methods with direct connections.
+ * Method to get the number of methods with direct connections
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -141,7 +136,7 @@ private void calculateNumberOfMethods(CompilationUnit unit){
*
* @return List
*/
- private List getNumberOfDirectConnections(List methodsWithDirectConn,
+ private MutableList getNumberOfDirectConnections(MutableList methodsWithDirectConn,
Iterator itMethods) {
while (itMethods.hasNext()){
@@ -168,7 +163,7 @@ private List getNumberOfDirectConnections(List methodsWithD
}
/**
- * Method to calculate the LCC value.
+ * Method to calculate the LCC value
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -215,7 +210,7 @@ private double calculateNP(){
}
/**
- * Method to get the LCC value.
+ * Method to get the LCC value
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -225,6 +220,7 @@ private double calculateNP(){
public double getLCCIndex(){
double np = calculateNP();
double lccValue = 0d;
+
if (np != 0d){
Double value = (numDirectConnections + numIndirectConnections)/np;
lccValue = new BigDecimal(value, new MathContext(3, RoundingMode.UP)).doubleValue();
@@ -234,7 +230,7 @@ public double getLCCIndex(){
}
/**
- * Method that clean the variable used to calculate LCC value.
+ * Method that clean the variable used to calculate LCC value
*
* @author Mariana Azevedo
* @since 13/07/2014
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/MartinMeasuresVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/MartinMeasuresVisitor.java
index 052ad72..687609f 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/MartinMeasuresVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/MartinMeasuresVisitor.java
@@ -1,8 +1,7 @@
package io.github.mariazevedo88.o3smeasures.astvisitors;
-import java.util.HashMap;
-import java.util.Map;
-
+import org.eclipse.collections.api.factory.Maps;
+import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.dom.ASTVisitor;
@@ -15,7 +14,7 @@
/**
* A visitor for abstract syntax trees that implements Robert Martin's coupling measures
* calculation: Abstractness, Instability, Afferent Coupling, Efferent Coupling, and
- * Distance from the Main Sequence.
+ * Distance from the Main Sequence
*
* @see ASTVisitor
*
@@ -25,24 +24,21 @@
public class MartinMeasuresVisitor extends ASTVisitor {
private static MartinMeasuresVisitor instance;
-
private double abstractnessIndex;
private double efferentIndex;
private double afferentIndex;
+ private double numberOfTypes;
- private Map afferentClasses;
+ private MutableMap afferentClasses;
private IType[] allTypes;
-
- private double numberOfTypes;
public MartinMeasuresVisitor(){
super();
this.abstractnessIndex = 0d;
this.efferentIndex = 0d;
this.afferentIndex = 0d;
- this.afferentClasses = new HashMap<>();
-
this.numberOfTypes = 0d;
+ this.afferentClasses = Maps.mutable.empty();
}
/**
@@ -90,6 +86,7 @@ public boolean visit(TypeDeclaration unit) {
private void calculateAbstractness(TypeDeclaration unit) {
if(allTypes != null) {
numberOfTypes += allTypes.length;
+
if(unit.isInterface()) {
abstractnessIndex++;
} else {
@@ -98,6 +95,7 @@ private void calculateAbstractness(TypeDeclaration unit) {
abstractnessIndex++;
}
}
+
}
}
@@ -158,11 +156,13 @@ private void calculateEfferentCoupling(CompilationUnit unit) {
private void calculateCouplins(String name, String simpleName, String importName, int afferentCouplingIndex) {
if(!importName.contains(name)) {
efferentIndex++;
+
if(afferentClasses.get(simpleName) != null) {
afferentCouplingIndex = afferentClasses.get(simpleName) + 1;
}else {
afferentCouplingIndex++;
}
+
afferentClasses.put(simpleName, afferentCouplingIndex);
}
}
@@ -254,5 +254,4 @@ public void cleanVariables(){
this.numberOfTypes = 0d;
this.allTypes = null;
}
-
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfAttributesVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfAttributesVisitor.java
index dfa5d8d..cfd6ae5 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfAttributesVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfAttributesVisitor.java
@@ -1,16 +1,14 @@
package io.github.mariazevedo88.o3smeasures.astvisitors;
import java.math.BigDecimal;
-import java.math.MathContext;
import java.math.RoundingMode;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.FieldDeclaration;
/**
- * A visitor for abstract syntax trees, that visits the given node
- * to perform the calculation of the NOA (Number of Attributes)
- * measure.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the NOA (Number of Attributes) measure
*
* @see ASTVisitor
*
@@ -19,7 +17,7 @@
*/
public class NumberOfAttributesVisitor extends ASTVisitor{
- private Double numberOfAttributes;
+ private double numberOfAttributes;
private static NumberOfAttributesVisitor instance;
public NumberOfAttributesVisitor(){
@@ -52,19 +50,19 @@ public boolean visit(FieldDeclaration variable) {
}
/**
- * Method to get the number of attributes or fields in a class.
+ * Method to get the number of attributes or fields in a class
*
* @author Mariana Azevedo
* @since 13/07/2014
*
- * @return Double
+ * @return double
*/
- public Double getNumberOfAttributes(){
- return new BigDecimal(numberOfAttributes, new MathContext(2, RoundingMode.UP)).doubleValue();
+ public double getNumberOfAttributes(){
+ return BigDecimal.valueOf(this.numberOfAttributes).setScale(2, RoundingMode.UP).doubleValue();
}
/**
- * Method that clean the variable used to calculate NOA value.
+ * Method that clean the variable used to calculate NOA value
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -72,5 +70,4 @@ public Double getNumberOfAttributes(){
public void cleanVariable(){
this.numberOfAttributes = 0d;
}
-
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfMethodReferenceVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfMethodReferenceVisitor.java
index 75e4784..8da187d 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfMethodReferenceVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfMethodReferenceVisitor.java
@@ -1,33 +1,30 @@
package io.github.mariazevedo88.o3smeasures.astvisitors;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
+import org.eclipse.collections.api.factory.Lists;
+import org.eclipse.collections.api.factory.Maps;
+import org.eclipse.collections.api.list.MutableList;
+import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.Expression;
import org.eclipse.jdt.core.dom.ExpressionMethodReference;
-public class NumberOfMethodReferenceVisitor extends ASTVisitor {
-
/**
- * A visitor for abstract syntax trees that implements the number of
- * method reference calculation.
+ * A visitor for abstract syntax trees that implements the number of method reference calculation
*
* @see ASTVisitor
*
* @author Mariana Azevedo
* @since 29/09/2019
*/
-private static NumberOfMethodReferenceVisitor instance;
-
- private Map> referencesMap;
+public class NumberOfMethodReferenceVisitor extends ASTVisitor {
+
+ private static NumberOfMethodReferenceVisitor instance;
+ private MutableMap> referencesMap;
public NumberOfMethodReferenceVisitor(){
super();
- this.referencesMap = new HashMap<>();
+ this.referencesMap = Maps.mutable.empty();
}
/**
@@ -55,8 +52,7 @@ public boolean visit(ExpressionMethodReference node) {
}
/**
- * Method to check whether the evaluated expression is of the
- * same builder method or is of a class.
+ * Method to check whether the evaluated expression is of the same builder method or is of a class
*
* @author Mariana Azevedo
* @since 05/10/2019
@@ -67,15 +63,15 @@ public boolean visit(ExpressionMethodReference node) {
private boolean calculateNumberOfMethodRef(Expression node) {
String methodClassName = ((CompilationUnit) node.getRoot()).getJavaElement().getElementName();
if(!referencesMap.containsKey(methodClassName)) {
- referencesMap.put(methodClassName, new ArrayList<>());
+ referencesMap.put(methodClassName, Lists.mutable.empty());
}
- List referencesList = referencesMap.get(methodClassName);
+ MutableList referencesList = referencesMap.get(methodClassName);
if(!referencesList.contains(node.toString())) {
referencesList.add(node.toString());
return false;
}
-
+
return true;
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfMethodsVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfMethodsVisitor.java
index 88ab401..ed5c9e4 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfMethodsVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfMethodsVisitor.java
@@ -3,17 +3,17 @@
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
-import java.util.ArrayList;
-import java.util.List;
+import org.eclipse.collections.api.factory.Lists;
+import org.eclipse.collections.api.list.MutableList;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.TypeDeclaration;
/**
- * A visitor for abstract syntax trees, that visits the given node
- * to perform the calculation of the NOM (Number of Methods) measure.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the NOM (Number of Methods) measure
*
* @see ASTVisitor
*
@@ -22,12 +22,12 @@
*/
public class NumberOfMethodsVisitor extends ASTVisitor{
- private List methodsList;
+ private MutableList methodsList;
private static NumberOfMethodsVisitor instance;
public NumberOfMethodsVisitor(){
super();
- methodsList = new ArrayList<>();
+ methodsList = Lists.mutable.empty();
}
/**
@@ -55,7 +55,7 @@ public boolean visit(CompilationUnit unit) {
}
/**
- * Method to calculate the number of methods in a class.
+ * Method to calculate the number of methods in a class
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -76,15 +76,15 @@ private void calculateNumberOfMethods(CompilationUnit unit){
}
/**
- * Method to get the number of methods in a class.
+ * Method to get the number of methods in a class
*
* @author Mariana Azevedo
* @since 13/07/2014
*
- * @return Double
+ * @return double
*/
- public Double getNumberOfMethods(){
- return new BigDecimal(methodsList.size(), new MathContext(2, RoundingMode.UP)).doubleValue();
+ public double getNumberOfMethods(){
+ return new BigDecimal(this.methodsList.size(), new MathContext(2, RoundingMode.UP)).doubleValue();
}
/**
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfModulesVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfModulesVisitor.java
index aa0a03d..405442d 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfModulesVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/NumberOfModulesVisitor.java
@@ -17,9 +17,7 @@
public class NumberOfModulesVisitor extends ASTVisitor {
private static final Logger logger = Logger.getLogger(NumberOfModulesVisitor.class);
-
private static NumberOfModulesVisitor instance;
-
private double numberOfModules;
public NumberOfModulesVisitor(){
@@ -62,14 +60,14 @@ public boolean visit(CompilationUnit node) {
* @author Mariana Azevedo
* @since 19/10/2019
*
- * @return int
+ * @return double
*/
public double getNumOfModules() {
return numberOfModules;
}
/**
- * Method that clean the variable to calculate number of modules value.
+ * Method that clean the variable to calculate number of modules value
*
* @author Mariana Azevedo
* @since 20/10/2019
@@ -77,5 +75,4 @@ public double getNumOfModules() {
public void cleanVariables(){
this.numberOfModules = 0d;
}
-
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/ResponseForClassVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/ResponseForClassVisitor.java
index c74cdf5..b1ab87c 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/ResponseForClassVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/ResponseForClassVisitor.java
@@ -2,10 +2,11 @@
import java.math.BigDecimal;
import java.math.RoundingMode;
-import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.collections.api.factory.Lists;
+import org.eclipse.collections.api.list.MutableList;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.Block;
@@ -15,9 +16,8 @@
import org.eclipse.jdt.core.dom.TypeDeclaration;
/**
- * A visitor for abstract syntax trees, that visits the given node
- * to perform the calculation of the RFC (Response for a Class)
- * measure.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the RFC (Response for a Class) measure.
*
* @see ASTVisitor
*
@@ -26,17 +26,17 @@
*/
public class ResponseForClassVisitor extends ASTVisitor{
- private List methodsList;
- private double numberMethodCalls;
+ private MutableList methodsList;
private IMethod[] listOfMethodsName;
+ private double numberMethodCalls;
private static int size = 20;
private static ResponseForClassVisitor instance;
public ResponseForClassVisitor(){
super();
- methodsList = new ArrayList<>();
- numberMethodCalls = 0d;
- listOfMethodsName = new IMethod[size];
+ this.numberMethodCalls = 0d;
+ this.methodsList = Lists.mutable.empty();
+ this.listOfMethodsName = new IMethod[size];
}
/**
@@ -65,7 +65,7 @@ public boolean visit(CompilationUnit unit) {
}
/**
- * Method to calculate the number of methods in a class.
+ * Method to calculate the number of methods in a class
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -75,9 +75,7 @@ public boolean visit(CompilationUnit unit) {
private void calculateNumberOfMethods(CompilationUnit unit){
for (Object type :unit.types()){
if (type instanceof TypeDeclaration){
-
MethodDeclaration [] methods = ((TypeDeclaration) type).getMethods();
-
for (MethodDeclaration method: methods){
this.methodsList.add(method);
}
@@ -86,7 +84,7 @@ private void calculateNumberOfMethods(CompilationUnit unit){
}
/**
- * Method to calculate method calls in the method's body.
+ * Method to calculate method calls in the method's body
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -96,29 +94,25 @@ private void calculateMethodCalls(){
Iterator itMethods = methodsList.iterator();
while (itMethods.hasNext()){
-
MethodDeclaration firstMethod = itMethods.next();
Block firstMethodBody = firstMethod.getBody();
if (firstMethodBody != null){
-
List firstMethodStatements = firstMethodBody.statements();
-
if (!firstMethodStatements.isEmpty()){
-
for (IMethod mtd : listOfMethodsName){
-
if (firstMethodStatements.toString().contains(mtd.getElementName())){
numberMethodCalls++;
}
}
}
}
+
}
}
/**
- * Method to add method's declaration in a list.
+ * Method to add method's declaration in a list
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -126,11 +120,11 @@ private void calculateMethodCalls(){
* @param methods
*/
public void addListOfMethodsDeclaration(IMethod [] methods){
- listOfMethodsName = methods;
+ this.listOfMethodsName = methods;
}
/**
- * Method to get the RFC value.
+ * Method to get the RFC value
*
* @author Mariana Azevedo
* @since 13/07/2014
@@ -144,7 +138,7 @@ public Double getResponseForClassValue(){
}
/**
- * Method that clean the variables used to calculate RFC value.
+ * Method that clean the variables used to calculate RFC value
*
* @author Mariana Azevedo
* @since 13/07/2014
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/TightClassCohesionVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/TightClassCohesionVisitor.java
index 673a0d0..d2b8e30 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/TightClassCohesionVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/TightClassCohesionVisitor.java
@@ -2,10 +2,11 @@
import java.math.BigDecimal;
import java.math.RoundingMode;
-import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.collections.api.factory.Lists;
+import org.eclipse.collections.api.list.MutableList;
import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.Block;
import org.eclipse.jdt.core.dom.CompilationUnit;
@@ -15,9 +16,8 @@
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
/**
- * A visitor for abstract syntax trees, that visits the given node
- * to perform the calculation of the TCC (Tight Class Cohesion)
- * measure.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the TCC (Tight Class Cohesion) measure
*
* @see ASTVisitor
*
@@ -26,16 +26,16 @@
*/
public class TightClassCohesionVisitor extends ASTVisitor{
- private List listOfMethods;
- private List listOfAttributes;
+ private MutableList listOfMethods;
+ private MutableList listOfAttributes;
private double numDirectConnections;
private static TightClassCohesionVisitor instance;
public TightClassCohesionVisitor(){
super();
- listOfMethods = new ArrayList<>();
- listOfAttributes = new ArrayList<>();
- numDirectConnections = 0d;
+ this.listOfMethods = Lists.mutable.empty();
+ this.listOfAttributes = Lists.mutable.empty();
+ this.numDirectConnections = 0d;
}
public static TightClassCohesionVisitor getInstance(){
@@ -50,26 +50,23 @@ public static TightClassCohesionVisitor getInstance(){
*/
@Override
public boolean visit(CompilationUnit node) {
-
getClassAttributes(node);
-
calculateNumberOfMethods(node);
-
return false;
}
/**
- * Method to get class attributes and add them in a list.
+ * Method to get class attributes and add them in a list
+ *
* @author Mariana Azevedo
* @since 13/07/2014
+ *
* @param node
*/
@SuppressWarnings("unchecked")
private void getClassAttributes(CompilationUnit node){
-
for (Object type : node.types()){
if (type instanceof TypeDeclaration){
-
FieldDeclaration [] attributes = ((TypeDeclaration) type).getFields();
for (FieldDeclaration attribute: attributes){
@@ -80,24 +77,23 @@ private void getClassAttributes(CompilationUnit node){
this.listOfAttributes.add(str);
}
}
+
}
}
}
/**
- * Method to calculate the number of methods in a class and verify if
- * two methods share attributes.
+ * Method to calculate the number of methods in a class and verify if two methods share attributes
+ *
* @author Mariana Azevedo
* @since 13/07/2014
+ *
* @param unit
*/
private void calculateNumberOfMethods(CompilationUnit unit){
-
for (Object type : unit.types()){
if (type instanceof TypeDeclaration){
-
MethodDeclaration [] methods = ((TypeDeclaration) type).getMethods();
-
for (MethodDeclaration method: methods){
this.listOfMethods.add(method);
}
@@ -107,22 +103,20 @@ private void calculateNumberOfMethods(CompilationUnit unit){
Iterator itMethods = this.listOfMethods.iterator();
while (itMethods.hasNext()){
-
MethodDeclaration firstMethod = itMethods.next();
MethodDeclaration secondMethod = null;
-
if (itMethods.hasNext())
secondMethod = itMethods.next();
-
checkMethodsBody(firstMethod, secondMethod);
}
}
/**
- * Method that check the method's body to detect some
- * connection between them
+ * Method that check the method's body to detect some connection between them
+ *
* @author Mariana Azevedo
* @since 20/01/2016
+ *
* @param firstMethod
* @param secondMethod
*/
@@ -130,9 +124,7 @@ private void checkMethodsBody(MethodDeclaration firstMethod, MethodDeclaration s
if (firstMethod != null && secondMethod != null){
Block firstMethodBody = firstMethod.getBody();
Block secondMethodBody = secondMethod.getBody();
-
if (firstMethodBody != null && secondMethodBody != null){
-
for (String attribute : listOfAttributes){
if (firstMethodBody.toString().contains(attribute) &&
secondMethodBody.toString().contains(attribute)){
@@ -144,32 +136,33 @@ private void checkMethodsBody(MethodDeclaration firstMethod, MethodDeclaration s
}
/**
- * Method to calculate the TCC value.
+ * Method to calculate the TCC value
+ *
* @author Mariana Azevedo
* @since 13/07/2014
+ *
* @return double
*/
private double calculateNP(){
double numMethods = 0d;
-
if (!this.listOfMethods.isEmpty())
numMethods = this.listOfMethods.size();
-
return numMethods * (numMethods-1)/2;
}
/**
- * Method to get the TCC value.
+ * Method to get the TCC value
+ *
* @author Mariana Azevedo
* @since 13/07/2014
- * @return Double
+ *
+ * @return double
*/
- public Double getTCCValue(){
- Double np = calculateNP();
- Double value = 0d;
+ public double getTCCValue(){
+ double np = calculateNP();
+ double value = 0d;
if (np != 0d){
- BigDecimal tccValue = BigDecimal.valueOf(numDirectConnections/np)
- .setScale(3, RoundingMode.UP);
+ BigDecimal tccValue = BigDecimal.valueOf(numDirectConnections/np).setScale(3, RoundingMode.UP);
value = tccValue.doubleValue();
}
return value;
diff --git a/src/io/github/mariazevedo88/o3smeasures/astvisitors/WeightMethodsPerClassVisitor.java b/src/io/github/mariazevedo88/o3smeasures/astvisitors/WeightMethodsPerClassVisitor.java
index 731fa15..1ea3da6 100644
--- a/src/io/github/mariazevedo88/o3smeasures/astvisitors/WeightMethodsPerClassVisitor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/astvisitors/WeightMethodsPerClassVisitor.java
@@ -1,7 +1,6 @@
package io.github.mariazevedo88.o3smeasures.astvisitors;
import java.math.BigDecimal;
-import java.math.MathContext;
import java.math.RoundingMode;
import java.util.Iterator;
import java.util.List;
@@ -26,9 +25,8 @@
import org.eclipse.jdt.core.dom.WhileStatement;
/**
- * A visitor for abstract syntax trees, that visits the given node
- * to perform the calculation of the WMC (Weight Methods per Class)
- * measure.
+ * A visitor for abstract syntax trees, that visits the given node to perform the calculation
+ * of the WMC (Weight Methods per Class) measure
*
* @see ASTVisitor
*
@@ -37,12 +35,11 @@
*/
public class WeightMethodsPerClassVisitor extends ASTVisitor{
- private Double wmcIndex;
+ private double wmcIndex;
+ private String methodName;
private CyclomaticComplexityVisitor visitor;
private static WeightMethodsPerClassVisitor instance;
- private String methodName;
-
public WeightMethodsPerClassVisitor(){
super();
this.wmcIndex = 0d;
@@ -74,18 +71,18 @@ public boolean visit(CompilationUnit node) {
}
/**
- * Method to calculate the sum of the complexities of all class methods.
+ * Method to calculate the sum of the complexities of all class methods
+ *
* @author Mariana Azevedo
* @since 13/07/2014
+ *
* @param node
*/
@SuppressWarnings("unchecked")
private void calculateWeightMethods(CompilationUnit node){
-
for (Object type : node.types()){
-
if ((type instanceof TypeDeclaration)){
-
+
List bodyDeclarationsList = ((TypeDeclaration) type).bodyDeclarations();
Iterator itBodyDeclaration = bodyDeclarationsList.iterator();
@@ -95,6 +92,7 @@ private void calculateWeightMethods(CompilationUnit node){
checkStatementsInMethodsDeclaration(itItem);
}
}
+
this.wmcIndex += this.visitor.getCyclomaticComplexityIndex();
}
}
@@ -102,14 +100,18 @@ private void calculateWeightMethods(CompilationUnit node){
/**
* Method that check statements like try/catch, while, if/else in method's declaration,
- * where weights are unspecified complexity factors.
+ * where weights are unspecified complexity factors
+ *
* @author Mariana Azevedo
* @since 13/07/2014
+ *
* @param itItem
*/
@SuppressWarnings("unchecked")
private void checkStatementsInMethodsDeclaration(Object itItem) {
+
Block block = ((MethodDeclaration) itItem).getBody();
+
if (block != null){
List statementsList = block.statements();
Iterator itStatements = statementsList.iterator();
@@ -118,9 +120,11 @@ private void checkStatementsInMethodsDeclaration(Object itItem) {
}
/**
- * Method that run into statements array.
+ * Method that run into statements array
+ *
* @author Mariana Azevedo
* @since 13/07/2014
+ *
* @param itStatements
*/
private void coveringStatements(Iterator itStatements) {
@@ -131,9 +135,11 @@ private void coveringStatements(Iterator itStatements) {
}
/**
- * Method that check statement type.
+ * Method that check statement type
+ *
* @author Mariana Azevedo
* @since 13/07/2014
+ *
* @param itStatement
*/
private void getStatementType(Object itStatement) {
@@ -170,18 +176,21 @@ private void getStatementType(Object itStatement) {
}
/**
- * Method to get the WMC value.
+ * Method to get the WMC value
+ *
* @author Mariana Azevedo
* @since 13/07/2014
+ *
* @return double
*/
public double getWeightMethodsPerClassIndex(){
if(wmcIndex == 0d) wmcIndex++;
- return new BigDecimal(this.wmcIndex, new MathContext(2, RoundingMode.UP)).doubleValue();
+ return BigDecimal.valueOf(this.wmcIndex).setScale(2, RoundingMode.UP).doubleValue();
}
/**
- * Method that clean the arrays and the variable used to calculate WMC value.
+ * Method that clean the arrays and the variable used to calculate WMC value
+ *
* @author Mariana Azevedo
* @since 13/07/2014
*/
@@ -192,7 +201,8 @@ public void cleanArraysAndVariable(){
}
/**
- * Method to set the name of the method evaluated.
+ * Method to set the name of the method evaluated
+ *
* @author Mariana Azevedo
* @since 06/07/2019
*
@@ -203,7 +213,8 @@ public void setMethodName(String methodName) {
}
/**
- * Method to get the name of the method evaluated.
+ * Method to get the name of the method evaluated
+ *
* @author Mariana Azevedo
* @since 07/07/2019
*
diff --git a/src/io/github/mariazevedo88/o3smeasures/builder/MeasureBuilder.java b/src/io/github/mariazevedo88/o3smeasures/builder/MeasureBuilder.java
index 614a4d5..6cbf0aa 100644
--- a/src/io/github/mariazevedo88/o3smeasures/builder/MeasureBuilder.java
+++ b/src/io/github/mariazevedo88/o3smeasures/builder/MeasureBuilder.java
@@ -1,8 +1,7 @@
package io.github.mariazevedo88.o3smeasures.builder;
-import java.util.ArrayList;
-import java.util.List;
-
+import org.eclipse.collections.api.list.MutableList;
+import org.eclipse.collections.impl.factory.Lists;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IJavaProject;
@@ -25,10 +24,10 @@
public class MeasureBuilder {
private ItemMeasured root;
- private List measures;
+ private MutableList measures;
public MeasureBuilder(){
- measures = new ArrayList<>();
+ measures = Lists.mutable.empty();
}
public void addMeasure(Measure measure){
diff --git a/src/io/github/mariazevedo88/o3smeasures/javamodel/LackCohesionMethodsJavaModel.java b/src/io/github/mariazevedo88/o3smeasures/javamodel/LackCohesionMethodsJavaModel.java
index fac5328..352ba5a 100644
--- a/src/io/github/mariazevedo88/o3smeasures/javamodel/LackCohesionMethodsJavaModel.java
+++ b/src/io/github/mariazevedo88/o3smeasures/javamodel/LackCohesionMethodsJavaModel.java
@@ -3,13 +3,14 @@
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
-import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
-import java.util.Map;
import java.util.Set;
import org.apache.log4j.Logger;
+import org.eclipse.collections.api.factory.Sets;
+import org.eclipse.collections.api.map.MutableMap;
+import org.eclipse.collections.api.set.MutableSet;
+import org.eclipse.collections.impl.factory.Maps;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IMethod;
@@ -35,9 +36,9 @@ public class LackCohesionMethodsJavaModel implements IJavaModel> sharedAttributesPerMethods;
- private Map> nonSharedAttributesPerMethods;
- private Map> connectedComponents;
+ private MutableMap> sharedAttributesPerMethods;
+ private MutableMap> nonSharedAttributesPerMethods;
+ private MutableMap> connectedComponents;
private Double lcomValue;
private Double lcom2Value;
private Double lcom4Value;
@@ -52,9 +53,9 @@ public enum LCOMType {
public LackCohesionMethodsJavaModel(){
- sharedAttributesPerMethods = new HashMap<>();
- nonSharedAttributesPerMethods = new HashMap<>();
- connectedComponents = new HashMap<>();
+ sharedAttributesPerMethods = Maps.mutable.empty();
+ nonSharedAttributesPerMethods = Maps.mutable.empty();
+ connectedComponents = Maps.mutable.empty();
this.lcomValue = 0d;
this.lcom2Value = 0d;
@@ -94,11 +95,11 @@ public void calculateValue(ICompilationUnit unit) {
if ((iFields != null && iMethods != null) && (iFields.length > 1 && iMethods.length > 1)) {
for (IField field: iFields){
- sharedAttributesPerMethods.put(field.getElementName(), new HashSet<>());
- nonSharedAttributesPerMethods.put(field.getElementName(), new HashSet<>());
+ sharedAttributesPerMethods.put(field.getElementName(), Sets.mutable.empty());
+ nonSharedAttributesPerMethods.put(field.getElementName(), Sets.mutable.empty());
}
for (IMethod method: iMethods){
- connectedComponents.put(method.getElementName(), new HashSet<>());
+ connectedComponents.put(method.getElementName(), Sets.mutable.empty());
}
checkMethodsWithSharedAttributes(iMethods);
@@ -126,7 +127,7 @@ public void calculateValue(ICompilationUnit unit) {
* @param method
*/
private void addMethods(String field, String method){
- Set sharedMethods = null;
+ MutableSet sharedMethods = null;
if (LCOMType.LCOM.toString().equals(getLcomType()) || LCOMType.LCOM2.toString().equals(getLcomType())){
if(sharedAttributesPerMethods.containsKey(field)){
sharedMethods = sharedAttributesPerMethods.get(field);
@@ -168,7 +169,6 @@ public void addMethod(String method, Set methodSet) {
*/
@SuppressWarnings("deprecation")
private void checkMethodsWithSharedAttributes(IMethod[] methods){
-
IScanner scanner = null;
for (IMethod method : methods) {
String methodName = method.getElementName();
@@ -199,16 +199,16 @@ private void checkMethodsWithSharedAttributes(IMethod[] methods){
*/
private Double calculateLCOMValue(){
- Set allSharedMethods = new HashSet<>();
- Set allNonSharedMethods = new HashSet<>();
+ MutableSet allSharedMethods = Sets.mutable.empty();
+ MutableSet allNonSharedMethods = Sets.mutable.empty();
- for (Iterator> it = sharedAttributesPerMethods.values().iterator(); it.hasNext();) {
- Set methods = it.next();
+ for (Iterator> it = sharedAttributesPerMethods.values().iterator(); it.hasNext();) {
+ MutableSet methods = it.next();
allSharedMethods.addAll(methods);
}
- for (Iterator> it = nonSharedAttributesPerMethods.values().iterator(); it.hasNext();) {
- Set methods = it.next();
+ for (Iterator> it = nonSharedAttributesPerMethods.values().iterator(); it.hasNext();) {
+ MutableSet methods = it.next();
allNonSharedMethods.addAll(methods);
}
@@ -231,10 +231,10 @@ private double calculateLCOM2Value(){
int sum = 0;
int accesses = 0;
- Set allSharedMethods = new HashSet<>();
+ MutableSet allSharedMethods = Sets.mutable.empty();
- for (Iterator> it = sharedAttributesPerMethods.values().iterator(); it.hasNext(); accesses++) {
- Set methods = it.next();
+ for (Iterator> it = sharedAttributesPerMethods.values().iterator(); it.hasNext(); accesses++) {
+ MutableSet methods = it.next();
allSharedMethods.addAll(methods);
sum += methods.size();
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/main/ASTSession.java b/src/io/github/mariazevedo88/o3smeasures/main/ASTSession.java
index d18625d..21e9ddc 100644
--- a/src/io/github/mariazevedo88/o3smeasures/main/ASTSession.java
+++ b/src/io/github/mariazevedo88/o3smeasures/main/ASTSession.java
@@ -1,8 +1,7 @@
package io.github.mariazevedo88.o3smeasures.main;
-import java.util.HashMap;
-import java.util.Map;
-
+import org.eclipse.collections.api.factory.Maps;
+import org.eclipse.collections.api.map.MutableMap;
import org.eclipse.jdt.core.ITypeRoot;
import org.eclipse.jdt.core.dom.CompilationUnit;
@@ -17,12 +16,20 @@
public class ASTSession {
private static ASTSession ast;
- private Map units;
+ private MutableMap units;
private ASTSession() {
- units = new HashMap<>();
+ units = Maps.mutable.empty();
}
+ /**
+ * Method that creates a ASTSession instance
+ *
+ * @author Mariana Azevedo
+ * @since 13/07/2014
+ *
+ * @return ASTSession
+ */
public static ASTSession getInstance(){
if (ast == null) {
ast = new ASTSession();
@@ -31,9 +38,11 @@ public static ASTSession getInstance(){
}
/**
- * Method that insert an compilation unit on the map.
+ * Method that insert an compilation unit on the map
+ *
* @author Mariana Azevedo
* @since 13/07/2014
+ *
* @param unit
*/
public void save(CompilationUnit unit){
@@ -41,9 +50,11 @@ public void save(CompilationUnit unit){
}
/**
- * Method that gets a specific compilation unit on the map.
+ * Method that gets a specific compilation unit on the map
+ *
* @author Mariana Azevedo
* @since 13/07/2014
+ *
* @param unit
* @return CompilationUnit
*/
@@ -52,10 +63,11 @@ public CompilationUnit get(ITypeRoot unit){
}
/**
- * Method that verifies if an unit it is contained
- * within the units' map
+ * Method that verifies if an unit it is contained within the units' map
+ *
* @author Mariana Azevedo
* @since 13/07/2014
+ *
* @param unit
* @return boolean
*/
@@ -64,12 +76,12 @@ public boolean contains(ITypeRoot unit){
}
/**
- * Method that cleans the units map.
+ * Method that cleans the units map
+ *
* @author Mariana Azevedo
* @since 13/07/2014
*/
public void reset(){
units.clear();
}
-
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/main/Application.java b/src/io/github/mariazevedo88/o3smeasures/main/Application.java
index bc00f46..14d1046 100644
--- a/src/io/github/mariazevedo88/o3smeasures/main/Application.java
+++ b/src/io/github/mariazevedo88/o3smeasures/main/Application.java
@@ -1,8 +1,7 @@
package io.github.mariazevedo88.o3smeasures.main;
-import java.util.Arrays;
-import java.util.List;
-
+import org.eclipse.collections.api.list.ImmutableList;
+import org.eclipse.collections.impl.factory.Lists;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
@@ -46,8 +45,8 @@
*/
public class Application {
- private List mainMeasures;
- private List secondaryMeasures;
+ private ImmutableList mainMeasures;
+ private ImmutableList secondaryMeasures;
/**
* Method that executes the project's measurement
@@ -91,7 +90,7 @@ public ItemMeasured executeSecondaryMeasures(IProject project) throws CoreExcept
*
* @return mainMeasures
*/
- public List getMainMeasures(){
+ public ImmutableList getMainMeasures(){
return mainMeasures;
}
@@ -103,7 +102,7 @@ public List getMainMeasures(){
*
* @return secondaryMeasures
*/
- public List getSecondaryMeasures(){
+ public ImmutableList getSecondaryMeasures(){
return secondaryMeasures;
}
@@ -114,7 +113,7 @@ public List getSecondaryMeasures(){
* @since 13/07/2014
*/
private void createMainMeasureArray(){
- mainMeasures = Arrays.asList(new NumberOfClasses(), new LinesOfCode(), new NumberOfMethods(), new NumberOfAttributes(),
+ mainMeasures = Lists.immutable.with(new NumberOfClasses(), new LinesOfCode(), new NumberOfMethods(), new NumberOfAttributes(),
new CyclomaticComplexity(), new WeightMethodsPerClass(), new DepthOfInheritanceTree(), new NumberOfChildren(),
new CouplingBetweenObjects(), new FanOut(), new ResponseForClass(), new LackCohesionMethods(),
new LackCohesionMethodsTwo(), new LackCohesionMethodsFour(), new TightClassCohesion(), new LooseClassCohesion());
@@ -127,7 +126,7 @@ private void createMainMeasureArray(){
* @since 29/09/2019
*/
private void createSecondaryMeasureArray(){
- secondaryMeasures = Arrays.asList(new NumberOfPackages(), new NumberOfLambdas(), new NumberOfInterfaces(),
+ secondaryMeasures = Lists.immutable.with(new NumberOfPackages(), new NumberOfLambdas(), new NumberOfInterfaces(),
new NumberOfMethodReference(), new NumberOfModules(), new EfferentCoupling(), new AfferentCoupling(),
new Abstractness(), new Instability(), new DistanceMainSequence());
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/measures/enumeration/FactorsEnum.java b/src/io/github/mariazevedo88/o3smeasures/measures/enumeration/FactorsEnum.java
index 64b0fc8..120b706 100644
--- a/src/io/github/mariazevedo88/o3smeasures/measures/enumeration/FactorsEnum.java
+++ b/src/io/github/mariazevedo88/o3smeasures/measures/enumeration/FactorsEnum.java
@@ -2,9 +2,9 @@
/**
* Enum to describe internal quality factors. See reference here: http://repositorio.ufla.br/handle/1/10561
+ *
* @author Mariana Azevedo
* @since 16/04/2017
- *
*/
public enum FactorsEnum {
diff --git a/src/io/github/mariazevedo88/o3smeasures/measures/enumeration/MeasuresEnum.java b/src/io/github/mariazevedo88/o3smeasures/measures/enumeration/MeasuresEnum.java
index 5b39a6c..59afda8 100644
--- a/src/io/github/mariazevedo88/o3smeasures/measures/enumeration/MeasuresEnum.java
+++ b/src/io/github/mariazevedo88/o3smeasures/measures/enumeration/MeasuresEnum.java
@@ -1,5 +1,11 @@
package io.github.mariazevedo88.o3smeasures.measures.enumeration;
+/**
+ * Enum to describe the measures name and acronym.
+ *
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ */
public enum MeasuresEnum {
CBO("CBO", "Coupling between Objects"),
diff --git a/src/io/github/mariazevedo88/o3smeasures/measures/enumeration/O3SMeasuresConfigurationEnum.java b/src/io/github/mariazevedo88/o3smeasures/measures/enumeration/O3SMeasuresConfigurationEnum.java
index 2ef3674..736623f 100644
--- a/src/io/github/mariazevedo88/o3smeasures/measures/enumeration/O3SMeasuresConfigurationEnum.java
+++ b/src/io/github/mariazevedo88/o3smeasures/measures/enumeration/O3SMeasuresConfigurationEnum.java
@@ -4,9 +4,9 @@
/**
* Enum to describe measure's configurations. See reference here: http://repositorio.ufla.br/handle/1/10561
+ *
* @author Mariana Azevedo
* @since 16/04/2017
- *
*/
public enum O3SMeasuresConfigurationEnum {
@@ -69,5 +69,4 @@ public static O3SMeasuresConfigurationEnum searchByValue (String value) throws F
}
throw new FactorNotFoundException("Invalid factor: " + value);
}
-
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/measures/secondary/Abstractness.java b/src/io/github/mariazevedo88/o3smeasures/measures/secondary/Abstractness.java
index e596181..7584692 100644
--- a/src/io/github/mariazevedo88/o3smeasures/measures/secondary/Abstractness.java
+++ b/src/io/github/mariazevedo88/o3smeasures/measures/secondary/Abstractness.java
@@ -15,6 +15,7 @@
/**
* Class that implements the A - Abstractness measure, which is the ratio of the number of abstract classes
* (and interfaces) in the analyzed package to the total number of classes in the analyzed package.
+ *
* The range for this metric is 0 to 1, with A=0 indicating a completely concrete package and A=1 indicating
* a completely abstract package.
*
diff --git a/src/io/github/mariazevedo88/o3smeasures/measures/secondary/DistanceMainSequence.java b/src/io/github/mariazevedo88/o3smeasures/measures/secondary/DistanceMainSequence.java
index d08d15b..30b825a 100644
--- a/src/io/github/mariazevedo88/o3smeasures/measures/secondary/DistanceMainSequence.java
+++ b/src/io/github/mariazevedo88/o3smeasures/measures/secondary/DistanceMainSequence.java
@@ -10,10 +10,12 @@
/**
* Class that implements D - Distance from the main sequence measure. The perpendicular distance
- * of a package from the idealized line A + I = 1. D is calculated as D = | A + I - 1 |. This metric
- * is an indicator of the package's balance between abstractness and stability. A package squarely on
- * the main sequence is optimally balanced with respect to its abstractness and stability. Ideal
- * packages are either completely abstract and stable (I=0, A=1) or completely concrete and unstable
+ * of a package from the idealized line A + I = 1. D is calculated as D = | A + I - 1 |.
+ *
+ * This metric is an indicator of the package's balance between abstractness and stability. A package
+ * squarely on the main sequence is optimally balanced with respect to its abstractness and stability.
+ *
+ * Ideal packages are either completely abstract and stable (I=0, A=1) or completely concrete and unstable
* (I=1, A=0). The range for this metric is 0 to 1, with D=0 indicating a package that is coincident
* with the main sequence and D=1 indicating a package that is as far from the main sequence as possible.
*
diff --git a/src/io/github/mariazevedo88/o3smeasures/measures/secondary/Instability.java b/src/io/github/mariazevedo88/o3smeasures/measures/secondary/Instability.java
index 0d852bb..7ee8041 100644
--- a/src/io/github/mariazevedo88/o3smeasures/measures/secondary/Instability.java
+++ b/src/io/github/mariazevedo88/o3smeasures/measures/secondary/Instability.java
@@ -10,9 +10,10 @@
/**
* Class that implements I - Instability measure. The ratio of efferent coupling (Ce) to total coupling (Ce + Ca)
- * such that I = Ce / (Ce + Ca). This metric is an indicator of the package's resilience to change. The range for
- * this metric is 0 to 1, with I=0 indicating a completely stable package and I=1 indicating a completely unstable
- * package.
+ * such that I = Ce / (Ce + Ca).
+ *
+ * This metric is an indicator of the package's resilience to change. The range is 0 to 1, with I=0 indicating
+ * a completely stable package and I=1 indicating a completely unstable package.
*
* @author Mariana Azevedo
* @since 14/10/2019
@@ -60,7 +61,7 @@ public String getAcronym() {
@Override
public String getDescription() {
return "Ce/(Ca + Ce) - indicates the necessity of performing modifications in an entity due to" +
- " updates occurred in other software entities";
+ " updates occurred in other software entities.";
}
/**
diff --git a/src/io/github/mariazevedo88/o3smeasures/plugin/chart/BarChart.java b/src/io/github/mariazevedo88/o3smeasures/plugin/chart/BarChart.java
index ba26df6..ce8ebe2 100644
--- a/src/io/github/mariazevedo88/o3smeasures/plugin/chart/BarChart.java
+++ b/src/io/github/mariazevedo88/o3smeasures/plugin/chart/BarChart.java
@@ -1,11 +1,11 @@
package io.github.mariazevedo88.o3smeasures.plugin.chart;
import java.awt.Color;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
import org.apache.log4j.Logger;
+import org.eclipse.collections.api.factory.Maps;
+import org.eclipse.collections.api.list.MutableList;
+import org.eclipse.collections.api.map.MutableMap;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.NumberAxis;
@@ -25,34 +25,36 @@
import io.github.mariazevedo88.o3smeasures.util.exception.FactorNotFoundException;
/**
- * Class that implements a Bar chart with the results of the items measured in
- * the plugin, separeted in internal quality indicators. See in http://repositorio.ufla.br/handle/1/10561.
+ * Class that implements a Bar chart with the results of the items measured in the plugin,
+ * separeted in internal quality indicators. See in http://repositorio.ufla.br/handle/1/10561.
*
* @author Mariana Azevedo
* @since 16/04/2017
- *
*/
public class BarChart {
static Logger logger = Logger.getLogger(BarChart.class);
- private Map factorsMap;
+ private MutableMap factorsMap;
public BarChart(){
- factorsMap = new HashMap<>();
+ factorsMap = Maps.mutable.empty();
}
- public Map getFactorsMap() {
+ public MutableMap getFactorsMap() {
return factorsMap;
}
- public void setFactorsMap(Map factorsMap) {
+ public void setFactorsMap(MutableMap factorsMap) {
this.factorsMap = factorsMap;
}
/**
* Method to create a dual axis bar chart
*
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
* @param itemsMeasured
* @return
*/
@@ -102,6 +104,10 @@ public JFreeChart createBarChart(ItemMeasured itemsMeasured){
/**
* Method to populate a bar chart
+ *
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
* @param barDataset
*/
private void populateProjectDataset(DefaultCategoryDataset barDataset) {
@@ -116,6 +122,9 @@ private void populateProjectDataset(DefaultCategoryDataset barDataset) {
/**
* Method to populate a line chart
*
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
* @param lineDataset
* @throws FactorNotFoundException
*/
@@ -133,13 +142,16 @@ private void populateFactorDataset (DefaultCategoryDataset lineDataset) throws F
/**
* Method to create the factor's objects
*
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
* @param itemsMeasured
* @throws FactorNotFoundException
*/
private void createFactors(ItemMeasured itemsMeasured) throws FactorNotFoundException {
if (itemsMeasured != null) {
- List items = itemsMeasured.getChildren();
+ MutableList items = itemsMeasured.getChildren();
for (ItemMeasured item : items) {
diff --git a/src/io/github/mariazevedo88/o3smeasures/plugin/chart/BoxAndWhiskerChart.java b/src/io/github/mariazevedo88/o3smeasures/plugin/chart/BoxAndWhiskerChart.java
index c946a64..8cccd95 100644
--- a/src/io/github/mariazevedo88/o3smeasures/plugin/chart/BoxAndWhiskerChart.java
+++ b/src/io/github/mariazevedo88/o3smeasures/plugin/chart/BoxAndWhiskerChart.java
@@ -1,11 +1,12 @@
package io.github.mariazevedo88.o3smeasures.plugin.chart;
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import org.apache.log4j.Logger;
+import org.eclipse.collections.api.factory.Lists;
+import org.eclipse.collections.api.factory.Maps;
+import org.eclipse.collections.api.list.MutableList;
+import org.eclipse.collections.api.map.MutableMap;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.NumberAxis;
@@ -20,8 +21,8 @@
import io.github.mariazevedo88.o3smeasures.util.exception.FactorNotFoundException;
/**
- * Class that implements a Box and Whisker chart with the results of the items measured in
- * the plugin, separeted in internal quality factors. See in http://repositorio.ufla.br/handle/1/10561.
+ * Class that implements a Box and Whisker chart with the results of the items measured in the plugin,
+ * separeted in internal quality factors. See in http://repositorio.ufla.br/handle/1/10561.
*
* @author Mariana Azevedo
* @since 16/04/2017
@@ -31,23 +32,26 @@ public class BoxAndWhiskerChart {
static Logger logger = Logger.getLogger(BoxAndWhiskerChart.class);
- private Map factorsMap;
+ private MutableMap factorsMap;
public BoxAndWhiskerChart(){
- factorsMap = new HashMap<>();
+ factorsMap = Maps.mutable.empty();
}
- public Map getFactorsMap() {
+ public MutableMap getFactorsMap() {
return factorsMap;
}
- public void setFactorsMap(Map factorsMap) {
+ public void setFactorsMap(MutableMap factorsMap) {
this.factorsMap = factorsMap;
}
/**
* Method to create a box and whisker chart
*
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
* @param itemsMeasured
* @return
*/
@@ -84,6 +88,10 @@ public JFreeChart createBoxAndWhiskerChart(ItemMeasured itemsMeasured){
/**
* Method to populate box and whisker
+ *
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
* @param boxDataset
*/
private void populateDataset(DefaultBoxAndWhiskerCategoryDataset boxDataset) {
@@ -91,7 +99,7 @@ private void populateDataset(DefaultBoxAndWhiskerCategoryDataset boxDataset) {
for (Indicator indicator : factor.getIndicators()){
ItemMeasured item = indicator.getItemMeasured();
- List values = createValueList(0, item.getChildren().size(), item);
+ MutableList values = createValueList(0, item.getChildren().size(), item);
boxDataset.add(values, factor.getName(), factor.getName());
}
}
@@ -100,6 +108,9 @@ private void populateDataset(DefaultBoxAndWhiskerCategoryDataset boxDataset) {
/**
* Method to create the factor's objects
*
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
* @param itemsMeasured
* @throws FactorNotFoundException
*/
@@ -122,14 +133,17 @@ private void createFactors(ItemMeasured itemsMeasured) throws FactorNotFoundExce
/**
* Method to calculate the factor's values
*
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
* @param lowerBound
* @param upperBound
* @param item
* @return
*/
- private static List createValueList(double lowerBound, double upperBound, ItemMeasured item) {
+ private static MutableList createValueList(double lowerBound, double upperBound, ItemMeasured item) {
- List result = new ArrayList<>();
+ MutableList result = Lists.mutable.empty();
for (int i = 0; i < item.getChildren().size(); i++) {
double itemValue = item.getChildren().get(i).getValue();
diff --git a/src/io/github/mariazevedo88/o3smeasures/plugin/chart/PieChart.java b/src/io/github/mariazevedo88/o3smeasures/plugin/chart/PieChart.java
index 5857970..a67e394 100644
--- a/src/io/github/mariazevedo88/o3smeasures/plugin/chart/PieChart.java
+++ b/src/io/github/mariazevedo88/o3smeasures/plugin/chart/PieChart.java
@@ -1,8 +1,8 @@
package io.github.mariazevedo88.o3smeasures.plugin.chart;
import java.awt.Font;
-import java.util.List;
+import org.eclipse.collections.api.list.MutableList;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.DefaultPieDataset;
@@ -20,9 +20,11 @@
public class PieChart {
/**
- * Method that creates the pie chart visualization using JFreeChart.
+ * Method that creates the pie chart visualization using JFreeChart
+ *
* @author Mariana Azevedo
* @since 13/07/2014
+ *
* @param itemsMeasured
* @return JFreeChart object
*/
@@ -34,7 +36,7 @@ public JFreeChart createPieChart(ItemMeasured itemsMeasured) {
String projectName = "";
if (itemsMeasured != null) {
- List items = itemsMeasured.getChildren();
+ MutableList items = itemsMeasured.getChildren();
projectName = itemsMeasured.getName();
for (ItemMeasured item : items) {
diff --git a/src/io/github/mariazevedo88/o3smeasures/popup/actions/Measurement.java b/src/io/github/mariazevedo88/o3smeasures/popup/actions/Measurement.java
index 5c692fa..49eace3 100644
--- a/src/io/github/mariazevedo88/o3smeasures/popup/actions/Measurement.java
+++ b/src/io/github/mariazevedo88/o3smeasures/popup/actions/Measurement.java
@@ -83,7 +83,7 @@ private void controlMonitorProgress(Runnable update, IProgressMonitor monitor) {
monitor.subTask("Getting measure values " + (i) + " of "+ size + "...");
Display.getDefault().syncExec(update);
- monitor.worked(1);
+ monitor.worked(i);
if(checkIfUserCancelledExecution(monitor)) break;
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/statistic/Factor.java b/src/io/github/mariazevedo88/o3smeasures/statistic/Factor.java
index 83ef3db..0895d51 100644
--- a/src/io/github/mariazevedo88/o3smeasures/statistic/Factor.java
+++ b/src/io/github/mariazevedo88/o3smeasures/statistic/Factor.java
@@ -1,7 +1,7 @@
package io.github.mariazevedo88.o3smeasures.statistic;
-import java.util.ArrayList;
-import java.util.Collection;
+import org.eclipse.collections.api.factory.Lists;
+import org.eclipse.collections.api.list.MutableList;
/**
* Class that represent a factor or construct (of internal quality in OO software)
@@ -13,48 +13,112 @@ public class Factor {
private String name;
private String description;
- private Collection indicators;
+ private MutableList indicators;
private int numberOfIndicators;
public Factor(){
- this.indicators = new ArrayList<>();
+ this.indicators = Lists.mutable.empty();
}
public Factor(String name, String description, int numberOfIndicators) {
this.name = name;
this.description = description;
this.numberOfIndicators = numberOfIndicators;
- this.indicators = new ArrayList<>();
+ this.indicators = Lists.mutable.empty();
}
+ /**
+ * Method to get the name of the factor
+ *
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
+ * @return String
+ */
public String getName() {
return name;
}
+ /**
+ * Method to get the description of the factor
+ *
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
+ * @return String
+ */
public String getDescription() {
return description;
}
- public Collection getIndicators() {
+ /**
+ * Method to get the indicators of the factor
+ *
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
+ * @return MutableList
+ */
+ public MutableList getIndicators() {
return indicators;
}
+ /**
+ * Method to get the indicators of the factor
+ *
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
+ * @param name
+ */
public void setName(String name) {
this.name = name;
}
+ /**
+ * Method to get the indicators of the factor
+ *
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
+ * @param description
+ */
public void setDescription(String description) {
this.description = description;
}
- public void setIndicators(Collection indicators) {
+ /**
+ * Method to set the indicators of the factor
+ *
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
+ * @param indicators
+ */
+ public void setIndicators(MutableList indicators) {
this.indicators = indicators;
}
+ /**
+ * Method to get the number of indicators in the factor
+ *
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
+ * @return int
+ */
public int getNumberOfIndicators() {
return numberOfIndicators;
}
+ /**
+ * Method to set the number indicators in the factor
+ *
+ * @author Mariana Azevedo
+ * @since 16/04/2017
+ *
+ * @param numberOfIndicators
+ */
public void setNumberOfIndicators(int numberOfIndicators) {
this.numberOfIndicators = numberOfIndicators;
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/statistic/Indicator.java b/src/io/github/mariazevedo88/o3smeasures/statistic/Indicator.java
index 74b4c62..d452af6 100644
--- a/src/io/github/mariazevedo88/o3smeasures/statistic/Indicator.java
+++ b/src/io/github/mariazevedo88/o3smeasures/statistic/Indicator.java
@@ -56,7 +56,7 @@ public void setItemMeasured(ItemMeasured itemMeasured) {
}
@Override
- public Double getStdDeviation() {
+ public double getStdDeviation() {
double sumItems = 0d;
for (ItemMeasured item : getItemMeasured().getChildren()) {
@@ -68,12 +68,11 @@ public Double getStdDeviation() {
}
@Override
- public Double getSum() {
+ public double getSum() {
double sum = 0d;
for (ItemMeasured item : getItemMeasured().getChildren()) {
sum+=item.getValue();
}
return sum;
}
-
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/statistic/generic/IStatistics.java b/src/io/github/mariazevedo88/o3smeasures/statistic/generic/IStatistics.java
index 3c7c615..c5cda00 100644
--- a/src/io/github/mariazevedo88/o3smeasures/statistic/generic/IStatistics.java
+++ b/src/io/github/mariazevedo88/o3smeasures/statistic/generic/IStatistics.java
@@ -14,9 +14,9 @@ public interface IStatistics {
* @author Mariana Azevedo
* @since 16/04/2017
*
- * @return Double
+ * @return double
*/
- public Double getStdDeviation();
+ public double getStdDeviation();
/**
* Method that calculates the sum of all values of a item
@@ -24,8 +24,8 @@ public interface IStatistics {
* @author Mariana Azevedo
* @since 16/04/2017
*
- * @return Double
+ * @return double
*/
- public Double getSum();
+ public double getSum();
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/structures/ItemMeasured.java b/src/io/github/mariazevedo88/o3smeasures/structures/ItemMeasured.java
index 24c3f9d..bd15088 100644
--- a/src/io/github/mariazevedo88/o3smeasures/structures/ItemMeasured.java
+++ b/src/io/github/mariazevedo88/o3smeasures/structures/ItemMeasured.java
@@ -1,8 +1,7 @@
package io.github.mariazevedo88.o3smeasures.structures;
-import java.util.ArrayList;
-import java.util.List;
-
+import org.eclipse.collections.api.factory.Lists;
+import org.eclipse.collections.api.list.MutableList;
import org.jsefa.xml.annotation.XmlDataType;
import org.jsefa.xml.annotation.XmlElement;
@@ -30,7 +29,7 @@ public class ItemMeasured {
@XmlElement(pos = 6)
private String classWithMaxValue;
private ItemMeasured parent;
- private List children;
+ private MutableList children;
private Measure measure;
public ItemMeasured(){}
@@ -38,7 +37,7 @@ public ItemMeasured(){}
public ItemMeasured(String name, ItemMeasured parent) {
this.name = name;
this.parent = parent;
- this.children = new ArrayList<>();
+ this.children = Lists.mutable.empty();
this.value = 0d;
this.mean = 0d;
this.max = 0d;
@@ -90,7 +89,7 @@ public void setParent(ItemMeasured item){
*
* @return List
*/
- public List getChildren(){
+ public MutableList getChildren(){
return children;
}
diff --git a/src/io/github/mariazevedo88/o3smeasures/util/FileExport.java b/src/io/github/mariazevedo88/o3smeasures/util/FileExport.java
index 59cfd4c..b195383 100644
--- a/src/io/github/mariazevedo88/o3smeasures/util/FileExport.java
+++ b/src/io/github/mariazevedo88/o3smeasures/util/FileExport.java
@@ -3,14 +3,14 @@
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
import javax.swing.JOptionPane;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVPrinter;
import org.apache.log4j.Logger;
+import org.eclipse.collections.api.factory.Lists;
+import org.eclipse.collections.api.list.MutableList;
import org.eclipse.jface.preference.IPreferenceStore;
import org.jsefa.xml.XmlIOFactory;
import org.jsefa.xml.XmlSerializer;
@@ -33,7 +33,7 @@
*/
public class FileExport {
- private static final List headerItems = new ArrayList<>();
+ private static final MutableList headerItems = Lists.mutable.empty();
private static String tempFolderPath = "";
private static String pathDelimiter = "\\";
private static String desktopPath = "\\Desktop\\";
@@ -85,9 +85,9 @@ private void populateHeader(){
*
* @return List
*/
- private List populateItems(ItemMeasured itemMeasured){
+ private MutableList populateItems(ItemMeasured itemMeasured){
- List recordItems = new ArrayList<>();
+ MutableList recordItems = Lists.mutable.empty();
for (ItemMeasured item : itemMeasured.getChildren()){
recordItems.add(new String[] {item.toString(),
String.valueOf(item.getValue()),
@@ -126,7 +126,7 @@ public void createCSVFile(String outputFile, ItemMeasured item) throws IOExcepti
CSVPrinter csvOutput = new CSVPrinter(fileWriter, CSVFormat.DEFAULT)) {
csvOutput.printRecords(headerItems);
- List it = populateItems(item);
+ MutableList it = populateItems(item);
csvOutput.printRecords(it);
JOptionPane.showMessageDialog(null, "CSV file was created successfully!");