Skip to content

Commit

Permalink
1.14.0 (#345)
Browse files Browse the repository at this point in the history
* 1.14.0

* fixing version

* adding missing checks feature (#346)

* adding missing checks feature

* minor update

Co-authored-by: Eugen Guenther <eugen.guenther@sap.com>

* Update changelog.txt

* Standard Functions in Prefer IS NOT to NOT IS (#353)

* solves #338

* Update changelog.txt

* contains_any_not_of and contains_any_of

* Prefer New to Create Object (#354)

* implements #283

* Update check_documentation.md

* minor fixes

* Create prefer-new-to-create-object.md

* Update changelog.txt

* Update prefer-new-to-create-object.md

* adding example

Co-authored-by: estevao-schultz-neto-SAP <63100656+estevao-schultz-neto-SAP@users.noreply.github.com>

* Unit Test Assert Check (#347)

* new check

* fixing class description

* adding demo

* comparing token type

* Update check_documentation.md

* Update check_documentation.md

* Create unit_test_assert.md

* Update changelog.txt

* Update unit_test_assert.md

Co-authored-by: estevao-schultz-neto-SAP <63100656+estevao-schultz-neto-SAP@users.noreply.github.com>

* Update y_check_unit_test_assert.clas.abap

* Update y_check_unit_test_assert.clas.abap

* Part 1 - core feature - allow pseudo comment exception #329 (#357)

* feature - allow pseudo comment exception

* Update y_check_unit_test_assert.clas.abap

Co-authored-by: Lucas Borin <5233413+lucasborin@users.noreply.github.com>

* Revert "Part 1 - core feature - allow pseudo comment exception #329 (#357)" (#358)

This reverts commit 4da128b.

* fixes #359 (#366)

* Update changelog.txt

* New abapLint Rules (#304)

* Update abaplint.json

* Update abaplint.json

* Update abaplint.json

* Update abaplint.json

* disabling empty_line_in_statement

* Remove double space

* disabling exit_or_check

* disabling line_only_punc

Reporting false-positives:
abaplint/abaplint#1888

* Update abaplint.json

* Update abaplint.json

* Compare operator "EQ" not preferred

* Disabling no_yoda_conditions

abaplint/abaplint#1891

* Method "get_first_character" not used

* Compare operator "EQ" not preferred

* Keep single parameter on one line

* Statement "ADD" is obsolete

* Compare operator "GE" not preferred

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Compare operator "GE" not preferred

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Compare operator "EQ" not preferred

* Avoid use of SELECT *

* Uncaught exception cx_sy_itab_line_not_found

* Compare operator "EQ", "LT, "GT" not preferred

* Reorder definitions to top of routine

* Too many parenthesis, simple

* Prefer Inline Declarations, CHECK_CONFIGURATION

* Missing space between string or character literal

* wrongly commited object

* Some fixes

Compare operator "EQ" not preferred
Prefer Inline Declarations, FM_NAME
Reorder definitions to top of routine

* Statement "ADD" is obsolete

* Compare operator "EQ" not preferred

* Some fixes

Compare operator "EQ" not preferred
Statement "ADD" is obsolete
Statement "SUBTRACT" is obsolete
Line break multiple parameters

* Some fixes

Compare operator "EQ" not preferred
Method "check_token_content" not used
Statement "ADD" is obsolete

* Some fixes

Line break multiple parameters
Compare operator "GE" not preferred
Compare operator "EQ" not preferred

* ops, fixing bug

* Compare operator "EQ" not preferred

* Statement "ADD" is obsolete

* Some fixes

Statement "ADD" is obsolete
Statement "SUBTRACT" is obsolete
Too many parenthesis, complex

* Some fixes

Omit default parameter name "FIRST_TOKEN"
Statement "SUBTRACT" is obsolete
Statement "ADD" is obsolete

* several fixes

* Update y_check_unit_test_assert.clas.abap

* Update abaplint.json

* Update abaplint.json

* Update abaplint.json

* Several fixes

* several fixes

* SEVERAL FIXES

* Update abaplint.json

* Update abaplint.json

* several fixes

* Update abaplint.json

* Update abaplint.json

* Update abaplint.json

* Update abaplint.json

* a few fixes

* Update abaplint.json

* several fixes

* Update abaplint.json

* several fixes

* Update abaplint.json

* a few fixes

* Update abaplint.json

* Update y_exemption_general.clas.abap

* Update y_test_code_detector.clas.abap

* Update y_check_empty_catches.clas.abap

* Don't mix RETURNING and EXPORTING/CHANGING paramet

* Update abaplint.json

* Update abaplint.json

* Update abaplint.json

Co-authored-by: Eugen Günther <64586309+eugen-guenther-sap@users.noreply.github.com>
Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Update changelog.txt

* Update y_check_base.clas.abap

* Update src/foundation/y_check_base.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Update unit_test_assert.md

* Feature allow pseudo comment exception (#361)

* feature - allow pseudo comment exception

* Update y_check_unit_test_assert.clas.abap

* update

* minor update

* requested changes

* Update src/profiles/y_profile_admin_classes.prog.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* UX update

* abaplint fix

* Update y_check_base.clas.abap

* Update y_profile_admin_classes.prog.abap

* Update y_profile_manager.clas.abap

* Update src/profiles/y_profile_admin_classes.prog.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Update y_profile_administrator.prog.xml

* Update y_profile_admin_classes.prog.abap

* Update y_profile_admin_classes.prog.abap

* minor change

* abaplint fix

* Update y_check_base.clas.abap

* update

* update

* Update y_profile_admin_classes.prog.abap

* update

* Update how-to-configure.md

* Update how-to-configure.md

* Update how-to-configure.md

* Update changelog.txt

Co-authored-by: Eugen Guenther <eugen.guenther@sap.com>
Co-authored-by: Eugen Günther <64586309+eugen-guenther-sap@users.noreply.github.com>
Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* Prefer LINE_EXISTS or LINE_INDEX to READ TABLE or LOOP AT (#355)

* implements #286

* Update changelog.txt

* Update check_documentation.md

* demo + description

* Create prefer-line-exists.md

* Update y_check_unit_test_assert.clas.abap

* fixing from/to

* Update y_check_prefer_line_exists.clas.testclasses.abap

Co-authored-by: Eugen Günther <64586309+eugen-guenther-sap@users.noreply.github.com>

* Update changelog.txt

* Update abaplint.json (#377)

* adjust of ignore pseudocomment on relevant checks (#375)

* adjust of ignore pseudocomment on relevant checks

* update

* update

Co-authored-by: Lucas Borin <5233413+lucasborin@users.noreply.github.com>

* changing default severity (#376)

* changing default severity

* fixing version

* c_note

* Update README.md

* Update README.md

* Update how-to-configure.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update how-to-configure.md

* Update how-to-configure.md

* Update how-to-configure.md

* Update how-to-configure.md

* Update how-to-configure.md

* Update changelog.txt

* Update README.md

* Update how-to-configure.md

* Update how-to-configure.md

* Update how-to-configure.md

* Update how-to-configure.md

* Update how-to-configure.md

Co-authored-by: estevao-schultz-neto-SAP <63100656+estevao-schultz-neto-SAP@users.noreply.github.com>

* Update changelog.txt

* Update changelog.txt

* Update changelog.txt

* fixing broken ut

Co-authored-by: Eugen Guenther <eugen.guenther@sap.com>
Co-authored-by: estevao-schultz-neto-SAP <63100656+estevao-schultz-neto-SAP@users.noreply.github.com>
Co-authored-by: Eugen Günther <64586309+eugen-guenther-sap@users.noreply.github.com>
Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
  • Loading branch information
5 people authored Apr 23, 2021
1 parent 0dc6195 commit e45ffb4
Show file tree
Hide file tree
Showing 91 changed files with 2,170 additions and 1,059 deletions.
65 changes: 27 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,32 @@
# code pal for ABAP

[![abap package version](https://img.shields.io/endpoint?url=https://shield.abap.space/version-shield-json/github/SAP/code-pal-for-abap/src/y_code_pal_version.intf.abap/abap&label=version)](https://github.com/SAP/code-pal-for-abap/blob/master/changelog.txt)
[![abap package version](https://img.shields.io/endpoint?url=https://shield.abap.space/version-shield-json/github/SAP/code-pal-for-abap/src/y_code_pal_version.intf.abap/abap&label=version)](changelog.txt)
[![license](https://img.shields.io/github/license/SAP/code-pal-for-abap)](LICENSE)

This tool supports you in writing a clean ABAP code. Clean Code allows you to read your code like well-written prose, it is easily understandable, maintainable, and extensible. In addition, you can write high quality and reliable Unit Tests without hurdles and thereby reduce the total cost of ownership of the software.
Based on the [Clean ABAP](https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md) style guide, this tool contains a set of checks to guarantee the [Clean ABAP](https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md) adherence.
Together, we both support you in writing a clean ABAP code.

Furthermore... It's **free** and **open-source**!
❣️ It's **free** and **open-source**.

It is licensed under the Apache License, Version 2.0 - see [LICENSE](LICENSE).

## News

**:warning: Migration Required :warning:**

From version `v1.01.0` to `v1.02.0` the folder logic was changed, and the abapGit is not able to perform this migration automatically. Therefore, please, follow the step-by-step described in [How To Migrate](pages/how-to-migrate.md)!
## Features

Check the [change log](changelog.txt) for further information.
- 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](pages/how-to-configure.md));
- 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.

⚠️ Tool is not RFC-Enabled ([#268](https://github.com/SAP/code-pal-for-abap/issues/268)).

## Features
⚠️ Severities set to `Notification` / `Priority 3` by default ([#368](https://github.com/SAP/code-pal-for-abap/issues/368)).

- Checks are ready-to-use;
- Checks can be executed via SUT, SCI, SCII (Code-Inspector) and via ATC (e.g. directly in SE80, Eclipse...);
- Automatic exclusion of code which shall not be checked (e.g. generated code);
- The scope is customizable (filter option on object creation date);
- Thresholds are customizable;
- Message severity is customizable (error, warning, or notification);
- Checking may be activated in productive-code and/or test-code (customizable);
- Findings can be suppressed via Code-Inspector Pragmas;
- Usage of a "Profile Management Tool" (Optional).

The Profile Management Tool, which is an alternative of working with SCI based variant(s), offers among others:
- An user friendly UI;
- A user-based or group-based execution of Checks;
- Creation, assignment and unassignment of Profiles (unassigning a profile will only delete it if no checks are registered to this profile);
- Import/Export a profile among systems (download/upload function – UI button or API Post Service);
- Single-Click registration of all code pal checks at once to a profile (UI button);
- Multiple execution of several profiles at the same time (the sharpest/strongest and time valid configuration/threshold will be taken);
- Delegation principle to facilitate team work (all delegates, for instance: team members, can work with the same profile);

:warning: The checks are not RFC-Enabled due to local dependencies.

## List of Checks
## Set of Checks

- [Check Documentation](docs/check_documentation.md)

Expand All @@ -56,11 +42,14 @@ The Profile Management Tool, which is an alternative of working with SCI based v
- **[Execute](pages/how-to-execute.md)**
- **[Contribute](pages/how-to-contribute.md)**

## Further Reading
## Recommended Readings

- [ABAP Styleguides on Clean Code](https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md)
- [Writing Testable Code for ABAP](https://open.sap.com/courses/wtc1/items/2gzG0sRlN1yjkTUREB02L9)
- [ABAP Development for S/4HANA](https://open.sap.com/courses/a4h1)
- [Clean ABAP](https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md)
- [ABAP 7.40 Quick Reference](https://blogs.sap.com/2015/10/25/abap-740-quick-reference/)
- [ABAP Built-in Functions](https://blogs.sap.com/2015/11/30/reminder-abap-built-in-functions/)
- [ABAP - Release-Specific Changes](https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abennews.htm)

## Recommended Courses

- [Writing Testable Code for ABAP](https://open.sap.com/courses/wtc1/items/2gzG0sRlN1yjkTUREB02L9)
- [ABAP Development for S/4HANA](https://open.sap.com/courses/a4h1)
207 changes: 65 additions & 142 deletions abaplint.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,230 +12,153 @@
"url": "https://github.com/abaplint/deps",
"folder": "/deps1",
"files": "/src/**/*.*"
},
{
"url": "https://github.com/abapGit/abapGit",
"folder": "/deps2",
"files": "/src/**/*.*"
}
],
"syntax": {
"version": "v740sp08",
"errorNamespace": "^(Z|Y|LCL_|TY_|LIF_)",
"errorNamespace": "^(Y)",
"globalConstants": ["cntb_btype_button", "scan_struc_stmnt_type", "scan_stmnt_type", "scan_struc_type", "scan_token_type"],
"globalMacros": []
},
"rules": {
"7bit_ascii": true,
"abapdoc": false,
"allowed_object_naming": true,
"allowed_object_types": {
"exclude": [],
"severity": "Error",
"allowed": []
},
"allowed_object_types": false,
"ambiguous_statement": false,
"avoid_use": {
"exclude": [],
"severity": "Error",
"define": true,
"endselect": true,
"execSQL": true,
"kernelCall": true,
"communication": true,
"statics": true,
"systemCall": true,
"defaultKey": false,
"break": false,
"describeLines": false
},
"avoid_use": false,
"begin_end_names": true,
"begin_single_include": true,
"call_transaction_authority_check": true,
"chain_mainly_declarations": {
"exclude": [],
"severity": "Error",
"definitions": true,
"write": true,
"move": true,
"refresh": true,
"unassign": true,
"clear": true,
"hide": true,
"free": true,
"include": true,
"check": true
},
"call_transaction_authority_check": false,
"chain_mainly_declarations": true,
"check_abstract": true,
"check_comments": false,
"check_ddic": true,
"check_ddic": false,
"check_include": true,
"check_no_handler_pragma": true,
"check_subrc": false,
"check_syntax": true,
"check_text_elements": false,
"check_transformation_exists": true,
"check_transformation_exists": false,
"class_attribute_names": false,
"cloud_types": true,
"colon_missing_space": true,
"commented_code": false,
"commented_code": true,
"constructor_visibility_public": true,
"contains_tab": false,
"cyclomatic_complexity": {
"exclude": [],
"severity": "Error",
"max": 20
},
"definitions_top": false,
"cyclomatic_complexity": true,
"dangerous_statement": true,
"db_operation_in_loop": false,
"definitions_top": true,
"description_empty": true,
"double_space": false,
"double_space": {
"startParen": false
},
"downport": true,
"empty_line_in_statement": false,
"empty_statement": true,
"empty_structure": false,
"empty_structure": true,
"exit_or_check": false,
"exporting": false,
"forbidden_identifier": {
"exclude": [],
"severity": "Error",
"check": []
},
"forbidden_pseudo_and_pragma": {
"exclude": [],
"severity": "Error",
"pseudo": [],
"pragmas": [],
"ignoreGlobalClassDefinition": false,
"ignoreGlobalInterface": false
},
"forbidden_void_type": {
"exclude": [],
"severity": "Error",
"check": []
},
"exporting": true,
"forbidden_identifier": false,
"forbidden_pseudo_and_pragma": false,
"forbidden_void_type": false,
"form_tables_obsolete": true,
"fully_type_constants": {
"exclude": [],
"severity": "Error",
"checkData": true
},
"fully_type_constants": false,
"function_module_recommendations": true,
"functional_writing": {
"exclude": [],
"severity": "Error",
"ignoreExceptions": true
},
"functional_writing": true,
"global_class": true,
"identical_conditions": true,
"identical_contents": true,
"identical_form_names": true,
"identical_descriptions": false,
"if_in_if": true,
"implement_methods": true,
"in_statement_indentation": false,
"indentation": false,
"inline_data_old_versions": true,
"keep_single_parameter_on_one_line": false,
"keyword_case": false,
"line_break_multiple_parameters": false,
"intf_referencing_clas": {
"allow": ["cl_ci_scan"]
},
"keep_single_parameter_on_one_line": true,
"line_break_multiple_parameters": true,
"line_break_style": true,
"line_length": false,
"line_only_punc": false,
"local_class_naming": false,
"local_testclass_location": true,
"local_variable_names": false,
"main_file_contents": true,
"many_parenthesis": false,
"many_parenthesis": true,
"max_one_method_parameter_per_line": true,
"method_implemented_twice": true,
"max_one_statement": true,
"message_exists": true,
"method_length": false,
"method_overwrites_builtin": false,
"method_overwrites_builtin": true,
"method_parameter_names": false,
"mix_returning": false,
"mix_returning": true,
"modify_only_own_db_tables": false,
"msag_consistency": true,
"nesting": false,
"nesting": true,
"names_no_dash": true,
"newline_between_methods": {
"exclude": [],
"severity": "Error",
"count": 3,
"logic": "less"
},
"newline_between_methods": true,
"no_public_attributes": false,
"no_yoda_conditions": false,
"object_naming": false,
"obsolete_statement": {
"exclude": [],
"severity": "Error",
"refresh": true,
"compute": true,
"add": false,
"subtract": false,
"multiply": true,
"move": true,
"divide": true,
"requested": true,
"occurs": true,
"setExtended": true,
"withHeaderLine": true,
"fieldSymbolStructure": true,
"typePools": true,
"load": true
},
"omit_parameter_name": false,
"obsolete_statement": true,
"omit_parameter_name": true,
"omit_receiving": true,
"parser_702_chaining": false,
"parser_error": true,
"parser_missing_space": true,
"prefer_inline": false,
"prefer_is_not": false,
"prefer_is_not": true,
"prefer_raise_exception_new": true,
"prefer_returning_to_exporting": true,
"prefer_xsdbool": true,
"preferred_compare_operator": false,
"prefix_is_current_class": false,
"preferred_compare_operator": true,
"prefix_is_current_class": true,
"reduce_string_templates": true,
"release_idoc": true,
"remove_descriptions": false,
"rfc_error_handling": false,
"selection_screen_naming": {
"exclude": [],
"severity": "Error",
"patternKind": "required",
"ignoreNames": [],
"ignorePatterns": [],
"parameter": "^P_.+$",
"selectOption": "^S_.+$"
},
"sequential_blank": false,
"short_case": {
"exclude": [],
"severity": "Error",
"length": 1,
"allow": []
"rfc_error_handling": true,
"select_add_order_by": false,
"select_performance": {
"severity": "Warning"
},
"selection_screen_naming": false,
"sequential_blank": true,
"short_case": true,
"sicf_consistency": true,
"space_before_colon": true,
"space_before_dot": {
"exclude": [],
"severity": "Error",
"ignoreGlobalDefinition": true,
"ignoreExceptions": true
"space_before_dot": true,
"sql_escape_host_variables": {
"severity": "Warning"
},
"sql_escape_host_variables": false,
"start_at_tab": false,
"start_at_tab": true,
"superclass_final": true,
"sy_modification": true,
"tabl_enhancement_category": true,
"try_without_catch": true,
"type_form_parameters": true,
"types_naming": false,
"uncaught_exception": false,
"unknown_types": true,
"unreachable_code": true,
"unused_methods": false,
"unsecure_fae": false,
"unused_methods": true,
"unused_types": true,
"unused_variables": false,
"unused_variables": {
"severity": "Warning"
},
"use_bool_expression": true,
"use_line_exists": false,
"use_class_based_exceptions": true,
"use_line_exists": true,
"use_new": true,
"when_others_last": true,
"whitespace_end": true,
"xml_consistency": true
"xml_consistency": true,
"keyword_case": false
}
}
Loading

0 comments on commit e45ffb4

Please sign in to comment.