imagecms/ImageCMS

View on GitHub
application/modules/xbanners/models/Base/BannersQuery.php

Summary

Maintainability
F
1 wk
Test Coverage

File BannersQuery.php has 347 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace xbanners\models\Base;

use \Exception;
Severity: Minor
Found in application/modules/xbanners/models/Base/BannersQuery.php - About 4 hrs to fix

BannersQuery has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class BannersQuery extends ModelCriteria
{
    protected $entityNotFoundExceptionClass = '\\Propel\\Runtime\\Exception\\EntityNotFoundException';

    /**
Severity: Minor
Found in application/modules/xbanners/models/Base/BannersQuery.php - About 3 hrs to fix

Consider simplifying this complex logical expression.
Open

        if (
            $this->formatter || $this->modelAlias || $this->with || $this->select
            || $this->selectColumns || $this->asColumns || $this->selectModifiers
            || $this->map || $this->having || $this->joins
        ) {
Severity: Critical
Found in application/modules/xbanners/models/Base/BannersQuery.php - About 2 hrs to fix

Function filterByWidth has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterByWidth($width = null, $comparison = null)
    {
        if (is_array($width)) {
            $useMinMax = false;
            if (isset($width['min'])) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannersQuery.php - About 55 mins 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

Function filterById has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterById($id = null, $comparison = null)
    {
        if (is_array($id)) {
            $useMinMax = false;
            if (isset($id['min'])) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannersQuery.php - About 55 mins 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

Function filterByHeight has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterByHeight($height = null, $comparison = null)
    {
        if (is_array($height)) {
            $useMinMax = false;
            if (isset($height['min'])) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannersQuery.php - About 55 mins 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

Function findPk has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function findPk($key, ConnectionInterface $con = null)
    {
        if ($key === null) {
            return null;
        }
Severity: Minor
Found in application/modules/xbanners/models/Base/BannersQuery.php - About 25 mins 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

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

    public function findPk($key, ConnectionInterface $con = null)
    {
        if ($key === null) {
            return null;
        }
Severity: Major
Found in application/modules/xbanners/models/Base/BannersQuery.php and 2 other locations - About 7 hrs to fix
application/modules/core/models/Base/RouteQuery.php on lines 150..176
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 173..199

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

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

    protected function findPkSimple($key, ConnectionInterface $con)
    {
        $sql = 'SELECT id, place, width, height, effects, page_type FROM banners WHERE id = :p0';
        try {
            $stmt = $con->prepare($sql);
Severity: Major
Found in application/modules/xbanners/models/Base/BannersQuery.php and 2 other locations - About 7 hrs to fix
application/modules/core/models/Base/RouteQuery.php on lines 189..210
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 212..233

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

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

    public function filterByWidth($width = null, $comparison = null)
    {
        if (is_array($width)) {
            $useMinMax = false;
            if (isset($width['min'])) {
Severity: Major
Found in application/modules/xbanners/models/Base/BannersQuery.php and 16 other locations - About 5 hrs to fix
application/modules/core/models/Base/RouteQuery.php on lines 299..320
application/modules/core/models/Base/RouteQuery.php on lines 340..361
application/modules/xbanners/models/Base/BannerImageI18nQuery.php on lines 304..325
application/modules/xbanners/models/Base/BannerImageI18nQuery.php on lines 420..441
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 322..343
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 365..386
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 406..427
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 472..493
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 513..534
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 554..575
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 595..616
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 636..657
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 677..698
application/modules/xbanners/models/Base/BannersI18nQuery.php on lines 289..310
application/modules/xbanners/models/Base/BannersQuery.php on lines 303..324
application/modules/xbanners/models/Base/BannersQuery.php on lines 410..431

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

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

    public function filterByHeight($height = null, $comparison = null)
    {
        if (is_array($height)) {
            $useMinMax = false;
            if (isset($height['min'])) {
Severity: Major
Found in application/modules/xbanners/models/Base/BannersQuery.php and 16 other locations - About 5 hrs to fix
application/modules/core/models/Base/RouteQuery.php on lines 299..320
application/modules/core/models/Base/RouteQuery.php on lines 340..361
application/modules/xbanners/models/Base/BannerImageI18nQuery.php on lines 304..325
application/modules/xbanners/models/Base/BannerImageI18nQuery.php on lines 420..441
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 322..343
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 365..386
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 406..427
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 472..493
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 513..534
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 554..575
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 595..616
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 636..657
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 677..698
application/modules/xbanners/models/Base/BannersI18nQuery.php on lines 289..310
application/modules/xbanners/models/Base/BannersQuery.php on lines 303..324
application/modules/xbanners/models/Base/BannersQuery.php on lines 369..390

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

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

    public function filterById($id = null, $comparison = null)
    {
        if (is_array($id)) {
            $useMinMax = false;
            if (isset($id['min'])) {
Severity: Major
Found in application/modules/xbanners/models/Base/BannersQuery.php and 16 other locations - About 5 hrs to fix
application/modules/core/models/Base/RouteQuery.php on lines 299..320
application/modules/core/models/Base/RouteQuery.php on lines 340..361
application/modules/xbanners/models/Base/BannerImageI18nQuery.php on lines 304..325
application/modules/xbanners/models/Base/BannerImageI18nQuery.php on lines 420..441
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 322..343
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 365..386
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 406..427
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 472..493
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 513..534
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 554..575
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 595..616
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 636..657
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 677..698
application/modules/xbanners/models/Base/BannersI18nQuery.php on lines 289..310
application/modules/xbanners/models/Base/BannersQuery.php on lines 369..390
application/modules/xbanners/models/Base/BannersQuery.php on lines 410..431

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

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

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

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

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

Refactorings

Further Reading

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

    public function joinBannerImage($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('BannerImage');

Severity: Major
Found in application/modules/xbanners/models/Base/BannersQuery.php and 3 other locations - About 4 hrs to fix
application/modules/core/models/Base/RouteQuery.php on lines 469..491
application/modules/core/models/Base/RouteQuery.php on lines 542..564
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 735..757

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

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

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

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

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

Refactorings

Further Reading

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

    public function joinBannersI18n($relationAlias = null, $joinType = 'LEFT JOIN')
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('BannersI18n');

Severity: Major
Found in application/modules/xbanners/models/Base/BannersQuery.php and 3 other locations - About 4 hrs to fix
application/modules/xbanners/models/Base/BannerImageI18nQuery.php on lines 503..525
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 808..830
application/modules/xbanners/models/Base/BannersI18nQuery.php on lines 397..419

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

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

    public function delete(ConnectionInterface $con = null)
    {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getWriteConnection(BannersTableMap::DATABASE_NAME);
        }
Severity: Major
Found in application/modules/xbanners/models/Base/BannersQuery.php and 2 other locations - About 3 hrs to fix
application/modules/core/models/Base/RouteQuery.php on lines 637..664
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 903..930

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

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

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

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

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

Refactorings

Further Reading

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

    protected function doOnDeleteCascade(ConnectionInterface $con)
    {
        // initialize var to track total num of affected rows
        $affectedRows = 0;

Severity: Major
Found in application/modules/xbanners/models/Base/BannersQuery.php and 1 other location - About 2 hrs to fix
application/modules/core/models/Base/RouteQuery.php on lines 678..702

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

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

    public function findPks($keys, ConnectionInterface $con = null)
    {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
        }
Severity: Major
Found in application/modules/xbanners/models/Base/BannersQuery.php and 4 other locations - About 1 hr to fix
application/modules/core/models/Base/RouteQuery.php on lines 241..253
application/modules/xbanners/models/Base/BannerImageI18nQuery.php on lines 233..245
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 264..276
application/modules/xbanners/models/Base/BannersI18nQuery.php on lines 218..230

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

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

    public function doDeleteAll(ConnectionInterface $con = null)
    {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getWriteConnection(BannersTableMap::DATABASE_NAME);
        }
Severity: Major
Found in application/modules/xbanners/models/Base/BannersQuery.php and 2 other locations - About 1 hr to fix
application/modules/core/models/Base/RouteQuery.php on lines 606..626
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 872..892

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

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

    public static function create($modelAlias = null, Criteria $criteria = null)
    {
        if ($criteria instanceof ChildBannersQuery) {
            return $criteria;
        }
Severity: Major
Found in application/modules/xbanners/models/Base/BannersQuery.php and 4 other locations - About 35 mins to fix
application/modules/core/models/Base/RouteQuery.php on lines 120..134
application/modules/xbanners/models/Base/BannerImageI18nQuery.php on lines 111..125
application/modules/xbanners/models/Base/BannerImageQuery.php on lines 143..157
application/modules/xbanners/models/Base/BannersI18nQuery.php on lines 96..110

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

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