example of-method-with-cyclomatic-complexity-17

10

Click here to load reader

Upload: zarko-acimovic

Post on 20-May-2015

1.550 views

Category:

Technology


0 download

DESCRIPTION

Example of Java method with cyclomatic complexity 17

TRANSCRIPT

Page 1: Example of-method-with-cyclomatic-complexity-17

�� �������� �����������������������������������������

;� �*+5�����5����������,�

���

�'������������������������������������"�������� #-# ����������

�'������������������������������������"�������� #-2 ����������

����������������"�����* #�* �������������

)����� ���������������$( #�* �������������

,������� ��������������2$ #�* �������������

�'������� ������������.������������������ $02 ����������

�'������������������������������������"�������� $0+ ����������

�'������� ������������.������������������ $#* ����������

�'������� ������������.������������������ $#- ����������

����������������'������������"������1������������������������������������������������ $5� ����������

����������� ����������������������::����I:������6�4���� ����'�H����7�����8�$-# %�&���

����������������"������ $-- �������������

)����� ���������������$0 $-- �������������

,������� ��������������(+ $-- �������������

=���������/����������/�����������������������"���� �#* $-- ����������

=�������������������78��������,�����������"���� �+5+# $-- ����������

�'������� ������������.������������������ $�+ ����������

�'������� ������������.������������������ $�* ����������

����������������"������ (0� �������������

)����� ���������������$� (0� �������������

,������� ��������������2- (0� �������������

zarko.acimovic
Texte surligné
Page 2: Example of-method-with-cyclomatic-complexity-17

�����������

;� *+5�����5����

�����������

�����������

�����������1�F�<���������������������������������<����������������������

�����'�����

�����(������������������

�����)�������� ��!"�����

�������������������"��2���!����2!���

��������

��������������������B��37��2���

����������������

������������B��M�2=�����!��7

������������?�����2�����F����

�����#������?������������F���� �������������

�����'������?�����!������F����

�����(������FA�2���0���,������

�����)����������%�����������

������������FA�2���2�����@��� �

������������%������!��.�7��F���

������������� �����0���!�

������������7�������!��.-���/����� ��

������������7�������!�����/�����

������������7�������2��������/�����

�����#������

�����'������

�����(������

�����)������B��37��2�$B��M�2=�����!��7%�

����������������� ����7�/��7

����������������2�����F�����/��7���G�.6!��$%

����������������!������F�����/��7���G�.6!��$%

����#�����������2�����F�������G���$>!����>%

����#�����������!������F�������G���$>!����>%

����#�����������������/�����%�����$%

����##����������0���!��/������ ����$%

����#'������&

����#(������

����#)��������������&������?������������������������

����� ��������

�����$���������

����#����������������!���C��.�7��F���$%�

����'�����������%�����������/�����%�����$%

����'�����������%����������

����'�����������

����'#����������������3������ ����������������� ��"�����

����''������������$� ���2�����F�����2��2=$�7���G�.6!��$%5��7���C�.�6�!$%%%��

����'(������������������

2�����F�������HI$�7���G�.6!��$%5�7���F"-��$%5�7���F"-�$%%

���

Page 3: Example of-method-with-cyclomatic-complexity-17

�� �������� �����������������������������������������

����')������������������������!!6�����$2�����F����%

����'�����������&

����'�������������$� ���!������F�����2��2=$�7���G�.6!��$%5�

�7���C�.�6�!$%%%��

����'�������������������

!������F�������HI$�7���G�.6!��$%5�7���F"-��$%5�7���F"-�$%%

����(�������������������������!!6�����$!������F����%

����(�����������&

����(�����������

����(#����������������3�������� ����������� ��"�����

����('���������������/�0���,���������F���$�7���G�.6!��$%5�7���C�.�6�!$%%

����((��������������$���/� ��;������:�$% ��88%�

����()������������������?�����.��/�$?����%�����������<$�%

����(�������������������.����HI$�7���G�.6!��$%5�7���F"-��$%5�7���F"-�$%%

����(�������������������������!!6�����$.�%

����(�����������&

����)�����������

����)�����������

����)�����������������3������� ����������� ��"�����

����)#���������������$��/� �;�������:�$% �88%�

����)'������������������FA�2�����/�$FA�2��%������������<$%

����)(���������������������$����A�7��$%//����%��

����))�������������������������������/�

����F���$�7���G�.6!��$%5�7���C�.�6�!$%%

����)�������������������

����)���������������������������������������$���/� ��;������:�$% ��88%�

����)�����������������������������������?�����.��/�$?����%�����������<$�%

����������������������������������������

.����HI$�7���G�.6!��$%5�7���F"-��$%5�7���F"-�$%%

����������������������������������������������!!6�����$.�%

��������������������������������&

�����#������������������&

�����'����������&

�����(����������!��.�7��F����/����� ��

�����)������&

������������

���������������*�������&������?������������������������

���� 8��������!�������%�����

����$+��������

�������������������%��������C��.�7��F���3�!$%�

����������������

�����#�����������������!��.�7��F���

�����'������&

�����(������

�����)��������������%��������C��.�7��F���$%�

����������������� �����C��.�7��F���$%

�����������������������!��.�7��F���

������������&

�����������

������������

���������������������!���������F����$?�����.�%�

���

Page 4: Example of-method-with-cyclomatic-complexity-17

�����������

�����#�����������������F�����/�2�����F����

�����'����������2�����F�����/�.�

�����(����������

2�����F�������HI$�7���G�.6!��$%5�7���F"-��$%5�7���F"-�$%%

�����)����������2��������/�����

������������&

������������

���������������*���������������������

����++��������

���������������������!�����������F����$%�

����������������2�����F�����/��7���G�.6!��$%

�����#����������!��.-���/�����

�����'����������2��������/�����

�����(������&

�����)������

���������������*�����������������������

����+$���������!�������?�����

����+8��������

�������������������?�������������F����$%�

�����������������������2�����F����

������������&

�����#������

�����'������

�����(��������������&������������������

�����)��������

���������������������!���C������F����$?�����.�%�

����������������!������F�����/�.�

����������������!�����/�����

������������&

������������

���������������*�����&������������������

��������������

�����'���������������!�����C������F����$%�

�����(����������!������F�����/��7���G�.6!��$%

�����)����������!��.-���/�����

����������������!�����/�����

������������&

������������

����#����������*�������&������������������

���������������!�������?�����

��������������

����##�������������?�������C������F����$%�

����#'�����������������!������F����

����#(������&�

����#)������

����#����������*����������������

�����$��������

����#��������������%��������@����$%�

����'�����������������������

����'�������&

����'�������

����

Page 5: Example of-method-with-cyclomatic-complexity-17

�� �������� �����������������������������������������

����'#���������*������������%��������������?�����

����''��������

����'(�������������FA�2�����E���,������$%�

����')�����������������0���,������

����'�������&

����'�������

����'����������,����1�F�<������777�FB�FD�/�,LOO

���-�9��������

����(����������������!�!��.B3M��!$2�� �����5�7�����������%�

����(����������������:��/��7���Q���-����$%8�

����(#����������D����::��/�����D���$:�%

����('������������:���-�/�0������������ �$::�������$%%

����((����������� �����C��.�7��F���$%

����()����������

����(��������������. ������������������������������������ �����������

����(�������������$!��.-��//����%�

����(�������������������

2�����F�������HI$�7���G�.6!��$%5�7���F"-��$%5�7���F"-�$%%

����)�������������������

!������F�������HI$�7���G�.6!��$%5�7���F"-��$%5�7���F"-�$%%

����)�������������������

��!��.-��$2�����F�������HH$%52�����F�������II$%5!������F�������H

H$%5!������F�������II$%%

����)�����������&

����)#������������������

����)'�������������. ��������� ���)����=��� �������������������������

�������

����)(�������������$��/� �;!��.�7��F�����:�$% �88%�

����))��������������������������?�����.��/�$?����%!��.�7��F����������<$%

����)�����������������������������$.���� ����$%��O����$>7���2�>%%�

����)�����������������������������0��@�2$.����HH$%5.����II$%5(�:���-5(�:���-%

����)�����������������������������!��.����$.����G���$%5.����HH$%8(5.����II$%

8(5�%

��������������������������������&�������

����������������������������������������0�������/�����

��������������������������������������������

�����#���������������������������������������������/�

0����2���� ����$.���� ����$%%

�����'����������������������������������&��� $�-���������%�&

�����(������������������������������������!��. ����$��5.����HH$%5.����II$%5�%

�����)��������������������������&

������������������������

����������������&

����������������

�������������������. �������� ���������

������������������$����//����%�

���������������������������$��/� �;�������:�$% �88%�

�����#��������������������������FA�2���.���/�$FA�2��%������������<$%

�����'����������������������������$.�����A�7��$%//����%�

�����(�������������������������������������$���/� ��;.����:�$%1� ��88%�

����

Page 6: Example of-method-with-cyclomatic-complexity-17

�����������

�����)��������������������������������������������������?�����.���/�$?����%�

.���������<$�%

��������������������������������������������������������?�����.���/�$?����%�

.���������<$�8�%

��������������������������������������������������������

.�����HI$�7���G�.6!��$%5�7���F"-��$%5�7���F"-�$%%

��������������������������������������������������������

.�����HI$�7���G�.6!��$%5�7���F"-��$%5�7���F"-�$%%

��������������������������������������������������������

��!��.-��$.�����HH$%5.�����II$%5.�����HH$%5.�����II$%%

����������������������������������������&

��������������������������������&

�����#������������������&

�����'����������&

�����(������&

�����)������

���������������,����1�F�<����

����8$��������

���������������������!�!��.B3M$2�� �����5�7�����������%�

�������������������������$�5�5�%

����������������

����������������

0���,�������!��.A�2��$�5����5�7���G�.6!��$%5�7���F"-��$%5�7���F"-�$%5�7��

�Q���-����$%%

�����#����������

�����'������������$0���!���:�$%9/�%�

� �����E���!�$%�!��.A�2��$�5����5�7���G�.6!��$%5�7���F"-��$%5�7���F"-�$%5

�%

�����(������������������

�����)������������$����//����%�

����������������������������$���/� �;�������:�$% �88%�

��������������������������������FA�2���.���/�$FA�2��%������������<$%

��������������������������������

.���!��.A�2��$�5����5�7���G�.6!��$%5�7���F"-��$%5�7���F"-�$%5�7���Q���-���

�$%%

������������������������&

����������������&

����������������

�����#������������$2�������%��

�����'������������������

2�����F�����!��.F��$�5�7���G�.6!��$%5�7���F"-�$%5�7���F"-��$%5�7���Q��

�-����$%%

�����(������������������

�����)����������&

������������������$!����%�

!������F�����!��.F��$�5�7���G�.6!��$%5�7���F"-�$%5�7���F"-��$%5�7���

Q���-����$%%

��������������������������$2��������LL�!����%�

��!��.-��$2�����F�������HH$%52�����F�������II$%5!������F�������H

H$%5!������F�������II$%%

����������������&

����

Page 7: Example of-method-with-cyclomatic-complexity-17

�� �������� �����������������������������������������

����������������

��������

������������

�����#������

�����'���������A&&�������?����

�����(��������

�����)���������������!��!!E���,�����$?�����.�%�

����������������� ���0���,��������!!6�����$.�%

������������&�

������������������������

����#����������A&&�����������

��������������

����#����������������!��!!@���$FA�2����%�

����##����������� ����������!!6�����$�%

����#'������&

����#(������

����#)���������A&&������?����������������� ������0,����������������

����� ��������

����#����������������!��!!,F�@���$?�����.�5������� C5������%��

����#�����������FA�2�������

����'���������������$��/� �;�������:�$% �88%�

����'������������������������/�$FA�2��%������������<$%

����'���������������������$������� C$%//���� C%�

����'#�����������������������������������6�����<$.�5���%

����''��������������������������/����

����'(������������������&

����')����������&

����'�������&

����'�������

����'�����������������������������.�����

����(+��������

����(����������������!���E���,������A$FA�2���.��%�

����(������������ ���0���,�������/�.��

����(#������&

����('������

����((���������1������&������

����()��������

����(��������������������������C���2�$?�����.�%�

����(��������������$2�����F������O����$�7���G�.6!��$%%%��

����(��������������������������1�

����)�����������&�������

����)��������������������������2�����F������������C���2�$.�% ��

����)�����������&

����)#������&

����)'������

����)(�������������7�������2�������$%�

����))�����������������2�������

����)�������&

����)�������

����)��������������7�������!����$%�

�����������������������!����

����

Page 8: Example of-method-with-cyclomatic-complexity-17

�����������

������������&

������������

�����#���������������������������

�����'���������������!�������@���$FA�2���.�%�

�����(����������������������6�����$.�%

�����)������&

������������

���������������������!�������@���$��������%�

�������������������$��/� �;�������:�$% �88%�

������������������������FA�2������/�$FA�2��%������������<$%

���������������������������$����G���$%//�%��

��������������������������������������������6�����<$%

�����#��������������������������/����

�����'������������������&

�����(����������&

�����)������&

������������

���������������������������C��2��$%�

������������������������

���������������������!��2���/��

�����������������������F�/��������F�������-�$%

������������������������F�/��������F�������-��$%

�����#�������������������/�2�����F�������-�$%

�����'��������������������/�2�����F�������-��$%

�����(����������

�����)������������$���N��F�LL����F//����%�!��2���/�B��EF��EF$>�>%

������������������$���N��F�LL�����N���F%�!��2���/�B��EF��EF$>'(>%

������������������$��F//����LL�����N���F%�!��2���/�B��EF��EF$>��>%

������������������$���;��F�LL�����N���F%�!��2���/�B��EF��EF$>�#(>%

���#��������������$���;��F�LL����F//����%�!��2���/�B��EF��EF$>���>%

���#��������������$���;��F�LL�����;���F%�!��2���/�B��EF��EF$>��(>%

���#��������������$��F//����LL�����;���F%�!��2���/�B��EF��EF$>���>%

���#�#������������$���N��F�LL�����;���F%�!��2���/�B��EF��EF$>#�(>%

���#�'����������

���#�(����������!��2���/�����!�����!������K�@�!���$!��2��%

���#�)�����������������!��2��

���#��������&

���#��������

���#�������������/ �������������9��������

�����+����������

���#�����������������������M�����$%�

���#����������������������������

���#�#���������������7������/��

���#�'�����������������F�/��������F�������-�$%

���#�(������������������F�/��������F�������-��$%

���#�)�����������������C�/�!������F�������-�$%

���#��������������������C�/�!������F�������-��$%

���#������������

���#������������

���#�������������������.M��)�PP����.%%���)���� ����%�'��()���()�$9$�

����

Page 9: Example of-method-with-cyclomatic-complexity-17

�� �������� �����������������������������������������

���#��������������$���CN��F�LL�B��EF��7�$B��EF���7$���C5���F%%;B��EF��EF$>(>%�

%�7������/�B��EF��EF$>�>%

���#��������������$��CN��F�LL����CN���F%�7������/�B��EF��EF$>'(>%

���#�#�����������������.%%��)�PP����.M���)���� ����%�'��()���()�$;9$�

���#�'������������$B��EF��7�$B��EF���7$��C5��F%%;B��EF��EF$>(>%�LL����CN���F%�

7������/�B��EF��EF$>��>%

���#�(������������$��C;��F�LL����CN���F%�7������/�B��EF��EF$>�#(>%

���#�)�����������������.A��)�PP����)%%���.���� ����%�'��()���()�$-89$�

���#��������������$��C;��F�LL�

B��EF��7�$B��EF���7$���C5���F%%;B��EF��EF$>(>%�%�7������/�B��EF��EF$>���>%

���#��������������$��C;��F�LL����C;���F%�7������/�B��EF��EF$>��(>%

���#�������������������)%%��.�PP����.A���)���� ����%�'��()���()�$459$�

���##�������������$B��EF��7�$B��EF���7$��C5��F%%;B��EF��EF$>(>%�LL����C;���F%�

7������/�B��EF��EF$>���>%

���##�������������$��CN��F�LL����C;���F%�7������/�B��EF��EF$>#�(>%

���##�����������

���###����������

���##'����������7������/�����!�����!������K�@�!���$7�����%

���##(�����������������7�����

���##)����������

���##�������&

���##�������

���##�������

���#'����������������!��!!G�.E���!$��0���! C%�

���#'�����������?�����!�����/�����?����$2�����F����5����%

���#'�����������0�������0� C�/�����0������$0���! C%

���#'#����������0���!����$0� C5!����%

���#''������&

���#'(������

���#')���������������!���!��E���!$0�������0���! C5?������%�

���#'�����������0���!����$0���! C5�%

���#'�������&

���#'�������

���#(����������������!�!����E���!$��0���! C%�

���#(�����������0�������0� C�/�����0������$0���! C%

���#(�����������0���!��������$0� C%

���#(#�������������������������$0���!�%

���#('������&

���#((������

���#()���������������!�!����<��E���!�$%�

���#(������������������������ ������$Q�)��QDDD�QFFFFF$�

���#(�����������0���!��2����$%

���#(������������������������ ������� �����

���#)�������&

���#)�������

���#)�������

���#)#������������.���������� � ����������.�����

����)'���������

���#)(�������������FA�2�����E���!�$%�

���#))����������%���������/�����%�����$%

���#)������������������������/�0���!���������$%

����

Page 10: Example of-method-with-cyclomatic-complexity-17

�����������

���#)������������ ���$�����B���6������$%%�

���#)����������������������!!6�����$$?����%����"6�����$%%

���#������������&

���#������������

���#������������FA�2���FE���!��/�����FA�2��$�5����% �

���#�#�����������������FE���!�

���#�'������&

���#�(����������

���#�)����������

���#��������

���#����&

����