Skip to content

Instantly share code, notes, and snippets.

@psuhas77
Last active August 25, 2019 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psuhas77/c52373fa34a1b76bf87fc04778f0ae12 to your computer and use it in GitHub Desktop.
Save psuhas77/c52373fa34a1b76bf87fc04778f0ae12 to your computer and use it in GitHub Desktop.
GODOT ENGINE - STATIC ANALYZER (Google Summer of Code 2019)

GSoC 2019 - Final Report

Code

The code that I have written can be found here [it's in the form of a comparison with the original repository]. Most of the work is done on the files static_analyzer.cpp and static_analyzer.h https://github.com/godotengine/godot/compare/master...psuhas77:gsoc

Background

While making medium to large scale games in Godot, many small bugs start to creep in that cannot be caught by the compiler. These can only be dealt with manually while debugging. This project will build a tool to be used semi-regularly to highlight these problematic pieces of code in an automated fashion. This essentially extends the scope of static checks , currently just being within each script, to operate across scripts and scenes.

Work Done

Foundations:

  • Scene traversal mechanism.
  • Script traversal mechanism

Static Checks that are complete:

  • Script inherits the Object type that it is attached to.

Static checks that work for general use cases:

  • Node referenced in a get_node() call exists.
  • Function connected to a signal has arguments of correct arity.

Future Work

Work needs to be done on extending the project to as many static checks as possible. I will continue working on ensuring that the tool is as useful to as many people as it can be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment