Bnei-Baruch/mdb

View on GitHub

Showing 704 of 1,135 total issues

Language has 76 methods (exceeds 20 allowed). Consider refactoring.
Open

type Language struct {
    ID       int         `boil:"id" json:"id" toml:"id" yaml:"id"`
    Locale   null.String `boil:"locale" json:"locale,omitempty" toml:"locale" yaml:"locale,omitempty"`
    Code3    null.String `boil:"code3" json:"code3,omitempty" toml:"code3" yaml:"code3,omitempty"`
    Language null.String `boil:"language" json:"language,omitempty" toml:"language" yaml:"language,omitempty"`
Severity: Major
Found in importer/kmedia/kmodels/languages.go - About 1 day to fix

    File virtual_lessons.go has 877 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/virtual_lessons.go - About 1 day to fix

      File servers.go has 869 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/servers.go - About 1 day to fix

        Function compareIdxDir has a Cognitive Complexity of 83 (exceeds 20 allowed). Consider refactoring.
        Open

        func compareIdxDir(
            d *IdxDirectory,
            mdbFiles map[string]*models.File,
            kmFiles map[string]*MiniKMFile,
            cudMap map[int64]int64,
        Severity: Minor
        Found in importer/roza/cu_analysis.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 content_types.go has 860 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/content_types.go - About 1 day to fix

          Method MetadataProcessorSuite.simulateLessonChain has 288 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (suite *MetadataProcessorSuite) simulateLessonChain() map[string]TrimFiles {
              CS_SHA1 := [5]string{}
              DMX_O_SHA1 := [5]string{}
              DMX_P_SHA1 := [5]string{}
              TRM_O_SHA1 := [7]string{}
          Severity: Major
          Found in api/metadata_processor_test.go - About 1 day to fix

            Method MetadataProcessorSuite.simulateSpecialLessonChain has 285 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (suite *MetadataProcessorSuite) simulateSpecialLessonChain() map[string]TrimFiles {
                CS_SHA1 := [2]string{}
                DMX_O_SHA1 := [2]string{}
                DMX_P_SHA1 := [2]string{}
                TRM_O_SHA1 := [13]string{}
            Severity: Major
            Found in api/metadata_processor_test.go - About 1 day to fix

              FileAsset has 70 methods (exceeds 20 allowed). Consider refactoring.
              Open

              type FileAsset struct {
                  ID           int         `boil:"id" json:"id" toml:"id" yaml:"id"`
                  Name         null.String `boil:"name" json:"name,omitempty" toml:"name" yaml:"name,omitempty"`
                  LangID       null.String `boil:"lang_id" json:"lang_id,omitempty" toml:"lang_id" yaml:"lang_id,omitempty"`
                  AssetType    null.String `boil:"asset_type" json:"asset_type,omitempty" toml:"asset_type" yaml:"asset_type,omitempty"`
              Severity: Major
              Found in importer/kmedia/kmodels/file_assets.go - About 1 day to fix

                Function handleInsert has 258 lines of code (exceeds 50 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: Major
                Found in api/handlers.go - About 1 day to fix

                  File file_asset_descriptions.go has 796 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_asset_descriptions.go - About 1 day to fix

                    File roles_users.go has 764 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/roles_users.go - About 1 day to fix

                      Function doCollection has a Cognitive Complexity of 67 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func doCollection(exec boil.Executor, header map[string]int, record []string) error {
                          authorCode := record[header["author"]]
                          if authorCode == "" {
                              return errors.New("Empty author code")
                          }
                      Severity: Minor
                      Found in importer/sources/sources.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 autoname.go has 742 lines of code (exceeds 500 allowed). Consider refactoring.
                      Open

                      package api
                      
                      import (
                          _ "embed"
                          "encoding/json"
                      Severity: Minor
                      Found in api/autoname.go - About 7 hrs to fix

                        Method LessonPartDescriber.DescribeContentUnit has a Cognitive Complexity of 65 (exceeds 20 allowed). Consider refactoring.
                        Open

                        func (d LessonPartDescriber) DescribeContentUnit(exec boil.Executor,
                            cu *models.ContentUnit,
                            metadata CITMetadata) ([]*models.ContentUnitI18n, error) {
                        
                            var err error
                        Severity: Minor
                        Found in api/autoname.go - About 7 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

                        User has 54 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        type User struct {
                            ID                  int         `boil:"id" json:"id" toml:"id" yaml:"id"`
                            Email               string      `boil:"email" json:"email" toml:"email" yaml:"email"`
                            EncryptedPassword   string      `boil:"encrypted_password" json:"encrypted_password" toml:"encrypted_password" yaml:"encrypted_password"`
                            ResetPasswordToken  null.String `boil:"reset_password_token" json:"reset_password_token,omitempty" toml:"reset_password_token" yaml:"reset_password_token,omitempty"`
                        Severity: Major
                        Found in importer/kmedia/kmodels/users.go - About 7 hrs to fix

                          Function compareUnit has a Cognitive Complexity of 62 (exceeds 20 allowed). Consider refactoring.
                          Open

                          func compareUnit(cu *models.ContentUnit, cn *kmodels.Container) error {
                              if err := cu.L.LoadFiles(mdb, true, cu, nil); err != nil {
                                  return errors.Wrapf(err, "Load CU files %d", cu.ID)
                              }
                          
                          
                          Severity: Minor
                          Found in importer/kmedia/compare.go - About 7 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

                          File repo.go has 710 lines of code (exceeds 500 allowed). Consider refactoring.
                          Open

                          package api
                          
                          import (
                              "database/sql"
                              "encoding/hex"
                          Severity: Minor
                          Found in api/repo.go - About 7 hrs to fix

                            Method MetadataProcessorSuite.TestDailyLesson has 194 lines of code (exceeds 50 allowed). Consider refactoring.
                            Open

                            func (suite *MetadataProcessorSuite) TestDailyLesson() {
                                likutim, err := SomeLikutim(suite.tx)
                                suite.Require().Nil(err)
                                likutimUIDs := make([]string, len(likutim))
                                for i, l := range likutim {
                            Severity: Major
                            Found in api/metadata_processor_test.go - About 6 hrs to fix

                              File common.go has 692 lines of code (exceeds 500 allowed). Consider refactoring.
                              Open

                              package kmedia
                              
                              import (
                                  "crypto/sha1"
                                  "database/sql"
                              Severity: Minor
                              Found in importer/kmedia/common.go - About 6 hrs to fix

                                File compare.go has 685 lines of code (exceeds 500 allowed). Consider refactoring.
                                Open

                                package kmedia
                                
                                import (
                                    "database/sql"
                                    "encoding/hex"
                                Severity: Minor
                                Found in importer/kmedia/compare.go - About 6 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language