Bnei-Baruch/mdb

View on GitHub

Showing 431 of 1,135 total issues

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

func ContentUnitOriginsHandler(c *gin.Context) {
    id, e := strconv.ParseInt(c.Param("id"), 10, 0)
    if e != nil {
        NewBadRequestError(errors.Wrap(e, "id expects int64")).Abort(c)
        return
Severity: Major
Found in api/rest.go and 2 other locations - About 50 mins to fix
api/rest.go on lines 413..422
api/rest.go on lines 772..781

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

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 ContentUnitCollectionsHandler(c *gin.Context) {
    id, e := strconv.ParseInt(c.Param("id"), 10, 0)
    if e != nil {
        NewBadRequestError(errors.Wrap(e, "id expects int64")).Abort(c)
        return
Severity: Major
Found in api/rest.go and 2 other locations - About 50 mins to fix
api/rest.go on lines 489..498
api/rest.go on lines 772..781

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

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

            for _, fileAsset := range container.R.FileAssets {
                log.Infof("Processing file_asset %d", fileAsset.ID)
                stats.FileAssetsProcessed.Inc(1)

                // Create or update MDB file
Severity: Major
Found in importer/kmedia/virtual_lessons.go and 3 other locations - About 50 mins to fix
importer/kmedia/common.go on lines 196..210
importer/kmedia/congresses.go on lines 524..538
importer/kmedia/programs.go on lines 153..167

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

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 FileStoragesHandler(c *gin.Context) {
    id, e := strconv.ParseInt(c.Param("id"), 10, 0)
    if e != nil {
        NewBadRequestError(errors.Wrap(e, "id expects int64")).Abort(c)
        return
Severity: Major
Found in api/rest.go and 2 other locations - About 50 mins to fix
api/rest.go on lines 413..422
api/rest.go on lines 489..498

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

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 (c *CreateUnits) openDB() {
    mdb, err := sql.Open("postgres", viper.GetString("mdb.url"))
    utils.Must(err)
    utils.Must(mdb.Ping())
    boil.SetDB(mdb)
Severity: Minor
Found in importer/likutim/create_unit.go and 1 other location - About 50 mins to fix
importer/likutim/create_tar.go on lines 92..100

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

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 (c *CreateTar) openDB() {
    mdb, err := sql.Open("postgres", viper.GetString("mdb.url"))
    utils.Must(err)
    utils.Must(mdb.Ping())
    boil.SetDB(mdb)
Severity: Minor
Found in importer/likutim/create_tar.go and 1 other location - About 50 mins to fix
importer/likutim/create_unit.go on lines 264..272

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

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) User(exec boil.Executor, mods ...qm.QueryMod) userQuery {
    queryMods := []qm.QueryMod{
        qm.Where("id=?", o.UserID),
    }

Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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 *CatalogDescription) Catalog(exec boil.Executor, mods ...qm.QueryMod) catalogQuery {
    queryMods := []qm.QueryMod{
        qm.Where("id=?", o.CatalogID),
    }

Severity: Major
Found in importer/kmedia/kmodels/catalog_descriptions.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/file_assets.go on lines 274..285
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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 *CatalogDescription) Lang(exec boil.Executor, mods ...qm.QueryMod) languageQuery {
    queryMods := []qm.QueryMod{
        qm.Where("code3=?", o.LangID),
    }

Severity: Major
Found in importer/kmedia/kmodels/catalog_descriptions.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/file_assets.go on lines 274..285
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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 *ContainerDescription) Lang(exec boil.Executor, mods ...qm.QueryMod) languageQuery {
    queryMods := []qm.QueryMod{
        qm.Where("code3=?", o.LangID),
    }

Severity: Major
Found in importer/kmedia/kmodels/container_descriptions.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/file_assets.go on lines 274..285
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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) Lang(exec boil.Executor, mods ...qm.QueryMod) languageQuery {
    queryMods := []qm.QueryMod{
        qm.Where("code3=?", o.LangID),
    }

Severity: Major
Found in importer/kmedia/kmodels/containers.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/file_assets.go on lines 274..285
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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) Lang(exec boil.Executor, mods ...qm.QueryMod) languageQuery {
    queryMods := []qm.QueryMod{
        qm.Where("code3=?", o.LangID),
    }

Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/file_assets.go on lines 274..285
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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) User(exec boil.Executor, mods ...qm.QueryMod) userQuery {
    queryMods := []qm.QueryMod{
        qm.Where("id=?", o.UserID),
    }

Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/file_assets.go on lines 274..285
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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 *RolesUser) User(exec boil.Executor, mods ...qm.QueryMod) userQuery {
    queryMods := []qm.QueryMod{
        qm.Where("id=?", o.UserID),
    }

Severity: Major
Found in importer/kmedia/kmodels/roles_users.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/file_assets.go on lines 274..285

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

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) VirtualLesson(exec boil.Executor, mods ...qm.QueryMod) virtualLessonQuery {
    queryMods := []qm.QueryMod{
        qm.Where("id=?", o.VirtualLessonID),
    }

Severity: Major
Found in importer/kmedia/kmodels/containers.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/file_assets.go on lines 274..285
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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) Parent(exec boil.Executor, mods ...qm.QueryMod) catalogQuery {
    queryMods := []qm.QueryMod{
        qm.Where("id=?", o.ParentID),
    }

Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/file_assets.go on lines 274..285
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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) Servername(exec boil.Executor, mods ...qm.QueryMod) serverQuery {
    queryMods := []qm.QueryMod{
        qm.Where("servername=?", o.ServernameID),
    }

Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 274..285
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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 *ContainerDescription) Container(exec boil.Executor, mods ...qm.QueryMod) containerQuery {
    queryMods := []qm.QueryMod{
        qm.Where("id=?", o.ContainerID),
    }

Severity: Major
Found in importer/kmedia/kmodels/container_descriptions.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/file_assets.go on lines 274..285
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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 *FileAssetDescription) File(exec boil.Executor, mods ...qm.QueryMod) fileAssetQuery {
    queryMods := []qm.QueryMod{
        qm.Where("id=?", o.FileID),
    }

Severity: Major
Found in importer/kmedia/kmodels/file_asset_descriptions.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 250..261
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/file_assets.go on lines 274..285
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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) ContentType(exec boil.Executor, mods ...qm.QueryMod) contentTypeQuery {
    queryMods := []qm.QueryMod{
        qm.Where("id=?", o.ContentTypeID),
    }

Severity: Major
Found in importer/kmedia/kmodels/containers.go and 13 other locations - About 50 mins to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 203..214
importer/kmedia/kmodels/catalog_descriptions.go on lines 222..233
importer/kmedia/kmodels/catalogs.go on lines 228..239
importer/kmedia/kmodels/catalogs.go on lines 247..258
importer/kmedia/kmodels/container_descriptions.go on lines 206..217
importer/kmedia/kmodels/container_descriptions.go on lines 225..236
importer/kmedia/kmodels/containers.go on lines 269..280
importer/kmedia/kmodels/containers.go on lines 288..299
importer/kmedia/kmodels/file_asset_descriptions.go on lines 202..213
importer/kmedia/kmodels/file_assets.go on lines 236..247
importer/kmedia/kmodels/file_assets.go on lines 255..266
importer/kmedia/kmodels/file_assets.go on lines 274..285
importer/kmedia/kmodels/roles_users.go on lines 189..200

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

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