@@ -284,25 +284,29 @@ def _split_name(self, name: str) -> List[str]:
284284 # =========================================================================
285285
286286 def visit_Assign (self , node : ast .Assign ):
287+ """Track assignment as Power signal (state modification)."""
287288 self .assignment_count += 1
288289 self .power_signals .append ("assign" )
289290 self .total_nodes += 1
290291 self .generic_visit (node )
291292
292293 def visit_AugAssign (self , node : ast .AugAssign ):
294+ """Track augmented assignment (+=, -=) as Power signal."""
293295 self .assignment_count += 1
294296 self .power_signals .append ("aug_assign" )
295297 self .total_nodes += 1
296298 self .generic_visit (node )
297299
298300 def visit_AnnAssign (self , node : ast .AnnAssign ):
301+ """Track annotated assignment as Power + Wisdom (type info)."""
299302 self .assignment_count += 1
300303 self .type_hints_count += 1
301304 self .power_signals .append ("ann_assign" )
302305 self .total_nodes += 1
303306 self .generic_visit (node )
304307
305308 def visit_Call (self , node : ast .Call ):
309+ """Track function call - dimension depends on verb semantics."""
306310 self .call_count += 1
307311
308312 # Check if call name suggests P or W
@@ -318,24 +322,28 @@ def visit_Call(self, node: ast.Call):
318322 self .generic_visit (node )
319323
320324 def visit_Raise (self , node : ast .Raise ):
325+ """Track exception raising as Power signal (forcing control flow)."""
321326 self .raise_count += 1
322327 self .power_signals .append ("raise" )
323328 self .total_nodes += 1
324329 self .generic_visit (node )
325330
326331 def visit_Delete (self , node : ast .Delete ):
332+ """Track deletion as Power signal (destruction operation)."""
327333 self .delete_count += 1
328334 self .power_signals .append ("delete" )
329335 self .total_nodes += 1
330336 self .generic_visit (node )
331337
332338 def visit_For (self , node : ast .For ):
339+ """Track for-loop - adds complexity, indicates iteration."""
333340 self .loop_count += 1
334341 self .complexity += 1
335342 self .total_nodes += 1
336343 self .generic_visit (node )
337344
338345 def visit_While (self , node : ast .While ):
346+ """Track while-loop - adds complexity, conditional iteration."""
339347 self .loop_count += 1
340348 self .complexity += 1
341349 self .total_nodes += 1
@@ -346,23 +354,27 @@ def visit_While(self, node: ast.While):
346354 # =========================================================================
347355
348356 def visit_Return (self , node : ast .Return ):
357+ """Track return as Wisdom signal (providing information back)."""
349358 self .return_count += 1
350359 self .wisdom_signals .append ("return" )
351360 self .total_nodes += 1
352361 self .generic_visit (node )
353362
354363 def visit_If (self , node : ast .If ):
364+ """Track conditional as complexity + understanding indicator."""
355365 self .conditional_count += 1
356366 self .complexity += 1
357367 self .total_nodes += 1
358368 self .generic_visit (node )
359369
360370 def visit_Assert (self , node : ast .Assert ):
371+ """Track assertion as Wisdom signal (validation, correctness)."""
361372 self .wisdom_signals .append ("assert" )
362373 self .total_nodes += 1
363374 self .generic_visit (node )
364375
365376 def visit_Try (self , node : ast .Try ):
377+ """Track try-block as Wisdom signal (error handling awareness)."""
366378 self .complexity += 1
367379 self .wisdom_signals .append ("try_block" )
368380 self .total_nodes += 1
0 commit comments