View Javadoc
1   /*
2    * This file is part of dependency-check-ant.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   * Copyright (c) 2013 Jeremy Long. All Rights Reserved.
17   */
18  package org.owasp.dependencycheck.taskdefs;
19  
20  import java.io.File;
21  import java.util.ArrayList;
22  import java.util.List;
23  import javax.annotation.concurrent.NotThreadSafe;
24  
25  import org.apache.tools.ant.BuildException;
26  import org.apache.tools.ant.Project;
27  import org.apache.tools.ant.types.EnumeratedAttribute;
28  import org.apache.tools.ant.types.Reference;
29  import org.apache.tools.ant.types.Resource;
30  import org.apache.tools.ant.types.ResourceCollection;
31  import org.apache.tools.ant.types.resources.FileProvider;
32  import org.apache.tools.ant.types.resources.Resources;
33  import org.owasp.dependencycheck.Engine;
34  import org.owasp.dependencycheck.agent.DependencyCheckScanAgent;
35  import org.owasp.dependencycheck.data.nvdcve.DatabaseException;
36  import org.owasp.dependencycheck.dependency.Dependency;
37  import org.owasp.dependencycheck.dependency.Vulnerability;
38  import org.owasp.dependencycheck.exception.ExceptionCollection;
39  import org.owasp.dependencycheck.exception.ReportException;
40  import org.owasp.dependencycheck.reporting.ReportGenerator.Format;
41  import org.owasp.dependencycheck.utils.Downloader;
42  import org.owasp.dependencycheck.utils.InvalidSettingException;
43  import org.owasp.dependencycheck.utils.Settings;
44  import org.owasp.dependencycheck.utils.SeverityUtil;
45  import org.slf4j.impl.StaticLoggerBinder;
46  
47  //CSOFF: MethodCount
48  /**
49   * An Ant task definition to execute dependency-check during an Ant build.
50   *
51   * @author Jeremy Long
52   */
53  @NotThreadSafe
54  public class Check extends Update {
55  
56      /**
57       * System specific new line character.
58       */
59      private static final String NEW_LINE = System.getProperty("line.separator", "\n").intern();
60  
61      /**
62       * Whether the ruby gemspec analyzer should be enabled.
63       */
64      private Boolean rubygemsAnalyzerEnabled;
65      /**
66       * Whether or not the Node.js Analyzer is enabled.
67       */
68      private Boolean nodeAnalyzerEnabled;
69      /**
70       * Whether or not the Node Audit Analyzer is enabled.
71       */
72      private Boolean nodeAuditAnalyzerEnabled;
73      /**
74       * Whether or not the Yarn Audit Analyzer is enabled.
75       */
76      private Boolean yarnAuditAnalyzerEnabled;
77      /**
78       * Whether or not the Pnpm Audit Analyzer is enabled.
79       */
80      private Boolean pnpmAuditAnalyzerEnabled;
81      /**
82       * Sets whether or not the Node Audit Analyzer should use a local cache.
83       */
84      private Boolean nodeAuditAnalyzerUseCache;
85      /**
86       * Sets whether or not the Node Package Analyzer should skip dev
87       * dependencies.
88       */
89      private Boolean nodePackageSkipDevDependencies;
90      /**
91       * Sets whether or not the Node Audit Analyzer should use a local cache.
92       */
93      private Boolean nodeAuditSkipDevDependencies;
94      /**
95       * Whether or not the RetireJS Analyzer is enabled.
96       */
97      private Boolean retireJsAnalyzerEnabled;
98      /**
99       * The URL to the RetireJS JSON data.
100      */
101     private String retireJsUrl;
102     /**
103      * The user to download URL to the RetireJS JSON data.
104      */
105     private String retireJsUrlUser;
106     /**
107      * The password to download URL to the RetireJS JSON data.
108      */
109     private String retireJsUrlPassword;
110     /**
111      * Whether or not the RetireJS Analyzer will be updated regardless of the
112      * `autoupdate` settings. Defaults to false.
113      */
114     private Boolean retireJsAnalyzerForceUpdate;
115     /**
116      * The list of filters (regular expressions) used by the RetireJS Analyzer
117      * to exclude files that contain matching content..
118      */
119     @SuppressWarnings("CanBeFinal")
120     private final List<String> retirejsFilters = new ArrayList<>();
121     /**
122      * Whether or not the RetireJS Analyzer filters non-vulnerable JS files from
123      * the report; default is false.
124      */
125     private Boolean retirejsFilterNonVulnerable;
126     /**
127      * Whether or not the Ruby Bundle Audit Analyzer is enabled.
128      */
129     private Boolean bundleAuditAnalyzerEnabled;
130     /**
131      * Whether the CMake analyzer should be enabled.
132      */
133     private Boolean cmakeAnalyzerEnabled;
134     /**
135      * Whether or not the Open SSL analyzer is enabled.
136      */
137     private Boolean opensslAnalyzerEnabled;
138     /**
139      * Whether the python package analyzer should be enabled.
140      */
141     private Boolean pyPackageAnalyzerEnabled;
142     /**
143      * Whether the python distribution analyzer should be enabled.
144      */
145     private Boolean pyDistributionAnalyzerEnabled;
146     /**
147      * Whether or not the mix audit analyzer is enabled.
148      */
149     private Boolean mixAuditAnalyzerEnabled;
150     /**
151      * Whether or not the central analyzer is enabled.
152      */
153     private Boolean centralAnalyzerEnabled;
154     /**
155      * Whether or not the Central Analyzer should use a local cache.
156      */
157     private Boolean centralAnalyzerUseCache;
158     /**
159      * Whether or not the nexus analyzer is enabled.
160      */
161     private Boolean nexusAnalyzerEnabled;
162     /**
163      * The URL of a Nexus server's REST API end point
164      * (http://domain/nexus/service/local).
165      */
166     private String nexusUrl;
167     /**
168      * The username to authenticate to the Nexus Server's REST API Endpoint.
169      */
170     private String nexusUser;
171     /**
172      * The password to authenticate to the Nexus Server's REST API Endpoint.
173      */
174     private String nexusPassword;
175     /**
176      * Whether or not the defined proxy should be used when connecting to Nexus.
177      */
178     private Boolean nexusUsesProxy;
179 
180     /**
181      * Sets whether the Golang Dependency analyzer is enabled. Default is true.
182      */
183     private Boolean golangDepEnabled;
184     /**
185      * Sets whether Golang Module Analyzer is enabled; this requires `go` to be
186      * installed. Default is true.
187      */
188     private Boolean golangModEnabled;
189     /**
190      * Sets the path to `go`.
191      */
192     private String pathToGo;
193     /**
194      * Sets whether the Dart analyzer is enabled. Default is true.
195      */
196     private Boolean dartAnalyzerEnabled;
197     /**
198      * The path to `yarn`.
199      */
200     private String pathToYarn;
201     /**
202      * The path to `pnpm`.
203      */
204     private String pathToPnpm;
205     /**
206      * Additional ZIP File extensions to add analyze. This should be a
207      * comma-separated list of file extensions to treat like ZIP files.
208      */
209     private String zipExtensions;
210     /**
211      * The path to dotnet core for .NET assembly analysis.
212      */
213     private String pathToCore;
214     /**
215      * The name of the project being analyzed.
216      */
217     private String projectName = "dependency-check";
218     /**
219      * Specifies the destination directory for the generated Dependency-Check
220      * report.
221      */
222     private String reportOutputDirectory = ".";
223     /**
224      * If using the JUNIT report format the junitFailOnCVSS sets the CVSS score
225      * threshold that is considered a failure. The default is 0.
226      */
227     private float junitFailOnCVSS = 0;
228     /**
229      * Specifies if the build should be failed if a CVSS score above a specified
230      * level is identified. The default is 11 which means since the CVSS scores
231      * are 0-10, by default the build will never fail and the CVSS score is set
232      * to 11. The valid range for the fail build on CVSS is 0 to 11, where
233      * anything above 10 will not cause the build to fail.
234      */
235     private float failBuildOnCVSS = 11;
236     /**
237      * Sets whether auto-updating of the NVD CVE/CPE data is enabled. It is not
238      * recommended that this be turned to false. Default is true.
239      */
240     private Boolean autoUpdate;
241     /**
242      * The report format to be generated (HTML, XML, CSV, JSON, JUNIT, SARIF,
243      * JENKINS, GITLAB, ALL). Default is HTML.
244      */
245     private String reportFormat = "HTML";
246     /**
247      * The report format to be generated (HTML, XML, CSV, JSON, JUNIT, SARIF,
248      * JENKINS, GITLAB, ALL). Default is HTML.
249      */
250     private final List<String> reportFormats = new ArrayList<>();
251     /**
252      * Whether the JSON and XML reports should be pretty printed; the default is
253      * false.
254      */
255     private Boolean prettyPrint = null;
256 
257     /**
258      * Suppression file paths.
259      */
260     @SuppressWarnings("CanBeFinal")
261     private final List<String> suppressionFiles = new ArrayList<>();
262 
263     /**
264      * The path to the suppression file.
265      */
266     private String hintsFile;
267     /**
268      * flag indicating whether or not to show a summary of findings.
269      */
270     private boolean showSummary = true;
271     /**
272      * Whether experimental analyzers are enabled.
273      */
274     private Boolean enableExperimental;
275     /**
276      * Whether retired analyzers are enabled.
277      */
278     private Boolean enableRetired;
279     /**
280      * Whether or not the Jar Analyzer is enabled.
281      */
282     private Boolean jarAnalyzerEnabled;
283     /**
284      * Whether or not the Archive Analyzer is enabled.
285      */
286     private Boolean archiveAnalyzerEnabled;
287     /**
288      * Whether or not the Known Exploited Vulnerability Analyzer is enabled.
289      */
290     private Boolean knownExploitedEnabled;
291     /**
292      * The URL to the known exploited vulnerabilities JSON datafeed.
293      */
294     private String knownExploitedUrl;
295     /**
296      * Whether or not the .NET Nuspec Analyzer is enabled.
297      */
298     private Boolean nuspecAnalyzerEnabled;
299     /**
300      * Whether or not the .NET Nuget packages.config file Analyzer is enabled.
301      */
302     private Boolean nugetconfAnalyzerEnabled;
303     /**
304      * Whether or not the Libman Analyzer is enabled.
305      */
306     private Boolean libmanAnalyzerEnabled;
307     /**
308      * Whether or not the PHP Composer Analyzer is enabled.
309      */
310     private Boolean composerAnalyzerEnabled;
311     /**
312      * Whether or not the PHP Composer Analyzer will skip "packages-dev".
313      */
314     private Boolean composerAnalyzerSkipDev;
315     /**
316      * Whether or not the Perl CPAN File Analyzer is enabled.
317      */
318     private Boolean cpanfileAnalyzerEnabled;
319 
320     /**
321      * Whether or not the .NET Assembly Analyzer is enabled.
322      */
323     private Boolean assemblyAnalyzerEnabled;
324     /**
325      * Whether or not the MS Build Assembly Analyzer is enabled.
326      */
327     private Boolean msbuildAnalyzerEnabled;
328     /**
329      * Whether the autoconf analyzer should be enabled.
330      */
331     private Boolean autoconfAnalyzerEnabled;
332     /**
333      * Whether the pip analyzer should be enabled.
334      */
335     private Boolean pipAnalyzerEnabled;
336     /**
337      * Whether the Maven install.json analyzer should be enabled.
338      */
339     private Boolean mavenInstallAnalyzerEnabled;
340     /**
341      * Whether the pipfile analyzer should be enabled.
342      */
343     private Boolean pipfileAnalyzerEnabled;
344     /**
345      * Whether the Poetry analyzer should be enabled.
346      */
347     private Boolean poetryAnalyzerEnabled;
348     /**
349      * Sets the path for the mix_audit binary.
350      */
351     private String mixAuditPath;
352     /**
353      * Sets the path for the bundle-audit binary.
354      */
355     private String bundleAuditPath;
356     /**
357      * Sets the path for the working directory that the bundle-audit binary
358      * should be executed from.
359      */
360     private String bundleAuditWorkingDirectory;
361     /**
362      * Whether or not the CocoaPods Analyzer is enabled.
363      */
364     private Boolean cocoapodsAnalyzerEnabled;
365     /**
366      * Whether or not the Carthage Analyzer is enabled.
367      */
368     private Boolean carthageAnalyzerEnabled;
369 
370     /**
371      * Whether or not the Swift package Analyzer is enabled.
372      */
373     private Boolean swiftPackageManagerAnalyzerEnabled;
374     /**
375      * Whether or not the Swift package Analyzer is enabled.
376      */
377     private Boolean swiftPackageResolvedAnalyzerEnabled;
378 
379     /**
380      * Whether or not the Sonatype OSS Index analyzer is enabled.
381      */
382     private Boolean ossindexAnalyzerEnabled;
383     /**
384      * Whether or not the Sonatype OSS Index analyzer should cache results.
385      */
386     private Boolean ossindexAnalyzerUseCache;
387     /**
388      * URL of the Sonatype OSS Index service.
389      */
390     private String ossindexAnalyzerUrl;
391     /**
392      * The username to use for the Sonatype OSS Index service.
393      */
394     private String ossindexAnalyzerUsername;
395     /**
396      * The password to use for the Sonatype OSS Index service.
397      */
398     private String ossindexAnalyzerPassword;
399     /**
400      * Whether we should only warn about Sonatype OSS Index remote errors
401      * instead of failing completely.
402      */
403     private Boolean ossIndexAnalyzerWarnOnlyOnRemoteErrors;
404 
405     /**
406      * Whether or not the Artifactory Analyzer is enabled.
407      */
408     private Boolean artifactoryAnalyzerEnabled;
409     /**
410      * The URL to Artifactory.
411      */
412     private String artifactoryAnalyzerUrl;
413     /**
414      * Whether or not Artifactory analysis should use the proxy..
415      */
416     private Boolean artifactoryAnalyzerUseProxy;
417     /**
418      * Whether or not Artifactory analysis should be parallelized.
419      */
420     private Boolean artifactoryAnalyzerParallelAnalysis;
421     /**
422      * The Artifactory username needed to connect.
423      */
424     private String artifactoryAnalyzerUsername;
425     /**
426      * The Artifactory API token needed to connect.
427      */
428     private String artifactoryAnalyzerApiToken;
429     /**
430      * The Artifactory bearer token.
431      */
432     private String artifactoryAnalyzerBearerToken;
433 
434     //The following code was copied Apache Ant PathConvert
435     //BEGIN COPY from org.apache.tools.ant.taskdefs.PathConvert
436     /**
437      * Path to be converted
438      */
439     private Resources path = null;
440     /**
441      * Reference to path/file set to convert
442      */
443     private Reference refId = null;
444 
445     /**
446      * Add an arbitrary ResourceCollection.
447      *
448      * @param rc the ResourceCollection to add.
449      * @since Ant 1.7
450      */
451     public void add(ResourceCollection rc) {
452         if (isReference()) {
453             throw new BuildException("Nested elements are not allowed when using the refId attribute.");
454         }
455         getPath().add(rc);
456     }
457 
458     /**
459      * Add a suppression file.
460      * <p>
461      * This is called by Ant with the configured {@link SuppressionFile}.
462      *
463      * @param suppressionFile the suppression file to add.
464      */
465     public void addConfiguredSuppressionFile(final SuppressionFile suppressionFile) {
466         suppressionFiles.add(suppressionFile.getPath());
467     }
468 
469     /**
470      * Add a report format.
471      * <p>
472      * This is called by Ant with the configured {@link ReportFormat}.
473      *
474      * @param reportFormat the reportFormat to add.
475      */
476     public void addConfiguredReportFormat(final ReportFormat reportFormat) {
477         reportFormats.add(reportFormat.getFormat());
478     }
479 
480     /**
481      * Returns the path. If the path has not been initialized yet, this class is
482      * synchronized, and will instantiate the path object.
483      *
484      * @return the path
485      */
486     private synchronized Resources getPath() {
487         if (path == null) {
488             path = new Resources(getProject());
489             path.setCache(true);
490         }
491         return path;
492     }
493 
494     /**
495      * Learn whether the refId attribute of this element been set.
496      *
497      * @return true if refId is valid.
498      */
499     public boolean isReference() {
500         return refId != null;
501     }
502 
503     /**
504      * Add a reference to a Path, FileSet, DirSet, or FileList defined
505      * elsewhere.
506      *
507      * @param r the reference to a path, fileset, dirset or filelist.
508      */
509     public synchronized void setRefId(Reference r) {
510         if (path != null) {
511             throw new BuildException("Nested elements are not allowed when using the refId attribute.");
512         }
513         refId = r;
514     }
515 
516     /**
517      * If this is a reference, this method will add the referenced resource
518      * collection to the collection of paths.
519      *
520      * @throws BuildException if the reference is not to a resource collection
521      */
522     //declaring a throw that extends runtime exception may be a bad practice
523     //but seems to be an ingrained practice within Ant as even the base `Task`
524     //contains an `execute() throws BuildExecption`.
525     @SuppressWarnings("squid:RedundantThrowsDeclarationCheck")
526     private void dealWithReferences() throws BuildException {
527         if (isReference()) {
528             final Object o = refId.getReferencedObject(getProject());
529             if (!(o instanceof ResourceCollection)) {
530                 throw new BuildException("refId '" + refId.getRefId()
531                         + "' does not refer to a resource collection.");
532             }
533             getPath().add((ResourceCollection) o);
534         }
535     }
536     // END COPY from org.apache.tools.ant.taskdefs
537 
538     /**
539      * Construct a new DependencyCheckTask.
540      */
541     public Check() {
542         super();
543         // Call this before Dependency Check Core starts logging anything - this way, all SLF4J messages from
544         // core end up coming through this tasks logger
545         StaticLoggerBinder.getSingleton().setTask(this);
546     }
547 
548     /**
549      * Get the value of projectName.
550      *
551      * @return the value of projectName
552      */
553     public String getProjectName() {
554         if (projectName == null) {
555             projectName = "";
556         }
557         return projectName;
558     }
559 
560     /**
561      * Set the value of projectName.
562      *
563      * @param projectName new value of projectName
564      */
565     public void setProjectName(String projectName) {
566         this.projectName = projectName;
567     }
568 
569     /**
570      * Get the value of reportOutputDirectory.
571      *
572      * @return the value of reportOutputDirectory
573      */
574     public String getReportOutputDirectory() {
575         return reportOutputDirectory;
576     }
577 
578     /**
579      * Set the value of reportOutputDirectory.
580      *
581      * @param reportOutputDirectory new value of reportOutputDirectory
582      */
583     public void setReportOutputDirectory(String reportOutputDirectory) {
584         this.reportOutputDirectory = reportOutputDirectory;
585     }
586 
587     /**
588      * Get the value of failBuildOnCVSS.
589      *
590      * @return the value of failBuildOnCVSS
591      */
592     public float getFailBuildOnCVSS() {
593         return failBuildOnCVSS;
594     }
595 
596     /**
597      * Set the value of failBuildOnCVSS.
598      *
599      * @param failBuildOnCVSS new value of failBuildOnCVSS
600      */
601     public void setFailBuildOnCVSS(float failBuildOnCVSS) {
602         this.failBuildOnCVSS = failBuildOnCVSS;
603     }
604 
605     /**
606      * Get the value of junitFailOnCVSS.
607      *
608      * @return the value of junitFailOnCVSS
609      */
610     public float getJunitFailOnCVSS() {
611         return junitFailOnCVSS;
612     }
613 
614     /**
615      * Set the value of junitFailOnCVSS.
616      *
617      * @param junitFailOnCVSS new value of junitFailOnCVSS
618      */
619     public void setJunitFailOnCVSS(float junitFailOnCVSS) {
620         this.junitFailOnCVSS = junitFailOnCVSS;
621     }
622 
623     /**
624      * Get the value of autoUpdate.
625      *
626      * @return the value of autoUpdate
627      */
628     public Boolean isAutoUpdate() {
629         return autoUpdate;
630     }
631 
632     /**
633      * Set the value of autoUpdate.
634      *
635      * @param autoUpdate new value of autoUpdate
636      */
637     public void setAutoUpdate(Boolean autoUpdate) {
638         this.autoUpdate = autoUpdate;
639     }
640 
641     /**
642      * Get the value of prettyPrint.
643      *
644      * @return the value of prettyPrint
645      */
646     public Boolean isPrettyPrint() {
647         return prettyPrint;
648     }
649 
650     /**
651      * Set the value of prettyPrint.
652      *
653      * @param prettyPrint new value of prettyPrint
654      */
655     public void setPrettyPrint(boolean prettyPrint) {
656         this.prettyPrint = prettyPrint;
657     }
658 
659     /**
660      * Set the value of reportFormat.
661      *
662      * @param reportFormat new value of reportFormat
663      */
664     public void setReportFormat(ReportFormats reportFormat) {
665         this.reportFormat = reportFormat.getValue();
666         this.reportFormats.add(this.reportFormat);
667     }
668 
669     /**
670      * Get the value of reportFormats.
671      *
672      * @return the value of reportFormats
673      */
674     public List<String> getReportFormats() {
675         if (reportFormats.isEmpty()) {
676             this.reportFormats.add(this.reportFormat);
677         }
678         return this.reportFormats;
679     }
680 
681     /**
682      * Gets suppression file paths.
683      *
684      * @return the suppression files.
685      */
686     public List<String> getSuppressionFiles() {
687         return suppressionFiles;
688     }
689 
690     /**
691      * Set the value of suppressionFile.
692      *
693      * @param suppressionFile new value of suppressionFile
694      */
695     public void setSuppressionFile(String suppressionFile) {
696         suppressionFiles.add(suppressionFile);
697     }
698 
699     /**
700      * Get the value of hintsFile.
701      *
702      * @return the value of hintsFile
703      */
704     public String getHintsFile() {
705         return hintsFile;
706     }
707 
708     /**
709      * Set the value of hintsFile.
710      *
711      * @param hintsFile new value of hintsFile
712      */
713     public void setHintsFile(String hintsFile) {
714         this.hintsFile = hintsFile;
715     }
716 
717     /**
718      * Get the value of showSummary.
719      *
720      * @return the value of showSummary
721      */
722     public boolean isShowSummary() {
723         return showSummary;
724     }
725 
726     /**
727      * Set the value of showSummary.
728      *
729      * @param showSummary new value of showSummary
730      */
731     public void setShowSummary(boolean showSummary) {
732         this.showSummary = showSummary;
733     }
734 
735     /**
736      * Get the value of enableExperimental.
737      *
738      * @return the value of enableExperimental
739      */
740     public Boolean isEnableExperimental() {
741         return enableExperimental;
742     }
743 
744     /**
745      * Set the value of enableExperimental.
746      *
747      * @param enableExperimental new value of enableExperimental
748      */
749     public void setEnableExperimental(Boolean enableExperimental) {
750         this.enableExperimental = enableExperimental;
751     }
752 
753     /**
754      * Get the value of enableRetired.
755      *
756      * @return the value of enableRetired
757      */
758     public Boolean isEnableRetired() {
759         return enableRetired;
760     }
761 
762     /**
763      * Set the value of enableRetired.
764      *
765      * @param enableRetired new value of enableRetired
766      */
767     public void setEnableRetired(Boolean enableRetired) {
768         this.enableRetired = enableRetired;
769     }
770 
771     /**
772      * Returns whether or not the analyzer is enabled.
773      *
774      * @return true if the analyzer is enabled
775      */
776     public Boolean isJarAnalyzerEnabled() {
777         return jarAnalyzerEnabled;
778     }
779 
780     /**
781      * Sets whether or not the analyzer is enabled.
782      *
783      * @param jarAnalyzerEnabled the value of the new setting
784      */
785     public void setJarAnalyzerEnabled(Boolean jarAnalyzerEnabled) {
786         this.jarAnalyzerEnabled = jarAnalyzerEnabled;
787     }
788 
789     /**
790      * Returns whether or not the analyzer is enabled.
791      *
792      * @return true if the analyzer is enabled
793      */
794     public Boolean isArchiveAnalyzerEnabled() {
795         return archiveAnalyzerEnabled;
796     }
797 
798     /**
799      * Sets whether the analyzer is enabled.
800      *
801      * @param archiveAnalyzerEnabled the value of the new setting
802      */
803     public void setArchiveAnalyzerEnabled(Boolean archiveAnalyzerEnabled) {
804         this.archiveAnalyzerEnabled = archiveAnalyzerEnabled;
805     }
806 
807     /**
808      * Returns whether the analyzer is enabled.
809      *
810      * @return true if the analyzer is enabled
811      */
812     public Boolean isKnownExploitedEnabled() {
813         return knownExploitedEnabled;
814     }
815 
816     /**
817      * Sets whether the analyzer is enabled.
818      *
819      * @param knownExploitedEnabled the value of the new setting
820      */
821     public void setKnownExploitedEnabled(Boolean knownExploitedEnabled) {
822         this.knownExploitedEnabled = knownExploitedEnabled;
823     }
824 
825     /**
826      * Returns the knownExploitedUrl.
827      *
828      * @return the knownExploitedUrl
829      */
830     public String getKnownExploitedUrl() {
831         return knownExploitedUrl;
832     }
833 
834     /**
835      * Sets the the knownExploitedUrl.
836      *
837      * @param knownExploitedUrl the URL
838      */
839     public void setKnownExploitedUrl(String knownExploitedUrl) {
840         this.knownExploitedUrl = knownExploitedUrl;
841     }
842 
843     /**
844      * Returns whether or not the analyzer is enabled.
845      *
846      * @return true if the analyzer is enabled
847      */
848     public Boolean isAssemblyAnalyzerEnabled() {
849         return assemblyAnalyzerEnabled;
850     }
851 
852     /**
853      * Sets whether or not the analyzer is enabled.
854      *
855      * @param assemblyAnalyzerEnabled the value of the new setting
856      */
857     public void setAssemblyAnalyzerEnabled(Boolean assemblyAnalyzerEnabled) {
858         this.assemblyAnalyzerEnabled = assemblyAnalyzerEnabled;
859     }
860 
861     /**
862      * Returns whether or not the analyzer is enabled.
863      *
864      * @return true if the analyzer is enabled
865      */
866     public Boolean isMSBuildAnalyzerEnabled() {
867         return msbuildAnalyzerEnabled;
868     }
869 
870     /**
871      * Sets whether or not the analyzer is enabled.
872      *
873      * @param msbuildAnalyzerEnabled the value of the new setting
874      */
875     public void setMSBuildAnalyzerEnabled(Boolean msbuildAnalyzerEnabled) {
876         this.msbuildAnalyzerEnabled = msbuildAnalyzerEnabled;
877     }
878 
879     /**
880      * Returns whether or not the analyzer is enabled.
881      *
882      * @return true if the analyzer is enabled
883      */
884     public Boolean isNuspecAnalyzerEnabled() {
885         return nuspecAnalyzerEnabled;
886     }
887 
888     /**
889      * Returns whether or not the analyzer is enabled.
890      *
891      * @return true if the analyzer is enabled
892      */
893     public Boolean isNugetconfAnalyzerEnabled() {
894         return nugetconfAnalyzerEnabled;
895     }
896 
897     /**
898      * Sets whether or not the analyzer is enabled.
899      *
900      * @param nuspecAnalyzerEnabled the value of the new setting
901      */
902     public void setNuspecAnalyzerEnabled(Boolean nuspecAnalyzerEnabled) {
903         this.nuspecAnalyzerEnabled = nuspecAnalyzerEnabled;
904     }
905 
906     /**
907      * Sets whether or not the analyzer is enabled.
908      *
909      * @param nugetconfAnalyzerEnabled the value of the new setting
910      */
911     public void setNugetconfAnalyzerEnabled(Boolean nugetconfAnalyzerEnabled) {
912         this.nugetconfAnalyzerEnabled = nugetconfAnalyzerEnabled;
913     }
914 
915     /**
916      * Returns whether or not the analyzer is enabled.
917      *
918      * @return true if the analyzer is enabled
919      */
920     public Boolean isLibmanAnalyzerEnabled() {
921         return libmanAnalyzerEnabled;
922     }
923 
924     /**
925      * Sets whether or not the analyzer is enabled.
926      *
927      * @param libmanAnalyzerEnabled the value of the new setting
928      */
929     public void setLibmanAnalyzerEnabled(Boolean libmanAnalyzerEnabled) {
930         this.libmanAnalyzerEnabled = libmanAnalyzerEnabled;
931     }
932 
933     /**
934      * Get the value of composerAnalyzerEnabled.
935      *
936      * @return the value of composerAnalyzerEnabled
937      */
938     public Boolean isComposerAnalyzerEnabled() {
939         return composerAnalyzerEnabled;
940     }
941 
942     /**
943      * Set the value of composerAnalyzerEnabled.
944      *
945      * @param composerAnalyzerEnabled new value of composerAnalyzerEnabled
946      */
947     public void setComposerAnalyzerEnabled(Boolean composerAnalyzerEnabled) {
948         this.composerAnalyzerEnabled = composerAnalyzerEnabled;
949     }
950     
951     /**
952      * Get the value of composerAnalyzerSkipDev.
953      *
954      * @return the value of composerAnalyzerSkipDev
955      */
956     public Boolean isComposerAnalyzerSkipDev() {
957         return composerAnalyzerSkipDev;
958     }
959 
960     /**
961      * Set the value of composerAnalyzerSkipDev.
962      *
963      * @param composerAnalyzerSkipDev new value of composerAnalyzerSkipDev
964      */
965     public void setComposerAnalyzerSkipDev(Boolean composerAnalyzerSkipDev) {
966         this.composerAnalyzerSkipDev = composerAnalyzerSkipDev;
967     }
968 
969     /**
970      * Get the value of cpanfileAnalyzerEnabled.
971      *
972      * @return the value of cpanfileAnalyzerEnabled
973      */
974     public Boolean isCpanfileAnalyzerEnabled() {
975         return cpanfileAnalyzerEnabled;
976     }
977 
978     /**
979      * Set the value of cpanfileAnalyzerEnabled.
980      *
981      * @param cpanfileAnalyzerEnabled new value of cpanfileAnalyzerEnabled
982      */
983     public void setCpanfileAnalyzerEnabled(Boolean cpanfileAnalyzerEnabled) {
984         this.cpanfileAnalyzerEnabled = cpanfileAnalyzerEnabled;
985     }
986 
987     /**
988      * Get the value of autoconfAnalyzerEnabled.
989      *
990      * @return the value of autoconfAnalyzerEnabled
991      */
992     public Boolean isAutoconfAnalyzerEnabled() {
993         return autoconfAnalyzerEnabled;
994     }
995 
996     /**
997      * Set the value of autoconfAnalyzerEnabled.
998      *
999      * @param autoconfAnalyzerEnabled new value of autoconfAnalyzerEnabled
1000      */
1001     public void setAutoconfAnalyzerEnabled(Boolean autoconfAnalyzerEnabled) {
1002         this.autoconfAnalyzerEnabled = autoconfAnalyzerEnabled;
1003     }
1004 
1005     /**
1006      * Get the value of pipAnalyzerEnabled.
1007      *
1008      * @return the value of pipAnalyzerEnabled
1009      */
1010     public Boolean isPipAnalyzerEnabled() {
1011         return pipAnalyzerEnabled;
1012     }
1013 
1014     /**
1015      * Set the value of pipAnalyzerEnabled.
1016      *
1017      * @param pipAnalyzerEnabled new value of pipAnalyzerEnabled
1018      */
1019     public void setPipAnalyzerEnabled(Boolean pipAnalyzerEnabled) {
1020         this.pipAnalyzerEnabled = pipAnalyzerEnabled;
1021     }
1022 
1023     /**
1024      * Get the value of pipfileAnalyzerEnabled.
1025      *
1026      * @return the value of pipfileAnalyzerEnabled
1027      */
1028     public Boolean isPipfileAnalyzerEnabled() {
1029         return pipfileAnalyzerEnabled;
1030     }
1031 
1032     /**
1033      * Set the value of pipfileAnalyzerEnabled.
1034      *
1035      * @param pipfileAnalyzerEnabled new value of pipfileAnalyzerEnabled
1036      */
1037     public void setPipfileAnalyzerEnabled(Boolean pipfileAnalyzerEnabled) {
1038         this.pipfileAnalyzerEnabled = pipfileAnalyzerEnabled;
1039     }
1040 
1041     /**
1042      * Get the value of poetryAnalyzerEnabled.
1043      *
1044      * @return the value of poetryAnalyzerEnabled
1045      */
1046     public Boolean isPoetryAnalyzerEnabled() {
1047         return poetryAnalyzerEnabled;
1048     }
1049 
1050     /**
1051      * Set the value of poetryAnalyzerEnabled.
1052      *
1053      * @param poetryAnalyzerEnabled new value of poetryAnalyzerEnabled
1054      */
1055     public void setPoetryAnalyzerEnabled(Boolean poetryAnalyzerEnabled) {
1056         this.poetryAnalyzerEnabled = poetryAnalyzerEnabled;
1057     }
1058 
1059     /**
1060      * Returns if the Bundle Audit Analyzer is enabled.
1061      *
1062      * @return if the Bundle Audit Analyzer is enabled.
1063      */
1064     public Boolean isBundleAuditAnalyzerEnabled() {
1065         return bundleAuditAnalyzerEnabled;
1066     }
1067 
1068     /**
1069      * Sets if the Bundle Audit Analyzer is enabled.
1070      *
1071      * @param bundleAuditAnalyzerEnabled whether or not the analyzer should be
1072      * enabled
1073      */
1074     public void setBundleAuditAnalyzerEnabled(Boolean bundleAuditAnalyzerEnabled) {
1075         this.bundleAuditAnalyzerEnabled = bundleAuditAnalyzerEnabled;
1076     }
1077 
1078     /**
1079      * Returns the path to the bundle audit executable.
1080      *
1081      * @return the path to the bundle audit executable
1082      */
1083     public String getBundleAuditPath() {
1084         return bundleAuditPath;
1085     }
1086 
1087     /**
1088      * Sets the path to the bundle audit executable.
1089      *
1090      * @param bundleAuditPath the path to the bundle audit executable
1091      */
1092     public void setBundleAuditPath(String bundleAuditPath) {
1093         this.bundleAuditPath = bundleAuditPath;
1094     }
1095 
1096     /**
1097      * Sets the path to the working directory that the bundle audit executable
1098      * should be executed from.
1099      *
1100      * @param bundleAuditWorkingDirectory the path to the working directory that
1101      * the bundle audit executable should be executed from.
1102      */
1103     public void setBundleAuditWorkingDirectory(String bundleAuditWorkingDirectory) {
1104         this.bundleAuditWorkingDirectory = bundleAuditWorkingDirectory;
1105     }
1106 
1107     /**
1108      * Returns the path to the working directory that the bundle audit
1109      * executable should be executed from.
1110      *
1111      * @return the path to the working directory that the bundle audit
1112      * executable should be executed from.
1113      */
1114     public String getBundleAuditWorkingDirectory() {
1115         return bundleAuditWorkingDirectory;
1116     }
1117 
1118     /**
1119      * Returns if the cocoapods analyzer is enabled.
1120      *
1121      * @return if the cocoapods analyzer is enabled
1122      */
1123     public boolean isCocoapodsAnalyzerEnabled() {
1124         return cocoapodsAnalyzerEnabled;
1125     }
1126 
1127     /**
1128      * Sets whether or not the cocoapods analyzer is enabled.
1129      *
1130      * @param cocoapodsAnalyzerEnabled the state of the cocoapods analyzer
1131      */
1132     public void setCocoapodsAnalyzerEnabled(Boolean cocoapodsAnalyzerEnabled) {
1133         this.cocoapodsAnalyzerEnabled = cocoapodsAnalyzerEnabled;
1134     }
1135 
1136     /**
1137      * Returns if the Carthage analyzer is enabled.
1138      *
1139      * @return if the Carthage analyzer is enabled
1140      */
1141     public boolean isCarthageAnalyzerEnabled() {
1142         return carthageAnalyzerEnabled;
1143     }
1144 
1145     /**
1146      * Sets whether or not the Carthage analyzer is enabled.
1147      *
1148      * @param carthageAnalyzerEnabled the state of the Carthage analyzer
1149      */
1150     public void setCarthageAnalyzerEnabled(Boolean carthageAnalyzerEnabled) {
1151         this.carthageAnalyzerEnabled = carthageAnalyzerEnabled;
1152     }
1153 
1154     /**
1155      * Returns whether or not the Swift package Analyzer is enabled.
1156      *
1157      * @return whether or not the Swift package Analyzer is enabled
1158      */
1159     public Boolean isSwiftPackageManagerAnalyzerEnabled() {
1160         return swiftPackageManagerAnalyzerEnabled;
1161     }
1162 
1163     /**
1164      * Sets the enabled state of the swift package manager analyzer.
1165      *
1166      * @param swiftPackageManagerAnalyzerEnabled the enabled state of the swift
1167      * package manager
1168      */
1169     public void setSwiftPackageManagerAnalyzerEnabled(Boolean swiftPackageManagerAnalyzerEnabled) {
1170         this.swiftPackageManagerAnalyzerEnabled = swiftPackageManagerAnalyzerEnabled;
1171     }
1172 
1173     /**
1174      * Returns whether or not the Swift package resolved Analyzer is enabled.
1175      *
1176      * @return whether or not the Swift package resolved Analyzer is enabled
1177      */
1178     public Boolean isSwiftPackageResolvedAnalyzerEnabled() {
1179         return swiftPackageResolvedAnalyzerEnabled;
1180     }
1181 
1182     /**
1183      * Sets the enabled state of the swift package manager analyzer.
1184      *
1185      * @param swiftPackageResolvedAnalyzerEnabled the enabled state of the swift
1186      * package resolved analyzer
1187      */
1188     public void setSwiftPackageResolvedAnalyzerEnabled(Boolean swiftPackageResolvedAnalyzerEnabled) {
1189         this.swiftPackageResolvedAnalyzerEnabled = swiftPackageResolvedAnalyzerEnabled;
1190     }
1191 
1192     /**
1193      * Get the value of opensslAnalyzerEnabled.
1194      *
1195      * @return the value of opensslAnalyzerEnabled
1196      */
1197     public Boolean isOpensslAnalyzerEnabled() {
1198         return opensslAnalyzerEnabled;
1199     }
1200 
1201     /**
1202      * Set the value of opensslAnalyzerEnabled.
1203      *
1204      * @param opensslAnalyzerEnabled new value of opensslAnalyzerEnabled
1205      */
1206     public void setOpensslAnalyzerEnabled(Boolean opensslAnalyzerEnabled) {
1207         this.opensslAnalyzerEnabled = opensslAnalyzerEnabled;
1208     }
1209 
1210     /**
1211      * Get the value of nodeAnalyzerEnabled.
1212      *
1213      * @return the value of nodeAnalyzerEnabled
1214      */
1215     public Boolean isNodeAnalyzerEnabled() {
1216         return nodeAnalyzerEnabled;
1217     }
1218 
1219     /**
1220      * Set the value of nodeAnalyzerEnabled.
1221      *
1222      * @param nodeAnalyzerEnabled new value of nodeAnalyzerEnabled
1223      */
1224     public void setNodeAnalyzerEnabled(Boolean nodeAnalyzerEnabled) {
1225         this.nodeAnalyzerEnabled = nodeAnalyzerEnabled;
1226     }
1227 
1228     /**
1229      * Get the value of nodeAuditAnalyzerEnabled.
1230      *
1231      * @return the value of nodeAuditAnalyzerEnabled
1232      */
1233     public Boolean isNodeAuditAnalyzerEnabled() {
1234         return nodeAuditAnalyzerEnabled;
1235     }
1236 
1237     /**
1238      * Set the value of nodeAuditAnalyzerEnabled.
1239      *
1240      * @param nodeAuditAnalyzerEnabled new value of nodeAuditAnalyzerEnabled
1241      */
1242     public void setNodeAuditAnalyzerEnabled(Boolean nodeAuditAnalyzerEnabled) {
1243         this.nodeAuditAnalyzerEnabled = nodeAuditAnalyzerEnabled;
1244     }
1245 
1246     /**
1247      * Get the value of yarnAuditAnalyzerEnabled.
1248      *
1249      * @return the value of yarnAuditAnalyzerEnabled
1250      */
1251     public Boolean isYarnAuditAnalyzerEnabled() {
1252         return yarnAuditAnalyzerEnabled;
1253     }
1254 
1255     /**
1256      * Set the value of yarnAuditAnalyzerEnabled.
1257      *
1258      * @param yarnAuditAnalyzerEnabled new value of yarnAuditAnalyzerEnabled
1259      */
1260     public void setYarnAuditAnalyzerEnabled(Boolean yarnAuditAnalyzerEnabled) {
1261         this.yarnAuditAnalyzerEnabled = yarnAuditAnalyzerEnabled;
1262     }
1263 
1264     /**
1265      * Get the value of pnpmAuditAnalyzerEnabled.
1266      *
1267      * @return the value of pnpmAuditAnalyzerEnabled
1268      */
1269     public Boolean isPnpmAuditAnalyzerEnabled() {
1270         return pnpmAuditAnalyzerEnabled;
1271     }
1272 
1273     /**
1274      * Set the value of pnpmAuditAnalyzerEnabled.
1275      *
1276      * @param pnpmAuditAnalyzerEnabled new value of pnpmAuditAnalyzerEnabled
1277      */
1278     public void setPnpmAuditAnalyzerEnabled(Boolean pnpmAuditAnalyzerEnabled) {
1279         this.pnpmAuditAnalyzerEnabled = pnpmAuditAnalyzerEnabled;
1280     }
1281 
1282     /**
1283      * Get the value of nodeAuditAnalyzerUseCache.
1284      *
1285      * @return the value of nodeAuditAnalyzerUseCache
1286      */
1287     public Boolean isNodeAuditAnalyzerUseCache() {
1288         return nodeAuditAnalyzerUseCache;
1289     }
1290 
1291     /**
1292      * Set the value of nodeAuditAnalyzerUseCache.
1293      *
1294      * @param nodeAuditAnalyzerUseCache new value of nodeAuditAnalyzerUseCache
1295      */
1296     public void setNodeAuditAnalyzerUseCache(Boolean nodeAuditAnalyzerUseCache) {
1297         this.nodeAuditAnalyzerUseCache = nodeAuditAnalyzerUseCache;
1298     }
1299 
1300     /**
1301      * Get the value of nodePackageSkipDevDependencies.
1302      *
1303      * @return the value of nodePackageSkipDevDependencies
1304      */
1305     public Boolean isNodePackageAnalyzerSkipDevDependencies() {
1306         return nodePackageSkipDevDependencies;
1307     }
1308 
1309     /**
1310      * Set the value of nodePackageSkipDevDependencies.
1311      *
1312      * @param nodePackageSkipDevDependencies new value of
1313      * nodePackageSkipDevDependencies
1314      */
1315     public void setNodePackageSkipDevDependencies(Boolean nodePackageSkipDevDependencies) {
1316         this.nodePackageSkipDevDependencies = nodePackageSkipDevDependencies;
1317     }
1318 
1319     /**
1320      * Get the value of nodeAuditSkipDevDependencies.
1321      *
1322      * @return the value of nodeAuditSkipDevDependencies
1323      */
1324     public Boolean isNodeAuditAnalyzerSkipDevDependencies() {
1325         return nodeAuditSkipDevDependencies;
1326     }
1327 
1328     /**
1329      * Set the value of nodeAuditSkipDevDependencies.
1330      *
1331      * @param nodeAuditSkipDevDependencies new value of
1332      * nodeAuditSkipDevDependencies
1333      */
1334     public void setNodeAuditSkipDevDependencies(Boolean nodeAuditSkipDevDependencies) {
1335         this.nodeAuditSkipDevDependencies = nodeAuditSkipDevDependencies;
1336     }
1337 
1338     /**
1339      * Get the value of retireJsAnalyzerEnabled.
1340      *
1341      * @return the value of retireJsAnalyzerEnabled
1342      */
1343     public Boolean isRetireJsAnalyzerEnabled() {
1344         return retireJsAnalyzerEnabled;
1345     }
1346 
1347     /**
1348      * Set the value of retireJsAnalyzerEnabled.
1349      *
1350      * @param retireJsAnalyzerEnabled new value of retireJsAnalyzerEnabled
1351      */
1352     public void setRetireJsAnalyzerEnabled(Boolean retireJsAnalyzerEnabled) {
1353         this.retireJsAnalyzerEnabled = retireJsAnalyzerEnabled;
1354     }
1355 
1356     /**
1357      * Get the value of Retire JS repository URL.
1358      *
1359      * @return the value of retireJsUrl
1360      */
1361     public String getRetireJsUrl() {
1362         return retireJsUrl;
1363     }
1364 
1365     /**
1366      * Set the value of the Retire JS repository URL.
1367      *
1368      * @param retireJsUrl new value of retireJsUrl
1369      */
1370     public void setRetireJsUrl(String retireJsUrl) {
1371         this.retireJsUrl = retireJsUrl;
1372     }
1373 
1374     /**
1375      * Get the value of User Retire JS repository URL.
1376      *
1377      * @return the value of retireJsUrlUser
1378      */
1379     public String getRetireJsUrlUser() {
1380         return retireJsUrlUser;
1381     }
1382 
1383     /**
1384      * Set the value of the User Retire JS repository URL.
1385      *
1386      * @param retireJsUrlUser new value of retireJsUrlUser
1387      */
1388     public void setRetireJsUrlUser(String retireJsUrlUser) {
1389         this.retireJsUrlUser = retireJsUrlUser;
1390     }
1391 
1392     /**
1393      * Get the value of Password Retire JS repository URL.
1394      *
1395      * @return the value of retireJsUrlPassword
1396      */
1397     public String getRetireJsUrlPassword() {
1398         return retireJsUrlPassword;
1399     }
1400 
1401     /**
1402      * Set the value of the Password Retire JS repository URL.
1403      *
1404      * @param retireJsUrlPassword new value of retireJsUrlPassword
1405      */
1406     public void setRetireJsUrlPassword(String retireJsUrlPassword) {
1407         this.retireJsUrlPassword = retireJsUrlPassword;
1408     }
1409 
1410     /**
1411      * Get the value of retireJsAnalyzerEnabled.
1412      *
1413      * @return the value of retireJsAnalyzerEnabled
1414      */
1415     public Boolean isRetireJsAnalyzerForceUpdate() {
1416         return retireJsAnalyzerForceUpdate;
1417     }
1418 
1419     /**
1420      * Set the value of retireJsAnalyzerForceUpdate.
1421      *
1422      * @param retireJsAnalyzerForceUpdate new value of
1423      * retireJsAnalyzerForceUpdate
1424      */
1425     public void setRetireJsAnalyzerForceUpdate(Boolean retireJsAnalyzerForceUpdate) {
1426         this.retireJsAnalyzerForceUpdate = retireJsAnalyzerForceUpdate;
1427     }
1428 
1429     /**
1430      * Get the value of retirejsFilterNonVulnerable.
1431      *
1432      * @return the value of retirejsFilterNonVulnerable
1433      */
1434     public Boolean isRetirejsFilterNonVulnerable() {
1435         return retirejsFilterNonVulnerable;
1436     }
1437 
1438     /**
1439      * Set the value of retirejsFilterNonVulnerable.
1440      *
1441      * @param retirejsFilterNonVulnerable new value of
1442      * retirejsFilterNonVulnerable
1443      */
1444     public void setRetirejsFilterNonVulnerable(Boolean retirejsFilterNonVulnerable) {
1445         this.retirejsFilterNonVulnerable = retirejsFilterNonVulnerable;
1446     }
1447 
1448     /**
1449      * Gets retire JS Analyzers file content filters.
1450      *
1451      * @return retire JS Analyzers file content filters
1452      */
1453     public List<String> getRetirejsFilters() {
1454         return retirejsFilters;
1455     }
1456 
1457     /**
1458      * Add a regular expression to the set of retire JS content filters.
1459      * <p>
1460      * This is called by Ant.
1461      *
1462      * @param retirejsFilter the regular expression used to filter based on file
1463      * content
1464      */
1465     public void addConfiguredRetirejsFilter(final RetirejsFilter retirejsFilter) {
1466         retirejsFilters.add(retirejsFilter.getRegex());
1467     }
1468 
1469     /**
1470      * Get the value of rubygemsAnalyzerEnabled.
1471      *
1472      * @return the value of rubygemsAnalyzerEnabled
1473      */
1474     public Boolean isRubygemsAnalyzerEnabled() {
1475         return rubygemsAnalyzerEnabled;
1476     }
1477 
1478     /**
1479      * Set the value of rubygemsAnalyzerEnabled.
1480      *
1481      * @param rubygemsAnalyzerEnabled new value of rubygemsAnalyzerEnabled
1482      */
1483     public void setRubygemsAnalyzerEnabled(Boolean rubygemsAnalyzerEnabled) {
1484         this.rubygemsAnalyzerEnabled = rubygemsAnalyzerEnabled;
1485     }
1486 
1487     /**
1488      * Get the value of pyPackageAnalyzerEnabled.
1489      *
1490      * @return the value of pyPackageAnalyzerEnabled
1491      */
1492     public Boolean isPyPackageAnalyzerEnabled() {
1493         return pyPackageAnalyzerEnabled;
1494     }
1495 
1496     /**
1497      * Set the value of pyPackageAnalyzerEnabled.
1498      *
1499      * @param pyPackageAnalyzerEnabled new value of pyPackageAnalyzerEnabled
1500      */
1501     public void setPyPackageAnalyzerEnabled(Boolean pyPackageAnalyzerEnabled) {
1502         this.pyPackageAnalyzerEnabled = pyPackageAnalyzerEnabled;
1503     }
1504 
1505     /**
1506      * Get the value of pyDistributionAnalyzerEnabled.
1507      *
1508      * @return the value of pyDistributionAnalyzerEnabled
1509      */
1510     public Boolean isPyDistributionAnalyzerEnabled() {
1511         return pyDistributionAnalyzerEnabled;
1512     }
1513 
1514     /**
1515      * Set the value of pyDistributionAnalyzerEnabled.
1516      *
1517      * @param pyDistributionAnalyzerEnabled new value of
1518      * pyDistributionAnalyzerEnabled
1519      */
1520     public void setPyDistributionAnalyzerEnabled(Boolean pyDistributionAnalyzerEnabled) {
1521         this.pyDistributionAnalyzerEnabled = pyDistributionAnalyzerEnabled;
1522     }
1523 
1524     /**
1525      * Get the value of mixAuditAnalyzerEnabled.
1526      *
1527      * @return the value of mixAuditAnalyzerEnabled
1528      */
1529     public Boolean getMixAuditAnalyzerEnabled() {
1530         return mixAuditAnalyzerEnabled;
1531     }
1532 
1533     /**
1534      * Set the value of mixAuditAnalyzerEnabled.
1535      *
1536      * @param mixAuditAnalyzerEnabled new value of mixAuditAnalyzerEnabled
1537      */
1538     public void setMixAuditAnalyzerEnabled(Boolean mixAuditAnalyzerEnabled) {
1539         this.mixAuditAnalyzerEnabled = mixAuditAnalyzerEnabled;
1540     }
1541 
1542     /**
1543      * Get the value of centralAnalyzerEnabled.
1544      *
1545      * @return the value of centralAnalyzerEnabled
1546      */
1547     public Boolean isCentralAnalyzerEnabled() {
1548         return centralAnalyzerEnabled;
1549     }
1550 
1551     /**
1552      * Set the value of centralAnalyzerEnabled.
1553      *
1554      * @param centralAnalyzerEnabled new value of centralAnalyzerEnabled
1555      */
1556     public void setCentralAnalyzerEnabled(Boolean centralAnalyzerEnabled) {
1557         this.centralAnalyzerEnabled = centralAnalyzerEnabled;
1558     }
1559 
1560     /**
1561      * Get the value of centralAnalyzerUseCache.
1562      *
1563      * @return the value of centralAnalyzerUseCache
1564      */
1565     public Boolean isCentralAnalyzerUseCache() {
1566         return centralAnalyzerUseCache;
1567     }
1568 
1569     /**
1570      * Set the value of centralAnalyzerUseCache.
1571      *
1572      * @param centralAnalyzerUseCache new value of centralAnalyzerUseCache
1573      */
1574     public void setCentralAnalyzerUseCache(Boolean centralAnalyzerUseCache) {
1575         this.centralAnalyzerUseCache = centralAnalyzerUseCache;
1576     }
1577 
1578     /**
1579      * Get the value of nexusAnalyzerEnabled.
1580      *
1581      * @return the value of nexusAnalyzerEnabled
1582      */
1583     public Boolean isNexusAnalyzerEnabled() {
1584         return nexusAnalyzerEnabled;
1585     }
1586 
1587     /**
1588      * Set the value of nexusAnalyzerEnabled.
1589      *
1590      * @param nexusAnalyzerEnabled new value of nexusAnalyzerEnabled
1591      */
1592     public void setNexusAnalyzerEnabled(Boolean nexusAnalyzerEnabled) {
1593         this.nexusAnalyzerEnabled = nexusAnalyzerEnabled;
1594     }
1595 
1596     /**
1597      * Get the value of golangDepEnabled.
1598      *
1599      * @return the value of golangDepEnabled
1600      */
1601     public Boolean isGolangDepEnabled() {
1602         return golangDepEnabled;
1603     }
1604 
1605     /**
1606      * Set the value of golangDepEnabled.
1607      *
1608      * @param golangDepEnabled new value of golangDepEnabled
1609      */
1610     public void setGolangDepEnabled(Boolean golangDepEnabled) {
1611         this.golangDepEnabled = golangDepEnabled;
1612     }
1613 
1614     /**
1615      * Get the value of golangModEnabled.
1616      *
1617      * @return the value of golangModEnabled
1618      */
1619     public Boolean isGoModDepEnabled() {
1620         return golangModEnabled;
1621     }
1622 
1623     /**
1624      * Set the value of golangModEnabled.
1625      *
1626      * @param golangModEnabled new value of golangModEnabled
1627      */
1628     public void setGolangModEnabled(Boolean golangModEnabled) {
1629         this.golangModEnabled = golangModEnabled;
1630     }
1631 
1632     /**
1633      * Get the value of dartAnalyzerEnabled.
1634      *
1635      * @return the value of dartAnalyzerEnabled
1636      */
1637     public Boolean isDartAnalyzerEnabled() {
1638         return dartAnalyzerEnabled;
1639     }
1640 
1641     /**
1642      * Set the value of dartAnalyzerEnabled.
1643      *
1644      * @param dartAnalyzerEnabled new value of dartAnalyzerEnabled
1645      */
1646     public void setDartAnalyzerEnabled(Boolean dartAnalyzerEnabled) {
1647         this.dartAnalyzerEnabled = dartAnalyzerEnabled;
1648     }
1649 
1650     /**
1651      * Get the value of pathToYarn.
1652      *
1653      * @return the value of pathToYarn
1654      */
1655     public String getPathToYarn() {
1656         return pathToYarn;
1657     }
1658 
1659     /**
1660      * Set the value of pathToYarn.
1661      *
1662      * @param pathToYarn new value of pathToYarn
1663      */
1664     public void setPathToYarn(String pathToYarn) {
1665         this.pathToYarn = pathToYarn;
1666     }
1667 
1668     /**
1669      * Get the value of pathToPnpm.
1670      *
1671      * @return the value of pathToPnpm
1672      */
1673     public String getPathToPnpm() {
1674         return pathToPnpm;
1675     }
1676 
1677     /**
1678      * Set the value of pathToPnpm.
1679      *
1680      * @param pathToPnpm new value of pathToPnpm
1681      */
1682     public void setPathToPnpm(String pathToPnpm) {
1683         this.pathToPnpm = pathToPnpm;
1684     }
1685 
1686     /**
1687      * Get the value of pathToCore.
1688      *
1689      * @return the value of pathToCore
1690      */
1691     public String getPathToGo() {
1692         return pathToGo;
1693     }
1694 
1695     /**
1696      * Set the value of pathToGo.
1697      *
1698      * @param pathToGo new value of pathToGo
1699      */
1700     public void setPathToGo(String pathToGo) {
1701         this.pathToGo = pathToGo;
1702     }
1703 
1704     /**
1705      * Get the value of nexusUrl.
1706      *
1707      * @return the value of nexusUrl
1708      */
1709     public String getNexusUrl() {
1710         return nexusUrl;
1711     }
1712 
1713     /**
1714      * Set the value of nexusUrl.
1715      *
1716      * @param nexusUrl new value of nexusUrl
1717      */
1718     public void setNexusUrl(String nexusUrl) {
1719         this.nexusUrl = nexusUrl;
1720     }
1721 
1722     /**
1723      * Get the value of nexusUser.
1724      *
1725      * @return the value of nexusUser
1726      */
1727     public String getNexusUser() {
1728         return nexusUser;
1729     }
1730 
1731     /**
1732      * Set the value of nexusUser.
1733      *
1734      * @param nexusUser new value of nexusUser
1735      */
1736     public void setNexusUser(String nexusUser) {
1737         this.nexusUser = nexusUser;
1738     }
1739 
1740     /**
1741      * Get the value of nexusPassword.
1742      *
1743      * @return the value of nexusPassword
1744      */
1745     public String getNexusPassword() {
1746         return nexusPassword;
1747     }
1748 
1749     /**
1750      * Set the value of nexusPassword.
1751      *
1752      * @param nexusPassword new value of nexusPassword
1753      */
1754     public void setNexusPassword(String nexusPassword) {
1755         this.nexusPassword = nexusPassword;
1756     }
1757 
1758     /**
1759      * Get the value of nexusUsesProxy.
1760      *
1761      * @return the value of nexusUsesProxy
1762      */
1763     public Boolean isNexusUsesProxy() {
1764         return nexusUsesProxy;
1765     }
1766 
1767     /**
1768      * Set the value of nexusUsesProxy.
1769      *
1770      * @param nexusUsesProxy new value of nexusUsesProxy
1771      */
1772     public void setNexusUsesProxy(Boolean nexusUsesProxy) {
1773         this.nexusUsesProxy = nexusUsesProxy;
1774     }
1775 
1776     /**
1777      * Get the value of zipExtensions.
1778      *
1779      * @return the value of zipExtensions
1780      */
1781     public String getZipExtensions() {
1782         return zipExtensions;
1783     }
1784 
1785     /**
1786      * Set the value of zipExtensions.
1787      *
1788      * @param zipExtensions new value of zipExtensions
1789      */
1790     public void setZipExtensions(String zipExtensions) {
1791         this.zipExtensions = zipExtensions;
1792     }
1793 
1794     /**
1795      * Get the value of pathToCore.
1796      *
1797      * @return the value of pathToCore
1798      */
1799     public String getPathToDotnetCore() {
1800         return pathToCore;
1801     }
1802 
1803     /**
1804      * Set the value of pathToCore.
1805      *
1806      * @param pathToCore new value of pathToCore
1807      */
1808     public void setPathToDotnetCore(String pathToCore) {
1809         this.pathToCore = pathToCore;
1810     }
1811 
1812     /**
1813      * Get value of {@link #ossindexAnalyzerEnabled}.
1814      *
1815      * @return the value of ossindexAnalyzerEnabled
1816      */
1817     public Boolean isOssindexAnalyzerEnabled() {
1818         return ossindexAnalyzerEnabled;
1819     }
1820 
1821     /**
1822      * Set value of {@link #ossindexAnalyzerEnabled}.
1823      *
1824      * @param ossindexAnalyzerEnabled new value of ossindexAnalyzerEnabled
1825      */
1826     public void setOssindexAnalyzerEnabled(Boolean ossindexAnalyzerEnabled) {
1827         this.ossindexAnalyzerEnabled = ossindexAnalyzerEnabled;
1828     }
1829 
1830     /**
1831      * Get value of {@link #ossindexAnalyzerUseCache}.
1832      *
1833      * @return the value of ossindexAnalyzerUseCache
1834      */
1835     public Boolean isOssindexAnalyzerUseCache() {
1836         return ossindexAnalyzerUseCache;
1837     }
1838 
1839     /**
1840      * Set value of {@link #ossindexAnalyzerUseCache}.
1841      *
1842      * @param ossindexAnalyzerUseCache new value of ossindexAnalyzerUseCache
1843      */
1844     public void setOssindexAnalyzerUseCache(Boolean ossindexAnalyzerUseCache) {
1845         this.ossindexAnalyzerUseCache = ossindexAnalyzerUseCache;
1846     }
1847 
1848     /**
1849      * Get value of {@link #ossindexAnalyzerUrl}.
1850      *
1851      * @return the value of ossindexAnalyzerUrl
1852      */
1853     public String getOssindexAnalyzerUrl() {
1854         return ossindexAnalyzerUrl;
1855     }
1856 
1857     /**
1858      * Set value of {@link #ossindexAnalyzerUrl}.
1859      *
1860      * @param ossindexAnalyzerUrl new value of ossindexAnalyzerUrl
1861      */
1862     public void setOssindexAnalyzerUrl(String ossindexAnalyzerUrl) {
1863         this.ossindexAnalyzerUrl = ossindexAnalyzerUrl;
1864     }
1865 
1866     /**
1867      * Get value of {@link #ossindexAnalyzerUsername}.
1868      *
1869      * @return the value of ossindexAnalyzerUsername
1870      */
1871     public String getOssindexAnalyzerUsername() {
1872         return ossindexAnalyzerUsername;
1873     }
1874 
1875     /**
1876      * Set value of {@link #ossindexAnalyzerUsername}.
1877      *
1878      * @param ossindexAnalyzerUsername new value of ossindexAnalyzerUsername
1879      */
1880     public void setOssindexAnalyzerUsername(String ossindexAnalyzerUsername) {
1881         this.ossindexAnalyzerUsername = ossindexAnalyzerUsername;
1882     }
1883 
1884     /**
1885      * Get value of {@link #ossindexAnalyzerPassword}.
1886      *
1887      * @return the value of ossindexAnalyzerPassword
1888      */
1889     public String getOssindexAnalyzerPassword() {
1890         return ossindexAnalyzerPassword;
1891     }
1892 
1893     /**
1894      * Set value of {@link #ossindexAnalyzerPassword}.
1895      *
1896      * @param ossindexAnalyzerPassword new value of ossindexAnalyzerPassword
1897      */
1898     public void setOssindexAnalyzerPassword(String ossindexAnalyzerPassword) {
1899         this.ossindexAnalyzerPassword = ossindexAnalyzerPassword;
1900     }
1901 
1902     /**
1903      * Get value of {@link #ossIndexAnalyzerWarnOnlyOnRemoteErrors}.
1904      *
1905      * @return the value of ossIndexWarnOnlyOnRemoteErrors
1906      */
1907     public Boolean getOssIndexWarnOnlyOnRemoteErrors() {
1908         return ossIndexAnalyzerWarnOnlyOnRemoteErrors;
1909     }
1910 
1911     /**
1912      * Set value of {@link #ossIndexAnalyzerWarnOnlyOnRemoteErrors}.
1913      *
1914      * @param ossIndexWarnOnlyOnRemoteErrors the value of
1915      * ossIndexWarnOnlyOnRemoteErrors
1916      */
1917     public void setOssIndexWarnOnlyOnRemoteErrors(Boolean ossIndexWarnOnlyOnRemoteErrors) {
1918         this.ossIndexAnalyzerWarnOnlyOnRemoteErrors = ossIndexWarnOnlyOnRemoteErrors;
1919     }
1920 
1921     /**
1922      * Get the value of cmakeAnalyzerEnabled.
1923      *
1924      * @return the value of cmakeAnalyzerEnabled
1925      */
1926     public Boolean isCmakeAnalyzerEnabled() {
1927         return cmakeAnalyzerEnabled;
1928     }
1929 
1930     /**
1931      * Set the value of cmakeAnalyzerEnabled.
1932      *
1933      * @param cmakeAnalyzerEnabled new value of cmakeAnalyzerEnabled
1934      */
1935     public void setCmakeAnalyzerEnabled(Boolean cmakeAnalyzerEnabled) {
1936         this.cmakeAnalyzerEnabled = cmakeAnalyzerEnabled;
1937     }
1938 
1939     /**
1940      * Returns the value of artifactoryAnalyzerEnabled.
1941      *
1942      * @return the value of artifactoryAnalyzerEnabled
1943      */
1944     public Boolean getArtifactoryAnalyzerEnabled() {
1945         return artifactoryAnalyzerEnabled;
1946     }
1947 
1948     /**
1949      * Set the value of artifactoryAnalyzerEnabled.
1950      *
1951      * @param artifactoryAnalyzerEnabled new value of artifactoryAnalyzerEnabled
1952      */
1953     public void setArtifactoryAnalyzerEnabled(Boolean artifactoryAnalyzerEnabled) {
1954         this.artifactoryAnalyzerEnabled = artifactoryAnalyzerEnabled;
1955     }
1956 
1957     /**
1958      * Returns the value of artifactoryAnalyzerUrl.
1959      *
1960      * @return the value of artifactoryAnalyzerUrl
1961      */
1962     public String getArtifactoryAnalyzerUrl() {
1963         return artifactoryAnalyzerUrl;
1964     }
1965 
1966     /**
1967      * Set the value of artifactoryAnalyzerUrl.
1968      *
1969      * @param artifactoryAnalyzerUrl new value of artifactoryAnalyzerUrl
1970      */
1971     public void setArtifactoryAnalyzerUrl(String artifactoryAnalyzerUrl) {
1972         this.artifactoryAnalyzerUrl = artifactoryAnalyzerUrl;
1973     }
1974 
1975     /**
1976      * Returns the value of artifactoryAnalyzerUseProxy.
1977      *
1978      * @return the value of artifactoryAnalyzerUseProxy
1979      */
1980     public Boolean getArtifactoryAnalyzerUseProxy() {
1981         return artifactoryAnalyzerUseProxy;
1982     }
1983 
1984     /**
1985      * Set the value of artifactoryAnalyzerUseProxy.
1986      *
1987      * @param artifactoryAnalyzerUseProxy new value of
1988      * artifactoryAnalyzerUseProxy
1989      */
1990     public void setArtifactoryAnalyzerUseProxy(Boolean artifactoryAnalyzerUseProxy) {
1991         this.artifactoryAnalyzerUseProxy = artifactoryAnalyzerUseProxy;
1992     }
1993 
1994     /**
1995      * Returns the value of artifactoryAnalyzerParallelAnalysis.
1996      *
1997      * @return the value of artifactoryAnalyzerParallelAnalysis
1998      */
1999     public Boolean getArtifactoryAnalyzerParallelAnalysis() {
2000         return artifactoryAnalyzerParallelAnalysis;
2001     }
2002 
2003     /**
2004      * Set the value of artifactoryAnalyzerParallelAnalysis.
2005      *
2006      * @param artifactoryAnalyzerParallelAnalysis new value of
2007      * artifactoryAnalyzerParallelAnalysis
2008      */
2009     public void setArtifactoryAnalyzerParallelAnalysis(Boolean artifactoryAnalyzerParallelAnalysis) {
2010         this.artifactoryAnalyzerParallelAnalysis = artifactoryAnalyzerParallelAnalysis;
2011     }
2012 
2013     /**
2014      * Returns the value of artifactoryAnalyzerUsername.
2015      *
2016      * @return the value of artifactoryAnalyzerUsername
2017      */
2018     public String getArtifactoryAnalyzerUsername() {
2019         return artifactoryAnalyzerUsername;
2020     }
2021 
2022     /**
2023      * Set the value of artifactoryAnalyzerUsername.
2024      *
2025      * @param artifactoryAnalyzerUsername new value of
2026      * artifactoryAnalyzerUsername
2027      */
2028     public void setArtifactoryAnalyzerUsername(String artifactoryAnalyzerUsername) {
2029         this.artifactoryAnalyzerUsername = artifactoryAnalyzerUsername;
2030     }
2031 
2032     /**
2033      * Returns the value of artifactoryAnalyzerApiToken.
2034      *
2035      * @return the value of artifactoryAnalyzerApiToken
2036      */
2037     public String getArtifactoryAnalyzerApiToken() {
2038         return artifactoryAnalyzerApiToken;
2039     }
2040 
2041     /**
2042      * Set the value of artifactoryAnalyzerApiToken.
2043      *
2044      * @param artifactoryAnalyzerApiToken new value of
2045      * artifactoryAnalyzerApiToken
2046      */
2047     public void setArtifactoryAnalyzerApiToken(String artifactoryAnalyzerApiToken) {
2048         this.artifactoryAnalyzerApiToken = artifactoryAnalyzerApiToken;
2049     }
2050 
2051     /**
2052      * Returns the value of artifactoryAnalyzerBearerToken.
2053      *
2054      * @return the value of artifactoryAnalyzerBearerToken
2055      */
2056     public String getArtifactoryAnalyzerBearerToken() {
2057         return artifactoryAnalyzerBearerToken;
2058     }
2059 
2060     /**
2061      * Set the value of artifactoryAnalyzerBearerToken.
2062      *
2063      * @param artifactoryAnalyzerBearerToken new value of
2064      * artifactoryAnalyzerBearerToken
2065      */
2066     public void setArtifactoryAnalyzerBearerToken(String artifactoryAnalyzerBearerToken) {
2067         this.artifactoryAnalyzerBearerToken = artifactoryAnalyzerBearerToken;
2068     }
2069 
2070     //see note on `dealWithReferences()` for information on this suppression
2071     @SuppressWarnings("squid:RedundantThrowsDeclarationCheck")
2072     @Override
2073     protected void executeWithContextClassloader() throws BuildException {
2074         dealWithReferences();
2075         validateConfiguration();
2076         populateSettings();
2077         try {
2078             Downloader.getInstance().configure(getSettings());
2079         } catch (InvalidSettingException e) {
2080             throw new BuildException(e);
2081         }
2082         try (Engine engine = new Engine(Check.class.getClassLoader(), getSettings())) {
2083             for (Resource resource : getPath()) {
2084                 final FileProvider provider = resource.as(FileProvider.class);
2085                 if (provider != null) {
2086                     final File file = provider.getFile();
2087                     if (file != null && file.exists()) {
2088                         engine.scan(file);
2089                     }
2090                 }
2091             }
2092             final ExceptionCollection exceptions = callExecuteAnalysis(engine);
2093             if (exceptions == null || !exceptions.isFatal()) {
2094                 for (String format : getReportFormats()) {
2095                     engine.writeReports(getProjectName(), new File(reportOutputDirectory), format, exceptions);
2096                 }
2097                 if (this.failBuildOnCVSS <= 10) {
2098                     checkForFailure(engine.getDependencies());
2099                 }
2100                 if (this.showSummary) {
2101                     DependencyCheckScanAgent.showSummary(engine.getDependencies());
2102                 }
2103             }
2104         } catch (DatabaseException ex) {
2105             final String msg = "Unable to connect to the dependency-check database; analysis has stopped";
2106             if (this.isFailOnError()) {
2107                 throw new BuildException(msg, ex);
2108             }
2109             log(msg, ex, Project.MSG_ERR);
2110         } catch (ReportException ex) {
2111             final String msg = "Unable to generate the dependency-check report";
2112             if (this.isFailOnError()) {
2113                 throw new BuildException(msg, ex);
2114             }
2115             log(msg, ex, Project.MSG_ERR);
2116         } finally {
2117             getSettings().cleanup();
2118         }
2119     }
2120 
2121     /**
2122      * Wraps the call to `engine.analyzeDependencies()` and correctly handles
2123      * any exceptions
2124      *
2125      * @param engine a reference to the engine
2126      * @return the collection of any exceptions that occurred; otherwise
2127      * <code>null</code>
2128      * @throws BuildException thrown if configured to fail the build on errors
2129      */
2130     //see note on `dealWithReferences()` for information on this suppression
2131     @SuppressWarnings("squid:RedundantThrowsDeclarationCheck")
2132     private ExceptionCollection callExecuteAnalysis(final Engine engine) throws BuildException {
2133         ExceptionCollection exceptions = null;
2134         try {
2135             engine.analyzeDependencies();
2136         } catch (ExceptionCollection ex) {
2137             if (this.isFailOnError()) {
2138                 throw new BuildException(ex);
2139             }
2140             exceptions = ex;
2141         }
2142         return exceptions;
2143     }
2144 
2145     /**
2146      * Validate the configuration to ensure the parameters have been properly
2147      * configured/initialized.
2148      *
2149      * @throws BuildException if the task was not configured correctly.
2150      */
2151     //see note on `dealWithReferences()` for information on this suppression
2152     @SuppressWarnings("squid:RedundantThrowsDeclarationCheck")
2153     private synchronized void validateConfiguration() throws BuildException {
2154         if (path == null) {
2155             throw new BuildException("No project dependencies have been defined to analyze.");
2156         }
2157         if (failBuildOnCVSS < 0 || failBuildOnCVSS > 11) {
2158             throw new BuildException("Invalid configuration, failBuildOnCVSS must be between 0 and 11.");
2159         }
2160     }
2161 
2162     /**
2163      * Takes the properties supplied and updates the dependency-check settings.
2164      * Additionally, this sets the system properties required to change the
2165      * proxy server, port, and connection timeout.
2166      *
2167      * @throws BuildException thrown when an invalid setting is configured.
2168      */
2169     //see note on `dealWithReferences()` for information on this suppression
2170     @SuppressWarnings("squid:RedundantThrowsDeclarationCheck")
2171     @Override
2172     protected void populateSettings() throws BuildException {
2173         super.populateSettings();
2174         getSettings().setBooleanIfNotNull(Settings.KEYS.AUTO_UPDATE, autoUpdate);
2175         getSettings().setArrayIfNotEmpty(Settings.KEYS.SUPPRESSION_FILE, suppressionFiles);
2176         getSettings().setStringIfNotEmpty(Settings.KEYS.HINTS_FILE, hintsFile);
2177         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_EXPERIMENTAL_ENABLED, enableExperimental);
2178         getSettings().setBooleanIfNotNull(Settings.KEYS.PRETTY_PRINT, prettyPrint);
2179         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_RETIRED_ENABLED, enableRetired);
2180         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_JAR_ENABLED, jarAnalyzerEnabled);
2181         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_PYTHON_DISTRIBUTION_ENABLED, pyDistributionAnalyzerEnabled);
2182         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_PYTHON_PACKAGE_ENABLED, pyPackageAnalyzerEnabled);
2183         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_RUBY_GEMSPEC_ENABLED, rubygemsAnalyzerEnabled);
2184         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_OPENSSL_ENABLED, opensslAnalyzerEnabled);
2185         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_CMAKE_ENABLED, cmakeAnalyzerEnabled);
2186 
2187         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_ARTIFACTORY_ENABLED, artifactoryAnalyzerEnabled);
2188         getSettings().setStringIfNotEmpty(Settings.KEYS.ANALYZER_ARTIFACTORY_URL, artifactoryAnalyzerUrl);
2189         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_ARTIFACTORY_USES_PROXY, artifactoryAnalyzerUseProxy);
2190         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_ARTIFACTORY_PARALLEL_ANALYSIS, artifactoryAnalyzerParallelAnalysis);
2191         getSettings().setStringIfNotEmpty(Settings.KEYS.ANALYZER_ARTIFACTORY_API_USERNAME, artifactoryAnalyzerUsername);
2192         getSettings().setStringIfNotEmpty(Settings.KEYS.ANALYZER_ARTIFACTORY_API_TOKEN, artifactoryAnalyzerApiToken);
2193         getSettings().setStringIfNotEmpty(Settings.KEYS.ANALYZER_ARTIFACTORY_BEARER_TOKEN, artifactoryAnalyzerBearerToken);
2194 
2195         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_SWIFT_PACKAGE_MANAGER_ENABLED, swiftPackageManagerAnalyzerEnabled);
2196         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_SWIFT_PACKAGE_RESOLVED_ENABLED, swiftPackageResolvedAnalyzerEnabled);
2197         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_COCOAPODS_ENABLED, cocoapodsAnalyzerEnabled);
2198         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_CARTHAGE_ENABLED, carthageAnalyzerEnabled);
2199         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_BUNDLE_AUDIT_ENABLED, bundleAuditAnalyzerEnabled);
2200         getSettings().setStringIfNotNull(Settings.KEYS.ANALYZER_BUNDLE_AUDIT_PATH, bundleAuditPath);
2201         getSettings().setStringIfNotNull(Settings.KEYS.ANALYZER_BUNDLE_AUDIT_WORKING_DIRECTORY, bundleAuditWorkingDirectory);
2202         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_AUTOCONF_ENABLED, autoconfAnalyzerEnabled);
2203         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_MAVEN_INSTALL_ENABLED, mavenInstallAnalyzerEnabled);
2204         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_PIP_ENABLED, pipAnalyzerEnabled);
2205         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_PIPFILE_ENABLED, pipfileAnalyzerEnabled);
2206         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_POETRY_ENABLED, poetryAnalyzerEnabled);
2207         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_COMPOSER_LOCK_ENABLED, composerAnalyzerEnabled);
2208         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_COMPOSER_LOCK_SKIP_DEV, composerAnalyzerSkipDev);
2209         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_CPANFILE_ENABLED, cpanfileAnalyzerEnabled);
2210         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_NODE_PACKAGE_ENABLED, nodeAnalyzerEnabled);
2211         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_NODE_PACKAGE_SKIPDEV, nodePackageSkipDevDependencies);
2212         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_NODE_AUDIT_ENABLED, nodeAuditAnalyzerEnabled);
2213         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_YARN_AUDIT_ENABLED, yarnAuditAnalyzerEnabled);
2214         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_PNPM_AUDIT_ENABLED, pnpmAuditAnalyzerEnabled);
2215         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_NODE_AUDIT_USE_CACHE, nodeAuditAnalyzerUseCache);
2216         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_NODE_AUDIT_SKIPDEV, nodeAuditSkipDevDependencies);
2217         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_RETIREJS_ENABLED, retireJsAnalyzerEnabled);
2218         getSettings().setStringIfNotNull(Settings.KEYS.ANALYZER_RETIREJS_REPO_JS_URL, retireJsUrl);
2219         getSettings().setStringIfNotNull(Settings.KEYS.ANALYZER_RETIREJS_REPO_JS_USER, retireJsUrlUser);
2220         getSettings().setStringIfNotNull(Settings.KEYS.ANALYZER_RETIREJS_REPO_JS_PASSWORD, retireJsUrlPassword);
2221         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_RETIREJS_FORCEUPDATE, retireJsAnalyzerForceUpdate);
2222         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_RETIREJS_FILTER_NON_VULNERABLE, retirejsFilterNonVulnerable);
2223         getSettings().setArrayIfNotEmpty(Settings.KEYS.ANALYZER_RETIREJS_FILTERS, retirejsFilters);
2224         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_GOLANG_DEP_ENABLED, golangDepEnabled);
2225         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_GOLANG_MOD_ENABLED, golangModEnabled);
2226         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_DART_ENABLED, dartAnalyzerEnabled);
2227         getSettings().setStringIfNotNull(Settings.KEYS.ANALYZER_GOLANG_PATH, pathToGo);
2228         getSettings().setStringIfNotNull(Settings.KEYS.ANALYZER_YARN_PATH, pathToYarn);
2229         getSettings().setStringIfNotNull(Settings.KEYS.ANALYZER_PNPM_PATH, pathToPnpm);
2230         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_MIX_AUDIT_ENABLED, mixAuditAnalyzerEnabled);
2231         getSettings().setStringIfNotNull(Settings.KEYS.ANALYZER_MIX_AUDIT_PATH, mixAuditPath);
2232         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, nuspecAnalyzerEnabled);
2233         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_NUGETCONF_ENABLED, nugetconfAnalyzerEnabled);
2234         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_LIBMAN_ENABLED, libmanAnalyzerEnabled);
2235         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_CENTRAL_ENABLED, centralAnalyzerEnabled);
2236         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_CENTRAL_USE_CACHE, centralAnalyzerUseCache);
2237         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled);
2238         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_ARCHIVE_ENABLED, archiveAnalyzerEnabled);
2239         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_KNOWN_EXPLOITED_ENABLED, knownExploitedEnabled);
2240         getSettings().setStringIfNotEmpty(Settings.KEYS.KEV_URL, knownExploitedUrl);
2241         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, assemblyAnalyzerEnabled);
2242         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_MSBUILD_PROJECT_ENABLED, msbuildAnalyzerEnabled);
2243         getSettings().setStringIfNotEmpty(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl);
2244         getSettings().setStringIfNotEmpty(Settings.KEYS.ANALYZER_NEXUS_USER, nexusUser);
2245         getSettings().setStringIfNotEmpty(Settings.KEYS.ANALYZER_NEXUS_PASSWORD, nexusPassword);
2246         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_NEXUS_USES_PROXY, nexusUsesProxy);
2247         getSettings().setStringIfNotEmpty(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, zipExtensions);
2248         getSettings().setStringIfNotEmpty(Settings.KEYS.ANALYZER_ASSEMBLY_DOTNET_PATH, pathToCore);
2249         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_OSSINDEX_ENABLED, ossindexAnalyzerEnabled);
2250         getSettings().setStringIfNotEmpty(Settings.KEYS.ANALYZER_OSSINDEX_URL, ossindexAnalyzerUrl);
2251         getSettings().setStringIfNotEmpty(Settings.KEYS.ANALYZER_OSSINDEX_USER, ossindexAnalyzerUsername);
2252         getSettings().setStringIfNotEmpty(Settings.KEYS.ANALYZER_OSSINDEX_PASSWORD, ossindexAnalyzerPassword);
2253         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_OSSINDEX_USE_CACHE, ossindexAnalyzerUseCache);
2254         getSettings().setBooleanIfNotNull(Settings.KEYS.ANALYZER_OSSINDEX_WARN_ONLY_ON_REMOTE_ERRORS, ossIndexAnalyzerWarnOnlyOnRemoteErrors);
2255         getSettings().setFloat(Settings.KEYS.JUNIT_FAIL_ON_CVSS, junitFailOnCVSS);
2256     }
2257 
2258     /**
2259      * Checks to see if a vulnerability has been identified with a CVSS score
2260      * that is above the threshold set in the configuration.
2261      *
2262      * @param dependencies the list of dependency objects
2263      * @throws BuildException thrown if a CVSS score is found that is higher
2264      * than the threshold set
2265      */
2266     //see note on `dealWithReferences()` for information on this suppression
2267     @SuppressWarnings("squid:RedundantThrowsDeclarationCheck")
2268     private void checkForFailure(Dependency[] dependencies) throws BuildException {
2269         final StringBuilder ids = new StringBuilder();
2270         for (Dependency d : dependencies) {
2271             boolean addName = true;
2272             for (Vulnerability v : d.getVulnerabilities()) {
2273                 if ((v.getCvssV2() != null && v.getCvssV2().getCvssData().getBaseScore() >= failBuildOnCVSS)
2274                         || (v.getCvssV3() != null && v.getCvssV3().getCvssData().getBaseScore() >= failBuildOnCVSS)
2275                         || (v.getUnscoredSeverity() != null && SeverityUtil.estimateCvssV2(v.getUnscoredSeverity()) >= failBuildOnCVSS)
2276                         //safety net to fail on any if for some reason the above misses on 0
2277                         || (failBuildOnCVSS <= 0.0f)) {
2278                     if (addName) {
2279                         addName = false;
2280                         ids.append(NEW_LINE).append(d.getFileName()).append(": ");
2281                         ids.append(v.getName());
2282                     } else {
2283                         ids.append(", ").append(v.getName());
2284                     }
2285                 }
2286             }
2287         }
2288         if (ids.length() > 0) {
2289             final String msg;
2290             if (showSummary) {
2291                 msg = String.format("%n%nDependency-Check Failure:%n"
2292                         + "One or more dependencies were identified with vulnerabilities that have a CVSS score greater than or equal to '%.1f': %s%n"
2293                         + "See the dependency-check report for more details.%n%n", failBuildOnCVSS, ids);
2294             } else {
2295                 msg = String.format("%n%nDependency-Check Failure:%n"
2296                         + "One or more dependencies were identified with vulnerabilities.%n%n"
2297                         + "See the dependency-check report for more details.%n%n");
2298             }
2299             throw new BuildException(msg);
2300         }
2301     }
2302 
2303     /**
2304      * An enumeration of supported report formats: "ALL", "HTML", "XML", "CSV",
2305      * "JSON", "JUNIT", "SARIF", 'JENkINS', etc..
2306      */
2307     public static class ReportFormats extends EnumeratedAttribute {
2308 
2309         /**
2310          * Returns the list of values for the report format.
2311          *
2312          * @return the list of values for the report format
2313          */
2314         @Override
2315         public String[] getValues() {
2316             int i = 0;
2317             final Format[] formats = Format.values();
2318             final String[] values = new String[formats.length];
2319             for (Format format : formats) {
2320                 values[i++] = format.name();
2321             }
2322             return values;
2323         }
2324     }
2325 
2326     /**
2327      * A class for Ant to represent the
2328      * {@code <reportFormat format="<format>"/>} nested element to define
2329      * multiple report formats for the ant-task.
2330      */
2331     public static class ReportFormat {
2332 
2333         /**
2334          * The format of this ReportFormat.
2335          */
2336         private ReportFormats format;
2337 
2338         /**
2339          * Gets the format as a String.
2340          *
2341          * @return the String representing a report format
2342          */
2343         public String getFormat() {
2344             return this.format.getValue();
2345         }
2346 
2347         /**
2348          * Sets the format.
2349          *
2350          * @param format the String value for one of the {@link ReportFormats}
2351          * @throws BuildException When the offered String is not one of the
2352          * valid values of the {@link ReportFormats} EnumeratedAttribute
2353          */
2354         public void setFormat(final String format) {
2355             this.format = (ReportFormats) EnumeratedAttribute.getInstance(ReportFormats.class, format);
2356         }
2357     }
2358 }
2359 //CSON: MethodCount