★ wanayoo — archive 1999 https://codeclimate.com/docsNouvelle recherche | Portail wanayoo

Code Climate Docs

We also have Terms of Service and a Privacy Policy.

Getting Started

Will Code Climate work for my project?

If it's a Ruby project and you use Git for version control, almost certainly. We support both Ruby 1.8 and 1.9.

If you're hosting your own Git server, you'll just want to check to ensure it meets our basic requirements.

How do I start using Code Climate?

Just create an account and you'll be on your way. Filling out the signup form will create an Account for your company or organization and also a User that you can use to login. The next step is adding your first repository.

How do I use Code Climate for open source projects?

We're proud that Code Climate is 100% free for Open Source. To setup a new Ruby OSS project, simply use our Add GitHub Repository form. We'll send you an email when the metrics are ready to view.

Will Code Climate work with my private Git server?

Probably. Your Git server must either allow public (unauthenticated) access over the git://, http:// or https:// protocols; or it must allow authenticated access using the SSH protocol and keys.

GitHub.com meets this requirement, but GitHub Enterprise may or may not depending on your configuration. DIY Git servers that are not accessible outside of your organizations firewall are not compatible.

What URL should I use for my Git repo?

It depends. For private repos hosted on GitHub.com (or GitHub enterprise), you'll want to use the SSH-style url. (e.g. git@github.com:brynary/codeclimate.git). In this case, Code Climate will provide an SSH public key for you to install to enable us to access your code.

For public Git repos either the git:// or http(s):// URLs work fine.

How do I analyze a branch other than master?

When you add your repository, click the "Change" link next to where it says "Branch: Master". As of right now, you can't change the branch setting for a repo after adding it, but you can add the same repo multiple times with different branches.

How do I install the Deploy Key?

If you use GitHub, you'll install the Deploy Key on the Deploy Keys page in the Admin area for your repo. If you host your own Git server, you'll probably need to add it to an authorized_keys file on that server instead.

I'm having trouble adding my repository!

I'm here to help! Send a quick note to hello@codeclimate.com and I'll definitely work with you to track down the problem.

Quality Metrics

What is a Smell?

Code Smells (or simply "Smells") are symptoms of your code that possibly indicate a deeper problem. Code Climate identifies long methods and duplicated blocks of code as smells and soon will also identify other smells.

Smells are not necessarily problems themselves. For example, long methods are often a symptom of mismanaged object responsibilities that require changes to the domain model. Simply splitting up the long method into smaller methods is not always the way to go.

It's important to note that not all smells identified by Code Climate point to issues that need to be addressed. Programmer judgment must be applied when using code metrics.

What is the Complexity metric?

Complexity metrics are based on Flog, an open source Ruby static analysis tool by Seattle.rb. The Complexity metric is a variant of the ABC metric, which looks at Assignments, Branches and Conditions in code. Certain Ruby metaprogramming constructs are also considered, as they generally make code harder to understand quickly.

What is the Duplication metric?

Duplication metrics are based on Flay, another great open source Ruby static analysis tool created by Seattle.rb. Code Climate looks at the syntax trees of your Ruby code in order to identify identical and similar code structures. Because duplication is identified using syntax trees, it's resilient to being confused by changes in code formatting and simple renames.

What is the Churn metric?

Churn is simply the number of times the source code file has changed in your Git history. Classes that change frequently and are also complex and difficult to maintain are good targets for refactoring. Writing small classes that have a single responsibility, and are open for extension but closed for modification helps avoid churn.

How are the ratings calculated?

The letter ratings (A through F) are calculated by summing up all of the smells of each class/module and then applying that to an absolute scale. (Behind the scenes, each Smell has an associated "cost". This allows us to sum together the cost of a duplication with complex methods, etc.)

What smells does Code Climate detect?

Currently we detect four smells:

One of my classes/modules is missing! What's up?

There are two reasons this can happen:

  1. The file may reside at a path not analyzed by Code Climate. This used to happen quite a bit, but we've improved our algorithm and have not had any reports of this since. Code Climate tries to analyze all Ruby files in your Git repo except for test/specs.

  2. Code Climate can't parse the file where the class is defined. We aim to support all valid Ruby 1.9 code (including Ruby 1.8 which is also valid Ruby 1.9), but aren't 100% there yet. Under the hood we use the fantastic RubyParer project to parse Ruby files, but RubyParser still has a few bugs around some less-common Ruby 1.9 constructs. We actively work with the RubyParser team to get these bugs recorded and fixed.

    If you suspect this may be the case, please contact us and if you authorize us, we can take a look at the file that isn't parsing and identify the specific issue. Often a quick tweak to the Ruby syntax will fix it. In the future, we will expose parser failures in an automated way so you can see them and resolve them yourself.

