Skip to content

Commit

Permalink
Merge pull request #4 from mixalturek/master
Browse files Browse the repository at this point in the history
[JENKINS-18029] Selected line with static analysis violation is hidden because breadcrumb covers it
  • Loading branch information
mixalturek committed Mar 8, 2014
2 parents 2962a47 + 70008f0 commit 5ba9108
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Expand Up @@ -229,7 +229,6 @@ public final String highlightSource(final InputStream file) throws IOException {
*
* @return the source code content as a String object
*/
@SuppressWarnings("unused")
public String getSourceCode() {
return sourceCode;
}
Expand All @@ -239,7 +238,6 @@ public String getSourceCode() {
*
* @return the workspace file
*/
@SuppressWarnings("unused")
public CppcheckWorkspaceFile getCppcheckWorkspaceFile() {
return cppcheckWorkspaceFile;
}
Expand Down
Expand Up @@ -60,6 +60,15 @@ public int getLineNumber() {
return lineNumber;
}

/**
* Returns the line number that should be shown on top of the source code view.
*
* @return the line number
*/
public int getLinkLineNumber() {
return Math.max(1, lineNumber - 10);
}

public void setLineNumber(int lineNumber) {
this.lineNumber = lineNumber;
}
Expand Down Expand Up @@ -92,7 +101,6 @@ public void setSeverity(String severity) {
}

@Exported
@SuppressWarnings("unused")
public Integer getKey() {
return key;
}
Expand Down
Expand Up @@ -39,7 +39,7 @@
${cppcheckfile.lineNumber}
</j:if>
<j:if test="${not elt.isSourceIgnored()}">
<a href="source.${cppcheckfile.key}#${cppcheckfile.lineNumber}">${cppcheckfile.lineNumber}</a>
<a href="source.${cppcheckfile.key}#${cppcheckfile.linkLineNumber}">${cppcheckfile.lineNumber}</a>
</j:if>
</td>
<td class="pane">${cppcheckfile.severity}</td>
Expand Down

0 comments on commit 5ba9108

Please sign in to comment.