pixijs/pixi-haxe

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

Summary

Maintainability
Test Coverage

Line is longer than 160 characters (found 181)
Open

            log("RGBA Bits", "[" + gl.getParameter(gl.RED_BITS) + ", " + gl.getParameter(gl.GREEN_BITS) + ", " + gl.getParameter(gl.BLUE_BITS) + ", " + gl.getParameter(gl.ALPHA_BITS) + "]");
Severity: Critical
Found in samples/src/webglinfo/Main.hx by haxe-checkstyle

Checks for long lines. Long lines are hard to read.

String , appears 3 times in the file
Open

            log("RGBA Bits", "[" + gl.getParameter(gl.RED_BITS) + ", " + gl.getParameter(gl.GREEN_BITS) + ", " + gl.getParameter(gl.BLUE_BITS) + ", " + gl.getParameter(gl.ALPHA_BITS) + "]");

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

            log("Depth & Stencil Bits", "[" + gl.getParameter(gl.DEPTH_BITS) + ", " + gl.getParameter(gl.STENCIL_BITS) + "]");

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

                log("Max Anisotropy", gl.getParameter(gl.getExtension("MOZ_EXT_texture_filter_anisotropic").MAX_TEXTURE_MAX_ANISOTROPY_EXT));

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

Right curly should be alone on a new line
Open

                } catch (e:Dynamic) {}

Checks the placement of right curly braces (}) for code blocks. The policy to verify is specified using the property option.

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

    var contextName:String;

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

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

    function log(msg:String, ?val:String = "") {
        Browser.window.document.writeln(msg + ": <b>" + val + "</b><br/>");
    }

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

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

    function displayWebGLProperties() {
        if (contextName != "") {
            var gl = Browser.document.createCanvasElement().getContext(contextName);
            log("WebGL Version", gl.getParameter(gl.VERSION));
            log("Shading Language Version", gl.getParameter(gl.SHADING_LANGUAGE_VERSION));

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

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

    function detectWebGL(?props:Dynamic):Bool {
        var ctx = Reflect.field(Browser.window, "WebGLRenderingContext");
        if (ctx != null) {
            var canvas:CanvasElement = Browser.document.createCanvasElement();
            var supportedContextNames:Array<String> = ["webgl", "experimental-webgl"];

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

There are no issues that match your filters.

Category
Status