Giter Site home page Giter Site logo

sap / code-pal-for-abap Goto Github PK

View Code? Open in Web Editor NEW
320.0 23.0 62.0 3.03 MB

code pal for ABAP is a highly configurable engine, fully integrated into the ABAP development framework ensuring Cloud’s built-in quality.

License: Apache License 2.0

ABAP 100.00%
abap atc check clean-code inspector code-inspector quality abapgit open-source sap

code-pal-for-abap's Introduction

code pal for ABAP

abap package version license REUSE status

This tool provides a set of checks to help adhering to the Clean ABAP style guide. While not all recommendations from the guide can be checked by static code analysis and in certain situations strict adherence to the guide might not be recommended, this provides robust automated support at least for a subset of recommendations.

It's free and open-source.

This is the legacy version supporting local checks on check systems starting with SAP_BASIS release 7.40. For the remote-enabled version for ABAP Cloud, see the Cloud Edition.

Features

  • Supported by Code Inspector (SCI / SCII) and ABAP Test Cockpit (ATC) (SE80 / Eclipse);
  • Ignores automatically generated code;
  • Supports exemptions;
  • Provides a new user-friendly way to create variants (Profile Management);
  • Allows configuration based on:
    • Threshold;
    • Severity / Priority;
    • Validity for productive code, test code, or both;
    • Validity for objects created since a specific date;
    • Validity period;
    • Allow / Deny exemption.

