Showing 1,820 of 1,820 total issues
Avoid deeply nested control flow statements. Open
Open
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRaft
}
if iNdEx >= l {
Avoid deeply nested control flow statements. Open
Open
for iNdEx < postIndex {
var v uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRaft
Avoid deeply nested control flow statements. Open
Open
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
Avoid deeply nested control flow statements. Open
Open
if postIndex > l {
return io.ErrUnexpectedEOF
}
Method Orchestrator.addTasks
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (r *Orchestrator) addTasks(ctx context.Context, batch *store.Batch, service *api.Service, runningSlots map[uint64]orchestrator.Slot, deadSlots map[uint64]orchestrator.Slot, count uint64) {
Method Orchestrator.tickTasks
has 7 return statements (exceeds 4 allowed). Open
Open
func (g *Orchestrator) tickTasks(ctx context.Context) {
if len(g.restartTasks) == 0 {
return
}
err := g.store.Batch(func(batch *store.Batch) error {
Avoid deeply nested control flow statements. Open
Open
if err != nil {
log.G(ctx).WithError(err).WithField("task.id", updated.ID).Warning("failed to remove old task after starting replacement")
}
Method Updater.Run
has 7 return statements (exceeds 4 allowed). Open
Open
func (u *Updater) Run(ctx context.Context, slots []orchestrator.Slot) {
defer close(u.doneChan)
service := u.newService
Avoid deeply nested control flow statements. Open
Open
if integer < 128 {
count++
}
Avoid deeply nested control flow statements. Open
Open
if postIndex < 0 {
return ErrInvalidLengthRaft
}
Function DecryptPEMBlock
has 7 return statements (exceeds 4 allowed). Open
Open
func DecryptPEMBlock(block *pem.Block, password []byte) ([]byte, error) {
der := block.Bytes
var privKey encryptedPrivateKeyInfo
if _, err := asn1.Unmarshal(der, &privKey); err != nil {
Avoid deeply nested control flow statements. Open
Open
if shift >= 64 {
return ErrIntOverflowRaft
}
Avoid deeply nested control flow statements. Open
Open
if b < 0x80 {
break
}
Avoid deeply nested control flow statements. Open
Open
if packedLen < 0 {
return ErrInvalidLengthRaft
}
Method Supervisor.Restart
has 7 return statements (exceeds 4 allowed). Open
Open
func (r *Supervisor) Restart(ctx context.Context, tx store.Tx, cluster *api.Cluster, service *api.Service, t api.Task) error {
// TODO(aluzzardi): This function should not depend on `service`.
// Is the old task still in the process of restarting? If so, wait for
// its restart delay to elapse, to avoid tight restart loops (for
Function AuthorizeForwardedRoleAndOrg
has 7 return statements (exceeds 4 allowed). Open
Open
func AuthorizeForwardedRoleAndOrg(ctx context.Context, authorizedRoles, forwarderRoles []string, org string, blacklistedCerts map[string]*api.BlacklistedCertificate) (string, error) {
if isForwardedRequest(ctx) {
_, err := AuthorizeOrgAndRole(ctx, org, blacklistedCerts, forwarderRoles...)
if err != nil {
return "", status.Errorf(codes.PermissionDenied, "Permission denied: unauthorized forwarder role: %v", err)
Avoid deeply nested control flow statements. Open
Open
if assignments.addOrUpdateTask(readTx, v.Task) {
oneModification()
}
Avoid deeply nested control flow statements. Open
Open
if assignments.removeTask(readTx, v.Task) {
oneModification()
}
Method Scheduler.scheduleNTasksOnSubtree
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (s *Scheduler) scheduleNTasksOnSubtree(ctx context.Context, n int, taskGroup map[string]*api.Task, tree *decisionTree, schedulingDecisions map[string]schedulingDecision, nodeLess func(a *NodeInfo, b *NodeInfo) bool) int {
Function newRootRotationObject
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func newRootRotationObject(ctx context.Context, securityConfig *ca.SecurityConfig, apiRootCA *api.RootCA, newCARootCA ca.RootCA, extCAs []*api.ExternalCA, version uint64) (*api.RootCA, error) {