Showing 829 of 829 total issues
Method validate_data
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_data(data)
case schema_type
when :json_schema
unless data.is_a?(Hash)
data =
Method validate_configuration
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_configuration
self.title = self.name if title.blank?
validators_classes = Hash.new { |h, k| h[k] = [] }
if validators.present?
validators.each { |validator| validators_classes[validator.class] << validator }
Method evolve_hash
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def evolve_hash(hash)
if (association = model.associations[field]) && association.referenced?
operators = {}
sub_criteria = {}
hash.each do |key, value|
Method detask
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def detask(message)
report = nil
case task = message.delete(:task)
when Class
task_class = task
Method process_ftp
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_ftp(opts)
result = nil
path = URI.decode(opts[:path])
username, password = check(opts[:template_parameters], :username, :password)
Method simple_translate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def simple_translate(message)
if translator.try(:source_handler)
options = {
object_ids: object_ids_from(message),
data_type: data_type_from(message),
Method build_indices
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_indices
unique_properties = self.unique_properties
indexed_properties = []
begin
records_model.collection.indexes.each do |index|
Method google_v4_refresh_token
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def google_v4_refresh_token(authorization)
if (refresh_token = authorization.refresh_token) && is_time_to_refresh?(authorization)
fail 'Missing client configuration' unless authorization.client
post = Setup::Connection.post('https://www.googleapis.com/oauth2/v4/token')
http_response = post.submit(
Method days
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def days
month = @solution[0]
weeks_days = @conf[:weeks_days]
weeks_days = (0..6).to_a if weeks_days.blank?
weeks_month = @conf[:weeks_month]
Method handle_delete_digest
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_delete_digest(controller)
query = where(controller.query_selector)
response =
if query.count == 1
item = query.first
Method method_missing
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def method_missing(symbol, *args, &block)
if METHODS.include?(symbol)
options =
if args.length == 1 && block
base_method_name =
Method query_selector
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def query_selector(selector = nil)
parse_query_params =
if selector
@criteria = nil
else
Method save_request_data
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save_request_data
@data_types ||= {}
@request_id = request.uuid
@webhook_body = request.body.read
@ns_slug = params[:ns]
Method read_from_store
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read_from_store(file, len)
cursor = file.cursor
return nil if cursor == file.length
chunk_size = file[:chunkSize]
current_chunk = cursor / chunk_size
Method json_value_of
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def json_value_of(value)
return value unless value.is_a?(String)
value = value.strip
if value.blank?
nil
Consider simplifying this complex logical expression. Open
if @ability.can?(action_symbol, options[:item] || options[:klass] || @item || klass) &&
(@oauth_scope.nil? || @oauth_scope.can?(action_symbol, options[:klass] || klass))
@access_token.hit if @access_token
else
success = false
Similar blocks of code found in 2 locations. Consider refactoring. Open
def check_name
if name.blank?
hash = JSON.parse(triggers)
triggered_fields = hash.keys
n = "#{self.data_type.custom_title} on #{triggered_fields.to_sentence}"
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 47.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def check_name
if name.blank?
hash = JSON.parse(triggers)
triggered_fields = hash.keys
n = "#{self.data_type.custom_title} on #{triggered_fields.to_sentence}"
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 47.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
def storage_size(scale = 1)
subtype_count = data_type.subtype? && data_type.count
data_type.all_data_type_storage_collections_names.inject(0) do |size, name|
s =
begin
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
def storage_size(scale = 1)
subtype_count = data_type.subtype? && data_type.count
data_type.all_data_type_storage_collections_names.inject(0) do |size, name|
s =
begin
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 46.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76