1.2.501. Global Code Only

This rule reports files that only contain global code.

<?php

include 'another_file.pnp';

// This sets an options, but does not execute anything
set_memory_limit(-1);

// Some definitions, no code
const A = 1;

function foo() {}

class x {}

?>

1.2.501.1. Specs

Short name

Files/GlobalCodeOnly

Rulesets

All

Exakat since

0.8.4

PHP Version

All

Severity

Time To Fix

Precision

Very high

Features

global-code

Available in

Entreprise Edition, Exakat Cloud