<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-forcingVulnerabilityThresholdEnabled.html<|end_filename|>
<div>
    Enabling this option will set default global settings to all jobs that are not using specific settings.
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-generatePdfReport.html<|end_filename|>
<div>
    Downloads a PDF report with scan results from the Checkmarx server. The report is available via a link on "Checkmarx Scan Results" page.
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-prohibitProjectCreation.html<|end_filename|>
<div>
    Enabling this option will prohibit creation of new projects in Checkmarx, or assigning an existing project to a different team.<br/>
    Disabling this option will allow this action.
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-osaInstallBeforeScan.html<|end_filename|>
<div>
    Select this option in order to be able to scan packages from various dependency managers (NPM, Nugget, Python and more.) as part of the CxOSA scan
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-lowThresholdEnforcement.html<|end_filename|>
<div>
    Low severity vulnerability threshold. If set, the threshold is crossed if number of low severity vulnerabilities exceeds it.
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-vulnerabilityThresholdEnabled.html<|end_filename|>
<div>
    Mark the build as unstable if the number of high severity vulnerabilities is above the specified threshold.
</div>

<|start_filename|>src/main/java/com/checkmarx/jenkins/JobStatusOnError.java<|end_filename|>
package com.checkmarx.jenkins;

public enum JobStatusOnError {
	GLOBAL("Use Global Settings"), FAILURE("Failure"), UNSTABLE("Unstable");

	private final String displayName;

	JobStatusOnError(String displayName) {
		this.displayName = displayName;
	}

	public String getDisplayName() {
		return displayName;
	}
}

<|start_filename|>src/main/java/com/checkmarx/jenkins/MavenProjectResult.java<|end_filename|>
package com.checkmarx.jenkins;

import hudson.maven.MavenModuleSet;
import hudson.model.AbstractProject;
import hudson.model.Action;

import java.util.LinkedList;

/**
 * @author tsahi
 * @since 02/06/16
 */
public class MavenProjectResult {
    private AbstractProject project;

    public MavenProjectResult(AbstractProject project) {
        this.project = project;
    }

    public LinkedList<Action> getMavenProjectResult(){
        if (project instanceof MavenModuleSet) {
            MavenModuleSet mavenProject = (MavenModuleSet) project;
            if (mavenProject.getPrebuilders().get(CxScanBuilder.class) != null
                    || mavenProject.getPostbuilders().get(CxScanBuilder.class) != null) {
                LinkedList<Action> list = new LinkedList<Action>();
                list.add(new CxProjectResult(project));
                return list;
            }
        }
        return null;
    }
}


<|start_filename|>src/main/java/com/checkmarx/jenkins/JobGlobalStatusOnThresholdViolation.java<|end_filename|>
package com.checkmarx.jenkins;

public enum JobGlobalStatusOnThresholdViolation {

	FAILURE("Failure"), UNSTABLE("Unstable");

	private final String displayName;

	JobGlobalStatusOnThresholdViolation(String displayName) {
		this.displayName = displayName;
	}

	public String getDisplayName() {
		return displayName;
	}
}

<|start_filename|>src/main/java/com/checkmarx/jenkins/CxResultSeverity.java<|end_filename|>
package com.checkmarx.jenkins;

/**
 * This class represents the severity of a result in a scan report
 */
public enum  CxResultSeverity {
    HIGH("High","3"),
    MEDIUM("Medium","2"),
    LOW("Low","1"),
    INFO("Info","0");


    private final String displayString; // This value is used for displaying a legend in a graph, and similar display uses
    public final String xmlParseString; // This value is used for detecting result severity while parsing results xml

    private CxResultSeverity(String displayString, String xmlParseString)
    {
        this.displayString = displayString;
        this.xmlParseString = xmlParseString;
    }

    @Override
    public String toString()
    {
        return displayString;
    }
}


<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-projectName.html<|end_filename|>
<div>
    A full absolute name of a project. The full Project name includes the
    whole path to the project, including Server, service provider, company,
    and team. Example: "CxServer\SP\Company\Users\bs_java" If
    project with such a name doesn't exist in the system, new project will
    be created. May reference build parameters like ${PARAM}.
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-enableProjectPolicyEnforcement.html<|end_filename|>
<div>
    Mark the build as failed or unstable if the project's policy is violated.<br>
    Note:<br>
    Assigning a policy to a project is done from within CxSAST<br>

