Skip to content

Commit

Permalink
#195 add a test case
Browse files Browse the repository at this point in the history
  • Loading branch information
HDouss committed Feb 26, 2020
1 parent 70ca3b8 commit 8145600
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/main/resources/org/jpeek/metrics/TCC.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ SOFTWARE.
<xsl:variable name="NC" select="$methods_count * ($methods_count - 1) div 2"/>
<xsl:variable name="directly-related-pairs">
<xsl:for-each select="$methods">
<!--
@todo #120:30min TCC: need to come back and refactor the following after
#156 is fixed. The ops for fields must be properly filtered to ensure
that they belong to the enclosing class.
-->
<xsl:variable name="i" select="position()"/>
<xsl:variable name="left" select="."/>
<xsl:variable name="left_attrs" select="$attrs[. = $left/ops/op/text()]"/>
Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/jpeek/MetricsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public static Collection<Object[]> targets() {
new Object[] {"Foo", "OCC", 0.5d},
new Object[] {"Bar", "TCC", 0.0d},
new Object[] {"Foo", "TCC", 1.0d},
new Object[] {"ClassSameAsAnotherPublicField", "TCC", 0.0d},
new Object[] {"MethodsWithDiffParamTypes", "TCC", 0.2d},
new Object[] {"OverloadMethods", "TCC", 1.0d},
new Object[] {"TwoCommonAttributes", "TCC", 0.0d},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.jpeek.samples;

public final class ClassSameAsAnotherPublicField {
private String NAME = "hey";

public void test() {
ClassWithPublicField.NAME = "test";
}

public void foo() {
this.NAME = "test";
}
}

class ClassWithPublicField {
public static String NAME = "yoo";
}

0 comments on commit 8145600

Please sign in to comment.