Showing 53 of 348 total issues
Function login
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ctx context.Context,
runner command.Runner,
server string,
username string,
password string,
Method Loader.Load
has 5 return statements (exceeds 4 allowed). Open
Open
func (l *Loader) Load(path string) (*config.Config, error) {
path = l.normalizePath(path, "")
if err := l.readConfigs(path); err != nil {
return nil, err
Function translateRegistry
has 5 return statements (exceeds 4 allowed). Open
Open
func translateRegistry(data json.RawMessage) (config.Registry, error) {
typeHint := &RegistryTypeHint{Type: "server"}
if err := json.Unmarshal(data, typeHint); err != nil {
return nil, err
Function runMain
has 5 return statements (exceeds 4 allowed). Open
Open
func runMain() error {
app := kingpin.New("ij", "IJ is a build tool using Docker containers.").Version(consts.Version)
clean := app.Command("clean", "Remove exported files.")
_ = app.Command("login", "Login to docker registries.")
_ = app.Command("logout", "Logout of docker registries.")
Method runTaskRunner.Run
has 5 return statements (exceeds 4 allowed). Open
Open
func (r *runTaskRunner) Run(context *RunContext) bool {
r.logger.Info(
r.prefix,
"Beginning task",
)
Method ScratchSpace.MakeLogFiles
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *ScratchSpace) MakeLogFiles(prefix string) (*os.File, *os.File, error) {
outpath, err := buildPath(filepath.Join(s.runpath, LogsDir, prefix+OutLogSuffix))
if err != nil {
return nil, nil, err
}
Function validateConfig
has 5 return statements (exceeds 4 allowed). Open
Open
func validateConfig(path string, data []byte) error {
if err := schema.Validate("schema/config.yaml", data); err != nil {
return fmt.Errorf("failed to validate config %s: %s", path, err.Error())
}
Method runTaskCommandBuilderState.addCommandOptions
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *runTaskCommandBuilderState) addCommandOptions(cb *command.Builder) error {
if s.task.Script != "" {
return nil
}
Method runTaskRunner.exportEnvironmentFile
has 5 return statements (exceeds 4 allowed). Open
Open
func (r *runTaskRunner) exportEnvironmentFile(context *RunContext, path string) bool {
workspace := r.scratch.Workspace()
realPath, err := filepath.Abs(filepath.Join(workspace, path))
if err != nil {
Method runTaskCommandBuilderState.addScriptOptions
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *runTaskCommandBuilderState) addScriptOptions(cb *command.Builder) error {
if s.task.Script == "" {
return nil
}
Method Loader.readConfigs
has 5 return statements (exceeds 4 allowed). Open
Open
func (l *Loader) readConfigs(path string) error {
if _, ok := l.loadedConfigs[path]; ok {
return nil
}
Function Validate
has 5 return statements (exceeds 4 allowed). Open
Open
func Validate(name string, data []byte) error {
schema, err := getSchema(name)
if err != nil {
return err
}
Function getGCRPassword
has 5 return statements (exceeds 4 allowed). Open
Open
func getGCRPassword(
env environment.Environment,
registry *config.GCRRegistry,
) (string, error) {
key, err := env.ExpandString(registry.Key)