diff --git a/pom.xml b/pom.xml
index 9514a332..7e8cc076 100644
--- a/pom.xml
+++ b/pom.xml
@@ -182,6 +182,12 @@ SOFTWARE.
9.8.0-5runtime
+
+ org.llorllale
+ cactoos-matchers
+ 0.13
+ test
+
diff --git a/src/main/java/org/jpeek/skeleton/OpsOf.java b/src/main/java/org/jpeek/skeleton/OpsOf.java
index 9591cb25..895ccbe6 100644
--- a/src/main/java/org/jpeek/skeleton/OpsOf.java
+++ b/src/main/java/org/jpeek/skeleton/OpsOf.java
@@ -23,6 +23,8 @@
*/
package org.jpeek.skeleton;
+import org.cactoos.Text;
+import org.cactoos.text.TextOf;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.xembly.Directives;
@@ -63,16 +65,25 @@ public void visitFieldInsn(final int opcode, final String owner,
final String attr, final String dsc) {
super.visitFieldInsn(opcode, owner, attr, dsc);
this.target.addIf("ops").add("op");
+ final Text name;
if (opcode == Opcodes.GETFIELD) {
this.target.attr("code", "get");
+ name = new TextOf(attr);
} else if (opcode == Opcodes.PUTFIELD) {
this.target.attr("code", "put");
+ name = new TextOf(attr);
} else if (opcode == Opcodes.GETSTATIC) {
this.target.attr("code", "get_static");
+ name = new QualifiedName(owner, attr);
} else if (opcode == Opcodes.PUTSTATIC) {
this.target.attr("code", "put_static");
+ name = new QualifiedName(owner, attr);
+ } else {
+ name = new TextOf(attr);
}
- this.target.set(attr).up().up();
+ this.target.set(
+ name
+ ).up().up();
}
@Override
@@ -86,5 +97,4 @@ public void visitMethodInsn(final int opcode,
.set(owner.replace("/", ".").concat(".").concat(mtd))
.up().up();
}
-
}
diff --git a/src/main/java/org/jpeek/skeleton/QualifiedName.java b/src/main/java/org/jpeek/skeleton/QualifiedName.java
new file mode 100644
index 00000000..3331fa6f
--- /dev/null
+++ b/src/main/java/org/jpeek/skeleton/QualifiedName.java
@@ -0,0 +1,55 @@
+/**
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2017-2019 Yegor Bugayenko
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+package org.jpeek.skeleton;
+
+import org.cactoos.text.JoinedText;
+import org.cactoos.text.TextEnvelope;
+import org.cactoos.text.UncheckedText;
+
+/**
+ * A fully qualified name of a field, an unambiguous name
+ * that specifies field without regard
+ * to the context of the call.
+ * @author Ilya Kharlamov (ilya.kharlamov@gmail.com)
+ * @version $Id$
+ * @since 0.29
+ */
+public final class QualifiedName extends TextEnvelope {
+ /**
+ * Ctor.
+ * @param owner The class the attribute belongs to
+ * @param attr The name of the field
+ */
+ public QualifiedName(final String owner, final String attr) {
+ super(
+ new UncheckedText(
+ new JoinedText(
+ ".",
+ owner.replace('/', '.'),
+ attr
+ )
+ )
+ );
+ }
+}
diff --git a/src/main/resources/org/jpeek/metrics/LCOM4.xsl b/src/main/resources/org/jpeek/metrics/LCOM4.xsl
index 2e2ab20a..40ef65ce 100644
--- a/src/main/resources/org/jpeek/metrics/LCOM4.xsl
+++ b/src/main/resources/org/jpeek/metrics/LCOM4.xsl
@@ -47,16 +47,23 @@ SOFTWARE.
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
diff --git a/src/main/resources/org/jpeek/metrics/LCOM5.xsl b/src/main/resources/org/jpeek/metrics/LCOM5.xsl
index 4b77f929..0729fffc 100644
--- a/src/main/resources/org/jpeek/metrics/LCOM5.xsl
+++ b/src/main/resources/org/jpeek/metrics/LCOM5.xsl
@@ -46,12 +46,24 @@ SOFTWARE.
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
diff --git a/src/main/resources/org/jpeek/metrics/OCC.xsl b/src/main/resources/org/jpeek/metrics/OCC.xsl
index 576acfdf..7051d2af 100644
--- a/src/main/resources/org/jpeek/metrics/OCC.xsl
+++ b/src/main/resources/org/jpeek/metrics/OCC.xsl
@@ -41,7 +41,18 @@ SOFTWARE.
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/test/java/org/jpeek/MetricsTest.java b/src/test/java/org/jpeek/MetricsTest.java
index 0427fedc..64bf2561 100644
--- a/src/test/java/org/jpeek/MetricsTest.java
+++ b/src/test/java/org/jpeek/MetricsTest.java
@@ -184,9 +184,6 @@ public static Collection