Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/pylint/extensions/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/pylint/extensions/__pycache__/mccabe.cpython-311.pyc

�

�܋f���H�dZddlmZddlmZddlmZmZmZm	Z	ddl
mZddlm
ZddlmZddlmZdd	lmZdd
lmZerddlmZe	ejejejejejejejej ej!ej"ej#ej$ej%ej&ej'ej(fZ)e	ej*ej+ej,ej-fZ.ede	e)ej-ej/f�
��Z0Gd�de��Z
Gd�de��ZGd�dej1��Z2dd�Z3dS)z.Module to add McCabe checker class for pylint.�)�annotations)�Sequence)�
TYPE_CHECKING�Any�TypeVar�Union)�nodes)�	PathGraph)�PathGraphingAstVisitor)�checkers)�only_required_for_messages)�HIGH)�PyLinter�_AppendableNodeT)�boundc� ��eZdZd�fd�Z�xZS)r
�node�"_SubGraphNodes | nodes.FunctionDefc�^��t���ddd���||_dS)N��)�name�entity�lineno)�super�__init__�root)�selfr�	__class__s  ��i/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/extensions/mccabe.pyrzPathGraph.__init__1s-���
�����b��A��6�6�6���	�	�	�)rr)�__name__�
__module__�__qualname__r�
__classcell__�rs@r r
r
0s=����������������r!r
c���eZdZd�fd�Zdd�Zdd	�Zdd�ZeZd d
�ZexZ	xZ
xZxZxZ
xZxZxZxZxZxZxZxZxZxZZd!d�ZeZd"d�Z	d#d$d�Zd%d�Z�xZS)&r�return�Nonec�d��t�����d|_d|_dS)Nr)rr�_bottom_counter�graph)rrs �r rzPathGraphingAstVisitor.__init__7s,���
�������� ���'+��
�
�
r!r�nodes.NodeNG�argsrc�P�|���D]}|j|g|�R��dS�N)�get_children�dispatch)rrr.�childs    r �defaultzPathGraphingAstVisitor.default<sD���&�&�(�(�	(�	(�E��D�M�%�'�$�'�'�'�'�'�	(�	(r!c���||_|j}|j�|��}|�/|j}t|jd|z|j��}||j|<||g|�R�S)N�visit)rr�_cache�getr"�getattr�visitorr4)rrr.�klass�meth�
class_names      r r2zPathGraphingAstVisitor.dispatch@sm����	�����{���u�%�%���<���J��4�<��:�)=�t�|�L�L�D�!%�D�K����t�D� �4� � � � r!�nodes.FunctionDefc��|j��|�|��}||_|�|j��|j�}|xjdz
c_|j�|j|��|j�||��||_dSt|��|_||_|�|j��|j|j|j	�|j
��<|���dS)Nr)r,�_append_node�tail�
dispatch_list�bodyr+�connectr
�graphs�	classnamer�reset)rr�pathnode�bottoms    r �visitFunctionDefz'PathGraphingAstVisitor.visitFunctionDefJs����:�!��(�(��.�.�H� �D�I����t�y�)�)�)��,�.�F�� � �A�%� � ��J���t�y�&�1�1�1��J���t�V�,�,�,��D�I�I�I�"�4���D�J��D�I����t�y�)�)�)�:>�*�D�K�4�>�6�4�9�6�6�7��J�J�L�L�L�L�Lr!�_StatementNodesc�0�|�|��dSr0)r@�rrs  r �visitSimpleStatementz+PathGraphingAstVisitor.visitSimpleStatement^s�����$�����r!�
nodes.Withc�d�|�|��|�|j��dSr0)r@rBrCrMs  r �	visitWithz PathGraphingAstVisitor.visitWithys2�����$�������4�9�%�%�%�%�%r!r�_AppendableNodeT | Nonec�t�|jr|jsdS|j�|j|��||_|Sr0)rAr,rDrMs  r r@z#PathGraphingAstVisitor._append_nodes@���y�	��
�	��4��
���4�9�d�+�+�+���	��r!��_SubGraphNodesr�str�extra_blocks�Sequence[nodes.ExceptHandler]c��|j�Yt|��|_|�|||��|j|j|j�|��<|���dS|�|��|�|||��dS)z@Create the subgraphs representing any `if` and `for` statements.N)r,r
�_subgraph_parserErFrGr@)rrrrWs    r �	_subgraphz PathGraphingAstVisitor._subgraph�s����:��"�4���D�J�� � ��t�\�:�:�:�59�Z�D�K�4�>�1�4�1�1�2��J�J�L�L�L�L�L����d�#�#�#�� � ��t�\�:�:�:�:�:r!rHc�H�g}||_|�|j��|�|j��|D]=}||_|�|j��|�|j���>|jr<||_|�|j��|�|j��n|�|��|rH|jrC|j�}|xjdz
c_|D]}|j�||���||_dSdSdS)zAParse the body and any `else` block of `if` and `for` statements.rN)rArBrC�append�orelser,r+rD)rrrHrW�
loose_ends�extrarI�ends        r rZz&PathGraphingAstVisitor._subgraph_parse�sN���
���	����4�9�%�%�%����$�)�$�$�$�!�	)�	)�E��D�I����u�z�*�*�*����d�i�(�(�(�(��;�	$��D�I����t�{�+�+�+����d�i�(�(�(�(����d�#�#�#��	�D�J�	��,�.�F�� � �A�%� � �!�
0�
0���
�"�"�3��/�/�/�/��D�I�I�I�	�	�	�	r!)r(r))rr-r.rr(r))rr-r.rr(r)rr>r(r))rrKr(r))rrOr(r))rrr(rR)rT)rrUrrVrWrXr(r))rrUrHrUrWrXr(r))r"r#r$rr4r2rJ�visitAsyncFunctionDefrN�visitAssert�visitAssign�visitAugAssign�visitDelete�
visitRaise�
visitYield�visitImport�	visitCall�visitSubscript�	visitPass�
visitContinue�
visitBreak�visitGlobal�visitReturn�	visitExpr�
visitAwaitrQ�visitAsyncWithr@r[rZr%r&s@r rr6s��������,�,�,�,�,�,�
(�(�(�(�!�!�!�!�����$-�� � � � �2>R�-R�K�R��R�	�R�
	�R�	�R�	�R�	�R�	�R�	�R�"	�#R�&	�'R�*	�+R�,	�-R�,"�-R�,%.�
�&�&�&�&��N�����79�	;�;�;�;�;�"�������r!rc�\�eZdZdZdZddiZddddd	d
�ffZed��dd���ZdS)�McCabeMethodCheckerzoChecks McCabe complexity cyclomatic threshold in methods and functions
    to validate a too complex code.
    �design�R1260)z*%s is too complex. The McCabe rating is %d�too-complexzSUsed when a method or function is too complex based on McCabe Complexity Cyclomaticzmax-complexity�
�intz<int>z&McCabe complexity cyclomatic threshold)r4�type�metavar�helprxr�nodes.Moduler(r)c��t��}|jD]}|�||���|j���D]�}|���}|j}t|d��rd|j�d�}n"d|j	j
����d�}||jj
jkr�q|�d|t ||f�����dS)z�Visit an astroid.Module node to check too complex rating and
        add message if is greater than max_complexity stored from options.
        r�'zThis 'rx)r�
