-
Notifications
You must be signed in to change notification settings - Fork 21
Mark Cost Attribution end_month parameter as not required #2027
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
Mark Cost Attribution end_month parameter as not required #2027
Conversation
| # @option opts [Boolean] :include_descendants Include child org cost in the response. Defaults to `true`. | ||
| # @return [Array<(MonthlyCostAttributionResponse, Integer, Hash)>] MonthlyCostAttributionResponse data, response status code and response headers | ||
| def get_monthly_cost_attribution_with_http_info(start_month, end_month, fields, opts = {}) | ||
| def get_monthly_cost_attribution_with_http_info(start_month, fields, opts = {}) |
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.
⚪ Code Quality Violation
Avoid using a hash as an optional parameter (...read more)
The rule "Avoid hash optional parameters" is a guideline that encourages developers to explicitly declare parameters instead of using a hash for optional parameters. This is because using a hash for optional parameters can make the code harder to understand and maintain. It can also lead to unexpected behavior if a developer accidentally includes a key in the hash that the method does not expect.
This rule is important because it promotes code readability and maintainability. It also helps prevent potential bugs that may occur due to unexpected keys in the optional hash. By explicitly declaring each parameter, developers can easily see what parameters a method expects, making the code easier to read and understand.
To adhere to this rule, instead of using a hash for optional parameters, explicitly declare each parameter in the method definition. For example, instead of using options = {} in the method definition, declare each parameter like name, email, age. This way, anyone reading the code can easily understand what parameters the method expects and in what order.
| # @see #get_monthly_cost_attribution_with_http_info | ||
| def get_monthly_cost_attribution(start_month, end_month, fields, opts = {}) | ||
| data, _status_code, _headers = get_monthly_cost_attribution_with_http_info(start_month, end_month, fields, opts) | ||
| def get_monthly_cost_attribution(start_month, fields, opts = {}) |
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.
⚪ Code Quality Violation
Avoid using a hash as an optional parameter (...read more)
The rule "Avoid hash optional parameters" is a guideline that encourages developers to explicitly declare parameters instead of using a hash for optional parameters. This is because using a hash for optional parameters can make the code harder to understand and maintain. It can also lead to unexpected behavior if a developer accidentally includes a key in the hash that the method does not expect.
This rule is important because it promotes code readability and maintainability. It also helps prevent potential bugs that may occur due to unexpected keys in the optional hash. By explicitly declaring each parameter, developers can easily see what parameters a method expects, making the code easier to read and understand.
To adhere to this rule, instead of using a hash for optional parameters, explicitly declare each parameter in the method definition. For example, instead of using options = {} in the method definition, declare each parameter like name, email, age. This way, anyone reading the code can easily understand what parameters the method expects and in what order.
263bfd7 to
20b9f8c
Compare
39dc169 to
5ef6880
Compare
5ef6880 to
279c6d4
Compare
279c6d4 to
6aee14b
Compare
Co-authored-by: ci.datadog-api-spec <[email protected]> d5e3ae3
See DataDog/datadog-api-spec#3154
Test branch datadog-api-spec/test/belkacem/fix-cbt-end-month