Teams

How do I add my team?

Easy. Just visit the Invite User page and provide their name and email address. You can also decide whether the user should be an Account admin or now (see the next question for an explanation of the difference). You can of course change who are account admins later.

What can an account admin do?

Account admins can manage the Code Climate account, including adding/deleting repositories, inviting users, configuring integrations with third party services, and updating plan and billing information.

What can the account owner do?

The account owner is the user that created the Code Climate account. The only difference between admins and the account owner is that the account owner will receive email receipts for successful monthly charges.

How do I change the account owner?

Right now this needs to be done manually by us. Please just have the current account owner shoot a quick note to hello@codeclimate.com and we'll take care of it.

The Feed

What appears in the feed?

The feed will show you every time a class or module changes its rating, as well as all the new classes/modules added to your repository. Please note: Feed events are only created for changes between Code Climate updates, so it's possible a class might change ratings a few times between updates and only produce one feed event. See below for an explanation of when repositories update.

Can I subscribe to the feed via RSS?

Of course. Just be sure not to share the URL for the feed for your private repositories. It has a secret token in it, so anyone with the URL will be able to view your feed events.

Repository Updates

How often do the metrics update?

Both repos under a private account, as well as public GitHub repos, update every three hours on cron without any additional configuration.

How do I setup the GitHub integration?

If you'd like your metrics to update more frequently, (highly recommended!) and you've got a private Code Climate account, you can configure GitHub to send a post-receive hook to Code Climate each time someone pushes to your repository.

As an Account admin, navigate to the Integrations page and copy the GitHub service token provided. Then visit the Service Hooks page for the repository on GitHub in the Admin area, locate "CodeClimate" in the "Available Service Hooks" list, and paste the token.

Two caveats:

How do I manually trigger a refresh?

Just click the refresh icon next to the commit SHA. There's no progress indicator for the refresh yet, but they finish within 10 minutes under normal circumstances. If there haven't been any updates to the relevant Git branch since the last update, this will be a no-op.

Notifications

When will I receive emails?

Each Tuesday morning, you'll get weekly summary emails for repositories under your account that have had at least one commit over the last week. Weekly summaries are not sent for repositories that have not had any commits.

How do I stop receiving emails?

Just uncheck "Receive notification emails from Code Climate" on the My Info page.

How do I receive Campfire notifications?

An Account admin can configure this in the Integrations area. On the Campfire Integration page, fill in the Campfire subdomain, Campfire room ID, and API authentication token.

How do I receive Hipchat notifications?

Like Campfire notifications, an account admin can configure this from the Integrations area. On the HipChat Integration page, fill in the room name and your HipChat authentication token. You can also control whether each chat message should notify members in the room.

What notifications are sent to Campfire and/or Hipchat?

Currently we send notifications to Campfire and Hipchat every time a class rating changes between Code Climate repo updates.

Accounts and Billing

How much does Code Climate cost?

Full pricing information is available on the homepage. (You'll need to be logged out to access it.)

How do I update my credit card information?

As an Account admin, visit the Plans & Billing page and click the "Update Credit Card" link towards the bottom of the page.

How do I change my plan?

Account admins can change your current plan from the Plans & Billing page. Pricing changes between plans are prorated according to the billing period.

If you wish to downgrade your account, you'll need to make sure you have don't have more repos than the plan you wish to switch to allows. To make some space, visit the Repos page and use the red delete button on the right side.

Where are invoices sent?

Receipts for successful payments are sent to the account owner via email. The account owner is the user who created the Code Climate account originally. No action is required upon receipt of these emails — they indicate we've already successfully charged your card on file.

How do I cancel my account?

First off, we're sorry to see you go! If there's anything we could do or could have done to improve your Code Climate experience, we'd of course love to hear about it.

To cancel your subscription, an Account admin the Plans & Billing area and use the "Cancel Subscription" link at the bottom of the page.

How do I delete my account and data?

As an Account admin, visit the Plans & Billing area and use the "Delete My Account" link at the bottom of the page. If you currently have an active subscription you'll first need to cancel your subscription (see above) before you can delete your account.