Class CodeSonarHubAnalysisDataLoader
- java.lang.Object
-
- org.jenkinsci.plugins.codesonar.services.CodeSonarHubAnalysisDataLoader
-
public class CodeSonarHubAnalysisDataLoader extends Object
Loads and caches data related to a single analysis, for use by "Condition" classes. This class implements two distinct modes for loading data: a "legacy" mode, and the current mode. The legacy mode loads large lists of warnings and procedures into main memory. This was the only mode implemented through plugin version 3.3.x. The current mode fetches analysis data in a more memory-safe way, but it requires CodeSonar hub JSON APIs, available only in CodeSonar 7.3 and later (i.e. with the "gridConfigJson" capability).- Author:
- aseno
-
-
Field Summary
Fields Modifier and Type Field Description protected CodeSonarHubInfo
hubInfo
protected CodeSonarServices
services
-
Constructor Summary
Constructors Constructor Description CodeSonarHubAnalysisDataLoader(HttpService httpService, CodeSonarHubInfo hubInfo, URI baseHubUri, Long analysisId, String visibilityFilter, String newWarningsVisibilityFilter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Long
getAnalysisId()
URI
getBaseHubUri()
protected Analysis
getLegacyAnalysisViewActive()
protected Analysis
getLegacyAnalysisViewNew()
protected Metrics
getLegacyMetrics()
protected Procedures
getLegacyProcedures()
protected String
getNewWarningsVisibilityFilter()
long
getNumberOfActiveWarnings()
int
getNumberOfAlerts(CodeSonarAlertLevels level)
long
getNumberOfNewWarnings()
long
getNumberOfWarningsWithScoreAboveThreshold(int threshold)
ProcedureJsonRow
getProcedureWithMaxCyclomaticComplexity()
protected String
getVisibilityFilter()
-
-
-
Field Detail
-
services
protected CodeSonarServices services
-
hubInfo
protected CodeSonarHubInfo hubInfo
-
-
Constructor Detail
-
CodeSonarHubAnalysisDataLoader
public CodeSonarHubAnalysisDataLoader(HttpService httpService, CodeSonarHubInfo hubInfo, URI baseHubUri, Long analysisId, String visibilityFilter, String newWarningsVisibilityFilter)
-
-
Method Detail
-
getBaseHubUri
public URI getBaseHubUri()
-
getAnalysisId
protected Long getAnalysisId()
-
getVisibilityFilter
protected String getVisibilityFilter()
-
getNewWarningsVisibilityFilter
protected String getNewWarningsVisibilityFilter()
-
getLegacyAnalysisViewActive
protected Analysis getLegacyAnalysisViewActive() throws CodeSonarPluginException
- Throws:
CodeSonarPluginException
-
getLegacyAnalysisViewNew
protected Analysis getLegacyAnalysisViewNew() throws CodeSonarPluginException
- Throws:
CodeSonarPluginException
-
getLegacyProcedures
protected Procedures getLegacyProcedures() throws CodeSonarPluginException
- Throws:
CodeSonarPluginException
-
getLegacyMetrics
protected Metrics getLegacyMetrics() throws CodeSonarPluginException
- Throws:
CodeSonarPluginException
-
getNumberOfActiveWarnings
public long getNumberOfActiveWarnings() throws CodeSonarPluginException
- Throws:
CodeSonarPluginException
-
getNumberOfNewWarnings
public long getNumberOfNewWarnings() throws CodeSonarPluginException
- Throws:
CodeSonarPluginException
-
getProcedureWithMaxCyclomaticComplexity
public ProcedureJsonRow getProcedureWithMaxCyclomaticComplexity() throws CodeSonarPluginException
- Throws:
CodeSonarPluginException
-
getNumberOfAlerts
public int getNumberOfAlerts(CodeSonarAlertLevels level) throws CodeSonarPluginException
- Throws:
CodeSonarPluginException
-
getNumberOfWarningsWithScoreAboveThreshold
public long getNumberOfWarningsWithScoreAboveThreshold(int threshold) throws CodeSonarPluginException
- Throws:
CodeSonarPluginException
-
-