Bnei-Baruch/mdb

View on GitHub

Showing 704 of 1,135 total issues

File rest.go has 4166 lines of code (exceeds 500 allowed). Consider refactoring.
Open

package api

import (
    "database/sql"
    "encoding/hex"
Severity: Major
Found in api/rest.go - About 1 wk to fix

    File metadata_processor_test.go has 2557 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    package api
    
    import (
        "database/sql"
        "encoding/hex"
    Severity: Major
    Found in api/metadata_processor_test.go - About 6 days to fix

      Function doProcess has a Cognitive Complexity of 263 (exceeds 20 allowed). Consider refactoring.
      Open

      func doProcess(exec boil.Executor, metadata CITMetadata, original, proxy, source *models.File, cu *models.ContentUnit) ([]events.Event, error) {
          isUpdate := cu != nil
          log.Infof("Processing CITMetadata, isUpdate: %t", isUpdate)
      
          // Update properties for original and proxy (film_date, capture_date)
      Severity: Minor
      Found in api/metadata_processor.go - About 5 days 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

      File containers.go has 2029 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      // Code generated by SQLBoiler (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
      // This file is meant to be re-generated in place and/or deleted at any time.
      
      package kmodels
      
      
      Severity: Major
      Found in importer/kmedia/kmodels/containers.go - About 4 days to fix

        File catalogs.go has 1823 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        // Code generated by SQLBoiler (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
        // This file is meant to be re-generated in place and/or deleted at any time.
        
        package kmodels
        
        
        Severity: Major
        Found in importer/kmedia/kmodels/catalogs.go - About 4 days to fix

          File handlers_test.go has 1583 lines of code (exceeds 500 allowed). Consider refactoring.
          Open

          package api
          
          import (
              "database/sql"
              "encoding/hex"
          Severity: Major
          Found in api/handlers_test.go - About 3 days to fix

            File file_assets.go has 1545 lines of code (exceeds 500 allowed). Consider refactoring.
            Open

            // Code generated by SQLBoiler (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
            // This file is meant to be re-generated in place and/or deleted at any time.
            
            package kmodels
            
            
            Severity: Major
            Found in importer/kmedia/kmodels/file_assets.go - About 3 days to fix

              File languages.go has 1487 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              // Code generated by SQLBoiler (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
              // This file is meant to be re-generated in place and/or deleted at any time.
              
              package kmodels
              
              
              Severity: Major
              Found in importer/kmedia/kmodels/languages.go - About 3 days to fix

                File users.go has 1256 lines of code (exceeds 500 allowed). Consider refactoring.
                Open

                // Code generated by SQLBoiler (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
                // This file is meant to be re-generated in place and/or deleted at any time.
                
                package kmodels
                
                
                Severity: Major
                Found in importer/kmedia/kmodels/users.go - About 2 days to fix

                  File handlers.go has 1196 lines of code (exceeds 500 allowed). Consider refactoring.
                  Open

                  package api
                  
                  import (
                      "database/sql"
                      "encoding/hex"
                  Severity: Major
                  Found in api/handlers.go - About 2 days to fix

                    Function doProcess has 446 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func doProcess(exec boil.Executor, metadata CITMetadata, original, proxy, source *models.File, cu *models.ContentUnit) ([]events.Event, error) {
                        isUpdate := cu != nil
                        log.Infof("Processing CITMetadata, isUpdate: %t", isUpdate)
                    
                        // Update properties for original and proxy (film_date, capture_date)
                    Severity: Major
                    Found in api/metadata_processor.go - About 2 days to fix

                      Function doEventsSubcollections has a Cognitive Complexity of 115 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func doEventsSubcollections(cIDs []int64) error {
                          for _, cID := range cIDs {
                      
                              c, err := models.Collections(
                                  qm.Where("id=?", cID),
                      Severity: Minor
                      Found in batch/events_subcollections.go - About 2 days 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 handleInsert has a Cognitive Complexity of 112 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func handleInsert(exec boil.Executor, input interface{}) (*models.Operation, []events.Event, error) {
                          r := input.(InsertRequest)
                      
                          log.Infof("Lookup file by SHA1")
                          file, _, err := FindFileBySHA1(exec, r.File.Sha1)
                      Severity: Minor
                      Found in api/handlers.go - About 1 day 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

                      Container has 98 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      type Container struct {
                          ID              int         `boil:"id" json:"id" toml:"id" yaml:"id"`
                          Name            null.String `boil:"name" json:"name,omitempty" toml:"name" yaml:"name,omitempty"`
                          CreatedAt       null.Time   `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
                          UpdatedAt       null.Time   `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"`
                      Severity: Major
                      Found in importer/kmedia/kmodels/containers.go - About 1 day to fix

                        Catalog has 88 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        type Catalog struct {
                            ID              int         `boil:"id" json:"id" toml:"id" yaml:"id"`
                            Name            string      `boil:"name" json:"name" toml:"name" yaml:"name"`
                            ParentID        null.Int    `boil:"parent_id" json:"parent_id,omitempty" toml:"parent_id" yaml:"parent_id,omitempty"`
                            CreatedAt       null.Time   `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
                        Severity: Major
                        Found in importer/kmedia/kmodels/catalogs.go - About 1 day to fix

                          Function compareCollection has a Cognitive Complexity of 98 (exceeds 20 allowed). Consider refactoring.
                          Open

                          func compareCollection(c *models.Collection) error {
                              var props map[string]interface{}
                              if err := json.Unmarshal(c.Properties.JSON, &props); err != nil {
                                  return errors.Wrap(err, "json.Unmarshal properties")
                              }
                          Severity: Minor
                          Found in importer/kmedia/compare.go - About 1 day 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

                          File container_descriptions.go has 957 lines of code (exceeds 500 allowed). Consider refactoring.
                          Open

                          // Code generated by SQLBoiler (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
                          // This file is meant to be re-generated in place and/or deleted at any time.
                          
                          package kmodels
                          
                          
                          Severity: Major
                          Found in importer/kmedia/kmodels/container_descriptions.go - About 1 day to fix

                            File catalog_descriptions.go has 954 lines of code (exceeds 500 allowed). Consider refactoring.
                            Open

                            // Code generated by SQLBoiler (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
                            // This file is meant to be re-generated in place and/or deleted at any time.
                            
                            package kmodels
                            
                            
                            Severity: Major
                            Found in importer/kmedia/kmodels/catalog_descriptions.go - About 1 day to fix

                              File container_description_patterns.go has 915 lines of code (exceeds 500 allowed). Consider refactoring.
                              Open

                              // Code generated by SQLBoiler (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
                              // This file is meant to be re-generated in place and/or deleted at any time.
                              
                              package kmodels
                              
                              
                              Severity: Major
                              Found in importer/kmedia/kmodels/container_description_patterns.go - About 1 day to fix

                                File labels.go has 904 lines of code (exceeds 500 allowed). Consider refactoring.
                                Open

                                // Code generated by SQLBoiler (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
                                // This file is meant to be re-generated in place and/or deleted at any time.
                                
                                package kmodels
                                
                                
                                Severity: Major
                                Found in importer/kmedia/kmodels/labels.go - About 1 day to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language