Bnei-Baruch/mdb

View on GitHub

Showing 1,135 of 1,135 total issues

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

func (o *ContainerDescriptionPattern) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
    if o == nil {
        return errors.New("kmodels: no container_description_patterns provided for upsert")
    }
    currTime := time.Now().In(boil.GetLocation())
Severity: Major
Found in importer/kmedia/kmodels/container_description_patterns.go and 10 other locations - About 1 day to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 950..1066
importer/kmedia/kmodels/catalogs.go on lines 2213..2329
importer/kmedia/kmodels/container_descriptions.go on lines 953..1069
importer/kmedia/kmodels/containers.go on lines 2493..2609
importer/kmedia/kmodels/file_asset_descriptions.go on lines 723..839
importer/kmedia/kmodels/file_assets.go on lines 1791..1907
importer/kmedia/kmodels/lecturer_descriptions.go on lines 559..675
importer/kmedia/kmodels/lecturers.go on lines 556..672
importer/kmedia/kmodels/roles.go on lines 556..672
importer/kmedia/kmodels/users.go on lines 1394..1510

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

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

func (o *Catalog) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
    if o == nil {
        return errors.New("kmodels: no catalogs provided for upsert")
    }
    currTime := time.Now().In(boil.GetLocation())
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go and 10 other locations - About 1 day to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 950..1066
importer/kmedia/kmodels/container_description_patterns.go on lines 907..1023
importer/kmedia/kmodels/container_descriptions.go on lines 953..1069
importer/kmedia/kmodels/containers.go on lines 2493..2609
importer/kmedia/kmodels/file_asset_descriptions.go on lines 723..839
importer/kmedia/kmodels/file_assets.go on lines 1791..1907
importer/kmedia/kmodels/lecturer_descriptions.go on lines 559..675
importer/kmedia/kmodels/lecturers.go on lines 556..672
importer/kmedia/kmodels/roles.go on lines 556..672
importer/kmedia/kmodels/users.go on lines 1394..1510

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

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

func (o *User) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
    if o == nil {
        return errors.New("kmodels: no users provided for upsert")
    }
    currTime := time.Now().In(boil.GetLocation())
Severity: Major
Found in importer/kmedia/kmodels/users.go and 10 other locations - About 1 day to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 950..1066
importer/kmedia/kmodels/catalogs.go on lines 2213..2329
importer/kmedia/kmodels/container_description_patterns.go on lines 907..1023
importer/kmedia/kmodels/container_descriptions.go on lines 953..1069
importer/kmedia/kmodels/containers.go on lines 2493..2609
importer/kmedia/kmodels/file_asset_descriptions.go on lines 723..839
importer/kmedia/kmodels/file_assets.go on lines 1791..1907
importer/kmedia/kmodels/lecturer_descriptions.go on lines 559..675
importer/kmedia/kmodels/lecturers.go on lines 556..672
importer/kmedia/kmodels/roles.go on lines 556..672

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

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

