doujing6436 2016-06-29 10:40
浏览 26
已采纳

了解php静态代码分析结果

I need an advice. Cant found any information about static code analysis results. For example, i use phploc, and generate report. But it's a good results or a bad i dont know. As I understand what utility I wouldn't have enjoyed report must be the same. After seeing the results, you can solve the bad code or not.

Where i can see info about all lines in this results?

Thanks for help!

All what i found is: Maximum Method Complexity must not be greater then 10. CyclomaticComplexity - 1-4 is low - 5-7 indicates moderate complexity - 8-10 is high complexity - 11+ is very high complexity.

Directories                                          1
Files                                                3

Size
  Lines of Code (LOC)                              296
  Comment Lines of Code (CLOC)                     116 (39.19%)
  Non-Comment Lines of Code (NCLOC)                180 (60.81%)
  Logical Lines of Code (LLOC)                      50 (16.89%)
    Classes                                         43 (86.00%)
      Average Class Length                          14
        Minimum Class Length                         0
        Maximum Class Length                        43
      Average Method Length                          3
        Minimum Method Length                        1
        Maximum Method Length                        7
    Functions                                        0 (0.00%)
      Average Function Length                        0
    Not in classes or functions                      7 (14.00%)

Cyclomatic Complexity
  Average Complexity per LLOC                     0.22
  Average Complexity per Class                    4.67
    Minimum Class Complexity                      1.00
    Maximum Class Complexity                     12.00
  Average Complexity per Method                   2.00
    Minimum Method Complexity                     1.00
    Maximum Method Complexity                     4.00

Dependencies
  Global Accesses                                    0
    Global Constants                                 0 (0.00%)
    Global Variables                                 0 (0.00%)
    Super-Global Variables                           0 (0.00%)
  Attribute Accesses                                16
    Non-Static                                      16 (100.00%)
    Static                                           0 (0.00%)
  Method Calls                                      22
    Non-Static                                      22 (100.00%)
    Static                                           0 (0.00%)

Structure
  Namespaces                                         2
  Interfaces                                         0
  Traits                                             0
  Classes                                            3
    Abstract Classes                                 0 (0.00%)
    Concrete Classes                                 3 (100.00%)
  Methods                                           11
    Scope
      Non-Static Methods                            11 (100.00%)
      Static Methods                                 0 (0.00%)
    Visibility
      Public Methods                                10 (90.91%)
      Non-Public Methods                             1 (9.09%)
  Functions                                          0
    Named Functions                                  0 (0.00%)
    Anonymous Functions                              0 (0.00%)
  Constants                                          1
    Global Constants                                 0 (0.00%)
    Class Constants                                  1 (100.00%)
  • 写回答

1条回答 默认 最新

  • dongyuan9149 2016-07-07 13:37
    关注

    Here are some more sources / links about the metrics , results and info in an old but similar question. If you want more info about mistakes and code smells I would recommand you look intro: PHP_CodeSniffer and PHP_Depend

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?