TibiaJS/tibia-crawler

View on GitHub

Showing 11 of 11 total issues

Function Character has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Character($) {

  this.data = {
    character: {},
    achievements: [],
Severity: Major
Found in src/fetchers/character.js - About 2 hrs to fix

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

        worlds: function(cb) {
          var path = 'community/?subtopic=worlds';
          return api.request('get', path, {}, function(err, res, body) {
            if(!err){
              cb(new Worlds(cheerio.load(body)));
    Severity: Major
    Found in src/index.js and 1 other location - About 2 hrs to fix
    src/index.js on lines 30..39

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

    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

        spells: function(cb) {
          var path = 'library/?subtopic=spells';
          return api.request('get', path, {}, function(err, res, body) {
            if(!err){
              cb(new Spells(cheerio.load(body)));
    Severity: Major
    Found in src/index.js and 1 other location - About 2 hrs to fix
    src/index.js on lines 87..96

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

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

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

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

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

    Refactorings

    Further Reading

    Function exports has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function (grunt) {
      // Show elapsed time at the end
      require('time-grunt')(grunt);
      // Load all grunt tasks
      require('load-grunt-tasks')(grunt);
    Severity: Minor
    Found in Gruntfile.js - About 1 hr to fix

      Function KillStatistics has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function KillStatistics($) {
      
          this.data = {};
      
          var self = this;
      Severity: Minor
      Found in src/fetchers/killstatistics.js - About 1 hr to fix

        Function World has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function World($) {
        
          this.data = {
            world: {},
            online: []
        Severity: Minor
        Found in src/fetchers/world.js - About 1 hr to fix

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

                              lastDay: {
                                  killedPlayers: parseInt($(td[1]).text()),
                                  killedByPlayers: parseInt($(td[2]).text())
                              },
          Severity: Major
          Found in src/fetchers/killstatistics.js and 3 other locations - About 55 mins to fix
          src/fetchers/killstatistics.js on lines 22..25
          src/fetchers/killstatistics.js on lines 31..34
          src/fetchers/killstatistics.js on lines 35..38

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

          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

                              lastWeek: {
                                  killedPlayers: parseInt($(td[3]).text()),
                                  killedByPlayers: parseInt($(td[4]).text())
                              }
          Severity: Major
          Found in src/fetchers/killstatistics.js and 3 other locations - About 55 mins to fix
          src/fetchers/killstatistics.js on lines 18..21
          src/fetchers/killstatistics.js on lines 31..34
          src/fetchers/killstatistics.js on lines 35..38

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

          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

                              lastWeek: {
                                  killedPlayers: parseInt($(td[3]).text()),
                                  killedByPlayers: parseInt($(td[4]).text())
                              }
          Severity: Major
          Found in src/fetchers/killstatistics.js and 3 other locations - About 55 mins to fix
          src/fetchers/killstatistics.js on lines 18..21
          src/fetchers/killstatistics.js on lines 22..25
          src/fetchers/killstatistics.js on lines 31..34

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

          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

                              lastDay: {
                                  killedPlayers: parseInt($(td[1]).text()),
                                  killedByPlayers: parseInt($(td[2]).text())
                              },
          Severity: Major
          Found in src/fetchers/killstatistics.js and 3 other locations - About 55 mins to fix
          src/fetchers/killstatistics.js on lines 18..21
          src/fetchers/killstatistics.js on lines 22..25
          src/fetchers/killstatistics.js on lines 35..38

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

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

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

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

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

          Refactorings

          Further Reading

          Function Request has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          var Request = function(method, path, data, sess, callback) {
          Severity: Minor
          Found in src/request.js - About 35 mins to fix
            Severity
            Category
            Status
            Source
            Language