Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Sonar
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<table class="confluenceTable"><tbody><tr><th class="confluenceTh">Language</th><th class="confluenceTh">Notes</th></tr><tr><td colspan="1" class="confluenceTd"><strong>ABAP</strong></td><td colspan="1" class="confluenceTd">The following keywords increase the complexity by one: AND, CATCH, CONTINUE, DO, ELSEIF, IF, LOOP, LOOPAT, OR, PROVIDE, SELECT…ENDSELECT, TRY, WHEN, WHILE.</td></tr><tr><td colspan="1" class="confluenceTd"><strong>C/C++</strong></td><td colspan="1" class="confluenceTd"><p>The complexity gets incremented by one for: function definitions, while, do while, for, throw statements, return (except if it is the last statement of a function), swtich, case, default, && operator, || operator, ? ternary operator, catch, break, continue, goto.</p></td></tr><tr><td class="confluenceTd"><strong>Cobol</strong></td><td class="confluenceTd">The following commands increase the complexity by one: 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 and EXEC CICS RETURN.</td></tr><tr><td class="confluenceTd"><strong>Java</strong></td><td class="confluenceTd"><ul><li>Keywords incrementing the complexity: if, for, while, case, catch, throw, return (that is not the last statement of a method), &&, ||, ?</li><li><span>else, default, and finally keywords do not increment the complexity. On the other hand, 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).</span><span>Notes:</span></li><li><span> </span><a class="confluence-link" href="#metric_accessors" data-anchor="metric_accessors" data-linked-resource-default-alias="metric_accessors" data-base-url="http://docs.codehaus.org">accessors</a><span> are not considered as </span><a class="confluence-link" href="#metric_function" data-anchor="metric_function" data-linked-resource-default-alias="metric_function" data-base-url="http://docs.codehaus.org">methods</a><span> and so do not increment the complexity</span></li></ul><p><br class="atl-forced-newline" />Example: the following method has a complexity of 5</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>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; } </pre></td></tr></table></td></tr><tr><td colspan="1" class="confluenceTd"><strong>PL/I</strong></td><td colspan="1" class="confluenceTd"><span style="color: rgb(25,25,25);">The following keywords increase the complexity by one: PROC, PROCEDURE, GOTO, GO TO, RETURN, DO, IF, WHEN, |, !, |=, !=, &, &=.</span></td></tr><tr><td colspan="1" class="confluenceTd"><strong>PL/SQL</strong></td><td colspan="1" class="confluenceTd"><span style="color: rgb(25,25,25);">The complexity gets incremented by one for: 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)</span></td></tr><tr><td colspan="1" class="confluenceTd"><strong>VB.NET</strong></td><td colspan="1" class="confluenceTd"><span style="color: rgb(25,25,25);">The complexity gets incremented by one for:</span> method or constructor declaration (Sub, Function), AndAlso, Case, Continue, End, Error, Exit, If, Loop, On Error, GoTo, OrElse, Resume, Return (except if it is the last statement of a function), Stop, Throw, Try.</td></tr></tbody></table>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced