Showing 2,161 of 2,161 total issues
Method PoolPatchParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *PoolPatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method JobUpdateParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *JobUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method PoolEnableAutoScaleParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *PoolEnableAutoScaleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method PoolResizeParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *PoolResizeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method PoolRemoveNodesParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *PoolRemoveNodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method TaskReactivateParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *TaskReactivateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method TaskTerminateParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *TaskTerminateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method ComputeNodeUpdateUserParams.WriteToRequest
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
Open
func (o *ComputeNodeUpdateUserParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
- 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 TaskDeleteParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *TaskDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method JobDisableParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *JobDisableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method JobTerminateParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *JobTerminateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method JobPatchParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *JobPatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method JobSchedulePatchParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *JobSchedulePatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method FileGetFromTaskParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *FileGetFromTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method FileGetFromComputeNodeParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *FileGetFromComputeNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method JobScheduleUpdateParams.WriteToRequest
has 13 return statements (exceeds 4 allowed). Open
Open
func (o *JobScheduleUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
Method BatchService.CreateJob
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
Open
func (s *BatchService) CreateJob(ctx context.Context, name string) (err error) {
// 1. Check metadata, if error returns, it means no app exists, then upload.
// 2. If version metadata is old or snapshot, upload new version.
// 3. otherwise create url and use it.
- 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 mockBatchAcountServer.ServeHTTP
has 13 return statements (exceeds 4 allowed). Open
Open
func (m *mockBatchAcountServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {
paths := strings.Split(strings.TrimPrefix(req.URL.Path, "/"), "/")
if len(paths) < 2 {
res.WriteHeader(http.StatusBadRequest)
Method optDataPut.run
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *optDataPut) run() (err error) {
filenames, err := filepath.Glob(o.Filename)
if err != nil {
return
Function TestConfigMachineTypeSet
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestConfigMachineTypeSet(t *testing.T) {
var err error
var output bytes.Buffer
p := mock.NewProvider()