Class AnalysisResult

    • Constructor Detail

      • AnalysisResult

        public AnalysisResult​(Run<?,​?> owner,
                              String id,
                              DeltaReport report,
                              io.jenkins.plugins.forensics.blame.Blames blames,
                              io.jenkins.plugins.forensics.miner.RepositoryStatistics totals,
                              QualityGateStatus qualityGateStatus,
                              Map<String,​Integer> sizePerOrigin,
                              AnalysisResult previousResult)
        Creates a new instance of AnalysisResult.
        Parameters:
        owner - the current build as owner of this action
        id - ID of the results
        report - the issues of this result
        blames - author and commit information for all issues
        totals - repository statistics for all issues
        qualityGateStatus - the quality gate status
        sizePerOrigin - the number of issues per origin
        previousResult - the analysis result of the previous run
      • AnalysisResult

        public AnalysisResult​(Run<?,​?> owner,
                              String id,
                              DeltaReport report,
                              io.jenkins.plugins.forensics.blame.Blames blames,
                              io.jenkins.plugins.forensics.miner.RepositoryStatistics totals,
                              QualityGateStatus qualityGateStatus,
                              Map<String,​Integer> sizePerOrigin)
        Creates a new instance of AnalysisResult.
        Parameters:
        owner - the current build as owner of this action
        id - ID of the results
        report - the issues of this result
        blames - author and commit information for all issues
        totals - repository statistics for all issues
        qualityGateStatus - the quality gate status
        sizePerOrigin - the number of issues per origin
      • AnalysisResult

        protected AnalysisResult​(Run<?,​?> owner,
                                 String id,
                                 DeltaReport report,
                                 io.jenkins.plugins.forensics.blame.Blames blames,
                                 io.jenkins.plugins.forensics.miner.RepositoryStatistics repositoryStatistics,
                                 QualityGateStatus qualityGateStatus,
                                 Map<String,​Integer> sizePerOrigin,
                                 boolean canSerialize)
        Creates a new instance of AnalysisResult.
        Parameters:
        owner - the current run as owner of this action
        id - ID of the results
        report - the issues of this result
        blames - author and commit information for all issues
        repositoryStatistics - source code repository statistics for all issues
        qualityGateStatus - the quality gate status
        sizePerOrigin - the number of issues per origin
        canSerialize - determines whether the result should be persisted in the build folder
    • Method Detail

      • readResolve

        protected Object readResolve()
        Called after de-serialization to retain backward compatibility.
        Returns:
        this
      • getBlames

        public io.jenkins.plugins.forensics.blame.Blames getBlames()
        Returns the blames for the report.
        Returns:
        the blames
      • getForensics

        public io.jenkins.plugins.forensics.miner.RepositoryStatistics getForensics()
        Returns the repository statistics for the report.
        Returns:
        the statistics
      • getOwner

        public Run<?,​?> getOwner()
        Description copied from interface: StaticAnalysisRun
        Returns the run that created this static analysis result.
        Specified by:
        getOwner in interface StaticAnalysisRun
        Returns:
        the run
      • setOwner

        public void setOwner​(Run<?,​?> owner)
        Sets the run for this result after Jenkins read its data from disk.
        Parameters:
        owner - the initialized run
      • getErrorMessages

        public org.eclipse.collections.api.list.ImmutableList<String> getErrorMessages()
        Description copied from interface: StaticAnalysisRun
        Returns the error messages of the analysis run.
        Specified by:
        getErrorMessages in interface StaticAnalysisRun
        Returns:
        the error messages
      • getInfoMessages

        public org.eclipse.collections.api.list.ImmutableList<String> getInfoMessages()
        Description copied from interface: StaticAnalysisRun
        Returns the info messages of the analysis run.
        Specified by:
        getInfoMessages in interface StaticAnalysisRun
        Returns:
        the info messages
      • getIssues

        public edu.hm.hafner.analysis.Report getIssues()
        Returns all issues of the associated static analysis run. These include outstanding issues as well as new issues.
        Returns:
        all issues
      • isEmpty

        public boolean isEmpty()
        Check if AnalysisResult issues are empty (including new, outstanding and fixed).
        Returns:
        true if AnalysisResult issues are empty, else false.
      • hasNoNewWarnings

        public boolean hasNoNewWarnings()
        Check if AnalysisResult issues does not have any new warnings.
        Returns:
        true if AnalysisResult issues has no new warnings.
      • getOutstandingIssues

        public edu.hm.hafner.analysis.Report getOutstandingIssues()
        Returns all outstanding issues of the associated static analysis run. I.e. all issues, that are part of the current and previous report.
        Returns:
        all outstanding issues
      • getNewIssues

        public edu.hm.hafner.analysis.Report getNewIssues()
        Returns all new issues of the associated static analysis run. I.e. all issues, that are part of the current report but have not been shown up in the previous report.
        Returns:
        all new issues
      • getFixedIssues

        public edu.hm.hafner.analysis.Report getFixedIssues()
        Returns all fixed issues of the associated static analysis run. I.e. all issues, that are part of the previous report but are not present in the current report anymore.
        Returns:
        all fixed issues
      • getNoIssuesSinceBuild

        public int getNoIssuesSinceBuild()
        Description copied from interface: StaticAnalysisRun
        Returns the build number since the associated job has no issues.
        Specified by:
        getNoIssuesSinceBuild in interface StaticAnalysisRun
        Returns:
        the build number since there are no issues, or -1 if issues have been reported
      • getSuccessfulSinceBuild

        public int getSuccessfulSinceBuild()
        Description copied from interface: StaticAnalysisRun
        Returns the build number since the associated job has a successful static analysis result.
        Specified by:
        getSuccessfulSinceBuild in interface StaticAnalysisRun
        Returns:
        the build number since the static analysis result is successful, or -1 if the result is not successful
      • getSizePerOrigin

        public Map<String,​Integer> getSizePerOrigin()
        Description copied from interface: AnalysisBuildResult
        Returns the number of issues in this analysis run, mapped by their origin. The origin is the tool that created the report.
        Specified by:
        getSizePerOrigin in interface AnalysisBuildResult
        Returns:
        number of issues per origin
      • getSizePerSeverity

        public Map<edu.hm.hafner.analysis.Severity,​Integer> getSizePerSeverity()
        Returns the number of issues in this analysis run, mapped by Severity.
        Returns:
        number of issues per severity
      • getNewSizePerSeverity

        public Map<edu.hm.hafner.analysis.Severity,​Integer> getNewSizePerSeverity()
        Returns the new number of issues in this analysis run, mapped by Severity.
        Returns:
        number of issues per severity
      • getTotalSizeOf

        public int getTotalSizeOf​(edu.hm.hafner.analysis.Severity severity)
        Description copied from interface: AnalysisBuildResult
        Returns the total number of issues in this analysis run that have the specified Severity.
        Specified by:
        getTotalSizeOf in interface AnalysisBuildResult
        Parameters:
        severity - the severity of the issues to match
        Returns:
        total number of issues
      • getTotalErrorsSize

        public int getTotalErrorsSize()
        Returns the total number of errors in this analysis run.
        Returns:
        total number of errors
      • getTotalHighPrioritySize

        public int getTotalHighPrioritySize()
        Returns the total number of high severity issues in this analysis run.
        Returns:
        total number of high severity issues
      • getTotalNormalPrioritySize

        public int getTotalNormalPrioritySize()
        Returns the total number of normal severity issues in this analysis run.
        Returns:
        total number of normal severity issues
      • getTotalLowPrioritySize

        public int getTotalLowPrioritySize()
        Returns the total number of low severity issues in this analysis run.
        Returns:
        total number of low severity of issues
      • getNewSizeOf

        public int getNewSizeOf​(edu.hm.hafner.analysis.Severity severity)
        Description copied from interface: AnalysisBuildResult
        Returns the new number of issues in this analysis run that have the specified Severity.
        Specified by:
        getNewSizeOf in interface AnalysisBuildResult
        Parameters:
        severity - the severity of the issues to match
        Returns:
        total number of issues
      • getNewErrorSize

        public int getNewErrorSize()
        Returns the number of new errors in this analysis run.
        Returns:
        number of new errors issues
      • getNewHighPrioritySize

        public int getNewHighPrioritySize()
        Returns the number of new high severity issues in this analysis run.
        Returns:
        number of new high severity issues
      • getNewNormalPrioritySize

        public int getNewNormalPrioritySize()
        Returns the number of new normal severity issues in this analysis run.
        Returns:
        number of new normal severity issues
      • getNewLowPrioritySize

        public int getNewLowPrioritySize()
        Returns the number of new low severity issues in this analysis run.
        Returns:
        number of new low severity of issues
      • getDeltaSize

        public int getDeltaSize()
      • getBuild

        public edu.hm.hafner.echarts.Build getBuild()