Skip to main content
Every file gets a health score out of 100, and each finding takes some points off it. A scoring weight is how many points one finding of a given kind takes off. Custom weights let you make particular findings matter more or less for your project. For example, raising the weight for secrets makes a detected access key lower the score further.
Custom weights are available when you are signed in, and do not depend on how many monthly project actions you have left. Set healthScoreWeights in .irisconfig.json, or use Config Studio. Your weights keep applying to the file checks you can run even after your monthly allowance is used up.

What everything costs by default

If you leave a key out, Iris Code uses the value from your preset, or the default below if you have not set a preset.
The nine security smell keys (evalUsage, sqlConcatenation, insecureRandom, unsafeRegex, hardcodedLocalhost, disabledTlsVerification, debugFlagsEnabled, weakHashing, openRedirect) were added alongside Security Smells detection. The bareSuppression key was added alongside Inline Suppressions: a valid suppression with a reason costs nothing, but a bare one is itself a finding. The duplicateCode key was added alongside Duplicate Code Detection.

When to customise weights

  • Your team ships to a regulated environment and wants secrets to cost nearly twice the default: set "hardcodedSecret": 18.
  • Your codebase is a prototype and leftover console logs are not a problem: set "consoleLog": 0.
  • TypeScript safety is the team’s top concern: raise anyUsage and tsIgnore above their preset values.
  • You want the health score to reflect only the findings you actually act on: set the others to 0.

Security-focused example

Make secrets cost more, and make console logs count for more, for code that has to pass an audit:
.irisconfig.json

Softening noise for a legacy codebase

Set findings your team has accepted to 0, so the health score reflects only what you plan to fix:
.irisconfig.json
Setting a weight to 0 means that kind of finding does not affect the health score at all. It still shows in the sidebar, and still appears as an inline warning if those are turned on, but it takes nothing off the 0 to 100 score. Only do this on purpose.

Interaction with presets

When a presetId is set, the preset’s own weights are the starting point. Each key you add to healthScoreWeights replaces only that one value, and every key you leave out keeps the preset’s value. With no preset and no custom weights, the defaults in the table above apply.

Configuring via Config Studio

Open Account → Config, switch to Custom mode, then expand the Custom scoring section. Each weight field shows the preset’s value next to it, so you only need to change the keys you care about. Click Sync to VS Code when done; only the values you changed from the default are written to the config file.