gooddata/gooddata-ruby

View on GitHub
lib/gooddata/models/schedule.rb

Summary

Maintainability
D
2 days
Test Coverage

Class Schedule has 55 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Schedule < Rest::Resource
    attr_reader :dirty, :json

    SCHEDULE_TEMPLATE = {
      :schedule => {
Severity: Major
Found in lib/gooddata/models/schedule.rb - About 7 hrs to fix

    File schedule.rb has 351 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require_relative '../rest/resource'
    require_relative '../mixins/rest_resource'
    require_relative '../helpers/global_helpers'
    
    require_relative 'execution'
    Severity: Minor
    Found in lib/gooddata/models/schedule.rb - About 4 hrs to fix

      Method create has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

            def create(process_id, trigger, executable, options = {})
              c, project = GoodData.get_client_and_project(options)
      
              fail 'Process ID has to be provided' if process_id.blank?
      
      
      Severity: Minor
      Found in lib/gooddata/models/schedule.rb - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method create has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def create(process_id, trigger, executable, options = {})
              c, project = GoodData.get_client_and_project(options)
      
              fail 'Process ID has to be provided' if process_id.blank?
      
      
      Severity: Minor
      Found in lib/gooddata/models/schedule.rb - About 1 hr to fix

        Method save has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def save
              fail 'A timezone has to be provided' if timezone.blank?
              fail 'Schedule type has to be provided' if schedule_type.blank?
              rewrite_deprecated_params
              if @dirty
        Severity: Minor
        Found in lib/gooddata/models/schedule.rb - About 55 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method executions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def executions
              return nil unless @json
              url = @json['schedule']['links']['executions']
              Enumerator.new do |y|
                loop do
        Severity: Minor
        Found in lib/gooddata/models/schedule.rb - About 35 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        There are no issues that match your filters.

        Category
        Status