</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-fullScanCycle.html<|end_filename|>
<div>
    Incremental scans are faster, but with time they become less accurate.</br>
    Therefore, after a number of incremental scans it is recommended to perform a full scan.</br>
    Here you can schedule periodic full scans to be executed after a certain number of incremental scans.</br></br>
    Alternatively, if you want to run full scans on weekends, you can create 2 separate jobs.</br>
    First job - to run incremental scans on weekdays and second job - to run full scans on weekends.
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-excludeFolders.html<|end_filename|>
<div>
    Comma separated list of folders to exclude from scan. Entries in this list are automatically converted
    to exclude wildcard patterns and appended to the full pattern list provided in the advanced section. May reference build parameters like ${PARAM}.
    <p>
    Conversion is done as follows: <br/>
    <code>fold1, fold2 fold3</code><br/>
    is converted to: <br/>
    <code>!**/fold1/**/*, !**/fold2/**/*, !**/fold3/**/*, </code>
    </p>
</div>

<|start_filename|>src/main/java/com/checkmarx/jenkins/legacy8_7/ScanDetails.java<|end_filename|>
package com.checkmarx.jenkins.legacy8_7;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

/**
 * Created by zoharby on 09/01/2017.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class ScanDetails {

    @JsonProperty("id")
    private String id;//"cc5ce4a8-daeb-43d3-a594-83ace96df8e2", nn
    @JsonProperty("startAnalyzeTime")
    private String startAnalyzeTime;//:"2016-12-19T10:16:06.1196743Z",
    @JsonProperty("endAnalyzeTime")
    private String endAnalyzeTime;//:"2016-12-19T10:29:06.1196743Z",
    @JsonProperty("origin")
    private String origin;//:"Eclipse",
    @JsonProperty("state")
    private State state;
    @JsonProperty("sharedSourceLocationPaths")
    private List<String> sharedSourceLocationPaths;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getStartAnalyzeTime() {
        return startAnalyzeTime;
    }

    public void setStartAnalyzeTime(String startAnalyzeTime) {
        this.startAnalyzeTime = startAnalyzeTime;
    }

    public String getEndAnalyzeTime() {
        return endAnalyzeTime;
    }

    public void setEndAnalyzeTime(String endAnalyzeTime) {
        this.endAnalyzeTime = endAnalyzeTime;
    }

    public String getOrigin() {
        return origin;
    }

    public void setOrigin(String origin) {
        this.origin = origin;
    }

    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
    }

    public List<String> getSharedSourceLocationPaths() {
        return sharedSourceLocationPaths;
    }

    public void setSharedSourceLocationPaths(List<String> sharedSourceLocationPaths) {
        this.sharedSourceLocationPaths = sharedSourceLocationPaths;
    }

    public static class State{
        @JsonProperty("id")
        int id;
        @JsonProperty("name")
        String name;
        @JsonProperty("failureReason")
        String failureReason;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getFailureReason() {
            return failureReason;
        }

        public void setFailureReason(String failureReason) {
            this.failureReason = failureReason;
        }
    }
}


<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-avoidDuplicateProjectScans.html<|end_filename|>
<div>
    If there is a scan of this project in the queue in status working or queued do not send a new scan request to Checkmarx
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-waitForResultsEnabled.html<|end_filename|>
<div>
    In synchronous mode, Checkmarx build step will wait for Checkmarx scan to complete, then retrieve scan results and optionally check vulnerability thresholds.
    When disabled, the build step finishes after scan job submissions to Checkmarx server.
</div>

<|start_filename|>src/main/java/com/checkmarx/jenkins/legacy8_7/QueryResult.java<|end_filename|>
package com.checkmarx.jenkins.legacy8_7;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * Created by zoharby on 22/01/2017.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class QueryResult {

        @Nullable
        @JsonProperty("name")
        private String name;
        @Nullable
        @JsonProperty("severity")
        private String severity;
        @JsonProperty("count")
        private int count;

        @Nullable
        public String getName() {
            return name;
        }

        public void setName(@Nullable String name) {
            this.name = name;
        }

        @Nullable
        public String getSeverity() {
            return severity;
        }

        public void setSeverity(@Nullable String severity) {
            this.severity = severity;
        }

        public int getCount() {
            return count;
        }

        public void setCount(int count) {
            this.count = count;
        }

        @NotNull
        public String getPrettyName() {
            if (this.name != null) {
                return this.name.replace('_', ' ');
            } else {
                return "";
            }
        }
}


<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-generateXmlReport.html<|end_filename|>
<div>
    Generate full XML and HTML CxSAST scan reports. These reports will contain additional information about the detected vulnerabilities
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-highThresholdEnforcement.html<|end_filename|>
<div>
    High severity vulnerability threshold. If set, the threshold is crossed if number of high severity vulnerabilities exceeds it.
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-osaArchiveIncludePatterns.html<|end_filename|>
<br>
    Comma separated list of archive wildcard patterns to include their extracted content for the scan. eg. *.zip, *.jar, *.ear</br>
    Supported archive types are: jar, war, ear, sca, gem, whl, egg, tar, tar.gz, tgz, zip, rar</br>
    Leave empty to extract all archives
</div>

<|start_filename|>src/main/java/com/checkmarx/jenkins/exception/CxCredException.java<|end_filename|>
package com.checkmarx.jenkins.exception;

import com.cx.restclient.exception.CxClientException;

/**
 * Created by shaulv on 6/20/2018.
 */
