Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .idea/CharmFL.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/main/java/actions/PluginAdvancedOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public void actionPerformed(@NotNull AnActionEvent e) {
FlServiceImpl flService = new FlServiceImpl();

if (dialog.showAndGet()) {
PluginModule.setBarinelSelected(dialog.isBarinelRadioButtonSelected());
PluginModule.setTarantulaSelected(dialog.isTarantulaRadioButtonSelected());
PluginModule.setOchiaiSelected(dialog.isOchiaiRadioButtonSelected());
PluginModule.setDStarSelected(dialog.isDStarRadioButtonSelected());
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/actions/PluginCallGraph.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package actions;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import modules.ProjectModule;
import org.apache.commons.lang3.SystemUtils;
Expand Down Expand Up @@ -35,7 +36,7 @@ public void actionPerformed(@NotNull AnActionEvent e) {
FlServiceImpl flService = new FlServiceImpl();
if (flService.isTestDataCollected()) {


/*
File file = new File(ProjectModule.getProjectPath() + File.separator +
"static_call_graph.html");
Writer fileWriter;
Expand Down Expand Up @@ -92,7 +93,11 @@ public void actionPerformed(@NotNull AnActionEvent e) {
}
JOptionPane.showMessageDialog(null, "Creating call graph was successful.\nYou may open the generated html file in any browser." +
"\nThe file is located at " + ProjectModule.getProjectPath() + File.separator + "static_call_graph.html", "Call Graph is ready", JOptionPane.PLAIN_MESSAGE);
*/
//new PopUpView("static_call_graph.html").show();
String path = "/html/";
String filename = "callchains.html";
new CallGraphView(path + filename, e.getProject()).show();
} else {
Messages.showMessageDialog(
e.getProject(),
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/actions/PluginTestView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package actions;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.ui.Messages;
import org.jetbrains.annotations.NotNull;
import services.FlServiceImpl;
import services.Resources;
import ui.ViewTest;

public class PluginTestView extends DumbAwareAction {
/**
* When you click on the menu item, then this will show the table data.
* If the Fault localization has been run, then it will just open the data with the results
* Otherwise it presents an error message.
* @param e
*/
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
FlServiceImpl flService = new FlServiceImpl();
if (flService.isTestDataCollected()) {
flService.setViewTestTableDialogOpened(true);
new ViewTest().show();
} else {
Messages.showMessageDialog(
e.getProject(),
Resources.get("errors", "run_tests_error"),
Resources.get("titles", "data_not_collected_title"),
Messages.getErrorIcon());
}
}
}
22 changes: 22 additions & 0 deletions src/main/java/models/bean/ClassTestData.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class ClassTestData implements ITestData{
private double ochiai;
private double wong2;
private double dstar;
private double barinel;
private double barinelModified;
private int rank;
private boolean faulty;
private String relativePath;
Expand All @@ -27,6 +29,8 @@ public ClassTestData() {
ochiai = 0;
wong2 = 0;
dstar = 0;
barinel = 0;
barinelModified = 0;
rank = 0;
faulty = false;
relativePath = "";
Expand Down Expand Up @@ -63,6 +67,24 @@ public void setLine(int line) {
this.line = line;
}

@Override
public double getBarinel() {
return barinel;
}

@Override
public void setBarinel(double barinel) {
this.barinel = barinel;
}

public double getBarinelModified() {
return barinelModified;
}

public void setBarinelModified(double barinelModified) {
this.barinelModified = barinelModified;
}

/**
* This provides the tarantula score of the class.
* @return the score
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/models/bean/Formula.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package models.bean;

public enum Formula {
TARANTULA, OCHIAI, DSTAR, WONG2;
TARANTULA, OCHIAI, DSTAR, WONG2, BARINEL, BARINEL_MODIFIED;
}
5 changes: 5 additions & 0 deletions src/main/java/models/bean/ITestData.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ public interface ITestData {

void setLine(int line);

double getBarinel();
void setBarinel(double barinel);

double getBarinelModified();
void setBarinelModified(double barinelModified);
double getTarantula();

void setTarantula(double tarantula);
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/models/bean/MethodTestData.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class MethodTestData implements ITestData {
private double ochiai;
private double wong2;
private double dstar;
private double barinel;
private double barinelModified;
private int rank;
private boolean faulty;
private ArrayList<ITestData> statements;
Expand All @@ -36,6 +38,8 @@ public MethodTestData() {
ochiai = 0;
wong2 = 0;
dstar = 0;
barinel = 0;
barinelModified = 0;
rank = 0;
faulty = false;
statements = new ArrayList<>();
Expand Down Expand Up @@ -176,6 +180,21 @@ public void setDstar(double wong2) {
this.dstar = dstar;
}

public double getBarinel() {
return barinel;
}

public void setBarinel(double barinel) {
this.barinel = barinel;
}

public double getBarinelModified() {
return barinelModified;
}

public void setBarinelModified(double barinelModified) {
this.barinelModified = barinelModified;
}

public int getRank() {
return rank;
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/models/bean/StatementTestData.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class StatementTestData implements ITestData {
private double ochiai;
private double wong2;
private double dstar;
private double barinel;
private double barinelModified;
private int rank;
private boolean faulty;
private CloseContext closeContext;
Expand All @@ -31,6 +33,8 @@ public StatementTestData() {
ochiai = 0;
wong2 = 0;
dstar = 0;
barinel = 0;
barinelModified = 0;
rank = 0;
faulty = false;
closeContext = new CloseContext(this);
Expand Down Expand Up @@ -98,6 +102,18 @@ public void setLine(int line) {
this.line = line;
}

public double getBarinel() {
return barinel;
}
public void setBarinel(double barinel) {
this.barinel = barinel;
}
public double getBarinelModified() {
return barinelModified;
}
public void setBarinelModified(double barinelModified) {
this.barinelModified = barinelModified;
}
/**
* This provides the tarantula score of the class.
*
Expand Down
53 changes: 53 additions & 0 deletions src/main/java/models/bean/TableData.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class TableData {
private double tarantulaScore;
private double ochiaiScore;
private double wong2Score;
private double barinelScore;
private double barinelModifiedScore;
private double minRank;
private double maxRank;
private double avgRank;
Expand All @@ -24,20 +26,31 @@ public class TableData {
private int level;
private boolean hide;

private String testName;

private String testResult;

private String testHeuristic;

public TableData() {
name = "";
path = "";
line = 0;
tarantulaScore = 0;
ochiaiScore = 0;
wong2Score = 0;
barinelScore = 0;
barinelModifiedScore = 0;
minRank = 0;
maxRank = 0;
avgRank = 0;
faulty = false;
icon = null;
level = 0;
hide = false;
testName = "";
testResult = "";
testHeuristic = "";
}

public String getName() {
Expand Down Expand Up @@ -88,6 +101,22 @@ public void setWong2Score(double wong2Score) {
this.wong2Score = wong2Score;
}

public double getBarinelScore() {
return barinelScore;
}

public void setBarinelScore(double barinelScore) {
this.barinelScore = barinelScore;
}

public double getBarinelModifiedScore() {
return barinelModifiedScore;
}

public void setBarinelModifiedScore(double barinelModifiedScore) {
this.barinelModifiedScore = barinelModifiedScore;
}

public double getMinRank() {
return minRank;
}
Expand Down Expand Up @@ -136,6 +165,30 @@ public void setLevel(int level) {
this.level = level;
}

public String getTestName() {
return testName;
}

public void setTestName(String testName) {
this.testName = testName;
}

public String getTestResult() {
return testResult;
}

public void setTestResult(String testResult) {
this.testResult = testResult;
}

public String getTestHeuristic() {
return testHeuristic;
}

public void setTestHeuristic(String testHeuristic) {
this.testHeuristic = testHeuristic;
}

/**
* Tells you whether the row is hidden or not
* @return true if the row is hidden
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/models/bean/TestResultData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package models.bean;

import java.util.ArrayList;

public class TestResultData{
String testname;
ArrayList<String> list;


public String getTestname() {
return testname;
}

public void setTestname(String testname) {
this.testname = testname;
}

public ArrayList<String> getList() {
return list;
}

public void setList(ArrayList<String> list) {
this.list = list;
}
}
Loading