pixijs/pixi-haxe

View on GitHub
samples/src/dragonbones/Main.hx

Summary

Maintainability
Test Coverage

Method _replaceDisplay length is 74 lines (max allowed is 50)
Open

    function _replaceDisplay() {
        _displayIndex = (_displayIndex + 1) % _replaceDisplays.length;

        var replaceDisplayName = _replaceDisplays[_displayIndex];

Severity: Critical
Found in samples/src/dragonbones/Main.hx by haxe-checkstyle

Checks for long methods. If a method becomes very long it is hard to understand. Therefore long methods should usually be refactored into several individual methods that focus on a specific task.

0.5 is a magic number
Open

        _armatureDisplay2.x = renderer.width * 0.5;

Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

0.5 is a magic number
Open

        _armatureDisplay1.y = renderer.height * 0.5 + 100;

Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

0x003366 is a magic number
Open

        backgroundColor = 0x003366;

Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

0.5 is a magic number
Open

        _armatureDisplay2.y = renderer.height * 0.5;

Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

0.1 is a magic number
Open

        _armatureDisplay2.animation.timeScale = 0.1;

Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

0.5 is a magic number
Open

        _armatureDisplay1.x = renderer.width * 0.5;

Checks that there are no magic numbers. By default, -1, 0, 1, and 2 are not considered to be magic numbers.

String mesh appears 4 times in the file
Open

                        _armatureDisplay2.armature.getSlot("mesh")

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String ReplaceSlotDisplay appears 4 times in the file
Open

                        "ReplaceSlotDisplay",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String meshA appears 3 times in the file
Open

                        "meshA",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String ReplaceSlotDisplay appears 3 times in the file
Open

                        "ReplaceSlotDisplay",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String mesh appears 6 times in the file
Open

                        "mesh",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String weapon_1004_1 appears 3 times in the file
Open

                        "weapon_1004_1",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String MyDisplay appears 4 times in the file
Open

                "MyDisplay",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String mesh appears 3 times in the file
Open

                        _armatureDisplay2.armature.getSlot("mesh")

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String MyMesh appears 3 times in the file
Open

                        "MyMesh",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String MyDisplay appears 3 times in the file
Open

                        "MyDisplay",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String meshB appears 3 times in the file
Open

                        "meshB",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String ball appears 5 times in the file
Open

                _armatureDisplay2.armature.getSlot("ball")

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String ReplaceSlotDisplay appears 5 times in the file
Open

                        "ReplaceSlotDisplay",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String ball appears 4 times in the file
Open

                "ball",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String mesh appears 5 times in the file
Open

                case "mesh":

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String weapon appears 3 times in the file
Open

                        _armatureDisplay2.armature.getSlot("weapon")

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String ReplaceSlotDisplay appears 6 times in the file
Open

                        "ReplaceSlotDisplay",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String ball appears 3 times in the file
Open

                        "ball",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String ReplaceSlotDisplay appears 7 times in the file
Open

                "ReplaceSlotDisplay",

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

String mesh appears 7 times in the file
Open

                        _armatureDisplay2.armature.getSlot("mesh")

Checks for multiple occurrences of the same string literal within a single file. Code duplication makes maintenance more difficult, so it's better to replace the multiple occurrences with a constant.

Too many consecutive empty lines (> 1)
Open


Checks for consecutive empty lines (default is 1). Also have options to check empty line separators after package, single-line and multi-line comments and class/interface/abstract declarations.

Invalid method name signature: main (name should be ~/^_[a-z][a-zA-Z0-9]*$/)
Open

    static function main() {
        new Main();
    }

Checks that method names conform to a format specified by the format property.

There are no issues that match your filters.

Category
Status