-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqodana.sarif.json
17462 lines (17462 loc) · 800 KB
/
qodana.sarif.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "https://raw.githubusercontent.com/schemastore/schemastore/master/src/schemas/json/sarif-2.1.0-rtm.5.json",
"version": "2.1.0",
"runs": [
{
"tool": {
"driver": {
"name": "DS",
"fullName": "Qodana",
"version": "233.14475.37",
"rules": [],
"taxa": [
{
"id": "Python",
"name": "Python"
},
{
"id": "EditorConfig",
"name": "EditorConfig"
},
{
"id": "Kubernetes",
"name": "Kubernetes"
},
{
"id": "XPath",
"name": "XPath"
},
{
"id": "Theme inspection",
"name": "Theme inspection"
},
{
"id": "Makefile",
"name": "Makefile"
},
{
"id": "JSON and JSON5",
"name": "JSON and JSON5"
},
{
"id": "Perl5",
"name": "Perl5"
},
{
"id": "MongoJS",
"name": "MongoJS"
},
{
"id": "Terraform configs",
"name": "Terraform configs"
},
{
"id": "MySQL",
"name": "MySQL"
},
{
"id": "Properties files",
"name": "Properties files"
},
{
"id": "AsciiDoc",
"name": "AsciiDoc"
},
{
"id": "AsciiDoc/General",
"name": "General",
"relationships": [
{
"target": {
"id": "AsciiDoc",
"index": 12,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "Markdown",
"name": "Markdown"
},
{
"id": "HTML",
"name": "HTML"
},
{
"id": "CSV",
"name": "CSV"
},
{
"id": "GraphQL",
"name": "GraphQL"
},
{
"id": "GraphQL/Schema",
"name": "Schema",
"relationships": [
{
"target": {
"id": "GraphQL",
"index": 17,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "Directive isn't supported",
"name": "Directive isn't supported"
},
{
"id": "DotEnv",
"name": "DotEnv"
},
{
"id": "General",
"name": "General"
},
{
"id": "R",
"name": "R"
},
{
"id": "Docker-compose",
"name": "Docker-compose"
},
{
"id": "CSS",
"name": "CSS"
},
{
"id": "CSS/Invalid elements",
"name": "Invalid elements",
"relationships": [
{
"target": {
"id": "CSS",
"index": 24,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "SQL",
"name": "SQL"
},
{
"id": "Dockerfile",
"name": "Dockerfile"
},
{
"id": "YAML",
"name": "YAML"
},
{
"id": "Python Annotations",
"name": "Python Annotations"
},
{
"id": "Ignore",
"name": "Ignore"
},
{
"id": "HTTP Client",
"name": "HTTP Client"
},
{
"id": "XML",
"name": "XML"
},
{
"id": "OpenAPI specifications",
"name": "OpenAPI specifications"
},
{
"id": "Terraform configs/Duplicates",
"name": "Duplicates",
"relationships": [
{
"target": {
"id": "Terraform configs",
"index": 9,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "Bitbucket Pipelines",
"name": "Bitbucket Pipelines"
},
{
"id": "CSS/Code style issues",
"name": "Code style issues",
"relationships": [
{
"target": {
"id": "CSS",
"index": 24,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "dbt",
"name": "dbt"
},
{
"id": "RegExp",
"name": "RegExp"
},
{
"id": "Markdown-based TMS",
"name": "Markdown-based TMS"
},
{
"id": "Ini files",
"name": "Ini files"
},
{
"id": "XSLT",
"name": "XSLT"
},
{
"id": "RELAX NG",
"name": "RELAX NG"
},
{
"id": "CSS/Probable bugs",
"name": "Probable bugs",
"relationships": [
{
"target": {
"id": "CSS",
"index": 24,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "GraphQL/General",
"name": "General",
"relationships": [
{
"target": {
"id": "GraphQL",
"index": 17,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "Proofreading",
"name": "Proofreading"
},
{
"id": "Unused attribute",
"name": "Unused attribute"
},
{
"id": "TMS",
"name": "TMS"
},
{
"id": "TMS/Unresolved TMS Link",
"name": "Unresolved TMS Link",
"relationships": [
{
"target": {
"id": "TMS",
"index": 47,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "Jupyter",
"name": "Jupyter"
},
{
"id": "PostgreSQL",
"name": "PostgreSQL"
},
{
"id": "Avro IDL",
"name": "Avro IDL"
},
{
"id": "Perl5 POD",
"name": "Perl5 POD"
},
{
"id": "SQL server",
"name": "SQL server"
},
{
"id": "ReST",
"name": "ReST"
},
{
"id": "Qodana",
"name": "Qodana"
},
{
"id": "Security",
"name": "Security"
},
{
"id": "Protocol Buffers",
"name": "Protocol Buffers"
},
{
"id": "Git Graph inspection",
"name": "Git Graph inspection"
},
{
"id": "PowerShell",
"name": "PowerShell"
},
{
"id": "Oracle",
"name": "Oracle"
},
{
"id": "Internationalization",
"name": "Internationalization"
},
{
"id": "Generic won't be rendered",
"name": "Generic won't be rendered"
},
{
"id": "File Watchers",
"name": "File Watchers"
},
{
"id": "TOML",
"name": "TOML"
},
{
"id": "Version control",
"name": "Version control"
}
],
"language": "en-US",
"contents": [
"localizedData",
"nonLocalizedData"
],
"isComprehensive": false
},
"extensions": [
{
"name": "PythonCore",
"version": "233.14475.37",
"rules": [
{
"id": "PyPandasSeriesToListInspection",
"shortDescription": {
"text": "Method Series.to_list() is recommended"
},
"fullDescription": {
"text": "Reports redundant 'list' in 'list(Series.values)' statement for pandas and polars libraries. Such 'Series' values extraction can be replaced with the 'to_list()' function call. Example: list(df['column'].values)\n When the quick-fix is applied, the code changes to: df['column'].to_list()",
"markdown": "Reports redundant `list` in `list(Series.values)` statement for pandas and polars libraries.\nSuch `Series` values extraction can be replaced with the `to_list()` function call.\n\n**Example:**\n\n```\nlist(df['column'].values)\n```\n\nWhen the quick-fix is applied, the code changes to:\n\n```\ndf['column'].to_list()\n```"
},
"defaultConfiguration": {
"enabled": true,
"level": "warning",
"parameters": {
"suppressToolId": "PyPackages",
"ideaSeverity": "WARNING",
"qodanaSeverity": "High"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PySetFunctionToLiteralInspection",
"shortDescription": {
"text": "Function call can be replaced with set literal"
},
"fullDescription": {
"text": "Reports calls to the 'set' function that can be replaced with the 'set' literal. Example: 'def do_mult(a, b):\n c = a * b\n return set([c, a, b])' When the quick-fix is applied, the code changes to: 'def do_mult(a, b):\n c = a * b\n return {c, a, b}'",
"markdown": "Reports calls to the `set` function that can be replaced with\nthe `set` literal.\n\n**Example:**\n\n\n def do_mult(a, b):\n c = a * b\n return set([c, a, b])\n\nWhen the quick-fix is applied, the code changes to:\n\n\n def do_mult(a, b):\n c = a * b\n return {c, a, b}\n"
},
"defaultConfiguration": {
"enabled": true,
"level": "warning",
"parameters": {
"suppressToolId": "PySetFunctionToLiteral",
"ideaSeverity": "WARNING",
"qodanaSeverity": "High"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyOverridesInspection",
"shortDescription": {
"text": "Invalid usages of @override decorator"
},
"fullDescription": {
"text": "Reports when a method decorated with @override doesn't have a matching method in its ancestor classes Example: 'from typing import override\n\nclass Parent:\n def foo(self) -> int:\n return 1\n\n def bar(self, x: str) -> str:\n return x\n\nclass Child(Parent):\n @override\n def foo(self) -> int:\n return 2\n\n @override # Missing super method for override function\n def baz(self) -> int:\n return 1'",
"markdown": "Reports when a method decorated with @override doesn't have a matching method in its ancestor classes\n\n**Example:**\n\n\n from typing import override\n\n class Parent:\n def foo(self) -> int:\n return 1\n\n def bar(self, x: str) -> str:\n return x\n\n class Child(Parent):\n @override\n def foo(self) -> int:\n return 2\n\n @override # Missing super method for override function\n def baz(self) -> int:\n return 1\n"
},
"defaultConfiguration": {
"enabled": true,
"level": "warning",
"parameters": {
"suppressToolId": "PyOverrides",
"ideaSeverity": "WARNING",
"qodanaSeverity": "High"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyInitNewSignatureInspection",
"shortDescription": {
"text": "Incompatible signatures of __new__ and __init__"
},
"fullDescription": {
"text": "Reports incompatible signatures of the '__new__' and '__init__' methods. Example: 'class MyClass(object):\n def __new__(cls, arg1):\n return super().__new__(cls)\n\n def __init__(self):\n pass' If the '__new__' and '__init__' have different arguments, then the 'MyClass' cannot be instantiated. As a fix, the IDE offers to apply the Change Signature refactoring.",
"markdown": "Reports incompatible signatures of the `__new__` and `__init__` methods.\n\n**Example:**\n\n\n class MyClass(object):\n def __new__(cls, arg1):\n return super().__new__(cls)\n\n def __init__(self):\n pass\n\nIf the `__new__` and `__init__` have different arguments, then the `MyClass`\ncannot be instantiated.\n\nAs a fix, the IDE offers to apply the Change Signature refactoring."
},
"defaultConfiguration": {
"enabled": true,
"level": "warning",
"parameters": {
"suppressToolId": "PyInitNewSignature",
"ideaSeverity": "WARNING",
"qodanaSeverity": "High"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyMissingConstructorInspection",
"shortDescription": {
"text": "Missed call to '__init__' of the super class"
},
"fullDescription": {
"text": "Reports cases when a call to the 'super' constructor in a class is missed. Example: 'class Fruit:\n def __init__(self):\n pass\n\n\nclass Pear(Fruit):\n def __init__(self):\n pass' The 'Pear' class should have a 'super' call in the '__init__' method. When the quick-fix is applied, the code changes to: 'class Fruit:\n def __init__(self):\n pass\n\n\nclass Pear(Fruit):\n def __init__(self):\n super().__init__()'",
"markdown": "Reports cases when a call to the `super` constructor in a class is missed.\n\n**Example:**\n\n\n class Fruit:\n def __init__(self):\n pass\n\n\n class Pear(Fruit):\n def __init__(self):\n pass\n\nThe `Pear` class should have a `super` call in the `__init__`\nmethod.\n\nWhen the quick-fix is applied, the code changes to:\n\n\n class Fruit:\n def __init__(self):\n pass\n\n\n class Pear(Fruit):\n def __init__(self):\n super().__init__()\n"
},
"defaultConfiguration": {
"enabled": true,
"level": "warning",
"parameters": {
"suppressToolId": "PyMissingConstructor",
"ideaSeverity": "WARNING",
"qodanaSeverity": "High"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PySimplifyBooleanCheckInspection",
"shortDescription": {
"text": "Redundant boolean variable check"
},
"fullDescription": {
"text": "Reports equality comparison with a boolean literal. Example: 'def func(s):\n if s.isdigit() == True:\n return int(s)' With the quick-fix applied, the code fragment will be simplified to: 'def func(s):\n if s.isdigit():\n return int(s)'",
"markdown": "Reports equality comparison with a boolean literal.\n\n**Example:**\n\n\n def func(s):\n if s.isdigit() == True:\n return int(s)\n\nWith the quick-fix applied, the code fragment will be simplified to:\n\n\n def func(s):\n if s.isdigit():\n return int(s)\n"
},
"defaultConfiguration": {
"enabled": true,
"level": "note",
"parameters": {
"suppressToolId": "PySimplifyBooleanCheck",
"ideaSeverity": "WEAK WARNING",
"qodanaSeverity": "Moderate"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyCallingNonCallableInspection",
"shortDescription": {
"text": "Attempt to call a non-callable object"
},
"fullDescription": {
"text": "Reports a problem when you are trying to call objects that are not callable, like, for example, properties: Example: 'class Record:\n @property\n def as_json(self):\n\njson = Record().as_json()'",
"markdown": "Reports a problem when you are trying\nto call objects that are not callable, like, for example, properties:\n\n**Example:**\n\n\n class Record:\n @property\n def as_json(self):\n\n json = Record().as_json()\n"
},
"defaultConfiguration": {
"enabled": true,
"level": "warning",
"parameters": {
"suppressToolId": "PyCallingNonCallable",
"ideaSeverity": "WARNING",
"qodanaSeverity": "High"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyUnreachableCodeInspection",
"shortDescription": {
"text": "Unreachable code"
},
"fullDescription": {
"text": "Reports code fragments that cannot be normally reached. Example: 'if True:\n print('Yes')\nelse:\n print('No')' As a fix, you might want to check and modify the algorithm to ensure it implements the expected logic.",
"markdown": "Reports code fragments that cannot be normally reached.\n\n**Example:**\n\n\n if True:\n print('Yes')\n else:\n print('No')\n\nAs a fix, you might want to check and modify the algorithm to ensure it implements\nthe expected logic."
},
"defaultConfiguration": {
"enabled": true,
"level": "warning",
"parameters": {
"suppressToolId": "PyUnreachableCode",
"ideaSeverity": "WARNING",
"qodanaSeverity": "High"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyChainedComparisonsInspection",
"shortDescription": {
"text": "Too complex chained comparisons"
},
"fullDescription": {
"text": "Reports chained comparisons that can be simplified. Example: 'def do_comparison(x):\n xmin = 10\n xmax = 100\n if x >= xmin and x <= xmax:\n pass' The IDE offers to simplify 'if x >= xmin and x <= xmax'. When the quick-fix is applied, the code changes to: 'def do_comparison(x):\n xmin = 10\n xmax = 100\n if xmin <= x <= xmax:\n pass'",
"markdown": "Reports chained comparisons that can be simplified.\n\n**Example:**\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if x >= xmin and x <= xmax:\n pass\n\nThe IDE offers to simplify `if x >= xmin and x <= xmax`.\nWhen the quick-fix is applied, the code changes to:\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if xmin <= x <= xmax:\n pass\n"
},
"defaultConfiguration": {
"enabled": true,
"level": "note",
"parameters": {
"suppressToolId": "PyChainedComparisons",
"ideaSeverity": "WEAK WARNING",
"qodanaSeverity": "Moderate"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyCompatibilityInspection",
"shortDescription": {
"text": "Code is incompatible with specific Python versions"
},
"fullDescription": {
"text": "Reports incompatibility with the specified versions of Python. Enable this inspection if you need your code to be compatible with a range of Python versions, for example, if you are building a library. To define the range of the inspected Python versions, select the corresponding checkboxes in the Options section. For more information about the Python versions supported by the IDE, see the web help.",
"markdown": "Reports incompatibility with the specified versions of Python.\nEnable this inspection if you need your code to be compatible with a range of Python versions, for example,\nif you are building a library.\n\nTo define the range of the inspected Python versions, select the corresponding checkboxes in the **Options**\nsection.\n\nFor more information about the Python versions supported by the IDE, see the\n[web help](https://www.jetbrains.com/help/pycharm/python.html#support)."
},
"defaultConfiguration": {
"enabled": false,
"level": "warning",
"parameters": {
"suppressToolId": "PyCompatibility",
"ideaSeverity": "WARNING",
"qodanaSeverity": "High"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyGlobalUndefinedInspection",
"shortDescription": {
"text": "Global variable is not defined at the module level"
},
"fullDescription": {
"text": "Reports problems when a variable defined through the 'global' statement is not defined in the module scope. Example: 'def foo():\n global bar\n print(bar)\n\nfoo()' As a fix, you can move the global variable declaration: 'global bar\n\n\ndef foo():\n print(bar)'",
"markdown": "Reports problems when a variable defined through the `global`\nstatement is not defined in the module scope.\n\n**Example:**\n\n\n def foo():\n global bar\n print(bar)\n\n foo()\n\nAs a fix, you can move the global variable declaration:\n\n\n global bar\n\n\n def foo():\n print(bar)\n"
},
"defaultConfiguration": {
"enabled": true,
"level": "note",
"parameters": {
"suppressToolId": "PyGlobalUndefined",
"ideaSeverity": "WEAK WARNING",
"qodanaSeverity": "Moderate"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyProtocolInspection",
"shortDescription": {
"text": "Invalid protocol definitions and usages"
},
"fullDescription": {
"text": "Reports invalid definitions and usages of protocols introduced in PEP-544. Example: 'from typing import Protocol\n\n\nclass MyProtocol(Protocol):\n def method(self, p: int) -> str:\n pass\n\n\nclass MyClass(MyProtocol):\n def method(self, p: str) -> int: # Type of 'method' is not compatible with 'MyProtocol'\n pass\n\n\nclass MyAnotherProtocol(MyClass, Protocol): # All bases of a protocol must be protocols\n pass'",
"markdown": "Reports invalid definitions and usages of protocols introduced in\n[PEP-544](https://www.python.org/dev/peps/pep-0544/).\n\n**Example:**\n\n\n from typing import Protocol\n\n\n class MyProtocol(Protocol):\n def method(self, p: int) -> str:\n pass\n\n\n class MyClass(MyProtocol):\n def method(self, p: str) -> int: # Type of 'method' is not compatible with 'MyProtocol'\n pass\n\n\n class MyAnotherProtocol(MyClass, Protocol): # All bases of a protocol must be protocols\n pass\n\n"
},
"defaultConfiguration": {
"enabled": true,
"level": "warning",
"parameters": {
"suppressToolId": "PyProtocol",
"ideaSeverity": "WARNING",
"qodanaSeverity": "High"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyTypeHintsInspection",
"shortDescription": {
"text": "Invalid type hints definitions and usages"
},
"fullDescription": {
"text": "Reports invalid usages of type hints. Example: 'from typing import TypeVar\n\nT0 = TypeVar('T1') # Argument of 'TypeVar' must be 'T0'\n\n\ndef b(p: int) -> int: # Type specified both in a comment and annotation\n # type: (int) -> int\n pass\n\n\ndef c(p1, p2): # Type signature has too many arguments\n # type: (int) -> int\n pass' Available quick-fixes offer various actions. You can rename, remove, or move problematic elements. You can also manually modify type declarations to ensure no warning is shown.",
"markdown": "Reports invalid usages of type hints.\n\n**Example:**\n\n\n from typing import TypeVar\n\n T0 = TypeVar('T1') # Argument of 'TypeVar' must be 'T0'\n\n\n def b(p: int) -> int: # Type specified both in a comment and annotation\n # type: (int) -> int\n pass\n\n\n def c(p1, p2): # Type signature has too many arguments\n # type: (int) -> int\n pass\n\nAvailable quick-fixes offer various actions. You can rename, remove, or move problematic elements. You can also manually modify type declarations to ensure no warning is shown."
},
"defaultConfiguration": {
"enabled": true,
"level": "warning",
"parameters": {
"suppressToolId": "PyTypeHints",
"ideaSeverity": "WARNING",
"qodanaSeverity": "High"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyMethodMayBeStaticInspection",
"shortDescription": {
"text": "Method is not declared static"
},
"fullDescription": {
"text": "Reports any methods that do not require a class instance creation and can be made static. Example: 'class MyClass(object):\n def my_method(self, x):\n print(x)' If a Make function from method quick-fix is applied, the code changes to: 'def my_method(x):\n print(x)\n\n\nclass MyClass(object):\n pass' If you select the Make method static quick-fix, the '@staticmethod' decorator is added: 'class MyClass(object):\n @staticmethod\n def my_method(x):\n print(x)'",
"markdown": "Reports any methods that do not require a class instance creation and can be\nmade static.\n\n**Example:**\n\n\n class MyClass(object):\n def my_method(self, x):\n print(x)\n\nIf a **Make function from method** quick-fix is applied, the code changes to:\n\n\n def my_method(x):\n print(x)\n\n\n class MyClass(object):\n pass\n\nIf you select the **Make method static** quick-fix, the `@staticmethod` decorator is added:\n\n\n class MyClass(object):\n @staticmethod\n def my_method(x):\n print(x)\n"
},
"defaultConfiguration": {
"enabled": true,
"level": "note",
"parameters": {
"suppressToolId": "PyMethodMayBeStatic",
"ideaSeverity": "WEAK WARNING",
"qodanaSeverity": "Moderate"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyDictCreationInspection",
"shortDescription": {
"text": "Dictionary creation can be rewritten by dictionary literal"
},
"fullDescription": {
"text": "Reports situations when you can rewrite dictionary creation by using a dictionary literal. This approach brings performance improvements. Example: 'dic = {}\ndic['var'] = 1' When the quick-fix is applied, the code changes to: 'dic = {'var': 1}'",
"markdown": "Reports situations when you can rewrite dictionary creation\nby using a dictionary literal.\n\nThis approach brings performance improvements.\n\n**Example:**\n\n\n dic = {}\n dic['var'] = 1\n\nWhen the quick-fix is applied, the code changes to:\n\n\n dic = {'var': 1}\n"
},
"defaultConfiguration": {
"enabled": true,
"level": "note",
"parameters": {
"suppressToolId": "PyDictCreation",
"ideaSeverity": "WEAK WARNING",
"qodanaSeverity": "Moderate"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyStringFormatInspection",
"shortDescription": {
"text": "Errors in string formatting operations"
},
"fullDescription": {
"text": "Reports errors in string formatting operations. Example 1: '\"Hello {1}\".format(\"people\")' Example 2: 'def bar():\n return 1\n\n\n\"%s %s\" % bar()' As a fix, you need to rewrite string formatting fragments to adhere to the formatting syntax.",
"markdown": "Reports errors in string formatting operations.\n\n**Example 1:**\n\n\n \"Hello {1}\".format(\"people\")\n\n**Example 2:**\n\n\n def bar():\n return 1\n\n\n \"%s %s\" % bar()\n\nAs a fix, you need to rewrite string formatting fragments to\nadhere to the [formatting syntax](https://docs.python.org/3/library/string.html#format-string-syntax)."
},
"defaultConfiguration": {
"enabled": true,
"level": "warning",
"parameters": {
"suppressToolId": "PyStringFormat",
"ideaSeverity": "WARNING",
"qodanaSeverity": "High"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyExceptionInheritInspection",
"shortDescription": {
"text": "Exceptions do not inherit from standard 'Exception' class"
},
"fullDescription": {
"text": "Reports cases when a custom exception class is raised but does not inherit from the builtin Exception class. Example: 'class A:\n pass\n\n\ndef me_exception():\n raise A()' The proposed quick-fix changes the code to: 'class A(Exception):\n pass\n\n\ndef me_exception():\n raise A()'",
"markdown": "Reports cases when a custom exception class is\nraised but does not inherit from the\n[builtin Exception class](https://docs.python.org/3/library/exceptions.html).\n\n**Example:**\n\n\n class A:\n pass\n\n\n def me_exception():\n raise A()\n\nThe proposed quick-fix changes the code to:\n\n\n class A(Exception):\n pass\n\n\n def me_exception():\n raise A()\n"
},
"defaultConfiguration": {
"enabled": true,
"level": "warning",
"parameters": {
"suppressToolId": "PyExceptionInherit",
"ideaSeverity": "WARNING",
"qodanaSeverity": "High"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PyAssignmentToLoopOrWithParameterInspection",
"shortDescription": {
"text": "Assignments to 'for' loop or 'with' statement parameter"
},
"fullDescription": {
"text": "Reports the cases when you rewrite a loop variable with an inner loop. Example: 'for i in range(5):\n for i in range(20, 25):\n print(\"Inner\", i)\n print(\"Outer\", i)' It also warns you if a variable declared in the 'with' statement is redeclared inside the statement body: 'with open(\"file\") as f:\n f.read()\n with open(\"file\") as f:'",
"markdown": "Reports the cases when you rewrite a loop variable with an inner loop.\n\n**Example:**\n\n\n for i in range(5):\n for i in range(20, 25):\n print(\"Inner\", i)\n print(\"Outer\", i)\n \nIt also warns you if a variable declared in the `with` statement is redeclared inside the statement body:\n\n\n with open(\"file\") as f:\n f.read()\n with open(\"file\") as f:\n \n"
},
"defaultConfiguration": {
"enabled": true,
"level": "note",
"parameters": {
"suppressToolId": "PyAssignmentToLoopOrWithParameter",
"ideaSeverity": "WEAK WARNING",
"qodanaSeverity": "Moderate"
}
},
"relationships": [
{
"target": {
"id": "Python",
"index": 0,
"toolComponent": {
"name": "DS"
}
},
"kinds": [
"superset"
]
}
]
},
{
"id": "PySuperArgumentsInspection",
"shortDescription": {
"text": "Wrong arguments to call super"
},