Integration with CI/CD

Maintaining a baseline level of code quality is essential to guarantee a release with minimal complications.

Scanyp offers a threshold feature, allowing for an assessment of code quality standards that must be upheld before launching, and ideally, before committing to the source control. Think of a threshold as a measure to determine if the software quality passes or fails. This threshold can be conveniently set up in the Admin -> Threshold section.

The specific criteria for the threshold is determined by a Python function called gatefunction. This function produces three outputs: a status, a message, and a detailsQuery which offers a more in-depth look at the threshold's details.

  • status: This can be either Pass, Warn, or Fail.
  • message: Displays a message to the user, highlighting the specific concern.
  • detailsQuery: This is a Scanyp-specific query that provides users with extended details regarding the threshold.

Below is an example of how a threshold may look:


def gatefunction(application):
    status = "Pass"
    message = "No critical issues detected."
    detailsQuery = "Team Critical Issues"
    criticalissues = [{'issue': issue, 'Debt': issue.Debt} for issue in application.Issues 
    if issue.Severity == "Critical"]
    if len(criticalissues) > 10:
        message = "Detected over 10 critical issues."
        status = "Fail"
    elif len(criticalissues) > 0:
        message = "Found at least one critical issue."
        status = "Warn"
    return status, message, detailsQuery

For CI/CD integration, Scanyp can be paired with any CI/CD tool by running the scanyp agent ([scanyp agent link]). The agent will return an 'OK' status if all thresholds are met and a 'KO' if any threshold is not met.