hoschi/sweetp-service-github-issues

View on GitHub

Showing 21 of 22 total issues

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

nock('https://api.github.com:443')
    .get('/repos/sweetp/dashboard/issues?state=all')
    .reply(200, [{
        "url": "https://api.github.com/repos/sweetp/dashboard/issues/33",
        "labels_url": "https://api.github.com/repos/sweetp/dashboard/issues/33/labels{/name}",
Severity: Major
Found in fixtures/method_all_with_all_props.js and 1 other location - About 2 mos to fix
fixtures/method_all.js on lines 19..2117

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

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

nock('https://api.github.com:443')
    .get('/repos/sweetp/dashboard/issues?state=all')
    .reply(200, [{
        "url": "https://api.github.com/repos/sweetp/dashboard/issues/33",
        "labels_url": "https://api.github.com/repos/sweetp/dashboard/issues/33/labels{/name}",
Severity: Major
Found in fixtures/method_all.js and 1 other location - About 2 mos to fix
fixtures/method_all_with_all_props.js on lines 19..2117

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

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

File method_all.js has 2114 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var nock = require('nock');

nock('http://localhost:8800')
    .get('/services/test-github-issues/password/manager/get?key=github')
    .reply(200, {
Severity: Major
Found in fixtures/method_all.js - About 5 days to fix

    File method_all_with_all_props.js has 2114 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var nock = require('nock');
    
    nock('http://localhost:8800')
        .get('/services/test-github-issues/password/manager/get?key=github')
        .reply(200, {
    Severity: Major
    Found in fixtures/method_all_with_all_props.js - About 5 days to fix

      File method_all_state_closed.js has 1703 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var nock = require('nock');
      
      nock('http://localhost:8800')
          .get('/services/test-github-issues/password/manager/get?key=github')
          .reply(200, {
      Severity: Major
      Found in fixtures/method_all_state_closed.js - About 4 days to fix

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

            }, {
                "url": "https://api.github.com/repos/sweetp/dashboard/issues/1",
                "labels_url": "https://api.github.com/repos/sweetp/dashboard/issues/1/labels{/name}",
                "comments_url": "https://api.github.com/repos/sweetp/dashboard/issues/1/comments",
                "events_url": "https://api.github.com/repos/sweetp/dashboard/issues/1/events",
        Severity: Major
        Found in fixtures/method_all_state_closed.js and 2 other locations - About 2 days to fix
        fixtures/method_all_state_closed.js on lines 1458..1533
        fixtures/method_all_state_closed.js on lines 1533..1608

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

        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

            }, {
                "url": "https://api.github.com/repos/sweetp/dashboard/issues/2",
                "labels_url": "https://api.github.com/repos/sweetp/dashboard/issues/2/labels{/name}",
                "comments_url": "https://api.github.com/repos/sweetp/dashboard/issues/2/comments",
                "events_url": "https://api.github.com/repos/sweetp/dashboard/issues/2/events",
        Severity: Major
        Found in fixtures/method_all_state_closed.js and 2 other locations - About 2 days to fix
        fixtures/method_all_state_closed.js on lines 1458..1533
        fixtures/method_all_state_closed.js on lines 1608..1683

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

        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

            }, {
                "url": "https://api.github.com/repos/sweetp/dashboard/issues/3",
                "labels_url": "https://api.github.com/repos/sweetp/dashboard/issues/3/labels{/name}",
                "comments_url": "https://api.github.com/repos/sweetp/dashboard/issues/3/comments",
                "events_url": "https://api.github.com/repos/sweetp/dashboard/issues/3/events",
        Severity: Major
        Found in fixtures/method_all_state_closed.js and 2 other locations - About 2 days to fix
        fixtures/method_all_state_closed.js on lines 1533..1608
        fixtures/method_all_state_closed.js on lines 1608..1683

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

        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

        File method_all_state_open.js has 676 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var nock = require('nock');
        
        nock('http://localhost:8800')
            .get('/services/test-github-issues/password/manager/get?key=github')
            .reply(200, {
        Severity: Major
        Found in fixtures/method_all_state_open.js - About 1 day to fix

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

              }], {
                  server: 'GitHub.com',
                  date: 'Tue, 29 Jul 2014 10:29:04 GMT',
                  'content-type': 'application/json; charset=utf-8',
                  status: '200 OK',
          Severity: Major
          Found in fixtures/method_all_state_open.js and 1 other location - About 3 hrs to fix
          fixtures/method_all_state_closed.js on lines 1683..1706

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

          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

              }], {
                  server: 'GitHub.com',
                  date: 'Tue, 29 Jul 2014 10:30:19 GMT',
                  'content-type': 'application/json; charset=utf-8',
                  status: '200 OK',
          Severity: Major
          Found in fixtures/method_all_state_closed.js and 1 other location - About 3 hrs to fix
          fixtures/method_all_state_open.js on lines 656..679

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

          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 66 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: Major
          Found in Gruntfile.js - About 2 hrs to fix

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

            nock('http://localhost:8800')
                .get('/services/test-github-issues/password/manager/get?key=github')
                .reply(200, {
                    "target": "/services/test-github-issues/password/manager/get",
                    "query": "key=github",
            Severity: Major
            Found in fixtures/method_all_with_all_props.js and 3 other locations - About 1 hr to fix
            fixtures/method_all.js on lines 3..16
            fixtures/method_all_state_closed.js on lines 3..16
            fixtures/method_all_state_open.js on lines 3..16

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

            nock('http://localhost:8800')
                .get('/services/test-github-issues/password/manager/get?key=github')
                .reply(200, {
                    "target": "/services/test-github-issues/password/manager/get",
                    "query": "key=github",
            Severity: Major
            Found in fixtures/method_all_state_closed.js and 3 other locations - About 1 hr to fix
            fixtures/method_all.js on lines 3..16
            fixtures/method_all_state_open.js on lines 3..16
            fixtures/method_all_with_all_props.js on lines 3..16

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

            nock('http://localhost:8800')
                .get('/services/test-github-issues/password/manager/get?key=github')
                .reply(200, {
                    "target": "/services/test-github-issues/password/manager/get",
                    "query": "key=github",
            Severity: Major
            Found in fixtures/method_all.js and 3 other locations - About 1 hr to fix
            fixtures/method_all_state_closed.js on lines 3..16
            fixtures/method_all_state_open.js on lines 3..16
            fixtures/method_all_with_all_props.js on lines 3..16

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

            nock('http://localhost:8800')
                .get('/services/test-github-issues/password/manager/get?key=github')
                .reply(200, {
                    "target": "/services/test-github-issues/password/manager/get",
                    "query": "key=github",
            Severity: Major
            Found in fixtures/method_all_state_open.js and 3 other locations - About 1 hr to fix
            fixtures/method_all.js on lines 3..16
            fixtures/method_all_state_closed.js on lines 3..16
            fixtures/method_all_with_all_props.js on lines 3..16

            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

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

            exports.callWithCache = function (id, get, callback) {
                exports.memoryCache.wrap(id, function (setInMemoryCache) {
                    var eTag, writeToCacheAndReturn;
            
                    writeToCacheAndReturn = function (response) {
            Severity: Minor
            Found in src/service.js - About 1 hr to fix

              Function getCredentials has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              exports.getCredentials = function (params, callback) {
                  var service, project, serviceParams, key;
              
                  service = this.defaultCredentialService;
                  project = params.config.name;
              Severity: Minor
              Found in src/service.js - About 35 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                      if (params.config.github_issues.auth.service) {
                          service = params.config.github_issues.auth.service;
                      }
              Severity: Minor
              Found in src/service.js and 2 other locations - About 35 mins to fix
              src/service.js on lines 26..28
              src/service.js on lines 30..32

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

              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 (params.config.github_issues.auth.project) {
                          project = params.config.github_issues.auth.project;
                      }
              Severity: Minor
              Found in src/service.js and 2 other locations - About 35 mins to fix
              src/service.js on lines 22..24
              src/service.js on lines 30..32

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

              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