Bnei-Baruch/mdb

View on GitHub

Showing 704 of 1,135 total issues

RolesUser has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

type RolesUser struct {
    RoleID int `boil:"role_id" json:"role_id" toml:"role_id" yaml:"role_id"`
    UserID int `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`

    R *rolesUserR `boil:"-" json:"-" toml:"-" yaml:"-"`
Severity: Minor
Found in importer/kmedia/kmodels/roles_users.go - About 3 hrs to fix

    FileAssetDescription has 26 methods (exceeds 20 allowed). Consider refactoring.
    Open

    type FileAssetDescription struct {
        ID        int         `boil:"id" json:"id" toml:"id" yaml:"id"`
        FileID    int         `boil:"file_id" json:"file_id" toml:"file_id" yaml:"file_id"`
        Filedesc  null.String `boil:"filedesc" json:"filedesc,omitempty" toml:"filedesc" yaml:"filedesc,omitempty"`
        Lang      null.String `boil:"lang" json:"lang,omitempty" toml:"lang" yaml:"lang,omitempty"`
    Severity: Minor
    Found in importer/kmedia/kmodels/file_asset_descriptions.go - About 3 hrs to fix

      Function handleSend has 100 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func handleSend(exec boil.Executor, input interface{}) (*models.Operation, []events.Event, error) {
          r := input.(SendRequest)
      
          // Original
          original, _, err := FindFileBySHA1(exec, r.Original.Sha1)
      Severity: Major
      Found in api/handlers.go - About 3 hrs to fix

        Method HandlersSuite.TestHandleTranscodeSuccess has 100 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (suite *HandlersSuite) TestHandleTranscodeSuccess() {
            // Create dummy original file
            ofi := File{
                FileName:  "dummy_original_file.wmv",
                CreatedAt: &Timestamp{time.Now()},
        Severity: Major
        Found in api/handlers_test.go - About 3 hrs to fix

          Method Lecturer.Upsert has 99 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (o *Lecturer) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
              if o == nil {
                  return errors.New("kmodels: no lecturers provided for upsert")
              }
              currTime := time.Now().In(boil.GetLocation())
          Severity: Major
          Found in importer/kmedia/kmodels/lecturers.go - About 2 hrs to fix

            Method Container.Upsert has 99 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (o *Container) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                if o == nil {
                    return errors.New("kmodels: no containers provided for upsert")
                }
                currTime := time.Now().In(boil.GetLocation())
            Severity: Major
            Found in importer/kmedia/kmodels/containers.go - About 2 hrs to fix

              Method LecturerDescription.Upsert has 99 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (o *LecturerDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                  if o == nil {
                      return errors.New("kmodels: no lecturer_descriptions provided for upsert")
                  }
                  currTime := time.Now().In(boil.GetLocation())
              Severity: Major
              Found in importer/kmedia/kmodels/lecturer_descriptions.go - About 2 hrs to fix

                Method Role.Upsert has 99 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func (o *Role) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                    if o == nil {
                        return errors.New("kmodels: no roles provided for upsert")
                    }
                    currTime := time.Now().In(boil.GetLocation())
                Severity: Major
                Found in importer/kmedia/kmodels/roles.go - About 2 hrs to fix

                  Method CatalogDescription.Upsert has 99 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (o *CatalogDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                      if o == nil {
                          return errors.New("kmodels: no catalog_descriptions provided for upsert")
                      }
                      currTime := time.Now().In(boil.GetLocation())
                  Severity: Major
                  Found in importer/kmedia/kmodels/catalog_descriptions.go - About 2 hrs to fix

                    Method ContainerDescription.Upsert has 99 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func (o *ContainerDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                        if o == nil {
                            return errors.New("kmodels: no container_descriptions provided for upsert")
                        }
                        currTime := time.Now().In(boil.GetLocation())
                    Severity: Major
                    Found in importer/kmedia/kmodels/container_descriptions.go - About 2 hrs to fix

                      Method ContainerDescriptionPattern.Upsert has 99 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func (o *ContainerDescriptionPattern) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                          if o == nil {
                              return errors.New("kmodels: no container_description_patterns provided for upsert")
                          }
                          currTime := time.Now().In(boil.GetLocation())
                      Severity: Major
                      Found in importer/kmedia/kmodels/container_description_patterns.go - About 2 hrs to fix

                        Method FileAssetDescription.Upsert has 99 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func (o *FileAssetDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                            if o == nil {
                                return errors.New("kmodels: no file_asset_descriptions provided for upsert")
                            }
                            currTime := time.Now().In(boil.GetLocation())
                        Severity: Major
                        Found in importer/kmedia/kmodels/file_asset_descriptions.go - About 2 hrs to fix

                          Method Catalog.Upsert has 99 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func (o *Catalog) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                              if o == nil {
                                  return errors.New("kmodels: no catalogs provided for upsert")
                              }
                              currTime := time.Now().In(boil.GetLocation())
                          Severity: Major
                          Found in importer/kmedia/kmodels/catalogs.go - About 2 hrs to fix

                            Method FileAsset.Upsert has 99 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func (o *FileAsset) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                                if o == nil {
                                    return errors.New("kmodels: no file_assets provided for upsert")
                                }
                                currTime := time.Now().In(boil.GetLocation())
                            Severity: Major
                            Found in importer/kmedia/kmodels/file_assets.go - About 2 hrs to fix

                              Method User.Upsert has 99 lines of code (exceeds 50 allowed). Consider refactoring.
                              Open

                              func (o *User) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                                  if o == nil {
                                      return errors.New("kmodels: no users provided for upsert")
                                  }
                                  currTime := time.Now().In(boil.GetLocation())
                              Severity: Major
                              Found in importer/kmedia/kmodels/users.go - About 2 hrs to fix

                                Function populateDBQueue has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring.
                                Open

                                func populateDBQueue(files []*models.File) error {
                                    cuMap := make(map[int64]map[string][]*models.File)
                                    noCU := make([]*models.File, 0)
                                    withChilds := make(map[int64]bool)
                                    var ok bool
                                Severity: Minor
                                Found in batch/convert.go - About 2 hrs 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 missingContainers has 97 lines of code (exceeds 50 allowed). Consider refactoring.
                                Open

                                func missingContainers() (map[string][]*kmodels.Container, error) {
                                    cuMap := make(map[int]bool)
                                
                                    log.Info("Loading all content units with kmedia_id")
                                    units, err := models.ContentUnits(
                                Severity: Major
                                Found in importer/kmedia/compare.go - About 2 hrs to fix

                                  Method Label.Upsert has 97 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  func (o *Label) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                                      if o == nil {
                                          return errors.New("kmodels: no labels provided for upsert")
                                      }
                                      currTime := time.Now().In(boil.GetLocation())
                                  Severity: Major
                                  Found in importer/kmedia/kmodels/labels.go - About 2 hrs to fix

                                    Method LabelDescription.Upsert has 97 lines of code (exceeds 50 allowed). Consider refactoring.
                                    Open

                                    func (o *LabelDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                                        if o == nil {
                                            return errors.New("kmodels: no label_descriptions provided for upsert")
                                        }
                                        currTime := time.Now().In(boil.GetLocation())
                                    Severity: Major
                                    Found in importer/kmedia/kmodels/label_descriptions.go - About 2 hrs to fix

                                      Method DictionaryDescription.Upsert has 97 lines of code (exceeds 50 allowed). Consider refactoring.
                                      Open

                                      func (o *DictionaryDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
                                          if o == nil {
                                              return errors.New("kmodels: no dictionary_descriptions provided for upsert")
                                          }
                                          currTime := time.Now().In(boil.GetLocation())
                                      Severity: Major
                                      Found in importer/kmedia/kmodels/dictionary_descriptions.go - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language