Bnei-Baruch/mdb

View on GitHub

Showing 431 of 1,135 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    for i, x := range input.Output[:len(input.Output)-2] {
        f := fm[x.FileName]
        suite.Equal(x.FileName, f.Name, "Output[%d]: Name", i)
        suite.Equal(x.Sha1, hex.EncodeToString(f.Sha1.Bytes), "Output[%d]: SHA1", i)
        suite.Equal(x.Size, f.Size, "Output[%d]: Size", i)
Severity: Major
Found in api/handlers_test.go and 1 other location - About 4 hrs to fix
api/handlers_test.go on lines 804..818

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 316.

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    for i, x := range input.Output {
        f := fm[x.FileName]
        suite.Equal(x.FileName, f.Name, "Output[%d]: Name", i)
        suite.Equal(x.Sha1, hex.EncodeToString(f.Sha1.Bytes), "Output[%d]: SHA1", i)
        suite.Equal(x.Size, f.Size, "Output[%d]: Size", i)
Severity: Major
Found in api/handlers_test.go and 1 other location - About 4 hrs to fix
api/handlers_test.go on lines 747..761

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 316.

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 3 locations. Consider refactoring.
Open

func handleGetContentUnitTags(cp utils.ContextProvider, exec boil.Executor, id int64) ([]*Tag, *HttpError) {
    unit, err := models.ContentUnits(
        qm.Where("id = ?", id),
        qm.Load("Tags"),
        qm.Load("Tags.TagI18ns")).
Severity: Major
Found in api/rest.go and 2 other locations - About 4 hrs to fix
api/rest.go on lines 2816..2847
api/rest.go on lines 3158..3189

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 316.

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 3 locations. Consider refactoring.
Open

func handleGetContentUnitPublishers(cp utils.ContextProvider, exec boil.Executor, id int64) ([]*Publisher, *HttpError) {
    unit, err := models.ContentUnits(
        qm.Where("id = ?", id),
        qm.Load("Publishers"),
        qm.Load("Publishers.PublisherI18ns")).
Severity: Major
Found in api/rest.go and 2 other locations - About 4 hrs to fix
api/rest.go on lines 2816..2847
api/rest.go on lines 2926..2957

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 316.

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 10 locations. Consider refactoring.
Open

func (o *Container) RemoveContentType(exec boil.Executor, related *ContentType) error {
    var err error

    o.ContentTypeID.Valid = false
    if err = o.Update(exec, "content_type_id"); err != nil {
Severity: Major
Found in importer/kmedia/kmodels/containers.go and 9 other locations - About 4 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 557..584
importer/kmedia/kmodels/catalogs.go on lines 906..933
importer/kmedia/kmodels/catalogs.go on lines 1043..1070
importer/kmedia/kmodels/container_descriptions.go on lines 560..587
importer/kmedia/kmodels/containers.go on lines 1171..1198
importer/kmedia/kmodels/containers.go on lines 1308..1335
importer/kmedia/kmodels/file_assets.go on lines 804..831
importer/kmedia/kmodels/file_assets.go on lines 941..968
importer/kmedia/kmodels/file_assets.go on lines 1078..1105

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 309.

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 10 locations. Consider refactoring.
Open

func (o *CatalogDescription) RemoveLang(exec boil.Executor, related *Language) error {
    var err error

    o.LangID.Valid = false
    if err = o.Update(exec, "lang_id"); err != nil {
Severity: Major
Found in importer/kmedia/kmodels/catalog_descriptions.go and 9 other locations - About 4 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 906..933
importer/kmedia/kmodels/catalogs.go on lines 1043..1070
importer/kmedia/kmodels/container_descriptions.go on lines 560..587
importer/kmedia/kmodels/containers.go on lines 1034..1061
importer/kmedia/kmodels/containers.go on lines 1171..1198
importer/kmedia/kmodels/containers.go on lines 1308..1335
importer/kmedia/kmodels/file_assets.go on lines 804..831
importer/kmedia/kmodels/file_assets.go on lines 941..968
importer/kmedia/kmodels/file_assets.go on lines 1078..1105

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 309.

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 10 locations. Consider refactoring.
Open

func (o *Container) RemoveLang(exec boil.Executor, related *Language) error {
    var err error

    o.LangID.Valid = false
    if err = o.Update(exec, "lang_id"); err != nil {
Severity: Major
Found in importer/kmedia/kmodels/containers.go and 9 other locations - About 4 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 557..584
importer/kmedia/kmodels/catalogs.go on lines 906..933
importer/kmedia/kmodels/catalogs.go on lines 1043..1070
importer/kmedia/kmodels/container_descriptions.go on lines 560..587
importer/kmedia/kmodels/containers.go on lines 1034..1061
importer/kmedia/kmodels/containers.go on lines 1308..1335
importer/kmedia/kmodels/file_assets.go on lines 804..831
importer/kmedia/kmodels/file_assets.go on lines 941..968
importer/kmedia/kmodels/file_assets.go on lines 1078..1105

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 309.

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 10 locations. Consider refactoring.
Open

func (o *FileAsset) RemoveUser(exec boil.Executor, related *User) error {
    var err error

    o.UserID.Valid = false
    if err = o.Update(exec, "user_id"); err != nil {
Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 9 other locations - About 4 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 557..584
importer/kmedia/kmodels/catalogs.go on lines 906..933
importer/kmedia/kmodels/catalogs.go on lines 1043..1070
importer/kmedia/kmodels/container_descriptions.go on lines 560..587
importer/kmedia/kmodels/containers.go on lines 1034..1061
importer/kmedia/kmodels/containers.go on lines 1171..1198
importer/kmedia/kmodels/containers.go on lines 1308..1335
importer/kmedia/kmodels/file_assets.go on lines 804..831
importer/kmedia/kmodels/file_assets.go on lines 941..968

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 309.

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 10 locations. Consider refactoring.
Open

func (o *FileAsset) RemoveLang(exec boil.Executor, related *Language) error {
    var err error

    o.LangID.Valid = false
    if err = o.Update(exec, "lang_id"); err != nil {
Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 9 other locations - About 4 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 557..584
importer/kmedia/kmodels/catalogs.go on lines 906..933
importer/kmedia/kmodels/catalogs.go on lines 1043..1070
importer/kmedia/kmodels/container_descriptions.go on lines 560..587
importer/kmedia/kmodels/containers.go on lines 1034..1061
importer/kmedia/kmodels/containers.go on lines 1171..1198
importer/kmedia/kmodels/containers.go on lines 1308..1335
importer/kmedia/kmodels/file_assets.go on lines 941..968
importer/kmedia/kmodels/file_assets.go on lines 1078..1105

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 309.

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 10 locations. Consider refactoring.
Open

func (o *Catalog) RemoveUser(exec boil.Executor, related *User) error {
    var err error

    o.UserID.Valid = false
    if err = o.Update(exec, "user_id"); err != nil {
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 9 other locations - About 4 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 557..584
importer/kmedia/kmodels/catalogs.go on lines 906..933
importer/kmedia/kmodels/container_descriptions.go on lines 560..587
importer/kmedia/kmodels/containers.go on lines 1034..1061
importer/kmedia/kmodels/containers.go on lines 1171..1198
importer/kmedia/kmodels/containers.go on lines 1308..1335
importer/kmedia/kmodels/file_assets.go on lines 804..831
importer/kmedia/kmodels/file_assets.go on lines 941..968
importer/kmedia/kmodels/file_assets.go on lines 1078..1105

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 309.

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 10 locations. Consider refactoring.
Open

func (o *Catalog) RemoveParent(exec boil.Executor, related *Catalog) error {
    var err error

    o.ParentID.Valid = false
    if err = o.Update(exec, "parent_id"); err != nil {
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 9 other locations - About 4 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 557..584
importer/kmedia/kmodels/catalogs.go on lines 1043..1070
importer/kmedia/kmodels/container_descriptions.go on lines 560..587
importer/kmedia/kmodels/containers.go on lines 1034..1061
importer/kmedia/kmodels/containers.go on lines 1171..1198
importer/kmedia/kmodels/containers.go on lines 1308..1335
importer/kmedia/kmodels/file_assets.go on lines 804..831
importer/kmedia/kmodels/file_assets.go on lines 941..968
importer/kmedia/kmodels/file_assets.go on lines 1078..1105

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 309.

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 10 locations. Consider refactoring.
Open

func (o *Container) RemoveVirtualLesson(exec boil.Executor, related *VirtualLesson) error {
    var err error

    o.VirtualLessonID.Valid = false
    if err = o.Update(exec, "virtual_lesson_id"); err != nil {
Severity: Major
Found in importer/kmedia/kmodels/containers.go and 9 other locations - About 4 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 557..584
importer/kmedia/kmodels/catalogs.go on lines 906..933
importer/kmedia/kmodels/catalogs.go on lines 1043..1070
importer/kmedia/kmodels/container_descriptions.go on lines 560..587
importer/kmedia/kmodels/containers.go on lines 1034..1061
importer/kmedia/kmodels/containers.go on lines 1171..1198
importer/kmedia/kmodels/file_assets.go on lines 804..831
importer/kmedia/kmodels/file_assets.go on lines 941..968
importer/kmedia/kmodels/file_assets.go on lines 1078..1105

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 309.

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 10 locations. Consider refactoring.
Open

func (o *ContainerDescription) RemoveLang(exec boil.Executor, related *Language) error {
    var err error

    o.LangID.Valid = false
    if err = o.Update(exec, "lang_id"); err != nil {
Severity: Major
Found in importer/kmedia/kmodels/container_descriptions.go and 9 other locations - About 4 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 557..584
importer/kmedia/kmodels/catalogs.go on lines 906..933
importer/kmedia/kmodels/catalogs.go on lines 1043..1070
importer/kmedia/kmodels/containers.go on lines 1034..1061
importer/kmedia/kmodels/containers.go on lines 1171..1198
importer/kmedia/kmodels/containers.go on lines 1308..1335
importer/kmedia/kmodels/file_assets.go on lines 804..831
importer/kmedia/kmodels/file_assets.go on lines 941..968
importer/kmedia/kmodels/file_assets.go on lines 1078..1105

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 309.

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 10 locations. Consider refactoring.
Open

func (o *FileAsset) RemoveServername(exec boil.Executor, related *Server) error {
    var err error

    o.ServernameID.Valid = false
    if err = o.Update(exec, "servername_id"); err != nil {
Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 9 other locations - About 4 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 557..584
importer/kmedia/kmodels/catalogs.go on lines 906..933
importer/kmedia/kmodels/catalogs.go on lines 1043..1070
importer/kmedia/kmodels/container_descriptions.go on lines 560..587
importer/kmedia/kmodels/containers.go on lines 1034..1061
importer/kmedia/kmodels/containers.go on lines 1171..1198
importer/kmedia/kmodels/containers.go on lines 1308..1335
importer/kmedia/kmodels/file_assets.go on lines 804..831
importer/kmedia/kmodels/file_assets.go on lines 1078..1105

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 309.

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 10 locations. Consider refactoring.
Open

func (o *Language) RemoveLangContainerDescriptions(exec boil.Executor, related ...*ContainerDescription) error {
    var err error
    for _, rel := range related {
        rel.LangID.Valid = false
        if rel.R != nil {
Severity: Major
Found in importer/kmedia/kmodels/languages.go and 9 other locations - About 3 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1344..1375
importer/kmedia/kmodels/content_types.go on lines 469..500
importer/kmedia/kmodels/languages.go on lines 745..776
importer/kmedia/kmodels/languages.go on lines 1187..1218
importer/kmedia/kmodels/languages.go on lines 1408..1439
importer/kmedia/kmodels/servers.go on lines 478..509
importer/kmedia/kmodels/users.go on lines 692..723
importer/kmedia/kmodels/users.go on lines 913..944
importer/kmedia/kmodels/virtual_lessons.go on lines 472..503

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 299.

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 10 locations. Consider refactoring.
Open

func (o *ContentType) RemoveContainers(exec boil.Executor, related ...*Container) error {
    var err error
    for _, rel := range related {
        rel.ContentTypeID.Valid = false
        if rel.R != nil {
Severity: Major
Found in importer/kmedia/kmodels/content_types.go and 9 other locations - About 3 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1344..1375
importer/kmedia/kmodels/languages.go on lines 745..776
importer/kmedia/kmodels/languages.go on lines 966..997
importer/kmedia/kmodels/languages.go on lines 1187..1218
importer/kmedia/kmodels/languages.go on lines 1408..1439
importer/kmedia/kmodels/servers.go on lines 478..509
importer/kmedia/kmodels/users.go on lines 692..723
importer/kmedia/kmodels/users.go on lines 913..944
importer/kmedia/kmodels/virtual_lessons.go on lines 472..503

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 299.

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 10 locations. Consider refactoring.
Open

func (o *Language) RemoveLangCatalogDescriptions(exec boil.Executor, related ...*CatalogDescription) error {
    var err error
    for _, rel := range related {
        rel.LangID.Valid = false
        if rel.R != nil {
Severity: Major
Found in importer/kmedia/kmodels/languages.go and 9 other locations - About 3 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1344..1375
importer/kmedia/kmodels/content_types.go on lines 469..500
importer/kmedia/kmodels/languages.go on lines 966..997
importer/kmedia/kmodels/languages.go on lines 1187..1218
importer/kmedia/kmodels/languages.go on lines 1408..1439
importer/kmedia/kmodels/servers.go on lines 478..509
importer/kmedia/kmodels/users.go on lines 692..723
importer/kmedia/kmodels/users.go on lines 913..944
importer/kmedia/kmodels/virtual_lessons.go on lines 472..503

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 299.

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 10 locations. Consider refactoring.
Open

func (o *User) RemoveFileAssets(exec boil.Executor, related ...*FileAsset) error {
    var err error
    for _, rel := range related {
        rel.UserID.Valid = false
        if rel.R != nil {
Severity: Major
Found in importer/kmedia/kmodels/users.go and 9 other locations - About 3 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1344..1375
importer/kmedia/kmodels/content_types.go on lines 469..500
importer/kmedia/kmodels/languages.go on lines 745..776
importer/kmedia/kmodels/languages.go on lines 966..997
importer/kmedia/kmodels/languages.go on lines 1187..1218
importer/kmedia/kmodels/languages.go on lines 1408..1439
importer/kmedia/kmodels/servers.go on lines 478..509
importer/kmedia/kmodels/users.go on lines 692..723
importer/kmedia/kmodels/virtual_lessons.go on lines 472..503

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 299.

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 10 locations. Consider refactoring.
Open

func (o *Language) RemoveLangFileAssets(exec boil.Executor, related ...*FileAsset) error {
    var err error
    for _, rel := range related {
        rel.LangID.Valid = false
        if rel.R != nil {
Severity: Major
Found in importer/kmedia/kmodels/languages.go and 9 other locations - About 3 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1344..1375
importer/kmedia/kmodels/content_types.go on lines 469..500
importer/kmedia/kmodels/languages.go on lines 745..776
importer/kmedia/kmodels/languages.go on lines 966..997
importer/kmedia/kmodels/languages.go on lines 1187..1218
importer/kmedia/kmodels/servers.go on lines 478..509
importer/kmedia/kmodels/users.go on lines 692..723
importer/kmedia/kmodels/users.go on lines 913..944
importer/kmedia/kmodels/virtual_lessons.go on lines 472..503

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 299.

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 10 locations. Consider refactoring.
Open

func (o *Catalog) RemoveParentCatalogs(exec boil.Executor, related ...*Catalog) error {
    var err error
    for _, rel := range related {
        rel.ParentID.Valid = false
        if rel.R != nil {
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 9 other locations - About 3 hrs to fix
importer/kmedia/kmodels/content_types.go on lines 469..500
importer/kmedia/kmodels/languages.go on lines 745..776
importer/kmedia/kmodels/languages.go on lines 966..997
importer/kmedia/kmodels/languages.go on lines 1187..1218
importer/kmedia/kmodels/languages.go on lines 1408..1439
importer/kmedia/kmodels/servers.go on lines 478..509
importer/kmedia/kmodels/users.go on lines 692..723
importer/kmedia/kmodels/users.go on lines 913..944
importer/kmedia/kmodels/virtual_lessons.go on lines 472..503

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 299.

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

Severity
Category
Status
Source
Language