In my Rails app, I tried to run Rubocop to check for problems. It gave me an error like this : Assignment Branch Condition size for show is too high. Here's my code :
def create
@field = Api::AnalyticsQueryBuilderMetadataService::Field.create(field_params, { type: 'fields' })
if @field['message'].nil?
redirect_to fields_index_path(entityId: field_params[:entityId], entity_name: field_params[:entity_name], schemaId: field_params[:schemaId],
schemaMnemonic: field_params[:schemaMnemonic], schemaName: field_params[:schemaName])
else
flash[:notice] = @field
redirect_to new_field_path(entityId: field_params[:entityId], entity_name: field_params[:entity_name], schemaId: field_params[:schemaId],
schemaMnemonic: field_params[:schemaMnemonic], schemaName: field_params[:schemaName])
end
end
How to solve such error, this error is not affecting the user, but during Zenkin build, it fails, How to solve it.