suitmedia/suitcoda

View on GitHub
seo/seoChecker.js

Summary

Maintainability
D
1 day
Test Coverage

Avoid deeply nested control flow statements.
Open

                    if ( getCharset === "" || getCharset === null ) {
                        errDesc = 'Please fill the charset attribute on meta tag.';
                        pushErrMsg(errDesc);
                    } else if ( getCharset !== "utf-8" ) {
                        errDesc = 'Please only use "utf-8" for charset attribute on meta tag.';
Severity: Major
Found in seo/seoChecker.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    } else if ( isHttpEquiv ) {
                        if ( getHttpEquiv === "" || getHttpEquiv === null ) {
                            errDesc = 'Please fill the http-equiv attribute on meta tag.';
                            pushErrMsg(errDesc);
                        } else if ( getHttpEquiv !== "content-type" ) {
    Severity: Major
    Found in seo/seoChecker.js - About 45 mins to fix

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

              if ( isMetaVp ) {
                  var getMetaVp = horseman.attribute('meta[name="viewport"]', 'content');
                  if ( getMetaVp === "" ) {
                      errDesc = "Meta Viewport tag must be filled";
                      pushErrMsg(errDesc);
      Severity: Major
      Found in seo/seoChecker.js and 1 other location - About 1 hr to fix
      seo/seoChecker.js on lines 160..170

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

      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 ( isLang ) {
                  var getLang = horseman.attribute('html','lang');
                  if ( getLang === "" ) {
                      errDesc = 'Please fill the Lang attribute to keep the standarization.';
                      pushErrMsg(errDesc);
      Severity: Major
      Found in seo/seoChecker.js and 1 other location - About 1 hr to fix
      seo/seoChecker.js on lines 231..241

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

      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 ( isCharset ) {
                          if ( getCharset === "" || getCharset === null ) {
                              errDesc = 'Please fill the charset attribute on meta tag.';
                              pushErrMsg(errDesc);
                          } else if ( getCharset !== "utf-8" ) {
      Severity: Major
      Found in seo/seoChecker.js and 1 other location - About 1 hr to fix
      seo/seoChecker.js on lines 195..204

      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

                      } else if ( isHttpEquiv ) {
                          if ( getHttpEquiv === "" || getHttpEquiv === null ) {
                              errDesc = 'Please fill the http-equiv attribute on meta tag.';
                              pushErrMsg(errDesc);
                          } else if ( getHttpEquiv !== "content-type" ) {
      Severity: Major
      Found in seo/seoChecker.js and 1 other location - About 1 hr to fix
      seo/seoChecker.js on lines 186..204

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

          if ( program.header ) {
              var countHeader = horseman.count( 'header' );
      
              if ( countHeader === 0 ) {
                  errDesc = 'Header Tag is not found. Please add Header Tag to keep the standarization.';
      Severity: Major
      Found in seo/seoChecker.js and 2 other locations - About 1 hr to fix
      seo/seoChecker.js on lines 83..92
      seo/seoChecker.js on lines 95..104

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

      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

          if ( program.footer ) {
              var countFooter = horseman.count( 'footer' );
      
              if ( countFooter === 0 ) {
                  errDesc = 'Footer Tag is not found. Please add Footer Tag to keep the standarization.';
      Severity: Major
      Found in seo/seoChecker.js and 2 other locations - About 1 hr to fix
      seo/seoChecker.js on lines 71..80
      seo/seoChecker.js on lines 95..104

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

      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

          if ( program.favicon ) {
              var countFavicon = horseman.count('link[rel*="icon"]');
      
              if ( countFavicon === 0 ) {
                  errDesc = 'Favicon is not found. Please add <link rel="icon" type="image/png" href="path/to/your/file"></link> to keep the standarization.';
      Severity: Major
      Found in seo/seoChecker.js and 2 other locations - About 1 hr to fix
      seo/seoChecker.js on lines 71..80
      seo/seoChecker.js on lines 83..92

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

      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

      program
      .version('0.0.1')
      .option('-u, --url [url]', 'Input URL')
      .option('-d, --destination [path]', 'Input Path to Store The Output')
      .option('--title',      'Include Title Tag Checker')
      Severity: Major
      Found in seo/seoChecker.js and 1 other location - About 1 hr to fix
      socmed/socmedChecker.js on lines 8..15

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

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

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

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

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

      Refactorings

      Further Reading

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

      if ( !isUrl(url) ) {
          console.log('ERROR: this is not an url');
          horseman.close();
          process.exit(1);
      }
      Severity: Major
      Found in seo/seoChecker.js and 3 other locations - About 35 mins to fix
      linter/cssHorseman.js on lines 23..27
      linter/htmlHorseman.js on lines 19..23
      linter/jsHorseman.js on lines 22..26

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

          function saveReport() {
              fs.writeFile(dest + 'resultSEO.json', toJson, function (err) {
                  if (err) throw err;
                  console.log("resultSEO.json has saved!");
              }); 
      Severity: Minor
      Found in seo/seoChecker.js and 1 other location - About 30 mins to fix
      performance/yslowHorseman.js on lines 99..104

      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