steeffeen/FancyManiaLinks

View on GitHub
FML/Controls/Quads/Quad_Copilot.php

Summary

Maintainability
A
1 hr
Test Coverage
F
0%

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

<?php

namespace FML\Controls\Quads;

use FML\Controls\Quad;
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php and 1 other location - About 1 hr to fix
FML/Controls/Quads/Quad_UIConstruction_Buttons2.php on lines 1..39

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

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

The class Quad_Copilot is not named in CamelCase.
Open

class Quad_Copilot extends Quad
{

    /*
     * Constants
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Class constants must be uppercase; expected SUBSTYLE_LEFTWRONG but found SUBSTYLE_LeftWrong
Open

    const SUBSTYLE_LeftWrong  = 'LeftWrong';

Class constants must be uppercase; expected SUBSTYLE_DOWN but found SUBSTYLE_Down
Open

    const SUBSTYLE_Down       = 'Down';

Class constants must be uppercase; expected SUBSTYLE_LEFT but found SUBSTYLE_Left
Open

    const SUBSTYLE_Left       = 'Left';

Class constants must be uppercase; expected SUBSTYLE_DOWNWRONG but found SUBSTYLE_DownWrong
Open

    const SUBSTYLE_DownWrong  = 'DownWrong';

Class constants must be uppercase; expected SUBSTYLE_RIGHTGOOD but found SUBSTYLE_RightGood
Open

    const SUBSTYLE_RightGood  = 'RightGood';

Class constants must be uppercase; expected SUBSTYLE_RIGHTWRONG but found SUBSTYLE_RightWrong
Open

    const SUBSTYLE_RightWrong = 'RightWrong';

Class constants must be uppercase; expected SUBSTYLE_UPWRONG but found SUBSTYLE_UpWrong
Open

    const SUBSTYLE_UpWrong    = 'UpWrong';

Class constants must be uppercase; expected SUBSTYLE_UPGOOD but found SUBSTYLE_UpGood
Open

    const SUBSTYLE_UpGood     = 'UpGood';

Class constants must be uppercase; expected SUBSTYLE_RIGHT but found SUBSTYLE_Right
Open

    const SUBSTYLE_Right      = 'Right';

The closing brace for the class must go on the next line after the body
Open

}

Class constants must be uppercase; expected SUBSTYLE_DOWNGOOD but found SUBSTYLE_DownGood
Open

    const SUBSTYLE_DownGood   = 'DownGood';

Class constants must be uppercase; expected SUBSTYLE_LEFTGOOD but found SUBSTYLE_LeftGood
Open

    const SUBSTYLE_LeftGood   = 'LeftGood';

Class constants must be uppercase; expected SUBSTYLE_UP but found SUBSTYLE_Up
Open

    const SUBSTYLE_Up         = 'Up';

Constant SUBSTYLE_Up should be defined in uppercase
Open

    const SUBSTYLE_Up         = 'Up';
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

ConstantNamingConventions

Since: 0.2

Class/Interface constant names should always be defined in uppercase.

Example

class Foo {
    const MY_NUM = 0; // ok
    const myTest = ""; // fail
}

Source https://phpmd.org/rules/naming.html#constantnamingconventions

Constant SUBSTYLE_RightGood should be defined in uppercase
Open

    const SUBSTYLE_RightGood  = 'RightGood';
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

ConstantNamingConventions

Since: 0.2

Class/Interface constant names should always be defined in uppercase.

Example

class Foo {
    const MY_NUM = 0; // ok
    const myTest = ""; // fail
}

Source https://phpmd.org/rules/naming.html#constantnamingconventions

Constant SUBSTYLE_DownWrong should be defined in uppercase
Open

    const SUBSTYLE_DownWrong  = 'DownWrong';
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

ConstantNamingConventions

Since: 0.2

Class/Interface constant names should always be defined in uppercase.

Example

class Foo {
    const MY_NUM = 0; // ok
    const myTest = ""; // fail
}

Source https://phpmd.org/rules/naming.html#constantnamingconventions

Constant SUBSTYLE_Left should be defined in uppercase
Open

    const SUBSTYLE_Left       = 'Left';
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

ConstantNamingConventions

Since: 0.2

Class/Interface constant names should always be defined in uppercase.

Example

class Foo {
    const MY_NUM = 0; // ok
    const myTest = ""; // fail
}

Source https://phpmd.org/rules/naming.html#constantnamingconventions

Constant SUBSTYLE_LeftGood should be defined in uppercase
Open

    const SUBSTYLE_LeftGood   = 'LeftGood';
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

ConstantNamingConventions

Since: 0.2

Class/Interface constant names should always be defined in uppercase.

Example

class Foo {
    const MY_NUM = 0; // ok
    const myTest = ""; // fail
}

Source https://phpmd.org/rules/naming.html#constantnamingconventions

Constant SUBSTYLE_Right should be defined in uppercase
Open

    const SUBSTYLE_Right      = 'Right';
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

ConstantNamingConventions

Since: 0.2

Class/Interface constant names should always be defined in uppercase.

Example

class Foo {
    const MY_NUM = 0; // ok
    const myTest = ""; // fail
}

Source https://phpmd.org/rules/naming.html#constantnamingconventions

Constant SUBSTYLE_UpGood should be defined in uppercase
Open

    const SUBSTYLE_UpGood     = 'UpGood';
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

ConstantNamingConventions

Since: 0.2

Class/Interface constant names should always be defined in uppercase.

Example

class Foo {
    const MY_NUM = 0; // ok
    const myTest = ""; // fail
}

Source https://phpmd.org/rules/naming.html#constantnamingconventions

Constant SUBSTYLE_Down should be defined in uppercase
Open

    const SUBSTYLE_Down       = 'Down';
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

ConstantNamingConventions

Since: 0.2

Class/Interface constant names should always be defined in uppercase.

Example

class Foo {
    const MY_NUM = 0; // ok
    const myTest = ""; // fail
}

Source https://phpmd.org/rules/naming.html#constantnamingconventions

Constant SUBSTYLE_DownGood should be defined in uppercase
Open

    const SUBSTYLE_DownGood   = 'DownGood';
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

ConstantNamingConventions

Since: 0.2

Class/Interface constant names should always be defined in uppercase.

Example

class Foo {
    const MY_NUM = 0; // ok
    const myTest = ""; // fail
}

Source https://phpmd.org/rules/naming.html#constantnamingconventions

Constant SUBSTYLE_RightWrong should be defined in uppercase
Open

    const SUBSTYLE_RightWrong = 'RightWrong';
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

ConstantNamingConventions

Since: 0.2

Class/Interface constant names should always be defined in uppercase.

Example

class Foo {
    const MY_NUM = 0; // ok
    const myTest = ""; // fail
}

Source https://phpmd.org/rules/naming.html#constantnamingconventions

Constant SUBSTYLE_LeftWrong should be defined in uppercase
Open

    const SUBSTYLE_LeftWrong  = 'LeftWrong';
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

ConstantNamingConventions

Since: 0.2

Class/Interface constant names should always be defined in uppercase.

Example

class Foo {
    const MY_NUM = 0; // ok
    const myTest = ""; // fail
}

Source https://phpmd.org/rules/naming.html#constantnamingconventions

Constant SUBSTYLE_UpWrong should be defined in uppercase
Open

    const SUBSTYLE_UpWrong    = 'UpWrong';
Severity: Minor
Found in FML/Controls/Quads/Quad_Copilot.php by phpmd

ConstantNamingConventions

Since: 0.2

Class/Interface constant names should always be defined in uppercase.

Example

class Foo {
    const MY_NUM = 0; // ok
    const myTest = ""; // fail
}

Source https://phpmd.org/rules/naming.html#constantnamingconventions

Class name "Quad_Copilot" is not in camel caps format
Open

class Quad_Copilot extends Quad

There are no issues that match your filters.

Category
Status