It is necessary to follow a specific style of code during software development. Otherwise code will become less readable and the developer will not be able to  understand other programmers’ intent. It can lead to functional defects and bugs in the code. Static analyzers, in it's turn, have methods for detecting and auto-correcting style errors and bugs. Modern linters and static analyzers are extremely useful not only for simple code-style analysis but also for bugs detection and automatic code fixing.

There are many methods and techniques used by existing analyzers to ﬁnd bugs (path-sensitive data ﬂow analysis \cite{ref:kremenek}, alias analysis \cite{ref:effective}, type analysis \cite{ref:simple}, symbolic execution \cite{ref:dis}, abstract interpretation \cite{ref:dis}).

Senior developer can write the same comment again and again in hundreds of code reviews. Static analysis reduces this bureaucracy as it can be thought of as an automated code review process, because it can detect those issues in code automatically. And of course it perfectly reduces the human factor in the review process. There are two main tasks that can be solved by static code analysis: identifying errors (bugs) in programs and recommending code formatting (fixes). This means that the analyzer allows you, for example, to check whether the source code complies with the accepted coding convention and automatically fix found issues. Also, a static analyzer can be used to determine the level of maintainability of a code. It shows how easy is it to read, modify and adapt a given code of software by detecting code-smells and design patterns used in the code. Static analysis tools allow you to identify a large number of errors in the design phase, which significantly reduces the development cost of the entire project. Static analysis covers the entire code - it checks even those code fragments that are difficult to test. It does not depend on the compiler used and the environment in which the compiled program will be executed.

This white-paper covers the work that was done to create a static analyzer for Kotlin language, called diKTat. It also briefly describes it's implementation and functionality. You can treat this document as a "how-to" instruction for diKTat.