confidencer.N)rrC�preorderrE�values�
complexityr�hasattrrrr"�lower�linter�config�max_complexity�add_messager)rrr:r3r,r��	node_names       r �visit_modulez McCabeMethodChecker.visit_module�s��
)�*�*���Y�	-�	-�E����U�G�,�,�,�,��^�*�*�,�,�	�	�E��)�)�+�+�J��:�D��t�V�$�$�
H�,��	�,�,�,�	�	�G�T�^�%<�%B�%B�%D�%D�G�G�G�	��T�[�/�>�>�>������D�T��J�@W�
�
�
�
�
�	�	r!N)rr~r(r))	r"r#r$�__doc__r�msgs�optionsr
r�rTr!r ruru�s����������D�	�
��D�
���"�@�	
�
�	
�
�G� ��
�.�.����/�.���r!rur�rr(r)c�J�|�t|����dSr0)�register_checkerru)r�s r �registerr��s%��
���/��7�7�8�8�8�8�8r!N)r�rr(r))4r��
__future__r�collections.abcr�typingrrrr�astroidr	�mccaber
�Mccabe_PathGraphr�Mccabe_PathGraphingAstVisitor�pylintr�pylint.checkers.utilsr
�pylint.interfacesr�pylint.lintr�Assert�Assign�	AugAssign�Delete�Raise�Yield�Import�Call�	Subscript�Pass�Continue�Break�Global�Return�Expr�AwaitrK�If�	TryExcept�For�WhilerU�FunctionDefr�BaseCheckerrur�rTr!r �<module>r�s/��
5�4�"�"�"�"�"�"�$�$�$�$�$�$�5�5�5�5�5�5�5�5�5�5�5�5�������0�0�0�0�0�0�J�J�J�J�J�J�������<�<�<�<�<�<�"�"�"�"�"�"��%�$�$�$�$�$�$��	�L�	�L�	�O�	�L�	�K�	�K�	�L�	�J�	�O�	�J�	�N�	�K�	�L�	�L�	�J�	�K����&�u�x���%�)�U�[�H�I���7��e�O�U�[�%�BS�$S�T�����
����� ����{�{�{�{�{�:�{�{�{�|.�.�.�.�.�(�.�.�.�.�b9�9�9�9�9�9r!

Hacked By AnonymousFox1.0, Coded By AnonymousFox