Bnei-Baruch/mdb

View on GitHub

Showing 431 of 1,135 total issues

Similar blocks of code found in 8 locations. Consider refactoring.
Open

func removeCatalogsFromContainerDescriptionPatternsSlice(o *ContainerDescriptionPattern, related []*Catalog) {
    for _, rel := range related {
        if rel.R == nil {
            continue
        }
Severity: Major
Found in importer/kmedia/kmodels/container_description_patterns.go and 7 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1593..1611
importer/kmedia/kmodels/catalogs.go on lines 1829..1847
importer/kmedia/kmodels/containers.go on lines 1553..1571
importer/kmedia/kmodels/containers.go on lines 1873..1891
importer/kmedia/kmodels/containers.go on lines 2109..2127
importer/kmedia/kmodels/file_assets.go on lines 1323..1341
importer/kmedia/kmodels/labels.go on lines 517..535

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

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

func removeContainersFromFileAssetsSlice(o *FileAsset, related []*Container) {
    for _, rel := range related {
        if rel.R == nil {
            continue
        }
Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 7 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1593..1611
importer/kmedia/kmodels/catalogs.go on lines 1829..1847
importer/kmedia/kmodels/container_description_patterns.go on lines 523..541
importer/kmedia/kmodels/containers.go on lines 1553..1571
importer/kmedia/kmodels/containers.go on lines 1873..1891
importer/kmedia/kmodels/containers.go on lines 2109..2127
importer/kmedia/kmodels/labels.go on lines 517..535

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

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

func removeLabelsFromContainersSlice(o *Container, related []*Label) {
    for _, rel := range related {
        if rel.R == nil {
            continue
        }
Severity: Major
Found in importer/kmedia/kmodels/containers.go and 7 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1593..1611
importer/kmedia/kmodels/catalogs.go on lines 1829..1847
importer/kmedia/kmodels/container_description_patterns.go on lines 523..541
importer/kmedia/kmodels/containers.go on lines 1553..1571
importer/kmedia/kmodels/containers.go on lines 1873..1891
importer/kmedia/kmodels/file_assets.go on lines 1323..1341
importer/kmedia/kmodels/labels.go on lines 517..535

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

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

func (o *Server) ServernameFileAssets(exec boil.Executor, mods ...qm.QueryMod) fileAssetQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/servers.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/users.go on lines 289..307
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

func (o *Language) LangContainerDescriptions(exec boil.Executor, mods ...qm.QueryMod) containerDescriptionQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/languages.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/users.go on lines 289..307
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

func (o *Language) LangFileAssets(exec boil.Executor, mods ...qm.QueryMod) fileAssetQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/languages.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/users.go on lines 289..307
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

func (o *Catalog) ParentCatalogs(exec boil.Executor, mods ...qm.QueryMod) catalogQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/users.go on lines 289..307
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

func (o *User) RolesUsers(exec boil.Executor, mods ...qm.QueryMod) rolesUserQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/users.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

func (o *Container) ContainerDescriptions(exec boil.Executor, mods ...qm.QueryMod) containerDescriptionQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/containers.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/users.go on lines 289..307
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

func (o *Catalog) CatalogDescriptions(exec boil.Executor, mods ...qm.QueryMod) catalogDescriptionQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/users.go on lines 289..307
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

func (o *ContentType) Containers(exec boil.Executor, mods ...qm.QueryMod) containerQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/content_types.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/users.go on lines 289..307
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

func (o *User) FileAssets(exec boil.Executor, mods ...qm.QueryMod) fileAssetQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/users.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 289..307
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

func (o *VirtualLesson) Containers(exec boil.Executor, mods ...qm.QueryMod) containerQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/virtual_lessons.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/users.go on lines 289..307

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

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

func (o *Language) LangCatalogDescriptions(exec boil.Executor, mods ...qm.QueryMod) catalogDescriptionQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/languages.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/users.go on lines 289..307
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

func (o *User) Catalogs(exec boil.Executor, mods ...qm.QueryMod) catalogQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/users.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/users.go on lines 289..307
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

func (o *FileAsset) FileFileAssetDescriptions(exec boil.Executor, mods ...qm.QueryMod) fileAssetDescriptionQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 251..269
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/users.go on lines 289..307
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

func (o *Language) LangContainers(exec boil.Executor, mods ...qm.QueryMod) containerQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/languages.go and 13 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 266..284
importer/kmedia/kmodels/catalogs.go on lines 292..310
importer/kmedia/kmodels/containers.go on lines 334..352
importer/kmedia/kmodels/content_types.go on lines 196..214
importer/kmedia/kmodels/file_assets.go on lines 320..338
importer/kmedia/kmodels/languages.go on lines 199..217
importer/kmedia/kmodels/languages.go on lines 225..243
importer/kmedia/kmodels/languages.go on lines 277..295
importer/kmedia/kmodels/servers.go on lines 205..223
importer/kmedia/kmodels/users.go on lines 237..255
importer/kmedia/kmodels/users.go on lines 263..281
importer/kmedia/kmodels/users.go on lines 289..307
importer/kmedia/kmodels/virtual_lessons.go on lines 199..217

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

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

    for _, l := range LANGS {
        n := record[header[l+".name"]]
        d := record[header[l+".description"]]
        if n == "" && d == "" {
            continue
Severity: Major
Found in importer/sources/sources.go and 1 other location - About 1 hr to fix
importer/sources/sources.go on lines 132..152

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

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

    for _, l := range LANGS {
        n := record[header[l+".name"]]
        fn := record[header[l+".full_name"]]
        if n == "" && fn == "" {
            continue
Severity: Major
Found in importer/sources/sources.go and 1 other location - About 1 hr to fix
importer/sources/sources.go on lines 245..265

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

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

func handleCreatePerson(exec boil.Executor, p *Person) (*Person, *HttpError) {

    // save person to DB
    uid, err := GetFreeUID(exec, new(PersonUIDChecker))
    if err != nil {
Severity: Major
Found in api/rest.go and 1 other location - About 1 hr to fix
api/rest.go on lines 4288..4311

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

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