simple.cpp 913 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Just produce any code in order to test basic workflow
  2. namespace hmm
  3. {
  4. #define old_prep
  5. #define new_prep
  6. class A
  7. {
  8. A()
  9. {
  10. /* first funtion */
  11. this->m_member = 10;
  12. if (a & b)
  13. {
  14. for (int i = 0; i < 0 && i > 0; i++)
  15. {
  16. int a; // right?
  17. }
  18. }
  19. }
  20. int func(int param = 5)
  21. {
  22. class embeded
  23. {
  24. embeded()
  25. {
  26. int a = 10;
  27. if (true)
  28. {
  29. // again crazy
  30. }
  31. while (a == b); // regressed
  32. }
  33. };
  34. if (a);
  35. }
  36. int never(int how_long = 999)
  37. {
  38. while(true)
  39. {
  40. }
  41. return 2; // slightly modified
  42. }
  43. char new_func()
  44. {
  45. // simple
  46. }
  47. char new_func_complex()
  48. {
  49. if (true) {}
  50. return 'A';
  51. }
  52. /* metrix++: suppress std.code.complexity:cyclomatic */
  53. char new_func_complex_but_suppressed()
  54. {
  55. if (true && false)
  56. {
  57. return 'A';
  58. }
  59. return 'B';
  60. }
  61. int m_member = 10;
  62. };
  63. }