EVi j d dl Z d dlmZ d dlmZmZ d dlmZmZm Z d dl mZ dZ G d de Z dS ) N)PathGraphingAstVisitor)CouldNotHandleEncodingread_py_file)LocationMessagemake_tool_error_message)ToolBase) McCabeToolc 0 e Zd Z fdZd Zd Zd Z xZS )r c V t j |i | d| _ d| _ d S )N )super__init__ignore_codesmax_complexity)selfargskwargs __class__s r/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/prospector/tools/mccabe/__init__.pyr zMcCabeTool.__init__ s5 $)&))) c | d | _ | d }d|v r|d | _ d S d S )Nmccabezmax-complexity)get_disabled_messagesr tool_optionsr )r prospector_config_optionss r configurezMcCabeTool.configure sR -CCHMM#00::w&&")*:";D '&r c j g }|j D ]} t | }t j || }n# t $ r8}| t |ddd|j Y d }~gd }~wt $ r<}| t |dd|j |j d Y d }~d }~wt $ r) | t |ddd Y w xY wt }| || |j D ]r}| } | | j k rQt% |d |j |j d } t) dd| |j d| d }| | s| | S )N)filenamer MC0000z,Could not handle the encoding of this file: )messagezSyntax Error)line characterr$ zUnable to parse filer )pathmodulefunctionr% r&