Skip to content

Commit d8b3fac

Browse files
committed
Statements: Improve metadata.
1 parent 250e06f commit d8b3fac

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

c/misra/src/rules/RULE-16-4/EverySwitchShallHaveDefaultLabel.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/**
22
* @id c/misra/every-switch-shall-have-default-label
33
* @name RULE-16-4: Every switch statement shall have a default label
4-
* @description The requirement for a default label is defensive programming.
4+
* @description A default label that has no statements or a comment explaining why this is correct
5+
* indicates a missing implementation that may result in unexpected behavior when the
6+
* default case is executed.
57
* @kind problem
68
* @precision very-high
7-
* @problem.severity error
9+
* @problem.severity warning
810
* @tags external/misra/id/rule-16-4
911
* maintainability
1012
* readability

c/misra/src/rules/RULE-16-5/DefaultNotFirstOrLastOfSwitch.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @id c/misra/default-not-first-or-last-of-switch
33
* @name RULE-16-5: A default label shall appear as either the first or the last switch label or a switch statement
4-
* @description Locating the default label is easy when it the first of last label.
4+
* @description Locating the default label is easier when it is the first or last label.
55
* @kind problem
66
* @precision very-high
77
* @problem.severity recommendation

rule_packages/c/Statements1.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
},
4848
"queries": [
4949
{
50-
"description": "The requirement for a default label is defensive programming.",
50+
"description": "A default label that has no statements or a comment explaining why this is correct indicates a missing implementation that may result in unexpected behavior when the default case is executed.",
5151
"kind": "problem",
5252
"name": "Every switch statement shall have a default label",
5353
"precision": "very-high",
54-
"severity": "error",
54+
"severity": "warning",
5555
"short_name": "EverySwitchShallHaveDefaultLabel",
5656
"tags": [
5757
"maintainability",
@@ -67,7 +67,7 @@
6767
},
6868
"queries": [
6969
{
70-
"description": "Locating the default label is easy when it the first of last label.",
70+
"description": "Locating the default label is easier when it is the first or last label.",
7171
"kind": "problem",
7272
"name": "A default label shall appear as either the first or the last switch label or a switch statement",
7373
"precision": "very-high",
@@ -79,4 +79,4 @@
7979
"title": "A default label shall appear as either the first or the last switch label of a switch statement"
8080
}
8181
}
82-
}
82+
}

0 commit comments

Comments
 (0)