Skip to content

davehenton/example-foobar

 
 

Repository files navigation

Code Climate Lunch & Learn Example

Example files: https://gist.github.com/dblandin/589e70345774298e1622850349c31876

Setup

  1. Install the Code Climate browser extension
  2. Fork this project to your own GitHub user.
  3. Import your new fork of the repo to Quality, using the Open Source section of the Quality UI.
  4. Update the included CircleCI config file with the Test Reporter ID found in your Repo Settings in Quality.
  5. Create a CircleCI user, and add your repo to CircleCI.
  6. Head back to the Quality UI, and install the GitHub PR Integration for your repo.

Introduce some complexity

  1. In the GitHub UI, modify foo_bar.rb with this content from gist
  2. When committing the changes, create a new branch titled demo-branch for the commit and open a pull request.

You should now see a Cognitive Complexity issue reported by Quality as a PR status and via the browser extension on the diff. Test coverage reporting should also show uncovered lines via the browser extension and a drop in coverage via the diff-coverage and total-coverage statuses.

Screenshot 2023-01-25 at 7 45 55 PM

uncovered2

Add some test coverage

  1. On your existing demo-branch branch, modify spec/foo_bar_spec.rb with this content from gist
  2. Commit the update to demo-branch.

Your pull request should now show a smaller decrease in total-coverage, and a passing diff-coverage status.

Screenshot 2023-01-25 at 8 01 06 PM

The browser extension will also highlight the newly covered lines in foo_bar.rb. Screenshot 2023-01-25 at 8 29 32 PM

Introduce some duplication

  1. On your existing demo-branch branch, modify duplication.rb and duplication_2.rb with these files

  2. Commit to demo-branch. You should now see duplication issues reported by Code Climate.

About

Example Ruby project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 63.7%
  • Ruby 36.3%