Kanti/htmly-installer

View on GitHub
src/HeaderTemplate.php

Summary

Maintainability
B
6 hrs
Test Coverage

Method printHeader has 170 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function printHeader($version = null)
    {
        if (true) : ?>
            <!DOCTYPE html>
            <html>
Severity: Major
Found in src/HeaderTemplate.php - About 6 hrs to fix

    The method printHeader() has 194 lines of code. Current threshold is set to 100. Avoid really long methods.
    Open

        public static function printHeader($version = null)
        {
            if (true) : ?>
                <!DOCTYPE html>
                <html>
    Severity: Minor
    Found in src/HeaderTemplate.php by phpmd

    The method printHeader uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

        <?php else : ?>
        HTMLy
    <?php endif; ?>
    Severity: Minor
    Found in src/HeaderTemplate.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Line exceeds 120 characters; contains 1602 characters
    Open

                          href="data:image/vnd.microsoft.icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABMLAAATCwAAAAAAAAAAAACVWQBclVkAsJVZAJGVWQAUlVkAAAAAAAAAAAAAu3EAALtxABa7cQCPu3EArrtxAKy7cQCsu3EArbtxAKW7cQBFlVkAyZVZAP+VWQD2lVkAQ5VZAAAAAAAAAAAAALtxAAC7cQBGu3EA97txAP+7cQD/u3EA/7txAP+7cQD/u3EAp5VZAMWVWQD/lVkA/5VZAHaVWQAAlVkAAAAAAAC7cQAAu3EATLtxAPq7cQD/u3EA/7txAP+7cQD/u3EA/7txALCVWQBBlVkAg5VZAKCVWQDLlVkAdJVZAECVWQAYtW0AALtxAEy7cQD6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AAAAAAAAEAAACBAAAAgQAAAIEAAACBAAAAgQAAAP8AAA=="
    Severity: Minor
    Found in src/HeaderTemplate.php by phpcodesniffer

    Line exceeds 120 characters; contains 129 characters
    Open

        <a href="<?php echo $version['html_url']; ?>" target="_blank"> HTMLy <small>/<?php echo $version['tag_name']; ?>/</a></small>
    Severity: Minor
    Found in src/HeaderTemplate.php by phpcodesniffer

    Closing brace indented incorrectly; expected 4 spaces, found 0
    Open

    <?php endif; ?>
    Severity: Minor
    Found in src/HeaderTemplate.php by phpcodesniffer

    Closing brace indented incorrectly; expected 0 spaces, found 4
    Open

        <?php else : ?>
    Severity: Minor
    Found in src/HeaderTemplate.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status