Skip to content
Closed
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
71 changes: 57 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@
<developerConnection>scm:git:git@github.com:jenkinsci/cppcheck-plugin.git</developerConnection>
<tag>HEAD</tag>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<jaxb.api.version>2.2.1</jaxb.api.version>
<jaxb.impl.version>2.2.1.1</jaxb.impl.version>
<jaxb2.maven.plugin.version>2.1</jaxb2.maven.plugin.version>
<jaxb2.maven.plugin.version>2.3</jaxb2.maven.plugin.version>
<java2html.version>5.0</java2html.version>
<junit.version>4.8.2</junit.version>
<mockito.version>1.8.5</mockito.version>
<dashboard.view.version>2.0</dashboard.view.version>
<jenkins.version>2.30</jenkins.version>
<jenkins.version>2.30</jenkins.version>
</properties>

<repositories>
Expand Down Expand Up @@ -121,6 +121,50 @@
</dependencies>

<build>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only.
It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<versionRange>[0.5,)
</versionRange>
<goals>
<goal>prepare-agent</goal>
</goals>
</pluginExecutionFilter>
<action>
<!-- m2e doesn't know what to do with jacoco,
let's ignore it or annoying error markers appear
see http://wiki.eclipse.org/M2E_plugin_execution_not_covered
-->
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>InjectedTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>

<plugin>
Expand All @@ -135,7 +179,6 @@
<sources>
<source>${basedir}/src/main/resources/com/thalesgroup/hudson/plugins/cppcheck/cppcheck-1.0.xsd</source>
</sources>
<clearOutputDir>false</clearOutputDir>
</configuration>
<goals>
<goal>xjc</goal>
Expand All @@ -155,16 +198,16 @@
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<!--<version>2.10.4</version>-->
<configuration>
<!--Exclude packages:-->
<excludePackageNames>org.jenkinsci.plugins.cppcheck.model:com.thalesgroup.jenkinsci.plugins.cppcheck.model</excludePackageNames>
</configuration>
</plugin>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<!--<version>2.10.4</version>-->
<configuration>
<!--Exclude packages:-->
<excludePackageNames>org.jenkinsci.plugins.cppcheck.model:com.thalesgroup.jenkinsci.plugins.cppcheck.model</excludePackageNames>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public final String generateURL(final CategoryDataset dataset, final int row, fi
private NumberOnlyBuildLabel getLabel(final CategoryDataset dataset, final int column) {
return (NumberOnlyBuildLabel) dataset.getColumnKey(column);
}

/**
* Checks this instance for equality with an arbitrary object.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import com.thalesgroup.hudson.plugins.cppcheck.model.CppcheckSourceContainer;
import com.thalesgroup.hudson.plugins.cppcheck.util.AbstractCppcheckBuildAction;
import com.thalesgroup.hudson.plugins.cppcheck.util.CppcheckBuildHealthEvaluator;

import hudson.model.Run;
import hudson.model.HealthReport;
import hudson.model.Run;
import hudson.util.ChartUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
package com.thalesgroup.hudson.plugins.cppcheck;

import com.thalesgroup.hudson.plugins.cppcheck.util.AbstractCppcheckProjectAction;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Result;
Expand All @@ -48,6 +50,7 @@ public CppcheckProjectAction(final AbstractProject<?, ?> project) {
}

@SuppressWarnings("unused")
@SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
public final boolean isDisplayGraph() {
//Latest
AbstractBuild<?, ?> b = getLastFinishedBuild();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private void buildFileContent() {

splitSourceFile(highlightSource(is));
} catch (IOException exception) {
sourceCode = "Can't read file: " + exception.getLocalizedMessage();
sourceCode = "Can't read file : " + exception.getLocalizedMessage();
} catch (RuntimeException re) {
sourceCode = "Problem for display the source code content: " + re.getLocalizedMessage();
} finally {
Expand Down Expand Up @@ -224,7 +224,7 @@ private void copyLine(final StringBuilder output, final LineIterator lineIterato
*
* @param file the source file to highlight
* @return the source as an HTML string
* @throws IOException
* @throws IOException if cannot read source or cannot write highlighted source
*/
public final String highlightSource(final InputStream file) throws IOException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import org.apache.commons.lang.StringUtils;
import org.jenkinsci.plugins.cppcheck.CppcheckDiffState;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.io.File;
import java.io.Serializable;

Expand Down Expand Up @@ -57,6 +59,7 @@ public class CppcheckWorkspaceFile implements Serializable {
*/
private transient CppcheckDiffState diffState = null;

@SuppressFBWarnings("NP_NULL_ON_SOME_PATH")
public CppcheckWorkspaceFile(File file) {
if (file != null)
this.fileName = file.getAbsolutePath().replace('\\', '/');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class CppcheckUtil {
*
* @param cppecheckConfig configuration of CppCheck run
* @param result results of the CPPCheck runs
* @param checkNewError check is the number of errors is increasing
* @param checkNewError check if the number of errors is increasing
* @return number of errors
*/
public static int getNumberErrors(CppcheckConfig cppecheckConfig, CppcheckResult result, boolean checkNewError) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public CppcheckBuildAction(Run<?, ?> owner, CppcheckResult result, CppcheckConfi
this.result = result;
this.healthReportPercentage = healthReportPercentage;

List<CppcheckProjectAction> projectActions = new ArrayList<>();
List<CppcheckProjectAction> projectActions = new ArrayList<CppcheckProjectAction>();
projectActions.add(new CppcheckProjectAction(owner, config.getConfigGraph()));
this.projectActions = projectActions;
}
Expand Down
Loading