Showing 704 of 1,135 total issues
RolesUser
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type RolesUser struct {
RoleID int `boil:"role_id" json:"role_id" toml:"role_id" yaml:"role_id"`
UserID int `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
R *rolesUserR `boil:"-" json:"-" toml:"-" yaml:"-"`
FileAssetDescription
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type FileAssetDescription struct {
ID int `boil:"id" json:"id" toml:"id" yaml:"id"`
FileID int `boil:"file_id" json:"file_id" toml:"file_id" yaml:"file_id"`
Filedesc null.String `boil:"filedesc" json:"filedesc,omitempty" toml:"filedesc" yaml:"filedesc,omitempty"`
Lang null.String `boil:"lang" json:"lang,omitempty" toml:"lang" yaml:"lang,omitempty"`
Function handleSend
has 100 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func handleSend(exec boil.Executor, input interface{}) (*models.Operation, []events.Event, error) {
r := input.(SendRequest)
// Original
original, _, err := FindFileBySHA1(exec, r.Original.Sha1)
Method HandlersSuite.TestHandleTranscodeSuccess
has 100 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (suite *HandlersSuite) TestHandleTranscodeSuccess() {
// Create dummy original file
ofi := File{
FileName: "dummy_original_file.wmv",
CreatedAt: &Timestamp{time.Now()},
Method Lecturer.Upsert
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *Lecturer) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no lecturers provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Method Container.Upsert
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *Container) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no containers provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Method LecturerDescription.Upsert
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *LecturerDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no lecturer_descriptions provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Method Role.Upsert
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *Role) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no roles provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Method CatalogDescription.Upsert
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *CatalogDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no catalog_descriptions provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Method ContainerDescription.Upsert
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *ContainerDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no container_descriptions provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Method ContainerDescriptionPattern.Upsert
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *ContainerDescriptionPattern) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no container_description_patterns provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Method FileAssetDescription.Upsert
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *FileAssetDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no file_asset_descriptions provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Method Catalog.Upsert
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *Catalog) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no catalogs provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Method FileAsset.Upsert
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *FileAsset) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no file_assets provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Method User.Upsert
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *User) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no users provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Function populateDBQueue
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
Open
func populateDBQueue(files []*models.File) error {
cuMap := make(map[int64]map[string][]*models.File)
noCU := make([]*models.File, 0)
withChilds := make(map[int64]bool)
var ok bool
- 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 missingContainers
has 97 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func missingContainers() (map[string][]*kmodels.Container, error) {
cuMap := make(map[int]bool)
log.Info("Loading all content units with kmedia_id")
units, err := models.ContentUnits(
Method Label.Upsert
has 97 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *Label) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no labels provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Method LabelDescription.Upsert
has 97 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *LabelDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no label_descriptions provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())
Method DictionaryDescription.Upsert
has 97 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (o *DictionaryDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
if o == nil {
return errors.New("kmodels: no dictionary_descriptions provided for upsert")
}
currTime := time.Now().In(boil.GetLocation())