adobe/brackets

View on GitHub
src/language/HTMLTokenizer.js

Summary

Maintainability
F
1 wk
Test Coverage

Function nextToken has 453 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Tokenizer.prototype.nextToken = function () {
        this._token = null;

        if (this._nextToken) {
            var result = this._nextToken;
Severity: Major
Found in src/language/HTMLTokenizer.js - About 2 days to fix

    File HTMLTokenizer.js has 583 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Copyright (c) 2013 - present Adobe Systems Incorporated. All rights reserved.
     *
     * Permission is hereby granted, free of charge, to any person obtaining a
     * copy of this software and associated documentation files (the "Software"),
    Severity: Major
    Found in src/language/HTMLTokenizer.js - About 1 day to fix

      Avoid deeply nested control flow statements.
      Open

                          if (c === "!") {
                              this._state = BEFORE_DECLARATION;
                              this._startSection(1);
                          } else if (c === "?") {
                              this._state = IN_PROCESSING_INSTRUCTION;
      Severity: Major
      Found in src/language/HTMLTokenizer.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                        if (c === "/") {
                            this._emitToken("opentagname");
                            this._emitSpecialToken("selfclosingtag", this._index + 2, _clonePos(this._indexPos, 2));
                            this._state = AFTER_SELFCLOSE_SLASH;
                        } else if (c === ">") {
        Severity: Major
        Found in src/language/HTMLTokenizer.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      } else if (this._state === BEFORE_CLOSING_TAG_NAME) {
                          if (c === ">") {
                              this._state = TEXT;
                          } else if (this._special > 0) {
                              if (c === "s" || c === "S") {
          Severity: Major
          Found in src/language/HTMLTokenizer.js - About 45 mins to fix

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

                            if (c === ">") {
                                this._emitToken("attribvalue");
                                this._emitSpecialToken("opentagend", this._index + 1, _clonePos(this._indexPos, 1));
                                this._state = TEXT;
                                this._startSection(1);
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 1 other location - About 4 hrs to fix
            src/language/HTMLTokenizer.js on lines 227..238

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

            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

                            } else if (c === ">") {
                                this._emitToken("opentagname");
                                this._emitSpecialToken("opentagend", this._index + 1, _clonePos(this._indexPos, 1));
                                this._state = TEXT;
                                this._startSection(1);
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 1 other location - About 4 hrs to fix
            src/language/HTMLTokenizer.js on lines 360..371

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

            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

                        } else if (this._state === AFTER_COMMENT_2) {
                            if (c === ">") {
                                //remove 2 trailing chars
                                // It should be okay to just decrement the char position by 2 because we know neither of the previous
                                // characters is a newline.
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 1 other location - About 3 hrs to fix
            src/language/HTMLTokenizer.js on lines 503..670

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

            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

                        } else if (this._state === AFTER_CDATA_2) {
                            if (c === ">") {
                                //remove 2 trailing chars
                                // It should be okay to just decrement the char position by 2 because we know neither of the previous
                                // characters is a newline.
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 1 other location - About 3 hrs to fix
            src/language/HTMLTokenizer.js on lines 439..670

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

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

                            } else if (c === "'") {
                                this._state = IN_ATTRIBUTE_VALUE_SINGLE_QUOTES;
                                this._startSection(1);
                            } else if (!isLegalInUnquotedAttributeValue(c)) {
                                this._emitSpecialToken("error");
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 4 other locations - About 1 hr to fix
            src/language/HTMLTokenizer.js on lines 211..220
            src/language/HTMLTokenizer.js on lines 242..255
            src/language/HTMLTokenizer.js on lines 297..306
            src/language/HTMLTokenizer.js on lines 325..334

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

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

                            } else if (c === "/") {
                                this._emitSpecialToken("selfclosingtag", this._index + 2, _clonePos(this._indexPos, 2));
                                this._state = AFTER_SELFCLOSE_SLASH;
                            } else if (!isLegalInAttributeName(c)) {
                                this._emitSpecialToken("error");
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 4 other locations - About 1 hr to fix
            src/language/HTMLTokenizer.js on lines 211..220
            src/language/HTMLTokenizer.js on lines 242..255
            src/language/HTMLTokenizer.js on lines 325..334
            src/language/HTMLTokenizer.js on lines 339..348

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

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

                            } else if (c === "/" || c === ">") {
                                this._state = BEFORE_ATTRIBUTE_NAME;
                                continue;
                            } else if (!isLegalInAttributeName(c)) {
                                this._emitSpecialToken("error");
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 4 other locations - About 1 hr to fix
            src/language/HTMLTokenizer.js on lines 211..220
            src/language/HTMLTokenizer.js on lines 242..255
            src/language/HTMLTokenizer.js on lines 297..306
            src/language/HTMLTokenizer.js on lines 339..348

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

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

                                } else if (c === "s" || c === "S") {
                                    this._state = BEFORE_SPECIAL;
                                    this._startSection();
                                } else if (!isLegalInTagName(c)) {
                                    this._emitSpecialToken("error");
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 4 other locations - About 1 hr to fix
            src/language/HTMLTokenizer.js on lines 242..255
            src/language/HTMLTokenizer.js on lines 297..306
            src/language/HTMLTokenizer.js on lines 325..334
            src/language/HTMLTokenizer.js on lines 339..348

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

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

                            } else if (this._special > 0) {
                                if (c === "s" || c === "S") {
                                    this._state = BEFORE_SPECIAL_END;
                                } else {
                                    this._state = TEXT;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 4 other locations - About 1 hr to fix
            src/language/HTMLTokenizer.js on lines 211..220
            src/language/HTMLTokenizer.js on lines 297..306
            src/language/HTMLTokenizer.js on lines 325..334
            src/language/HTMLTokenizer.js on lines 339..348

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

            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 (c === ">") {
                                this._state = TEXT;
                                this._emitSpecialToken("opentagend", this._index + 1, _clonePos(this._indexPos, 1));
                                this._startSection(1);
                            } else if (c === "/") {
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 1 other location - About 1 hr to fix
            src/language/HTMLTokenizer.js on lines 375..387

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

            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 (c === ">") {
                                this._state = TEXT;
                                this._emitSpecialToken("opentagend", this._index + 1, _clonePos(this._indexPos, 1));
                                this._startSection(1);
                            } else if (c === "/") {
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 1 other location - About 1 hr to fix
            src/language/HTMLTokenizer.js on lines 293..306

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

            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

                        } else if (this._state === BEFORE_STYLE_4) {
                            if (c === "/" || c === ">" || isWhitespace(c)) {
                                this._special = 2;
                            }
                            this._state = IN_TAG_NAME;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 1 other location - About 1 hr to fix
            src/language/HTMLTokenizer.js on lines 570..670

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

            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

                        } else if (this._state === BEFORE_SCRIPT_5) {
                            if (c === "/" || c === ">" || isWhitespace(c)) {
                                this._special = 1;
                            }
                            this._state = IN_TAG_NAME;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 1 other location - About 1 hr to fix
            src/language/HTMLTokenizer.js on lines 634..670

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

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

                        } else if (this._state === BEFORE_SCRIPT_3) {
                            if (c === "p" || c === "P") {
                                this._state = BEFORE_SCRIPT_4;
                            } else {
                                this._state = IN_TAG_NAME;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 50 mins to fix
            src/language/HTMLTokenizer.js on lines 542..670
            src/language/HTMLTokenizer.js on lines 549..670
            src/language/HTMLTokenizer.js on lines 563..670
            src/language/HTMLTokenizer.js on lines 613..670
            src/language/HTMLTokenizer.js on lines 620..670
            src/language/HTMLTokenizer.js on lines 627..670

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

                        } else if (this._state === BEFORE_SCRIPT_1) {
                            if (c === "r" || c === "R") {
                                this._state = BEFORE_SCRIPT_2;
                            } else {
                                this._state = IN_TAG_NAME;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 50 mins to fix
            src/language/HTMLTokenizer.js on lines 549..670
            src/language/HTMLTokenizer.js on lines 556..670
            src/language/HTMLTokenizer.js on lines 563..670
            src/language/HTMLTokenizer.js on lines 613..670
            src/language/HTMLTokenizer.js on lines 620..670
            src/language/HTMLTokenizer.js on lines 627..670

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

                        } else if (this._state === BEFORE_STYLE_2) {
                            if (c === "l" || c === "L") {
                                this._state = BEFORE_STYLE_3;
                            } else {
                                this._state = IN_TAG_NAME;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 50 mins to fix
            src/language/HTMLTokenizer.js on lines 542..670
            src/language/HTMLTokenizer.js on lines 549..670
            src/language/HTMLTokenizer.js on lines 556..670
            src/language/HTMLTokenizer.js on lines 563..670
            src/language/HTMLTokenizer.js on lines 613..670
            src/language/HTMLTokenizer.js on lines 627..670

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

                        } else if (this._state === BEFORE_SCRIPT_4) {
                            if (c === "t" || c === "T") {
                                this._state = BEFORE_SCRIPT_5;
                            } else {
                                this._state = IN_TAG_NAME;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 50 mins to fix
            src/language/HTMLTokenizer.js on lines 542..670
            src/language/HTMLTokenizer.js on lines 549..670
            src/language/HTMLTokenizer.js on lines 556..670
            src/language/HTMLTokenizer.js on lines 613..670
            src/language/HTMLTokenizer.js on lines 620..670
            src/language/HTMLTokenizer.js on lines 627..670

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

                        } else if (this._state === BEFORE_STYLE_3) {
                            if (c === "e" || c === "E") {
                                this._state = BEFORE_STYLE_4;
                            } else {
                                this._state = IN_TAG_NAME;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 50 mins to fix
            src/language/HTMLTokenizer.js on lines 542..670
            src/language/HTMLTokenizer.js on lines 549..670
            src/language/HTMLTokenizer.js on lines 556..670
            src/language/HTMLTokenizer.js on lines 563..670
            src/language/HTMLTokenizer.js on lines 613..670
            src/language/HTMLTokenizer.js on lines 620..670

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

                        } else if (this._state === BEFORE_SCRIPT_2) {
                            if (c === "i" || c === "I") {
                                this._state = BEFORE_SCRIPT_3;
                            } else {
                                this._state = IN_TAG_NAME;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 50 mins to fix
            src/language/HTMLTokenizer.js on lines 542..670
            src/language/HTMLTokenizer.js on lines 556..670
            src/language/HTMLTokenizer.js on lines 563..670
            src/language/HTMLTokenizer.js on lines 613..670
            src/language/HTMLTokenizer.js on lines 620..670
            src/language/HTMLTokenizer.js on lines 627..670

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

                        } else if (this._state === BEFORE_STYLE_1) {
                            if (c === "y" || c === "Y") {
                                this._state = BEFORE_STYLE_2;
                            } else {
                                this._state = IN_TAG_NAME;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 50 mins to fix
            src/language/HTMLTokenizer.js on lines 542..670
            src/language/HTMLTokenizer.js on lines 549..670
            src/language/HTMLTokenizer.js on lines 556..670
            src/language/HTMLTokenizer.js on lines 563..670
            src/language/HTMLTokenizer.js on lines 620..670
            src/language/HTMLTokenizer.js on lines 627..670

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

                        } else if (this._state === BEFORE_COMMENT) {
                            if (c === "-") {
                                this._state = IN_COMMENT;
                                this._startSection(1);
                            } else {
            Severity: Minor
            Found in src/language/HTMLTokenizer.js and 1 other location - About 50 mins to fix
            src/language/HTMLTokenizer.js on lines 486..670

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

                        } else if (this._state === BEFORE_CDATA_6) {
                            if (c === "[") {
                                this._state = IN_CDATA;
                                this._startSection(1);
                            } else {
            Severity: Minor
            Found in src/language/HTMLTokenizer.js and 1 other location - About 50 mins to fix
            src/language/HTMLTokenizer.js on lines 422..670

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

                        } else if (this._state === IN_DECLARATION) {
                            if (c === ">") {
                                this._emitToken("declaration");
                                this._state = TEXT;
                                this._startSection(1);
            Severity: Minor
            Found in src/language/HTMLTokenizer.js and 1 other location - About 45 mins to fix
            src/language/HTMLTokenizer.js on lines 411..670

            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

                        } else if (this._state === IN_PROCESSING_INSTRUCTION) {
                            if (c === ">") {
                                this._emitToken("processinginstruction");
                                this._state = TEXT;
                                this._startSection(1);
            Severity: Minor
            Found in src/language/HTMLTokenizer.js and 1 other location - About 45 mins to fix
            src/language/HTMLTokenizer.js on lines 400..670

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

                        } else if (this._state === AFTER_STYLE_1) {
                            if (c === "y" || c === "Y") {
                                this._state = AFTER_STYLE_2;
                            } else {
                                this._state = TEXT;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 40 mins to fix
            src/language/HTMLTokenizer.js on lines 576..670
            src/language/HTMLTokenizer.js on lines 582..670
            src/language/HTMLTokenizer.js on lines 588..670
            src/language/HTMLTokenizer.js on lines 594..670
            src/language/HTMLTokenizer.js on lines 646..670
            src/language/HTMLTokenizer.js on lines 652..670

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

                        } else if (this._state === AFTER_SCRIPT_3) {
                            if (c === "p" || c === "P") {
                                this._state = AFTER_SCRIPT_4;
                            } else {
                                this._state = TEXT;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 40 mins to fix
            src/language/HTMLTokenizer.js on lines 576..670
            src/language/HTMLTokenizer.js on lines 582..670
            src/language/HTMLTokenizer.js on lines 594..670
            src/language/HTMLTokenizer.js on lines 640..670
            src/language/HTMLTokenizer.js on lines 646..670
            src/language/HTMLTokenizer.js on lines 652..670

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

                        } else if (this._state === AFTER_STYLE_2) {
                            if (c === "l" || c === "L") {
                                this._state = AFTER_STYLE_3;
                            } else {
                                this._state = TEXT;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 40 mins to fix
            src/language/HTMLTokenizer.js on lines 576..670
            src/language/HTMLTokenizer.js on lines 582..670
            src/language/HTMLTokenizer.js on lines 588..670
            src/language/HTMLTokenizer.js on lines 594..670
            src/language/HTMLTokenizer.js on lines 640..670
            src/language/HTMLTokenizer.js on lines 652..670

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

                        } else if (this._state === AFTER_STYLE_3) {
                            if (c === "e" || c === "E") {
                                this._state = AFTER_STYLE_4;
                            } else {
                                this._state = TEXT;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 40 mins to fix
            src/language/HTMLTokenizer.js on lines 576..670
            src/language/HTMLTokenizer.js on lines 582..670
            src/language/HTMLTokenizer.js on lines 588..670
            src/language/HTMLTokenizer.js on lines 594..670
            src/language/HTMLTokenizer.js on lines 640..670
            src/language/HTMLTokenizer.js on lines 646..670

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

                        } else if (this._state === AFTER_SCRIPT_1) {
                            if (c === "r" || c === "R") {
                                this._state = AFTER_SCRIPT_2;
                            } else {
                                this._state = TEXT;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 40 mins to fix
            src/language/HTMLTokenizer.js on lines 582..670
            src/language/HTMLTokenizer.js on lines 588..670
            src/language/HTMLTokenizer.js on lines 594..670
            src/language/HTMLTokenizer.js on lines 640..670
            src/language/HTMLTokenizer.js on lines 646..670
            src/language/HTMLTokenizer.js on lines 652..670

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

                        } else if (this._state === AFTER_SCRIPT_2) {
                            if (c === "i" || c === "I") {
                                this._state = AFTER_SCRIPT_3;
                            } else {
                                this._state = TEXT;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 40 mins to fix
            src/language/HTMLTokenizer.js on lines 576..670
            src/language/HTMLTokenizer.js on lines 588..670
            src/language/HTMLTokenizer.js on lines 594..670
            src/language/HTMLTokenizer.js on lines 640..670
            src/language/HTMLTokenizer.js on lines 646..670
            src/language/HTMLTokenizer.js on lines 652..670

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

                        } else if (this._state === AFTER_SCRIPT_4) {
                            if (c === "t" || c === "T") {
                                this._state = AFTER_SCRIPT_5;
                            } else {
                                this._state = TEXT;
            Severity: Major
            Found in src/language/HTMLTokenizer.js and 6 other locations - About 40 mins to fix
            src/language/HTMLTokenizer.js on lines 576..670
            src/language/HTMLTokenizer.js on lines 582..670
            src/language/HTMLTokenizer.js on lines 588..670
            src/language/HTMLTokenizer.js on lines 640..670
            src/language/HTMLTokenizer.js on lines 646..670
            src/language/HTMLTokenizer.js on lines 652..670

            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

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

                            } else if (c === "/") {
                                this._emitSpecialToken("selfclosingtag", this._index + 2, _clonePos(this._indexPos, 2));
                                this._state = AFTER_SELFCLOSE_SLASH;
                            } else if (isWhitespace(c)) {
                                this._state = BEFORE_ATTRIBUTE_NAME;
            Severity: Minor
            Found in src/language/HTMLTokenizer.js and 1 other location - About 30 mins to fix
            src/language/HTMLTokenizer.js on lines 297..306

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

            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

            There are no issues that match your filters.

            Category
            Status