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 (o *Container) Labels(exec boil.Executor, mods ...qm.QueryMod) labelQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
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 318..337
importer/kmedia/kmodels/catalogs.go on lines 345..364
importer/kmedia/kmodels/container_description_patterns.go on lines 205..224
importer/kmedia/kmodels/containers.go on lines 307..326
importer/kmedia/kmodels/containers.go on lines 360..379
importer/kmedia/kmodels/file_assets.go on lines 293..312
importer/kmedia/kmodels/labels.go on lines 199..218

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

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 (o *Catalog) 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/catalogs.go and 7 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 318..337
importer/kmedia/kmodels/container_description_patterns.go on lines 205..224
importer/kmedia/kmodels/containers.go on lines 307..326
importer/kmedia/kmodels/containers.go on lines 360..379
importer/kmedia/kmodels/containers.go on lines 387..406
importer/kmedia/kmodels/file_assets.go on lines 293..312
importer/kmedia/kmodels/labels.go on lines 199..218

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

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 (o *Container) 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/containers.go and 7 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 318..337
importer/kmedia/kmodels/catalogs.go on lines 345..364
importer/kmedia/kmodels/container_description_patterns.go on lines 205..224
importer/kmedia/kmodels/containers.go on lines 360..379
importer/kmedia/kmodels/containers.go on lines 387..406
importer/kmedia/kmodels/file_assets.go on lines 293..312
importer/kmedia/kmodels/labels.go on lines 199..218

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

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 (o *Label) 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/labels.go and 7 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 318..337
importer/kmedia/kmodels/catalogs.go on lines 345..364
importer/kmedia/kmodels/container_description_patterns.go on lines 205..224
importer/kmedia/kmodels/containers.go on lines 307..326
importer/kmedia/kmodels/containers.go on lines 360..379
importer/kmedia/kmodels/containers.go on lines 387..406
importer/kmedia/kmodels/file_assets.go on lines 293..312

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

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 (o *Container) 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/containers.go and 7 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 318..337
importer/kmedia/kmodels/catalogs.go on lines 345..364
importer/kmedia/kmodels/container_description_patterns.go on lines 205..224
importer/kmedia/kmodels/containers.go on lines 307..326
importer/kmedia/kmodels/containers.go on lines 387..406
importer/kmedia/kmodels/file_assets.go on lines 293..312
importer/kmedia/kmodels/labels.go on lines 199..218

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

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 (o *Catalog) ContainerDescriptionPatterns(exec boil.Executor, mods ...qm.QueryMod) containerDescriptionPatternQuery {
    var queryMods []qm.QueryMod
    if len(mods) != 0 {
        queryMods = append(queryMods, mods...)
    }
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 7 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 345..364
importer/kmedia/kmodels/container_description_patterns.go on lines 205..224
importer/kmedia/kmodels/containers.go on lines 307..326
importer/kmedia/kmodels/containers.go on lines 360..379
importer/kmedia/kmodels/containers.go on lines 387..406
importer/kmedia/kmodels/file_assets.go on lines 293..312
importer/kmedia/kmodels/labels.go on lines 199..218

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

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 (o *ContainerDescriptionPattern) 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/container_description_patterns.go and 7 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 318..337
importer/kmedia/kmodels/catalogs.go on lines 345..364
importer/kmedia/kmodels/containers.go on lines 307..326
importer/kmedia/kmodels/containers.go on lines 360..379
importer/kmedia/kmodels/containers.go on lines 387..406
importer/kmedia/kmodels/file_assets.go on lines 293..312
importer/kmedia/kmodels/labels.go on lines 199..218

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

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

func (suite *RestSuite) TestFileItem() {
    cp := new(DummyAuthProvider)
    f, err := handleGetFile(cp, suite.tx, 1)
    suite.Nil(f, "file nil")
    suite.Require().NotNil(err, "Not Found error")
Severity: Major
Found in api/rest_test.go and 3 other locations - About 2 hrs to fix
api/rest_test.go on lines 118..132
api/rest_test.go on lines 196..210
api/rest_test.go on lines 332..346

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

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

    if r.Proxy != nil {
        proxy, _, err = FindFileBySHA1(exec, r.Proxy.Sha1)
        if err != nil {
            return nil, nil, errors.Wrap(err, "Lookup proxy file")
        }
Severity: Major
Found in api/handlers.go and 1 other location - About 2 hrs to fix
api/handlers.go on lines 457..475

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

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

func (suite *RestSuite) TestContentUnitItem() {
    cp := new(DummyAuthProvider)
    cu, err := handleGetContentUnit(cp, suite.tx, 1)
    suite.Nil(cu, "ContentUnit nil")
    suite.Require().NotNil(err, "Not Found error")
Severity: Major
Found in api/rest_test.go and 3 other locations - About 2 hrs to fix
api/rest_test.go on lines 118..132
api/rest_test.go on lines 288..302
api/rest_test.go on lines 332..346

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

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

func (suite *RestSuite) TestOperationItem() {
    cp := new(DummyAuthProvider)
    f, err := handleGetFile(cp, suite.tx, 1)
    suite.Nil(f, "file nil")
    suite.Require().NotNil(err, "Not Found error")
Severity: Major
Found in api/rest_test.go and 3 other locations - About 2 hrs to fix
api/rest_test.go on lines 118..132
api/rest_test.go on lines 196..210
api/rest_test.go on lines 288..302

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

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

func (suite *RestSuite) TestCollectionItem() {
    cp := new(DummyAuthProvider)
    c, err := handleGetCollection(cp, suite.tx, 1)
    suite.Nil(c, "Collection nil")
    suite.Require().NotNil(err, "Not Found error")
Severity: Major
Found in api/rest_test.go and 3 other locations - About 2 hrs to fix
api/rest_test.go on lines 196..210
api/rest_test.go on lines 288..302
api/rest_test.go on lines 332..346

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

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

    if r.Source != nil {
        source, _, err = FindFileBySHA1(exec, r.Source.Sha1)
        if err != nil {
            return nil, nil, errors.Wrap(err, "Lookup source file")
        }
Severity: Major
Found in api/handlers.go and 1 other location - About 2 hrs to fix
api/handlers.go on lines 435..453

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

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

        if ok {
            // update - for tags
            cu, err = importContainer(tx, cn, nil, common.CT_VIRTUAL_LESSON, "", 0)
            if err != nil {
                utils.Must(tx.Rollback())
Severity: Major
Found in importer/kmedia/vls.go and 1 other location - About 2 hrs to fix
importer/kmedia/clips.go on lines 250..273

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

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

        if ok {
            // update - for tags
            cu, err = importContainer(tx, cn, nil, common.CT_CLIP, "", 0)
            if err != nil {
                utils.Must(tx.Rollback())
Severity: Major
Found in importer/kmedia/clips.go and 1 other location - About 2 hrs to fix
importer/kmedia/vls.go on lines 165..193

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

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 removeContainersFromCatalogsSlice(o *Catalog, related []*Container) {
    for _, rel := range related {
        if rel.R == nil {
            continue
        }
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 7 other locations - About 2 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1593..1611
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/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 removeFileAssetsFromContainersSlice(o *Container, related []*FileAsset) {
    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 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 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 removeContainerDescriptionPatternsFromCatalogsSlice(o *Catalog, related []*ContainerDescriptionPattern) {
    for _, rel := range related {
        if rel.R == nil {
            continue
        }
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 7 other locations - About 2 hrs to fix
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/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

Severity
Category
Status
Source
Language