Switch Statement (SS)

Description:

SS detects if a method contains a switch on an attribute of the same class. An attribute must be of an integral type; it may be access either directly or via an accessor method. In this case it is often where the switch statement should be replaced with polymorphism.

Example:

   class Node {
       private int kind;
    
       void print() {
           switch (kind) {
           case ADD:
           ...
           case SUB:
           ...
           }
       }
   }