func (o *ContainerDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
    if o == nil {
        return errors.New("kmodels: no container_descriptions provided for upsert")
    }
    currTime := time.Now().In(boil.GetLocation())
Severity: Major
Found in importer/kmedia/kmodels/container_descriptions.go and 10 other locations - About 1 day to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 950..1066
importer/kmedia/kmodels/catalogs.go on lines 2213..2329
importer/kmedia/kmodels/container_description_patterns.go on lines 907..1023
importer/kmedia/kmodels/containers.go on lines 2493..2609
importer/kmedia/kmodels/file_asset_descriptions.go on lines 723..839
importer/kmedia/kmodels/file_assets.go on lines 1791..1907
importer/kmedia/kmodels/lecturer_descriptions.go on lines 559..675
importer/kmedia/kmodels/lecturers.go on lines 556..672
importer/kmedia/kmodels/roles.go on lines 556..672
importer/kmedia/kmodels/users.go on lines 1394..1510

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

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

func (o *Container) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
    if o == nil {
        return errors.New("kmodels: no containers provided for upsert")
    }
    currTime := time.Now().In(boil.GetLocation())
Severity: Major
Found in importer/kmedia/kmodels/containers.go and 10 other locations - About 1 day to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 950..1066
importer/kmedia/kmodels/catalogs.go on lines 2213..2329
importer/kmedia/kmodels/container_description_patterns.go on lines 907..1023
importer/kmedia/kmodels/container_descriptions.go on lines 953..1069
importer/kmedia/kmodels/file_asset_descriptions.go on lines 723..839
importer/kmedia/kmodels/file_assets.go on lines 1791..1907
importer/kmedia/kmodels/lecturer_descriptions.go on lines 559..675
importer/kmedia/kmodels/lecturers.go on lines 556..672
importer/kmedia/kmodels/roles.go on lines 556..672
importer/kmedia/kmodels/users.go on lines 1394..1510

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

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

func (o *LecturerDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
    if o == nil {
        return errors.New("kmodels: no lecturer_descriptions provided for upsert")
    }
    currTime := time.Now().In(boil.GetLocation())
Severity: Major
Found in importer/kmedia/kmodels/lecturer_descriptions.go and 10 other locations - About 1 day to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 950..1066
importer/kmedia/kmodels/catalogs.go on lines 2213..2329
importer/kmedia/kmodels/container_description_patterns.go on lines 907..1023
importer/kmedia/kmodels/container_descriptions.go on lines 953..1069
importer/kmedia/kmodels/containers.go on lines 2493..2609
importer/kmedia/kmodels/file_asset_descriptions.go on lines 723..839
importer/kmedia/kmodels/file_assets.go on lines 1791..1907
importer/kmedia/kmodels/lecturers.go on lines 556..672
importer/kmedia/kmodels/roles.go on lines 556..672
importer/kmedia/kmodels/users.go on lines 1394..1510

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

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

func (o *Lecturer) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
    if o == nil {
        return errors.New("kmodels: no lecturers provided for upsert")
    }
    currTime := time.Now().In(boil.GetLocation())
Severity: Major
Found in importer/kmedia/kmodels/lecturers.go and 10 other locations - About 1 day to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 950..1066
importer/kmedia/kmodels/catalogs.go on lines 2213..2329
importer/kmedia/kmodels/container_description_patterns.go on lines 907..1023
importer/kmedia/kmodels/container_descriptions.go on lines 953..1069
importer/kmedia/kmodels/containers.go on lines 2493..2609
importer/kmedia/kmodels/file_asset_descriptions.go on lines 723..839
importer/kmedia/kmodels/file_assets.go on lines 1791..1907
importer/kmedia/kmodels/lecturer_descriptions.go on lines 559..675
importer/kmedia/kmodels/roles.go on lines 556..672
importer/kmedia/kmodels/users.go on lines 1394..1510

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

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

func (o *CatalogDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
    if o == nil {
        return errors.New("kmodels: no catalog_descriptions provided for upsert")
    }
    currTime := time.Now().In(boil.GetLocation())
Severity: Major
Found in importer/kmedia/kmodels/catalog_descriptions.go and 10 other locations - About 1 day to fix
importer/kmedia/kmodels/catalogs.go on lines 2213..2329
importer/kmedia/kmodels/container_description_patterns.go on lines 907..1023
importer/kmedia/kmodels/container_descriptions.go on lines 953..1069
importer/kmedia/kmodels/containers.go on lines 2493..2609
importer/kmedia/kmodels/file_asset_descriptions.go on lines 723..839
importer/kmedia/kmodels/file_assets.go on lines 1791..1907
importer/kmedia/kmodels/lecturer_descriptions.go on lines 559..675
importer/kmedia/kmodels/lecturers.go on lines 556..672
importer/kmedia/kmodels/roles.go on lines 556..672
importer/kmedia/kmodels/users.go on lines 1394..1510

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

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

func (o *FileAssetDescription) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
    if o == nil {
        return errors.New("kmodels: no file_asset_descriptions provided for upsert")
    }
    currTime := time.Now().In(boil.GetLocation())
Severity: Major
Found in importer/kmedia/kmodels/file_asset_descriptions.go and 10 other locations - About 1 day to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 950..1066
importer/kmedia/kmodels/catalogs.go on lines 2213..2329
importer/kmedia/kmodels/container_description_patterns.go on lines 907..1023
importer/kmedia/kmodels/container_descriptions.go on lines 953..1069
importer/kmedia/kmodels/containers.go on lines 2493..2609
importer/kmedia/kmodels/file_assets.go on lines 1791..1907
importer/kmedia/kmodels/lecturer_descriptions.go on lines 559..675
importer/kmedia/kmodels/lecturers.go on lines 556..672
importer/kmedia/kmodels/roles.go on lines 556..672
importer/kmedia/kmodels/users.go on lines 1394..1510

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

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

func (o *Role) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
    if o == nil {
        return errors.New("kmodels: no roles provided for upsert")
    }
    currTime := time.Now().In(boil.GetLocation())
Severity: Major
Found in importer/kmedia/kmodels/roles.go and 10 other locations - About 1 day to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 950..1066
importer/kmedia/kmodels/catalogs.go on lines 2213..2329
importer/kmedia/kmodels/container_description_patterns.go on lines 907..1023
importer/kmedia/kmodels/container_descriptions.go on lines 953..1069
importer/kmedia/kmodels/containers.go on lines 2493..2609
importer/kmedia/kmodels/file_asset_descriptions.go on lines 723..839
importer/kmedia/kmodels/file_assets.go on lines 1791..1907
importer/kmedia/kmodels/lecturer_descriptions.go on lines 559..675
importer/kmedia/kmodels/lecturers.go on lines 556..672
importer/kmedia/kmodels/users.go on lines 1394..1510

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

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

func (o *FileAsset) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
    if o == nil {
        return errors.New("kmodels: no file_assets provided for upsert")
    }
    currTime := time.Now().In(boil.GetLocation())
Severity: Major
Found in importer/kmedia/kmodels/file_assets.go and 10 other locations - About 1 day to fix
importer/kmedia/kmodels/catalog_descriptions.go on lines 950..1066
importer/kmedia/kmodels/catalogs.go on lines 2213..2329
importer/kmedia/kmodels/container_description_patterns.go on lines 907..1023
importer/kmedia/kmodels/container_descriptions.go on lines 953..1069
importer/kmedia/kmodels/containers.go on lines 2493..2609
importer/kmedia/kmodels/file_asset_descriptions.go on lines 723..839
importer/kmedia/kmodels/lecturer_descriptions.go on lines 559..675
importer/kmedia/kmodels/lecturers.go on lines 556..672
importer/kmedia/kmodels/roles.go on lines 556..672
importer/kmedia/kmodels/users.go on lines 1394..1510

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

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

Catalog has 88 methods (exceeds 20 allowed). Consider refactoring.
Open

type Catalog struct {
    ID              int         `boil:"id" json:"id" toml:"id" yaml:"id"`
    Name            string      `boil:"name" json:"name" toml:"name" yaml:"name"`
    ParentID        null.Int    `boil:"parent_id" json:"parent_id,omitempty" toml:"parent_id" yaml:"parent_id,omitempty"`
    CreatedAt       null.Time   `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
Severity: Major
Found in importer/kmedia/kmodels/catalogs.go - About 1 day to fix

    Function compareCollection has a Cognitive Complexity of 98 (exceeds 20 allowed). Consider refactoring.
    Open

    func compareCollection(c *models.Collection) error {
        var props map[string]interface{}
        if err := json.Unmarshal(c.Properties.JSON, &props); err != nil {
            return errors.Wrap(err, "json.Unmarshal properties")
        }
    Severity: Minor
    Found in importer/kmedia/compare.go - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    File container_descriptions.go has 957 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    // Code generated by SQLBoiler (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
    // This file is meant to be re-generated in place and/or deleted at any time.
    
    package kmodels
    
    
    Severity: Major
    Found in importer/kmedia/kmodels/container_descriptions.go - About 1 day to fix

      File catalog_descriptions.go has 954 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      // Code generated by SQLBoiler (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
      // This file is meant to be re-generated in place and/or deleted at any time.
      
      package kmodels
      
      
      Severity: Major
      Found in importer/kmedia/kmodels/catalog_descriptions.go - About 1 day to fix

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

        func (o *RolesUser) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
            if o == nil {
                return errors.New("kmodels: no roles_users provided for upsert")
            }
        
        
        Severity: Major
        Found in importer/kmedia/kmodels/roles_users.go and 4 other locations - About 1 day to fix
        importer/kmedia/kmodels/content_types.go on lines 851..959
        importer/kmedia/kmodels/file_types.go on lines 535..643
        importer/kmedia/kmodels/languages.go on lines 1790..1898
        importer/kmedia/kmodels/servers.go on lines 860..968

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

        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) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
            if o == nil {
                return errors.New("kmodels: no languages provided for upsert")
            }
        
        
        Severity: Major
        Found in importer/kmedia/kmodels/languages.go and 4 other locations - About 1 day to fix
        importer/kmedia/kmodels/content_types.go on lines 851..959
        importer/kmedia/kmodels/file_types.go on lines 535..643
        importer/kmedia/kmodels/roles_users.go on lines 695..803
        importer/kmedia/kmodels/servers.go on lines 860..968

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

        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) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
            if o == nil {
                return errors.New("kmodels: no content_types provided for upsert")
            }
        
        
        Severity: Major
        Found in importer/kmedia/kmodels/content_types.go and 4 other locations - About 1 day to fix
        importer/kmedia/kmodels/file_types.go on lines 535..643
        importer/kmedia/kmodels/languages.go on lines 1790..1898
        importer/kmedia/kmodels/roles_users.go on lines 695..803
        importer/kmedia/kmodels/servers.go on lines 860..968

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

        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) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
            if o == nil {
                return errors.New("kmodels: no file_types provided for upsert")
            }
        
        
        Severity: Major
        Found in importer/kmedia/kmodels/file_types.go and 4 other locations - About 1 day to fix
        importer/kmedia/kmodels/content_types.go on lines 851..959
        importer/kmedia/kmodels/languages.go on lines 1790..1898
        importer/kmedia/kmodels/roles_users.go on lines 695..803
        importer/kmedia/kmodels/servers.go on lines 860..968

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

        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) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error {
            if o == nil {
                return errors.New("kmodels: no servers provided for upsert")
            }
        
        
        Severity: Major
        Found in importer/kmedia/kmodels/servers.go and 4 other locations - About 1 day to fix
        importer/kmedia/kmodels/content_types.go on lines 851..959
        importer/kmedia/kmodels/file_types.go on lines 535..643
        importer/kmedia/kmodels/languages.go on lines 1790..1898
        importer/kmedia/kmodels/roles_users.go on lines 695..803

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

        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