Code Analysis: Exports all properties to JSON files

More fun with analysing your code

Dani Beaubien has updated the Code Analysis component to allow you to export all the forms and their objects to files. Only the properties that are available via the 4D getters are saved to exported text files as JSON objects.

Code Analysis is easy to use and offers the following features:

  • Can perform analysis on “all” stored methods in the structure including project methods, project form/object methods, table form/object methods, database methods and trigger methods.
  • Gathers stats on line counts, comment line counts, blank line counts, code line counts, and cyclomatic complexity.
  • Can export, as disk files, every method in the structure. Can be used for archiving, backups, and source code management.
  • Can export, as JSON files, every available form and form object property in the structure. Can be used for archiving, backups, and source code management.
  • Can create HTML documentation of the methods in the structure. The HTML docs can be limited to only those methods that have been marked as shared with host. This gives 4D developers to easily produce documentation for components that they share.

Please feel free to drop me a note on suggestions and feature requests. I do plan to do some more tweaks and add new features in the future.

Go to <> to get more information and download the component.


  • Component API documentation is visible from within the component.
  • Release Notes dialog expanded to be a documentation dialog. There is now a tab for release notes and a 2nd tab for the component API documentation.
  • Changed all progress bars to be the native 4D v13 Progress Bar.

Form Object Property Export

  • Added ability to export a summary of each project and table form that is in the structure to a file. The properties are exported as a JSON object.
  • Added a preference for the default folder name that the form properties are exported to.
  • Added a preference to indicate if the date and time should be appended to the form properties default folder name when exported.

Component API

  • CA_SaveFormProperties“: component method added. Used internally to export the form properties to a JSON disk file.
  • CA_SaveMethodsToTextFiles“: component method added. Used to export the method code to a text disk file.
  • CA_ShowAnalysisWindow“: component method renamed. Used to be called “CodeAnalysis_GeneratorDialog“.

Methods Automatically Added to Host Database

  • CodeAnalysis_FormObjectStub“: used to intercept any form events when exporting the form properties.
  • CodeAnalysis_FormScannerDialog“: the method that controls the dialog to extract form properties.

NOTE: The corresponding form must be added copied from the supplied “CodeAnalysis Extra Layout.4dbase” structure.

  • CodeAnalysis_GetFormNames“: method to retrieve the form names from the host database.
  • CodeAnalysis_GetFormProperties“: method to retrieve specific form properties from the host database.

Dani Beaubien
Open Road Development, Inc.


[amazon_link id=”3896498215″ target=”_blank” sc_id=”sc1″]Inverting Middleware: Performance Analysis of Layered Application Codes in High Performance Distributed Computing[/amazon_link] [amazon_link id=”B005O7EZT6″ target=”_blank” sc_id=”sc2″](Structural Analysis [With Access Code]) By Hibbeler, Russell C. (Author) Hardcover on 25-Feb-2011[/amazon_link]