djezzzl/database_consistency

View on GitHub

Showing 12 of 24 total issues

Function exports has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Confirmed

module.exports = function(api) {
  var validEnv = ['development', 'test', 'production']
  var currentEnv = api.env()
  var isDevelopmentEnv = api.env('development')
  var isProductionEnv = api.env('production')
Severity: Major
Found in rails6-example/babel.config.js - About 2 hrs to fix

    Method check has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

          def check # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
            Helper.parent_models.flat_map do |model|
              DebugContext.with(model: model.name) do
                next unless configuration.enabled?('DatabaseConsistencyDatabases', Helper.database_name(model)) &&
                            configuration.enabled?(model.name.to_s)

    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 check has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

          def check # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity
            Helper.parent_models.flat_map do |model|
              DebugContext.with(model: model.name) do
                next unless configuration.enabled?('DatabaseConsistencyDatabases', Helper.database_name(model)) &&
                            configuration.enabled?(model.name.to_s)
    Severity: Minor
    Found in lib/database_consistency/processors/validators_processor.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 report has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

          def report(catch_errors: true)
            return unless preconditions
    
            @report ||= check
          rescue StandardError => e
    Severity: Minor
    Found in lib/database_consistency/checkers/base_checker.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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def run(*args, **opts) # rubocop:disable Metrics/MethodLength
          configuration = Configuration.new(*args)
          reports = Processors.reports(configuration)
    
          if opts[:autofix]
    Severity: Minor
    Found in lib/database_consistency.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

    Method check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def check # rubocop:disable Metrics/MethodLength,  Metrics/AbcSize
            if converted_type(associated_column).cover?(converted_type(primary_column))
              report_template(:ok)
            elsif !(converted_type(associated_column).numeric? && converted_type(primary_column).numeric?)
              report_template(:ok)

    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 check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def check # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
            Helper.models.flat_map do |model|
              DebugContext.with(model: model.name) do
                next unless configuration.enabled?('DatabaseConsistencyDatabases', Helper.database_name(model)) &&
                            configuration.enabled?(model.name.to_s)
    Severity: Minor
    Found in lib/database_consistency/processors/associations_processor.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 check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def check # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
            Helper.project_models.flat_map do |model|
              DebugContext.with(model: model.name) do
                next unless configuration.enabled?('DatabaseConsistencyDatabases', Helper.database_name(model)) &&
                            configuration.enabled?(model.name.to_s)
    Severity: Minor
    Found in lib/database_consistency/processors/models_processor.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 check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def check # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
            Helper.parent_models.flat_map do |model|
              DebugContext.with(model: model.name) do
                next unless configuration.enabled?('DatabaseConsistencyDatabases', Helper.database_name(model)) &&
                            configuration.enabled?(model.name.to_s)
    Severity: Minor
    Found in lib/database_consistency/processors/indexes_processor.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 enabled? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def enabled?(*path)
          current = configuration
    
          value = global_enabling
    
    
    Severity: Minor
    Found in lib/database_consistency/configuration.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 check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def check # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
            Helper.parent_models.flat_map do |model|
              DebugContext.with(model: model.name) do
                next unless configuration.enabled?('DatabaseConsistencyDatabases', Helper.database_name(model)) &&
                            configuration.enabled?(model.name.to_s)
    Severity: Minor
    Found in lib/database_consistency/processors/columns_processor.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 check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def check # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
            Helper.models.flat_map do |model|
              DebugContext.with(model: model.name) do
                next unless configuration.enabled?('DatabaseConsistencyDatabases', Helper.database_name(model)) &&
                            configuration.enabled?(model.name.to_s)
    Severity: Minor
    Found in lib/database_consistency/processors/enums_processor.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

    Severity
    Category
    Status
    Source
    Language