Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354535 - Eclipse C/C++ Code complexity
Summary: Eclipse C/C++ Code complexity
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: CDT Codan Inbox CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on: 350856
Blocks:
  Show dependency tree
 
Reported: 2011-08-11 13:36 EDT by andy Mising name CLA
Modified: 2012-03-03 09:49 EST (History)
2 users (show)

See Also:


Attachments
Error rate as a function of complexity (45.46 KB, image/jpeg)
2011-08-16 14:56 EDT, andy Mising name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description andy Mising name CLA 2011-08-11 13:36:25 EDT
Build Identifier: 

Make it possible to have coderules and color coding based on the cylocmatic complexity.

E.g in JSF the limit is 20 in AV Rule 3
http://www.jsf.mil/downloads/documents/JSF_AV_C++_Coding_Standards_Rev_C.doc


Other information on the subject
Links on the subject:
http://www.enerjy.com/blog/?p=198
http://www.scribd.com/doc/49763722/24/Cyclomatic-complexity


Also a thesis made this year in the subject.
http://pure.ltu.se/portal/files/33040726/LTU-EX-2011-32994156.pdf


Based on http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg22725.html



Reproducible: Couldn't Reproduce
Comment 1 andy Mising name CLA 2011-08-16 14:56:00 EDT
Created attachment 201600 [details]
Error rate as a function of complexity

This picture from http://www.enerjy.com/blog/?p=198 exaplains this quite good
Comment 2 andy Mising name CLA 2011-08-16 15:04:54 EDT
One could use color coding on functions based on these old SEI results 

E.g based from http://www.scribd.com/doc/49763722/24/Cyclomatic-complexity
1-10 Simple program, without much risk
11-20 Complexity and moderate risk
21-50 Complex, high risk
Above 50 Not testable, high risk


E.g 
green 1-20
Yellow 21-50
Red 51-

or 

green 1-10
orange 11-20
Yellow 21-50
Red 51 -

What do you think
Comment 3 andy Mising name CLA 2012-03-03 09:49:16 EST
This is quite similar to another case here
https://bugs.eclipse.org/bugs/show_bug.cgi?id=372722