pixijs/pixi-haxe

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

Summary

Maintainability
Test Coverage

128 is a magic number
Open

                else _img.position.set(128 * (i - 5), 128);

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

5 is a magic number
Open

            else _img.position.set(128 * (i - 5), 128);

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

5 is a magic number
Open

                else _img.position.set(128 * (i - 5), 128);

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

        for (i in 0 ... 10) {

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

24 is a magic number
Open

        style.fontSize = 24;

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

6 is a magic number
Open

            if (i < 6) _img.position.set(128 * i, 0);

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

128 is a magic number
Open

            else _img.position.set(128 * (i - 5), 128);

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

128 is a magic number
Open

                else _img.position.set(128 * (i - 5), 128);

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

            for (i in 0 ... 10) {

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

128 is a magic number
Open

            if (i < 6) _img.position.set(128 * i, 0);

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

128 is a magic number
Open

                if (i < 6) _img.position.set(128 * i, 0);

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

6 is a magic number
Open

                if (i < 6) _img.position.set(128 * i, 0);

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

        for (i in 0 ... 50) _loader.add("img" + (i + 1), (i + 1) + ".png");

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

128 is a magic number
Open

            else _img.position.set(128 * (i - 5), 128);

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

        style.fill = 0x003366;

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

String .png appears 3 times in the file
Open

                Reflect.setField(Utils.TextureCache, (i + 1) + ".png", texture);
Severity: Minor
Found in samples/src/loader/Main.hx by haxe-checkstyle

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 Loaded: appears 3 times in the file
Open

            _label.text = "Loaded: " + Math.round(progress * 100) + "%";
Severity: Minor
Found in samples/src/loader/Main.hx by haxe-checkstyle

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 secs appears 3 times in the file
Open

        _label.text += "\nLoad Time: " + (_loadTime / 1000) + " secs";
Severity: Minor
Found in samples/src/loader/Main.hx by haxe-checkstyle

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 .png appears 4 times in the file
Open

        for (i in 0 ... 50) _loader.add("img" + (i + 1), (i + 1) + ".png");
Severity: Minor
Found in samples/src/loader/Main.hx by haxe-checkstyle

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 .png appears 5 times in the file
Open

            _img = new Sprite(Texture.fromImage(_baseURL + (i + 1) + ".png"));
Severity: Minor
Found in samples/src/loader/Main.hx by haxe-checkstyle

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 Load Time: appears 3 times in the file
Open

        _label.text += "\nLoad Time: " + (_loadTime / 1000) + " secs";
Severity: Minor
Found in samples/src/loader/Main.hx by haxe-checkstyle

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 Loaded: appears 4 times in the file
Open

        _label.text = "Loaded: " + Math.round(_loader.progress) + "%";
Severity: Minor
Found in samples/src/loader/Main.hx by haxe-checkstyle

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 img appears 3 times in the file
Open

            _img.name = "img" + (i + 1);
Severity: Minor
Found in samples/src/loader/Main.hx by haxe-checkstyle

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.

Invalid local var signature: _container (name should be ~/^[a-z][a-zA-Z0-9]*$/)
Open

            var _container:Container = new Container();

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

Unused import js.html.URL detected
Open

import js.html.URL;

Checks for unused or duplicate imports.

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.

Invalid local var signature: _container (name should be ~/^[a-z][a-zA-Z0-9]*$/)
Open

        var _container:Container = new Container();

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

There are no issues that match your filters.

Category
Status