File | Line |
---|
jfp/qualitas/exceptions/HandlerTypeCategoriser.java | 71 |
jfp/qualitas/exceptions/ThrowTypeCategoriser.java | 103 |
"C-system", "C-base", "C-library");
}
private void incrementCountFor(String className, String systemCounter,
String baseCounter, String libraryCounter) {
if (relevanceChecker.isRelevantClass(className)) {
perMethod.incrementCount(systemCounter);
} else if (isBaseExceptionType(className)) {
perMethod.incrementCount(baseCounter);
} else {
perMethod.incrementCount(libraryCounter);
}
}
private boolean isBaseExceptionType(String className) {
String dotClassName = className.replace(File.separatorChar, '.');
return dotClassName.equals("java.lang.Exception")
|| dotClassName.equals("java.lang.Error")
|| dotClassName.equals("java.lang.Throwable");
}
@Override
public void processNode() {
CounterData perClass = new CounterData();
for (MethodNode mn : methods) {
if (!wantToCount(mn.access, mn.name)) {
continue;
}
perMethod.reset(); |
File | Line |
---|
ie/nuim/cs/pop/metrics/LCC.java | 49 |
ie/nuim/cs/pop/metrics/LCOM3.java | 40 |
public class LCC implements ModuleMetric {
@Override
public Number value(int moduleId) {
Graph<Method> graph = new UndirectedGraph<Method>();
Session session = HibernateUtils.getSessionFactory()
.getCurrentSession();
Transaction transaction = session.beginTransaction();
@SuppressWarnings("unchecked")
Collection<Method> methods = session
.createQuery("from Method where scope_id = :scope_id")
.setParameter("scope_id", moduleId).list();
for (Method method : methods) {
graph.addNode(method);
}
for (Method method1 : methods) {
for (Method method2 : methods) {
if (method1 != method2
&& method1.getMethodBody().shareAccessToAField(
method2.getMethodBody())) {
graph.addEdge(method1, method2);
}
}
} |
File | Line |
---|
ie/nuim/cs/pop/metrics/LCC.java | 49 |
ie/nuim/cs/pop/metrics/LCOM3.java | 40 |
ie/nuim/cs/pop/metrics/LCOM4.java | 40 |
public class LCC implements ModuleMetric {
@Override
public Number value(int moduleId) {
Graph<Method> graph = new UndirectedGraph<Method>();
Session session = HibernateUtils.getSessionFactory()
.getCurrentSession();
Transaction transaction = session.beginTransaction();
@SuppressWarnings("unchecked")
Collection<Method> methods = session
.createQuery("from Method where scope_id = :scope_id")
.setParameter("scope_id", moduleId).list();
for (Method method : methods) {
graph.addNode(method);
}
for (Method method1 : methods) {
for (Method method2 : methods) {
if (method1 != method2
&& method1.getMethodBody().shareAccessToAField( |
File | Line |
---|
ie/nuim/cs/pop/importers/JarImporter.java | 109 |
ie/nuim/cs/pop/importers/JarImporter.java | 229 |
private void addDeclaredPackagesToSystem(ZipFile jar) throws IOException {
Enumeration<? extends ZipEntry> jarEntries = jar.entries();
while (jarEntries.hasMoreElements()) {
ZipEntry jarEntry = jarEntries.nextElement();
if (jarEntry.getName().endsWith(CLASS_FILE_SUFFIX)) {
ClassNode classNode = new ClassNode(ASM4);
try {
new ClassReader(jar.getInputStream(jarEntry)).accept(
classNode, 0);
} catch (IOException e) {
e.printStackTrace();
}
String packageName = ancestorName(classNode.name);
if (packageName != null) { |