Bnei-Baruch/mdb

View on GitHub

Showing 431 of 1,135 total issues

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

func (o *Container) SetContentType(exec boil.Executor, insert bool, related *ContentType) error {
    var err error
    if insert {
        if err = related.Insert(exec); err != nil {
            return errors.Wrap(err, "failed to insert into foreign table")
Severity: Major
Found in importer/kmedia/kmodels/containers.go and 5 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 829..873
importer/kmedia/kmodels/catalogs.go on lines 966..1010
importer/kmedia/kmodels/containers.go on lines 1231..1275
importer/kmedia/kmodels/file_assets.go on lines 864..908
importer/kmedia/kmodels/file_assets.go on lines 1001..1045

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

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

func (o *FileAsset) SetUser(exec boil.Executor, insert bool, related *User) error {
    var err error
    if insert {
        if err = related.Insert(exec); err != nil {
            return errors.Wrap(err, "failed to insert into foreign table")
Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 5 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 829..873
importer/kmedia/kmodels/catalogs.go on lines 966..1010
importer/kmedia/kmodels/containers.go on lines 957..1001
importer/kmedia/kmodels/containers.go on lines 1231..1275
importer/kmedia/kmodels/file_assets.go on lines 864..908

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

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

func (o *FileAsset) SetServername(exec boil.Executor, insert bool, related *Server) error {
    var err error
    if insert {
        if err = related.Insert(exec); err != nil {
            return errors.Wrap(err, "failed to insert into foreign table")
Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 5 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 829..873
importer/kmedia/kmodels/catalogs.go on lines 966..1010
importer/kmedia/kmodels/containers.go on lines 957..1001
importer/kmedia/kmodels/containers.go on lines 1231..1275
importer/kmedia/kmodels/file_assets.go on lines 1001..1045

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

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

func (o *Catalog) SetParent(exec boil.Executor, insert bool, related *Catalog) error {
    var err error
    if insert {
        if err = related.Insert(exec); err != nil {
            return errors.Wrap(err, "failed to insert into foreign table")
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 5 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 966..1010
importer/kmedia/kmodels/containers.go on lines 957..1001
importer/kmedia/kmodels/containers.go on lines 1231..1275
importer/kmedia/kmodels/file_assets.go on lines 864..908
importer/kmedia/kmodels/file_assets.go on lines 1001..1045

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

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) RemoveCatalogs(exec boil.Executor, related ...*Catalog) error {
    var err error
    query := fmt.Sprintf(
        "delete from \"catalogs_container_description_patterns\" where \"container_description_pattern_id\" = $1 and \"catalog_id\" in (%s)",
        strmangle.Placeholders(dialect.IndexPlaceholders, len(related), 2, 1),
Severity: Major
Found in importer/kmedia/kmodels/container_description_patterns.go and 7 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1550..1591
importer/kmedia/kmodels/catalogs.go on lines 1786..1827
importer/kmedia/kmodels/containers.go on lines 1510..1551
importer/kmedia/kmodels/containers.go on lines 1830..1871
importer/kmedia/kmodels/containers.go on lines 2066..2107
importer/kmedia/kmodels/file_assets.go on lines 1280..1321
importer/kmedia/kmodels/labels.go on lines 474..515

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

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) RemoveFileAssets(exec boil.Executor, related ...*FileAsset) error {
    var err error
    query := fmt.Sprintf(
        "delete from \"containers_file_assets\" where \"container_id\" = $1 and \"file_asset_id\" in (%s)",
        strmangle.Placeholders(dialect.IndexPlaceholders, len(related), 2, 1),
Severity: Major
Found in importer/kmedia/kmodels/containers.go and 7 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1550..1591
importer/kmedia/kmodels/catalogs.go on lines 1786..1827
importer/kmedia/kmodels/container_description_patterns.go on lines 480..521
importer/kmedia/kmodels/containers.go on lines 1510..1551
importer/kmedia/kmodels/containers.go on lines 2066..2107
importer/kmedia/kmodels/file_assets.go on lines 1280..1321
importer/kmedia/kmodels/labels.go on lines 474..515

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

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) RemoveContainers(exec boil.Executor, related ...*Container) error {
    var err error
    query := fmt.Sprintf(
        "delete from \"containers_labels\" where \"label_id\" = $1 and \"container_id\" in (%s)",
        strmangle.Placeholders(dialect.IndexPlaceholders, len(related), 2, 1),
Severity: Major
Found in importer/kmedia/kmodels/labels.go and 7 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1550..1591
importer/kmedia/kmodels/catalogs.go on lines 1786..1827
importer/kmedia/kmodels/container_description_patterns.go on lines 480..521
importer/kmedia/kmodels/containers.go on lines 1510..1551
importer/kmedia/kmodels/containers.go on lines 1830..1871
importer/kmedia/kmodels/containers.go on lines 2066..2107
importer/kmedia/kmodels/file_assets.go on lines 1280..1321

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

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 *FileAsset) RemoveContainers(exec boil.Executor, related ...*Container) error {
    var err error
    query := fmt.Sprintf(
        "delete from \"containers_file_assets\" where \"file_asset_id\" = $1 and \"container_id\" in (%s)",
        strmangle.Placeholders(dialect.IndexPlaceholders, len(related), 2, 1),
Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 7 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1550..1591
importer/kmedia/kmodels/catalogs.go on lines 1786..1827
importer/kmedia/kmodels/container_description_patterns.go on lines 480..521
importer/kmedia/kmodels/containers.go on lines 1510..1551
importer/kmedia/kmodels/containers.go on lines 1830..1871
importer/kmedia/kmodels/containers.go on lines 2066..2107
importer/kmedia/kmodels/labels.go on lines 474..515

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

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) RemoveCatalogs(exec boil.Executor, related ...*Catalog) error {
    var err error
    query := fmt.Sprintf(
        "delete from \"catalogs_containers\" where \"container_id\" = $1 and \"catalog_id\" in (%s)",
        strmangle.Placeholders(dialect.IndexPlaceholders, len(related), 2, 1),
Severity: Major
Found in importer/kmedia/kmodels/containers.go and 7 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1550..1591
importer/kmedia/kmodels/catalogs.go on lines 1786..1827
importer/kmedia/kmodels/container_description_patterns.go on lines 480..521
importer/kmedia/kmodels/containers.go on lines 1830..1871
importer/kmedia/kmodels/containers.go on lines 2066..2107
importer/kmedia/kmodels/file_assets.go on lines 1280..1321
importer/kmedia/kmodels/labels.go on lines 474..515

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

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) RemoveContainers(exec boil.Executor, related ...*Container) error {
    var err error
    query := fmt.Sprintf(
        "delete from \"catalogs_containers\" where \"catalog_id\" = $1 and \"container_id\" in (%s)",
        strmangle.Placeholders(dialect.IndexPlaceholders, len(related), 2, 1),
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 7 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1550..1591
importer/kmedia/kmodels/container_description_patterns.go on lines 480..521
importer/kmedia/kmodels/containers.go on lines 1510..1551
importer/kmedia/kmodels/containers.go on lines 1830..1871
importer/kmedia/kmodels/containers.go on lines 2066..2107
importer/kmedia/kmodels/file_assets.go on lines 1280..1321
importer/kmedia/kmodels/labels.go on lines 474..515

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

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) RemoveLabels(exec boil.Executor, related ...*Label) error {
    var err error
    query := fmt.Sprintf(
        "delete from \"containers_labels\" where \"container_id\" = $1 and \"label_id\" in (%s)",
        strmangle.Placeholders(dialect.IndexPlaceholders, len(related), 2, 1),
Severity: Major
Found in importer/kmedia/kmodels/containers.go and 7 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1550..1591
importer/kmedia/kmodels/catalogs.go on lines 1786..1827
importer/kmedia/kmodels/container_description_patterns.go on lines 480..521
importer/kmedia/kmodels/containers.go on lines 1510..1551
importer/kmedia/kmodels/containers.go on lines 1830..1871
importer/kmedia/kmodels/file_assets.go on lines 1280..1321
importer/kmedia/kmodels/labels.go on lines 474..515

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

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) RemoveContainerDescriptionPatterns(exec boil.Executor, related ...*ContainerDescriptionPattern) error {
    var err error
    query := fmt.Sprintf(
        "delete from \"catalogs_container_description_patterns\" where \"catalog_id\" = $1 and \"container_description_pattern_id\" in (%s)",
        strmangle.Placeholders(dialect.IndexPlaceholders, len(related), 2, 1),
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 7 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1786..1827
importer/kmedia/kmodels/container_description_patterns.go on lines 480..521
importer/kmedia/kmodels/containers.go on lines 1510..1551
importer/kmedia/kmodels/containers.go on lines 1830..1871
importer/kmedia/kmodels/containers.go on lines 2066..2107
importer/kmedia/kmodels/file_assets.go on lines 1280..1321
importer/kmedia/kmodels/labels.go on lines 474..515

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

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 (o *CatalogDescription) SetCatalog(exec boil.Executor, insert bool, related *Catalog) error {
    var err error
    if insert {
        if err = related.Insert(exec); err != nil {
            return errors.Wrap(err, "failed to insert into foreign table")
Severity: Major
Found in importer/kmedia/kmodels/catalog_descriptions.go and 2 other locations - About 5 hrs to fix
importer/kmedia/kmodels/container_descriptions.go on lines 407..450
importer/kmedia/kmodels/file_asset_descriptions.go on lines 314..357

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

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 (o *ContainerDescription) SetContainer(exec boil.Executor, insert bool, related *Container) error {
    var err error
    if insert {
        if err = related.Insert(exec); err != nil {
            return errors.Wrap(err, "failed to insert into foreign table")
Severity: Major
Found in importer/kmedia/kmodels/container_descriptions.go and 2 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 404..447
importer/kmedia/kmodels/file_asset_descriptions.go on lines 314..357

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

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 (o *FileAssetDescription) SetFile(exec boil.Executor, insert bool, related *FileAsset) error {
    var err error
    if insert {
        if err = related.Insert(exec); err != nil {
            return errors.Wrap(err, "failed to insert into foreign table")
Severity: Major
Found in importer/kmedia/kmodels/file_asset_descriptions.go and 2 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 404..447
importer/kmedia/kmodels/container_descriptions.go on lines 407..450

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

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 PersonsListHandler(c *gin.Context) {
    var err *HttpError
    var resp interface{}

    switch c.Request.Method {
Severity: Major
Found in api/rest.go and 1 other location - About 5 hrs to fix
api/rest.go on lines 1314..1360

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

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 PublishersHandler(c *gin.Context) {
    var err *HttpError
    var resp interface{}

    switch c.Request.Method {
Severity: Major
Found in api/rest.go and 1 other location - About 5 hrs to fix
api/rest.go on lines 1177..1223

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

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 ContentUnitsListHandler(c *gin.Context) {
    var err *HttpError
    var resp interface{}

    switch c.Request.Method {
Severity: Major
Found in api/rest.go and 1 other location - About 5 hrs to fix
api/rest.go on lines 41..83

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

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 CollectionsListHandler(c *gin.Context) {
    var err *HttpError
    var resp interface{}

    switch c.Request.Method {
Severity: Major
Found in api/rest.go and 1 other location - About 5 hrs to fix
api/rest.go on lines 264..306

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

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 SourceHandler(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 5 hrs to fix
api/rest.go on lines 1100..1141
api/rest.go on lines 1362..1403

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

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