dblock/slack-ruby-client

View on GitHub

Showing 131 of 131 total issues

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

          def conversations_archive(options = {})
            raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
            options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
            post('conversations.archive', options)
Severity: Major
Found in lib/slack/web/api/endpoints/conversations.rb and 11 other locations - About 25 mins to fix
lib/slack/web/api/endpoints/conversations.rb on lines 65..68
lib/slack/web/api/endpoints/conversations.rb on lines 143..146
lib/slack/web/api/endpoints/conversations.rb on lines 180..183
lib/slack/web/api/endpoints/conversations.rb on lines 193..196
lib/slack/web/api/endpoints/conversations.rb on lines 223..226
lib/slack/web/api/endpoints/conversations.rb on lines 419..422
lib/slack/web/api/endpoints/pins.rb on lines 18..21
lib/slack/web/api/endpoints/pins.rb on lines 31..34
lib/slack/web/api/endpoints/pins.rb on lines 46..49
lib/slack/web/api/endpoints/reactions.rb on lines 89..92
lib/slack/web/api/endpoints/users.rb on lines 76..79

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

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

          def admin_conversations_setConversationPrefs(options = {})
            raise ArgumentError, 'Required arguments :channel_id missing' if options[:channel_id].nil?
            raise ArgumentError, 'Required arguments :prefs missing' if options[:prefs].nil?
            options = encode_options_as_json(options, %i[prefs])
            post('admin.conversations.setConversationPrefs', options)
Severity: Major
Found in lib/slack/web/api/endpoints/admin_conversations.rb and 5 other locations - About 20 mins to fix
lib/slack/web/api/endpoints/apps_manifest.rb on lines 55..59
lib/slack/web/api/endpoints/dialog.rb on lines 18..22
lib/slack/web/api/endpoints/functions.rb on lines 33..37
lib/slack/web/api/endpoints/views.rb on lines 38..42
lib/slack/web/api/endpoints/workflows.rb on lines 32..36

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

module Slack
  module Web
    module Api
      module Mixins
        module Conversations
Severity: Minor
Found in lib/slack/web/api/mixins/conversations.id.rb and 1 other location - About 20 mins to fix
lib/slack/web/api/mixins/users.id.rb on lines 4..19

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

          def apps_manifest_update(options = {})
            raise ArgumentError, 'Required arguments :app_id missing' if options[:app_id].nil?
            raise ArgumentError, 'Required arguments :manifest missing' if options[:manifest].nil?
            options = encode_options_as_json(options, %i[manifest])
            post('apps.manifest.update', options)
Severity: Major
Found in lib/slack/web/api/endpoints/apps_manifest.rb and 5 other locations - About 20 mins to fix
lib/slack/web/api/endpoints/admin_conversations.rb on lines 290..294
lib/slack/web/api/endpoints/dialog.rb on lines 18..22
lib/slack/web/api/endpoints/functions.rb on lines 33..37
lib/slack/web/api/endpoints/views.rb on lines 38..42
lib/slack/web/api/endpoints/workflows.rb on lines 32..36

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

          def dialog_open(options = {})
            raise ArgumentError, 'Required arguments :dialog missing' if options[:dialog].nil?
            raise ArgumentError, 'Required arguments :trigger_id missing' if options[:trigger_id].nil?
            options = encode_options_as_json(options, %i[dialog])
            post('dialog.open', options)
Severity: Major
Found in lib/slack/web/api/endpoints/dialog.rb and 5 other locations - About 20 mins to fix
lib/slack/web/api/endpoints/admin_conversations.rb on lines 290..294
lib/slack/web/api/endpoints/apps_manifest.rb on lines 55..59
lib/slack/web/api/endpoints/functions.rb on lines 33..37
lib/slack/web/api/endpoints/views.rb on lines 38..42
lib/slack/web/api/endpoints/workflows.rb on lines 32..36

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

module Slack
  module Web
    module Api
      module Mixins
        module Users
Severity: Minor
Found in lib/slack/web/api/mixins/users.id.rb and 1 other location - About 20 mins to fix
lib/slack/web/api/mixins/conversations.id.rb on lines 4..19

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

          def functions_completeSuccess(options = {})
            raise ArgumentError, 'Required arguments :function_execution_id missing' if options[:function_execution_id].nil?
            raise ArgumentError, 'Required arguments :outputs missing' if options[:outputs].nil?
            options = encode_options_as_json(options, %i[outputs])
            post('functions.completeSuccess', options)
Severity: Major
Found in lib/slack/web/api/endpoints/functions.rb and 5 other locations - About 20 mins to fix
lib/slack/web/api/endpoints/admin_conversations.rb on lines 290..294
lib/slack/web/api/endpoints/apps_manifest.rb on lines 55..59
lib/slack/web/api/endpoints/dialog.rb on lines 18..22
lib/slack/web/api/endpoints/views.rb on lines 38..42
lib/slack/web/api/endpoints/workflows.rb on lines 32..36

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

          def workflows_stepFailed(options = {})
            raise ArgumentError, 'Required arguments :error missing' if options[:error].nil?
            raise ArgumentError, 'Required arguments :workflow_step_execute_id missing' if options[:workflow_step_execute_id].nil?
            options = encode_options_as_json(options, %i[error])
            post('workflows.stepFailed', options)
Severity: Major
Found in lib/slack/web/api/endpoints/workflows.rb and 5 other locations - About 20 mins to fix
lib/slack/web/api/endpoints/admin_conversations.rb on lines 290..294
lib/slack/web/api/endpoints/apps_manifest.rb on lines 55..59
lib/slack/web/api/endpoints/dialog.rb on lines 18..22
lib/slack/web/api/endpoints/functions.rb on lines 33..37
lib/slack/web/api/endpoints/views.rb on lines 38..42

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

          def views_publish(options = {})
            raise ArgumentError, 'Required arguments :user_id missing' if options[:user_id].nil?
            raise ArgumentError, 'Required arguments :view missing' if options[:view].nil?
            options = encode_options_as_json(options, %i[view])
            post('views.publish', options)
Severity: Major
Found in lib/slack/web/api/endpoints/views.rb and 5 other locations - About 20 mins to fix
lib/slack/web/api/endpoints/admin_conversations.rb on lines 290..294
lib/slack/web/api/endpoints/apps_manifest.rb on lines 55..59
lib/slack/web/api/endpoints/dialog.rb on lines 18..22
lib/slack/web/api/endpoints/functions.rb on lines 33..37
lib/slack/web/api/endpoints/workflows.rb on lines 32..36

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

  module Web
    module Api
      module Endpoints
        module Apps
          #
Severity: Minor
Found in lib/slack/web/api/endpoints/apps.rb and 1 other location - About 20 mins to fix
lib/slack/web/api/endpoints/files_comments.rb on lines 5..21

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

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

  module Web
    module Api
      module Endpoints
        module FilesComments
          #
Severity: Minor
Found in lib/slack/web/api/endpoints/files_comments.rb and 1 other location - About 20 mins to fix
lib/slack/web/api/endpoints/apps.rb on lines 5..21

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

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