vampireneo/Book

View on GitHub

Showing 47 of 47 total issues

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

      '952': {
        name: 'Finland',
        ranges: [
          ['00', '19'],
          ['200', '499'],
Severity: Major
Found in utility/isbn.js and 2 other locations - About 1 hr to fix
utility/isbn.js on lines 297..311
utility/isbn.js on lines 492..506

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

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

      '983': {
        name: 'Malaysia',
        ranges: [
          ['00', '01'],
          ['020', '199'],
Severity: Minor
Found in utility/isbn.js and 1 other location - About 55 mins to fix
utility/isbn.js on lines 664..677

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

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

      '973': {
        name: 'Romania',
        ranges: [
          ['0', '0'],
          ['100', '169'],
Severity: Minor
Found in utility/isbn.js and 1 other location - About 55 mins to fix
utility/isbn.js on lines 768..781

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

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

Avoid deeply nested control flow statements.
Open

              if (text2.length !== 2) {
                continue;
              }
Severity: Major
Found in bookParser/Books.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

              if (
                (!(e instanceof Date) && dst.indexOf(e) === -1) ||
                (e instanceof Date && dst.map(Number).indexOf(+e) === -1)
              ) {
                dst.push(e);
    Severity: Major
    Found in utility/merge.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                    switch (title) {
                      //原文作者
                      //譯者
                      case '出版社':
                        bookObj.Publisher = content;
      Severity: Major
      Found in bookParser/Books.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                      if (infos[i].indexOf('ISBN 13') > -1) {
                        bookObj.ISBN = infos[i].split('/')[1].trim();
                      }
        Severity: Major
        Found in bookParser/Eslite.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                        if (text.length !== 2) {
                          continue;
                        }
          Severity: Major
          Found in bookParser/Books.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                          if (text.length !== 2) {
                            continue;
                          }
            Severity: Major
            Found in bookParser/Kingstone.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                            switch (title) {
                              case 'ISBN':
                                bookObj.ISBN = content;
                                break;
                              case '出版社':
              Severity: Major
              Found in bookParser/Kingstone.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                              switch (title2) {
                                case 'ISBN':
                                  bookObj.ISBN = content2;
                                  break;
                                case '叢書系列':
                Severity: Major
                Found in bookParser/Books.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              if (dst[key].indexOf(src[key]) === -1) {
                                dst[key].push(src[key]);
                              }
                  Severity: Major
                  Found in utility/merge.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                    if (page !== '0') {
                                      bookObj.Pages = page;
                                    }
                    Severity: Major
                    Found in bookParser/JointPublishing.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                    switch (title) {
                                      case '作者:':
                                        bookObj.Author = content;
                                        break;
                                      case 'ISBN-13:':
                      Severity: Major
                      Found in bookParser/HkBookCity.js - About 45 mins to fix

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

                            asIsbn10: function(hyphen) {
                              return this.isValid() ?
                                hyphen ? this.codes.isbn10h : this.codes.isbn10 :
                                null;
                            },
                        Severity: Minor
                        Found in utility/isbn.js and 1 other location - About 40 mins to fix
                        utility/isbn.js on lines 1894..1898

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

                            asIsbn13: function(hyphen) {
                              return this.isValid() ?
                                hyphen ? this.codes.isbn13h : this.codes.isbn13 :
                                null;
                            },
                        Severity: Minor
                        Found in utility/isbn.js and 1 other location - About 40 mins to fix
                        utility/isbn.js on lines 1888..1892

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

                              '2': {
                                name: 'French speaking area',
                                ranges: [
                                  ['00', '19'],
                                  ['200', '349'],
                        Severity: Major
                        Found in utility/isbn.js and 4 other locations - About 40 mins to fix
                        utility/isbn.js on lines 365..377
                        utility/isbn.js on lines 566..578
                        utility/isbn.js on lines 641..653
                        utility/isbn.js on lines 729..741

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

                              '90': {
                                name: 'Netherlands, Belgium (Flemish)',
                                ranges: [
                                  ['00', '19'],
                                  ['200', '499'],
                        Severity: Major
                        Found in utility/isbn.js and 4 other locations - About 40 mins to fix
                        utility/isbn.js on lines 34..46
                        utility/isbn.js on lines 566..578
                        utility/isbn.js on lines 641..653
                        utility/isbn.js on lines 729..741

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

                              '971': {
                                name: 'Philippines',
                                ranges: [
                                  ['000', '019'],
                                  ['02', '02'],
                        Severity: Major
                        Found in utility/isbn.js and 4 other locations - About 40 mins to fix
                        utility/isbn.js on lines 34..46
                        utility/isbn.js on lines 365..377
                        utility/isbn.js on lines 566..578
                        utility/isbn.js on lines 729..741

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

                              '979': {
                                name: 'Indonesia',
                                ranges: [
                                  ['000', '099'],
                                  ['1000', '1499'],
                        Severity: Major
                        Found in utility/isbn.js and 4 other locations - About 40 mins to fix
                        utility/isbn.js on lines 34..46
                        utility/isbn.js on lines 365..377
                        utility/isbn.js on lines 566..578
                        utility/isbn.js on lines 641..653

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language