Examples of code inspections
Finding probable bugs
IntelliJ IDEA analyzes the code you are typing and is capable of finding probable bugs as non compilation errors right on-the-fly. Here is an example of such situation. Potential NPEs that can be thrown at application runtime.
Before

Here the first if condition may lead to a NullPointer exception being thrown in the second if, as not all situations are covered. At this point adding an assertion in order to avoid a NullPointer being thrown during the application runtime would be a good idea.
After

So, this is exactly what we get from the intention action.
Locating the dead code
IntelliJ IDEA highlights in the editor pieces of so-called dead code. This is the code that is never executed during the application runtime. Perhaps, you don't even need this part of code in your project. Depending on situation, such code may be treated as a bug or as a redundancy. Anyway it decreases the application performance and complicates the maintenance process. Here is an example.
So-called constant conditions - conditions that are never met or are always true, for example. In this case the responsible code is not reachable and actually is a dead code.

IntelliJ IDEA highlights the if condition as it's always true. So the part of code surrounded with else is actually a dead code because it is never executed.
Highlighting unused declarations
IntelliJ IDEA is also able to instantly highlight Java classes, methods and fields which are unused across the entire project via Unused declarations inspection. All sorts of Java EE @Inject annotations, test code entry points and other implicit dependencies configured in the Unused declarations inspection are deeply respected.
For more examples of code inspections use, refer to
http://www.jetbrains.com/idea/documentation/static_code_analysis.html
The following is available only in the Ultimate edition of IntelliJ IDEA
Examples of php code inspections
Unresolved include
This inspection detects attempts to include not actually existing files and suggests two quick fixes: to create a file with the specified name or use a PHPDOC annotation.

Dynamic method is called as static
This inspection checks whether a call to a static function is actually applied to a static function.

The function do_something() is called as static while actually it is dynamic.
Unimplemented abstract method in class
This inspection checks whether classes inherited from abstract superclasses are either explicitly declared as abstract or the functions inherited from the superclass are implemented.

The class ConcreteClass is inherited from an abstract class AbstractClass and has not been explicitly declared as abstract. At the same time, the function GetValue(), which is inherited from AbstractClass, has not been implemented.
Parameter type
PHP variables do not have types, therefore basically parameter types are not specified in definitions of functions. However, if the type of a parameter is defined explicitly, the function should be called with parameters of the appropriate type.

The function do_something has the parameter of the type integer but is called with a string.
Undefined class constant
This inspection detects references to constants that are not actually defined in the specified class.

The constant NotExistingConst is referenced to as a constant of the class Animal, while actually it is not defined in this class.
Undefined constant inspection
This inspection detects references to constants that are not actually defined anywhere within the inspection scope.

The referenced constant UndefinedConst is not defined anywhere within the inspection scope.
Undefined class
This inspection detects references to classes that are not actually defined anywhere within the inspection scope.

The referenced class NotExistingClass is not defined.
Undefined field
This inspection detects references to fields of a class that are not actually defined in this class.

The $obj variable is an instance of the class Animal. The declaration of the $var contains a reference to the field field of the class Animal, which is not defined on this class.
Call of undefined function
This inspection detects references to functions that are not defined anywhere within the inspection scope.

The called function undefined_function() is not defined anywhere within the inspection scope.
Undefined variable
This inspection detects references to variables that are not declared and initialized anywhere within the inspection scope. PHP does not require that each variable should be declared and initialized. PHP can initialize such variable on the fly and assign it the zero value. However, this inspection allows to detect discrepancies of this kind.

