
| Operator |
Number of Occurrences |
| if |
1 |
| < |
1 |
| += |
1 |
| – |
1 |
| int |
1 |
| + |
6 |
| * |
2 |
| / |
4 |
| % |
1 |
| dayray |
1 |
| return |
1 |
| n1 = 11 |
N1 = 20 |
| Operand |
Number of Occurrences |
| month |
3 |
| 3 |
1 |
| 12 |
1 |
| year |
5 |
| day |
1 |
| 1 |
1 |
| 26 |
1 |
| 10 |
1 |
| 4 |
1 |
| 6 |
1 |
| 100 |
1 |
| 400 |
1 |
| 7 |
1 |
| n2 = 13 |
N2 = 19 |
Halstead Metrics
- n1=11,n2=13,N1=20,N2=19
- 程序词汇表长度 Program vocabulary: n=n1+n2=24
- 程序长度或简单长度 Program length: N=N1+N2=39
- 程序的预测长度 Calculated program length:N^ =n1log2n1+n2log2n2=86.15946
- 程序体积或容量 Program volume: V=Nlog2(n)=178.81
- 程序级别Program level: L^ =(2/n1)∗(n2/N2)=2/11∗13/19=0.124
- 程序难度Program difficulty: D=1/L^ =8.03846
- 编程工作量 Effort: E=V∗D=V/L^ = 1437.357
- 语言级别: Lʹ = L^ * L^ * V = 2.74938256
- 编程时间 (hours): T^ = E/(S∗f)=E/(60∗60∗18)=0.02218
- 平均语句大小: N/语句数=39/4=9.75
- 程序中的错误数预测值: B=V/3000=Nlog2(n)/3000=0.0596
相关文章:
-
2021-02-11
-
2021-11-04
-
2021-10-15
-
2021-12-31
-
2021-12-17
-
2022-12-23
-
2021-11-27
-
2021-12-15
猜你喜欢
-
2022-12-23
-
2022-12-23
-
2021-05-20
-
2021-10-05
-
2021-10-25
-
2021-04-12
-
2021-08-20
相关资源
-
下载
2021-06-06
-
下载
2023-03-16
-
下载
2022-12-23