phug-php/phug

View on GitHub

Showing 36 of 205 total issues

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\ClassToken;
Severity: Major
Found in src/Phug/Parser/Parser/TokenHandler/ClassTokenHandler.php and 1 other location - About 7 hrs to fix
src/Phug/Parser/Parser/TokenHandler/IdTokenHandler.php on lines 1..45

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\IdToken;
Severity: Major
Found in src/Phug/Parser/Parser/TokenHandler/IdTokenHandler.php and 1 other location - About 7 hrs to fix
src/Phug/Parser/Parser/TokenHandler/ClassTokenHandler.php on lines 1..46

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

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

<?php

namespace Phug\Lexer\Event;

use Phug\Event;
Severity: Major
Found in src/Phug/Lexer/Lexer/Event/LexEvent.php and 1 other location - About 7 hrs to fix
src/Phug/Parser/Parser/Event/ParseEvent.php on lines 1..96

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

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

<?php

namespace Phug\Parser\Event;

use Phug\Event;
Severity: Major
Found in src/Phug/Parser/Parser/Event/ParseEvent.php and 1 other location - About 7 hrs to fix
src/Phug/Lexer/Lexer/Event/LexEvent.php on lines 1..96

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\EachToken;
Severity: Major
Found in src/Phug/Parser/Parser/TokenHandler/EachTokenHandler.php and 1 other location - About 3 hrs to fix
src/Phug/Parser/Parser/TokenHandler/ExpressionTokenHandler.php on lines 1..29

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\ExpressionToken;
src/Phug/Parser/Parser/TokenHandler/EachTokenHandler.php on lines 1..28

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

    private function hasExpiredImport($sourcePath, $cachePath)
    {
        $importsMap = $cachePath.'.imports.serialize.txt';

        if (!file_exists($importsMap)) {
Severity: Major
Found in src/Phug/Renderer/Renderer/Adapter/FileAdapter.php and 1 other location - About 2 hrs to fix
src/Phug/Phug/Phug/Optimizer.php on lines 270..290

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

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

    private function hasExpiredImport($sourcePath, $cachePath)
    {
        $importsMap = $cachePath.'.imports.serialize.txt';

        if (!file_exists($importsMap)) {
Severity: Major
Found in src/Phug/Phug/Phug/Optimizer.php and 1 other location - About 2 hrs to fix
src/Phug/Renderer/Renderer/Adapter/FileAdapter.php on lines 291..311

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\BlockToken;
Severity: Major
Found in src/Phug/Parser/Parser/TokenHandler/BlockTokenHandler.php and 3 other locations - About 2 hrs to fix
src/Phug/Parser/Parser/TokenHandler/ConditionalTokenHandler.php on lines 1..27
src/Phug/Parser/Parser/TokenHandler/KeywordTokenHandler.php on lines 1..27
src/Phug/Parser/Parser/TokenHandler/WhenTokenHandler.php on lines 1..27

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\KeywordToken;
Severity: Major
Found in src/Phug/Parser/Parser/TokenHandler/KeywordTokenHandler.php and 3 other locations - About 2 hrs to fix
src/Phug/Parser/Parser/TokenHandler/BlockTokenHandler.php on lines 1..27
src/Phug/Parser/Parser/TokenHandler/ConditionalTokenHandler.php on lines 1..27
src/Phug/Parser/Parser/TokenHandler/WhenTokenHandler.php on lines 1..27

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\ConditionalToken;
src/Phug/Parser/Parser/TokenHandler/BlockTokenHandler.php on lines 1..27
src/Phug/Parser/Parser/TokenHandler/KeywordTokenHandler.php on lines 1..27
src/Phug/Parser/Parser/TokenHandler/WhenTokenHandler.php on lines 1..27

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\WhenToken;
Severity: Major
Found in src/Phug/Parser/Parser/TokenHandler/WhenTokenHandler.php and 3 other locations - About 2 hrs to fix
src/Phug/Parser/Parser/TokenHandler/BlockTokenHandler.php on lines 1..27
src/Phug/Parser/Parser/TokenHandler/ConditionalTokenHandler.php on lines 1..27
src/Phug/Parser/Parser/TokenHandler/KeywordTokenHandler.php on lines 1..27

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\DoctypeToken;
src/Phug/Parser/Parser/TokenHandler/CaseTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/CommentTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/ForTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/MixinTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/VariableTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/WhileTokenHandler.php on lines 1..26

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\WhileToken;
Severity: Major
Found in src/Phug/Parser/Parser/TokenHandler/WhileTokenHandler.php and 6 other locations - About 1 hr to fix
src/Phug/Parser/Parser/TokenHandler/CaseTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/CommentTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/DoctypeTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/ForTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/MixinTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/VariableTokenHandler.php on lines 1..26

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\CommentToken;
src/Phug/Parser/Parser/TokenHandler/CaseTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/DoctypeTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/ForTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/MixinTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/VariableTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/WhileTokenHandler.php on lines 1..26

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\CaseToken;
Severity: Major
Found in src/Phug/Parser/Parser/TokenHandler/CaseTokenHandler.php and 6 other locations - About 1 hr to fix
src/Phug/Parser/Parser/TokenHandler/CommentTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/DoctypeTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/ForTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/MixinTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/VariableTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/WhileTokenHandler.php on lines 1..26

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\ForToken;
Severity: Major
Found in src/Phug/Parser/Parser/TokenHandler/ForTokenHandler.php and 6 other locations - About 1 hr to fix
src/Phug/Parser/Parser/TokenHandler/CaseTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/CommentTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/DoctypeTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/MixinTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/VariableTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/WhileTokenHandler.php on lines 1..26

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\MixinToken;
Severity: Major
Found in src/Phug/Parser/Parser/TokenHandler/MixinTokenHandler.php and 6 other locations - About 1 hr to fix
src/Phug/Parser/Parser/TokenHandler/CaseTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/CommentTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/DoctypeTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/ForTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/VariableTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/WhileTokenHandler.php on lines 1..26

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

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

<?php

namespace Phug\Parser\TokenHandler;

use Phug\Lexer\Token\VariableToken;
src/Phug/Parser/Parser/TokenHandler/CaseTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/CommentTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/DoctypeTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/ForTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/MixinTokenHandler.php on lines 1..26
src/Phug/Parser/Parser/TokenHandler/WhileTokenHandler.php on lines 1..26

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

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

<?php

namespace Phug\Util\Partial;

/**
Severity: Major
Found in src/Phug/Util/Util/Partial/EscapeTrait.php and 2 other locations - About 1 hr to fix
src/Phug/Util/Util/Partial/CheckTrait.php on lines 1..54
src/Phug/Util/Util/Partial/VisibleTrait.php on lines 1..54

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

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