codeanalyzer-python 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- codeanalyzer/__main__.py +51 -13
- codeanalyzer/core.py +5 -12
- codeanalyzer/schema/__init__.py +6 -6
- codeanalyzer/schema/py_schema.py +103 -125
- codeanalyzer/semantic_analysis/codeql/__init__.py +2 -2
- codeanalyzer/semantic_analysis/codeql/codeql_analysis.py +2 -2
- codeanalyzer/semantic_analysis/codeql/codeql_loader.py +3 -14
- codeanalyzer/semantic_analysis/codeql/codeql_query_runner.py +2 -1
- codeanalyzer/syntactic_analysis/symbol_table_builder.py +157 -159
- codeanalyzer/utils/__init__.py +1 -2
- codeanalyzer/utils/logging.py +2 -1
- codeanalyzer/utils/progress_bar.py +5 -4
- {codeanalyzer_python-0.1.3.dist-info → codeanalyzer_python-0.1.4.dist-info}/METADATA +46 -38
- codeanalyzer_python-0.1.4.dist-info/RECORD +26 -0
- codeanalyzer_python-0.1.3.dist-info/RECORD +0 -26
- {codeanalyzer_python-0.1.3.dist-info → codeanalyzer_python-0.1.4.dist-info}/WHEEL +0 -0
- {codeanalyzer_python-0.1.3.dist-info → codeanalyzer_python-0.1.4.dist-info}/entry_points.txt +0 -0
- {codeanalyzer_python-0.1.3.dist-info → codeanalyzer_python-0.1.4.dist-info}/licenses/LICENSE +0 -0
- {codeanalyzer_python-0.1.3.dist-info → codeanalyzer_python-0.1.4.dist-info}/licenses/NOTICE +0 -0
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import ast
|
|
2
|
+
import tokenize
|
|
3
|
+
from ast import AST, ClassDef
|
|
1
4
|
from io import StringIO
|
|
2
5
|
from pathlib import Path
|
|
3
|
-
import tokenize
|
|
4
6
|
from typing import Dict, List, Optional
|
|
7
|
+
|
|
5
8
|
import astor
|
|
6
9
|
import jedi
|
|
7
|
-
from codeanalyzer.utils import logger
|
|
8
|
-
from jedi.api.project import Project
|
|
9
10
|
from jedi.api import Script
|
|
10
|
-
from
|
|
11
|
+
from jedi.api.project import Project
|
|
12
|
+
|
|
11
13
|
from codeanalyzer.schema.py_schema import (
|
|
12
14
|
PyCallable,
|
|
13
15
|
PyCallableParameter,
|
|
@@ -20,9 +22,7 @@ from codeanalyzer.schema.py_schema import (
|
|
|
20
22
|
PySymbol,
|
|
21
23
|
PyVariableDeclaration,
|
|
22
24
|
)
|
|
23
|
-
import
|
|
24
|
-
from ast import AST, ClassDef
|
|
25
|
-
|
|
25
|
+
from codeanalyzer.utils import logger
|
|
26
26
|
from codeanalyzer.utils.progress_bar import ProgressBar
|
|
27
27
|
|
|
28
28
|
|
|
@@ -98,13 +98,13 @@ class SymbolTableBuilder:
|
|
|
98
98
|
|
|
99
99
|
return (
|
|
100
100
|
PyModule.builder()
|
|
101
|
-
.
|
|
102
|
-
.
|
|
103
|
-
.
|
|
104
|
-
.
|
|
105
|
-
.
|
|
106
|
-
.
|
|
107
|
-
.
|
|
101
|
+
.file_path(str(py_file))
|
|
102
|
+
.module_name(py_file.stem)
|
|
103
|
+
.comments(self._pycomments(module, source))
|
|
104
|
+
.imports(self._imports(module))
|
|
105
|
+
.variables(self._module_variables(module, script))
|
|
106
|
+
.classes(classes)
|
|
107
|
+
.functions(functions)
|
|
108
108
|
.build()
|
|
109
109
|
)
|
|
110
110
|
|
|
@@ -126,13 +126,13 @@ class SymbolTableBuilder:
|
|
|
126
126
|
for alias in node.names:
|
|
127
127
|
imports.append(
|
|
128
128
|
PyImport.builder()
|
|
129
|
-
.
|
|
130
|
-
.
|
|
131
|
-
.
|
|
132
|
-
.
|
|
133
|
-
.
|
|
134
|
-
.
|
|
135
|
-
.
|
|
129
|
+
.module(alias.name) # for "import os", alias.name = "os"
|
|
130
|
+
.name(alias.asname or alias.name) # name in local scope
|
|
131
|
+
.alias(alias.name if alias.asname else None)
|
|
132
|
+
.start_line(getattr(node, "lineno", -1))
|
|
133
|
+
.end_line(getattr(node, "end_lineno", node.lineno))
|
|
134
|
+
.start_column(getattr(node, "col_offset", -1))
|
|
135
|
+
.end_column(getattr(node, "end_col_offset", -1))
|
|
136
136
|
.build()
|
|
137
137
|
)
|
|
138
138
|
|
|
@@ -145,13 +145,13 @@ class SymbolTableBuilder:
|
|
|
145
145
|
qualified_module = "." * node.level + (module_name or "")
|
|
146
146
|
imports.append(
|
|
147
147
|
PyImport.builder()
|
|
148
|
-
.
|
|
149
|
-
.
|
|
150
|
-
.
|
|
151
|
-
.
|
|
152
|
-
.
|
|
153
|
-
.
|
|
154
|
-
.
|
|
148
|
+
.module(qualified_module)
|
|
149
|
+
.name(alias.asname or alias.name)
|
|
150
|
+
.alias(alias.name if alias.asname else None)
|
|
151
|
+
.start_line(getattr(node, "lineno", -1))
|
|
152
|
+
.end_line(getattr(node, "end_lineno", node.lineno))
|
|
153
|
+
.start_column(getattr(node, "col_offset", -1))
|
|
154
|
+
.end_column(getattr(node, "end_col_offset", -1))
|
|
155
155
|
.build()
|
|
156
156
|
)
|
|
157
157
|
|
|
@@ -187,26 +187,26 @@ class SymbolTableBuilder:
|
|
|
187
187
|
|
|
188
188
|
py_class = (
|
|
189
189
|
PyClass.builder()
|
|
190
|
-
.
|
|
191
|
-
.
|
|
192
|
-
.
|
|
193
|
-
.
|
|
190
|
+
.name(class_node.name)
|
|
191
|
+
.signature(signature)
|
|
192
|
+
.start_line(class_node.lineno)
|
|
193
|
+
.end_line(
|
|
194
194
|
getattr(
|
|
195
195
|
class_node, "end_lineno", class_node.lineno + len(class_node.body)
|
|
196
196
|
)
|
|
197
197
|
)
|
|
198
|
-
.
|
|
199
|
-
.
|
|
200
|
-
.
|
|
198
|
+
.comments(self._pycomments(class_node, code))
|
|
199
|
+
.code(code)
|
|
200
|
+
.base_classes(
|
|
201
201
|
[
|
|
202
202
|
ast.unparse(base)
|
|
203
203
|
for base in class_node.bases
|
|
204
204
|
if isinstance(base, ast.expr)
|
|
205
205
|
]
|
|
206
206
|
)
|
|
207
|
-
.
|
|
208
|
-
.
|
|
209
|
-
.
|
|
207
|
+
.methods(self._callables(class_node, script))
|
|
208
|
+
.attributes(self._class_attributes(class_node, script))
|
|
209
|
+
.inner_classes(
|
|
210
210
|
{
|
|
211
211
|
k: v
|
|
212
212
|
for child in class_node.body
|
|
@@ -260,27 +260,27 @@ class SymbolTableBuilder:
|
|
|
260
260
|
|
|
261
261
|
callables[method_name] = (
|
|
262
262
|
PyCallable.builder()
|
|
263
|
-
.
|
|
264
|
-
.
|
|
265
|
-
.
|
|
266
|
-
.
|
|
267
|
-
.
|
|
268
|
-
.
|
|
269
|
-
.
|
|
270
|
-
.
|
|
271
|
-
.
|
|
272
|
-
.
|
|
273
|
-
.
|
|
274
|
-
.
|
|
275
|
-
.
|
|
276
|
-
.
|
|
263
|
+
.name(method_name)
|
|
264
|
+
.path(script.path.__str__())
|
|
265
|
+
.signature(signature)
|
|
266
|
+
.decorators(decorators)
|
|
267
|
+
.code(code)
|
|
268
|
+
.start_line(start_line)
|
|
269
|
+
.end_line(end_line)
|
|
270
|
+
.code_start_line(code_start_line)
|
|
271
|
+
.accessed_symbols(self._accessed_symbols(child, script))
|
|
272
|
+
.call_sites(self._call_sites(child, script))
|
|
273
|
+
.local_variables(self._local_variables(child, script))
|
|
274
|
+
.cyclomatic_complexity(self._cyclomatic_complexity(child))
|
|
275
|
+
.parameters(self._callable_parameters(child, script))
|
|
276
|
+
.return_type(
|
|
277
277
|
ast.unparse(child.returns)
|
|
278
278
|
if child.returns
|
|
279
279
|
else self._infer_type(
|
|
280
280
|
script, child.lineno, child.col_offset
|
|
281
281
|
)
|
|
282
282
|
)
|
|
283
|
-
.
|
|
283
|
+
.comments(self._pycomments(child, code))
|
|
284
284
|
.build()
|
|
285
285
|
)
|
|
286
286
|
|
|
@@ -327,12 +327,12 @@ class SymbolTableBuilder:
|
|
|
327
327
|
|
|
328
328
|
comments.append(
|
|
329
329
|
PyComment.builder()
|
|
330
|
-
.
|
|
331
|
-
.
|
|
332
|
-
.
|
|
333
|
-
.
|
|
334
|
-
.
|
|
335
|
-
.
|
|
330
|
+
.content(docstring_content)
|
|
331
|
+
.start_line(start_line)
|
|
332
|
+
.end_line(end_line)
|
|
333
|
+
.start_column(start_column)
|
|
334
|
+
.end_column(end_column)
|
|
335
|
+
.is_docstring(True)
|
|
336
336
|
.build()
|
|
337
337
|
)
|
|
338
338
|
|
|
@@ -348,12 +348,12 @@ class SymbolTableBuilder:
|
|
|
348
348
|
comment_text = tok.string.lstrip("#").strip()
|
|
349
349
|
comments.append(
|
|
350
350
|
PyComment.builder()
|
|
351
|
-
.
|
|
352
|
-
.
|
|
353
|
-
.
|
|
354
|
-
.
|
|
355
|
-
.
|
|
356
|
-
.
|
|
351
|
+
.content(comment_text)
|
|
352
|
+
.start_line(tok_line)
|
|
353
|
+
.end_line(tok_line)
|
|
354
|
+
.start_column(tok_col)
|
|
355
|
+
.end_column(tok_col + len(tok.string))
|
|
356
|
+
.is_docstring(False)
|
|
357
357
|
.build()
|
|
358
358
|
)
|
|
359
359
|
|
|
@@ -380,14 +380,14 @@ class SymbolTableBuilder:
|
|
|
380
380
|
if isinstance(target, ast.Name):
|
|
381
381
|
attributes[target.id] = (
|
|
382
382
|
PyClassAttribute.builder()
|
|
383
|
-
.
|
|
384
|
-
.
|
|
383
|
+
.name(target.id)
|
|
384
|
+
.type(
|
|
385
385
|
self._infer_type(
|
|
386
386
|
script, target.lineno, target.col_offset
|
|
387
387
|
)
|
|
388
388
|
)
|
|
389
|
-
.
|
|
390
|
-
.
|
|
389
|
+
.start_line(getattr(target, "lineno", -1))
|
|
390
|
+
.end_line(getattr(stmt, "end_lineno", stmt.lineno))
|
|
391
391
|
.build()
|
|
392
392
|
)
|
|
393
393
|
|
|
@@ -396,16 +396,16 @@ class SymbolTableBuilder:
|
|
|
396
396
|
if isinstance(target, ast.Name):
|
|
397
397
|
attributes[target.id] = (
|
|
398
398
|
PyClassAttribute.builder()
|
|
399
|
-
.
|
|
400
|
-
.
|
|
399
|
+
.name(target.id)
|
|
400
|
+
.type(
|
|
401
401
|
ast.unparse(stmt.annotation)
|
|
402
402
|
if stmt.annotation
|
|
403
403
|
else self._infer_type(
|
|
404
404
|
script, target.lineno, target.col_offset
|
|
405
405
|
)
|
|
406
406
|
)
|
|
407
|
-
.
|
|
408
|
-
.
|
|
407
|
+
.start_line(getattr(target, "lineno", -1))
|
|
408
|
+
.end_line(getattr(stmt, "end_lineno", stmt.lineno))
|
|
409
409
|
.build()
|
|
410
410
|
)
|
|
411
411
|
# We may also encounter `__slots__` in class definitions.
|
|
@@ -428,10 +428,10 @@ class SymbolTableBuilder:
|
|
|
428
428
|
value = elt.s if isinstance(elt, ast.Str) else elt.value
|
|
429
429
|
attributes[value] = (
|
|
430
430
|
PyClassAttribute.builder()
|
|
431
|
-
.
|
|
432
|
-
.
|
|
433
|
-
.
|
|
434
|
-
.
|
|
431
|
+
.name(value)
|
|
432
|
+
.type("slot")
|
|
433
|
+
.start_line(getattr(stmt, "lineno", -1))
|
|
434
|
+
.end_line(getattr(stmt, "end_lineno", stmt.lineno))
|
|
435
435
|
.build()
|
|
436
436
|
)
|
|
437
437
|
|
|
@@ -472,15 +472,15 @@ class SymbolTableBuilder:
|
|
|
472
472
|
) -> PyCallableParameter:
|
|
473
473
|
return (
|
|
474
474
|
PyCallableParameter.builder()
|
|
475
|
-
.
|
|
476
|
-
.
|
|
477
|
-
.
|
|
478
|
-
.
|
|
479
|
-
.
|
|
475
|
+
.name(arg_node.arg)
|
|
476
|
+
.type(resolve_type(arg_node))
|
|
477
|
+
.default_value(ast.unparse(default) if default else None)
|
|
478
|
+
.start_line(getattr(arg_node, "lineno", -1))
|
|
479
|
+
.end_line(
|
|
480
480
|
getattr(arg_node, "end_lineno", getattr(arg_node, "lineno", -1))
|
|
481
481
|
)
|
|
482
|
-
.
|
|
483
|
-
.
|
|
482
|
+
.start_column(getattr(arg_node, "col_offset", -1))
|
|
483
|
+
.end_column(getattr(arg_node, "end_col_offset", -1))
|
|
484
484
|
.build()
|
|
485
485
|
)
|
|
486
486
|
|
|
@@ -559,17 +559,17 @@ class SymbolTableBuilder:
|
|
|
559
559
|
|
|
560
560
|
call_sites.append(
|
|
561
561
|
PyCallsite.builder()
|
|
562
|
-
.
|
|
563
|
-
.
|
|
564
|
-
.
|
|
565
|
-
.
|
|
566
|
-
.
|
|
567
|
-
.
|
|
568
|
-
.
|
|
569
|
-
.
|
|
570
|
-
.
|
|
571
|
-
.
|
|
572
|
-
.
|
|
562
|
+
.method_name(method_name)
|
|
563
|
+
.receiver_expr(receiver_expr)
|
|
564
|
+
.receiver_type(receiver_type)
|
|
565
|
+
.argument_types(argument_types)
|
|
566
|
+
.return_type(return_type)
|
|
567
|
+
.callee_signature(callee_signature)
|
|
568
|
+
.is_constructor_call(method_name == "__init__")
|
|
569
|
+
.start_line(getattr(node, "lineno", -1))
|
|
570
|
+
.start_column(getattr(node, "col_offset", -1))
|
|
571
|
+
.end_line(getattr(node, "end_lineno", -1))
|
|
572
|
+
.end_column(getattr(node, "end_col_offset", -1))
|
|
573
573
|
.build()
|
|
574
574
|
)
|
|
575
575
|
|
|
@@ -611,23 +611,23 @@ class SymbolTableBuilder:
|
|
|
611
611
|
if isinstance(target, ast.Name):
|
|
612
612
|
module_vars.append(
|
|
613
613
|
PyVariableDeclaration.builder()
|
|
614
|
-
.
|
|
615
|
-
.
|
|
614
|
+
.name(target.id)
|
|
615
|
+
.type(
|
|
616
616
|
self._infer_type(
|
|
617
617
|
script, target.lineno, target.col_offset
|
|
618
618
|
)
|
|
619
619
|
)
|
|
620
|
-
.
|
|
620
|
+
.initializer(
|
|
621
621
|
ast.unparse(node.value) if node.value else None
|
|
622
622
|
)
|
|
623
|
-
.
|
|
624
|
-
.
|
|
625
|
-
.
|
|
626
|
-
.
|
|
623
|
+
.value(None)
|
|
624
|
+
.scope("module")
|
|
625
|
+
.start_line(getattr(target, "lineno", -1))
|
|
626
|
+
.end_line(
|
|
627
627
|
getattr(node, "end_lineno", getattr(node, "lineno", -1))
|
|
628
628
|
)
|
|
629
|
-
.
|
|
630
|
-
.
|
|
629
|
+
.start_column(getattr(target, "col_offset", -1))
|
|
630
|
+
.end_column(getattr(target, "end_col_offset", -1))
|
|
631
631
|
.build()
|
|
632
632
|
)
|
|
633
633
|
|
|
@@ -638,23 +638,21 @@ class SymbolTableBuilder:
|
|
|
638
638
|
if isinstance(target, ast.Name):
|
|
639
639
|
module_vars.append(
|
|
640
640
|
PyVariableDeclaration.builder()
|
|
641
|
-
.
|
|
642
|
-
.
|
|
641
|
+
.name(target.id)
|
|
642
|
+
.type(
|
|
643
643
|
ast.unparse(node.annotation)
|
|
644
644
|
if node.annotation
|
|
645
645
|
else self._infer_type(script, node.lineno, node.col_offset)
|
|
646
646
|
)
|
|
647
|
-
.
|
|
648
|
-
|
|
649
|
-
)
|
|
650
|
-
.
|
|
651
|
-
.
|
|
652
|
-
.with_start_line(getattr(target, "lineno", -1))
|
|
653
|
-
.with_end_line(
|
|
647
|
+
.initializer(ast.unparse(node.value) if node.value else None)
|
|
648
|
+
.value(None)
|
|
649
|
+
.scope("module")
|
|
650
|
+
.start_line(getattr(target, "lineno", -1))
|
|
651
|
+
.end_line(
|
|
654
652
|
getattr(node, "end_lineno", getattr(node, "lineno", -1))
|
|
655
653
|
)
|
|
656
|
-
.
|
|
657
|
-
.
|
|
654
|
+
.start_column(getattr(target, "col_offset", -1))
|
|
655
|
+
.end_column(getattr(target, "end_col_offset", -1))
|
|
658
656
|
.build()
|
|
659
657
|
)
|
|
660
658
|
|
|
@@ -682,23 +680,23 @@ class SymbolTableBuilder:
|
|
|
682
680
|
if isinstance(target, ast.Name):
|
|
683
681
|
local_vars.append(
|
|
684
682
|
PyVariableDeclaration.builder()
|
|
685
|
-
.
|
|
686
|
-
.
|
|
683
|
+
.name(target.id)
|
|
684
|
+
.type(
|
|
687
685
|
self._infer_type(
|
|
688
686
|
script, target.lineno, target.col_offset
|
|
689
687
|
)
|
|
690
688
|
)
|
|
691
|
-
.
|
|
689
|
+
.initializer(
|
|
692
690
|
ast.unparse(node.value) if node.value else None
|
|
693
691
|
)
|
|
694
|
-
.
|
|
695
|
-
.
|
|
696
|
-
.
|
|
697
|
-
.
|
|
692
|
+
.value(None)
|
|
693
|
+
.scope("function")
|
|
694
|
+
.start_line(getattr(target, "lineno", -1))
|
|
695
|
+
.end_line(
|
|
698
696
|
getattr(node, "end_lineno", getattr(node, "lineno", -1))
|
|
699
697
|
)
|
|
700
|
-
.
|
|
701
|
-
.
|
|
698
|
+
.start_column(getattr(target, "col_offset", -1))
|
|
699
|
+
.end_column(getattr(target, "end_col_offset", -1))
|
|
702
700
|
.build()
|
|
703
701
|
)
|
|
704
702
|
# This handles instance attribute assignments like self.attr = value
|
|
@@ -709,23 +707,23 @@ class SymbolTableBuilder:
|
|
|
709
707
|
):
|
|
710
708
|
local_vars.append(
|
|
711
709
|
PyVariableDeclaration.builder()
|
|
712
|
-
.
|
|
713
|
-
.
|
|
710
|
+
.name(target.attr)
|
|
711
|
+
.type(
|
|
714
712
|
self._infer_type(
|
|
715
713
|
script, target.lineno, target.col_offset
|
|
716
714
|
)
|
|
717
715
|
)
|
|
718
|
-
.
|
|
716
|
+
.initializer(
|
|
719
717
|
ast.unparse(node.value) if node.value else None
|
|
720
718
|
)
|
|
721
|
-
.
|
|
722
|
-
.
|
|
723
|
-
.
|
|
724
|
-
.
|
|
719
|
+
.value(None)
|
|
720
|
+
.scope("class")
|
|
721
|
+
.start_line(getattr(target, "lineno", -1))
|
|
722
|
+
.end_line(
|
|
725
723
|
getattr(node, "end_lineno", getattr(node, "lineno", -1))
|
|
726
724
|
)
|
|
727
|
-
.
|
|
728
|
-
.
|
|
725
|
+
.start_column(getattr(target, "col_offset", -1))
|
|
726
|
+
.end_column(getattr(target, "end_col_offset", -1))
|
|
729
727
|
.build()
|
|
730
728
|
)
|
|
731
729
|
|
|
@@ -741,17 +739,17 @@ class SymbolTableBuilder:
|
|
|
741
739
|
if isinstance(target, ast.Name):
|
|
742
740
|
local_vars.append(
|
|
743
741
|
PyVariableDeclaration.builder()
|
|
744
|
-
.
|
|
745
|
-
.
|
|
746
|
-
.
|
|
747
|
-
.
|
|
748
|
-
.
|
|
749
|
-
.
|
|
750
|
-
.
|
|
742
|
+
.name(target.id)
|
|
743
|
+
.type(annotation_str)
|
|
744
|
+
.initializer(initializer_str)
|
|
745
|
+
.value(None)
|
|
746
|
+
.scope("function")
|
|
747
|
+
.start_line(getattr(target, "lineno", -1))
|
|
748
|
+
.end_line(
|
|
751
749
|
getattr(node, "end_lineno", getattr(node, "lineno", -1))
|
|
752
750
|
)
|
|
753
|
-
.
|
|
754
|
-
.
|
|
751
|
+
.start_column(getattr(target, "col_offset", -1))
|
|
752
|
+
.end_column(getattr(target, "end_col_offset", -1))
|
|
755
753
|
.build()
|
|
756
754
|
)
|
|
757
755
|
# Annotated instance attribute: self.attr: int = SOME_VALUE
|
|
@@ -762,17 +760,17 @@ class SymbolTableBuilder:
|
|
|
762
760
|
):
|
|
763
761
|
local_vars.append(
|
|
764
762
|
PyVariableDeclaration.builder()
|
|
765
|
-
.
|
|
766
|
-
.
|
|
767
|
-
.
|
|
768
|
-
.
|
|
769
|
-
.
|
|
770
|
-
.
|
|
771
|
-
.
|
|
763
|
+
.name(target.attr)
|
|
764
|
+
.type(annotation_str)
|
|
765
|
+
.initializer(initializer_str)
|
|
766
|
+
.value(None)
|
|
767
|
+
.scope("class")
|
|
768
|
+
.start_line(getattr(target, "lineno", -1))
|
|
769
|
+
.end_line(
|
|
772
770
|
getattr(node, "end_lineno", getattr(node, "lineno", -1))
|
|
773
771
|
)
|
|
774
|
-
.
|
|
775
|
-
.
|
|
772
|
+
.start_column(getattr(target, "col_offset", -1))
|
|
773
|
+
.end_column(getattr(target, "end_col_offset", -1))
|
|
776
774
|
.build()
|
|
777
775
|
)
|
|
778
776
|
|
|
@@ -859,14 +857,14 @@ class SymbolTableBuilder:
|
|
|
859
857
|
|
|
860
858
|
return (
|
|
861
859
|
PySymbol.builder()
|
|
862
|
-
.
|
|
863
|
-
.
|
|
864
|
-
.
|
|
865
|
-
.
|
|
866
|
-
.
|
|
867
|
-
.
|
|
868
|
-
.
|
|
869
|
-
.
|
|
860
|
+
.name(name)
|
|
861
|
+
.scope(scope)
|
|
862
|
+
.kind(kind)
|
|
863
|
+
.type(inferred_type)
|
|
864
|
+
.qualified_name(qname)
|
|
865
|
+
.is_builtin(is_builtin)
|
|
866
|
+
.lineno(lineno)
|
|
867
|
+
.col_offset(col_offset)
|
|
870
868
|
.build()
|
|
871
869
|
)
|
|
872
870
|
|
codeanalyzer/utils/__init__.py
CHANGED
codeanalyzer/utils/logging.py
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
1
4
|
from rich.console import Console
|
|
2
5
|
from rich.progress import (
|
|
6
|
+
BarColumn,
|
|
3
7
|
Progress,
|
|
4
8
|
SpinnerColumn,
|
|
9
|
+
TaskID,
|
|
5
10
|
TextColumn,
|
|
6
|
-
BarColumn,
|
|
7
11
|
TimeElapsedColumn,
|
|
8
12
|
TimeRemainingColumn,
|
|
9
|
-
TaskID,
|
|
10
13
|
)
|
|
11
|
-
from typing import Optional
|
|
12
|
-
import logging
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class ProgressBar:
|