Bnei-Baruch/mdb

View on GitHub

Showing 1,135 of 1,135 total issues

Similar blocks of code found in 2 locations. 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_transcripts.go and 1 other location - About 2 wks to fix
importer/kmedia/kmodels/comments.go on lines 1..938

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 7322.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. 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/comments.go and 1 other location - About 2 wks to fix
importer/kmedia/kmodels/container_transcripts.go on lines 1..938

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 7322.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. 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/label_descriptions.go and 1 other location - About 2 wks to fix
importer/kmedia/kmodels/dictionary_descriptions.go on lines 1..935

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 7299.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. 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/dictionary_descriptions.go and 1 other location - About 2 wks to fix
importer/kmedia/kmodels/label_descriptions.go on lines 1..935

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 7299.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. 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/dictionaries.go and 1 other location - About 2 wks to fix
importer/kmedia/kmodels/departments.go on lines 1..929

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 7253.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. 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/departments.go and 1 other location - About 2 wks to fix
importer/kmedia/kmodels/dictionaries.go on lines 1..929

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 7253.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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
                        Severity
                        Category
                        Status
                        Source
                        Language