christophehurpeau/html-document

View on GitHub

Showing 58 of 58 total issues

Function constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    constructor(type, mouseEventInit) {
        mouseEventInit = extend(true, {
            screenX: 0,
            screenY: 0,
            clientX: 0,
Severity: Minor
Found in src/MouseEvent.js - About 1 hr to fix

    Function processSelectors has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function* processSelectors(element, selectors) {
        for (let selector of selectors) {
            const rule = selector.rule;
    
            if (!matchRule(element, rule)) {
    Severity: Minor
    Found in src/utils/querySelectorHelper.js - About 1 hr to fix

      Function rows has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          get rows() {
              const result = [];
              if (this.tHead !== null) {
                  this.tHead.children.forEach((element) => {
                      if (element.tagName === 'tr') {
      Severity: Minor
      Found in src/HTMLElement/elements/HTMLTableElement.js - About 1 hr to fix

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

                if (tBodies.length === 0) {
                    tBody = this._createTBody();
                } else {
                    tBody = tBodies[tBodies.length - 1];
                }
        Severity: Minor
        Found in src/HTMLElement/elements/HTMLTableElement.js and 1 other location - About 50 mins to fix
        src/HTMLElement/elements/HTMLTableElement.js on lines 337..341

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

        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

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

                    if (tBodies.length === 0) {
                        tBody = this._createTBody();
                    } else {
                        tBody = tBodies[tBodies.length - 1];
                    }
        Severity: Minor
        Found in src/HTMLElement/elements/HTMLTableElement.js and 1 other location - About 50 mins to fix
        src/HTMLElement/elements/HTMLTableElement.js on lines 313..317

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

        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

            set host(value) {
                this._href.host = value;
                this._setAttribute('href', this._href.toString());
            }
        Severity: Major
        Found in src/HTMLElement/elements/HTMLAnchorElement.js and 2 other locations - About 50 mins to fix
        src/HTMLElement/elements/HTMLAnchorElement.js on lines 117..120
        src/HTMLElement/elements/HTMLAnchorElement.js on lines 153..156

        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

            set hostname(value) {
                this._href.hostname = value;
                this._setAttribute('href', this._href.toString());
            }
        Severity: Major
        Found in src/HTMLElement/elements/HTMLAnchorElement.js and 2 other locations - About 50 mins to fix
        src/HTMLElement/elements/HTMLAnchorElement.js on lines 99..102
        src/HTMLElement/elements/HTMLAnchorElement.js on lines 153..156

        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

            set vAlign(value) {
                if (['top', 'middle', 'bottom', 'baseline'].indexOf(value) !== -1) {
                    this.setAttribute('valign', value);
                }
            }
        Severity: Minor
        Found in src/HTMLElement/elements/HTMLTableSectionElement.js and 1 other location - About 50 mins to fix
        src/HTMLElement/elements/HTMLTableRowElement.js on lines 50..54

        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

            set pathname(value) {
                this._href.pathname = value;
                this._setAttribute('href', this._href.toString());
            }
        Severity: Major
        Found in src/HTMLElement/elements/HTMLAnchorElement.js and 2 other locations - About 50 mins to fix
        src/HTMLElement/elements/HTMLAnchorElement.js on lines 99..102
        src/HTMLElement/elements/HTMLAnchorElement.js on lines 117..120

        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

            set vAlign(value) {
                if (['top', 'middle', 'bottom', 'baseline'].indexOf(value) !== -1) {
                    this.setAttribute('valign', value);
                }
            }
        Severity: Minor
        Found in src/HTMLElement/elements/HTMLTableRowElement.js and 1 other location - About 50 mins to fix
        src/HTMLElement/elements/HTMLTableSectionElement.js on lines 84..88

        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

            set align(value) {
                if (['left', 'right', 'center'].indexOf(value) !== -1) {
                    this.setAttribute('align', value);
                }
            }
        Severity: Minor
        Found in src/HTMLElement/elements/HTMLTableSectionElement.js and 1 other location - About 45 mins to fix
        src/HTMLElement/elements/HTMLTableRowElement.js on lines 85..89

        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

        Function matchRule has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function matchRule(element, rule) {
            if (rule.hasOwnProperty('tagName') && element.tagName !== rule.tagName) {
                return false;
            }
        
        
        Severity: Minor
        Found in src/utils/querySelectorHelper.js - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function rowIndex has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            get rowIndex() {
                if (this.parentNode === null) {
                    return -1;
                }
        
        
        Severity: Minor
        Found in src/HTMLElement/elements/HTMLTableRowElement.js - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            set align(value) {
                if (['left', 'right', 'center'].indexOf(value) !== -1) {
                    this.setAttribute('align', value);
                }
            }
        Severity: Minor
        Found in src/HTMLElement/elements/HTMLTableRowElement.js and 1 other location - About 45 mins to fix
        src/HTMLElement/elements/HTMLTableSectionElement.js on lines 26..30

        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 2 locations. Consider refactoring.
        Open

            setAttribute(key, value) {
                super.setAttribute(key, value);
                if (key === 'href') {
                    this.href = value;
                }
        Severity: Minor
        Found in src/HTMLElement/elements/HTMLLinkElement.js and 1 other location - About 40 mins to fix
        src/HTMLElement/elements/HTMLAnchorElement.js on lines 20..25

        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 2 locations. Consider refactoring.
        Open

            setAttribute(key, value) {
                super.setAttribute(key, value);
                if (key === 'href') {
                    this.href = value;
                }
        Severity: Minor
        Found in src/HTMLElement/elements/HTMLAnchorElement.js and 1 other location - About 40 mins to fix
        src/HTMLElement/elements/HTMLLinkElement.js on lines 20..25

        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 4 locations. Consider refactoring.
        Open

            set autoFocus(value) {
                if (value) {
                    this.setAttribute('autofocus', '');
                } else {
                    this.removeAttribute('autofocus');
        Severity: Major
        Found in src/HTMLElement/elements/HTMLSelectElement.js and 3 other locations - About 35 mins to fix
        src/HTMLElement/elements/HTMLOptionElement.js on lines 44..50
        src/HTMLElement/elements/HTMLSelectElement.js on lines 49..55
        src/HTMLElement/elements/HTMLSelectElement.js on lines 121..127

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

        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 4 locations. Consider refactoring.
        Open

            set disabled(value) {
                if (value) {
                    this.setAttribute('disabled', 'disabled');
                } else {
                    this.removeAttribute('disabled');
        Severity: Major
        Found in src/HTMLElement/elements/HTMLSelectElement.js and 3 other locations - About 35 mins to fix
        src/HTMLElement/elements/HTMLOptionElement.js on lines 44..50
        src/HTMLElement/elements/HTMLSelectElement.js on lines 27..33
        src/HTMLElement/elements/HTMLSelectElement.js on lines 121..127

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

        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 4 locations. Consider refactoring.
        Open

            set multiple(multiple) {
                if (multiple) {
                    this.setAttribute('multiple', 'multiple');
                } else {
                    this.removeAttribute('multiple');
        Severity: Major
        Found in src/HTMLElement/elements/HTMLSelectElement.js and 3 other locations - About 35 mins to fix
        src/HTMLElement/elements/HTMLOptionElement.js on lines 44..50
        src/HTMLElement/elements/HTMLSelectElement.js on lines 27..33
        src/HTMLElement/elements/HTMLSelectElement.js on lines 49..55

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

        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 4 locations. Consider refactoring.
        Open

            set disabled(disabled) {
                if (disabled) {
                    this.setAttribute('disabled', 'disabled');
                } else {
                    this.removeAttribute('disabled');
        Severity: Major
        Found in src/HTMLElement/elements/HTMLOptionElement.js and 3 other locations - About 35 mins to fix
        src/HTMLElement/elements/HTMLSelectElement.js on lines 27..33
        src/HTMLElement/elements/HTMLSelectElement.js on lines 49..55
        src/HTMLElement/elements/HTMLSelectElement.js on lines 121..127

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

        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