Visitar URL original
refactor: reduce max-lines-per-function violations by TooAngel · Pull Request #795 · TooAngel/screeps · GitHub
Skip to content

refactor: reduce max-lines-per-function violations - #795

Open
TooAngel wants to merge 1 commit into
masterfrom
fix/max-lines-per-function
Open

TooAngel wants to merge 1 commit into
masterfrom
fix/max-lines-per-function

Conversation

@TooAngel

Copy link
Copy Markdown
Owner

What

Extract helper function from handleHostileOccupiedRoom in src/prototype_room_external.js to bring the function below the 60-line limit.

Why

Enforcing max-lines-per-function: [error, 60] ESLint rule. This brings handleHostileOccupiedRoom from 72 lines to 53 lines.\n\n### Results for max-lines-per-function (60):

  • Fixed: 1 of 3 violations (prototype_room_external.js)
  • Left: 2 violations remaining (role_atkeeper.js, role_atkeepermelee.js)

Changes

  • Added getBreakthroughSquadComposition(availableEnergy) helper with full JSDoc block
  • Refactored handleHostileOccupiedRoom to use the extraction, keeping identical behavior

Extract getBreakthroughSquadComposition helper to fix max-lines-per-function
violation in handleHostileOccupiedRoom (72 lines -> 53 lines).
@worlddriven

worlddriven Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Worlddriven Status

📊 Live Status Dashboard

🗓️ Merge Date: 2026-10-31 at 13:48:24 UTC (in 2 days)
📅 Started: 2026-10-28 at 17:28:29 UTC
⚡ Speed Factor: 0.41 (59% faster due to reviews)
✅ Positive votes: 493/831 contribution weight (coefficient: 0.59)
📈 Base Merge Time: 7 days → Current: 3 days

🎯 Want to influence when this merges?

Your review matters! As a contributor to this project, your voice helps determine the merge timeline.

How to review:

  1. Check the changes
    Files changed

  2. Leave your review
    Review changes

Your options:

  • ✅ Agree & Speed Up: Approve Approving makes this merge faster
  • ❌ Disagree & Slow Down: Request changes Requesting changes delays the merge

💡 Pro tip: The more contributors who agree, the faster this gets merged!

📊 View detailed stats on the dashboard

📋 Recent Activity

• 2026-10-28, 17:28:39 - Pull request opened


This comment is automatically updated by worlddriven

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant