Showing 93 of 93 total issues

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

func unsubscribe(cmd *kingpin.Cmd) {
    c := cmd.Command("unsubscribe", "Unsubscribe from the Pro plan.")

    c.Action(func(_ *kingpin.ParseContext) error {
        config, err := userconfig.Require()
Severity: Major
Found in internal/cli/team/team.go - About 40 mins to fix

    Method Stack.showNameservers has 6 return statements (exceeds 4 allowed).
    Open

    func (s *Stack) showNameservers(stage *config.Stage) error {
        if stage.Domain == "" {
            return nil
        }
    
    
    Severity: Major
    Found in platform/lambda/stack/stack.go - About 40 mins to fix

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

      func status(cmd *kingpin.Cmd) {
          c := cmd.Command("status", "Status of your account.").Default()
      
          c.Action(func(_ *kingpin.ParseContext) error {
              var config userconfig.Config
      Severity: Major
      Found in internal/cli/team/team.go - About 40 mins to fix

        Method Platform.Build has 6 return statements (exceeds 4 allowed).
        Open

        func (p *Platform) Build() error {
            start := time.Now()
            p.zip = new(bytes.Buffer)
        
            if err := p.injectProxy(); err != nil {
        Severity: Major
        Found in platform/lambda/lambda.go - About 40 mins to fix

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

          func New(c *up.Config, h http.Handler) (http.Handler, error) {
              h = poweredby.New("up", h)
              h = robots.New(c, h)
              h = static.NewDynamic(c, h)
          
          
          Severity: Major
          Found in handler/handler.go - About 40 mins to fix

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

            func New(c *up.Config, next http.Handler) (http.Handler, error) {
                if len(c.Redirects) == 0 {
                    return next, nil
                }
            
            
            Severity: Major
            Found in http/redirects/redirects.go - About 40 mins to fix

              Method Platform.DeleteStack has 6 return statements (exceeds 4 allowed).
              Open

              func (p *Platform) DeleteStack(region string, wait bool) error {
                  versions := resources.Versions{}
              
                  for _, s := range p.config.Stages {
                      versions[s.Name] = "1"
              Severity: Major
              Found in platform/lambda/lambda.go - About 40 mins to fix

                Method Platform.Prune has 6 return statements (exceeds 4 allowed).
                Open

                func (p *Platform) Prune(region, stage string, versions int) error {
                    p.events.Emit("prune", nil)
                
                    if err := p.createRole(); err != nil {
                        return errors.Wrap(err, "creating iam role")
                Severity: Major
                Found in platform/lambda/prune.go - About 40 mins to fix

                  Method Platform.Deploy has 6 return statements (exceeds 4 allowed).
                  Open

                  func (p *Platform) Deploy(d up.Deploy) error {
                      regions := p.config.Regions
                      var g errgroup.Group
                  
                      if err := p.createRole(); err != nil {
                  Severity: Major
                  Found in platform/lambda/lambda.go - About 40 mins to fix

                    Method Stack.Create has 6 return statements (exceeds 4 allowed).
                    Open

                    func (s *Stack) Create(versions resources.Versions) error {
                        c := s.config
                        tmpl := s.template(versions)
                        name := c.Name
                    
                    
                    Severity: Major
                    Found in platform/lambda/stack/stack.go - About 40 mins to fix

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

                      func Build(dir string) (io.ReadCloser, *archive.Stats, error) {
                          upignore, err := read(".upignore")
                          if err != nil {
                              return nil, nil, errors.Wrap(err, "reading .upignore")
                          }
                      Severity: Major
                      Found in internal/zip/zip.go - About 40 mins to fix

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                        func (r *rewrite) Write(b []byte) (int, error) {
                            if r.isNotFound {
                                return len(b), nil
                            }
                        
                        
                        Severity: Minor
                        Found in http/redirects/redirects.go and 1 other location - About 40 mins to fix
                        http/errorpages/errorpages.go on lines 72..83

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 108.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                        func (r *response) Write(b []byte) (int, error) {
                            if r.ignore {
                                return len(b), nil
                            }
                        
                        
                        Severity: Minor
                        Found in http/errorpages/errorpages.go and 1 other location - About 40 mins to fix
                        http/redirects/redirects.go on lines 40..51

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 108.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Method Platform.createFunction has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        func (p *Platform) createFunction(c *lambda.Lambda, a *apigateway.APIGateway, up *s3manager.Uploader, region string, d up.Deploy) (version string, err error) {
                        Severity: Minor
                        Found in platform/lambda/lambda.go - About 35 mins to fix

                          Method Platform.updateFunction has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          func (p *Platform) updateFunction(c *lambda.Lambda, a *apigateway.APIGateway, up *s3manager.Uploader, region string, d up.Deploy) (version string, err error) {
                          Severity: Minor
                          Found in platform/lambda/lambda.go - About 35 mins to fix

                            Similar blocks of code found in 4 locations. Consider refactoring.
                            Open

                            func (c *Client) AddInvite(token, email string) error {
                                in := struct {
                                    Email string `json:"email"`
                                }{
                                    Email: email,
                            Severity: Major
                            Found in internal/account/account.go and 3 other locations - About 35 mins to fix
                            internal/account/account.go on lines 148..162
                            internal/account/account.go on lines 269..283
                            internal/account/account.go on lines 298..312

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 106.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 4 locations. Consider refactoring.
                            Open

                            func (c *Client) AddFeedback(token, message string) error {
                                in := struct {
                                    Message string `json:"message"`
                                }{
                                    Message: message,
                            Severity: Major
                            Found in internal/account/account.go and 3 other locations - About 35 mins to fix
                            internal/account/account.go on lines 148..162
                            internal/account/account.go on lines 252..266
                            internal/account/account.go on lines 269..283

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 106.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 4 locations. Consider refactoring.
                            Open

                            func (c *Client) RemoveMember(token, email string) error {
                                in := struct {
                                    Email string `json:"email"`
                                }{
                                    Email: email,
                            Severity: Major
                            Found in internal/account/account.go and 3 other locations - About 35 mins to fix
                            internal/account/account.go on lines 148..162
                            internal/account/account.go on lines 252..266
                            internal/account/account.go on lines 298..312

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 106.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 4 locations. Consider refactoring.
                            Open

                            func (c *Client) AddCard(token, cardToken string) error {
                                in := struct {
                                    Token string `json:"token"`
                                }{
                                    Token: cardToken,
                            Severity: Major
                            Found in internal/account/account.go and 3 other locations - About 35 mins to fix
                            internal/account/account.go on lines 252..266
                            internal/account/account.go on lines 269..283
                            internal/account/account.go on lines 298..312

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 106.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Method Stack.Apply has 5 return statements (exceeds 4 allowed).
                            Open

                            func (s *Stack) Apply() error {
                                c := s.config
                                name := c.Name
                            
                                res, err := s.client.DescribeChangeSet(&cloudformation.DescribeChangeSetInput{
                            Severity: Major
                            Found in platform/lambda/stack/stack.go - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language