gooddata/gooddata-ruby

View on GitHub
lib/gooddata/models/blueprint/project_blueprint.rb

Summary

Maintainability
D
2 days
Test Coverage

Class ProjectBlueprint has 60 methods (exceeds 20 allowed). Consider refactoring.
Open

    class ProjectBlueprint
      attr_accessor :data

      # Instantiates a project blueprint either from a file or from a string containing
      # json. Also eats Hash for convenience.
Severity: Major
Found in lib/gooddata/models/blueprint/project_blueprint.rb - About 1 day to fix

    File project_blueprint.rb has 459 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module GoodData
      module Model
        class ProjectBlueprint
          attr_accessor :data
    
    
    Severity: Minor
    Found in lib/gooddata/models/blueprint/project_blueprint.rb - About 7 hrs to fix

      Method lint has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def lint(full = false)
              errors = []
              find_star_centers.each do |dataset|
                next unless dataset.anchor?
                errors << {
      Severity: Minor
      Found in lib/gooddata/models/blueprint/project_blueprint.rb - About 1 hr to fix

        Method merge has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

              def merge(a_blueprint)
                temp_blueprint = dup
                return temp_blueprint unless a_blueprint
                a_blueprint.datasets.each do |dataset|
                  if temp_blueprint.dataset?(dataset.id)
        Severity: Minor
        Found in lib/gooddata/models/blueprint/project_blueprint.rb - About 45 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 datasets has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def datasets(id = :all, options = {})
                id = id.respond_to?(:id) ? id.id : id
                dss = ProjectBlueprint.datasets(self, options).map do |d|
                  case d[:type]
                  when :date_dimension
        Severity: Minor
        Found in lib/gooddata/models/blueprint/project_blueprint.rb - About 25 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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def initialize(init_data)
                some_data = if init_data.respond_to?(:project_blueprint?) && init_data.project_blueprint?
                              init_data.to_hash
                            elsif init_data.respond_to?(:to_blueprint)
                              init_data.to_blueprint.to_hash
        Severity: Minor
        Found in lib/gooddata/models/blueprint/project_blueprint.rb - About 25 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 == has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def ==(other)
                # to_hash == other.to_hash
                return false unless id == other.id
                return false unless title == other.title
                left = to_hash[:datasets].map { |d| d[:columns].to_set }.to_set
        Severity: Minor
        Found in lib/gooddata/models/blueprint/project_blueprint.rb - About 25 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