fix: Apply Python naming conventions to _nmf.py parameters and variables#637
Merged
Merged
Conversation
Fixed issues: - AZ45CvQfRXnEWm2Rf4x1 for python:S117 rule - AZ45CvQfRXnEWm2Rf4x0 for python:S117 rule - AZ45CvQfRXnEWm2Rf4x9 for python:S117 rule - AZ45CvQfRXnEWm2Rf4x- for python:S117 rule - AZ45CvQfRXnEWm2Rf4xy for python:S117 rule - AZ45CvQfRXnEWm2Rf4xz for python:S117 rule - AZ45CvQfRXnEWm2Rf4x2 for python:S117 rule - AZ45CvQfRXnEWm2Rf4x3 for python:S117 rule - AZ45CvQfRXnEWm2Rf4x7 for python:S117 rule - AZ45CvQfRXnEWm2Rf4x5 for python:S117 rule Generated by SonarQube Agent (task: 71eee368-5fe4-4d0d-aa94-15fb43a9079b)
SonarQube reviewer guideSummary: Standardize variable naming conventions in Review Focus: This is a large refactoring with widespread variable renames (W→w, H→h, A→a, B→b, etc.). Pay close attention to:
Start review at:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Rename 6 function parameters and 4 local variables in sklearn/decomposition/_nmf.py to comply with Python naming conventions (lowercase with underscores). This resolves 10 SonarQube S117 issues where identifiers contained uppercase letters that violated the required pattern ^[a-z][a-z0-9]*$.
View Project in SonarCloud
Fixed Issues
python:S117 - Rename this parameter "l2_reg_H" to match the regular expression ^[_a-z][a-z0-9_]*$. • MINOR • View issue
Location:
sklearn/decomposition/_nmf.py:630Why is this an issue?
A naming convention in software development is a set of guidelines for naming code elements like variables, functions, and classes.
Local variables and function parameters hold the meaning of the written code. Their names should be meaningful and follow a consistent and easily recognizable pattern.
Adhering to a consistent naming convention helps to make the code more readable and understandable, which makes it easier to maintain and debug. It also ensures consistency in the code, especially when multiple developers are working on the same project.
What changed
Renames function parameters from uppercase/mixed-case names (W, H, l1_reg_H, l2_reg_H, A, B) to lowercase equivalents (w, h, l1_reg_h, l2_reg_h, a, b) in the _multiplicative_update_h function signature. This directly fixes the naming convention violations for parameters W, H, l1_reg_H, l2_reg_H, A, and B that don't match the required pattern ^[a-z][a-z0-9]*$.
python:S117 - Rename this parameter "H" to match the regular expression ^[_a-z][a-z0-9_]*$. • MINOR • View issue
Location:
sklearn/decomposition/_nmf.py:630Why is this an issue?
A naming convention in software development is a set of guidelines for naming code elements like variables, functions, and classes.
Local variables and function parameters hold the meaning of the written code. Their names should be meaningful and follow a consistent and easily recognizable pattern.
Adhering to a consistent naming convention helps to make the code more readable and understandable, which makes it easier to maintain and debug. It also ensures consistency in the code, especially when multiple developers are working on the same project.
What changed
Renames function parameters from uppercase/mixed-case names (W, H, l1_reg_H, l2_reg_H, A, B) to lowercase equivalents (w, h, l1_reg_h, l2_reg_h, a, b) in the _multiplicative_update_h function signature. This directly fixes the naming convention violations for parameters W, H, l1_reg_H, l2_reg_H, A, and B that don't match the required pattern ^[a-z][a-z0-9]*$.
python:S117 - Rename this parameter "W" to match the regular expression ^[_a-z][a-z0-9_]*$. • MINOR • View issue
Location:
sklearn/decomposition/_nmf.py:630Why is this an issue?
A naming convention in software development is a set of guidelines for naming code elements like variables, functions, and classes.
Local variables and function parameters hold the meaning of the written code. Their names should be meaningful and follow a consistent and easily recognizable pattern.
Adhering to a consistent naming convention helps to make the code more readable and understandable, which makes it easier to maintain and debug. It also ensures consistency in the code, especially when multiple developers are working on the same project.
What changed
Renames function parameters from uppercase/mixed-case names (W, H, l1_reg_H, l2_reg_H, A, B) to lowercase equivalents (w, h, l1_reg_h, l2_reg_h, a, b) in the _multiplicative_update_h function signature. This directly fixes the naming convention violations for parameters W, H, l1_reg_H, l2_reg_H, A, and B that don't match the required pattern ^[a-z][a-z0-9]*$.
python:S117 - Rename this parameter "l1_reg_H" to match the regular expression ^[_a-z][a-z0-9_]*$. • MINOR • View issue
Location:
sklearn/decomposition/_nmf.py:630Why is this an issue?
A naming convention in software development is a set of guidelines for naming code elements like variables, functions, and classes.
Local variables and function parameters hold the meaning of the written code. Their names should be meaningful and follow a consistent and easily recognizable pattern.
Adhering to a consistent naming convention helps to make the code more readable and understandable, which makes it easier to maintain and debug. It also ensures consistency in the code, especially when multiple developers are working on the same project.
What changed
Renames function parameters from uppercase/mixed-case names (W, H, l1_reg_H, l2_reg_H, A, B) to lowercase equivalents (w, h, l1_reg_h, l2_reg_h, a, b) in the _multiplicative_update_h function signature. This directly fixes the naming convention violations for parameters W, H, l1_reg_H, l2_reg_H, A, and B that don't match the required pattern ^[a-z][a-z0-9]*$.
python:S117 - Rename this parameter "A" to match the regular expression ^[_a-z][a-z0-9_]*$. • MINOR • View issue
Location:
sklearn/decomposition/_nmf.py:630Why is this an issue?
A naming convention in software development is a set of guidelines for naming code elements like variables, functions, and classes.
Local variables and function parameters hold the meaning of the written code. Their names should be meaningful and follow a consistent and easily recognizable pattern.
Adhering to a consistent naming convention helps to make the code more readable and understandable, which makes it easier to maintain and debug. It also ensures consistency in the code, especially when multiple developers are working on the same project.
What changed
Renames function parameters from uppercase/mixed-case names (W, H, l1_reg_H, l2_reg_H, A, B) to lowercase equivalents (w, h, l1_reg_h, l2_reg_h, a, b) in the _multiplicative_update_h function signature. This directly fixes the naming convention violations for parameters W, H, l1_reg_H, l2_reg_H, A, and B that don't match the required pattern ^[a-z][a-z0-9]*$.
python:S117 - Rename this parameter "B" to match the regular expression ^[_a-z][a-z0-9_]*$. • MINOR • View issue
Location:
sklearn/decomposition/_nmf.py:630Why is this an issue?
A naming convention in software development is a set of guidelines for naming code elements like variables, functions, and classes.
Local variables and function parameters hold the meaning of the written code. Their names should be meaningful and follow a consistent and easily recognizable pattern.
Adhering to a consistent naming convention helps to make the code more readable and understandable, which makes it easier to maintain and debug. It also ensures consistency in the code, especially when multiple developers are working on the same project.
What changed
Renames function parameters from uppercase/mixed-case names (W, H, l1_reg_H, l2_reg_H, A, B) to lowercase equivalents (w, h, l1_reg_h, l2_reg_h, a, b) in the _multiplicative_update_h function signature. This directly fixes the naming convention violations for parameters W, H, l1_reg_H, l2_reg_H, A, and B that don't match the required pattern ^[a-z][a-z0-9]*$.
python:S117 - Rename this local variable "WH_safe_X" to match the regular expression ^[_a-z][a-z0-9_]*$. • MINOR • View issue
Location:
sklearn/decomposition/_nmf.py:639Why is this an issue?
A naming convention in software development is a set of guidelines for naming code elements like variables, functions, and classes.
Local variables and function parameters hold the meaning of the written code. Their names should be meaningful and follow a consistent and easily recognizable pattern.
Adhering to a consistent naming convention helps to make the code more readable and understandable, which makes it easier to maintain and debug. It also ensures consistency in the code, especially when multiple developers are working on the same project.
What changed
Renames the local variable WH_safe_X to wh_safe_x, fixing the naming convention violation where the variable name contained uppercase letters and didn't match the required pattern ^[a-z][a-z0-9]*$.
python:S117 - Rename this local variable "WH_safe_X_data" to match the regular expression ^[_a-z][a-z0-9_]*$. • MINOR • View issue
Location:
sklearn/decomposition/_nmf.py:641Why is this an issue?
A naming convention in software development is a set of guidelines for naming code elements like variables, functions, and classes.
Local variables and function parameters hold the meaning of the written code. Their names should be meaningful and follow a consistent and easily recognizable pattern.
Adhering to a consistent naming convention helps to make the code more readable and understandable, which makes it easier to maintain and debug. It also ensures consistency in the code, especially when multiple developers are working on the same project.
What changed
Renames local variables WH_safe_X_data to wh_safe_x_data and X_data to x_data in the sparse branch, fixing naming convention violations where these variable names contained uppercase letters.
python:S117 - Rename this local variable "X_data" to match the regular expression ^[_a-z][a-z0-9_]*$. • MINOR • View issue
Location:
sklearn/decomposition/_nmf.py:642Why is this an issue?
A naming convention in software development is a set of guidelines for naming code elements like variables, functions, and classes.
Local variables and function parameters hold the meaning of the written code. Their names should be meaningful and follow a consistent and easily recognizable pattern.
Adhering to a consistent naming convention helps to make the code more readable and understandable, which makes it easier to maintain and debug. It also ensures consistency in the code, especially when multiple developers are working on the same project.
What changed
Renames local variables WH_safe_X_data to wh_safe_x_data and X_data to x_data in the sparse branch, fixing naming convention violations where these variable names contained uppercase letters.
python:S117 - Rename this local variable "W_sum" to match the regular expression ^[_a-z][a-z0-9_]*$. • MINOR • View issue
Location:
sklearn/decomposition/_nmf.py:674Why is this an issue?
A naming convention in software development is a set of guidelines for naming code elements like variables, functions, and classes.
Local variables and function parameters hold the meaning of the written code. Their names should be meaningful and follow a consistent and easily recognizable pattern.
Adhering to a consistent naming convention helps to make the code more readable and understandable, which makes it easier to maintain and debug. It also ensures consistency in the code, especially when multiple developers are working on the same project.
What changed
Renames local variable W_sum to w_sum and updates usages of the renamed parameter w (formerly W), fixing the naming convention violation where W_sum contained uppercase letters and didn't match the required pattern.
SonarQube Remediation Agent uses AI. Check for mistakes.