SAP / code-pal-for-abap

code pal for ABAP is a highly configurable engine, fully integrated into the ABAP development framework ensuring Cloud’s built-in quality.
Apache License 2.0
348 stars 66 forks source link

Number of public attributes threshold #158

Closed jrodriguez-rc closed 4 years ago

jrodriguez-rc commented 4 years ago

Number of public attributes check has no threshold option image

In code is setted to 1 image

But the check is raising even if no public attributes exists image

lucasborin commented 4 years ago

We recently changed its default threshold from 00 to 01 to keep its threshold behavior like the other checks (once you have one public attribute, raise the error), and to support the new unit test framework.

Are you using the Profiles feature?

If so, I kindly ask you to remove the check from the profile and assign it again (it will use the new default threshold).

If you are not using the Profile, could you please deactivate the Check in the SCI framework, and reactivate it?

  1. T.code SCI > Code Inspector > Mangement Of > Check > Unselect y_check_num_public_attributes > Save;
  2. T.code SCI > Code Inspector > Mangement Of > Check > Select y_check_num_public_attributes > Save.

Let me know if it works, or if you need new further support on it.

jrodriguez-rc commented 4 years ago

I'm executing it without Profile, just SCI configuration.

I tried to unselect > save > select > save and still I get the error.

Including configuration in Profile works fine, but I need to apply only in a specific SCI variant

lucasborin commented 4 years ago

Hm, interesting. It looks like something in a buffer because it works with the Profile feature. Have you tried to unselect > save > select > save the Check in the SCI variant?

jrodriguez-rc commented 4 years ago

Yes, I tried it from Mangement Of > Check and directly in the variant.

It's like the variant settings saved threshold 0 from the initial configuration.

Is there any way to restore default settings only for a check in a variant?

lucasborin commented 4 years ago

Yeah, it looks the variant saved the threshold 0. We will take a deeper look at it.

I have a workaround to suggest to you:

  1. Open the y_check_num_public_attributes, and change the settings-disable_threshold_selection to abap_false in the class constructor;
  2. Go to SCI and unselect > save > select > save the check via Management Of > Check;
  3. Go to SCI and change the set threshold from 0 to 1;
  4. Rever the changes (1~3 having disable_threshold_selection it as abap_true).
jrodriguez-rc commented 4 years ago

It is working with this change, thanks