Showing 107 of 107 total issues

Method NonAtomicTufStore.WalkStagedTargets has 6 return statements (exceeds 4 allowed).
Open

func (store *NonAtomicTufStore) WalkStagedTargets(targetPathList []string, targetsFn tuf.TargetsWalkFunc) error {
    store.logger.Debug(fmt.Sprintf("-- NonAtomicTufStore.WalkStagedTargets %v", targetPathList))

    ctx := context.Background()

Severity: Major
Found in server/pkg/publisher/non_atomic_tuf_store.go - About 40 mins to fix

    Function GetBackendReferencePages has 6 return statements (exceeds 4 allowed).
    Open

    func GetBackendReferencePages(ctx context.Context, backend BackendHandle, formatPathLink func(markdownPagePath string) string) ([]*BackendReferencePage, error) {
        req := &logical.Request{
            Operation:  logical.HelpOperation,
            Storage:    backend.Storage,
            Connection: &logical.Connection{},
    Severity: Major
    Found in server/pkg/gendocs/gendocs.go - About 40 mins to fix

      Function VerifyCommitSignatures has 6 return statements (exceeds 4 allowed).
      Open

      func VerifyCommitSignatures(repo *git.Repository, commit string, trustedPGPPublicKeys []string, requiredNumberOfVerifiedSignatures int, logger hclog.Logger) error {
          co, err := repo.CommitObject(plumbing.NewHash(commit))
          if err != nil {
              return fmt.Errorf("unable to get commit %q: %w", commit, err)
          }
      Severity: Major
      Found in server/pkg/git/signatures.go - About 40 mins to fix

        Function switchTaskToCompletedInStorage has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func switchTaskToCompletedInStorage(ctx context.Context, storage logical.Storage, status taskStatus, uuid string, opts switchTaskToCompletedInStorageOptions) error {
        Severity: Minor
        Found in server/pkg/tasks_manager/task.go - About 35 mins to fix

          Function VerifyTagSignatures has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func VerifyTagSignatures(repo *git.Repository, tagName string, trustedPGPPublicKeys []string, requiredNumberOfVerifiedSignatures int, logger hclog.Logger) error {
          Severity: Minor
          Found in server/pkg/git/signatures.go - About 35 mins to fix

            Function verifyObjectSignatures has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func verifyObjectSignatures(repo *git.Repository, objectID string, trustedPGPPublicKeys []string, requiredNumberOfVerifiedSignatures int, logger hclog.Logger) error {
            Severity: Minor
            Found in server/pkg/git/signatures.go - About 35 mins to fix

              Function ValidatePublishConfig has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func ValidatePublishConfig(ctx context.Context, publisher publisher.Interface, publisherRepository publisher.RepositoryInterface, config *config.TrdlChannels, logger hclog.Logger) error {
              Severity: Minor
              Found in server/path_publish.go - About 35 mins to fix

                Function VerifyCommitSignatures has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                func VerifyCommitSignatures(repo *git.Repository, commit string, trustedPGPPublicKeys []string, requiredNumberOfVerifiedSignatures int, logger hclog.Logger) error {
                Severity: Minor
                Found in server/pkg/git/signatures.go - About 35 mins to fix

                  Function VerifyPGPSignatures has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  func VerifyPGPSignatures(pgpSignatures []string, signedReaderFunc func() (io.Reader, error), pgpKeys []string, requiredNumberOfVerifiedSignatures int, logger hclog.Logger) ([]string, int, error) {
                  Severity: Minor
                  Found in server/pkg/pgp/util.go - About 35 mins to fix

                    Method Manager.PeriodicFunc has 5 return statements (exceeds 4 allowed).
                    Open

                    func (m *Manager) PeriodicFunc(ctx context.Context, req *logical.Request) error {
                        // lock manager
                        m.mu.Lock()
                        defer m.mu.Unlock()
                    
                    
                    Severity: Major
                    Found in server/pkg/tasks_manager/periodic.go - About 35 mins to fix

                      Method Client.saveMeta has 5 return statements (exceeds 4 allowed).
                      Open

                      func (c *Client) saveMeta() error {
                          localDB, err := leveldbstore.FileLocalStore(c.metaLocalStoreDir)
                          if err != nil {
                              return fmt.Errorf("unable to init file local store: %w", err)
                          }
                      Severity: Major
                      Found in client/pkg/tuf/client.go - About 35 mins to fix

                        Function processExecArgs has 5 return statements (exceeds 4 allowed).
                        Open

                        func processExecArgs(cmd *cobra.Command, args []string) (*execCmdData, error) {
                            data := &execCmdData{}
                        
                            data.repoName = args[0]
                            data.group = args[1]
                        Severity: Major
                        Found in client/cmd/trdl/exec.go - About 35 mins to fix

                          Method configuration.load has 5 return statements (exceeds 4 allowed).
                          Open

                          func (c *configuration) load() error {
                              if exist, err := util.IsRegularFileExist(c.configPath); err != nil {
                                  return fmt.Errorf("unable to check existence of file %q: %w", c.configPath, err)
                              } else if !exist {
                                  return nil
                          Severity: Major
                          Found in client/pkg/client/configuration.go - About 35 mins to fix

                            Function StartUpdateInBackground has 5 return statements (exceeds 4 allowed).
                            Open

                            func StartUpdateInBackground(name string, args []string, backgroundStdoutFile, backgroundStderrFile string) error {
                                cmd := exec.Command(name, args...)
                            
                                if backgroundStdoutFile != "" {
                                    f, err := os.Create(backgroundStdoutFile)
                            Severity: Major
                            Found in client/cmd/trdl/update.go - About 35 mins to fix

                              Method Client.UpdateRepoChannel has 5 return statements (exceeds 4 allowed).
                              Open

                              func (c Client) UpdateRepoChannel(repoName, group, optionalChannel string, autocleanReleases bool) error {
                                  channel, err := c.processRepoOptionalChannel(repoName, optionalChannel)
                                  if err != nil {
                                      return err
                                  }
                              Severity: Major
                              Found in client/pkg/client/client.go - About 35 mins to fix

                                Method Client.findChannelReleaseDir has 5 return statements (exceeds 4 allowed).
                                Open

                                func (c Client) findChannelReleaseDir(group, channel string) (dir, release string, err error) {
                                    release, err = c.GetChannelRelease(group, channel)
                                    if err != nil {
                                        return "", "", err
                                    }
                                Severity: Major
                                Found in client/pkg/repo/client.go - About 35 mins to fix

                                  Function LoadKeys has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func LoadKeys(r io.Reader, passphrase []byte) ([]*data.PrivateKey, error) {
                                      pk := &PersistedKeys{}
                                  
                                      if err := json.NewDecoder(r).Decode(pk); err != nil {
                                          return nil, fmt.Errorf("error unmarshalling keys json data: %w", err)
                                  Severity: Major
                                  Found in server/pkg/keyhelper/load_keys.go - About 35 mins to fix

                                    Method Client.GetChannelRelease has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (c Client) GetChannelRelease(group, channel string) (string, error) {
                                        channelFilePath := c.channelPath(group, channel)
                                        exist, err := util.IsRegularFileExist(channelFilePath)
                                        if err != nil {
                                            return "", fmt.Errorf("unable to check existence of file %q: %w", channelFilePath, err)
                                    Severity: Major
                                    Found in client/pkg/repo/client.go - About 35 mins to fix

                                      Function VerifyPGPSignatures has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func VerifyPGPSignatures(pgpSignatures []string, signedReaderFunc func() (io.Reader, error), pgpKeys []string, requiredNumberOfVerifiedSignatures int, logger hclog.Logger) ([]string, int, error) {
                                          if requiredNumberOfVerifiedSignatures == 0 {
                                              return pgpKeys, 0, nil
                                          }
                                      
                                      
                                      Severity: Major
                                      Found in server/pkg/pgp/util.go - About 35 mins to fix

                                        Method Metafile.reset has 5 return statements (exceeds 4 allowed).
                                        Open

                                        func (f Metafile) reset() error {
                                            if err := f.delete(); err != nil {
                                                return err
                                            }
                                        
                                        
                                        Severity: Major
                                        Found in client/pkg/util/metafile.go - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language