pixijs/pixi-haxe

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

Summary

Maintainability
Test Coverage

Method _init length is 54 lines (max allowed is 50)
Open

    function _init() {
        position = "fixed";
        backgroundColor = 0x003366;
        antialias = true;
        onUpdate = _onUpdate;
Severity: Critical
Found in samples/src/graphics/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.

50 is a magic number
Open

        _graphics.lineTo(50, 50);

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

210 is a magic number
Open

        _graphics.moveTo(210, 300);

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

320 is a magic number
Open

        _graphics.lineTo(450, 320);

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

350 is a magic number
Open

        _graphics.lineTo(570, 350);

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

        _count += 0.1;

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

580 is a magic number
Open

        _graphics.lineTo(580, 20);

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

10 is a magic number
Open

        _graphics.lineStyle(10, 0xffd900, 1);

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

330 is a magic number
Open

        _graphics.lineTo(330, 120);

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

30 is a magic number
Open

        _graphics.moveTo(30, 30);

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

10 is a magic number
Open

        _graphics.lineStyle(10, 0xFF0000, 0.8);

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

0xFF0000 is a magic number
Open

        _graphics.lineStyle(10, 0xFF0000, 0.8);

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

0x33FF00 is a magic number
Open

        _graphics.lineStyle(20, 0x33FF00);

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

30 is a magic number
Open

        _thing.lineStyle(30, 0xFF0000, 1);

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

450 is a magic number
Open

        _graphics.lineTo(450, 320);

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

20 is a magic number
Open

        _graphics.lineTo(580, 20);

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

120 is a magic number
Open

        _graphics.lineTo(330, 120);

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

250 is a magic number
Open

        _graphics.lineTo(250, 50);

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

0xFFFF0B is a magic number
Open

        _graphics.beginFill(0xFFFF0B, 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

        _thing.beginFill(0xFF0000, 0.5);

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

-100 is a magic number
Open

        _thing.moveTo(-120 + Math.sin(_count) * 20, -100 + Math.cos(_count) * 20);

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

50 is a magic number
Open

        _graphics.moveTo(50, 50);

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

220 is a magic number
Open

        _graphics.lineTo(250, 220);

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

0.8 is a magic number
Open

        _graphics.lineStyle(10, 0xFF0000, 0.8);

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

600 is a magic number
Open

        _graphics.lineTo(600, 300);

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.

20 is a magic number
Open

        _thing.moveTo(-120 + Math.sin(_count) * 20, -100 + Math.cos(_count) * 20);

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

-100 is a magic number
Open

        _thing.lineTo(120 + Math.cos(_count) * 20, -100 + Math.sin(_count) * 20);

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

20 is a magic number
Open

        _thing.lineTo(-120 + Math.cos(_count) * 20, 100 + Math.sin(_count) * 20);

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

220 is a magic number
Open

        _graphics.lineTo(50, 220);

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

20 is a magic number
Open

        _graphics.lineStyle(20, 0x33FF00);

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

30 is a magic number
Open

        _graphics.moveTo(30, 30);

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

0xFF0000 is a magic number
Open

        _thing.beginFill(0xFF0000, 0.5);

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

410 is a magic number
Open

        _graphics.lineTo(410, 200);

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

210 is a magic number
Open

        _graphics.lineTo(210, 300);

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

        _graphics.beginFill(0xFFFF0B, 0.5);

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

470 is a magic number
Open

        _graphics.drawCircle(470, 200, 100);

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

-120 is a magic number
Open

        _thing.moveTo(-120 + Math.sin(_count) * 20, -100 + Math.cos(_count) * 20);

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

30 is a magic number
Open

        _graphics.lineStyle(Math.random() * 30, Std.int(Math.random() * 0xFFFFFF), 1);

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

620 is a magic number
Open

        _graphics.lineTo(Math.random() * 620, Math.random() * 380);

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

0xffd900 is a magic number
Open

        _graphics.lineStyle(10, 0xffd900, 1);

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

50 is a magic number
Open

        _graphics.moveTo(50, 50);

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

50 is a magic number
Open

        _graphics.drawRect(50, 250, 100, 100);

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

20 is a magic number
Open

        _thing.moveTo(-120 + Math.sin(_count) * 20, -100 + Math.cos(_count) * 20);

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

20 is a magic number
Open

        _thing.lineTo(120 + Math.cos(_count) * 20, -100 + Math.sin(_count) * 20);

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

-120 is a magic number
Open

        _thing.lineTo(-120 + Math.sin(_count) * 20, -100 + Math.cos(_count) * 20);

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

20 is a magic number
Open

        _thing.lineTo(-120 + Math.sin(_count) * 20, -100 + Math.cos(_count) * 20);

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

620 is a magic number
Open

        _graphics.moveTo(Math.random() * 620, Math.random() * 380);

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

300 is a magic number
Open

        _graphics.moveTo(210, 300);

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

250 is a magic number
Open

        _graphics.drawRect(50, 250, 100, 100);

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

0xFF3300 is a magic number
Open

        _graphics.beginFill(0xFF3300);

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

250 is a magic number
Open

        _graphics.lineTo(250, 220);

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

50 is a magic number
Open

        _graphics.lineTo(50, 220);

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

0x0000FF is a magic number
Open

        _graphics.lineStyle(2, 0x0000FF, 1);

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

300 is a magic number
Open

        _graphics.lineTo(600, 300);

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

0xFF0000 is a magic number
Open

        _thing.lineStyle(30, 0xFF0000, 1);

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

380 is a magic number
Open

        _graphics.moveTo(Math.random() * 620, Math.random() * 380);

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

50 is a magic number
Open

        _graphics.lineTo(250, 50);

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

50 is a magic number
Open

        _graphics.lineTo(50, 50);

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

300 is a magic number
Open

        _graphics.lineTo(210, 300);

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

120 is a magic number
Open

        _thing.lineTo(120 + Math.sin(_count) * 20, 100 + Math.cos(_count) * 20);

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

-120 is a magic number
Open

        _thing.lineTo(-120 + Math.cos(_count) * 20, 100 + Math.sin(_count) * 20);

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

20 is a magic number
Open

        _thing.lineTo(-120 + Math.sin(_count) * 20, -100 + Math.cos(_count) * 20);

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

        _thing.rotation = _count * 0.1;

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

0xFF700B is a magic number
Open

        _graphics.beginFill(0xFF700B, 1);

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

570 is a magic number
Open

        _graphics.lineTo(570, 350);

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

20 is a magic number
Open

        _thing.lineTo(120 + Math.cos(_count) * 20, -100 + Math.sin(_count) * 20);

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

20 is a magic number
Open

        _thing.lineTo(120 + Math.sin(_count) * 20, 100 + Math.cos(_count) * 20);

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

120 is a magic number
Open

        _thing.lineTo(120 + Math.cos(_count) * 20, -100 + Math.sin(_count) * 20);

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

-100 is a magic number
Open

        _thing.lineTo(-120 + Math.sin(_count) * 20, -100 + Math.cos(_count) * 20);

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

0xFFFFFF is a magic number
Open

        _graphics.lineStyle(Math.random() * 30, Std.int(Math.random() * 0xFFFFFF), 1);

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

380 is a magic number
Open

        _graphics.lineTo(Math.random() * 620, Math.random() * 380);

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

20 is a magic number
Open

        _thing.lineTo(120 + Math.sin(_count) * 20, 100 + Math.cos(_count) * 20);

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

20 is a magic number
Open

        _thing.lineTo(-120 + Math.cos(_count) * 20, 100 + Math.sin(_count) * 20);

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

Bad hexadecimal literal, use upperCase
Open

        _graphics.lineStyle(10, 0xffd900, 1);

Checks the letter case of hexadecimal literals.

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