Severities set to Notification / Priority 3 by default (#368).

Set of Checks

Dependencies

  • Since Version 1.00 - SAP NetWeaver 7.40 SP8 or higher
  • abapGit

How-to Guides

Further Documentation

Recommended Readings

Recommended Courses

code-pal-for-abap's People

Contributors

alexandreht avatar bjoern-jueliger-sap avatar conjuringcoffee avatar d074020 avatar estevao-schultz-neto-sap avatar jelliottp avatar jrodriguez-rc avatar larshp avatar larsip avatar lucasborin avatar matthewdjb avatar maxim-engel-sap avatar olafschmidt avatar smb avatar stefan-hauser-sap avatar steve192 avatar thomham avatar thoralfhaensel avatar valeriast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

code-pal-for-abap's Issues

What is the reason for check parameter "Message severity"?

All Code Pal checks provide a parameter for "Message severity". However, the severity of ATC messages can be defined inside transaction SCI "Management of message priorities". Hence no other ATC checks seem to provide a parameter for that. Therefore I want to recommend to remove the parameter "Message severity" from the base class Y_CHECK_BASE and instead define the severity in the same way, as for the other check classes.

Syntax Error in Y_DEMO_FAILURES

Actually, I am not even sure what this syntax errors means. Maybe even error in syntax check? Any suggestion?

grafik

Ref system ABAP 7.40/SP0023.

Changed values are not saved

I'm trying to change the values for some checks (Cyclomatic Complexity and Number of Executable Statements) and they remain with the default value instead of changed.

Not runnable under 7.40

CodePal does not run under 7.40 because class y_check_base has a syntax error.

In constructor the instance attribute of referenced class CL_CI_TEST_ROOT is set

me->remote_rfc_enabled = abap_true.

This attribute does not exist under 7.40.

Empty Catches

TRY.
   some code.
CATCH cx_error.
   "empty
ENDTRY.

CATCH sys_error.
   "empty
ENDCATCH.

Simplifying RAISE_ERROR( ... )

The Y_CHECK_BASE->RAISE_ERROR( ... ) has the importing parameter named p_code which is unnecessary, as we can get it from the p_kind using the get_code( p_kind ) internally.

Currently, we perform the conversion on the inherited check:
image

False Positive in "Declaration in IF Check"

IMO we have a false positive in

https://github.com/SAP/code-pal-for-abap/blob/master/docs/checks/declaration-in-if.md

When you have the following code:

....
  IF condition.
    DATA(my_log_value) = |{ val1 } + { val2 }|. 
    MESSAGE i001(/absw/messageclass) WITH my_log_value INTO DATA(msgtext).
  ENDIF.
ENDMETHOD.

The check reports the my_log_value line, because it's delcared within the IF - but since it's not used outside afterwards, this shouldn't be an error.

In other languages this would be covered by variable scope (my_log_value) only available within the IF block - but even without scoping it's much cleaner if you dont declare this outside.

New check: non-exhaustive case statement

Example: I have a domain with 3 fixed values. Then every case statement based on that domain not covering all three is suspicious. 

Even more importantly, if you extend the domain with a fourth value later, all existing switches should be reviewed to make sure the new value is handled correctly.

Minor point about documentation

In some systems (e.g. 750) in SCI the menu path is Code Inspector-> Management of -> Tests as opposed to "Checks"

It does not matter I hope everyone will be able to figure that out anyway, but I just thought I would mention it.

Convert Line Endings to match UNIX

I've had to convert all *,abap files to use UNIX line endings because ABAPGIT was dumping with CX_OO_CLASS_SCAN_ERROR. I'd like to suggest this workaround addition to the README.md file.

Y_CHECK_RECEIVING_USAGE - Usage of RECEIVING cannot be avoided

Dear Code Pals,

Since the usage of RECEIVING is mandatory when working with classic exceptions at this point of time, the check should skipped in these situations.

Corresponding to the discussion in the (closed) issue #72 I propose the following change to the method
Y_CHECK_RECEIVING_USAGE->INSPECT_TOKENS:

....
       FROM statement-from TO statement-to WHERE str EQ 'RECEIVING'.

       "Method calls with classic exceptions can not be written in functional style
      LOOP AT ref_scan_manager->get_tokens( ) FROM statement-from TO statement-to REFERENCE INTO DATA(current_token)
        WHERE str = 'EXCEPTIONS'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        EXIT.
      ENDIF.

      statement_for_message = statement.

...

I do not really like this bulky notation just for checking, if the token EXCEPTIONS can be found inside the current statement, but so far I do not have a better solution. Perhaps somebody has a shorter algorithm for that.

By the way: I would replace the IF CHECK_CONFIGURATION...ENDIF. the following way - just because this notation is shorter:
CHECK check_configuration IS NOT INITIAL.

Thomas

CONCATENATE RESPECTING BLANKS => concat_lines_of

Hi, I don't know if this is an issue o more a question.

I'm using this sentence:
CONCATENATE LINES OF lt_content INTO DATA(lv_string) RESPECTING BLANKS.

A check detects it and tells me to replace by concat_lines_of
image

The problem is that I cannot found a RESPECTING BLANKS addition for concat_lines_of

Extend Magic number checks for numeric strings

https://github.com/SAP/code-pal-for-abap/blob/master/clean_code_main/clean_code_checks/y_check_magic_number.clas.abap
https://github.com/SAP/code-pal-for-abap/blob/master/docs/checks/magic-number.md

Could this be extended to also detect something like

IF my_variable = '5'. ?

Something like this in the check:

^(?!'?[01]'?$)\'?\d+\'?$

(Could also create a PR if needed - The negative lookahead for 0 / 1 doesn't improve readability of this regexp)

https://regex101.com/r/MwfLLJ/2

New check - modification of importing parameter via field-symbol

  methods EXECUTE
    importing
      !IR_OPERAND1 type ref to DATA
      !IR_OPERAND2 type ref to DATA
      !IR_RESULT type ref to DATA.

METHOD execute.      
   CHECK ir_operand1 IS BOUND AND
   ir_operand2 IS BOUND AND
   ir_result   IS BOUND.

    ASSIGN ir_operand1->* TO FIELD-SYMBOL(<operand1>).
    ASSIGN ir_operand2->* TO FIELD-SYMBOL(<operand2>).
    ASSIGN ir_result->*   TO FIELD-SYMBOL(<result>).

    TRY.
      <result> = <operand1> - <operand2>.
    CATCH cx_root.
    ENDTRY.
ENDMETHOD.

I found this method which treats an importing parameter as if it were changing/returning.

CHECK Comment Usage

I implemented this check (and many others), but it is getting comments that I can't find.
This is one of the classes, in which code find 4 comments:

"! <p class="shorttext synchronized" lang="en">APACK Definition</p>
CLASS /rslt/cl_bs_apack DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC.

  PUBLIC SECTION.
    INTERFACES zif_apack_manifest.

    CONSTANTS:
      gc_artifact_id TYPE string VALUE 'base' ##NO_TEXT,
      gc_version     TYPE string VALUE '2.0.0' ##NO_TEXT,
      gc_repository  TYPE string VALUE '' ##NO_TEXT.

    "! <p class="shorttext synchronized" lang="en">CONSTRUCTOR</p>
    "!
    METHODS constructor.

  PROTECTED SECTION.

  PRIVATE SECTION.

ENDCLASS.



CLASS /rslt/cl_bs_apack IMPLEMENTATION.


  METHOD constructor.

    zif_apack_manifest~descriptor = VALUE #( group_id    = ''
                                             artifact_id = gc_artifact_id
                                             version     = gc_version
                                             git_url     = gc_repository ).

  ENDMETHOD.


ENDCLASS.

I think it is getting ABAP Doc as commentary, but in the above code there are only 3 lines and check detects 4
image

Check target field of select

Hey SAP experts,

there is a quite common issue from our developers that target fields (structure/table type) do not match SELECT field list.
Can you provide a check for that, please? 🙏

Example:

FORM cut.

  DATA: ls_mara TYPE mara.
  
  SELECT SINGLE mtart FROM mara
    INTO ls_mara " MTART is not moved to ls_mara-mtart but into
	         " the first fields MANDT (3 characters) and MATNR (1 character)
		 " -> How to track this with SCI/ATC/SLIN, etc? 
    WHERE matnr = '...'.
	
ENDFORM.

Too Many Output Parameters Check

image

I get the error message abut too many output parameters.

But there is only one output parameter. The Pseudo-Comment to suppress the error does not work either.

image

Redundancy of check classes

I noticed, that several Code Pal checks are already covered from SAP standard checks. E.g. the Code Pal checks
"Number of attributes", "Number of methods", "Number of public Attributes" is already integrated in the SAP standard check class "OO Size metrices". The Code Pal check "Nesting depth" is included in the SAP standard check "Program complexity Test" and so on.
What is the reason for that?
Users of Code Pal and SAP standard checks have to consider, which one of the checks is the better or more accurate one. If both checks are activated at the same time, they might produce redundant or even contradictory messages and the repository of the system (superfluously) increased.
My recommendation would be, to remove any check classes from the Code Pal, that is already covered from the SAP standard.

Another Syntax Error

image

image

What you should do is have a system on the lowest ABAP release the "Code Pal" is supposed to be compatible with and test it there before doing a new release.

Error Message

I click on all the check boxes of the new "Y" checks and then press SAVE. I get an error message as follows:-

image

It tells you have to fix the problem but again, I just thought I would mention it.

Cannot Pull into Z-Packages

Installation Guide mentions to install Code Pal into local package, e.g. $CLEAN_CODE_MAIN.
As I want to run tests in both DEV and QA stages, I wanted to use Z-package Z_CODE_PAL in DEV to be able to create transport request and import code pal to QA system.

It looks like Code Pal trys to use SAP Standard packages like CLEAN_CODE_FOUNDATION, which can be pulled into $-packages, but not into customer namespace. -- Please advise.

Import Log:

Customer object DOMA YCICC_MESSAGE_KIND cannot be assigned to package CLEAN_CODE_FOUNDATION

Import of object YCICC_MESSAGE_KIND failed

Customer object DTEL YCICC_MESSAGE_KIND cannot be assigned to package CLEAN_CODE_FOUNDATION

Import of object YCICC_MESSAGE_KIND failed

Customer object DTEL YCICC_PRODUCTIVE_CODE cannot be assigned to package CLEAN_CODE_FOUNDATION

Import of object YCICC_PRODUCTIVE_CODE failed

Customer object DTEL YCICC_TESTCODE cannot be assigned to package CLEAN_CODE_FOUNDATION

Import of object YCICC_TESTCODE failed

Customer object DTEL YCICC_THRESHOLD cannot be assigned to package CLEAN_CODE_FOUNDATION

Import of object YCICC_THRESHOLD failed

Customer object TABL YTAB_EXEMPTIONS cannot be assigned to package CLEAN_CODE_FOUNDATION

Import of object YTAB_EXEMPTIONS failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object YCX_ENTRY_NOT_FOUND failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object YCX_NO_CHECK_CUSTOMIZING failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object YCX_OBJECT_IS_EXEMPTED failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object YCX_OBJECT_NOT_PROCESSED failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_BASE failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_CALL_METHOD_USAGE failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_CATEGORY failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_CHECK_STMNT_POSITION failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_COMMENT_USAGE failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_CONSTANTS_INTERFACE failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_CYCLOMATIC_COMPLEXITY failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_DB_ACCESS_IN_UT failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_DECLARATION_IN_IF failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_DEPRECATED_KEY_WORDS failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_EMPTY_CATCHES failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_EMPTY_IF_BRANCHES failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_EMPTY_PROCEDURES failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_EQUALS_SIGN_CHAINING failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_FORM failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_FUNCTION failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_IS_INTERFACE_IN_CLASS failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_MAGIC_NUMBER failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_MAX_NESTING_DEPTH failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_METHOD_OUTPUT_PARAM failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_METHOD_RETURN_BOOL failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_NON_CLASS_EXCEPTION failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_NUMBER_ATTRIBUTES failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_NUMBER_EVENTS failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_NUMBER_INTERFACES failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_NUMBER_METHODS failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_NUM_EXEC_STATEMENTS failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_NUM_OUTPUT_PARAMETER failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_NUM_PUBLIC_ATTRIBUTES failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_RECEIVING_USAGE failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_SUB_ASSIGN_READ_TABLE failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CHECK_TEST_SEAM_USAGE failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_CLEAN_CODE_MANAGER failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_EXEMPTION_DISPATCHER failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_EXEMPTION_GENERAL failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_EXEMPTION_HANDLER failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_EXEMPTION_OF_CLASS failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_EXEMPTION_OF_FUNCTION_GROUP failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_EXEMPTION_OF_PROGRAM failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_MESSAGE_REGISTRATION failed

Error from SEO_CLASS_CREATE_COMPLETE. Subrc = 5

Import of object Y_OBJECT_CREATION_DATE failed

Error from SEO_INTERFACE_CREATE_COMPLETE. Subrc = 5

Import of object Y_IF_CLEAN_CODE_MANAGER failed

Error from SEO_INTERFACE_CREATE_COMPLETE. Subrc = 5

Import of object Y_IF_EXEMPTION_DISPATCHER failed

Error from SEO_INTERFACE_CREATE_COMPLETE. Subrc = 5

Import of object Y_IF_EXEMPTION_OF_OBJECTS failed

Error from SEO_INTERFACE_CREATE_COMPLETE. Subrc = 5

Import of object Y_IF_OBJECT_CREATION_DATE failed

Error from SEO_INTERFACE_CREATE_COMPLETE. Subrc = 5

Import of object Y_IF_SCAN_MANAGER failed

Error from SEO_INTERFACE_CREATE_COMPLETE. Subrc = 5

Import of object Y_IF_SCAN_STATISTICS failed

Error from SEO_INTERFACE_CREATE_COMPLETE. Subrc = 5

Import of object Y_IF_TESTCODE_DETECTOR failed

Class Y_CHECK_CALL_METHOD_USAGE - Ignore CALL METHOD when classic exceptions are used

The idea of check class Y_CHECK_CALL_METHOD_USAGE is to find outdated method calls invoked with
CALL METHOD myMethod
to encourage developers using the shorter and functional expression
myMethod( ).

However, when using classic exceptions and returning parameters as the same time, you cannot avoid CALL METHOD, e.g.

CALL METHOD myMethod
    RECEIVING = return_value
    EXCEPTIONS others = 1.

There is currently no functional expression for that.

Now you could argument, that classic exceptions should no longer be used. But there are still several common classes in the SAP standard with classic exceptions (e.g. CL_GUI_ALV_GRID). When using these classes the Code Pal would produce pointless warnings. Furthermore, ATC already does provide a check for classic exception.

Following from this, I recommend to skip the CALL METHOD check for all method calls with classic exceptions and return-parameters. In order to do this, the following code change would need to be added to method Y_CHECK_CALL_METHOD_USAGE->INSPECT_TOKENS( ):

...
      AND is_dynamic             = abap_false.

      "Method calls with classic exceptions and returning parameters can not be written in functional style
      LOOP AT ref_scan_manager->get_tokens( ) FROM statement-from TO statement-to REFERENCE INTO DATA(current_token).
        IF current_token->str = 'EXCEPTIONS'.
          DATA(has_classic_exceptions) = abap_true.
        ELSEIF current_token->str = 'RECEIVING'.
          DATA(has_returning_message) = abap_true.
        ENDIF.
      ENDLOOP.

      IF has_classic_exceptions = abap_false OR has_returning_message = abap_false.
        raise_error( p_sub_obj_type = c_type_include
                     p_level        = statement_for_message-level
...

The same applies to the check class Y_CHECK_RECEIVING_USAGE : You must use RECEIVING, when you are working with classic exceptions.

New check class for unit test coverage

Dear Code Pal team,

I developed a new custom SCI/ATC check class for SAP Release 754, that I would like to contribute to the Code Pal project. Unfortunately, I noticed, that the Code Pal seems to be protected in GitHub, hence I am not allowed to upload my check class.

My check class determines the ABAP unit test coverage of any given set of ABAP sources defined in the SCI/ATC. It does it in this way:

  1. Determine the cyclomatic complexity of a class/Fugr/program. If the complexity exceeds a customizable threshold, proceed with step 2. (This is relevant, since I do not want developers to produce unit tests for boiler plate code or SETer/GETer methods).
  2. Search for unit tests for these development object.
  3. Execute the unit tests
  4. Retrieve the (line based) coverage of the executed unit tests.
  5. If the unit test coverage in % falls below a customizable value (default 60%), this will produce a warning message in SCI/ATC. An error message will be issued, if the coverage falls below a second customizable value (default 20%) or the development object has no unit tests.

If you do think, this is a helpfull check and should be part of the Code Pal, please advise, how I can contribute.

Regards

Thomas

ABAP Doc and comments check

Following issue #7

I enabled again this check and still gets ABAP Documentation as comments and result is exactly the same as #7

Also, is detecting comments in a function module without comments:
image

Check for class-based exception does not work correctly

We have many findings because of code like this:

IF sy-subrc <> 0.
  RAISE EXCEPTION cx_my_exception_class=>create_from_symsg( ).
ENDIF.

Here the check will issue a finding even though class based exceptions are used.

BR

New Pseudo Comments

The obvious problem with the new Pseudo Comments is that they are not recognized by the traditional extended program check as in:-

image

Therefore there is no way to get the extended program check and the code inspector to give a clean slate.

Check for CHECK Statements

The style guide says to use CHECK statements at the start of methods, but nowhere else.

The below gives two warnings:-

image

Often you need comments above the CHECK to explain to the reader what is going on. Often you need several CHECK statements.

Even if you disagree in my example CHECK is in fact the first STATEMENT but the check says it is not and that is clearly wrong.

Therefore if the first (say) three statements (not comments) in a method are OK, you should let it go.

Prefer CASE to ELSE IF check is not correct

You can do a CASE only if in all ELSE branches the same variable is used. We get findings for code like this:

IF ls_posting-betrw > 0.
  ls_posting-shkzg = 'S'.
ELSEIF ls_posting-betrh > 0.
  ls_posting-shkzg = 'S'.
ELSEIF ls_posting-betr2 > 0.
  ls_posting-shkzg = 'S'.
ELSEIF ls_posting-betr3 > 0.
  ls_posting-shkzg = 'S'.
ELSE.
  ls_posting-shkzg = 'H'.
ENDIF.

how can this be replaced by a CASE?

Pseudo-Comments not suppressing warnings

I have tried to suppress the two warning by using the psuedo-comment suggested:-

image

However they still comes up as warnings even I back right out of the class and go back in again.

image

However the pseudo comment works in other methods in the class - there the warning is indeed suppressed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.