public class CxCredException extends CxClientException {

    public CxCredException() {
        super();
    }

    public CxCredException(String message) {
        super(message);
    }

    public CxCredException(String message, Throwable cause) {
        super(message, cause);
    }

    public CxCredException(Throwable cause) {
        super(cause);
    }
}


<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-mediumThresholdEnforcement.html<|end_filename|>
<div>
    Medium severity vulnerability threshold. If set, the threshold is crossed if number of medium severity vulnerabilities exceeds it.
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-serverUrl.html<|end_filename|>
<div>
    Checkmarx server url or ip address with or without port. Syntax: http(s)://server-name:port. Example: http://checkmarx-server, https://10.0.0.255:9495
</div>


<|start_filename|>src/main/java/com/checkmarx/jenkins/legacy8_7/ThresholdConfig.java<|end_filename|>
package com.checkmarx.jenkins.legacy8_7;

import hudson.model.Result;

public class ThresholdConfig {
    private Integer highSeverity;
    private Integer mediumSeverity;
    private Integer lowSeverity;
    private Result buildStatus;
    
	public Integer getHighSeverity() {
		return highSeverity;
	}
	public void setHighSeverity(Integer highSeverity) {
		this.highSeverity = highSeverity;
	}
	public Integer getMediumSeverity() {
		return mediumSeverity;
	}
	public void setMediumSeverity(Integer mediumSeverity) {
		this.mediumSeverity = mediumSeverity;
	}
	public Integer getLowSeverity() {
		return lowSeverity;
	}
	public void setLowSeverity(Integer lowSeverity) {
		this.lowSeverity = lowSeverity;
	}
	public Result getBuildStatus() {
		return buildStatus;
	}
	public void setBuildStatus(Result buildStatus) {
		this.buildStatus = buildStatus;
	}
}


<|start_filename|>src/main/java/com/checkmarx/jenkins/CxPlugin.java<|end_filename|>
package com.checkmarx.jenkins;

import hudson.Plugin;

/**
 *
 * @author denis
 * @since 3/11/13
 */
//todo check if this class is needed
public class CxPlugin extends Plugin {

}


<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-jobStatusOnError.html<|end_filename|>
<div>
	Determines how to act when a triggered Checkmarx scan in synchronous mode fails and returns an error message (i.e. no scan results, not to be confused with
	valid scan results that exceed the threshold).
	<ul>
		<li>FAILURE is equivalent to a Job error that fails the entire build.</li>
		<li>UNSTABLE is equivalent to a Job warning that allows the build to proceed normally but provides an unstable status upon completion.</li>
		<li>Use the global setting implies that this project uses the value either FAILURE or UNSTABLE defined globally by the CxSAST Jenkins plugin.</li>
	</ul>
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-disableCertificateValidation.html<|end_filename|>
<div>
    Enable TLS/SSL server certificate validation. When disabled, allows connecting to Checkmarx server with untrusted self-signed certificate.
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-jobGlobalStatusOnError.html<|end_filename|>
<div>
	Determines how to act when a triggered CxSAST scan in synchronous/asynchronous modes fails and returns an error message (i.e. no scan results, not to be
	confused with valid scan results that exceed the threshold).
	<ul>
		<li>FAILURE is equivalent to a Job error that fails the entire build.</li>
		<li>UNSTABLE is equivalent to a Job warning that allows the build to proceed normally but provides an unstable status upon completion.</li>
	</ul>
</div>

<|start_filename|>src/main/resources/com/checkmarx/jenkins/CxScanBuilder/help-includeOpenSourceFolders.html<|end_filename|>
<div>
    <p>
        Include/Exclude definition will not affect dependencies resolved from package manager manifest files.
    </p>
    Comma separated list of include or exclude wildcard patterns.
    Exclude patterns start with exclamation mark "!".
    <p>
        Example: <code>
        *.jar
        */folder/*
        */folder1/folder2/*
        */folder*/*

        */file.*
        */file*.jar
        */test/*file*.*
    </code>
    </p>

    <p>May reference build parameters like ${PARAM}.</p>
    <p>
        Examples:
    </p><p>
    "**/*.jar" matches all .jar jars in a directory tree.
</p><p>
    "*/test/a??.jar" matches all files/dirs which start with an 'a', then two
    more characters and then ".jar", in a directory called test.
</p><p>
    "**" matches everything in a directory tree.
</p><p>
    "**/test/**/XYZ*" matches all files/dirs which start with "XYZ" and where
    there is a parent directory called test (e.g. "abc/test/def/ghi/XYZ123").
</div>