You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a single line contains an inline block comment such as int count = 0; /* inline */, the "/*" in line branch executes, setting in_block_comment = True. Because elif "*/" in line is an elif, the closing delimiter on that same line is never checked! in_block_comment remains True for the remainder of the file, causing all subsequent executable lines to be counted as comments.
For relative imports like from . import utils, node.module is None. Appending None to stats["imports"] can cause unexpected TypeError or render literal None in reports.
Affected Files
insight/analyzer.py:38-66
Proposed Solution
Check for single-line block comments ("/*" in line and "*/" in line) before toggling block state.
Problem Description
C-Style Inline Comments (
/* ... */):In
insight/analyzer.py:If a single line contains an inline block comment such as
int count = 0; /* inline */, the"/*" in linebranch executes, settingin_block_comment = True. Becauseelif "*/" in lineis anelif, the closing delimiter on that same line is never checked!in_block_commentremainsTruefor the remainder of the file, causing all subsequent executable lines to be counted as comments.Async Functions Ignored:
In
analyzer.py:55-56:In Python,
async def my_func()generates anast.AsyncFunctionDefAST node. Modern asynchronous functions are completely ignored.Relative Imports Returning
None:In
analyzer.py:61-62:For relative imports like
from . import utils,node.moduleisNone. AppendingNonetostats["imports"]can cause unexpectedTypeErroror render literalNonein reports.Affected Files
insight/analyzer.py:38-66Proposed Solution
"/*" in line and "*/" in line) before toggling block state.ast.AsyncFunctionDef:node.module is None(e.g. usef".{node.names[0].name}"or".").