backend/api/deleted.go

Summary

Maintainability
F
1 wk
Test Coverage

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

func (s *Server) GetDeletedCarouselTexts(c echo.Context, params autogen.GetDeletedCarouselTextsParams) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 5 other locations - About 4 hrs to fix
backend/api/deleted.go on lines 109..148
backend/api/deleted.go on lines 296..335
backend/api/deleted.go on lines 393..432
backend/api/deleted.go on lines 490..529
backend/api/deleted.go on lines 581..620

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

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 (s *Server) GetDeletedCarouselImages(c echo.Context, params autogen.GetDeletedCarouselImagesParams) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 5 other locations - About 4 hrs to fix
backend/api/deleted.go on lines 206..245
backend/api/deleted.go on lines 296..335
backend/api/deleted.go on lines 393..432
backend/api/deleted.go on lines 490..529
backend/api/deleted.go on lines 581..620

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

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 (s *Server) GetDeletedCategories(c echo.Context, params autogen.GetDeletedCategoriesParams) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 5 other locations - About 4 hrs to fix
backend/api/deleted.go on lines 109..148
backend/api/deleted.go on lines 206..245
backend/api/deleted.go on lines 393..432
backend/api/deleted.go on lines 490..529
backend/api/deleted.go on lines 581..620

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

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 (s *Server) GetDeletedRefills(c echo.Context, params autogen.GetDeletedRefillsParams) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 5 other locations - About 4 hrs to fix
backend/api/deleted.go on lines 109..148
backend/api/deleted.go on lines 206..245
backend/api/deleted.go on lines 296..335
backend/api/deleted.go on lines 393..432
backend/api/deleted.go on lines 581..620

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

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 (s *Server) GetDeletedTransactions(c echo.Context, params autogen.GetDeletedTransactionsParams) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 5 other locations - About 4 hrs to fix
backend/api/deleted.go on lines 109..148
backend/api/deleted.go on lines 206..245
backend/api/deleted.go on lines 296..335
backend/api/deleted.go on lines 393..432
backend/api/deleted.go on lines 490..529

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

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 (s *Server) GetDeletedItems(c echo.Context, params autogen.GetDeletedItemsParams) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 5 other locations - About 4 hrs to fix
backend/api/deleted.go on lines 109..148
backend/api/deleted.go on lines 206..245
backend/api/deleted.go on lines 296..335
backend/api/deleted.go on lines 490..529
backend/api/deleted.go on lines 581..620

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

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 (s *Server) DeleteItem(c echo.Context, itemId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 2 other locations - About 3 hrs to fix
backend/api/deleted.go on lines 151..179
backend/api/deleted.go on lines 338..366

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

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 (s *Server) DeleteCategory(c echo.Context, categoryId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 2 other locations - About 3 hrs to fix
backend/api/deleted.go on lines 151..179
backend/api/deleted.go on lines 435..463

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

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 (s *Server) DeleteCarouselImage(c echo.Context, imageId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 2 other locations - About 3 hrs to fix
backend/api/deleted.go on lines 338..366
backend/api/deleted.go on lines 435..463

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

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

func (s *Server) DeleteAccount(c echo.Context, accountId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 9 other locations - About 2 hrs to fix
backend/api/deleted.go on lines 85..106
backend/api/deleted.go on lines 182..203
backend/api/deleted.go on lines 248..270
backend/api/deleted.go on lines 369..390
backend/api/deleted.go on lines 466..487
backend/api/deleted.go on lines 532..554
backend/api/deleted.go on lines 557..578
backend/api/deleted.go on lines 623..645
backend/api/deleted.go on lines 648..669

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

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

func (s *Server) RestoreDeletedAccount(c echo.Context, accountId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 9 other locations - About 2 hrs to fix
backend/api/deleted.go on lines 60..82
backend/api/deleted.go on lines 182..203
backend/api/deleted.go on lines 248..270
backend/api/deleted.go on lines 369..390
backend/api/deleted.go on lines 466..487
backend/api/deleted.go on lines 532..554
backend/api/deleted.go on lines 557..578
backend/api/deleted.go on lines 623..645
backend/api/deleted.go on lines 648..669

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

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

func (s *Server) RestoreDeletedCategory(c echo.Context, categoryId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 9 other locations - About 2 hrs to fix
backend/api/deleted.go on lines 60..82
backend/api/deleted.go on lines 85..106
backend/api/deleted.go on lines 182..203
backend/api/deleted.go on lines 248..270
backend/api/deleted.go on lines 466..487
backend/api/deleted.go on lines 532..554
backend/api/deleted.go on lines 557..578
backend/api/deleted.go on lines 623..645
backend/api/deleted.go on lines 648..669

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

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

func (s *Server) DeleteRefill(c echo.Context, refillId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 9 other locations - About 2 hrs to fix
backend/api/deleted.go on lines 60..82
backend/api/deleted.go on lines 85..106
backend/api/deleted.go on lines 182..203
backend/api/deleted.go on lines 248..270
backend/api/deleted.go on lines 369..390
backend/api/deleted.go on lines 466..487
backend/api/deleted.go on lines 557..578
backend/api/deleted.go on lines 623..645
backend/api/deleted.go on lines 648..669

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

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

func (s *Server) RestoreDeletedTransaction(c echo.Context, transactionId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 9 other locations - About 2 hrs to fix
backend/api/deleted.go on lines 60..82
backend/api/deleted.go on lines 85..106
backend/api/deleted.go on lines 182..203
backend/api/deleted.go on lines 248..270
backend/api/deleted.go on lines 369..390
backend/api/deleted.go on lines 466..487
backend/api/deleted.go on lines 532..554
backend/api/deleted.go on lines 557..578
backend/api/deleted.go on lines 623..645

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

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

func (s *Server) RestoreDeletedRefill(c echo.Context, refillId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 9 other locations - About 2 hrs to fix
backend/api/deleted.go on lines 60..82
backend/api/deleted.go on lines 85..106
backend/api/deleted.go on lines 182..203
backend/api/deleted.go on lines 248..270
backend/api/deleted.go on lines 369..390
backend/api/deleted.go on lines 466..487
backend/api/deleted.go on lines 532..554
backend/api/deleted.go on lines 623..645
backend/api/deleted.go on lines 648..669

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

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

func (s *Server) RestoreDeletedItem(c echo.Context, itemId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 9 other locations - About 2 hrs to fix
backend/api/deleted.go on lines 60..82
backend/api/deleted.go on lines 85..106
backend/api/deleted.go on lines 182..203
backend/api/deleted.go on lines 248..270
backend/api/deleted.go on lines 369..390
backend/api/deleted.go on lines 532..554
backend/api/deleted.go on lines 557..578
backend/api/deleted.go on lines 623..645
backend/api/deleted.go on lines 648..669

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

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

func (s *Server) DeleteTransaction(c echo.Context, transactionId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 9 other locations - About 2 hrs to fix
backend/api/deleted.go on lines 60..82
backend/api/deleted.go on lines 85..106
backend/api/deleted.go on lines 182..203
backend/api/deleted.go on lines 248..270
backend/api/deleted.go on lines 369..390
backend/api/deleted.go on lines 466..487
backend/api/deleted.go on lines 532..554
backend/api/deleted.go on lines 557..578
backend/api/deleted.go on lines 648..669

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

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

func (s *Server) DeleteCarouselText(c echo.Context, textId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 9 other locations - About 2 hrs to fix
backend/api/deleted.go on lines 60..82
backend/api/deleted.go on lines 85..106
backend/api/deleted.go on lines 182..203
backend/api/deleted.go on lines 369..390
backend/api/deleted.go on lines 466..487
backend/api/deleted.go on lines 532..554
backend/api/deleted.go on lines 557..578
backend/api/deleted.go on lines 623..645
backend/api/deleted.go on lines 648..669

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

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

func (s *Server) RestoreDeletedCarouselImage(c echo.Context, imageId autogen.UUID) error {
    // Get admin account from cookie
    account, err := MustGetAdmin(c)
    if err != nil {
        return nil
Severity: Major
Found in backend/api/deleted.go and 9 other locations - About 2 hrs to fix
backend/api/deleted.go on lines 60..82
backend/api/deleted.go on lines 85..106
backend/api/deleted.go on lines 248..270
backend/api/deleted.go on lines 369..390
backend/api/deleted.go on lines 466..487
backend/api/deleted.go on lines 532..554
backend/api/deleted.go on lines 557..578
backend/api/deleted.go on lines 623..645
backend/api/deleted.go on lines 648..669

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

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

There are no issues that match your filters.

Category
Status