Java Reference
In-Depth Information
illustration, the line found is the class declaration, because the class implements
that interface.
Several new types of dependency analysis have been added in IDEA 5.0. You can
find them under the Analyze menu. They all do basically the same thing: deter-
mine the relationships between parts of your project. These analyses can operate
on a single class, a single module, a set of modules, or the project as a whole,
referred to as a scope :
Analyze Backward Dependencies determines what other classes or mod-
ules depend on the selected scope.
Analyze Cyclic Dependencies finds any circular relationships between the
packages of the selected scope.
Analyze Module Dependencies shows all modules of the selected scope
and their dependencies. It also detects and visually presents all found
cyclic dependencies for the shown modules.
9.3.3
Locating duplicate code
A common and insidious problem with many software projects is duplicated code
(sometimes referred to as copy and paste programming ). By including duplicate
code in your project, you make your project less maintainable. Issues that need to
be addressed in the original copied code must be addressed in more than one
place, and forgetting a single instance usually means you've introduced a bug.
IDEA 4.5 can analyze a specific file (or your entire project) and report on
blocks of code that are repetitive. To start a search for duplicates, select Analyze |
Locate Duplicates . Alternatively, you can choose the same command from the
context menu by right-clicking a class (in the editor) or from a class, package, or
module in the Project view.
If a file is selected when the command is issued, you're prompted to spec-
ify the scope of the code duplication analysis—either the selected file or the
entire project.
The Code Duplication Analysis Settings dialog appears, allowing you to
specify preferences for the requested analysis. The Anonymize options control
whether code must be an identical match in order to be considered a duplicate.
For example, if two methods are identical but use different local variable names,
they're considered duplicates if Anonymize Local Variables is enabled. Do not
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search