Summary of AI Code Completion Tools — Codota

Bug Days
5 min readFeb 10, 2022

--

In recent years, artificial intelligence has developed rapidly and has been applied in all walks of life, especially in the last two years, AI development tools for developers have emerged, from which we see the infinite possibilities AI can bring to developers. This series of articles focuses on Kite, Codota, TabNine, GitHub Copilot, Microsoft IntelliCode, Alibaba Cloud Cosy and AIXcoder, which are some of the hottest intelligent coding tools, and will be followed by more detailed and personal comparative reviews.

In the last article we introduced Kite, in this article we take a look at another older tool, Codota, which is available on the official website at:https://www.codota.com/

Codota was also an early industry entrant into the field. Founded in 2013, Codota released the first version of its JetBrains plugin in late 2014, primarily for Java developers. However, Codota has now abandoned Codota as a plugin following its acquisition of TabNine, and has renamed the old product TabNine. best language to use: Java.

Support Features

Intelligent code completion

  • Regularized code completion based on program analysis and statistical analysis, mainly for some class names and common code templates.

Code search (Java, JavaScript supported)

  • Search for code examples that refer to a specific API.

Official Demo

As you can see from the official video, Codota provides code completion for long sequences and automatically generates variable definitions that do not exist in the text above.

Experience

Codota’s code completion function can provide completion results on some very generic code. It is better at recommending code templates and can be considered as a complement to IDEA code templates, but is more general in terms of code context recognition, variable autofill, etc.

A few examples of Java usage are shown below:

1. Codota can generate a lot of completion results when completing, but there are too many of them, which often disturb my coding and squeeze the IDE’s own completion to the back, and many of them are not very accurate, and there are also syntax errors similar to Kite’s, for example, the url variable in the picture below does not exist.

2. Let’s look again at how well the auto-population of variables worked: when the filePath variable was present above, Codota had a complement item that auto-populated the filePath variable, but the other completions didn’t recognise the scenario where the file path had been declared and instead recommended various code templates, none of which I wanted, and too many of which turned out to be rather intrusive to me.

If we rename the filePath variable, for example filePathTest, then Codota will not auto-populate the variable, indicating that Codota’s ability to auto-populate variables is more limited and more of a recommendation for code templates.

3. In the following diagram, we can see that Codota cannot automatically populate the inputStream variable into the XSSFWorkbook parameters, but needs to be filled in manually, and cannot identify the code above well in the subsequent completions.

4. Of course, the code templates are further supplemented by IDEA’s code templates, which is convenient, as shown in the picture below where Codota provides 3 code templates containing the “read” keyword. After selecting the first “readInputLines”, the content of the code template will be displayed on the right hand side.

Selecting “codota:readInputLines” and hitting enter will display code template snippets for reading file lines, helping us to reduce the need for low-level repetitive code.

Let’s take a closer look at Codota’s API code example search function, which is available in a web version as well as a version built into the IDE.

As we can see from the above image, Codota can search for code examples by right-clicking on the specified Java API, or by entering multiple API names in the right-hand toolbar, and the code examples are sourced from Github, StackOverflow and other open source channels. It is suitable for development scenarios where you know some APIs in advance, but are not familiar with some APIs, saving you the time of going to Google, GitHub, etc. Moreover, the APIs provided by Codota are searched precisely (the full path of the corresponding/belonging class of variables, class names, etc. in the code can be identified), thus avoiding the problem of inaccurate search due to too many APIs with the same name as in GitHub. The problem of not being able to find them accurately, as in the GitHub search, is that there are too many APIs with the same name.

In general, Codota is a good development tool until other code completion tools are released, especially the enrichment of the code templates that come with the IDE, which can help developers save a lot of time in low-level coding, Codota also has some small features for code generation, which will not be expanded here. However, in the current era of AI explosion, Codota’s product evolution has not kept pace, so Codota has abandoned the evolution of this product in favour of the acquired TabNine, which I will take you through in the next installment of this series.

If you are interested, you can install Codota in the IDE plug-in market by searching for Codota, and we welcome your feedback in the comments.

--

--