DFRefactor's refactoring functions are described in two ways: by type, which decides what the engine passes to the function and how often the function is called, and by group, which describes the kind of work the function does. Both are shown as columns in Select Functions, and both can be used to filter the list.


Which code the functions are run on

A function does not decide which files it is run on; that depends on how you start the run:

  • A whole workspace. Every source file in the folders selected in Select Folders that matches the Filter: on the same view. This is what both the guided route and the Manual Dashboard's Workspace mode use.
  • A single file. Single file on the Manual Dashboard runs the selected functions on one source file.

See How to use the Program.


Groups

The Group column shows what a function is used for, and the function library tile shows how many functions each group has:

  • Modernization — updates legacy code to current DataFlex. Most of the functions belong to this group.
  • Tidy Up — cleans up or removes code, such as trailing spaces, unnecessary keywords and redundant comments.
  • x64 + Unicode — reports and fixes that prepare the code for 64-bit and Unicode.
  • Other — functions that do not belong to any of the groups above.


Types

Constrain by Type: on the Select Functions view shows only the functions of one type. Each type corresponds to a MethodType declared in the function's meta-tag, which tells the engine how to call the function.

Standard — Line by Line
Changes the source code one line at a time. The engine calls each selected function for every line of every selected file, and passes the line by reference. The function returns True if it changed the line. Most functions are of this type. MethodType = eStandardFunction.

Remove — Line by Line
Like Standard, but for lines that should be removed rather than changed. The function returns True if the line is to be removed. MethodType = eRemoveFunction.

Editor — One File
Works on a whole file through the Scintilla editor, for changes that need the editor, such as indentation and the case of keywords. The editor view is shown automatically when a run includes one of these functions, because the editor must be visible to work. MethodType = eEditorFunction.

Report — One File
Reports findings for one file and does not change anything. MethodType = eReportFunction. No functions of this type are included at present. The engine supports the type, so that you can use it for your own functions.

Report — All Files
Reports findings for all selected files at once, and does not change anything. Most report functions are of this type. MethodType = eReportFunctionAll.

Other — One File
Receives a whole file as a string array, for changes that need to look at several lines at a time, such as removing consecutive blank lines, finding unused local variables, or converting a class together with its properties. MethodType = eOtherFunction.

Other — All Files
Receives all selected files at once, for changes that must be consistent across the whole workspace, not only within one file. MethodType = eOtherFunctionAll.


Parameters

Some functions use an extra setting, such as an index number, a style for splitting lines, or a list of class names. The setting is shown in the Parameter column of Select Functions. Double-click the cell to choose a value, and point to it to read what each value means. The description of each function explains what its setting does.


Commercial services

For commercial development of custom refactoring functions, or full legacy-code migration projects, see Feedback.