Skip to content

Update AUTOSAR reference #297

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

Merged
merged 12 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ _Carnegie Mellon and CERT are registered trademarks of Carnegie Mellon Universit
This repository contains CodeQL queries and libraries which support various Coding Standards for the [C++14](https://www.iso.org/standard/64029.html) programming language.

The following coding standards are supported:
- [AUTOSAR - Guidelines for the use of C++14 language in critical and safety-related systems Release 20-11](https://www.autosar.org/fileadmin/standards/adaptive/20-11/AUTOSAR_RS_CPP14Guidelines.pdf)
- [MISRA C++:2008](https://www.misra.org.uk) (support limited to the rules specified in AUTOSAR 20-11).
- [AUTOSAR - Guidelines for the use of C++14 language in critical and safety-related systems (Releases R22-11, R20-11, R19-11 and R19-03)](https://www.autosar.org/fileadmin/standards/R22-11/AP/AUTOSAR_RS_CPP14Guidelines.pdf).
- [MISRA C++:2008](https://www.misra.org.uk) (support limited to the rules specified in AUTOSAR).
- [SEI CERT C++ Coding Standard: Rules for Developing Safe, Reliable, and Secure Systems (2016 Edition)](https://resources.sei.cmu.edu/library/asset-view.cfm?assetID=494932)

In addition, the following Coding Standards for the C programming language are under development:
Expand Down
2 changes: 1 addition & 1 deletion cpp/autosar/src/codeql-suites/autosar-advisory.qls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- description: AUTOSAR C++14 Guidelines 20-11 (Advisory)
- description: AUTOSAR C++14 Guidelines R22-11, R21-11, R20-11, R19-11 and R19-03 (Advisory)
- qlpack: codeql/autosar-cpp-coding-standards
- include:
kind:
Expand Down
2 changes: 1 addition & 1 deletion cpp/autosar/src/codeql-suites/autosar-audit.qls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- description: AUTOSAR C++14 Guidelines 20-11 (Audit)
- description: AUTOSAR C++14 Guidelines R22-11, R21-11, R20-11, R19-11 and R19-03 (Audit)
- qlpack: codeql/autosar-cpp-coding-standards
- include:
kind:
Expand Down
2 changes: 1 addition & 1 deletion cpp/autosar/src/codeql-suites/autosar-default.qls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- description: AUTOSAR C++14 Guidelines 20-11 (Default)
- description: AUTOSAR C++14 Guidelines R22-11, R21-11, R20-11, R19-11 and R19-03 (Default)
- qlpack: codeql/autosar-cpp-coding-standards
- include:
kind:
Expand Down
2 changes: 1 addition & 1 deletion cpp/autosar/src/codeql-suites/autosar-required.qls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- description: AUTOSAR C++14 Guidelines 20-11 (Required)
- description: AUTOSAR C++14 Guidelines R22-11, R21-11, R20-11, R19-11 and R19-03 (Required)
- qlpack: codeql/autosar-cpp-coding-standards
- include:
kind:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- description: AUTOSAR C++14 Guidelines 20-11 (Single Translation Unit)
- description: AUTOSAR C++14 Guidelines R22-11, R21-11, R20-11, R19-11 and R19-03 (Single Translation Unit)
- qlpack: codeql/autosar-cpp-coding-standards
- include:
kind:
Expand Down
2 changes: 1 addition & 1 deletion cpp/autosar/src/qlpack.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: codeql/autosar-cpp-coding-standards
version: 2.18.0-dev
description: AUTOSAR C++14 Guidelines 20-11
description: AUTOSAR C++14 Guidelines R22-11, R21-11, R20-11, R19-11 and R19-03
suites: codeql-suites
license: MIT
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion docs/development_handbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ A _coding standard_ is a set of rules or guidelines which restrict or prohibit t

| Standard | Version | Total rules | Total supportable rules | Status | Notes |
| -------------------------------------------------------------------------------------------------------------------- | ------- | ----------- | ----------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AUTOSAR C++](https://www.autosar.org/fileadmin/standards/adaptive/20-11/AUTOSAR_RS_CPP14Guidelines.pdf) | 20-11 | 397 | 375 | Implemented |
| [AUTOSAR C++](https://www.autosar.org/fileadmin/standards/R22-11/AP/AUTOSAR_RS_CPP14Guidelines.pdf) | R22-11, R21-11, R20-11, R19-11, R19-03 | 397 | 375 | Implemented |
| [CERT-C++](https://resources.sei.cmu.edu/downloads/secure-coding/assets/sei-cert-cpp-coding-standard-2016-v01.pdf) | 2016 | 83 | 83 | Implemented | AUTOSAR includes a sub-set of rules take from MISRA C++ 2008, which can be purchased for a small fee from [the MISRA website](https://misra.org.uk/shop). |
| [CERT-C](https://resources.sei.cmu.edu/downloads/secure-coding/assets/sei-cert-c-coding-standard-2016-v01.pdf) | 2016 | 120 | 99 | In development | The implementation excludes rules not part of 2016, but that are added to the [CERT-C wiki](https://wiki.sei.cmu.edu/confluence/display/c/) |
| [MISRA C](https://www.misra.org.uk/product/misra-c2012-third-edition-first-revision/ ) | 2012 | 172 | 172 | In development | This includes the [MISRA C:2012 Amendment 2](https://www.misra.org.uk/app/uploads/2021/06/MISRA-C-2012-AMD2.pdf) |
Expand Down
5 changes: 4 additions & 1 deletion docs/user_manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
| 0.12.0 | 2022-10-21 | Luke Cartey | Updated version to 2.10.0 |
| 0.13.0 | 2022-11-03 | Remco Vermeulen | Add missing deviation analysis report tables to section 'Producing an analysis report'. |
| 0.14.0 | 2022-11-03 | Remco Vermeulen | Add guideline recategorization plan. |
| 0.15.0 | 2023-05-24 | Mauro Baluda | Clarify AUTOSAR C++ supported versions. |

## Release information

Expand Down Expand Up @@ -47,7 +48,7 @@ The _CodeQL Coding Standards_ product is a set of CodeQL queries for identifying

| Standard | Version | Total rules | Total supportable rules | Status |
| -------------------------------------------------------------------------------------------------------------------- | ------- | ----------- | ----------------------- | ----------------- |
| [AUTOSAR C++](https://www.autosar.org/fileadmin/standards/adaptive/20-11/AUTOSAR_RS_CPP14Guidelines.pdf) | 20-11 | 397 | 375 | Implemented |
| [AUTOSAR C++](https://www.autosar.org/fileadmin/standards/R22-11/AP/AUTOSAR_RS_CPP14Guidelines.pdf) | [^1] R22-11, R21-11, R20-11, R19-11, R19-03 | 397 | 375 | Implemented |
| [CERT-C++](https://resources.sei.cmu.edu/downloads/secure-coding/assets/sei-cert-cpp-coding-standard-2016-v01.pdf) | 2016 | 83 | 83 | Implemented |
| [CERT C](https://resources.sei.cmu.edu/downloads/secure-coding/assets/sei-cert-c-coding-standard-2016-v01.pdf) | 2016 | 99 | 99 | Under development |
| [MISRA C](https://www.misra.org.uk/product/misra-c2012-third-edition-first-revision/) | 2012 | 172 | 169 | Under development |
Expand All @@ -62,6 +63,8 @@ Each supported rule is implemented as one or more CodeQL queries, with each quer

The datasheet _"CodeQL Coding Standards: supported rules"_, provided with each release, lists which rules are supported for that particular release, and the _scope of analysis_ for that rule.

[^1]: AUTOSAR C++ versions R22-11, R21-11, R20-11, R19-11 and R19-03 are all identical as indicated in the document change history.

## Supported environment

This section describes the supported environment for the product.
Expand Down
4 changes: 2 additions & 2 deletions scripts/generate_rules/generate_package_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"AUTOSAR" : {
"standard_title" : "AUTOSAR: Guidelines for the use of the C++14 language in critical and safety-related systems",
"standard_url" : "https://www.autosar.org/fileadmin/standards/adaptive/20-11/AUTOSAR_RS_CPP14Guidelines.pdf"
"standard_url" : "https://www.autosar.org/fileadmin/standards/R22-11/AP/AUTOSAR_RS_CPP14Guidelines.pdf"
},
"CERT-C" : {
"standard_title" : "CERT-C",
Expand Down Expand Up @@ -370,7 +370,7 @@ def generate_package_files(package_name: str) -> None:
query["standard_title"] = "AUTOSAR: Guidelines for the use of the C++14 language in critical and safety-related systems"
query[
"standard_url"
] = "https://www.autosar.org/fileadmin/standards/adaptive/20-11/AUTOSAR_RS_CPP14Guidelines.pdf"
] = "https://www.autosar.org/fileadmin/standards/R22-11/AP/AUTOSAR_RS_CPP14Guidelines.pdf"

help_dir = None
if standard_name in external_help_file_standards:
Expand Down
2 changes: 1 addition & 1 deletion scripts/reports/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def generate_guideline_compliance_summary(output_directory, results_summary):
print(
"**Result**: " + ("Not compliant" if total_guidelines_violated > 0 else "Compliant"))
standard_pretty_name = {
"cert": "CERT C++ 2016", "autosar": "AUTOSAR C++ 20-11"}
"cert": "CERT C++ 2016", "autosar": "AUTOSAR C++ R22-11, R21-11, R20-11, R19-11 and R19-03"}
print("**Coding Standards applied**: " + ", ".join([standard_pretty_name[standard_short_name]
for standard_short_name in results_summary.guideline_violation_count.keys()]))

Expand Down