Showing 247 of 615 total issues
Function simpleCheckFailure
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func simpleCheckFailure(t *testing.T, lvm lowlevel.LVM, group string, devs []string, remove bool, forceRemove bool) resource.TaskStatus {
Function getFailedReason
has 7 return statements (exceeds 4 allowed). Open
Open
func getFailedReason(u *Unit) (string, error) {
err := errors.New("unable to determine cause of failure: no properties available")
var reason string
switch u.Type {
case UnitTypeService:
Function simpleCheckSuccess
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func simpleCheckSuccess(t *testing.T, lvm lowlevel.LVM, group string, devs []string, remove bool, forceRemove bool) (resource.TaskStatus, resource.Task) {
Function ResolveDependencies
has 7 return statements (exceeds 4 allowed). Open
Open
func ResolveDependencies(ctx context.Context, g *graph.Graph) (*graph.Graph, error) {
logger := logging.GetLogger(ctx).WithField("function", "ResolveDependencies")
logger.Debug("resolving dependencies")
groupLock := new(sync.Mutex)
Method Fetch.DiffFile
has 7 return statements (exceeds 4 allowed). Open
Open
func (f *Fetch) DiffFile(status *resource.Status, hsh hash.Hash) (*resource.Status, error) {
// the destination should be a file if fetching without an unarchive
// if unarchiving, the destination should be a directory
stat, err := os.Stat(f.Destination)
if err == nil {
Method ExportExtractor.Visit
has 7 return statements (exceeds 4 allowed). Open
Open
func (e *ExportExtractor) Visit(node ast.Node) (w ast.Visitor) {
switch n := node.(type) {
case *ast.File, *ast.TypeSpec, *ast.FieldList:
return e
case *ast.StructType:
Method Fetch.applyWithContext
has 7 return statements (exceeds 4 allowed). Open
Open
func (f *Fetch) applyWithContext(context.Context) (resource.TaskStatus, error) {
var (
hsh hash.Hash
err error
status = resource.NewStatus()
Function Parse
has 6 return statements (exceeds 4 allowed). Open
Open
func Parse(content []byte) (resources []*Node, err error) {
obj, err := hcl.ParseBytes(content)
if err != nil {
return resources, err
}
Method Unarchive.isMemAvailable
has 6 return statements (exceeds 4 allowed). Open
Open
func (u *Unarchive) isMemAvailable() (bool, error) {
var (
destStat syscall.Statfs_t
tmpStat syscall.Statfs_t
)
Method grapher.Graph
has 6 return statements (exceeds 4 allowed). Open
Open
func (g *grapher) Graph(in *pb.LoadRequest, stream pb.Grapher_GraphServer) error {
logger, ctx := setIDLogger(stream.Context())
logger = logger.WithField("function", "grapher.Graph")
loaded, err := in.Load(ctx)
Function WithNotify
has 6 return statements (exceeds 4 allowed). Open
Open
func WithNotify(ctx context.Context, in *graph.Graph, notify *graph.Notifier) (*graph.Graph, error) {
var hasErrors error
out, err := in.Transform(ctx,
notify.Transform(func(meta *node.Node, out *graph.Graph) error {
Method User.Check
has 6 return statements (exceeds 4 allowed). Open
Open
func (u *User) Check(context.Context, resource.Renderer) (resource.TaskStatus, error) {
// lookup the user by name
// ErrUnsupported is returned if the system is not supported
// Lookup returns user.UnknownUserError if the user is not found
userByName, nameErr := u.system.Lookup(u.Username)
Function TraverseUntilModule
has 6 return statements (exceeds 4 allowed). Open
Open
func TraverseUntilModule(g *graph.Graph, id string) bool {
if graph.IsRoot(id) {
return true
}
elemMeta, ok := g.Get(id)
Method pipelineGen.PlanNode
has 6 return statements (exceeds 4 allowed). Open
Open
func (g *pipelineGen) PlanNode(ctx context.Context, taski interface{}) (interface{}, error) {
twrapper, ok := taski.(taskWrapper)
if !ok {
asResult, ok := taski.(*Result)
if ok {
Method commandIOContext.exec
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *commandIOContext) exec(script string) (results *CommandResults, err error) {
results = &CommandResults{
Stdin: script,
}
Method Network.Apply
has 6 return statements (exceeds 4 allowed). Open
Open
func (n *Network) Apply(context.Context) (resource.TaskStatus, error) {
status := resource.NewStatus()
var (
nw *dc.Network
Function mergeMaybeUnresolvables
has 6 return statements (exceeds 4 allowed). Open
Open
func mergeMaybeUnresolvables(err1, err2 error) error {
if err1 == nil {
return err2
}
if err2 == nil {
Method CommandResults.Eq
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *CommandResults) Eq(cmd *CommandResults) bool {
if c == nil || cmd == nil {
return false
}
if c.ExitStatus != cmd.ExitStatus {
Method Preparer.convertNumber
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *Preparer) convertNumber(typ reflect.Type, r Renderer, name string, val interface{}, base int) (reflect.Value, error) {
if val == nil {
return reflect.Zero(typ), nil
}
Method Server.newREST
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Server) newREST(ctx context.Context, addr *url.URL) (*http.Server, error) {
opts, err := s.Security.Client()
if err != nil {
return nil, errors.Wrap(err, "could not generate REST gateway security options")
}