Analyzer
The Analyzer is the second of the three tabs at the bottom of the window. It reads the DataFlex compiler's warnings and errors and links each one to the refactoring function that fixes it. It does not change anything itself: it is a list of findings, sorted by priority, for you to act on.
What it shows
- Check on the dashboard, or Analyze on the compile bar after a compile — see Check - Compile + Analyze.
- Analyze Source, started from the dashboard, adds the results of a scan of your selected source folders to the same list: obsolete commands and symbols that the compiler does not report.
The compiler's complete output is shown on the Compiler Output tab, and its totals can be higher, because the Analyzer leaves out messages that cannot be fixed by refactoring and shows their number as "excluded".
Reading a row
The Fix column shows what can be done:
- Auto-fix — a refactoring function makes the change automatically.
- Review — a refactoring function makes the change, but you should check the result afterwards.
- Explain — there is no automatic fix. Suggested fix describes what to change by hand.
- Unknown — DFRefactor does not know this message yet, so the compiler's own text is shown instead. It is still the best help available.
- System (read-only) — the file is outside your workspace (for example a package of the DataFlex installation), so it cannot be refactored.
In the Msg# column, the number starts with W for a warning, E for an error, or DS for a finding of Analyze Source. File and Line show where the code is. (xN) after the line number means that N messages are combined in this row; the line shown is the first of them. Refactor function shows the function that will run.
Explain, Unknown and System rows are hidden by default, so that the rows that can be fixed are easy to see. Toggle Explain (Ctrl+I) shows them.
Acting on the grid
Double-clicking works differently on a combined row. Double-click a row marked (xN) to list each of its occurrences, and double-click again to combine them. Double-click any other row to go to that source line in the editor. Both actions are also on the right-click menu, as Locate in Editor and Toggle Unfold / Fold occurrences.
When the list is correct, press Run Plan. The Refactoring Plan - review and select before running dialog opens. The Auto-fix functions are selected. The Review functions are listed but not selected, so you decide whether to include them. The dialog also lists the Affected Files: that the functions will change. Clear the check box of anything that you do not want, before you continue.
Select the rows that you do not want to fix and press Ignore Row(s). They are then left out of the list and the plan every time this workspace is analyzed, until you press Clear Ignored.
A change that a function does not make is not silently skipped. It is listed on the Manual Changes tab with the reason.
When you need it, and when you do not
The dashboard's list of findings is built from the same rows and is already sorted by how serious they are, so a normal round can be done from the dashboard without opening this tab. Use this tab when you want:
- to see the whole list at once, instead of the dashboard's priority groups;
- to see the hidden Explain, Unknown and System rows, with Toggle Explain;
- to expand a (xN) row and see every occurrence;
- to remove rows that you do not want to fix, with Ignore Row(s);
- to choose exactly what is run, by clearing entries in the plan dialog.
Repeat the analysis
Fixing some warnings reveals new ones, so compile and analyze again until nothing more can be fixed. Each round is recorded, so you can see the counts go down: see Modernization Progress.
See also Refactoring Functions for what each function does, and How to use the Program for the complete workflow.