Skip to content

Commit

Permalink
Merge pull request #399 from HDouss/#195
Browse files Browse the repository at this point in the history
#195 Add a test case
  • Loading branch information
paulodamaso authored Mar 1, 2020
2 parents 72d5a81 + f8a7f50 commit c080f28
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 @@ -174,6 +174,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";
}

1 comment on commit c080f28

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on c080f28 Mar 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 120-bc67ce38 disappeared from src/main/resources/org/jpeek/metrics/TCC.xsl, that's why I closed #195. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

Please sign in to comment.