Skip to content

New Cop: Avoid usage of Class.descendents #110

Open
@bensheldon

Description

There are two reasons why this is an unreliable solution:

  • it doesn't know about things that have yet to be autoloaded
  • it's non-deterministic with regards to Garbage Collection of classes. If you use Class.descendants in Test, where there is a pattern to dynamically define classes, GC is unpredictable for when those classes are cleaned up and removed by the GC.

cc @jhawthorn

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions