cequel/cequel

View on GitHub
lib/cequel/metal/request_logger.rb

Summary

Maintainability
A
0 mins
Test Coverage

Line is too long. [113/80]
Open

            statement.statements.each { |s| batch_stmt << "\n" << sanitize(s.cql, limit_value_length(s.params)) }
Severity: Minor
Found in lib/cequel/metal/request_logger.rb by rubocop

Add an empty line after magic comments.
Open

module Cequel
Severity: Minor
Found in lib/cequel/metal/request_logger.rb by rubocop

Checks for a newline after the final magic comment.

Example:

# good
# frozen_string_literal: true

# Some documentation for Person
class Person
  # Some code
end

# bad
# frozen_string_literal: true
# Some documentation for Person
class Person
  # Some code
end

Prefer annotated tokens (like %<foo>s</foo>) over unannotated tokens (like %s).
Open

        format('%s (%s) %s', label, timing, cql_for_log)
Severity: Minor
Found in lib/cequel/metal/request_logger.rb by rubocop

Use a consistent style for named format string tokens.

Note: unannotated style cop only works for strings which are passed as arguments to those methods: sprintf, format, %. The reason is that unannotated format is very similar to encoded URLs or Date/Time formatting strings.

Example: EnforcedStyle: annotated (default)

# bad
format('%{greeting}', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%<greeting>s', greeting: 'Hello')</greeting>

Example: EnforcedStyle: template

# bad
format('%<greeting>s', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%{greeting}', greeting: 'Hello')</greeting>

Example: EnforcedStyle: unannotated

# bad
format('%<greeting>s', greeting: 'Hello')
format('%{greeting}', 'Hello')

# good
format('%s', 'Hello')</greeting>

Line is too long. [83/80]
Open

            batch_stmt = "BEGIN #{'UNLOGGED ' if statement.type == :unlogged}BATCH"
Severity: Minor
Found in lib/cequel/metal/request_logger.rb by rubocop

Prefer annotated tokens (like %<foo>s</foo>) over unannotated tokens (like %s).
Open

        format('%s (%s) %s', label, timing, cql_for_log)
Severity: Minor
Found in lib/cequel/metal/request_logger.rb by rubocop

Use a consistent style for named format string tokens.

Note: unannotated style cop only works for strings which are passed as arguments to those methods: sprintf, format, %. The reason is that unannotated format is very similar to encoded URLs or Date/Time formatting strings.

Example: EnforcedStyle: annotated (default)

# bad
format('%{greeting}', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%<greeting>s', greeting: 'Hello')</greeting>

Example: EnforcedStyle: template

# bad
format('%<greeting>s', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%{greeting}', greeting: 'Hello')</greeting>

Example: EnforcedStyle: unannotated

# bad
format('%<greeting>s', greeting: 'Hello')
format('%{greeting}', 'Hello')

# good
format('%s', 'Hello')</greeting>

Prefer annotated tokens (like %<foo>s</foo>) over unannotated tokens (like %s).
Open

        format('%s (%s) %s', label, timing, cql_for_log)
Severity: Minor
Found in lib/cequel/metal/request_logger.rb by rubocop

Use a consistent style for named format string tokens.

Note: unannotated style cop only works for strings which are passed as arguments to those methods: sprintf, format, %. The reason is that unannotated format is very similar to encoded URLs or Date/Time formatting strings.

Example: EnforcedStyle: annotated (default)

# bad
format('%{greeting}', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%<greeting>s', greeting: 'Hello')</greeting>

Example: EnforcedStyle: template

# bad
format('%<greeting>s', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%{greeting}', greeting: 'Hello')</greeting>

Example: EnforcedStyle: unannotated

# bad
format('%<greeting>s', greeting: 'Hello')
format('%{greeting}', 'Hello')

# good
format('%s', 'Hello')</greeting>

Unnecessary utf-8 encoding comment.
Open

# -*- encoding : utf-8 -*-
Severity: Minor
Found in lib/cequel/metal/request_logger.rb by rubocop

Avoid the use of the case equality operator ===.
Open

        bind_vars.map { |it| String === it ? limit_length(it) : it }
Severity: Minor
Found in lib/cequel/metal/request_logger.rb by rubocop

This cop checks for uses of the case equality operator(===).

Example:

# bad
Array === something
(1..100) === 7
/something/ === some_string

# good
something.is_a?(Array)
(1..100).include?(7)
some_string =~ /something/

There are no issues that match your filters.

Category
Status