Showing 247 of 615 total issues
Method JWTAuth.Verify
has 8 return statements (exceeds 4 allowed). Open
Open
func (j *JWTAuth) Verify(material string) error {
token, err := jwt.ParseWithClaims(
material,
&jwt.StandardClaims{},
func(token *jwt.Token) (interface{}, error) {
Function checkSyntax
has 8 return statements (exceeds 4 allowed). Open
Open
func checkSyntax(interpreter string, flags []string, script string) error {
if interpreter == "" {
interpreter = defaultInterpreter
if len(flags) > 0 {
return errors.New("custom syntax check_flags given without an interpreter")
Method Unarchive.applyWithContext
has 8 return statements (exceeds 4 allowed). Open
Open
func (u *Unarchive) applyWithContext(ctx context.Context) (resource.TaskStatus, error) {
status := resource.NewStatus()
defer os.RemoveAll(u.fetchLoc)
err := u.diff(status)
Function PeerBranches
has 8 return statements (exceeds 4 allowed). Open
Open
func PeerBranches(g *graph.Graph, meta *node.Node) (out []*node.Node) {
if !IsConditional(meta) {
return
}
kind, ok := meta.LookupMetadata(MetaType)
Function Nodes
has 8 return statements (exceeds 4 allowed). Open
Open
func Nodes(ctx context.Context, root string, verify bool) (*graph.Graph, error) {
logger := logging.GetLogger(ctx).WithField("function", "Nodes")
toLoad := []*source{{"root", root, root}}
Method Resource.shouldStop
has 8 return statements (exceeds 4 allowed). Open
Open
func (r *Resource) shouldStop(u *Unit, st *resource.Status) bool {
switch u.ActiveState {
case "active":
st.AddDifference("state", "active", "inactive", "")
st.RaiseLevel(resource.StatusWillChange)
Method Resource.shouldStart
has 8 return statements (exceeds 4 allowed). Open
Open
func (r *Resource) shouldStart(u *Unit, st *resource.Status) bool {
switch u.ActiveState {
case "active":
st.AddMessage("already running")
return false
Method TypeExtractor.Visit
has 8 return statements (exceeds 4 allowed). Open
Open
func (te *TypeExtractor) Visit(node ast.Node) (w ast.Visitor) {
if node == nil {
return nil
}
Method Unarchive.evaluateDuplicates
has 7 return statements (exceeds 4 allowed). Open
Open
func (u *Unarchive) evaluateDuplicates() error {
// determine which directory has fewer items in order to minimize operations
dirA := u.destDir.Name()
dirB := u.fetchDir.Name()
filesA := u.destContents
Method pipelineGen.MaybeResolveConditional
has 7 return statements (exceeds 4 allowed). Open
Open
func (g *pipelineGen) MaybeResolveConditional(_ context.Context, idi interface{}) (interface{}, error) {
meta, ok := g.Graph.Get(g.ID)
if !ok {
return nil, errors.New("unexpectedly unable to find " + g.ID + " in graph")
}
Method User.DiffMod
has 7 return statements (exceeds 4 allowed). Open
Open
func (u *User) DiffMod(status *resource.Status, currUser *user.User) (*ModUserOptions, error) {
options := new(ModUserOptions)
// Check for differences between currUser and the desired modifications
if u.NewUsername != "" {
Avoid deeply nested control flow statements. Open
Open
if err != nil {
status.RaiseLevel(resource.StatusFatal)
status.Output = append(status.Output, fmt.Sprintf("error adding group %s", g.Name))
return status, errors.Wrap(err, "group add")
}
Function getParamOverrides
has 7 return statements (exceeds 4 allowed). Open
Open
func getParamOverrides(gFunc func() *graph.Graph, id string) (ValueThunk, bool) {
name := graph.BaseID(id)
f := func() (resource.Value, bool, error) { return resource.Value(""), false, nil }
if strings.HasPrefix(name, "param") {
f = func() (resource.Value, bool, error) {
Avoid deeply nested control flow statements. Open
Open
if err != nil {
status.RaiseLevel(resource.StatusFatal)
status.Output = append(status.Output, fmt.Sprintf("error adding group %s with gid %s", g.Name, g.GID))
return status, errors.Wrap(err, "group add")
}
Avoid deeply nested control flow statements. Open
Open
if err != nil {
status.RaiseLevel(resource.StatusFatal)
status.Output = append(status.Output, fmt.Sprintf("error modifying group %s with new gid %s", g.Name, g.GID))
return status, errors.Wrap(err, "group modify")
}
Avoid deeply nested control flow statements. Open
Open
if err != nil {
status.RaiseLevel(resource.StatusFatal)
status.Output = append(status.Output, fmt.Sprintf("error modifying group %s with new name %s and new gid %s", g.Name, g.NewName, g.GID))
return status, errors.Wrap(err, "group modify")
}
Avoid deeply nested control flow statements. Open
Open
if err != nil {
status.RaiseLevel(resource.StatusFatal)
status.Output = append(status.Output, fmt.Sprintf("error modifying group %s", g.Name))
return status, errors.Wrap(err, "group modify")
}
Function TestRetryUntil
has 7 return statements (exceeds 4 allowed). Open
Open
func TestRetryUntil(t *testing.T) {
t.Parallel()
defer logging.HideLogs(t)()
t.Run("sets retry count", func(t *testing.T) {
Function simpleApplySuccess
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func simpleApplySuccess(t *testing.T, lvm lowlevel.LVM, group string, devs []string, remove bool, forceRemove bool) resource.TaskStatus {
Function simpleApplyFailure
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func simpleApplyFailure(t *testing.T, lvm lowlevel.LVM, group string, devs []string, remove bool, forceRemove bool) resource.TaskStatus {