imagecms/ImageCMS

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

Summary

Maintainability
F
1 wk
Test Coverage

File BannerImageQuery.php has 452 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/BannerImageQuery.php - About 6 hrs to fix

BannerImageQuery has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

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

    /**
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageQuery.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/BannerImageQuery.php - About 2 hrs to fix

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/BannerImageQuery.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 filterByActiveFrom has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterByActiveFrom($activeFrom = null, $comparison = null)
    {
        if (is_array($activeFrom)) {
            $useMinMax = false;
            if (isset($activeFrom['min'])) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageQuery.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 filterByActiveTo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterByActiveTo($activeTo = null, $comparison = null)
    {
        if (is_array($activeTo)) {
            $useMinMax = false;
            if (isset($activeTo['min'])) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageQuery.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 filterByBannerId has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterByBannerId($bannerId = null, $comparison = null)
    {
        if (is_array($bannerId)) {
            $useMinMax = false;
            if (isset($bannerId['min'])) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageQuery.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 filterByPosition has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterByPosition($position = null, $comparison = null)
    {
        if (is_array($position)) {
            $useMinMax = false;
            if (isset($position['min'])) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageQuery.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 filterByActive has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterByActive($active = null, $comparison = null)
    {
        if (is_array($active)) {
            $useMinMax = false;
            if (isset($active['min'])) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageQuery.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 filterByTarget has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterByTarget($target = null, $comparison = null)
    {
        if (is_array($target)) {
            $useMinMax = false;
            if (isset($target['min'])) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageQuery.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 filterByAllowedPage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterByAllowedPage($allowedPage = null, $comparison = null)
    {
        if (is_array($allowedPage)) {
            $useMinMax = false;
            if (isset($allowedPage['min'])) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageQuery.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 filterByPermanent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterByPermanent($permanent = null, $comparison = null)
    {
        if (is_array($permanent)) {
            $useMinMax = false;
            if (isset($permanent['min'])) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageQuery.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/BannerImageQuery.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;
        }
application/modules/core/models/Base/RouteQuery.php on lines 150..176
application/modules/xbanners/models/Base/BannersQuery.php on lines 154..180

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, banner_id, target, url, allowed_page, position, active_from, active_to, active, permanent FROM banner_image WHERE id = :p0';
        try {
            $stmt = $con->prepare($sql);
application/modules/core/models/Base/RouteQuery.php on lines 189..210
application/modules/xbanners/models/Base/BannersQuery.php on lines 193..214

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 filterByActiveFrom($activeFrom = null, $comparison = null)
    {
        if (is_array($activeFrom)) {
            $useMinMax = false;
            if (isset($activeFrom['min'])) {
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 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
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 filterByPosition($position = null, $comparison = null)
    {
        if (is_array($position)) {
            $useMinMax = false;
            if (isset($position['min'])) {
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 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
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 filterByActiveTo($activeTo = null, $comparison = null)
    {
        if (is_array($activeTo)) {
            $useMinMax = false;
            if (isset($activeTo['min'])) {
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 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
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 filterByTarget($target = null, $comparison = null)
    {
        if (is_array($target)) {
            $useMinMax = false;
            if (isset($target['min'])) {
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 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
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 filterByBannerId($bannerId = null, $comparison = null)
    {
        if (is_array($bannerId)) {
            $useMinMax = false;
            if (isset($bannerId['min'])) {
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 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
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 filterByActive($active = null, $comparison = null)
    {
        if (is_array($active)) {
            $useMinMax = false;
            if (isset($active['min'])) {
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 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
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 filterByPermanent($permanent = null, $comparison = null)
    {
        if (is_array($permanent)) {
            $useMinMax = false;
            if (isset($permanent['min'])) {
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/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
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 filterById($id = null, $comparison = null)
    {
        if (is_array($id)) {
            $useMinMax = false;
            if (isset($id['min'])) {
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 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
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 filterByAllowedPage($allowedPage = null, $comparison = null)
    {
        if (is_array($allowedPage)) {
            $useMinMax = false;
            if (isset($allowedPage['min'])) {
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 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
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 joinBanners($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Banners');

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/BannersQuery.php on lines 514..536

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 joinBannerImageI18n($relationAlias = null, $joinType = 'LEFT JOIN')
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('BannerImageI18n');

application/modules/xbanners/models/Base/BannerImageI18nQuery.php on lines 503..525
application/modules/xbanners/models/Base/BannersI18nQuery.php on lines 397..419
application/modules/xbanners/models/Base/BannersQuery.php on lines 587..609

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(BannerImageTableMap::DATABASE_NAME);
        }
application/modules/core/models/Base/RouteQuery.php on lines 637..664
application/modules/xbanners/models/Base/BannersQuery.php on lines 682..709

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

    public function filterByBanners($banners, $comparison = null)
    {
        if ($banners instanceof \xbanners\models\Banners) {
            return $this
                ->addUsingAlias(BannerImageTableMap::COL_BANNER_ID, $banners->getId(), $comparison);
application/modules/xbanners/models/Base/BannerImageI18nQuery.php on lines 478..493
application/modules/xbanners/models/Base/BannersI18nQuery.php on lines 372..387

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

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());
        }
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/BannersI18nQuery.php on lines 218..230
application/modules/xbanners/models/Base/BannersQuery.php on lines 245..257

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(BannerImageTableMap::DATABASE_NAME);
        }
application/modules/core/models/Base/RouteQuery.php on lines 606..626
application/modules/xbanners/models/Base/BannersQuery.php on lines 651..671

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 ChildBannerImageQuery) {
            return $criteria;
        }
Severity: Major
Found in application/modules/xbanners/models/Base/BannerImageQuery.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/BannersI18nQuery.php on lines 96..110
application/modules/xbanners/models/Base/BannersQuery.php on lines 124..138

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