-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert Icon Legend module #1205
Conversation
Quality Gate passedIssues Measures |
Using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked out a few instances, all looks well to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested a few myself too and happy its working as expected!
Tested in reports too and using anchors and legendScale
Revert & Refactor
legendIcon
Function to Improve Code Readability and MaintainabilityThis pull request contains changes to refactor the
legendIcon
function in the/ui/elements/legendIcon
module. The main goal of the PR was to revert the module to a previous working version and to refactor the module to improve code readability, maintainability, and reduce cognitive complexity.Changes ✍️
Refactored the
legendIcon
function to reduce cognitive complexity:createIconFromArray
.createIconFromInlineStyle
.createLineSymbol
.createPolygonSymbol
.legendIcon
function by using early returns.Added JSDoc comments for better documentation 📝 :
legendIcon
function and its parameters.Improved code readability and maintainability 👀 :
Benefits 👍
Reduced cognitive complexity 🧠 :
legendIcon
function from 18 to within the allowed limit of 15.Improved code readability and maintainability 🔧 :
Enhanced documentation:
legendIcon
function and its parameters.Testing 🧪