Bnei-Baruch/mdb

View on GitHub

Showing 431 of 1,135 total issues

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

    for i := 1; i < 4; i++ {
        metadata.Part = null.IntFrom(i)
        metadata.Sources = suite.someSources()
        metadata.Tags = suite.someTags()
        tf := chain[fmt.Sprintf("part%d", i)]
Severity: Major
Found in api/metadata_processor_test.go and 1 other location - About 6 hrs to fix
api/metadata_processor_test.go on lines 361..391

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

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

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

    for i := 1; i < 4; i++ {
        metadata.Part = null.IntFrom(i)
        metadata.Sources = suite.someSources()
        metadata.Tags = suite.someTags()
        tf := chain[fmt.Sprintf("part%d", i)]
Severity: Major
Found in api/metadata_processor_test.go and 1 other location - About 6 hrs to fix
api/metadata_processor_test.go on lines 124..154

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

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 ContentUnitTagsHandler(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 1 other location - About 6 hrs to fix
api/rest.go on lines 500..548

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

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 ContentUnitSourcesHandler(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 1 other location - About 6 hrs to fix
api/rest.go on lines 550..599

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

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

func (o *FileType) Update(exec boil.Executor, whitelist ...string) error {
    var err error
    key := makeCacheKey(whitelist, nil)
    fileTypeUpdateCacheMut.RLock()
    cache, cached := fileTypeUpdateCache[key]
Severity: Major
Found in importer/kmedia/kmodels/file_types.go and 4 other locations - About 6 hrs to fix
importer/kmedia/kmodels/content_types.go on lines 696..746
importer/kmedia/kmodels/languages.go on lines 1635..1685
importer/kmedia/kmodels/roles_users.go on lines 540..590
importer/kmedia/kmodels/servers.go on lines 705..755

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

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

func (o *RolesUser) Update(exec boil.Executor, whitelist ...string) error {
    var err error
    key := makeCacheKey(whitelist, nil)
    rolesUserUpdateCacheMut.RLock()
    cache, cached := rolesUserUpdateCache[key]
Severity: Major
Found in importer/kmedia/kmodels/roles_users.go and 4 other locations - About 6 hrs to fix
importer/kmedia/kmodels/content_types.go on lines 696..746
importer/kmedia/kmodels/file_types.go on lines 380..430
importer/kmedia/kmodels/languages.go on lines 1635..1685
importer/kmedia/kmodels/servers.go on lines 705..755

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

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

func (o *Server) Update(exec boil.Executor, whitelist ...string) error {
    var err error
    key := makeCacheKey(whitelist, nil)
    serverUpdateCacheMut.RLock()
    cache, cached := serverUpdateCache[key]
Severity: Major
Found in importer/kmedia/kmodels/servers.go and 4 other locations - About 6 hrs to fix
importer/kmedia/kmodels/content_types.go on lines 696..746
importer/kmedia/kmodels/file_types.go on lines 380..430
importer/kmedia/kmodels/languages.go on lines 1635..1685
importer/kmedia/kmodels/roles_users.go on lines 540..590

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

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

func (o *Language) Update(exec boil.Executor, whitelist ...string) error {
    var err error
    key := makeCacheKey(whitelist, nil)
    languageUpdateCacheMut.RLock()
    cache, cached := languageUpdateCache[key]
Severity: Major
Found in importer/kmedia/kmodels/languages.go and 4 other locations - About 6 hrs to fix
importer/kmedia/kmodels/content_types.go on lines 696..746
importer/kmedia/kmodels/file_types.go on lines 380..430
importer/kmedia/kmodels/roles_users.go on lines 540..590
importer/kmedia/kmodels/servers.go on lines 705..755

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

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

func (o *ContentType) Update(exec boil.Executor, whitelist ...string) error {
    var err error
    key := makeCacheKey(whitelist, nil)
    contentTypeUpdateCacheMut.RLock()
    cache, cached := contentTypeUpdateCache[key]
Severity: Major
Found in importer/kmedia/kmodels/content_types.go and 4 other locations - About 6 hrs to fix
importer/kmedia/kmodels/file_types.go on lines 380..430
importer/kmedia/kmodels/languages.go on lines 1635..1685
importer/kmedia/kmodels/roles_users.go on lines 540..590
importer/kmedia/kmodels/servers.go on lines 705..755

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

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 *Container) AddContainerDescriptions(exec boil.Executor, insert bool, related ...*ContainerDescription) error {
    var err error
    for _, rel := range related {
        if insert {
            rel.ContainerID = o.ID
Severity: Major
Found in importer/kmedia/kmodels/containers.go and 2 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1107..1154
importer/kmedia/kmodels/file_assets.go on lines 1378..1425

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

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 *FileAsset) AddFileFileAssetDescriptions(exec boil.Executor, insert bool, related ...*FileAssetDescription) error {
    var err error
    for _, rel := range related {
        if insert {
            rel.FileID = o.ID
Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 2 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 1107..1154
importer/kmedia/kmodels/containers.go on lines 1608..1655

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

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 *Catalog) AddCatalogDescriptions(exec boil.Executor, insert bool, related ...*CatalogDescription) error {
    var err error
    for _, rel := range related {
        if insert {
            rel.CatalogID = o.ID
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 2 other locations - About 5 hrs to fix
importer/kmedia/kmodels/containers.go on lines 1608..1655
importer/kmedia/kmodels/file_assets.go on lines 1378..1425

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

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 handleGetTags(exec boil.Executor, r TagsRequest) (*TagsResponse, *HttpError) {
    mods := make([]qm.QueryMod, 0)

    // count query
    var total int64
Severity: Major
Found in api/rest.go and 1 other location - About 5 hrs to fix
api/rest.go on lines 3630..3673

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

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 handleGetSources(exec boil.Executor, r SourcesRequest) (*SourcesResponse, *HttpError) {
    mods := make([]qm.QueryMod, 0)

    // count query
    var total int64
Severity: Major
Found in api/rest.go and 1 other location - About 5 hrs to fix
api/rest.go on lines 3860..3903

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

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 (o *Container) SetLang(exec boil.Executor, insert bool, related *Language) 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 3 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 480..524
importer/kmedia/kmodels/container_descriptions.go on lines 483..527
importer/kmedia/kmodels/file_assets.go on lines 727..771

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

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 (o *CatalogDescription) SetLang(exec boil.Executor, insert bool, related *Language) 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 3 other locations - About 5 hrs to fix
importer/kmedia/kmodels/container_descriptions.go on lines 483..527
importer/kmedia/kmodels/containers.go on lines 1094..1138
importer/kmedia/kmodels/file_assets.go on lines 727..771

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

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 (o *ContainerDescription) SetLang(exec boil.Executor, insert bool, related *Language) 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 3 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 480..524
importer/kmedia/kmodels/containers.go on lines 1094..1138
importer/kmedia/kmodels/file_assets.go on lines 727..771

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

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 (o *FileAsset) SetLang(exec boil.Executor, insert bool, related *Language) 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 3 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 480..524
importer/kmedia/kmodels/container_descriptions.go on lines 483..527
importer/kmedia/kmodels/containers.go on lines 1094..1138

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

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 *Container) SetVirtualLesson(exec boil.Executor, insert bool, related *VirtualLesson) 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 957..1001
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 *Catalog) 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/catalogs.go and 5 other locations - About 5 hrs to fix
importer/kmedia/kmodels/catalogs.go on lines 829..873
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

Severity
Category
Status
Source
Language