1. A computer-implemented method comprising: analyzing, by a computer system, a codebase comprising a first dynamically-typed variable or function; determining, by the computer system, a first set of characteristics relating to the codebase based on the analyzing the codebase, wherein the analyzing the codebase includes performing one or more scans with respect to the codebase to determine the first set of characteristics, and wherein the first set of characteristics comprises information regarding usage of the first dynamically-typed variable or function in the codebase; determining, by the computer system, a first set of potential data types for the first dynamically-typed variable or function based on the first set of characteristics; determining, by the computer system, a first candidate data type for the first dynamically-typed variable or function based on the first set of potential data types, wherein the first candidate data type is a superclass of data types in the first set of potential data types, and wherein each of the data types in the first set of potential data types is a subclass of the first candidate data type; converting, by the computer system, the first dynamically-typed variable or function in the codebase to a first statically-typed variable or function in the codebase based on the first candidate data type; and checking, by the computer system, the codebase for one or more errors in response to the converting the first dynamically-typed variable or function to the first statically-typed variable or function.
7. The computer-implemented method of claim 1 , further comprising, in response to detection of an error during the checking the codebase for one or more errors, determining a second candidate data type for the first dynamically-typed variable or function based on the first set of potential data types, wherein the second candidate data type is different from the first candidate data type.