Showing 20 of 20 total issues
Block has too many lines. [56/25] Open
field :search, SearchType, null: false, description: 'Search for timdex records' do argument :searchterm, String, required: false, default_value: nil, description: 'Query all searchable fields' argument :citation, String, required: false, default_value: nil, description: 'Search by citation information' argument :contributors, String, required: false, default_value: nil,
- Read upRead up
- Exclude checks
Cyclomatic complexity for filters is too high. [16/7] Open
def filters(params) f = [] if params[:contributors_filter].present? params[:contributors_filter].each do |p|
- Read upRead up
- Exclude checks
Perceived complexity for filters is too high. [16/8] Open
def filters(params) f = [] if params[:contributors_filter].present? params[:contributors_filter].each do |p|
- Read upRead up
- Exclude checks
Method has too many lines. [14/10] Open
def ensure_hash(ambiguous_param) case ambiguous_param when String if ambiguous_param.present? ensure_hash(JSON.parse(ambiguous_param))
- Read upRead up
- Exclude checks
Method has too many lines. [13/10] Open
def execute variables = ensure_hash(params[:variables]) query = params[:query] operation_name = params[:operationName] context = {
- Read upRead up
- Exclude checks
Method construct_query
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def construct_query(searchterm, citation, contributors, funding_information, geodistance, geobox, identifiers, locations, subjects, title, source, boolean_type, filters)
Avoid parameter lists longer than 5 parameters. [15/5] Open
def search(searchterm:, citation:, contributors:, funding_information:, geodistance:, geobox:, identifiers:, locations:, subjects:, title:, index:, source:, from:, boolean_type:, **filters)
- Read upRead up
- Exclude checks
Avoid parameter lists longer than 5 parameters. [13/5] Open
def construct_query(searchterm, citation, contributors, funding_information, geodistance, geobox, identifiers, locations, subjects, title, source, boolean_type, filters)
- Read upRead up
- Exclude checks
Assignment Branch Condition size for collapse_buckets is too high. [<0, 24, 0> 24/17] Open
def collapse_buckets(es_aggs) { access_to_files: es_aggs['access_to_files']['only_file_access']['access_types']['buckets'], contributors: es_aggs['contributors']['contributor_names']['buckets'], source: es_aggs['source']['buckets'],
- Read upRead up
- Exclude checks
Use ENV.fetch('JWT_SECRET_KEY')
or ENV.fetch('JWT_SECRET_KEY', nil)
instead of ENV['JWT_SECRET_KEY']
. Open
JWT.encode(payload, ENV['JWT_SECRET_KEY'])
- Read upRead up
- Exclude checks
Omit the hash value. Open
result = TimdexSchema.execute(query, variables: variables,
- Read upRead up
- Exclude checks
Assignment Branch Condition size for filters is too high. [<7, 49, 15> 51.72/17] Open
def filters(params) f = [] if params[:contributors_filter].present? params[:contributors_filter].each do |p|
- Read upRead up
- Exclude checks
Prefer keyword arguments for arguments with a boolean default value; use highlight: false
instead of highlight = false
. Open
def search(from, params, client, highlight = false, index = nil)
- Read upRead up
- Exclude checks
Use ENV.fetch('JWT_SECRET_KEY')
or ENV.fetch('JWT_SECRET_KEY', nil)
instead of ENV['JWT_SECRET_KEY']
. Open
JWT.decode(token, ENV['JWT_SECRET_KEY']).first
- Read upRead up
- Exclude checks
Assignment Branch Condition size for matches is too high. [<1, 19, 3> 19.26/17] Open
def matches m = [] if @params[:q].present? m << { multi_match: {
- Read upRead up
- Exclude checks
Use ENV.fetch('PREFERRED_DOMAIN')
or ENV.fetch('PREFERRED_DOMAIN', nil)
instead of ENV['PREFERRED_DOMAIN']
. Open
redirect_to "https://#{ENV['PREFERRED_DOMAIN']}", status: :moved_permanently, allow_other_host: true
- Read upRead up
- Exclude checks
Assignment Branch Condition size for construct_query is too high. [<22, 31, 0> 38.01/17] Open
def construct_query(searchterm, citation, contributors, funding_information, geodistance, geobox, identifiers, locations, subjects, title, source, boolean_type, filters) query = {} query[:q] = searchterm query[:boolean_type] = boolean_type
- Read upRead up
- Exclude checks