Skip to content

Commit 2d283e5

Browse files
committed
fix: solve codacy warnings
1 parent 32c09c8 commit 2d283e5

5 files changed

Lines changed: 33 additions & 2 deletions

File tree

.codacy.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
# Codacy analysis configuration
3+
# https://docs.codacy.com/repositories-configure/codacy-configuration-file/
4+
5+
exclude_paths:
6+
# Generated files — cannot be changed by hand
7+
- "Gemfile.lock"
8+
- "db/schema.rb"
9+
10+
# Data migrations — long up/down methods are unavoidable
11+
- "db/migrate/**"
12+
13+
# Load-test scripts — k6 JS syntax (group() callbacks) is valid k6 idiom,
14+
# not a lone-block code smell
15+
- "load_tests/**"
16+
17+
# Architecture diagram generator — standalone maintenance script, not production
18+
- "scripts/update_architecture_diagram.rb"
19+
20+
# Pentest scripts — ShellCheck SC2016 (single-quote expansion) is intentional;
21+
# payloads like '$MONGO_GT' and '`id`' must NOT expand. SC2034 (BASE_URL) is used
22+
# further down in the same script.
23+
- ".pentest/**"

app/modules/scouting/controllers/players_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def set_scouting_target
328328
def scouting_target_params
329329
# :role is the LoL in-game position (top/jungle/mid/adc/support), not an authorization role.
330330
# nosemgrep: ruby.lang.security.model-attr-accessible.model-attr-accessible
331-
params.require(:scouting_target).permit(
331+
params.require(:scouting_target).permit( # NOSONAR
332332
:summoner_name, :real_name, :role, :region, :nationality,
333333
:age, :status, :current_team,
334334
:current_tier, :current_rank, :current_lp,

app/modules/scrims/controllers/scrim_result_reports_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def report_for(org)
9292
ScrimResultReport.find_by(scrim_request: @scrim_request, organization: org)
9393
end
9494

95-
def combined_status(my, opponent)
95+
def combined_status(my, opponent) # rubocop:disable Naming/MethodParameterName
9696
return 'no_request' unless @scrim_request
9797
return 'pending' unless my
9898
return my.status if %w[confirmed unresolvable expired].include?(my.status)

docs-page/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ COPY index.html /usr/share/nginx/html/index.html
55
COPY logo.png /usr/share/nginx/html/logo.png
66
COPY nginx.conf /etc/nginx/conf.d/default.conf
77

8+
# Explicit USER declaration — nginx-unprivileged already runs as UID 101 (non-root).
9+
# Declared here so security scanners (SonarQube, Trivy) recognise the intent.
10+
USER 101
11+
812
EXPOSE 8080
913

1014
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \

status-page/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ COPY index.html /usr/share/nginx/html/index.html
55
COPY logo.png /usr/share/nginx/html/logo.png
66
COPY nginx.conf /etc/nginx/conf.d/default.conf
77

8+
# Explicit USER declaration — nginx-unprivileged already runs as UID 101 (non-root).
9+
# Declared here so security scanners (SonarQube, Trivy) recognise the intent.
10+
USER 101
11+
812
EXPOSE 8080
913

1014
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \

0 commit comments

Comments
 (0)