publiclab/plots2

View on GitHub

Showing 686 of 688 total issues

Trailing whitespace detected.
Open

      revision['timestamp'] = DateTime.now.to_i # odd assignment needed due to legacy Drupal column types 
Severity: Minor
Found in app/controllers/notes_controller.rb by rubocop

Use tr instead of gsub.
Open

    tags_order = 'CASE WHEN name LIKE ? OR name LIKE ? THEN 1 WHEN name LIKE ? OR name LIKE ? THEN 2 WHEN name LIKE ? OR name LIKE ? THEN 4 ELSE 3 END', "#{query}", "#{query.to_s.gsub(' ', '-')}", "#{query}%", "#{query.to_s.gsub(' ', '-')}%", "%#{query}", "%#{query.to_s.gsub(' ', '-')}"
Severity: Minor
Found in app/services/search_service.rb by rubocop

This cop identifies places where gsub can be replaced by tr or delete.

Example:

# bad
'abc'.gsub('b', 'd')
'abc'.gsub('a', '')
'abc'.gsub(/a/, 'd')
'abc'.gsub!('a', 'd')

# good
'abc'.gsub(/.*/, 'a')
'abc'.gsub(/a+/, 'd')
'abc'.tr('b', 'd')
'a b c'.delete(' ')

TODO found
Open

    <!-- TODO: could be resolved with `node.node.main_image` but applying quick fix here -->

TODO found
Open

  # TODO: make less redundant with https://github.com/publiclab/plots2/blob/main/app/helpers/application_helper.rb#L3

TODO found
Open

        # TODO: evaluate if disabling this caching action actually speeds things up?
Severity: Minor
Found in app/api/srch/search.rb by fixme

TODO found
Open

        // TODO: create multicase for "CREATE NEW COMMENT FORM" in reducers.js
Severity
Category
Status
Source
Language