gitlabhq/gitlabhq

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

Summary

Maintainability
F
6 days
Test Coverage

Method services has 564 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 755 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 32 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

            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 51..101

            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 104..154

            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 214..243

            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 286..315

            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: :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 188..211

            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: :namespace,
                          type: String,
                          desc: 'The Kubernetes namespace to use'
            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 629..652

            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: :new_issue_url,
                          type: String,
                          desc: 'The new issue URL'
            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 493..516

            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 696..719

            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: '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 326..343
            lib/api/helpers/services_helpers.rb on lines 535..552
            lib/api/helpers/services_helpers.rb on lines 655..672

            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 246..263
            lib/api/helpers/services_helpers.rb on lines 326..343
            lib/api/helpers/services_helpers.rb on lines 535..552

            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: :recipients,
                          type: String,
                          desc: 'Comma-separated list of recipient email addresses'
            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 13..30
            lib/api/helpers/services_helpers.rb on lines 266..283
            lib/api/helpers/services_helpers.rb on lines 555..572

            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: :webhook,
                        type: String,
                        desc: 'The chat webhook'
            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 266..283
            lib/api/helpers/services_helpers.rb on lines 346..363
            lib/api/helpers/services_helpers.rb on lines 555..572

            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: :recipients,
                          type: String,
                          desc: 'Comma-separated list of recipient email addresses'
            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 13..30
            lib/api/helpers/services_helpers.rb on lines 266..283
            lib/api/helpers/services_helpers.rb on lines 346..363

            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 246..263
            lib/api/helpers/services_helpers.rb on lines 535..552
            lib/api/helpers/services_helpers.rb on lines 655..672

            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: 'Campfire 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 13..30
            lib/api/helpers/services_helpers.rb on lines 346..363
            lib/api/helpers/services_helpers.rb on lines 555..572

            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 246..263
            lib/api/helpers/services_helpers.rb on lines 326..343
            lib/api/helpers/services_helpers.rb on lines 655..672

            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