jmdobry/disqus-node

View on GitHub

Showing 43 of 43 total issues

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

forums
  .command('unfollow')
  .description('Unfollow a forum.')
  .option('-A, --access_token <string>', 'Your access token.')
  .option('-H, --https [boolean]', 'Whether to use https. Defaults to true.', true)
Severity: Major
Found in lib/cli/forums.js and 1 other location - About 4 hrs to fix
lib/cli/topics.js on lines 101..112

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

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

topics
  .command('unfollow')
  .description('Unfollow a topic.')
  .option('-A, --access_token <string>', 'Your access token.')
  .option('-H, --https [boolean]', 'Whether to use https. Defaults to true.', true)
Severity: Major
Found in lib/cli/topics.js and 1 other location - About 4 hrs to fix
lib/cli/forums.js on lines 527..538

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

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 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (grunt) {

  require('load-grunt-tasks')(grunt);
  require('time-grunt')(grunt);

Severity: Major
Found in Gruntfile.js - About 4 hrs to fix

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

    categories
      .command('listThreads')
      .description('Returns a list of threads within a category sorted by the date created.')
      .option('-c, --cursor [string]', 'Defaults to null.', null)
      .option('-C, --category <string>', 'Looks up a category by ID.')
    Severity: Major
    Found in lib/cli/categories.js and 1 other location - About 2 hrs to fix
    lib/cli/categories.js on lines 98..107

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

    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

    categories
      .command('list')
      .description('Returns a list of categories within a forum.')
      .option('-c, --cursor [string]', 'Defaults to null.', null)
      .option('-f, --forum <string>', 'Looks up a forum by ID (aka short name).')
    Severity: Major
    Found in lib/cli/categories.js and 1 other location - About 2 hrs to fix
    lib/cli/categories.js on lines 179..188

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

    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 Disqus has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Disqus(options) {
      options = options || {};
    
      var _this = this;
      var Log = container.get('Log');
    Severity: Major
    Found in lib/index.js - About 2 hrs to fix

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

      module.exports = function (util) {
        return function Forums(config) {
      
          /**
           * ### addModerator
      Severity: Minor
      Found in lib/api/Forums.js - About 1 hr to fix

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

        whitelists
          .command('add')
          .description('Adds an entry to the whitelist.')
          .option('-A, --access_token <string>', 'Your access token.')
          .option('-e, --email [array]', 'Defaults to []. Email address (defined by RFC 5322).', [])
        Severity: Major
        Found in lib/cli/whitelists.js and 1 other location - About 1 hr to fix
        lib/cli/whitelists.js on lines 119..127

        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

        Function Forums has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          return function Forums(config) {
        
            /**
             * ### addModerator
             * Adds a moderator to a forum.
        Severity: Minor
        Found in lib/api/Forums.js - About 1 hr to fix

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

          whitelists
            .command('remove')
            .description('Removes an entry from the blacklist.')
            .option('-A, --access_token <string>', 'Your access token.')
            .option('-e, --email [array]', 'Defaults to []. Email address (defined by RFC 5322).', [])
          Severity: Major
          Found in lib/cli/whitelists.js and 1 other location - About 1 hr to fix
          lib/cli/whitelists.js on lines 36..44

          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

          whitelists
            .command('list')
            .description('Returns a list of all whitelist entries.')
            .option('-A, --access_token <string>', 'Your access token.')
            .option('-c, --cursor [string]', 'Defaults to null.', null)
          Severity: Major
          Found in lib/cli/whitelists.js and 1 other location - About 1 hr to fix
          lib/cli/blacklists.js on lines 85..93

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

          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

          blacklists
            .command('list')
            .description('Returns a list of all blacklist entries.')
            .option('-A, --access_token <string>', 'Your access token.')
            .option('-c, --cursor [cursor]', 'Defaults to null,', null)
          Severity: Major
          Found in lib/cli/blacklists.js and 1 other location - About 1 hr to fix
          lib/cli/whitelists.js on lines 78..86

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

          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

          module.exports = function (util) {
            return function Applications(config) {
          
              /**
               * ### listUsage
          Severity: Major
          Found in lib/api/Applications.js and 2 other locations - About 1 hr to fix
          lib/api/Exports.js on lines 18..58
          lib/api/Trends.js on lines 18..57

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

          module.exports = function (util) {
            return function Trends(config) {
          
              /**
               * ### listThreads
          Severity: Major
          Found in lib/api/Trends.js and 2 other locations - About 1 hr to fix
          lib/api/Applications.js on lines 18..58
          lib/api/Exports.js on lines 18..58

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

          module.exports = function (util) {
            return function Exports(config) {
          
              /**
               * ### exportForum
          Severity: Major
          Found in lib/api/Exports.js and 2 other locations - About 1 hr to fix
          lib/api/Applications.js on lines 18..58
          lib/api/Trends.js on lines 18..57

          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

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

          module.exports = function (util) {
            return function Posts(config) {
          
              /**
               * ### approve
          Severity: Minor
          Found in lib/api/Posts.js - About 1 hr to fix

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

              return function Posts(config) {
            
                /**
                 * ### approve
                 * Approves the requested post(s).
            Severity: Minor
            Found in lib/api/Posts.js - About 1 hr to fix

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

              categories
                .command('listPosts')
                .description('Returns a list of posts within a category.')
                .option('-c, --cursor [string]', 'Defaults to null.', null)
                .option('-C, --category <string>', 'Looks up a category by ID.')
              Severity: Major
              Found in lib/cli/categories.js and 1 other location - About 1 hr to fix
              lib/cli/forums.js on lines 377..384

              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

              forums
                .command('listPosts')
                .description('Returns a list of posts within a forum.')
                .option('-c, --cursor [cursor]', 'Defaults to null,', null)
                .option('-f, --forum <string>', 'Looks up a forum by ID (aka short name).')
              Severity: Major
              Found in lib/cli/forums.js and 1 other location - About 1 hr to fix
              lib/cli/categories.js on lines 138..145

              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

              posts
                .command('listPopular')
                .description('Returns a list of posts ordered by the number of likes recently.')
                .option('-c, --category [string]', 'Defaults to null. Looks up a category by ID.', null)
                .option('-f, --forum [string]', 'Defaults to null. Defaults to all forums you moderate. Use :all to retrieve all forums.', null)
              Severity: Minor
              Found in lib/cli/posts.js and 1 other location - About 50 mins to fix
              lib/cli/posts.js on lines 69..75

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 52.

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

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

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

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

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language