Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel
borderColor#888888#C3CCD7
bgColor#FCFCFC

Table of Contents

Table of Contents
indent16px



LanguagesNotes
ABAPThe following keywords increase the complexity by one: AND, CATCH, CONTINUE, DO, ELSEIF, IF, LOOP, LOOPAT, OR, PROVIDE, SELECT…ENDSELECT, TRY, WHEN, WHILE

다음 키워드를 만날 때마다 복잡도가 1씩 증가합니다: ANDCATCH, CONTINUE, DO, ELSEIF, IF, LOOP, LOOPAT, OR, PROVIDE, SELECTENDSELECT, TRY, WHEN, WHILE

C/C++/Objective-C

The complexity gets incremented by one for: function definitions다음 구문 혹은 키워드를 만날 때마다 복잡도가 1씩 증가합니다: 함수 선언(function definitions)whiledo while, for, throw statements 구문return (except if it is the last statement of a function함수의 가장 마지막 구문인 경우는 제외), switchcasedefault&& operator 연산자|| operator 연산자? ternary operator 삼항 연산자catchbreakcontinuegoto.

CobolThe following commands increase the complexity by one (except when they are used in a copybook다음 명령어를 만날 때마다 복잡도가 1씩 증가합니다(해당 키워드가 카피북(copybook)에서 사용되는 경우는 제외): ALSO, ALTER, AND, DEPENDING, END_OF_PAGE, ENTRY, EOP, EXCEPTION, EXIT, GOBACK, CONTINUE, IF, INVALID, OR, OVERFLOW, SIZE, STOP, TIMES, UNTIL, USE, VARYING, WHEN, EXEC CICS HANDLE, EXEC CICS LINK, EXEC CICS XCTL, EXEC  EXEC CICS RETURN
Java
  • Keywords incrementing the complexity다음 키워드를 만날 때마다 복잡도가 1씩 증가합니다ifforwhilecasecatchthrowreturn (that is not the last statement of a method함수의 가장 마지막 구문인 경우는 제외), && 연산자|| 연산자? 삼항연산자
  • Notes주의:
    • elsedefault, and finally keywords do not increment the complexity.
    • a simple method with a switch statement and a huge block of case statements can have a surprisingly high complexity value (still it has the same value when converting a switch block to an equivalent sequence of if statements).
Example: the following method has a complexity of 5
    • finally 키워드는 복잡도를 증가시키지 않습니다.
    • 하나의 switch 구문을 포함한 간단한 메소드 및 거대한 case 구문 블럭의 복잡도는 기하급수적으로 증가할 수 있습니다(해당 switch 블록을 동일한 시퀀스의 if 구문으로 변경해도 복잡도 값은 동일합니다).


예: 다음 메소드의 복잡도 값은 5입니다.

public void process(Car myCar){          // +1
    if(myCar.isNotMine()){               // +1
         return;                         // +1
    }
    car.paint("red");
    car.changeWheel();
    while(car.hasGazol() && car.getDriver().isNotStressed()){   // +2
         car.drive();
    }
    return;
}


JavaScript, PHP

Complexity is incremented by one for each다음의 경우, 복잡도가 1씩 증가합니다:

  • function (i.e non-abstract and non-anonymous constructors, functions, procedures or methods)
  • if statement함수 (즉, 비-추상화 및 비-임의 생성자(constructor), 함수(function), 프로시져(procedure) 혹은 메소드(method))
  • if 구문
  • short-circuit (AKA lazy) logical conjunction (&&)
  • short-circuit (AKA lazy) logical disjunction (||)
  • ternary conditional expressions
  • loop
  • case clauses of a switch statement
  • throw and catch statement
  • return statement (except when it is the very last statement of a function삼항 조건문
  • 루프(loop)
  • switch 구문의 case 조건
  • throw & catch 구문
  • return 구문(함수의 마지막 구문인 경우는 제외)
  • go to statement 구문 (only for PHP 만 해당)
PL/IThe following keywords increase the complexity by one다음 키워드를 만날 때마다 복잡도가 1씩 증가합니다PROC, PROCEDURE, GOTO, GO TO, RETURN, DO, IF, WHEN, |, !, |=, !=, &, &=
PL/SQLThe complexity gets incremented by one for다음의 경우 복잡도가 1씩 증가합니다: the main PL/SQL anonymous block (not inner ones), create procedure, create trigger, procedure_definition, basic loop statement, when_clause_statement (the “when” of simple_case_statement and searched_case_statement), continue_statement, cursor_for_loop_statement, continue_exit_when_clause (The “WHEN” part of the continue and exit statements), exception_handler (every individual “WHEN”), exit_statement, for_loop_statement, forall_statement, if_statement, elsif_clause, raise_statement, return_statement, while_loop_statement, and_expression (“and” reserved word used within PL/SQL expressions), or_expression (“or” reserved word used within PL/SQL expressions), when_clause_expression (the “when” of simple_case_expression and searched_case_expression)
VB.NETThe complexity gets incremented by one for: method or constructor declaration (Sub다음의 경우 복잡도가 1씩 증가합니다: 메소드 혹은 생성자 선언(SubFunction), AndAlso, Case Case, Continue, End, Error Error, Exit Exit, If If, Loop Loop, On Error, GoTo, OrElse, Resume, Return (except if it is the last statement of a function함수의 마지막 구문인 경우는 제외), Stop, Throw Throw, Try Try.
Web

Complexity of the web page is measured by counting the decision tags (such as if and forEach) and boolean operators in expressions 결정 태그(ifforEach 등) 및 불리언 연산자(&& and  ||), plus one for the body of the document. The decision tags and the operators are configurable through the Complexity rule문서의 body를 만날 때마다 복잡도가 1씩 증가합니다. 결정 태그 및 연산자는 Complexity rule을 통해 지정할 수 있습니다.