IIC2173-2015-2-Grupo2/news-api

View on GitHub

Showing 4 of 33 total issues

Function GetNewsItems has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

func GetNewsItems(db *neoism.Database, tags []string, providers []string, categories []string, people []string, locations []string, companies []string, page int) (*[]NewsItem, error) {
Severity: Major
Found in models/new.go - About 1 hr to fix

    Function GetNewsItems has 8 return statements (exceeds 4 allowed).
    Open

    func GetNewsItems(db *neoism.Database, tags []string, providers []string, categories []string, people []string, locations []string, companies []string, page int) (*[]NewsItem, error) {
        var news []NewsItem
    
        matchClause := []string{"MATCH (new:NewsItem)<-[r]-(p:NewsProvider)"}
    
    
    Severity: Major
    Found in models/new.go - About 50 mins to fix

      Avoid deeply nested control flow statements.
      Open

              if _, err := user.Save(n.DB); err != nil {
                  c.JSON(http.StatusInternalServerError, gin.H{"error": err})
      
              } else {
                  n.Log("Session", "Create")
      Severity: Major
      Found in controllers/session.go - About 45 mins to fix

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

        func getOrCreateNode(db *neoism.Database, label string, key string, value string, props neoism.Props) *neoism.Node {
        Severity: Minor
        Found in tasks/seed.go - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language