Showing 11 of 11 total issues
Method start_job
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_job(operation, sobject, records, external_field=nil)
attachment_keys = Executrix::Helper.attachment_keys(records)
content_type = 'CSV'
zip_filename = nil
Method records_to_csv
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def records_to_csv records
file_mock = StringIO.new
csv_client = CSV.new(file_mock, CSV_OPTIONS)
all_headers = []
all_rows = []
- Read upRead up
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 start_job
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def start_job(operation, sobject, records, external_field=nil)
attachment_keys = Executrix::Helper.attachment_keys(records)
content_type = 'CSV'
zip_filename = nil
- Read upRead up
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 create_job
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.create_job instance, session_id, operation, sobject, content_type, api_version, external_field = nil
Method query_batch_result_data
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.query_batch_result_data(instance,
session_id,
job_id,
batch_id,
result_id,
Method add_batch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.add_batch instance, session_id, job_id, data, api_version
Method query_batch_result_id
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.query_batch_result_id instance, session_id, job_id, batch_id, api_version
Method add_file_upload_batch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_file_upload_batch instance, session_id, job_id, data, api_version
Method query_batch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.query_batch instance, session_id, job_id, batch_id, api_version
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize http_method, host, path, body, headers
Method transform_values!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def transform_values! records, keys
keys.each do |key|
records.each do |record|
file_handle = record[key]
if file_handle
- Read upRead up
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"