itarverne/checklist-seo

View on GitHub
seo/static/js/seoSidePannel.js

Summary

Maintainability
F
1 wk
Test Coverage

File seoSidePannel.js has 432 lines of code (exceeds 250 allowed). Consider refactoring.
Open

document.addEventListener('DOMContentLoaded', function () {

    var e = React.createElement;
    sidePannel = document.createElement('div');
    sidePannel.classList.add("seo_side_pannel")
Severity: Minor
Found in seo/static/js/seoSidePannel.js - About 6 hrs to fix

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

            constructor(props) {
                super(props);
                this.state = {
                    keywordScore: 0,
                    lengthScore: 0,
    Severity: Major
    Found in seo/static/js/seoSidePannel.js - About 3 hrs to fix

      Function render has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              render() {
                  return [
                      e('div', { class: "seo-title" },
                          [
                              e('img', { class: 'seo-logo', src: '/static/images/seo_logo.png', alt: "logo seo" },
      Severity: Major
      Found in seo/static/js/seoSidePannel.js - About 2 hrs to fix

        Function checkKeyword has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                checkKeyword() {
                    let body = [];
                    body[0] = document.getElementById("id_keyword").value;
                    body[1] = this.getText();
                    fetch("/seo/keyword/", {
        Severity: Minor
        Found in seo/static/js/seoSidePannel.js - About 1 hr to fix

          Function getText has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  getText() {
                      let blocks = document.getElementsByClassName("notranslate public-DraftEditor-content");
                      let text = "";
                      for (let block of blocks) {
                          // we make sure we don’t get deleted blocks’s content
          Severity: Minor
          Found in seo/static/js/seoSidePannel.js - About 1 hr to fix

            Function check_h1_in_content has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    check_h1_in_content() {
                        var rich_text_blocks = document.getElementsByClassName("DraftEditor-root");
                        var text;
                        for (let block of rich_text_blocks) {
                            text += block.innerHTML;
            Severity: Minor
            Found in seo/static/js/seoSidePannel.js - About 1 hr to fix

              Function checkTitle has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      checkTitle() {
                          var body = [];
                          body[0] = document.getElementById("id_keyword").value;
                          body[1] = document.getElementById("id_title").value;
                          fetch("/seo/title/", {
              Severity: Minor
              Found in seo/static/js/seoSidePannel.js - About 1 hr to fix

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

                        checkLength() {
                            fetch("/seo/length/", {
                                method: "POST",
                                credentials: 'include',
                                body: JSON.stringify(this.getText()),
                Severity: Minor
                Found in seo/static/js/seoSidePannel.js - About 1 hr to fix

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

                          checkInternalLinks() {
                              fetch("/seo/internal_links/", {
                                  method: "POST",
                                  credentials: 'include',
                                  body: JSON.stringify(this.getHtml()),
                  Severity: Minor
                  Found in seo/static/js/seoSidePannel.js - About 1 hr to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if (!line.classList.contains('Draftail-block--atomic')) {
                                                    if (line.classList.contains('public-DraftStyleDefault-ol')
                                                        || line.classList.contains('public-DraftStyleDefault-ul')) {
                                                        for (let child of line.children) {
                                                            text += " " + child.firstChild.firstChild.firstChild.innerHTML;
                    Severity: Major
                    Found in seo/static/js/seoSidePannel.js - About 45 mins to fix

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

                              checkInternalLinks() {
                                  fetch("/seo/internal_links/", {
                                      method: "POST",
                                      credentials: 'include',
                                      body: JSON.stringify(this.getHtml()),
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 1 other location - About 1 day to fix
                      seo/static/js/seoSidePannel.js on lines 232..260

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

                      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

                              checkLength() {
                                  fetch("/seo/length/", {
                                      method: "POST",
                                      credentials: 'include',
                                      body: JSON.stringify(this.getText()),
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 1 other location - About 1 day to fix
                      seo/static/js/seoSidePannel.js on lines 316..344

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

                      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

                                  document.getElementById("id_keyword").addEventListener('keyup', () => {
                                      clearTimeout(this.state.seoKeyWordInputTimeout);
                                      this.setState({
                                          seoKeyWordInputTimeout: setTimeout(() => {
                                              this.checkKeyword();
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 2 other locations - About 3 hrs to fix
                      seo/static/js/seoSidePannel.js on lines 72..80
                      seo/static/js/seoSidePannel.js on lines 81..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 95.

                      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

                                  document.getElementById("id_slug").addEventListener("input", () => {
                                      clearTimeout(this.state.seoSlugInputTimeout);
                                      this.setState({
                                          seoSlugInputTimeout: setTimeout(() => {
                                              this.checkSlug();
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 2 other locations - About 3 hrs to fix
                      seo/static/js/seoSidePannel.js on lines 40..48
                      seo/static/js/seoSidePannel.js on lines 72..80

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

                      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

                                  document.getElementById("id_title").addEventListener("input", () => {
                                      clearTimeout(this.state.seoTitleInputTimeout);
                                      this.setState({
                                          seoTitleInputTimeout: setTimeout(() => {
                                              this.checkTitle();
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 2 other locations - About 3 hrs to fix
                      seo/static/js/seoSidePannel.js on lines 40..48
                      seo/static/js/seoSidePannel.js on lines 81..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 95.

                      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

                                  fetch("/seo/title/", {
                                      method: "POST",
                                      credentials: 'include',
                                      body: JSON.stringify(body),
                                      headers: {
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 2 other locations - About 2 hrs to fix
                      seo/static/js/seoSidePannel.js on lines 295..314
                      seo/static/js/seoSidePannel.js on lines 355..374

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

                      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

                                  fetch("/seo/title_in_article/", {
                                      method: "POST",
                                      credentials: 'include',
                                      body: JSON.stringify(text),
                                      headers: {
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 2 other locations - About 2 hrs to fix
                      seo/static/js/seoSidePannel.js on lines 265..289
                      seo/static/js/seoSidePannel.js on lines 295..314

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

                      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

                                  fetch("/seo/slug/", {
                                      method: "POST",
                                      credentials: 'include',
                                      body: JSON.stringify(body),
                                      headers: {
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 2 other locations - About 2 hrs to fix
                      seo/static/js/seoSidePannel.js on lines 265..289
                      seo/static/js/seoSidePannel.js on lines 355..374

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

                      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 (block.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
                                              .parentNode.parentNode.parentNode.parentNode.children[0].children[2].children[0].innerHTML != "Code") {
                                              for (let line of block.firstChild.children) {
                                                  if (!line.classList.contains('Draftail-block--atomic')) {
                                                      if (line.classList.contains('public-DraftStyleDefault-ol')
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 1 other location - About 1 hr to fix
                      seo/static/js/seoSidePannel.js on lines 147..150

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

                      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 (block.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
                                              .parentNode.parentNode.parentNode.children[0].children[2].children[0].innerHTML != "Code") {
                                              text += block.firstChild.firstChild.firstChild.innerHTML;
                                          }
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 1 other location - About 1 hr to fix
                      seo/static/js/seoSidePannel.js on lines 110..133

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

                      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

                                          e('div', null,
                                              [
                                                  e('i', { class: `icon ${this.state.internalLinksValidationColor}` },
                                                      null),
                                                  e('span', { title: "There must be internal links, the best is 5" },
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 1 other location - About 1 hr to fix
                      seo/static/js/seoSidePannel.js on lines 396..404

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

                      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

                                          e('div', null,
                                              [
                                                  e('i',
                                                      { class: `icon ${this.state.lengthValidationColor}` },
                                                      null),
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 1 other location - About 1 hr to fix
                      seo/static/js/seoSidePannel.js on lines 423..429

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

                      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 (block.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
                                          .parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display != "none") {
                                          // we make sure we get only text and not GistCreateCode code
                                          if (block.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
                                              .parentNode.parentNode.parentNode.children[0].children[2].children[0].innerHTML != "Code") {
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 1 other location - About 1 hr to fix
                      seo/static/js/seoSidePannel.js on lines 107..134

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

                      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 (block.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
                                          .parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display != "none") {
                                          // we make sure we get only text and not GistCreateCode code
                                          if (block.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
                                              .parentNode.parentNode.parentNode.parentNode.children[0].children[2].children[0].innerHTML != "Code") {
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 1 other location - About 1 hr to fix
                      seo/static/js/seoSidePannel.js on lines 144..151

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                                      if (data["response"] == 'VALID_SLUG') {
                                          this.setState({ slugValidationColor: "green", urlScore: 1 });
                                      } else {
                                          this.setState({ slugValidationColor: "red", urlScore: 0 });
                                      }
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 1 other location - About 1 hr to fix
                      seo/static/js/seoSidePannel.js on lines 284..288

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                                      if (data["response"] == 'VALID_TITLE') {
                                          this.setState({ titleValidationColor: "green", titleScore: 1 });
                                      } else {
                                          this.setState({ titleValidationColor: "red", titleScore: 0 });
                                      }
                      Severity: Major
                      Found in seo/static/js/seoSidePannel.js and 1 other location - About 1 hr to fix
                      seo/static/js/seoSidePannel.js on lines 309..313

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

                      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