Increasing developer happiness with GitHub code scanning
Blog post from GitHub
GitHub's code scanning tool, CodeQL, is being utilized internally to enhance code quality by identifying common coding mistakes, such as memory leaks and unchecked errors, that can be challenging to detect manually. By leveraging CodeQL, GitHub has developed queries to flag specific issues like Go's defer statement causing memory leaks and missing error checks in GORM, a Go Object Relational Mapper. Additionally, they have addressed performance issues associated with "N+1 queries" by identifying inefficient database operations within loops. These custom queries, although experimental, can be employed by developers via a special query suite to improve code quality and developer efficiency. GitHub encourages the creation and sharing of custom CodeQL queries to address unique issues within codebases, enhancing the community's collective coding practices.