|
1 | 1 | /**
|
2 |
| - * @name Python extraction errors |
3 |
| - * @description List all extraction errors for Python files in the source code directory. |
| 2 | + * @name Python extraction warnings |
| 3 | + * @description List all extraction warnings for Python files in the source code directory. |
4 | 4 | * @kind diagnostic
|
5 |
| - * @id py/diagnostics/extraction-errors |
| 5 | + * @id py/diagnostics/extraction-warnings |
6 | 6 | */
|
7 | 7 |
|
8 | 8 | import python
|
9 | 9 |
|
10 | 10 | /**
|
11 |
| - * Gets the SARIF severity for errors. |
| 11 | + * Gets the SARIF severity for warnings. |
12 | 12 | *
|
13 |
| - * See point 3.27.10 in https://docs.oasis-open.org/sarif/sarif/v2.0/sarif-v2.0.html for |
14 |
| - * what error means. |
| 13 | + * See https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html#_Toc10541338 |
15 | 14 | */
|
16 |
| -int getErrorSeverity() { result = 2 } |
| 15 | +int getWarningSeverity() { result = 1 } |
17 | 16 |
|
| 17 | +// The spec |
| 18 | +// https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html#_Toc10541338 |
| 19 | +// defines error and warning as: |
| 20 | +// |
| 21 | +// "error": A serious problem was found. The condition encountered by the tool resulted |
| 22 | +// in the analysis being halted or caused the results to be incorrect or incomplete. |
| 23 | +// |
| 24 | +// "warning": A problem that is not considered serious was found. The condition |
| 25 | +// encountered by the tool is such that it is uncertain whether a problem occurred, or |
| 26 | +// is such that the analysis might be incomplete but the results that were generated are |
| 27 | +// probably valid. |
| 28 | +// |
| 29 | +// so SyntaxErrors are reported at the warning level, since analysis might be incomplete |
| 30 | +// but the results that were generated are probably valid. |
18 | 31 | from SyntaxError error, File file
|
19 | 32 | where
|
20 | 33 | file = error.getFile() and
|
21 | 34 | exists(file.getRelativePath())
|
22 | 35 | select error, "Extraction failed in " + file + " with error " + error.getMessage(),
|
23 |
| - getErrorSeverity() |
| 36 | + getWarningSeverity() |
0 commit comments