Skip to content

Commit

Permalink
cnescatlab#23 - CheckResult creation. Replace Violation by CheckResult.
Browse files Browse the repository at this point in the history
  • Loading branch information
dupuisa committed May 23, 2017
1 parent 45dd1e9 commit e933456
Show file tree
Hide file tree
Showing 2 changed files with 210 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
package fr.cnes.analysis.tools.analyzer.datas;

import java.io.File;

public class CheckResult {

/** Check name. */
private String name;

/** Check id. */
private String id;

/** Langage id. */
private String langageId;

/** Check location. */
private String location;

/** Check line. */
private Integer line;

/** Violation message. */
private String message;

/** Metric value. */
private Float value;

/** Analysed file. */
private File file;

public CheckResult(String name, String id, String langageId) {
// TODO Auto-generated constructor stub
}

public CheckResult(String name, String id, File file) {
this.name = name;
this.id = id;
this.file = file;
}

/**
* @return the name
*/
public String getName() {
return name;
}

/**
* @param name
* the name to set
*/
public void setName(String name) {
this.name = name;
}

/**
* @return the id
*/
public String getId() {
return id;
}

/**
* @param id
* the id to set
*/
public void setId(String id) {
this.id = id;
}

/**
* @return the location
*/
public String getLocation() {
return location;
}

/**
* @param location
* the location to set
*/
public void setLocation(String location) {
this.location = location;
}

/**
* @return the line
*/
public Integer getLine() {
return line;
}

/**
* @param line
* the line to set
*/
public void setLine(Integer line) {
this.line = line;
}

/**
* @return the message
*/
public String getMessage() {
return message;
}

/**
* @param message
* the message to set
*/
public void setMessage(String message) {
this.message = message;
}

/**
* @return the value
*/
public Float getValue() {
return value;
}

/**
* @param value
* the value to set
*/
public void setValue(Float value) {
this.value = value;
}

/**
* @return the langageId
*/
public String getLangageId() {
return langageId;
}

/**
* @param langageId
* the langageId to set
*/
public void setLangageId(String langageId) {
this.langageId = langageId;
}

/**
* @return the file
*/
public File getFile() {
return file;
}

/**
* @param file
* the file to set
*/
public void setFile(File file) {
this.file = file;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package fr.cnes.analysis.tools.analyzer.datas;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.LinkedList;
import java.util.List;

import fr.cnes.analysis.tools.analyzer.exception.JFlexException;

public class Checker {

private String name;
private String id;
private String langageId;

/** Check results list. */
private List<CheckResult> checkResults = new LinkedList<CheckResult>();;

/**
* Method to add a violation, knowing its location and line.
*
* @param pLocation
* the location
*
* @param pMessage
* violation's message
* @param pLine
* the line
* @throws JFlexException
* exception thrown when cloning error appears
*/
protected void setError(final String pLocation, final String pMessage, final int pLine) throws JFlexException {
CheckResult checkResult = new CheckResult(name, id, langageId);
checkResult.setLine(pLine);
checkResult.setLocation(pLocation);
checkResult.setMessage(pMessage);
checkResults.add(checkResult);
}

/**
*
* @param file
* @throws FileNotFoundException
*/

public void setInputFile(final File file) throws FileNotFoundException {
this.checkResults = new LinkedList<CheckResult>();
}
}

0 comments on commit e933456

Please sign in to comment.