Bnei-Baruch/mdb

View on GitHub

Showing 704 of 1,135 total issues

Function handleTopics has a Cognitive Complexity of 57 (exceeds 20 allowed). Consider refactoring.
Open

func handleTopics(db *sql.DB) error {
    records, err := utils.ReadCSV(TAGS_FILE)
    if err != nil {
        return errors.Wrap(err, "Read topics")
    }
Severity: Minor
Found in importer/tags/tags.go - About 6 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 importContainer has a Cognitive Complexity of 57 (exceeds 20 allowed). Consider refactoring.
Open

func importContainer(exec boil.Executor,
    container *kmodels.Container,
    collection *models.Collection,
    contentType string,
    ccuName string,
Severity: Minor
Found in importer/kmedia/common.go - About 6 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 prepareUpload has a Cognitive Complexity of 57 (exceeds 20 allowed). Consider refactoring.
Open

func prepareUpload(
    idx *RozaIndex,
    kmFiles map[string]*MiniKMFile,
    kmContainers map[int]string) error {

Severity: Minor
Found in importer/roza/upload.go - About 6 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 importMissingContainers has 184 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func importMissingContainers(missing map[string][]*kmodels.Container) error {

    // clips
    cns := missing["2"]
    for i := range cns {
Severity: Major
Found in importer/kmedia/compare.go - About 6 hrs to fix

    File ckeditor_assets.go has 680 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: Minor
    Found in importer/kmedia/kmodels/ckeditor_assets.go - About 6 hrs to fix

      Method MetadataProcessorSuite.TestSpecialLesson has 183 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (suite *MetadataProcessorSuite) TestSpecialLesson() {
          chain := suite.simulateSpecialLessonChain()
      
          // send parts
          // send full
      Severity: Major
      Found in api/metadata_processor_test.go - About 6 hrs to fix

        Function ErrorHandlingMiddleware has a Cognitive Complexity of 56 (exceeds 20 allowed). Consider refactoring.
        Open

        func ErrorHandlingMiddleware() gin.HandlerFunc {
            return func(c *gin.Context) {
                c.Next()
        
                if len(c.Errors) > 0 {
        Severity: Minor
        Found in utils/middleware.go - About 6 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 metadata_processor.go has 677 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        package api
        
        import (
            "database/sql"
            "encoding/json"
        Severity: Minor
        Found in api/metadata_processor.go - About 6 hrs to fix

          File lecturer_descriptions.go has 676 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: Minor
          Found in importer/kmedia/kmodels/lecturer_descriptions.go - About 6 hrs to fix

            File container_transcripts.go has 674 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: Minor
            Found in importer/kmedia/kmodels/container_transcripts.go - About 6 hrs to fix

              File comments.go has 674 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: Minor
              Found in importer/kmedia/kmodels/comments.go - About 6 hrs to fix

                File lecturers.go has 673 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: Minor
                Found in importer/kmedia/kmodels/lecturers.go - About 6 hrs to fix

                  File roles.go has 673 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: Minor
                  Found in importer/kmedia/kmodels/roles.go - About 6 hrs to fix

                    Method MetadataProcessorSuite.TestReplaceProcess has 178 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func (suite *MetadataProcessorSuite) TestReplaceProcess() {
                        tfMain, WorkflowID := suite.simulateSimpleChain()
                        original, proxy := tfMain.Original, tfMain.Proxy
                    
                        c, err := CreateCollection(suite.tx, common.CT_VIDEO_PROGRAM, nil)
                    Severity: Major
                    Found in api/metadata_processor_test.go - About 6 hrs to fix

                      File label_descriptions.go has 671 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: Minor
                      Found in importer/kmedia/kmodels/label_descriptions.go - About 6 hrs to fix

                        File dictionary_descriptions.go has 671 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: Minor
                        Found in importer/kmedia/kmodels/dictionary_descriptions.go - About 6 hrs to fix

                          File departments.go has 665 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: Minor
                          Found in importer/kmedia/kmodels/departments.go - About 5 hrs to fix

                            File dictionaries.go has 665 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: Minor
                            Found in importer/kmedia/kmodels/dictionaries.go - About 5 hrs to fix

                              Function doCollection has 165 lines of code (exceeds 50 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: Major
                              Found in importer/sources/sources.go - About 5 hrs to fix

                                Function doOrganizeKiteiMakor has a Cognitive Complexity of 52 (exceeds 20 allowed). Consider refactoring.
                                Open

                                func doOrganizeKiteiMakor(ktFiles []*models.File) error {
                                    cuByID := make(map[int64]*models.ContentUnit)
                                    cuMap := make(map[int64][]*models.File)
                                    noCU := make([]*models.File, 0)
                                    for i := range ktFiles {
                                Severity: Minor
                                Found in batch/kitei_makor.go - About 5 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

                                Severity
                                Category
                                Status
                                Source
                                Language