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")
}
- 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 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,
- 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 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 {
- 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 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 {
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
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
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 {
- 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 metadata_processor.go
has 677 lines of code (exceeds 500 allowed). Consider refactoring. Open
package api
import (
"database/sql"
"encoding/json"
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
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
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
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
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
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)
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
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
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
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
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")
}
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 {
- 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"