Semmle 1.18
Skip to end of metadata
Go to start of metadata

This topic introduces the key concepts of Semmle analysis.

Overview

Semmle analysis uses the following key concepts:

  • Project: the source code files, in a single programming language, plus associated data, for a specific code base
  • Snapshot: all of the files in the code base for a project as they existed after a specific revision to the code
  • Rule: a definition of good programming practice against which code can be checked 
  • Query: code written in the QL query language that can be used to: test whether a particular rule is adhered to in source code of a specific language; calculate a metric for a code base; filter data
  • Dashboard: a graphical interface that allows users to view and interact with analysis results. Various applications use dashboards to display Semmle analysis data: for example, Semmle Project Insight and business intelligence tools such as Tableau and QlikView.

    Unless specified otherwise "dashboard" in this documentation refers to the Semmle Project Insight dashboard.

Decoupling projects and dashboards gives tremendous flexibility: a Semmle Project Insight dashboard consists of one or more projects, and a project can appear on more than one dashboard. This allows you to define dashboards that focus on different aspects of code quality for different groups of users with very little overhead (for example, a multi-project dashboard of key results for managers and single-project dashboards with detailed results for developers).

How does it work?

The basic workflow for taking a snapshot of a code base, analyzing that snapshot, and generate/update a Project Insight dashboard is as follows:

  1. addLatestSnapshot command creates a new snapshot folder using the <checkout> commands defined the project file.
  2. buildSnapshot command builds the new snapshot using the <build> commands defined in the project file. As the code is built, it is indexed to create a snapshot database ready for analysis. This command is also executed by buildDashboard, so normally it is only used directly during initial setup.
  3. buildDashboard command checks the dashboard Configuration file and identifies any missing data. It runs queries on snapshot databases to provide the missing data.

When you have added the new dashboard to a web server, the new data is available to client applications.