1.2.701. Missing Include

The included files doesn’t exists in the repository. The inclusions target a files that doesn’t exist.

The analysis works with every type of inclusion : include(), require(), include_once() and require_once(). It also works with parenthesis when used as parameter delimiter.

The analysis doesn’t take into account include_path. This may yield false positives. Missing included files may lead to a fatal error, a warning or other error later in the execution.

<?php

include 'non_existent.php';

// variables are not resolved. This won't be reported.
require ($path.'non_existent.php');

?>

Name

Default

Type

Description

constant_or_variable_name

100

integer

Literal value to be used when including files. For example, by configuring ‘Files_MissingInclude[HOME_DIR] = /tmp/myDir/;’, then ‘include HOME_DIR . my_class.php; will be actually be used as ‘/tmp/myDir/my_class.php’. Constants must be configured with their correct case. Variable must be configured with their initial ‘$’. Configure any number of variable and constant names.

1.2.701.1. Specs

Short name

Files/MissingInclude

Rulesets

All, Analyze

Exakat since

1.1.2

PHP Version

All

Severity

Critical

Time To Fix

Instant (5 mins)

Precision

Very high

Features

include

Available in

Entreprise Edition, Exakat Cloud