Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Working with Bundler
      • Rails Support
    • Python
      • Background Jobs in Python
      • Working with Django
    • Java
      • Working with Maven
      • Java Database Operations
      • Java Advanced Topics
      • Working with Spring Boot
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
Codekvast

This add-on is operated by Hallin Information Technology AB

Codekvast detects Truly Dead Code in your app, code that no real user is using.

Codekvast

Last updated April 16, 2021

This is a draft article - the text and URL may change in the future. This article is unlisted. Only those with the link can access it.

The Codekvast add-on is currently in beta.

Table of Contents

  • Install the Codekvast add-on
  • Configure your Codekvast javaagent
  • Dashboard
  • Migrating between plans
  • Uninstalling the Codekvast add-on
  • Support

Codekvast is an add-on for detecting Truly Dead Code in your app.

By “Truly Dead Code”, we mean code in your production app that has not executed for a significant period of time.

Continuously detecting and removing dead code from your app provides the following benefits:

  • Shorter development cycles
  • Reduced technical debt
  • Reduced risk for security exploits
  • Faster developer onboarding

Codekvast requires minimal changes to your application. It is currently available for Java and other JVM languages such as Scala. It requires a JDK with at least version 8. It is tested on versions 8 to 15.

Install the Codekvast add-on

Codekvast can be attached to a Heroku application via the CLI:

A list of all available plans can be found here.

$ heroku addons:create codekvast
-----> Adding codekvast to sharp-mountain-4005... done, v18 (free)

Installing the add-on automatically creates a private Codekvast account connected to your Heroku account. You can access your Codekvast account from your app’s Add-ons list in the Heroku Dashboard.

After you provision Codekvast, the CODEKVAST_URL and CODEKVAST_LICENSE_KEY config vars are available in your app’s configuration. They contain information for accessing the newly provisioned Codekvast service instance. You can confirm this via the heroku config:get command:

$ heroku config:get CODEKVAST_URL
https://api.codekvast.io/

After you attach Codekvast to your app, you’ll need to configure it.

Configure your Codekvast javaagent

Manual configuration

  1. Download codekvast-agent-1.4.1.zip and unzip it into your project’s root directory. The ZIP file includes a sample codekvast.conf file, as well as a codekvast/ directory that contains the Java agent.

  2. Edit codekvast.conf to suit your app’s needs. Do not change the serverUrl or licenseKey values, because they are injected from your Heroku environment.

    Full documentation of all configuration parameters file is available at https://www.codekvast.io/pages/getting-started.html.

  3. Update your app’s JAVA_OPTS config var to include the javaagent:

    heroku config:set JAVA_OPTS="-javaagent:/app/codekvast/codekvast-javaagent-1.4.1.jar"
    

Using Codekvast with Gradle

Using spring-boot-gradle-plugin to build an executable JAR file is supported.

See Codekvast Getting Started to learn how to use Codekvast with spring-boot-gradle-plugin.

The standard standard Gradle application plugin is also supported.

A sample application that illustrates how to use codekvast-agent with the Gradle application plugin is available on Github.

The sample application also illustrates how to download codekvast-javaagent via Gradle’s dependency mechanism.

Using Codekvast with Maven

Using spring-boot-maven-plugin to build an executable JAR file is supported.

See Codekvast Getting Started to learn how to use Codekvast with spring-boot-maven-plugin.

Testing locally

After you install the add-on and configure the Codekvast java agent, you can test locally that everything works as expected, and that data collection is taking place.

It’s necessary to locally replicate the add-on’s config vars so your development environment can operate against the service.

Use the Heroku Local command-line tool to configure, run and manage process types specified in your app’s Procfile. Heroku Local reads configuration variables from a .env file. To view all of your app’s config vars, type heroku config. Use the following command for each value that you want to add to your .env file:

heroku config:get CODEKVAST_URL -s  >> .env
heroku config:get CODEKVAST_LICENSE_KEY -s  >> .env
heroku config:get JAVA_OPTS -s  >> .env

Warning Credentials and other sensitive configuration values should not be committed to source-control. In Git exclude the .env file with: echo .env >> .gitignore.

For more information, see the Heroku Local article.

Monitoring and logging

You can monitor Codekvast activity within the Heroku log-stream by running the following command:

$ heroku logs -t | grep -i codekvast

You should see the string Codekvast uploaded within a few minutes after the application starts if the integration is working correctly.

After the initial upload, Codekvast will upload data according to your selected plan.

Dashboard

For more information on features available in the Codekvast dashboard, please see the documentation at www.codekvast.io.

The Codekvast dashboard allows you to browse your collected usage data.

You can access the dashboard via the CLI:

$ heroku addons:open codekvast
Opening codekvast for sharp-mountain-4005

or by visiting the Heroku Dashboard and selecting the application in question. Select Codekvast from the Add-ons menu.

Migrating between plans

Use the heroku addons:upgrade command to migrate to a new plan.

$ heroku addons:upgrade codekvast:newplan
-----> Upgrading codekvast:newplan to sharp-mountain-4005... done, v18 ($49/mo)
       Your plan has been updated to: codekvast:newplan

Uninstalling the Codekvast add-on

Use the following procedure for uninstalling the Codekvast add-on:

  1. Remove codekvast.conf from your project root.
  2. Remove codekvast/codekvast-javaagent-1.4.1.jar
  3. Revert the changes to your build system, or run heroku config:unset JAVA_OPTS
  4. git push heroku master

Then deprovision the Codekvast service via the CLI:

Warning This will destroy all collected data and cannot be undone!

$ heroku addons:destroy codekvast
-----> Removing codekvast from sharp-mountain-4005... done, v20 (free)

Support

All Codekvast support and runtime issues should be submitted via one of the Heroku Support channels.

Any non-support related issues or product feedback is welcome at https://github.com/crispab/codekvast/issues.

There is also a Slack team for Codekvast. Send an email to support@codekvast.io for an invitation.

Feedback

Log in to submit feedback.

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Podcasts
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences