Showing 611 of 2,161 total issues
Method JobScheduleDeleteReader.ReadResponse
has 5 return statements (exceeds 4 allowed). Open
Open
func (o *JobScheduleDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 202:
result := NewJobScheduleDeleteAccepted()
Method FileGetNodeFilePropertiesFromTaskReader.ReadResponse
has 5 return statements (exceeds 4 allowed). Open
Open
func (o *FileGetNodeFilePropertiesFromTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewFileGetNodeFilePropertiesFromTaskOK()
Method FileListFromTaskReader.ReadResponse
has 5 return statements (exceeds 4 allowed). Open
Open
func (o *FileListFromTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewFileListFromTaskOK()
Method ProvidersListParams.WriteToRequest
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
Open
func (o *ProvidersListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method QueueService.Queues
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
Open
func (s *QueueService) Queues(ctx context.Context, handler cloud.QueueStatusHandler) (err error) {
s.Logger.Println("Retrieving queue names")
statusSet := make(map[string]cloud.QueueStatus)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method QueueManager.Workers
has 5 return statements (exceeds 4 allowed). Open
Open
func (m *QueueManager) Workers(ctx context.Context, queue string, handler cloud.QueueManagerNameHandler) (err error) {
if m.Failure {
return ErrServiceFailure
}
Method QueueManager.CreateWorkers
has 5 return statements (exceeds 4 allowed). Open
Open
func (m *QueueManager) CreateWorkers(ctx context.Context, queue string, n int, handler cloud.QueueManagerNameHandler) (err error) {
if m.Failure {
return ErrServiceFailure
}
Method AvailabilitySetsListParams.WriteToRequest
has 5 return statements (exceeds 4 allowed). Open
Open
func (o *AvailabilitySetsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
Method ImagesListByResourceGroupParams.WriteToRequest
has 5 return statements (exceeds 4 allowed). Open
Open
func (o *ImagesListByResourceGroupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
Method QueueService.Fetch
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *QueueService) Fetch(ctx context.Context, queue string) (task *Task, err error) {
s.Logger.Println("Retrieving a task in queue", queue)
query := datastore.NewQuery(QueueKind).Filter("QueueName=", queue).Filter("Status=", TaskStatusWaiting).Limit(1)
Method VirtualMachineScaleSetsListParams.WriteToRequest
has 5 return statements (exceeds 4 allowed). Open
Open
func (o *VirtualMachineScaleSetsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
Method StorageService.Upload
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *StorageService) Upload(ctx context.Context, loc *url.URL, in io.Reader) (err error) {
s.Logger.Println("Uploading a file to", loc)
client, err := s.newClient(ctx)
if err != nil {
Method QueueManager.DeleteQueue
has 5 return statements (exceeds 4 allowed). Open
Open
func (m *QueueManager) DeleteQueue(ctx context.Context, queue string) error {
if m.Failure {
return ErrServiceFailure
}
Method VirtualMachineSizesListParams.WriteToRequest
has 5 return statements (exceeds 4 allowed). Open
Open
func (o *VirtualMachineSizesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
Method StorageService.List
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *StorageService) List(ctx context.Context, loc *url.URL, handler cloud.FileInfoHandler) (err error) {
s.Logger.Printf(`Retrieving the list of files matching to prefix "%v"`, loc)
client, err := s.newClient(ctx)
if err != nil {
Method QueueManager.Restart
has 5 return statements (exceeds 4 allowed). Open
Open
func (m *QueueManager) Restart(ctx context.Context, queue string) error {
if m.Failure {
return ErrServiceFailure
}
Method StorageService.Download
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *StorageService) Download(ctx context.Context, loc *url.URL, out io.Writer) (err error) {
s.Logger.Println("Downloading a file from", loc)
client, err := s.newClient(ctx)
if err != nil {
Method VirtualMachinesListParams.WriteToRequest
has 5 return statements (exceeds 4 allowed). Open
Open
func (o *VirtualMachinesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
Method VirtualMachineImagesListPublishersParams.WriteToRequest
has 5 return statements (exceeds 4 allowed). Open
Open
func (o *VirtualMachineImagesListPublishersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
Method QueueManager.DeleteTask
has 5 return statements (exceeds 4 allowed). Open
Open
func (m *QueueManager) DeleteTask(ctx context.Context, queue, task string) error {
if m.Failure {
return ErrServiceFailure
}