SeunAdelekan/Kanary

View on GitHub

Showing 58 of 77 total issues

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

    /**
     * Handles DELETE requests.
     *
     * @param [path] - request path.
     * @param [routerAction] - router action.
Severity: Major
Found in src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt and 8 other locations - About 1 hr to fix
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 95..106
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 120..131
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 145..156
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 195..206
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 220..231
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 245..256
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 270..281
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 295..306

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 109.

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

    /**
     * Handles HEAD requests.
     *
     * @param [path] - request path.
     * @param [routerAction] - router action.
Severity: Major
Found in src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt and 8 other locations - About 1 hr to fix
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 95..106
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 120..131
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 145..156
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 170..181
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 195..206
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 245..256
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 270..281
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 295..306

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 109.

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

    /**
     * Handles PUT requests.
     *
     * @param [path] - request path.
     * @param [routerAction] - router action.
Severity: Major
Found in src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt and 8 other locations - About 1 hr to fix
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 95..106
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 120..131
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 170..181
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 195..206
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 220..231
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 245..256
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 270..281
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 295..306

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 109.

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

    /**
     * Handles UNLINK requests.
     *
     * @param [path] - request path.
     * @param [routerAction] - router action.
Severity: Major
Found in src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt and 8 other locations - About 1 hr to fix
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 95..106
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 120..131
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 145..156
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 170..181
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 195..206
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 220..231
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 245..256
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 270..281

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

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

                HttpConstants.PUT.name -> {
                    matchedRoutes = router.putRouteList.filter { it.path == formattedTarget }
                    if(matchedRoutes.isNotEmpty()) {
                        route = matchedRoutes[0]
                    }
Severity: Major
Found in src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt and 5 other locations - About 1 hr to fix
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 89..94
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 95..100
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 107..112
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 113..118
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 119..124

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

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

                HttpConstants.PATCH.name -> {
                    matchedRoutes = router.patchRouteList.filter { it.path == formattedTarget }
                    if(matchedRoutes.isNotEmpty()) {
                        route = matchedRoutes[0]
                    }
Severity: Major
Found in src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt and 5 other locations - About 1 hr to fix
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 89..94
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 95..100
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 101..106
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 107..112
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 119..124

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

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

                HttpConstants.GET.name -> {
                    matchedRoutes = router.getRouteList.filter { it.path == formattedTarget }
                    if(matchedRoutes.isNotEmpty()) {
                        route = matchedRoutes[0]
                    }
Severity: Major
Found in src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt and 5 other locations - About 1 hr to fix
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 95..100
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 101..106
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 107..112
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 113..118
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 119..124

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

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

                HttpConstants.DELETE.name -> {
                    matchedRoutes = router.deleteRouteList.filter { it.path == formattedTarget }
                    if(matchedRoutes.isNotEmpty()) {
                        route = matchedRoutes[0]
                    }
Severity: Major
Found in src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt and 5 other locations - About 1 hr to fix
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 89..94
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 95..100
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 101..106
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 113..118
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 119..124

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

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

                HttpConstants.POST.name -> {
                    matchedRoutes = router.postRouteList.filter { it.path == formattedTarget }
                    if(matchedRoutes.isNotEmpty()) {
                        route = matchedRoutes[0]
                    }
Severity: Major
Found in src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt and 5 other locations - About 1 hr to fix
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 89..94
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 101..106
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 107..112
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 113..118
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 119..124

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

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

                HttpConstants.OPTIONS.name -> {
                    matchedRoutes = router.optionsRouteList.filter { it.path == formattedTarget }
                    if(matchedRoutes.isNotEmpty()) {
                        route = matchedRoutes[0]
                    }
Severity: Major
Found in src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt and 5 other locations - About 1 hr to fix
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 89..94
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 95..100
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 101..106
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 107..112
src/main/com/iyanuadelekan/kanary/handlers/AppHandler.kt on lines 113..118

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

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

    fun put(
            path: String,
            action: (Request, HttpServletRequest, HttpServletResponse) -> Unit,
            controller: KanaryController? = null): KanaryRouter
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 15..18
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 20..23
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 30..33
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 35..38
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 40..43

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

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

    fun get(
            path: String,
            action: (Request, HttpServletRequest, HttpServletResponse) -> Unit,
            controller: KanaryController? = null): KanaryRouter
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 20..23
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 25..28
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 30..33
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 35..38
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 40..43

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

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

    fun patch(
            path: String,
            action: (Request, HttpServletRequest, HttpServletResponse) -> Unit,
            controller: KanaryController? = null): KanaryRouter
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 15..18
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 20..23
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 25..28
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 30..33
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 40..43

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

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

    fun options(
            path: String,
            action: (Request, HttpServletRequest, HttpServletResponse) -> Unit,
            controller: KanaryController? = null): KanaryRouter
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 15..18
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 20..23
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 25..28
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 30..33
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 35..38

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

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

    fun post(
            path: String,
            action: (Request, HttpServletRequest, HttpServletResponse) -> Unit,
            controller: KanaryController?=null): KanaryRouter
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 15..18
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 25..28
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 30..33
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 35..38
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 40..43

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

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

    fun delete(
            path: String,
            action: (Request, HttpServletRequest, HttpServletResponse) -> Unit,
            controller: KanaryController? = null): KanaryRouter
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 15..18
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 20..23
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 25..28
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 35..38
src/main/com/iyanuadelekan/kanary/interfaces/RouterInterface.kt on lines 40..43

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

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

        getRouteList(method).forEach {
            if (it.path == currentSegment || it.path[0] == ':') {
                queue.add(it)
            }
        }
Severity: Minor
Found in src/main/com/iyanuadelekan/kanary/app/router/RouteManager.kt and 1 other location - About 55 mins to fix
src/main/com/iyanuadelekan/kanary/app/router/RouteManager.kt on lines 112..116

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

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

            currentNode.getChildren().forEach {
                if (it.path == currentSegment || it.path[0] == ':') {
                    queue.add(it)
                }
            }
Severity: Minor
Found in src/main/com/iyanuadelekan/kanary/app/router/RouteManager.kt and 1 other location - About 55 mins to fix
src/main/com/iyanuadelekan/kanary/app/router/RouteManager.kt on lines 96..100

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

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

    /**
     * Handles POST requests.
     *
     * @param [path] - request path.
     * @param [routerAction] - router action.
Severity: Major
Found in src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt and 8 other locations - About 50 mins to fix
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 83..93
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 133..143
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 158..168
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 183..193
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 208..218
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 233..243
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 258..268
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 283..293

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

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

    /**
     * Handles HEAD requests.
     *
     * @param [path] - request path.
     * @param [routerAction] - router action.
Severity: Major
Found in src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt and 8 other locations - About 50 mins to fix
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 83..93
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 108..118
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 133..143
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 158..168
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 183..193
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 233..243
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 258..268
src/main/com/iyanuadelekan/kanary/app/router/AppRouter.kt on lines 283..293

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

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