gitlabhq/gitlabhq

View on GitHub
lib/api/helpers/services_helpers.rb

Summary

Maintainability
F
6 days
Test Coverage

Method services has 538 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def self.services
        {
          'asana' => [
            {
              required: true,
Severity: Major
Found in lib/api/helpers/services_helpers.rb - About 2 days to fix

    File services_helpers.rb has 729 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module API
      module Helpers
        # Helpers module for API::Services
        #
        # The data structures inside this model are returned using class methods,
    Severity: Major
    Found in lib/api/helpers/services_helpers.rb - About 1 day to fix

      Method chat_notification_events has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def self.chat_notification_events
              [
                {
                  required: false,
                  name: :push_events,
      Severity: Minor
      Found in lib/api/helpers/services_helpers.rb - About 2 hrs to fix

        Method chat_notification_channels has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def self.chat_notification_channels
                [
                  {
                    required: false,
                    name: :push_channel,
        Severity: Minor
        Found in lib/api/helpers/services_helpers.rb - About 2 hrs to fix

          Method service_classes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def self.service_classes
                  [
                    ::AsanaService,
                    ::AssemblaService,
                    ::BambooService,
          Severity: Minor
          Found in lib/api/helpers/services_helpers.rb - About 1 hr to fix

            Method chat_notification_settings has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def self.chat_notification_settings
                    [
                      {
                        required: true,
                        name: :webhook,
            Severity: Minor
            Found in lib/api/helpers/services_helpers.rb - About 1 hr to fix

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

                    def self.chat_notification_events
                      [
                        {
                          required: false,
                          name: :push_events,
              Severity: Major
              Found in lib/api/helpers/services_helpers.rb and 1 other location - About 2 hrs to fix
              lib/api/helpers/services_helpers.rb on lines 50..100

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

              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

                    def self.chat_notification_channels
                      [
                        {
                          required: false,
                          name: :push_channel,
              Severity: Major
              Found in lib/api/helpers/services_helpers.rb and 1 other location - About 2 hrs to fix
              lib/api/helpers/services_helpers.rb on lines 103..153

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

              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

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

                          {
                            required: true,
                            name: :new_issue_url,
                            type: String,
                            desc: 'New issue URL'
              Severity: Minor
              Found in lib/api/helpers/services_helpers.rb and 1 other location - About 55 mins to fix
              lib/api/helpers/services_helpers.rb on lines 213..242

              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

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

                          {
                            required: true,
                            name: :new_issue_url,
                            type: String,
                            desc: 'New issue URL'
              Severity: Minor
              Found in lib/api/helpers/services_helpers.rb and 1 other location - About 55 mins to fix
              lib/api/helpers/services_helpers.rb on lines 285..314

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

                          {
                            required: true,
                            name: :bamboo_url,
                            type: String,
                            desc: 'Bamboo root URL like https://bamboo.example.com'
              Severity: Minor
              Found in lib/api/helpers/services_helpers.rb and 1 other location - About 40 mins to fix
              lib/api/helpers/services_helpers.rb on lines 669..692

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

              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

                          {
                            required: true,
                            name: :teamcity_url,
                            type: String,
                            desc: 'TeamCity root URL like https://teamcity.example.com'
              Severity: Minor
              Found in lib/api/helpers/services_helpers.rb and 1 other location - About 40 mins to fix
              lib/api/helpers/services_helpers.rb on lines 187..210

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

              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

                          {
                            required: true,
                            name: :token,
                            type: String,
                            desc: 'Campfire token'
              Severity: Minor
              Found in lib/api/helpers/services_helpers.rb and 2 other locations - About 20 mins to fix
              lib/api/helpers/services_helpers.rb on lines 345..362
              lib/api/helpers/services_helpers.rb on lines 528..545

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

              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

                          {
                            required: true,
                            name: :recipients,
                            type: String,
                            desc: 'Comma-separated list of recipient email addresses'
              Severity: Minor
              Found in lib/api/helpers/services_helpers.rb and 2 other locations - About 20 mins to fix
              lib/api/helpers/services_helpers.rb on lines 265..282
              lib/api/helpers/services_helpers.rb on lines 528..545

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

              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

                          {
                            required: true,
                            name: :project_url,
                            type: String,
                            desc: 'The project URL'
              Severity: Minor
              Found in lib/api/helpers/services_helpers.rb and 3 other locations - About 20 mins to fix
              lib/api/helpers/services_helpers.rb on lines 245..262
              lib/api/helpers/services_helpers.rb on lines 325..342
              lib/api/helpers/services_helpers.rb on lines 508..525

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

              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

                          {
                            required: true,
                            name: :recipients,
                            type: String,
                            desc: 'Comma-separated list of recipient email addresses'
              Severity: Minor
              Found in lib/api/helpers/services_helpers.rb and 2 other locations - About 20 mins to fix
              lib/api/helpers/services_helpers.rb on lines 265..282
              lib/api/helpers/services_helpers.rb on lines 345..362

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

              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

                          {
                            required: true,
                            name: :token,
                            type: String,
                            desc: 'Drone CI token'
              Severity: Minor
              Found in lib/api/helpers/services_helpers.rb and 3 other locations - About 20 mins to fix
              lib/api/helpers/services_helpers.rb on lines 245..262
              lib/api/helpers/services_helpers.rb on lines 508..525
              lib/api/helpers/services_helpers.rb on lines 628..645

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

              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

                          {
                            required: true,
                            name: :username,
                            type: String,
                            desc: 'The username'
              Severity: Minor
              Found in lib/api/helpers/services_helpers.rb and 3 other locations - About 20 mins to fix
              lib/api/helpers/services_helpers.rb on lines 245..262
              lib/api/helpers/services_helpers.rb on lines 325..342
              lib/api/helpers/services_helpers.rb on lines 628..645

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

              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

                          {
                            required: true,
                            name: :token,
                            type: String,
                            desc: 'Buildkite project GitLab token'
              Severity: Minor
              Found in lib/api/helpers/services_helpers.rb and 3 other locations - About 20 mins to fix
              lib/api/helpers/services_helpers.rb on lines 325..342
              lib/api/helpers/services_helpers.rb on lines 508..525
              lib/api/helpers/services_helpers.rb on lines 628..645

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

              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