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"
File metadata_processor_test.go
has 2557 lines of code (exceeds 500 allowed). Consider refactoring. Open
package api
import (
"database/sql"
"encoding/hex"
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)
- Read upRead up
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
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
File handlers_test.go
has 1583 lines of code (exceeds 500 allowed). Consider refactoring. Open
package api
import (
"database/sql"
"encoding/hex"
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
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
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
File handlers.go
has 1196 lines of code (exceeds 500 allowed). Consider refactoring. Open
package api
import (
"database/sql"
"encoding/hex"
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)
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),
- Read upRead up
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)
- Read upRead up
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"`
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"`
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")
}
- Read upRead up
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
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
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
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