Skip to content

Commit

Permalink
Merge pull request #1937 from MushroomObserver/jdc-thread-offenses
Browse files Browse the repository at this point in the history
Thread offenses
  • Loading branch information
JoeCohen committed Feb 21, 2024
2 parents ca33c12 + 575e014 commit 930d963
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 54 deletions.
90 changes: 52 additions & 38 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit`
# on 2023-12-26 15:05:33 UTC using RuboCop version 1.59.0.
# on 2024-02-21 17:54:32 UTC using RuboCop version 1.60.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 3
# Offense count: 10
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Exclude:
- 'lib/core_extensions/action_view/log_subscriber.rb'

## Offense count: 3
Lint/DuplicateMethods:
Exclude:
- 'app/classes/query/modules/active_record.rb'
Expand Down Expand Up @@ -72,12 +80,12 @@ Lint/Void:
- 'app/classes/query/modules/sequence_operators.rb'
- 'app/models/observation.rb'

# Offense count: 293
# Offense count: 311
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 78

# Offense count: 28
# Offense count: 29
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
# AllowedMethods: refine
Metrics/BlockLength:
Expand All @@ -91,29 +99,44 @@ Metrics/BlockNesting:
- 'app/controllers/observations_controller/form_helpers.rb'
- 'test/controller_extensions.rb'

# Offense count: 9
# Offense count: 7
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ClassLength:
Exclude:
- 'app/classes/site_data.rb'
- 'app/classes/textile.rb'
- 'app/controllers/names_controller.rb'
- 'app/extensions/string_extensions.rb'
- 'app/models/abstract_model.rb'
- 'app/models/description.rb'
- 'app/models/image.rb'
- 'app/models/location.rb'
- 'app/models/user.rb'

# Offense count: 106
# Offense count: 113
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 28

# Offense count: 26
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
# Offense count: 21
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 52
Exclude:
- 'app/classes/query/modules/joining.rb'
- 'app/classes/query/modules/sql.rb'
- 'app/classes/site_data.rb'
- 'app/classes/tree.rb'
- 'app/controllers/concerns/descriptions.rb'
- 'app/controllers/concerns/descriptions/permissions.rb'
- 'app/controllers/concerns/descriptions/publish.rb'
- 'app/controllers/locations_controller.rb'
- 'app/controllers/names/eol_data/preview_controller.rb'
- 'app/extensions/symbol_extensions.rb'
- 'app/helpers/pagination_helper.rb'
- 'app/models/language_exporter.rb'
- 'app/models/location.rb'
- 'app/models/name/notify.rb'
- 'app/models/name/parse.rb'
- 'app/models/name_sorter.rb'
- 'script/bulk_name_change'

# Offense count: 4
# Configuration parameters: CountComments, Max, CountAsOne.
Expand All @@ -135,7 +158,7 @@ Metrics/ParameterLists:
- 'test/controllers/projects/members_controller_test.rb'
- 'test/models/collapsible_map_test.rb'

# Offense count: 86
# Offense count: 90
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 29
Expand All @@ -158,7 +181,7 @@ Naming/HeredocDelimiterNaming:
Exclude:
- 'script/refresh_name_lister_cache'

# Offense count: 27
# Offense count: 26
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
# NamePrefix: is_, has_, have_
# ForbiddenPrefixes: is_, has_, have_
Expand Down Expand Up @@ -225,7 +248,7 @@ Rails/FilePath:
Exclude:
- 'app/models/language_exporter.rb'

# Offense count: 35
# Offense count: 34
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods, AllowedPatterns.
# AllowedMethods: order, limit, select, lock
Expand Down Expand Up @@ -259,7 +282,7 @@ Rails/HasManyOrHasOneDependent:
- 'app/models/user.rb'
- 'app/models/user_group.rb'

# Offense count: 7
# Offense count: 8
# Configuration parameters: Include.
# Include: app/helpers/**/*.rb
Rails/HelperInstanceVariable:
Expand Down Expand Up @@ -328,26 +351,6 @@ Security/Eval:
Exclude:
- 'script/config.rb'

# Offense count: 70
Style/ClassVars:
Exclude:
- 'app/classes/content_filter.rb'
- 'app/classes/ip_stats.rb'
- 'app/classes/run_level.rb'
- 'app/classes/textile.rb'
- 'app/extensions/symbol_extensions.rb'
- 'app/models/language.rb'
- 'app/models/language_tracking.rb'
- 'app/models/location.rb'
- 'app/models/queued_email.rb'
- 'app/models/user.rb'
- 'app/models/user_group.rb'
- 'test/controllers/locations_controller_test.rb'
- 'test/controllers/names_controller_test.rb'
- 'test/general_extensions.rb'
- 'test/language_extensions.rb'
- 'test/test_helper.rb'

# Offense count: 8
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/CombinableLoops:
Expand All @@ -364,6 +367,12 @@ Style/HashEachMethods:
- 'app/classes/eol_data.rb'
- 'script/slowest_pages'

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
Style/IfUnlessModifier:
Exclude:
- 'lib/core_extensions/action_view/log_subscriber.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedMethods, AllowedPatterns.
Expand All @@ -385,6 +394,13 @@ Style/Next:
Exclude:
- 'lib/tasks/email.rake'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinDigits, Strict, AllowedNumbers, AllowedPatterns.
Style/NumericLiterals:
Exclude:
- 'app/controllers/application_controller.rb'

# Offense count: 49
# Configuration parameters: AllowedMethods.
# AllowedMethods: respond_to_missing?
Expand Down Expand Up @@ -412,15 +428,14 @@ Style/OptionalBooleanParameter:
- 'test/session_extensions.rb'
- 'test/session_form_extensions.rb'

# Offense count: 11
# Offense count: 10
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantParentheses:
Exclude:
- 'app/classes/query/modules/joining.rb'
- 'app/controllers/api2_controller.rb'
- 'app/controllers/application_controller.rb'
- 'app/controllers/concerns/descriptions/permissions.rb'
- 'app/helpers/content_helper.rb'
- 'app/helpers/title_and_tabset_helper.rb'
- 'app/models/name.rb'
- 'test/controller_extensions.rb'
Expand Down Expand Up @@ -463,7 +478,6 @@ Style/StringConcatenation:
- 'app/extensions/string_extensions.rb'
- 'app/helpers/application_helper.rb'
- 'app/helpers/descriptions_helper.rb'
- 'app/helpers/object_link_helper.rb'
- 'app/helpers/suggestions_helper.rb'
- 'app/helpers/versions_helper.rb'
- 'app/models/comment/callbacks.rb'
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ GEM
execjs (~> 2)
base64 (0.2.0)
bcrypt (3.1.20)
bigdecimal (3.1.5)
bigdecimal (3.1.6)
bindex (0.8.1)
blankslate (3.1.3)
bootstrap-sass (3.4.1)
Expand Down Expand Up @@ -164,7 +164,7 @@ GEM
mini_mime (1.1.5)
mini_racer (0.8.0)
libv8-node (~> 18.16.0.0)
minitest (5.21.1)
minitest (5.22.2)
minitest-reporters (1.6.1)
ansi
builder
Expand All @@ -190,7 +190,7 @@ GEM
nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4)
parallel (1.24.0)
parser (3.3.0.4)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
psych (4.0.6)
Expand Down Expand Up @@ -237,7 +237,7 @@ GEM
railties (>= 6.1.0)
rexml (3.2.6)
rtf (0.3.3)
rubocop (1.60.1)
rubocop (1.60.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down
3 changes: 2 additions & 1 deletion app/helpers/matrix_box_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def matrix_box_vote_or_propose_ui(identify, object, consensus)
else
propose_naming_link(
object.id, btn_class: "btn btn-default d-inline-block mb-3",
context: "matrix_box")
context: "matrix_box"
)
end
end

Expand Down
18 changes: 9 additions & 9 deletions app/helpers/tabs/descriptions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ def show_description_tabs(description:)
# admin = is_admin?(description)
# assemble HTML for "tabset" for show_{type}_description
# [
# description_parent_tab(description, type)
# edit_description_tab(description, type),
# destroy_description_tab(description, admin),
# clone_description_tab(description, type),
# merge_description_tab(description, type, admin),
# adjust_description_permissions_tab(description, type, admin),
# make_description_default_tab(description, type),
# description_project_tab(description),
# publish_description_draft_tab(description, type, admin)
# description_parent_tab(description, type)
# edit_description_tab(description, type),
# destroy_description_tab(description, admin),
# clone_description_tab(description, type),
# merge_description_tab(description, type, admin),
# adjust_description_permissions_tab(description, type, admin),
# make_description_default_tab(description, type),
# description_project_tab(description),
# publish_description_draft_tab(description, type, admin)
# ].reject(&:empty?)
end

Expand Down
4 changes: 2 additions & 2 deletions script/refresh_caches
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ msgs = progress("unused or missing synonyms...",
Name, :make_sure_names_are_bolded_correctly) +
progress("classification caches...",
Name, :refresh_classification_caches) +
# progress("generic classifications...",
# Name, :propagate_generic_classifications) +
# progress("generic classifications...",
# Name, :propagate_generic_classifications) +
progress("misspelled observations...",
Observation, :make_sure_no_observations_are_misspelled) +
progress("content filter caches...",
Expand Down

0 comments on commit 930d963

Please sign in to comment.