Skip to content

[detector-report] DanglingRouteNameDetector #590

Description

@jessegall

Detector: DanglingRouteNameDetector

Report (why the flagged code is CORRECT and the detector is wrong):
The detector crashes on every judge run and is skipped, so no route name is ever checked: 'DanglingRouteNameDetector failed and was skipped: assert(!$this->isFirstClassCallable())'. Neither routes/workflows.php nor routes/webhooks.php uses first-class callable syntax, and no route() or ->name() call passes one. src holds 717 first-class callables (for example Repeated::of(self::row(...))), so the detector most likely calls getArgs() on every call node, and PhpParser's CallLike::getArgs() asserts on a first-class callable. The exact file that trips it is not printed, and the cited line is one representative (...) call site.

Where: src/View/Scenes/Wizards/Agent/Screens/BrowseAgents.php:182

Code (src/View/Scenes/Wizards/Agent/Screens/BrowseAgents.php:182):

  179       */
  180      private static function repeated(array $agents): Repeated
  181      {
→ 182          return Repeated::of(self::row(...))
  183              ->over($agents)
  184              ->filteredBy(self::term(), 'searchable');
  185      }
  186  
  187      private static function row(ConfiguredAgent | RowStencil $agent): ChoiceRow
  188      {
  189          return ChoiceRow::row($agent->name, $agent->icon, $agent->hint)
  190              ->chosenWhile(Matches::of(self::picked(), $agent->id))
  191              ->raises(static fn (AgentDriver $agents) => $agents->pickAgent($agent->id))
  192              ->aliased($agent->id);
  193      }
  194  
  195      private static function accounts(BrowseAgents | Reactive $component): Component
  196      {
  197          return Listing::of(array_merge(...Components::map(self::group(...), $component->state->accounts)));
  198      }
  199  
  200      /**
  201       * @return list<Component>
  202       */
  203      private static function group(AccountGroup $group): array
  204      {
  205          return [
  206              GroupBand::of($group->label, count($group->accounts))

Where: routes/workflows.php:1

Code (routes/workflows.php:1):

1  <?php
   2  
   3  use Illuminate\Support\Facades\Route;
   4  use JesseGall\Workflows\Http\Controllers\IntegrationLogoController;
   5  use JesseGall\Workflows\Http\Controllers\IntegrationOAuthCallbackController;
   6  use JesseGall\Workflows\Http\Controllers\IntegrationOAuthConnectController;
   7  use JesseGall\Workflows\View\Http\StepContextController;
   8  use JesseGall\Workflows\View\Http\StepFieldController;
   9  use JesseGall\Workflows\View\Scenes\Editor\Editor;
  10  
  11  Route::get('/integrations/{integration}/logo', IntegrationLogoController::class)->name('integrations.logo');
  12  Route::get('/integrations/{integration}/oauth/{method}/connect', IntegrationOAuthConnectController::class)->name('integrations.oauth.connect');
  13  Route::get('/oauth/callback', IntegrationOAuthCallbackController::class)->name('integrations.oauth.callback');
  14  
  15  Route::get(Editor::path('{workflow}').'/runs/{runId}/steps/{number}', StepContextController::class)->whereNumber('number')->name('edit.step');
  16  
  17  Route::get('/{slug}/run/{run}/steps/{sequence}/{field}', StepFieldController::class)->whereNumber('sequence')->where('field', 'input|output')->name('run.step.field');

Filed via commandments report from a consumer project.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions