gitlabhq/gitlabhq

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

Summary

Maintainability
F
6 days
Test Coverage

Method services has 559 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 756 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 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def self.chat_notification_events
              [
                {
                  required: false,
                  name: :push_events,
      Severity: Major
      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

              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 219..248

              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 291..320

              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: :recipients,
                            type: String,
                            desc: 'Comma-separated list of recipient email addresses'
              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 12..35

              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: :webhook,
                          type: String,
                          desc: 'The chat webhook'
              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 351..374

              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 193..216

              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: :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 687..710

              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 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 251..268
              lib/api/helpers/services_helpers.rb on lines 526..543
              lib/api/helpers/services_helpers.rb on lines 646..663

              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 251..268
              lib/api/helpers/services_helpers.rb on lines 331..348
              lib/api/helpers/services_helpers.rb on lines 646..663

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

                          {
                            required: true,
                            name: :token,
                            type: String,
                            desc: 'Campfire token'
              Severity: Minor
              Found in lib/api/helpers/services_helpers.rb and 1 other location - About 20 mins to fix
              lib/api/helpers/services_helpers.rb on lines 546..563

              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 251..268
              lib/api/helpers/services_helpers.rb on lines 331..348
              lib/api/helpers/services_helpers.rb on lines 526..543

              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 2 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 1 other location - About 20 mins to fix
              lib/api/helpers/services_helpers.rb on lines 271..288

              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 331..348
              lib/api/helpers/services_helpers.rb on lines 526..543
              lib/api/helpers/services_helpers.rb on lines 646..663

              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