sonarqube

package
v0.0.0-...-eb5b319 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SonarAnalysisActionClass is the class of Sonar in Jenkins
	SonarAnalysisActionClass = "hudson.plugins.sonar.action.SonarAnalysisAction"
	// SonarMetricKeys are the metric keys
	SonarMetricKeys = "" /* 432-byte string literal not displayed */
	// SonarAdditionalFields is the key of the additional fields
	SonarAdditionalFields = "metrics,periods"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents the client of SonarQube

func NewSonarQubeClient

func NewSonarQubeClient(options *Options) (*Client, error)

NewSonarQubeClient creates a client with options

func (*Client) SonarQube

func (s *Client) SonarQube() *sonargo.Client

SonarQube returns sonarqube client Also we can wrap some methods to avoid direct use sonar client

type Options

type Options struct {
	Host  string `json:",omitempty" yaml:"host" description:"SonarQube service host address"`
	Token string `json:",omitempty" yaml:"token" description:"SonarQube service token"`
}

Options represents the flags for the CLI

func NewSonarQubeOptions

func NewSonarQubeOptions() *Options

NewSonarQubeOptions creates an empty Option instance

func (*Options) AddFlags

func (s *Options) AddFlags(fs *pflag.FlagSet, c *Options)

AddFlags adds flags to a flag set

func (*Options) ApplyTo

func (s *Options) ApplyTo(options *Options)

ApplyTo applies the current values to target one

func (*Options) Validate

func (s *Options) Validate() []error

Validate runs the validation of the options

type SonarInterface

type SonarInterface interface {
	GetSonarResultsByTaskIds(taskIDS ...string) ([]*SonarStatus, error)
}

SonarInterface represents a SonarQube interface

type SonarQube

type SonarQube struct {
	// contains filtered or unexported fields
}

SonarQube represents SonarQube instance

func NewSonar

func NewSonar(client *sonargo.Client) *SonarQube

NewSonar creates a sonar instance

func (*SonarQube) GetSonarResultsByTaskIds

func (s *SonarQube) GetSonarResultsByTaskIds(taskIDs ...string) ([]*SonarStatus, error)

GetSonarResultsByTaskIds gets the sonar result

type SonarStatus

type SonarStatus struct {
	Measures      *sonargo.MeasuresComponentObject `json:"measures,omitempty"`
	Issues        *sonargo.IssuesSearchObject      `json:"issues,omitempty"`
	GeneralAction *devops.GeneralAction            `json:"generalAction,omitempty"`
	Task          *sonargo.CeTaskObject            `json:"task,omitempty"`
}

SonarStatus represents the status of a sonar request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL