pixijs/pixi-haxe

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

Summary

Maintainability
Test Coverage

Method _draw length is 55 lines (max allowed is 50)
Open

    function _draw() {
        if (_videoElement.paused || _videoElement.ended) return;
        //_context.drawImage(_videoElement, 0, 200, 480, 50, 0, 0, 480, 50);

        _context.drawImage(_videoElement, 0, 384, 400, 16, 0, 0, 400, 16);
Severity: Critical
Found in samples/src/stream/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.

0x003366 is a magic number
Open

        options.backgroundColor = 0x003366;

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

400 is a magic number
Open

        _playBtn.height = 400;

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

400 is a magic number
Open

        _canvas.width = 400;

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

                var uri:Array<String> = subtitles[5].split('=');

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

400 is a magic number
Open

        _context.drawImage(_videoElement, 0, 384, 400, 16, 0, 0, 400, 16);

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

16 is a magic number
Open

        _context.drawImage(_videoElement, 0, 384, 400, 16, 0, 0, 400, 16);

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

160 is a magic number
Open

                if (lines != null && lines[4] != null && lines[4].charCodeAt(0) != 160) {

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

400 is a magic number
Open

        _playBtn.width = 400;

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

384 is a magic number
Open

        _context.drawImage(_videoElement, 0, 384, 400, 16, 0, 0, 400, 16);

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

400 is a magic number
Open

        _context.drawImage(_videoElement, 0, 384, 400, 16, 0, 0, 400, 16);

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

16 is a magic number
Open

        _canvas.height = 16;

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

                var webVTT = lines[5];

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

16 is a magic number
Open

        _context.drawImage(_videoElement, 0, 384, 400, 16, 0, 0, 400, 16);

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

String absolute appears 3 times in the file
Open

        _canvas.style.position = "absolute";
Severity: Minor
Found in samples/src/stream/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 http://93.93.85.123:1935/live/ appears 3 times in the file
Open

                var subtitleUrl = 'http://93.93.85.123:1935/live/' + movie + '/' + webVTT;
Severity: Minor
Found in samples/src/stream/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 GET appears 3 times in the file
Open

            subtitlePlaylistRequest.open('GET', subtitlePlaylistUrl, true);
Severity: Minor
Found in samples/src/stream/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 member signature: movie (name should be ~/^_[a-z][a-zA-Z0-9]*$/)
Open

    var movie:String;

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

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

    var subtitlePlaylistUrl:String;

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

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