Skip to content
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

Ruff: Fix RUF046 #11492

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Ruff: Fix RUF046 #11492

wants to merge 1 commit into from

Conversation

kiblik
Copy link
Contributor

@kiblik kiblik commented Jan 2, 2025

Fix RUF046. Enabler for #11490

Copy link

dryrunsecurity bot commented Jan 2, 2025

DryRun Security Summary

The pull request improves the accuracy of calculating weeks between two dates in the view_product_metrics function by modifying the ceil() function application, with no apparent security risks.

Expand for full summary

Summary:

The code change in this pull request is focused on improving the accuracy of the calculation of the number of weeks between two dates in the view_product_metrics function. The original code used the ceil() function to round up the number of weeks, which could result in the number of weeks being greater than the actual number of weeks between the two dates. The updated code uses the ceil() function directly on the calculation of the number of weeks, which should provide a more accurate result. This change ensures that the number of weeks displayed in the product metrics view is calculated correctly.

From an application security perspective, this change does not introduce any obvious security risks. The code is primarily focused on calculating the number of weeks between two dates and displaying product metrics. There are no user inputs being processed or any other security-sensitive operations being performed. Overall, this code change appears to be a minor optimization to improve the accuracy of the product metrics calculations.

Files Changed:

  • dojo/product/views.py: The changes in this file are related to the calculation of the number of weeks between two dates in the view_product_metrics function. The original code used the ceil() function to round up the number of weeks, which could result in the number of weeks being greater than the actual number of weeks between the two dates. The updated code uses the ceil() function directly on the calculation of the number of weeks, which should provide a more accurate result.

Code Analysis

We ran 9 analyzers against 1 file and 0 analyzers had findings. 9 analyzers had no findings.

View PR in the DryRun Dashboard.

Copy link
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants