Skip to content

Commit

Permalink
Update rules metadata (#1826)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-dequenne-sonarsource authored Jun 6, 2024
1 parent 816d009 commit d5d9bcc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
"quickfix": "unknown",
"code": {
"impacts": {
"MAINTAINABILITY": "MEDIUM",
"RELIABILITY": "MEDIUM",
"SECURITY": "LOW"
"MAINTAINABILITY": "MEDIUM"
},
"attribute": "CONVENTIONAL"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<p>This rule raises an issue when an attributes ending with <code>_</code> is set in the <code>__init__</code> method of a class inheriting from
<p>This rule raises an issue when an attribute ending with <code>_</code> is set in the <code>__init__</code> method of a class inheriting from
Scikit-Learn <code>BaseEstimator</code></p>
<h2>Why is this an issue?</h2>
<p>On a Scikit-Learn estimator, attributes that have a trailing underscore represents attributes that are estimated. These attributes have to be set
in the fit method. Their presence are used to verify if an estimator has been fitted.</p>
<p>On a Scikit-Learn estimator, attributes that have a trailing underscore represent attributes that are estimated. These attributes have to be set in
the fit method. Their presence is used to verify if an estimator has been fitted.</p>
<pre>
from sklearn.neighbors import KNeighborsClassifier

Expand Down Expand Up @@ -41,6 +41,5 @@ <h3>Documentation</h3>
<ul>
<li> Scikit-Learn documentation - <a href="https://scikit-learn.org/stable/developers/develop.html#parameters-and-init">Parameters and init</a>
</li>
<li> {rule:python:S6970} - The Scikit-learn <code>fit</code> method should be called before methods yielding results </li>
</ul>

2 changes: 1 addition & 1 deletion sonarpedia.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languages": [
"PY"
],
"latest-update": "2024-05-08T13:59:27.675264513Z",
"latest-update": "2024-06-06T09:09:16.726328Z",
"options": {
"no-language-in-filenames": true,
"preserve-filenames": true
Expand Down

0 comments on commit d5d9bcc

Please sign in to comment.