htmlchecker 1.2.2 - Lint Report

Thu Jan 30 22:32:23 CET 2020

site-example/src/main/resources/site

Verified rules

  • LOCAL_SCRIPT_TAG_RULE
  • LOCAL_IMG_TAG_RULE
  • LOCAL_A_TAG_RULE
  • LOCAL_LINK_TAG_RULE

Violations

Violation Name Category Number of Violations
LOCAL_A_TAG_RULE HtmlChecker-Local 4
LOCAL_IMG_TAG_RULE HtmlChecker-Local 1
LOCAL_LINK_TAG_RULE HtmlChecker-Local 2
LOCAL_SCRIPT_TAG_RULE HtmlChecker-Local 1
There are 0 warnings, 8 errors, and 0 fatal errors (8 total).

HtmlChecker-Local

ERROR LOCAL_A_TAG_RULE violated in index.html on line 15

File 'page2.html' (relative to 'index.html') referenced by the 'href' attribute in the 'a' tag is missing

ERROR LOCAL_A_TAG_RULE violated in index.html on line 17

Anchor 'p2' referenced in the 'href' attribute in the 'a' tag is missing in file 'index.html'

ERROR LOCAL_A_TAG_RULE violated in index.html on line 19

Anchor 'xyz' referenced in the 'href' attribute in the 'a' tag is missing in file 'page1.html' (relative to 'index.html')

ERROR LOCAL_A_TAG_RULE violated in index.html on line 20

File 'page2.html' (relative to 'index.html') referenced by the 'href' attribute in the 'a' tag is missing

ERROR LOCAL_IMG_TAG_RULE violated in index.html on line 23

File 'img/pict2.png' (relative to 'index.html') referenced by the 'src' attribute in the 'img' tag is missing

ERROR LOCAL_LINK_TAG_RULE violated in index.html on line 5

File 'css/style2.css' (relative to 'index.html') referenced by the 'href' attribute in the 'link' tag is missing

ERROR LOCAL_LINK_TAG_RULE violated in index.html on line 6

File 'favicon.ico' (relative to 'index.html') referenced by the 'href' attribute in the 'link' tag is missing

ERROR LOCAL_SCRIPT_TAG_RULE violated in index.html on line 8

File 'js/script2.js' (relative to 'index.html') referenced by the 'src' attribute in the 'script' tag is missing

Rule Descriptions

LOCAL_SCRIPT_TAG_RULE HtmlChecker-Local
Rule Name LOCAL_SCRIPT_TAG_RULE
Summary Local file should be present
Severity ERROR
Category HtmlChecker-Local
Enabled by default? Yes

All local files referenced by the src attribute of the <script> tag should exist.

With this small site structure:

site
|   index.html
|   page1.html
|
+---css
|       style1.css
|
+---img
|       pict1.png
|
\---js
        script1.js

If index.html contains this content:

<head>
    <!-- ... -->
    <script type="text/javascript" src="js/script1.js"></script>
    <script src="js/script2.js"></script>
    <!-- ... -->
</head>

The first <script> tag does not trigger any ERROR, because the file js/script1.js exists.

The second <script> tag triggers an ERROR, because there is no file js/script2.js.

Remote resources (for example starting with https://) are not checked by this rule.

LOCAL_IMG_TAG_RULE HtmlChecker-Local
Rule Name LOCAL_IMG_TAG_RULE
Summary Local file should be present
Severity ERROR
Category HtmlChecker-Local
Enabled by default? Yes

All local files referenced by the src attribute of the <img> tag should exist.

With this small site structure:

site
|   index.html
|   page1.html
|
+---css
|       style1.css
|
+---img
|       pict1.png
|
\---js
        script1.js

If index.html contains this content:

<body>
    <!-- ... -->
    <p>First image: <img src="img/pict1.png" />.</p>
    <p>Second image: <img src="img/pict2.png" />.</p>
    <!-- ... -->
</body>

The first <img> tag does not trigger any ERROR, because the file img/pict1.png exists.

The second <img> tag triggers an ERROR, because there is no file img/pict2.png.

Remote resources (for example starting with https://) are not checked by this rule.

LOCAL_LINK_TAG_RULE HtmlChecker-Local
Rule Name LOCAL_LINK_TAG_RULE
Summary Local file should be present
Severity ERROR
Category HtmlChecker-Local
Enabled by default? Yes

All local files referenced by the href attribute of the <link> tag should exist.

With this small site structure:

site
|   index.html
|   page1.html
|
+---css
|       style1.css
|
+---img
|       pict1.png
|
\---js
        script1.js

If index.html contains this content:

<head>
    <link rel="stylesheet" href="css/style1.css">
    <link rel="stylesheet" href="css/style2.css">
    <!-- ... -->
</head>

The first <link> tag does not trigger any ERROR, because the file css/style1.css exists.

The second <link> tag triggers an ERROR, because there is no file css/style2.css.

Remote resources (for example starting with https://) are not checked by this rule.

LOCAL_A_TAG_RULE HtmlChecker-Local
Rule Name LOCAL_A_TAG_RULE
Summary Local file should be present
Severity ERROR
Category HtmlChecker-Local
Enabled by default? Yes

All local files referenced by the href attribute of the <a> tag should exist.

With this small site structure:

site
|   index.html
|   page1.html
|
+---css
|       style1.css
|
+---img
|       pict1.png
|
\---js
        script1.js

If index.html contains this content:

<body>
    <!-- ... -->
    <p>Link to a <a href="page1.html">page</a>.</p>
    <p>Link to a <a href="page1.html#abc">page with anchor</a>.</p>
    <p>Link to an <a href="page2.html">other page</a>.</p>
    <p>Link to a <a href="page1.html#xyz">page with wrong anchor</a>.</p>
    <!-- ... -->
<body>

The first <a> tag does not trigger any ERROR, because the file page1.html exists. If page1.html contains the anchor abc then the link page1.html#abc is also valid, and no ERROR is created for the second <a> tag.

The third <a> tag triggers an ERROR, because there is no file page2.html. If page1.html does not contain the anchor xyz, the fourth <a> tag triggers an ERROR.

Remote files (for example starting with https://) are not checked by this rule.