1.2.194. Collect Use Counts

This rule counts the number of use` expression in a file. use expressions import external classes, interfaces, enums, constant, functions and traits.

A high number of imports may signal a class that is doing to much.

<?php

// This count 4 uses
use A as B;
use F\C, F\D, F\E;

?>

1.2.194.1. Specs

Short name

Dump/CollectUseCounts

Rulesets

All, CE, Changed Behavior, Dump

Exakat since

2.1.9

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

High

Features

use

Available in

Entreprise Edition, Community Edition, Exakat Cloud