dsathyakumar/a11y-auditor

View on GitHub

Showing 50 of 129 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (a.hasAttribute(e)) {
                var f = a.getAttribute(e);
                c[e] = this.getAriaPropertyValue(e, f, a);
            }
Severity: Minor
Found in lib/axs/axsUtils.js and 1 other location - About 50 mins to fix
lib/axs/axsUtils.js on lines 571..574

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (a.hasAttribute(c)) {
                var d = a.getAttribute(c);
                b[c] = this.getAriaPropertyValue(c, d, a);
            }
Severity: Minor
Found in lib/axs/axsUtils.js and 1 other location - About 50 mins to fix
lib/axs/axsUtils.js on lines 534..537

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 51.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

module.exports = {
    name: 'isOpeningInNewTabOrPopUp',
    description: 'Until user agents allow users to turn off spawned windows, do not cause pop-ups or other windows to appear and do not change the current window without informing the user.',
    ruleID: 'AX_21',
    tagName: [
Severity: Major
Found in lib/rulesImpl/AX_21.js and 2 other locations - About 45 mins to fix
lib/rulesImpl/AX_01.js on lines 56..67
lib/rulesImpl/AX_29.js on lines 29..40

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

module.exports = {
    name: 'isBorIElementUsed',
    description: "Don't use the <B> and <I> tags. They are used to create a visual presentation effect",
    ruleID: 'AX_29',
    tagName: [
Severity: Major
Found in lib/rulesImpl/AX_29.js and 2 other locations - About 45 mins to fix
lib/rulesImpl/AX_01.js on lines 56..67
lib/rulesImpl/AX_21.js on lines 34..45

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

module.exports = {
    name: 'imageWithoutAltText',
    description: 'Images should have an alt attribute, unless they have an ARIA role of presentation',
    ruleID: 'AX_01',
    tagName: [
Severity: Major
Found in lib/rulesImpl/AX_01.js and 2 other locations - About 45 mins to fix
lib/rulesImpl/AX_21.js on lines 34..45
lib/rulesImpl/AX_29.js on lines 29..40

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 50.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'hasInlineStyles',
    description: 'Avoid using the style attribute and defining styles inline and move them to stylesheets instead',
    ruleID: 'AX_17',
    tagName: ['*'],
Severity: Major
Found in lib/rulesImpl/AX_17.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_03.js on lines 64..72
lib/rulesImpl/AX_04.js on lines 46..54
lib/rulesImpl/AX_06.js on lines 46..54
lib/rulesImpl/AX_08.js on lines 33..41
lib/rulesImpl/AX_09.js on lines 33..41
lib/rulesImpl/AX_10.js on lines 43..51
lib/rulesImpl/AX_11.js on lines 79..87
lib/rulesImpl/AX_15.js on lines 44..52
lib/rulesImpl/AX_20.js on lines 34..42
lib/rulesImpl/AX_25.js on lines 50..58
lib/rulesImpl/AX_28.js on lines 31..39
lib/rulesImpl/AX_30.js on lines 30..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'hasTextEquivalent',
    description: 'Provide text equivalent for every non-text element like OBJECT',
    ruleID: 'AX_30',
    tagName: ['OBJECT'],
Severity: Major
Found in lib/rulesImpl/AX_30.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_03.js on lines 64..72
lib/rulesImpl/AX_04.js on lines 46..54
lib/rulesImpl/AX_06.js on lines 46..54
lib/rulesImpl/AX_08.js on lines 33..41
lib/rulesImpl/AX_09.js on lines 33..41
lib/rulesImpl/AX_10.js on lines 43..51
lib/rulesImpl/AX_11.js on lines 79..87
lib/rulesImpl/AX_15.js on lines 44..52
lib/rulesImpl/AX_17.js on lines 29..37
lib/rulesImpl/AX_20.js on lines 34..42
lib/rulesImpl/AX_25.js on lines 50..58
lib/rulesImpl/AX_28.js on lines 31..39

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'isPreElementUsed',
    description: 'Check if PRE elements are used. Ensure that there are no TABLE based layouts in it',
    ruleID: 'AX_28',
    tagName: ['PRE'],
Severity: Major
Found in lib/rulesImpl/AX_28.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_03.js on lines 64..72
lib/rulesImpl/AX_04.js on lines 46..54
lib/rulesImpl/AX_06.js on lines 46..54
lib/rulesImpl/AX_08.js on lines 33..41
lib/rulesImpl/AX_09.js on lines 33..41
lib/rulesImpl/AX_10.js on lines 43..51
lib/rulesImpl/AX_11.js on lines 79..87
lib/rulesImpl/AX_15.js on lines 44..52
lib/rulesImpl/AX_17.js on lines 29..37
lib/rulesImpl/AX_20.js on lines 34..42
lib/rulesImpl/AX_25.js on lines 50..58
lib/rulesImpl/AX_30.js on lines 30..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'hasAbbr',
    description: 'Provide abbreviations for header labels',
    ruleID: 'AX_09',
    tagName: ['TH'],
Severity: Major
Found in lib/rulesImpl/AX_09.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_03.js on lines 64..72
lib/rulesImpl/AX_04.js on lines 46..54
lib/rulesImpl/AX_06.js on lines 46..54
lib/rulesImpl/AX_08.js on lines 33..41
lib/rulesImpl/AX_10.js on lines 43..51
lib/rulesImpl/AX_11.js on lines 79..87
lib/rulesImpl/AX_15.js on lines 44..52
lib/rulesImpl/AX_17.js on lines 29..37
lib/rulesImpl/AX_20.js on lines 34..42
lib/rulesImpl/AX_25.js on lines 50..58
lib/rulesImpl/AX_28.js on lines 31..39
lib/rulesImpl/AX_30.js on lines 30..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'isIdUnique',
    description: 'Check if element ID is unique',
    ruleID: 'AX_04',
    tagName: ['*'],
Severity: Major
Found in lib/rulesImpl/AX_04.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_03.js on lines 64..72
lib/rulesImpl/AX_06.js on lines 46..54
lib/rulesImpl/AX_08.js on lines 33..41
lib/rulesImpl/AX_09.js on lines 33..41
lib/rulesImpl/AX_10.js on lines 43..51
lib/rulesImpl/AX_11.js on lines 79..87
lib/rulesImpl/AX_15.js on lines 44..52
lib/rulesImpl/AX_17.js on lines 29..37
lib/rulesImpl/AX_20.js on lines 34..42
lib/rulesImpl/AX_25.js on lines 50..58
lib/rulesImpl/AX_28.js on lines 31..39
lib/rulesImpl/AX_30.js on lines 30..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'invalidAriaAttribute',
    description: 'The element has an invalid ARIA attribute',
    ruleID: 'AX_03',
    tagName: ['*'],
Severity: Major
Found in lib/rulesImpl/AX_03.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_04.js on lines 46..54
lib/rulesImpl/AX_06.js on lines 46..54
lib/rulesImpl/AX_08.js on lines 33..41
lib/rulesImpl/AX_09.js on lines 33..41
lib/rulesImpl/AX_10.js on lines 43..51
lib/rulesImpl/AX_11.js on lines 79..87
lib/rulesImpl/AX_15.js on lines 44..52
lib/rulesImpl/AX_17.js on lines 29..37
lib/rulesImpl/AX_20.js on lines 34..42
lib/rulesImpl/AX_25.js on lines 50..58
lib/rulesImpl/AX_28.js on lines 31..39
lib/rulesImpl/AX_30.js on lines 30..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'hasSummary',
    description: 'Provide summaries for tables',
    ruleID: 'AX_08',
    tagName: ['TABLE'],
Severity: Major
Found in lib/rulesImpl/AX_08.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_03.js on lines 64..72
lib/rulesImpl/AX_04.js on lines 46..54
lib/rulesImpl/AX_06.js on lines 46..54
lib/rulesImpl/AX_09.js on lines 33..41
lib/rulesImpl/AX_10.js on lines 43..51
lib/rulesImpl/AX_11.js on lines 79..87
lib/rulesImpl/AX_15.js on lines 44..52
lib/rulesImpl/AX_17.js on lines 29..37
lib/rulesImpl/AX_20.js on lines 34..42
lib/rulesImpl/AX_25.js on lines 50..58
lib/rulesImpl/AX_28.js on lines 31..39
lib/rulesImpl/AX_30.js on lines 30..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'hasValidAriaRole',
    description: 'Elements with ARIA roles must use a valid, non-abstract ARIA role.',
    ruleID: 'AX_11',
    tagName: ['*'],
Severity: Major
Found in lib/rulesImpl/AX_11.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_03.js on lines 64..72
lib/rulesImpl/AX_04.js on lines 46..54
lib/rulesImpl/AX_06.js on lines 46..54
lib/rulesImpl/AX_08.js on lines 33..41
lib/rulesImpl/AX_09.js on lines 33..41
lib/rulesImpl/AX_10.js on lines 43..51
lib/rulesImpl/AX_15.js on lines 44..52
lib/rulesImpl/AX_17.js on lines 29..37
lib/rulesImpl/AX_20.js on lines 34..42
lib/rulesImpl/AX_25.js on lines 50..58
lib/rulesImpl/AX_28.js on lines 31..39
lib/rulesImpl/AX_30.js on lines 30..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'isRoleMainOnSignificantElement',
    description: 'role=main must be present on significant elements only',
    ruleID: 'AX_25',
    tagName: ['*'],
Severity: Major
Found in lib/rulesImpl/AX_25.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_03.js on lines 64..72
lib/rulesImpl/AX_04.js on lines 46..54
lib/rulesImpl/AX_06.js on lines 46..54
lib/rulesImpl/AX_08.js on lines 33..41
lib/rulesImpl/AX_09.js on lines 33..41
lib/rulesImpl/AX_10.js on lines 43..51
lib/rulesImpl/AX_11.js on lines 79..87
lib/rulesImpl/AX_15.js on lines 44..52
lib/rulesImpl/AX_17.js on lines 29..37
lib/rulesImpl/AX_20.js on lines 34..42
lib/rulesImpl/AX_28.js on lines 31..39
lib/rulesImpl/AX_30.js on lines 30..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'hasCaption',
    description: 'Provide a caption via the CAPTION element. A table CAPTION describes the table in one to three sentences',
    ruleID: 'AX_10',
    tagName: ['TABLE'],
Severity: Major
Found in lib/rulesImpl/AX_10.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_03.js on lines 64..72
lib/rulesImpl/AX_04.js on lines 46..54
lib/rulesImpl/AX_06.js on lines 46..54
lib/rulesImpl/AX_08.js on lines 33..41
lib/rulesImpl/AX_09.js on lines 33..41
lib/rulesImpl/AX_11.js on lines 79..87
lib/rulesImpl/AX_15.js on lines 44..52
lib/rulesImpl/AX_17.js on lines 29..37
lib/rulesImpl/AX_20.js on lines 34..42
lib/rulesImpl/AX_25.js on lines 50..58
lib/rulesImpl/AX_28.js on lines 31..39
lib/rulesImpl/AX_30.js on lines 30..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'isAriaOnReservedElement',
    description: 'This element does not support ARIA roles, states and properties',
    ruleID: 'AX_15',
    tagName: ['*'],
Severity: Major
Found in lib/rulesImpl/AX_15.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_03.js on lines 64..72
lib/rulesImpl/AX_04.js on lines 46..54
lib/rulesImpl/AX_06.js on lines 46..54
lib/rulesImpl/AX_08.js on lines 33..41
lib/rulesImpl/AX_09.js on lines 33..41
lib/rulesImpl/AX_10.js on lines 43..51
lib/rulesImpl/AX_11.js on lines 79..87
lib/rulesImpl/AX_17.js on lines 29..37
lib/rulesImpl/AX_20.js on lines 34..42
lib/rulesImpl/AX_25.js on lines 50..58
lib/rulesImpl/AX_28.js on lines 31..39
lib/rulesImpl/AX_30.js on lines 30..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'isIdInIdRefUnique',
    description: 'Any ID referred to via an IDREF must be unique in the DOM',
    ruleID: 'AX_06',
    tagName: ['*'],
Severity: Major
Found in lib/rulesImpl/AX_06.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_03.js on lines 64..72
lib/rulesImpl/AX_04.js on lines 46..54
lib/rulesImpl/AX_08.js on lines 33..41
lib/rulesImpl/AX_09.js on lines 33..41
lib/rulesImpl/AX_10.js on lines 43..51
lib/rulesImpl/AX_11.js on lines 79..87
lib/rulesImpl/AX_15.js on lines 44..52
lib/rulesImpl/AX_17.js on lines 29..37
lib/rulesImpl/AX_20.js on lines 34..42
lib/rulesImpl/AX_25.js on lines 50..58
lib/rulesImpl/AX_28.js on lines 31..39
lib/rulesImpl/AX_30.js on lines 30..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 13 locations. Consider refactoring.
Open

module.exports = {
    name: 'hasAutoRefresh',
    description: 'Until user agents provide the ability to stop the refresh, do not create periodically auto-refreshing / auto re-direct pages',
    ruleID: 'AX_20',
    tagName: ['META'],
Severity: Major
Found in lib/rulesImpl/AX_20.js and 12 other locations - About 40 mins to fix
lib/rulesImpl/AX_03.js on lines 64..72
lib/rulesImpl/AX_04.js on lines 46..54
lib/rulesImpl/AX_06.js on lines 46..54
lib/rulesImpl/AX_08.js on lines 33..41
lib/rulesImpl/AX_09.js on lines 33..41
lib/rulesImpl/AX_10.js on lines 43..51
lib/rulesImpl/AX_11.js on lines 79..87
lib/rulesImpl/AX_15.js on lines 44..52
lib/rulesImpl/AX_17.js on lines 29..37
lib/rulesImpl/AX_25.js on lines 50..58
lib/rulesImpl/AX_28.js on lines 31..39
lib/rulesImpl/AX_30.js on lines 30..38

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 49.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

module.exports = {
    name: 'hasLangAttribute',
    description: "The web page should have the content's human language indicated in the markup. Identify the primary natural language of the document",
    ruleID: 'AX_12',
    tagName: [],
Severity: Major
Found in lib/rulesImpl/AX_12.js and 7 other locations - About 40 mins to fix
lib/rulesImpl/AX_07.js on lines 41..49
lib/rulesImpl/AX_13.js on lines 32..40
lib/rulesImpl/AX_16.js on lines 44..52
lib/rulesImpl/AX_22.js on lines 32..40
lib/rulesImpl/AX_24.js on lines 56..64
lib/rulesImpl/AX_26.js on lines 44..52
lib/rulesImpl/AX_27.js on lines 44..52

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 8 locations. Consider refactoring.
Open

module.exports = {
    name: 'hasHeaderElementDefined',
    description: 'Check if there is atleast one header section / element for the page content that defines its purpose & context',
    ruleID: 'AX_24',
    tagName: [],
Severity: Major
Found in lib/rulesImpl/AX_24.js and 7 other locations - About 40 mins to fix
lib/rulesImpl/AX_07.js on lines 41..49
lib/rulesImpl/AX_12.js on lines 34..42
lib/rulesImpl/AX_13.js on lines 32..40
lib/rulesImpl/AX_16.js on lines 44..52
lib/rulesImpl/AX_22.js on lines 32..40
lib/rulesImpl/AX_26.js on lines 44..52
lib/rulesImpl/AX_27.js on lines 44..52

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 48.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language