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"`
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
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
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,
- 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 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
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{}
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{}
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"`
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)
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
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
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")
}
- 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 autoname.go
has 742 lines of code (exceeds 500 allowed). Consider refactoring. Open
package api
import (
_ "embed"
"encoding/json"
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
- 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
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"`
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)
}
- 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 repo.go
has 710 lines of code (exceeds 500 allowed). Consider refactoring. Open
package api
import (
"database/sql"
"encoding/hex"
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 {
File common.go
has 692 lines of code (exceeds 500 allowed). Consider refactoring. Open
package kmedia
import (
"crypto/sha1"
"database/sql"
File compare.go
has 685 lines of code (exceeds 500 allowed). Consider refactoring. Open
package kmedia
import (
"database/sql"
"encoding/hex"