devrelcollective/xela

View on GitHub

Showing 20 of 62 total issues

Function init has 83 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func init() {
    r = render.New(render.Options{
        // HTML layout to be used for all HTML requests:
        HTMLLayout: "application.html",

Severity: Major
Found in actions/render.go - About 2 hrs to fix

    Function init has 18 return statements (exceeds 4 allowed).
    Open

    func init() {
        r = render.New(render.Options{
            // HTML layout to be used for all HTML requests:
            HTMLLayout: "application.html",
    
    
    Severity: Major
    Found in actions/render.go - About 1 hr to fix

      Function init has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
      Open

      func init() {
          r = render.New(render.Options{
              // HTML layout to be used for all HTML requests:
              HTMLLayout: "application.html",
      
      
      Severity: Minor
      Found in actions/render.go - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function moduleOptions has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        moduleOptions: function() {
          return {
            rules: [
              {
                test: /\.css$/,
      Severity: Minor
      Found in webpack.config.js - About 1 hr to fix

        Function buildConfig has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          buildConfig: function(){
            const env = process.env.NODE_ENV || "development";
        
            var config = {
              mode: env,
        Severity: Minor
        Found in webpack.config.js - About 1 hr to fix

          Function AuthCallback has 7 return statements (exceeds 4 allowed).
          Open

          func AuthCallback(c buffalo.Context) error {
              gu, err := gothic.CompleteUserAuth(c.Response(), c.Request())
              if err != nil {
                  return c.Error(401, err)
              }
          Severity: Major
          Found in actions/auth.go - About 45 mins to fix

            Method DutoniansResource.Update has 6 return statements (exceeds 4 allowed).
            Open

            func (v DutoniansResource) Update(c buffalo.Context) error {
                // Get the DB connection from the context
                tx, ok := c.Value("tx").(*pop.Connection)
                if !ok {
                    return errors.WithStack(errors.New("no transaction found"))
            Severity: Major
            Found in actions/dutonians.go - About 40 mins to fix

              Method ProposalsResource.Update has 6 return statements (exceeds 4 allowed).
              Open

              func (v ProposalsResource) Update(c buffalo.Context) error {
                  // Get the DB connection from the context
                  tx, ok := c.Value("tx").(*pop.Connection)
                  if !ok {
                      return errors.WithStack(errors.New("no transaction found"))
              Severity: Major
              Found in actions/proposals.go - About 40 mins to fix

                Method ProposalsResource.Edit has 6 return statements (exceeds 4 allowed).
                Open

                func (v ProposalsResource) Edit(c buffalo.Context) error {
                    // Get the DB connection from the context
                    //     tx, ok := c.Value("tx").(*pop.Connection)
                    //     if !ok {
                    //         return errors.WithStack(errors.New("no transaction found"))
                Severity: Major
                Found in actions/proposals.go - About 40 mins to fix

                  Method SponsorshipsResource.Update has 6 return statements (exceeds 4 allowed).
                  Open

                  func (v SponsorshipsResource) Update(c buffalo.Context) error {
                      // Get the DB connection from the context
                      tx, ok := c.Value("tx").(*pop.Connection)
                      if !ok {
                          return errors.WithStack(errors.New("no transaction found"))
                  Severity: Major
                  Found in actions/sponsorships.go - About 40 mins to fix

                    Method LinksResource.Update has 6 return statements (exceeds 4 allowed).
                    Open

                    func (v LinksResource) Update(c buffalo.Context) error {
                        // Get the DB connection from the context
                        tx, ok := c.Value("tx").(*pop.Connection)
                        if !ok {
                            return errors.WithStack(errors.New("no transaction found"))
                    Severity: Major
                    Found in actions/links.go - About 40 mins to fix

                      Method EventsResource.Update has 6 return statements (exceeds 4 allowed).
                      Open

                      func (v EventsResource) Update(c buffalo.Context) error {
                          // Get the DB connection from the context
                          tx, ok := c.Value("tx").(*pop.Connection)
                          if !ok {
                              return errors.WithStack(errors.New("no transaction found"))
                      Severity: Major
                      Found in actions/events.go - About 40 mins to fix

                        Method AbstractsResource.Update has 6 return statements (exceeds 4 allowed).
                        Open

                        func (v AbstractsResource) Update(c buffalo.Context) error {
                            // Get the DB connection from the context
                            tx, ok := c.Value("tx").(*pop.Connection)
                            if !ok {
                                return errors.WithStack(errors.New("no transaction found"))
                        Severity: Major
                        Found in actions/abstracts.go - About 40 mins to fix

                          Method LinksResource.Create has 5 return statements (exceeds 4 allowed).
                          Open

                          func (v LinksResource) Create(c buffalo.Context) error {
                              // Get the DB connection from the context
                              tx, ok := c.Value("tx").(*pop.Connection)
                              if !ok {
                                  return errors.WithStack(errors.New("no transaction found"))
                          Severity: Major
                          Found in actions/links.go - About 35 mins to fix

                            Method ProposalsResource.New has 5 return statements (exceeds 4 allowed).
                            Open

                            func (v ProposalsResource) New(c buffalo.Context) error {
                                //     return c.Render(200, r.Auto(c, &models.Proposal{}))
                                // }
                            
                                // func NewProposal(c buffalo.Context) error {
                            Severity: Major
                            Found in actions/proposals.go - About 35 mins to fix

                              Method EventsResource.Create has 5 return statements (exceeds 4 allowed).
                              Open

                              func (v EventsResource) Create(c buffalo.Context) error {
                                  // Get the DB connection from the context
                                  tx, ok := c.Value("tx").(*pop.Connection)
                                  if !ok {
                                      return errors.WithStack(errors.New("no transaction found"))
                              Severity: Major
                              Found in actions/events.go - About 35 mins to fix

                                Method AbstractsResource.Create has 5 return statements (exceeds 4 allowed).
                                Open

                                func (v AbstractsResource) Create(c buffalo.Context) error {
                                    // Get the DB connection from the context
                                    tx, ok := c.Value("tx").(*pop.Connection)
                                    if !ok {
                                        return errors.WithStack(errors.New("no transaction found"))
                                Severity: Major
                                Found in actions/abstracts.go - About 35 mins to fix

                                  Method DutoniansResource.Create has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func (v DutoniansResource) Create(c buffalo.Context) error {
                                  
                                      // Get the DB connection from the context
                                      tx, ok := c.Value("tx").(*pop.Connection)
                                      if !ok {
                                  Severity: Major
                                  Found in actions/dutonians.go - About 35 mins to fix

                                    Method ProposalsResource.Create has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (v ProposalsResource) Create(c buffalo.Context) error {
                                    
                                        // Get the DB connection from the context
                                        tx, ok := c.Value("tx").(*pop.Connection)
                                        if !ok {
                                    Severity: Major
                                    Found in actions/proposals.go - About 35 mins to fix

                                      Method SponsorshipsResource.Create has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func (v SponsorshipsResource) Create(c buffalo.Context) error {
                                      
                                          // Get the DB connection from the context
                                          tx, ok := c.Value("tx").(*pop.Connection)
                                          if !ok {
                                      Severity: Major
                                      Found in actions/sponsorships.go - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language