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 (c *CollectionWName) Name() string {
    if c.name != "" {
        return c.name
    }

Severity: Major
Found in common/i18n.go and 2 other locations - About 2 hrs to fix
common/i18n.go on lines 40..60
common/i18n.go on lines 62..82

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

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 (cu *UnitWName) Name() string {
    if cu.name != "" {
        return cu.name
    }

Severity: Major
Found in common/i18n.go and 2 other locations - About 2 hrs to fix
common/i18n.go on lines 12..32
common/i18n.go on lines 62..82

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

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 (cu *UnitWName) Description() string {
    if cu.description != "" {
        return cu.description
    }

Severity: Major
Found in common/i18n.go and 2 other locations - About 2 hrs to fix
common/i18n.go on lines 12..32
common/i18n.go on lines 40..60

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

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 handleGetSource(exec boil.Executor, id int64) (*Source, *HttpError) {
    source, err := models.Sources(
        qm.Where("id = ?", id),
        qm.Load("SourceI18ns")).
        One(exec)
Severity: Major
Found in api/rest.go and 3 other locations - About 2 hrs to fix
api/rest.go on lines 3940..3961
api/rest.go on lines 4117..4138
api/rest.go on lines 4313..4334

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

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 handleGetTag(exec boil.Executor, id int64) (*Tag, *HttpError) {
    tag, err := models.Tags(
        qm.Where("id = ?", id),
        qm.Load("TagI18ns")).
        One(exec)
Severity: Major
Found in api/rest.go and 3 other locations - About 2 hrs to fix
api/rest.go on lines 3779..3799
api/rest.go on lines 4117..4138
api/rest.go on lines 4313..4334

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

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 handleGetPerson(exec boil.Executor, id int64) (*Person, *HttpError) {
    person, err := models.Persons(
        qm.Where("id = ?", id),
        qm.Load("PersonI18ns")).
        One(exec)
Severity: Major
Found in api/rest.go and 3 other locations - About 2 hrs to fix
api/rest.go on lines 3779..3799
api/rest.go on lines 3940..3961
api/rest.go on lines 4313..4334

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

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 handleGetPublisher(exec boil.Executor, id int64) (*Publisher, *HttpError) {
    publisher, err := models.Publishers(
        qm.Where("id = ?", id),
        qm.Load("PublisherI18ns")).
        One(exec)
Severity: Major
Found in api/rest.go and 3 other locations - About 2 hrs to fix
api/rest.go on lines 3779..3799
api/rest.go on lines 3940..3961
api/rest.go on lines 4117..4138

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

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) SetCatalogs(exec boil.Executor, insert bool, related ...*Catalog) error {
    query := "delete from \"catalogs_containers\" where \"container_id\" = $1"
    values := []interface{}{o.ID}
    if boil.DebugMode {
        fmt.Fprintln(boil.DebugWriter, query)
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 1499..1517
importer/kmedia/kmodels/catalogs.go on lines 1735..1753
importer/kmedia/kmodels/container_description_patterns.go on lines 429..447
importer/kmedia/kmodels/containers.go on lines 1779..1797
importer/kmedia/kmodels/containers.go on lines 2015..2033
importer/kmedia/kmodels/file_assets.go on lines 1229..1247
importer/kmedia/kmodels/labels.go on lines 423..441

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

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) SetFileAssets(exec boil.Executor, insert bool, related ...*FileAsset) error {
    query := "delete from \"containers_file_assets\" where \"container_id\" = $1"
    values := []interface{}{o.ID}
    if boil.DebugMode {
        fmt.Fprintln(boil.DebugWriter, query)
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 1499..1517
importer/kmedia/kmodels/catalogs.go on lines 1735..1753
importer/kmedia/kmodels/container_description_patterns.go on lines 429..447
importer/kmedia/kmodels/containers.go on lines 1459..1477
importer/kmedia/kmodels/containers.go on lines 2015..2033
importer/kmedia/kmodels/file_assets.go on lines 1229..1247
importer/kmedia/kmodels/labels.go on lines 423..441

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

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) SetContainers(exec boil.Executor, insert bool, related ...*Container) error {
    query := "delete from \"containers_labels\" where \"label_id\" = $1"
    values := []interface{}{o.ID}
    if boil.DebugMode {
        fmt.Fprintln(boil.DebugWriter, query)
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 1499..1517
importer/kmedia/kmodels/catalogs.go on lines 1735..1753
importer/kmedia/kmodels/container_description_patterns.go on lines 429..447
importer/kmedia/kmodels/containers.go on lines 1459..1477
importer/kmedia/kmodels/containers.go on lines 1779..1797
importer/kmedia/kmodels/containers.go on lines 2015..2033
importer/kmedia/kmodels/file_assets.go on lines 1229..1247

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

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

    op, evnts, err := handleTrim(suite.tx, TrimRequest{
        Operation: Operation{
            Station: "Trimmer station",
            User:    "operator@dev.com",
        },
Severity: Major
Found in api/metadata_processor_test.go and 1 other location - About 2 hrs to fix
api/metadata_processor_test.go on lines 2428..2456

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

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

    op, evnts, err := handleTrim(suite.tx, TrimRequest{
        Operation: Operation{
            Station: "Trimmer station",
            User:    "operator@dev.com",
        },
Severity: Major
Found in api/metadata_processor_test.go and 1 other location - About 2 hrs to fix
api/metadata_processor_test.go on lines 2061..2089

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

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) SetCatalogs(exec boil.Executor, insert bool, related ...*Catalog) error {
    query := "delete from \"catalogs_container_description_patterns\" where \"container_description_pattern_id\" = $1"
    values := []interface{}{o.ID}
    if boil.DebugMode {
        fmt.Fprintln(boil.DebugWriter, query)
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 1499..1517
importer/kmedia/kmodels/catalogs.go on lines 1735..1753
importer/kmedia/kmodels/containers.go on lines 1459..1477
importer/kmedia/kmodels/containers.go on lines 1779..1797
importer/kmedia/kmodels/containers.go on lines 2015..2033
importer/kmedia/kmodels/file_assets.go on lines 1229..1247
importer/kmedia/kmodels/labels.go on lines 423..441

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

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) SetContainers(exec boil.Executor, insert bool, related ...*Container) error {
    query := "delete from \"catalogs_containers\" where \"catalog_id\" = $1"
    values := []interface{}{o.ID}
    if boil.DebugMode {
        fmt.Fprintln(boil.DebugWriter, query)
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 1499..1517
importer/kmedia/kmodels/container_description_patterns.go on lines 429..447
importer/kmedia/kmodels/containers.go on lines 1459..1477
importer/kmedia/kmodels/containers.go on lines 1779..1797
importer/kmedia/kmodels/containers.go on lines 2015..2033
importer/kmedia/kmodels/file_assets.go on lines 1229..1247
importer/kmedia/kmodels/labels.go on lines 423..441

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

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) SetContainers(exec boil.Executor, insert bool, related ...*Container) error {
    query := "delete from \"containers_file_assets\" where \"file_asset_id\" = $1"
    values := []interface{}{o.ID}
    if boil.DebugMode {
        fmt.Fprintln(boil.DebugWriter, query)
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 1499..1517
importer/kmedia/kmodels/catalogs.go on lines 1735..1753
importer/kmedia/kmodels/container_description_patterns.go on lines 429..447
importer/kmedia/kmodels/containers.go on lines 1459..1477
importer/kmedia/kmodels/containers.go on lines 1779..1797
importer/kmedia/kmodels/containers.go on lines 2015..2033
importer/kmedia/kmodels/labels.go on lines 423..441

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

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) SetLabels(exec boil.Executor, insert bool, related ...*Label) error {
    query := "delete from \"containers_labels\" where \"container_id\" = $1"
    values := []interface{}{o.ID}
    if boil.DebugMode {
        fmt.Fprintln(boil.DebugWriter, query)
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 1499..1517
importer/kmedia/kmodels/catalogs.go on lines 1735..1753
importer/kmedia/kmodels/container_description_patterns.go on lines 429..447
importer/kmedia/kmodels/containers.go on lines 1459..1477
importer/kmedia/kmodels/containers.go on lines 1779..1797
importer/kmedia/kmodels/file_assets.go on lines 1229..1247
importer/kmedia/kmodels/labels.go on lines 423..441

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

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) SetContainerDescriptionPatterns(exec boil.Executor, insert bool, related ...*ContainerDescriptionPattern) error {
    query := "delete from \"catalogs_container_description_patterns\" where \"catalog_id\" = $1"
    values := []interface{}{o.ID}
    if boil.DebugMode {
        fmt.Fprintln(boil.DebugWriter, query)
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 1735..1753
importer/kmedia/kmodels/container_description_patterns.go on lines 429..447
importer/kmedia/kmodels/containers.go on lines 1459..1477
importer/kmedia/kmodels/containers.go on lines 1779..1797
importer/kmedia/kmodels/containers.go on lines 2015..2033
importer/kmedia/kmodels/file_assets.go on lines 1229..1247
importer/kmedia/kmodels/labels.go on lines 423..441

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    for i := 0; i < 4; i++ {
        part := strconv.Itoa(i)
        _, evnts, err := handleCaptureStop(suite.tx, CaptureStopRequest{
            Operation: Operation{
                Station:    "Capture station",
Severity: Major
Found in api/metadata_processor_test.go and 1 other location - About 2 hrs to fix
api/metadata_processor_test.go on lines 1973..1994

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    for i := 0; i < 4; i++ {
        part := strconv.Itoa(i)
        _, evnts, err := handleCaptureStop(suite.tx, CaptureStopRequest{
            Operation: Operation{
                Station:    "Capture station",
Severity: Major
Found in api/metadata_processor_test.go and 1 other location - About 2 hrs to fix
api/metadata_processor_test.go on lines 2706..2727

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

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) 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/file_assets.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/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

Severity
Category
Status
Source
Language