Skip to content

Commit

Permalink
Fix JavaDoc issues reported by Codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
garyttierney committed Mar 31, 2019
1 parent 8790310 commit 7bd6ad0
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions src/main/java/edu/hm/hafner/analysis/parser/CargoCheckParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,52 @@
import edu.hm.hafner.analysis.Severity;

/**
* A parser for {@code rustc} compiler messages in the JSON format emitted by {@code cargo check --message-format
* json}.
* A parser for {@code rustc} compiler messages in the JSON format emitted by {@code cargo check --message-format json}.
* .
*/
public class CargoCheckParser extends IssueParser {
private static final long serialVersionUID = 7953467739178377581L;

/** The {@link #REASON} associated with messages that have code analysis information */
/** The {@link #REASON} associated with messages that have code analysis information. */
private static final String ANALYSIS_MESSAGE_REASON = "compiler-message";

/** Top-level key indicating the reason for a message to be emitted, we only care about compiler-message */
/** Top-level key indicating the reason for a message to be emitted, we only care about compiler-message. */
private static final String REASON = "reason";

/** Top-level key containing the code analysis message */
/** Top-level key containing the code analysis message. */
private static final String MESSAGE = "message";

/** Key for {@code message.code}, an object containing the message category */
/** Key for {@code message.code}, an object containing the message category. */
private static final String MESSAGE_CODE = "code";

/** Key for {@code message.code.code}, a string representation of the message category */
/** Key for {@code message.code.code}, a string representation of the message category. */
private static final String MESSAGE_CODE_CATEGORY = "code";

/** Key for {@code message.rendered}, the rendered string representation of the message */
/** Key for {@code message.rendered}, the rendered string representation of the message. */
private static final String MESSAGE_RENDERED = "message";

/** Key for {@code message.level}, the string representation of the message severity */
/** Key for {@code message.level}, the string representation of the message severity. */
private static final String MESSAGE_LEVEL = "level";

/** Key for {@code message.spans}, an array of message location information */
/** Key for {@code message.spans}, an array of message location information. */
private static final String MESSAGE_SPANS = "spans";

/** Key for {@code message.spans.is_primary}, a boolean indicating if this is the primary error location" */
/** Key for {@code message.spans.is_primary}, a boolean indicating if this is the primary error location". */
private static final String MESSAGE_SPAN_IS_PRIMARY = "is_primary";

/** Key for {@code message.spans.file_name}, a relative path to the file the message was emitted for */
/** Key for {@code message.spans.file_name}, a relative path to the file the message was emitted for. */
private static final String MESSAGE_SPAN_FILE_NAME = "file_name";

/** Key for {@code message.spans.line_start}, the line number where the associated code starts */
/** Key for {@code message.spans.line_start}, the line number where the associated code starts. */
private static final String MESSAGE_SPAN_LINE_START = "line_start";

/** Key for {@code message.spans.line_end}, the line number where the associated code ends */
/** Key for {@code message.spans.line_end}, the line number where the associated code ends. */
private static final String MESSAGE_SPAN_LINE_END = "line_end";

/** Key for {@code message.spans.column_start}, the column number where the associated code starts */
/** Key for {@code message.spans.column_start}, the column number where the associated code starts. */
private static final String MESSAGE_SPAN_COLUMN_START = "column_start";

/** Key for {@code message.spans.column_end}, the column number where the associated code ends */
/** Key for {@code message.spans.column_end}, the column number where the associated code ends. */
private static final String MESSAGE_SPAN_COLUMN_END = "column_end";

@Override
Expand All @@ -82,7 +82,9 @@ public Report parse(final ReaderFactory readerFactory) throws ParsingException,

/**
* Extract the compiler message from a cargo event if any is present.
* @param object A cargo event that may contain a compiler message.
*
* @param object
* A cargo event that may contain a compiler message.
*
* @return a built {@link Issue} object if any was present.
*/
Expand Down Expand Up @@ -132,6 +134,9 @@ private Optional<CompilerMessageDetails> parseDetails(final JSONObject message)
return Optional.empty();
}

/**
* A simplified representation of a primary {@code span} object in the {@code message.spans} an array.
*/
private static final class CompilerMessageDetails {
private final String fileName;
private final int lineStart;
Expand Down

0 comments on commit 7bd6ad0

Please sign in to comment.