remomueller/aqueduct-mysql

View on GitHub

Showing 6 of 6 total issues

Method get_all_values_for_column has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

      def get_all_values_for_column(table, column)
        values = []
        error = ''
        begin
          db_connection = Mysql2::Client.new(host: @source.host, username: @source.username, password: @source.password, database: @source.database, port: @source.port)
Severity: Minor
Found in lib/aqueduct/wrappers/mysql.rb - About 2 hrs 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 count has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

      def count(query_concepts, conditions, tables, join_conditions, concept_to_count)
        result = 0
        error = ''
        sql_conditions = ''
        begin
Severity: Minor
Found in lib/aqueduct/wrappers/mysql.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 get_all_values_for_column has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def get_all_values_for_column(table, column)
        values = []
        error = ''
        begin
          db_connection = Mysql2::Client.new(host: @source.host, username: @source.username, password: @source.password, database: @source.database, port: @source.port)
Severity: Minor
Found in lib/aqueduct/wrappers/mysql.rb - About 1 hr to fix

    Method column_values has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

          def column_values(table, column)
            error = ''
            result = []
            begin
              db_connection = Mysql2::Client.new(host: @source.host, username: @source.username, password: @source.password, database: @source.database, port: @source.port)
    Severity: Minor
    Found in lib/aqueduct/wrappers/mysql.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 get_table_metadata has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def get_table_metadata
            result = {}
            error = ''
            begin
              db_connection = Mysql2::Client.new(host: @source.host, username: @source.username, password: @source.password, database: @source.database, port: @source.port)
    Severity: Minor
    Found in lib/aqueduct/wrappers/mysql.rb - About 1 hr to fix

      Method count has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def count(query_concepts, conditions, tables, join_conditions, concept_to_count)
      Severity: Minor
      Found in lib/aqueduct/wrappers/mysql.rb - About 35 mins to fix
        Severity
        Category
        Status
        Source
        Language