Bnei-Baruch/mdb

View on GitHub

Showing 704 of 1,135 total issues

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

func (containerL) LoadVirtualLesson(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 35 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 Role.Insert has 5 return statements (exceeds 4 allowed).
Open

func (o *Role) Insert(exec boil.Executor, whitelist ...string) error {
    if o == nil {
        return errors.New("kmodels: no roles provided for insertion")
    }

Severity: Major
Found in importer/kmedia/kmodels/roles.go - About 35 mins to fix

    Method containerL.LoadVirtualLesson has 5 return statements (exceeds 4 allowed).
    Open

    func (containerL) LoadVirtualLesson(e boil.Executor, singular bool, maybeContainer interface{}) error {
        var slice []*Container
        var object *Container
    
        count := 1
    Severity: Major
    Found in importer/kmedia/kmodels/containers.go - About 35 mins to fix

      Method Label.Insert has 5 return statements (exceeds 4 allowed).
      Open

      func (o *Label) Insert(exec boil.Executor, whitelist ...string) error {
          if o == nil {
              return errors.New("kmodels: no labels provided for insertion")
          }
      
      
      Severity: Major
      Found in importer/kmedia/kmodels/labels.go - About 35 mins to fix

        Method catalogL.LoadContainerDescriptionPatterns has 5 return statements (exceeds 4 allowed).
        Open

        func (catalogL) LoadContainerDescriptionPatterns(e boil.Executor, singular bool, maybeCatalog interface{}) error {
            var slice []*Catalog
            var object *Catalog
        
            count := 1
        Severity: Major
        Found in importer/kmedia/kmodels/catalogs.go - About 35 mins to fix

          Method fileAssetL.LoadContainers has 5 return statements (exceeds 4 allowed).
          Open

          func (fileAssetL) LoadContainers(e boil.Executor, singular bool, maybeFileAsset interface{}) error {
              var slice []*FileAsset
              var object *FileAsset
          
              count := 1
          Severity: Major
          Found in importer/kmedia/kmodels/file_assets.go - About 35 mins to fix

            Method FileAssetDescription.Insert has 5 return statements (exceeds 4 allowed).
            Open

            func (o *FileAssetDescription) Insert(exec boil.Executor, whitelist ...string) error {
                if o == nil {
                    return errors.New("kmodels: no file_asset_descriptions provided for insertion")
                }
            
            
            Severity: Major
            Found in importer/kmedia/kmodels/file_asset_descriptions.go - About 35 mins to fix

              Method CkeditorAsset.Insert has 5 return statements (exceeds 4 allowed).
              Open

              func (o *CkeditorAsset) Insert(exec boil.Executor, whitelist ...string) error {
                  if o == nil {
                      return errors.New("kmodels: no ckeditor_assets provided for insertion")
                  }
              
              
              Severity: Major
              Found in importer/kmedia/kmodels/ckeditor_assets.go - About 35 mins to fix

                Method rolesUserL.LoadUser has 5 return statements (exceeds 4 allowed).
                Open

                func (rolesUserL) LoadUser(e boil.Executor, singular bool, maybeRolesUser interface{}) error {
                    var slice []*RolesUser
                    var object *RolesUser
                
                    count := 1
                Severity: Major
                Found in importer/kmedia/kmodels/roles_users.go - About 35 mins to fix

                  Method Comment.Insert has 5 return statements (exceeds 4 allowed).
                  Open

                  func (o *Comment) Insert(exec boil.Executor, whitelist ...string) error {
                      if o == nil {
                          return errors.New("kmodels: no comments provided for insertion")
                      }
                  
                  
                  Severity: Major
                  Found in importer/kmedia/kmodels/comments.go - About 35 mins to fix

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

                    func importFlatContainer(exec boil.Executor, container *kmodels.Container, cuType string) error {
                        stats.ContainersProcessed.Inc(1)
                    
                        unit, err := models.ContentUnits(qm4.Where("(properties->>'kmedia_id')::int = ?", container.ID)).One(mdb)
                        if err != nil {
                    Severity: Major
                    Found in importer/kmedia/yh_meals.go - About 35 mins to fix

                      Method VirtualLesson.Insert has 5 return statements (exceeds 4 allowed).
                      Open

                      func (o *VirtualLesson) Insert(exec boil.Executor, whitelist ...string) error {
                          if o == nil {
                              return errors.New("kmodels: no virtual_lessons provided for insertion")
                          }
                      
                      
                      Severity: Major
                      Found in importer/kmedia/kmodels/virtual_lessons.go - About 35 mins to fix

                        Method Department.Insert has 5 return statements (exceeds 4 allowed).
                        Open

                        func (o *Department) Insert(exec boil.Executor, whitelist ...string) error {
                            if o == nil {
                                return errors.New("kmodels: no departments provided for insertion")
                            }
                        
                        
                        Severity: Major
                        Found in importer/kmedia/kmodels/departments.go - About 35 mins to fix

                          Method fileAssetDescriptionL.LoadFile has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
                          Open

                          func (fileAssetDescriptionL) LoadFile(e boil.Executor, singular bool, maybeFileAssetDescription interface{}) error {
                              var slice []*FileAssetDescription
                              var object *FileAssetDescription
                          
                              count := 1
                          Severity: Minor
                          Found in importer/kmedia/kmodels/file_asset_descriptions.go - About 35 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 Catalog.Insert has 5 return statements (exceeds 4 allowed).
                          Open

                          func (o *Catalog) Insert(exec boil.Executor, whitelist ...string) error {
                              if o == nil {
                                  return errors.New("kmodels: no catalogs provided for insertion")
                              }
                          
                          
                          Severity: Major
                          Found in importer/kmedia/kmodels/catalogs.go - About 35 mins to fix

                            Method fileAssetL.LoadServername has 5 return statements (exceeds 4 allowed).
                            Open

                            func (fileAssetL) LoadServername(e boil.Executor, singular bool, maybeFileAsset interface{}) error {
                                var slice []*FileAsset
                                var object *FileAsset
                            
                                count := 1
                            Severity: Major
                            Found in importer/kmedia/kmodels/file_assets.go - About 35 mins to fix

                              Method catalogL.LoadContainers has 5 return statements (exceeds 4 allowed).
                              Open

                              func (catalogL) LoadContainers(e boil.Executor, singular bool, maybeCatalog interface{}) error {
                                  var slice []*Catalog
                                  var object *Catalog
                              
                                  count := 1
                              Severity: Major
                              Found in importer/kmedia/kmodels/catalogs.go - About 35 mins to fix

                                Method catalogL.LoadUser has 5 return statements (exceeds 4 allowed).
                                Open

                                func (catalogL) LoadUser(e boil.Executor, singular bool, maybeCatalog interface{}) error {
                                    var slice []*Catalog
                                    var object *Catalog
                                
                                    count := 1
                                Severity: Major
                                Found in importer/kmedia/kmodels/catalogs.go - About 35 mins to fix

                                  Method RolesUser.Insert has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func (o *RolesUser) Insert(exec boil.Executor, whitelist ...string) error {
                                      if o == nil {
                                          return errors.New("kmodels: no roles_users provided for insertion")
                                      }
                                  
                                  
                                  Severity: Major
                                  Found in importer/kmedia/kmodels/roles_users.go - About 35 mins to fix

                                    Method Server.Insert has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (o *Server) Insert(exec boil.Executor, whitelist ...string) error {
                                        if o == nil {
                                            return errors.New("kmodels: no servers provided for insertion")
                                        }
                                    
                                    
                                    Severity: Major
                                    Found in importer/kmedia/kmodels/servers.go - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language