Bnei-Baruch/mdb

View on GitHub

Showing 704 of 1,135 total issues

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

func handleFileStorages(cp utils.ContextProvider, exec boil.Executor, id int64) ([]*Storage, *HttpError) {
    file, err := models.FindFile(exec, id)
    if err != nil {
        if err == sql.ErrNoRows {
            return nil, NewNotFoundError()
Severity: Major
Found in api/rest.go - About 35 mins to fix

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

    func handleStoragesList(exec boil.Executor, r StoragesRequest) (*StoragesResponse, *HttpError) {
        mods := make([]qm.QueryMod, 0)
    
        // count query
        var total int64
    Severity: Major
    Found in api/rest.go - About 35 mins to fix

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

      func CreateContentUnit(exec boil.Executor, contentType string, properties map[string]interface{}) (*models.ContentUnit, error) {
          ct, ok := common.CONTENT_TYPE_REGISTRY.ByName[contentType]
          if !ok {
              return nil, errors.Errorf("Unknown content type %s", contentType)
          }
      Severity: Major
      Found in api/repo.go - About 35 mins to fix

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

        func PublishersHandler(c *gin.Context) {
            var err *HttpError
            var resp interface{}
        
            switch c.Request.Method {
        Severity: Major
        Found in api/rest.go - About 35 mins to fix

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

          func handleCreateCollection(cp utils.ContextProvider, exec boil.Executor, c Collection) (*Collection, *HttpError) {
              // check object level permissions
              if !can(cp, secureToPermission(c.Secure), common.PERM_WRITE) {
                  return nil, NewForbiddenError()
              }
          Severity: Major
          Found in api/rest.go - About 35 mins to fix

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

            func appendSourcesFilterMods(exec boil.Executor, mods *[]qm.QueryMod, f SourcesFilter) error {
                if utils.IsEmpty(f.Authors) && len(f.Sources) == 0 {
                    return nil
                }
            
            
            Severity: Major
            Found in api/rest.go - About 35 mins to fix

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

              func FileAddedUnitImpact(exec boil.Executor, fileIsPublished bool, cuID int64) (*PublishedChangeImpact, error) {
                  impact := new(PublishedChangeImpact)
              
                  if !fileIsPublished {
                      return impact, nil
              Severity: Major
              Found in api/repo.go - About 35 mins to fix

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

                func PersonHandler(c *gin.Context) {
                    id, e := strconv.ParseInt(c.Param("id"), 10, 0)
                    if e != nil {
                        NewBadRequestError(errors.Wrap(e, "id expects int64")).Abort(c)
                        return
                Severity: Major
                Found in api/rest.go - About 35 mins to fix

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

                  func handleGetTags(exec boil.Executor, r TagsRequest) (*TagsResponse, *HttpError) {
                      mods := make([]qm.QueryMod, 0)
                  
                      // count query
                      var total int64
                  Severity: Major
                  Found in api/rest.go - About 35 mins to fix

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

                    func UpdateContentUnitProperties(exec boil.Executor, unit *models.ContentUnit, props map[string]interface{}) error {
                        if len(props) == 0 {
                            return nil
                        }
                    
                    
                    Severity: Major
                    Found in api/repo.go - About 35 mins to fix

                      Method contentTypeL.LoadContainers has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func (contentTypeL) LoadContainers(e boil.Executor, singular bool, maybeContentType interface{}) error {
                          var slice []*ContentType
                          var object *ContentType
                      
                          count := 1
                      Severity: Minor
                      Found in importer/kmedia/kmodels/content_types.go - About 25 mins 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

                      Method languageL.LoadLangContainerDescriptions has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func (languageL) LoadLangContainerDescriptions(e boil.Executor, singular bool, maybeLanguage interface{}) error {
                          var slice []*Language
                          var object *Language
                      
                          count := 1
                      Severity: Minor
                      Found in importer/kmedia/kmodels/languages.go - About 25 mins 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

                      Method catalogL.LoadCatalogDescriptions has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func (catalogL) LoadCatalogDescriptions(e boil.Executor, singular bool, maybeCatalog interface{}) error {
                          var slice []*Catalog
                          var object *Catalog
                      
                          count := 1
                      Severity: Minor
                      Found in importer/kmedia/kmodels/catalogs.go - About 25 mins 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

                      Method catalogL.LoadParentCatalogs has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func (catalogL) LoadParentCatalogs(e boil.Executor, singular bool, maybeCatalog interface{}) error {
                          var slice []*Catalog
                          var object *Catalog
                      
                          count := 1
                      Severity: Minor
                      Found in importer/kmedia/kmodels/catalogs.go - About 25 mins 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

                      Method languageL.LoadLangContainers has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func (languageL) LoadLangContainers(e boil.Executor, singular bool, maybeLanguage interface{}) error {
                          var slice []*Language
                          var object *Language
                      
                          count := 1
                      Severity: Minor
                      Found in importer/kmedia/kmodels/languages.go - About 25 mins 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

                      Method languageL.LoadLangFileAssets has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func (languageL) LoadLangFileAssets(e boil.Executor, singular bool, maybeLanguage interface{}) error {
                          var slice []*Language
                          var object *Language
                      
                          count := 1
                      Severity: Minor
                      Found in importer/kmedia/kmodels/languages.go - About 25 mins 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

                      Method containerL.LoadContainerDescriptions has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func (containerL) LoadContainerDescriptions(e boil.Executor, singular bool, maybeContainer interface{}) error {
                          var slice []*Container
                          var object *Container
                      
                          count := 1
                      Severity: Minor
                      Found in importer/kmedia/kmodels/containers.go - About 25 mins 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

                      Method languageL.LoadLangCatalogDescriptions has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func (languageL) LoadLangCatalogDescriptions(e boil.Executor, singular bool, maybeLanguage interface{}) error {
                          var slice []*Language
                          var object *Language
                      
                          count := 1
                      Severity: Minor
                      Found in importer/kmedia/kmodels/languages.go - About 25 mins 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

                      Method userL.LoadCatalogs has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func (userL) LoadCatalogs(e boil.Executor, singular bool, maybeUser interface{}) error {
                          var slice []*User
                          var object *User
                      
                          count := 1
                      Severity: Minor
                      Found in importer/kmedia/kmodels/users.go - About 25 mins 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

                      Method userL.LoadRolesUsers has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func (userL) LoadRolesUsers(e boil.Executor, singular bool, maybeUser interface{}) error {
                          var slice []*User
                          var object *User
                      
                          count := 1
                      Severity: Minor
                      Found in importer/kmedia/kmodels/users.go - About 25 mins 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

                      Severity
                      Category
                      Status
                      Source
                      Language