cqfn / jpeek Goto Github PK
View Code? Open in Web Editor NEWHosted and command-line calculator of cohesion metrics for Java code
Home Page: https://i.jpeek.org
License: MIT License
Hosted and command-line calculator of cohesion metrics for Java code
Home Page: https://i.jpeek.org
License: MIT License
Seems that it has to be reversed.
Let's create a skeleton. I'll do it.
Let's track the amount of mistakes different metrics produce.
Let's fix.
Let's add a new number "trust" per artifact.
I fail to run jpeek. I end up in exceptions when runnnig the maven repository jar and compiled sources.
When running the repository jar, given in the readme, some class is reported missing:
$ java -jar ~/tools/jpeek/jpeek-0.1-jar-with-dependencies.jar . /tmp/jpeek
Exception in thread "main" java.io.IOException: java.io.UncheckedIOException: java.io.IOException: java.lang.IllegalStateException: javassist.NotFoundException: com.company.releng.tools.deploy.locations.DeployLocations
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:74)
at org.cactoos.scalar.IoCheckedScalar.value(IoCheckedScalar.java:60)
at org.jpeek.App.analyze(App.java:96)
at org.jpeek.Main.main(Main.java:61)
Caused by: java.io.UncheckedIOException: java.io.IOException: java.lang.IllegalStateException: javassist.NotFoundException: com.company.releng.tools.deploy.locations.DeployLocations
at org.cactoos.func.UncheckedFunc.apply(UncheckedFunc.java:61)
at org.cactoos.iterator.Mapped.next(Mapped.java:70)
at org.jpeek.metrics.cohesion.CAMC.metrics(CAMC.java:118)
at org.jpeek.metrics.cohesion.CAMC.xembly(CAMC.java:91)
at org.jpeek.App.lambda$analyze$0(App.java:85)
at org.cactoos.func.FuncOf.lambda$new$3(FuncOf.java:88)
at org.cactoos.func.FuncOf.apply(FuncOf.java:104)
at org.cactoos.scalar.And.lambda$null$0(And.java:101)
at org.cactoos.scalar.And.value(And.java:127)
at org.cactoos.scalar.And.value(And.java:52)
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:66)
... 3 more
Caused by: java.io.IOException: java.lang.IllegalStateException: javassist.NotFoundException: com.company.releng.tools.deploy.locations.DeployLocations
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:74)
at org.cactoos.func.UncheckedFunc.apply(UncheckedFunc.java:59)
... 13 more
Caused by: java.lang.IllegalStateException: javassist.NotFoundException: com.company.releng.tools.deploy.locations.DeployLocations
at org.jpeek.metrics.cohesion.CAMC.metric(CAMC.java:146)
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:66)
... 14 more
Caused by: javassist.NotFoundException: com.company.releng.tools.deploy.locations.DeployLocations
at javassist.ClassPool.get(ClassPool.java:445)
at javassist.bytecode.Descriptor.toCtClass(Descriptor.java:592)
at javassist.bytecode.Descriptor.getParameterTypes(Descriptor.java:439)
at javassist.CtBehavior.getParameterTypes(CtBehavior.java:298)
at org.jpeek.metrics.cohesion.CAMC.methods(CAMC.java:196)
at org.jpeek.metrics.cohesion.CAMC.cohesion(CAMC.java:157)
at org.jpeek.metrics.cohesion.CAMC.metric(CAMC.java:142)
... 15 more
When trying to build the tool from source using mvn clean package
, the build fails due to errors in tests:
# Build tests fail
Tests in error:
AppTest.createsXmlReports:50 » IO java.lang.IllegalArgumentException: 40 error...
MainTest.createsXmlReports:47 » IO java.lang.IllegalArgumentException: 40 erro...
Tests run: 11, Failures: 4, Errors: 2, Skipped: 0
Building with mvn clean package -DskipTests
produces the desired jar.
However when running this file, another exception occurs:
~/git/master$ java -jar ~/source/jpeek/target/jpeek-1.0-SNAPSHOT-jar-with-dependencies.jar . /tmp/jpeek
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.io.IOException: java.io.UncheckedIOException: java.io.IOException: javassist.NotFoundException: org.apache.commons.cli.CommandLine
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:74)
at org.cactoos.scalar.IoCheckedScalar.value(IoCheckedScalar.java:60)
at org.jpeek.App.analyze(App.java:114)
at org.jpeek.Main.main(Main.java:61)
Caused by: java.io.UncheckedIOException: java.io.IOException: javassist.NotFoundException: org.apache.commons.cli.CommandLine
at org.cactoos.func.UncheckedFunc.apply(UncheckedFunc.java:61)
at org.cactoos.iterator.Mapped.next(Mapped.java:70)
at org.jpeek.metrics.JavassistClasses.metrics(JavassistClasses.java:129)
at org.jpeek.metrics.JavassistClasses.xembly(JavassistClasses.java:101)
at org.jpeek.metrics.cohesion.CAMC.xembly(CAMC.java:76)
at org.jpeek.App.xml(App.java:134)
at org.jpeek.App.lambda$analyze$0(App.java:102)
at org.cactoos.func.FuncOf.lambda$new$3(FuncOf.java:88)
at org.cactoos.func.FuncOf.apply(FuncOf.java:104)
at org.cactoos.scalar.And.lambda$null$0(And.java:101)
at org.cactoos.scalar.And.value(And.java:127)
at org.cactoos.scalar.And.value(And.java:52)
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:66)
... 3 more
Caused by: java.io.IOException: javassist.NotFoundException: org.apache.commons.cli.CommandLine
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:74)
at org.jpeek.metrics.JavassistClasses.metric(JavassistClasses.java:147)
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:66)
at org.cactoos.func.UncheckedFunc.apply(UncheckedFunc.java:59)
... 15 more
Caused by: javassist.NotFoundException: org.apache.commons.cli.CommandLine
at javassist.ClassPool.get(ClassPool.java:445)
at javassist.bytecode.Descriptor.toCtClass(Descriptor.java:592)
at javassist.bytecode.Descriptor.getParameterTypes(Descriptor.java:439)
at javassist.CtBehavior.getParameterTypes(CtBehavior.java:298)
at org.jpeek.metrics.cohesion.CAMC.methods(CAMC.java:139)
at org.jpeek.metrics.cohesion.CAMC.cohesion(CAMC.java:86)
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:66)
... 18 more
Am I missing something or did I catch the project in an unfortunate state?
Now we just accept two arguments in App
. It's primitive. Let's add some library for options parsing.
Let's exclude them
Let's show them all
Let's make it smarter
Let's implement OCC cohesion metric.
H. Aman, K. Yamasaki, H. Yamada, and M.-T. Noda, “A proposal
of class cohesion metrics using sizes of cohesive parts,” in Proc. of
Fifth Joint Conference on Knowledge-based Software Engineering,
2002, pp. 102–107.
Let's add GitHub link to those repos, which have that in their .pom
files. When we download artifact in Reports
, we should pay attention to the .pom
file inside. If it contains the link to GitHub repo, in its /project/scm/url
-- we should call App
with an additional parameter: github
, equal to the repository name. Later, we will use this param in XSL processing, to point classes to their sources.
Also, let's send /project/version
in version
parameter.
Let's implement LCOM4.
Hitz M., Montazeri B.: Measuring Coupling and Cohesion In Object-Oriented Systems. Proc. Int. Symposium on Applied Corporate Computing, Oct. 25-27, Monterrey, Mexico, 75-76, 197, 78-84.
Let's implement LCOM cohesion metric.
S. R. Chidamber and C. F. Kemerer, A metrics suite for object oriented design. IEEE Transactions on Software Engineering, vol.20, no.6, 1994.
http://www.pitt.edu/~ckemerer/CK%20research%20papers/MetricForOOD_ChidamberKemerer94.pdf
Shyam R. Chidamber, Chris F. Kemerer. A Metrics suite for Object Oriented design. M.I.T. Sloan School of Management E53-315. 1993. http://uweb.txstate.edu/~mg43/CS5391/Papers/Metrics/OOMetrics.pdf
Victor Basili, Lionel Briand and Walcelio Melo. A Validation of Object-Oriented Design Metrics as Quality Indicators. IEEE Transactions on Software Engineering. Vol. 22, No. 10, October 1996. http://www.cs.umd.edu/users/basili/publications/journals/J60.pdf
Bindu S. Gupta: A Critique of Cohesion Measures in the Object-Oriented Paradigm. Master of Science Thesis. Michigan Technological University, Department of Computer Science. 1997.
Let's implement NHD cohesion metric.
S. Counsell, S. Swift, and J. Crampton, “The interpretation
and utility of three cohesion metrics for object-oriented design,”
ACM Transactions on Software Engineering and Methodology
(TOSEM), vol. 15, no. 2, pp. 123–149, 2006.
Let's create XSD schema for the output XML documents validation.
I have analyzed some implemented metrics and also think about the following questions during implementation metrics where we counting methods of a class and types of method parameters or return types. Next questions relate to all metrics and I think it should be clarified for all who want to implement some new metric. To be easy it to understand what I want to say let's look to CAMC metric implementation. We can take any metric, but CAMC has easy description and formula.
See this one paper Class Cohesion Metrics for Software Engineering: A Critical Review, PDF, Table 2. Interface-based metrics. CAMC metric is described as:
1. Letter l
in formula is a number of distinct parameter types across all methods in a class. For example, if class has the next methods
public int length(String str) {
return s.length();
}
public int bytes(String str) {
return str.getBytes().length;
}
then l
should be equals to 1 because two methods have the same parameter type String
. But for committed to repository implementation l
will be equals to 2. It happens because our implementation counts not only parameter types of method but also it counts return types of method. For code above it counts int
and String
. I think our implementation contradicts to definition in the paper, we should count only parameter types of method.
One more evidence for that: if we should count both parameter types of method and return types then it clearly is wrote in the paper. See description for MMAC metric. Paper clearly tells us that i
is can be a parameter type of method or return type. In the description of CAMC metric l
is defined only as count of parameter types.
So, am I right that we should count only parameter types of method for l
?
2. For example class has the next method:
public int plus(int a, Integer b) {
return a + b;
}
Let see the point 1 above, for CAMC metric we should calculate value l
as a number of distinct parameter types for method. Our implmentation counts l
as 2 because method has two distinct types: int
and java.lang.Integer
. Also we can see it in a bytecode of method:
public plus(ILjava/lang/Integer;)I
L0
LINENUMBER 13 L0
// ... and other instructions
For compiler int
and java.lang.Integer
it is two different types, but for human it is one type for integer values.
So, should we consider simple types and theirs analogous boxed types as the same types or consider them as different types (like compiler does)?
3. Letter k
in CAMC formula is a number of all methods in a class.
So, is it correct that we consider constructors as methods?
Should we consider only public methods or consider all methods (public, private, protected, package-private)? I think we should consider all methods, but what do you think?
If class inherits from another class then should we consider methods from parent class? I think we shouldn't, but what do you think?
4. Also interesting bug in counting of all methods in a class when class overrides one or more generic methods from parent. Let's see the next code:
public final class OverrideGenericMethodFromInterface
implements GenericIncrementor1<Integer> {
private final int num;
public OverrideGenericMethodFromInterface(int num) {
this.num = num;
}
@Override
public Integer inc() {
return num + 1;
}
}
interface GenericIncrementor1<T> {
T inc();
}
We have generic interface GenericIncrementor1
and its implementation presented by class OverrideGenericMethodFromInterface
. Visually we see only one method in OverrideGenericMethodFromInterface
class, it is public Integer inc() { }
. And when we count methods for some metric we expect that Javassist or ASM returns us only one method. But it doesn't. It returns two methods. Why does it happen? Let's see to the bytecode:
// class version 52.0 (52)
// access flags 0x31
// signature Ljava/lang/Object;LGenericIncrementor1<Ljava/lang/Integer;>;
// declaration: OverrideGenericMethodFromInterface implements GenericIncrementor1<java.lang.Integer>
public final class OverrideGenericMethodFromInterface implements GenericIncrementor1 {
// compiled from: OverrideGenericMethodFromInterface.java
// access flags 0x12
private final I num
// access flags 0x1
public <init>(I)V
L0
LINENUMBER 5 L0
ALOAD 0
INVOKESPECIAL java/lang/Object.<init> ()V
L1
LINENUMBER 6 L1
ALOAD 0
ILOAD 1
PUTFIELD OverrideGenericMethodFromInterface.num : I
L2
LINENUMBER 7 L2
RETURN
MAXSTACK = 2
MAXLOCALS = 2
// access flags 0x1
public inc()Ljava/lang/Integer;
L0
LINENUMBER 11 L0
ALOAD 0
GETFIELD OverrideGenericMethodFromInterface.num : I
ICONST_1
IADD
INVOKESTATIC java/lang/Integer.valueOf (I)Ljava/lang/Integer;
ARETURN
MAXSTACK = 2
MAXLOCALS = 1
// access flags 0x1041
public synthetic bridge inc()Ljava/lang/Object;
L0
LINENUMBER 1 L0
ALOAD 0
INVOKEVIRTUAL OverrideGenericMethodFromInterface.inc ()Ljava/lang/Integer;
ARETURN
MAXSTACK = 1
MAXLOCALS = 1
}
In the bytecode two methods is presented: public inc()Ljava/lang/Integer;
and public synthetic bridge inc()Ljava/lang/Object;
. And according that Javassist or ASM works properly when returning two methods, because bytecode contains two methods. Compiler always generates one more method on each implementation of generic method in a class. And it impacts all our metrics. To avoid incorrect counting of all methods in a classs we should exclude synthetic
methods.
Let's discuss all points/questions and I will fix them if it will be needed.
Let's add more data there.
Analysing large projects fails as too many files are held open at the same time.
Scenario to reproduce:
/tmp/java-bullshifier$ ./gradlew -Pclasses=256 -Psubprojects=100 clean run
/tmp/java-bullshifier/output$ ./gradlew fatjar
/tmp/jpeek$ java -jar jpeek-0.5-jar-with-dependencies.jar /tmp/java-bullshifier/output /tmp/results
Run will fail following exception:
Exception in thread "main" java.io.IOException: java.io.UncheckedIOException: java.io.FileNotFoundException: /tmp/java-bullshifier/output/ProjAhgodwwubpj/build/tmp/fatjar-stage/ch/qos/logback/core/LogbackException.class (Too many open files)
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:74)
at org.cactoos.scalar.IoCheckedScalar.value(IoCheckedScalar.java:60)
at org.jpeek.App.analyze(App.java:115)
at org.jpeek.Main.main(Main.java:61)
Caused by: java.io.UncheckedIOException: java.io.FileNotFoundException: /tmp/java-bullshifier/output/ProjAhgodwwubpj/build/tmp/fatjar-stage/ch/qos/logback/core/LogbackException.class (Too many open files)
at org.cactoos.func.UncheckedFunc.apply(UncheckedFunc.java:61)
at org.cactoos.iterator.Mapped.next(Mapped.java:70)
at org.cactoos.iterator.Filtered.hasNext(Filtered.java:89)
at org.cactoos.iterator.Mapped.hasNext(Mapped.java:65)
at org.jpeek.metrics.JavassistClasses.metrics(JavassistClasses.java:139)
at org.jpeek.metrics.JavassistClasses.xembly(JavassistClasses.java:103)
at org.jpeek.metrics.cohesion.CAMC.xembly(CAMC.java:91)
at org.jpeek.Report.xml(Report.java:124)
at org.jpeek.Report.save(Report.java:88)
at org.jpeek.App.lambda$analyze$0(App.java:112)
at org.cactoos.func.FuncOf.lambda$new$3(FuncOf.java:88)
at org.cactoos.func.FuncOf.apply(FuncOf.java:104)
at org.cactoos.scalar.And.lambda$null$0(And.java:101)
at org.cactoos.scalar.And.value(And.java:127)
at org.cactoos.scalar.And.value(And.java:52)
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:66)
... 3 more
Caused by: java.io.FileNotFoundException: /tmp/java-bullshifier/output/ProjAhgodwwubpj/build/tmp/fatjar-stage/ch/qos/logback/core/LogbackException.class (Too many open files)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at org.jpeek.metrics.JavassistClasses.lambda$metrics$2(JavassistClasses.java:132)
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:66)
at org.cactoos.func.UncheckedFunc.apply(UncheckedFunc.java:59)
... 18 more
Let's make an analysis of metrics in the matrix
Let's implement it.
HTTP redirect is broken, let's fix.
java.io.IOException: java.lang.IllegalStateException: java.util.concurrent.ExecutionException: java.io.UncheckedIOException: java.io.IOException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at org.cactoos.func.IoCheckedBiFunc.apply(IoCheckedBiFunc.java:74)
at org.jpeek.web.TkReport.act(TkReport.java:74)
at org.takes.facets.fork.FkRegex.route(FkRegex.java:209)
at org.takes.facets.fork.FkChain.route(FkChain.java:75)
at org.takes.facets.fork.TkFork.act(TkFork.java:100)
at org.takes.facets.forward.TkForward.act(TkForward.java:68)
at org.takes.tk.TkWrap.act(TkWrap.java:61)
at org.takes.http.BkBasic.print(BkBasic.java:108)
at org.takes.http.BkBasic.accept(BkBasic.java:84)
at org.takes.http.BkSafe$1.accept(BkSafe.java:51)
at org.takes.http.BkWrap.accept(BkWrap.java:52)
at org.takes.http.BkTimeable.accept(BkTimeable.java:89)
at org.takes.http.BkParallel$1$1.run(BkParallel.java:89)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: java.util.concurrent.ExecutionException: java.io.UncheckedIOException: java.io.IOException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at org.jpeek.web.AsyncReports.apply(AsyncReports.java:86)
at org.jpeek.web.AsyncReports.apply(AsyncReports.java:54)
at org.cactoos.func.IoCheckedBiFunc.apply(IoCheckedBiFunc.java:66)
... 15 more
Caused by: java.util.concurrent.ExecutionException: java.io.UncheckedIOException: java.io.IOException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.jpeek.web.AsyncReports.apply(AsyncReports.java:84)
... 17 more
Caused by: java.io.UncheckedIOException: java.io.IOException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at org.cactoos.func.UncheckedFunc.apply(UncheckedFunc.java:61)
at org.cactoos.iterator.Mapped.next(Mapped.java:70)
at org.cactoos.iterable.Joined.iterator(Joined.java:68)
at org.cactoos.collection.Joined.iterator(Joined.java:97)
at org.xembly.Directives.append(Directives.java:250)
at org.jpeek.Index.value(Index.java:72)
at org.jpeek.App.analyze(App.java:135)
at org.jpeek.web.Reports.apply(Reports.java:136)
at org.jpeek.web.Reports.apply(Reports.java:49)
at org.jpeek.web.Futures.lambda$apply$0(Futures.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at com.jcabi.log.VerboseThreads$Wrap.run(VerboseThreads.java:220)
... 1 more
Caused by: java.io.IOException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:74)
at org.cactoos.func.UncheckedFunc.apply(UncheckedFunc.java:59)
... 14 more
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.LinkedList.checkElementIndex(LinkedList.java:555)
at java.util.LinkedList.get(LinkedList.java:476)
at org.cactoos.list.Sorted.get(Sorted.java:185)
at org.jpeek.Index.metric(Index.java:118)
at org.cactoos.func.IoCheckedFunc.apply(IoCheckedFunc.java:66)
... 15 more
Let's add graphs.
let's fix
Let's implement LCOM5 cohesion metric.
B. Henderson-Sellers, L. L. Constantine, and I. M. Graham, “Coupling
and cohesion (towards a valid metrics suite for objectoriented
analysis and design),” Object Oriented Systems, vol. 3,
no. 3, pp. 143–158, 1996
Heroku logs:
2017-11-06T15:16:08.710384+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-11-06T15:16:31.142395+00:00 heroku[web.1]: Process running mem=594M(109.6%)
2017-11-06T15:16:31.142499+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-11-06T15:16:52.583138+00:00 heroku[web.1]: Process running mem=594M(109.6%)
2017-11-06T15:16:52.583189+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-11-06T15:17:14.414977+00:00 heroku[web.1]: Process running mem=594M(109.6%)
2017-11-06T15:17:14.415136+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-11-06T15:17:36.968745+00:00 heroku[web.1]: Process running mem=594M(109.6%)
2017-11-06T15:17:36.968940+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-11-06T15:17:59.260627+00:00 heroku[web.1]: Process running mem=594M(109.6%)
2017-11-06T15:17:59.260845+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-11-06T15:18:20.801884+00:00 heroku[web.1]: Process running mem=594M(109.6%)
2017-11-06T15:18:20.801884+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-11-06T15:18:42.533605+00:00 heroku[web.1]: Process running mem=594M(109.6%)
2017-11-06T15:18:42.533660+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-11-06T15:19:05.481493+00:00 heroku[web.1]: Process running mem=594M(109.6%)
2017-11-06T15:19:05.481529+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-11-06T15:19:27.573072+00:00 heroku[web.1]: Process running mem=594M(109.6%)
2017-11-06T15:19:27.573248+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
We seem to be leaking memory resources somewhere. Let's investigate and fix.
Let's implement MWE cohesion metric.
Y. Liu, D. Poshyvanyk, R. Ferenc, T. Gyim´othy, and N. Chrisochoides,
“Modeling class cohesion as mixtures of latent topics,”
in Software Maintenance, 2009. ICSM 2009. IEEE International
Conference on. IEEE, 2009, pp. 233–242.
PDF is not available :(
Let's record all projects we analyzed and build a hot list of best/worst.
Let's implement LCSM cohesion metric.
A. Marcus and D. Poshyvanyk, “The conceptual cohesion of
classes,” in 21st IEEE International Conference on Software Maintenance
(ICSM’05). IEEE, 2005, pp. 133–142.
https://pdfs.semanticscholar.org/c6c4/b63f3ba81f2bee75a0c29367da99971dfbaa.pdf
They are coming from AspectJ and shouldn't be analyzed.
Try http://i.jpeek.org/com.google.guava/guava/index.html Most likely it's too big, that's why the delay and then application error.
Let's fix
In theory, CAMC values can't be higher than 1.0. However, our software produces 2.0 and sometimes even 3.0. Let's investigate and fix.
For example org.takes.misc.TransformAction
gives 2.0.
Let's create a simple web front for public Maven artifacts.
Let's connect it to Sentry
To calculate class cohesion metrics we need information about methods, attributes, and connections between them. We can get that from the bytecode directly, or from AST, which we should get through some parser. Which option is better? The decision is important, since it will affect the entire design of this tool.
Let's generate XSL stylesheet for all reports and make sure they all have links to it.
Let's make a summary by classes.
Let's create summary numbers and a badge.
Let's add integration testing phase to make sure our JAR actually works with an external code base. Let's use maven-invoker-plugin.
Let's exclude Enums and Annotations
Let's add MMAC cohesion metric.
J. Al Dallal and L. C. Briand, “An object-oriented high-level
design-based class cohesion metric,” Information and software
technology, vol. 52, no. 12, pp. 1346–1361, 2010.
PDF is not available for free :( More about this metric here: http://www.math.md/files/csjm/v25-n1/v25-n1-(pp44-74).pdf
http://www.sciencedirect.com/science/article/pii/S0950584910001552
Let's add colors to all metrics, to indicate their quality (red, green, yellow).
Let's implement LORM metric.
L. Etzkorn and H. Delugach, “Towards a semantic metrics suite
for object-oriented design,” in Technology of Object-Oriented Languages
and Systems, 2000. TOOLS 34. Proceedings. 34th International
Conference on. IEEE, 2000, pp. 71–80.
No PDF available :(
http://ieeexplore.ieee.org/document/868960/
It's explained here, briefly: http://www.math.md/files/csjm/v25-n1/v25-n1-(pp44-74).pdf
Let's implement TCC and LCC metrics.
Bieman, James M. & Kang, Byung-Kyoo: Cohesion and reuse in an object-oriented system. Proceedings of the 1995 Symposium on Software. Pages: 259 - 262. ISSN:0163-5948. ACM Press New York, NY, USA.
https://pdfs.semanticscholar.org/672e/de6e3e600eafd84036a0b983b88e481ac626.pdf
Let's create it.
Let's implement LCOM2 and LCOM3. See http://www.aivosto.com/project/help/pm-oo-cohesion.html
Henderson-Sellers, B, L, Constantine and I, Graham , 'Coupling and Cohesion (Towards a Valid Metrics Suite for Object-Oriented Analysis and Design)', Object-Oriented Systems, 3(3), pp143-158, 1996.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.