「ファンクションポイント 簡易マクロ」の版間の差分
ナビゲーションに移動
検索に移動
(ページの作成:「==ファンクションポイント 簡易マクロ== [ファンクションポイント][Excel VBA] Const KEY_VALUE_DELIM_CHAR = ":" Const TRANSACTIONAL_TYPE_EI…」) |
|||
(同じ利用者による、間の4版が非表示) | |||
1行目: | 1行目: | ||
− | ==ファンクションポイント 簡易マクロ== | + | ==[[ファンクションポイント 簡易マクロ]]== |
− | [ファンクションポイント][Excel VBA] | + | [[ファンクションポイント]] | [[Excel VBA]] | |
− | Const | + | Const KEY_VALUE_DELIM_CHA[[R]] = ":" |
− | Const | + | Const T[[R]]ANSACTIONAL_TYPE_EI = "EI" |
− | Const | + | Const T[[R]]ANSACTIONAL_TYPE_EO = "EO" |
− | Const | + | Const T[[R]]ANSACTIONAL_TYPE_EQ = "EQ" |
− | Const | + | Const TRANSACTIONAL_[[COM]]PLEXITY_LOW = "LOW" |
− | Const | + | Const TRANSACTIONAL_[[COM]]PLEXITY_AVG = "AVG" |
− | Const | + | Const TRANSACTIONAL_[[COM]]PLEXITY_HIGH = "HIGH" |
16行目: | 16行目: | ||
'トランザクショナルファンクションの複雑度を判定 | 'トランザクショナルファンクションの複雑度を判定 | ||
' | ' | ||
− | Public Function | + | Public Function FP_CALC_[[COM]]PLEXITY(TransactionalFunctionType As Range, det As Range, ftr As Range) As String |
Dim ft As String | Dim ft As String | ||
Dim intDet As Integer | Dim intDet As Integer | ||
Dim intFtr As Integer | Dim intFtr As Integer | ||
− | ft = Split(TransactionalFunctionType(1, 1).Text, | + | ft = Split(TransactionalFunctionType(1, 1).Text, KEY_VALUE_DELIM_CHA[[R]])(0) |
intDet = CInt(Val(det(1, 1).Text)) | intDet = CInt(Val(det(1, 1).Text)) | ||
intFtr = CInt(Val(ftr(1, 1).Text)) | intFtr = CInt(Val(ftr(1, 1).Text)) | ||
Select Case ft | Select Case ft | ||
− | Case | + | Case T[[R]]ANSACTIONAL_TYPE_EI |
ret = CalcComplexityEI(intDet, intFtr) | ret = CalcComplexityEI(intDet, intFtr) | ||
− | Case | + | Case T[[R]]ANSACTIONAL_TYPE_EO |
ret = CalcComplexityEO_EQ(intDet, intFtr) | ret = CalcComplexityEO_EQ(intDet, intFtr) | ||
− | Case | + | Case T[[R]]ANSACTIONAL_TYPE_EQ |
ret = CalcComplexityEO_EQ(intDet, intFtr) | ret = CalcComplexityEO_EQ(intDet, intFtr) | ||
End Select | End Select | ||
− | + | FP_CALC_[[COM]]PLEXITY = ret | |
End Function | End Function | ||
− | Public Function | + | Public Function FP_CALC_FUNCTION_[[POI]]NT(TransactionalFunctionType As Range, complexity As Range) As Integer |
Dim ret As String | Dim ret As String | ||
Dim ft As String | Dim ft As String | ||
Dim comp As String | Dim comp As String | ||
− | ft = Split(TransactionalFunctionType(1, 1).Text, | + | ft = Split(TransactionalFunctionType(1, 1).Text, KEY_VALUE_DELIM_CHA[[R]])(0) |
comp = UCase(Trim(complexity(1, 1).Text)) | comp = UCase(Trim(complexity(1, 1).Text)) | ||
Select Case ft | Select Case ft | ||
− | Case | + | Case T[[R]]ANSACTIONAL_TYPE_EI |
Select Case comp | Select Case comp | ||
− | Case | + | Case TRANSACTIONAL_[[COM]]PLEXITY_LOW |
ret = "3" | ret = "3" | ||
− | Case | + | Case TRANSACTIONAL_[[COM]]PLEXITY_AVG |
ret = "4" | ret = "4" | ||
− | Case | + | Case TRANSACTIONAL_[[COM]]PLEXITY_HIGH |
ret = "6" | ret = "6" | ||
End Select | End Select | ||
− | Case | + | Case T[[R]]ANSACTIONAL_TYPE_EO |
Select Case comp | Select Case comp | ||
− | Case | + | Case TRANSACTIONAL_[[COM]]PLEXITY_LOW |
ret = "4" | ret = "4" | ||
− | Case | + | Case TRANSACTIONAL_[[COM]]PLEXITY_AVG |
ret = "5" | ret = "5" | ||
− | Case | + | Case TRANSACTIONAL_[[COM]]PLEXITY_HIGH |
ret = "7" | ret = "7" | ||
End Select | End Select | ||
− | Case | + | Case T[[R]]ANSACTIONAL_TYPE_EQ |
Select Case comp | Select Case comp | ||
− | Case | + | Case TRANSACTIONAL_[[COM]]PLEXITY_LOW |
ret = "3" | ret = "3" | ||
− | Case | + | Case TRANSACTIONAL_[[COM]]PLEXITY_AVG |
ret = "4" | ret = "4" | ||
− | Case | + | Case TRANSACTIONAL_[[COM]]PLEXITY_HIGH |
ret = "6" | ret = "6" | ||
End Select | End Select | ||
75行目: | 75行目: | ||
− | + | FP_CALC_FUNCTION_[[POI]]NT = CInt(Val(ret)) | |
End Function | End Function | ||
86行目: | 86行目: | ||
Dim ret As String | Dim ret As String | ||
− | If ftr | + | If ftr <= 1 Then |
− | If det | + | If det <= 4 Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_LOW |
End If | End If | ||
− | If 5 | + | If 5 <= det And det <= 15 Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_LOW |
End If | End If | ||
− | If 16 | + | If 16 <= det Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_AVG |
End If | End If | ||
End If | End If | ||
If ftr = 2 Then | If ftr = 2 Then | ||
− | If det | + | If det <= 4 Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_LOW |
End If | End If | ||
− | If 5 | + | If 5 <= det And det <= 15 Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_AVG |
End If | End If | ||
− | If 16 | + | If 16 <= det Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_HIGH |
End If | End If | ||
End If | End If | ||
− | If 3 | + | If 3 <= ftr Then |
− | If det | + | If det <= 4 Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_AVG |
End If | End If | ||
− | If 5 | + | If 5 <= det And det <= 15 Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_HIGH |
End If | End If | ||
− | If 16 | + | If 16 <= det Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_HIGH |
End If | End If | ||
End If | End If | ||
130行目: | 130行目: | ||
Dim ret As String | Dim ret As String | ||
− | If ftr | + | If ftr <= 1 Then |
− | If det | + | If det <= 5 Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_LOW |
End If | End If | ||
− | If 6 | + | If 6 <= det And det <= 19 Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_LOW |
End If | End If | ||
− | If 20 | + | If 20 <= det Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_AVG |
End If | End If | ||
End If | End If | ||
− | If 2 | + | If 2 <= ftr And ftr <= 3 Then |
− | If det | + | If det <= 5 Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_LOW |
End If | End If | ||
− | If 6 | + | If 6 <= det And det <= 19 Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_AVG |
End If | End If | ||
− | If 20 | + | If 20 <= det Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_HIGH |
End If | End If | ||
End If | End If | ||
− | If 4 | + | If 4 <= ftr Then |
− | If det | + | If det <= 5 Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_AVG |
End If | End If | ||
− | If 6 | + | If 6 <= det And det <= 19 Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_HIGH |
End If | End If | ||
− | If 20 | + | If 20 <= det Then |
− | ret = | + | ret = TRANSACTIONAL_[[COM]]PLEXITY_HIGH |
End If | End If | ||
End If | End If |
2020年2月16日 (日) 04:19時点における最新版
ファンクションポイント 簡易マクロ
ファンクションポイント | Excel VBA |
Const KEY_VALUE_DELIM_CHAR = ":" Const TRANSACTIONAL_TYPE_EI = "EI" Const TRANSACTIONAL_TYPE_EO = "EO" Const TRANSACTIONAL_TYPE_EQ = "EQ" Const TRANSACTIONAL_COMPLEXITY_LOW = "LOW" Const TRANSACTIONAL_COMPLEXITY_AVG = "AVG" Const TRANSACTIONAL_COMPLEXITY_HIGH = "HIGH" ' 'トランザクショナルファンクションの複雑度を判定 ' Public Function FP_CALC_COMPLEXITY(TransactionalFunctionType As Range, det As Range, ftr As Range) As String Dim ft As String Dim intDet As Integer Dim intFtr As Integer ft = Split(TransactionalFunctionType(1, 1).Text, KEY_VALUE_DELIM_CHAR)(0) intDet = CInt(Val(det(1, 1).Text)) intFtr = CInt(Val(ftr(1, 1).Text)) Select Case ft Case TRANSACTIONAL_TYPE_EI ret = CalcComplexityEI(intDet, intFtr) Case TRANSACTIONAL_TYPE_EO ret = CalcComplexityEO_EQ(intDet, intFtr) Case TRANSACTIONAL_TYPE_EQ ret = CalcComplexityEO_EQ(intDet, intFtr) End Select FP_CALC_COMPLEXITY = ret End Function Public Function FP_CALC_FUNCTION_POINT(TransactionalFunctionType As Range, complexity As Range) As Integer Dim ret As String Dim ft As String Dim comp As String ft = Split(TransactionalFunctionType(1, 1).Text, KEY_VALUE_DELIM_CHAR)(0) comp = UCase(Trim(complexity(1, 1).Text)) Select Case ft Case TRANSACTIONAL_TYPE_EI Select Case comp Case TRANSACTIONAL_COMPLEXITY_LOW ret = "3" Case TRANSACTIONAL_COMPLEXITY_AVG ret = "4" Case TRANSACTIONAL_COMPLEXITY_HIGH ret = "6" End Select Case TRANSACTIONAL_TYPE_EO Select Case comp Case TRANSACTIONAL_COMPLEXITY_LOW ret = "4" Case TRANSACTIONAL_COMPLEXITY_AVG ret = "5" Case TRANSACTIONAL_COMPLEXITY_HIGH ret = "7" End Select Case TRANSACTIONAL_TYPE_EQ Select Case comp Case TRANSACTIONAL_COMPLEXITY_LOW ret = "3" Case TRANSACTIONAL_COMPLEXITY_AVG ret = "4" Case TRANSACTIONAL_COMPLEXITY_HIGH ret = "6" End Select End Select FP_CALC_FUNCTION_POINT = CInt(Val(ret)) End Function ' ' EIの複雑度を計算 ' Private Function CalcComplexityEI(det As Integer, ftr As Integer) As String Dim ret As String If ftr <= 1 Then If det <= 4 Then ret = TRANSACTIONAL_COMPLEXITY_LOW End If If 5 <= det And det <= 15 Then ret = TRANSACTIONAL_COMPLEXITY_LOW End If If 16 <= det Then ret = TRANSACTIONAL_COMPLEXITY_AVG End If End If If ftr = 2 Then If det <= 4 Then ret = TRANSACTIONAL_COMPLEXITY_LOW End If If 5 <= det And det <= 15 Then ret = TRANSACTIONAL_COMPLEXITY_AVG End If If 16 <= det Then ret = TRANSACTIONAL_COMPLEXITY_HIGH End If End If If 3 <= ftr Then If det <= 4 Then ret = TRANSACTIONAL_COMPLEXITY_AVG End If If 5 <= det And det <= 15 Then ret = TRANSACTIONAL_COMPLEXITY_HIGH End If If 16 <= det Then ret = TRANSACTIONAL_COMPLEXITY_HIGH End If End If CalcComplexityEI = ret End Function ' ' EO、EQ の複雑度を計算 ' Private Function CalcComplexityEO_EQ(det As Integer, ftr As Integer) As String Dim ret As String If ftr <= 1 Then If det <= 5 Then ret = TRANSACTIONAL_COMPLEXITY_LOW End If If 6 <= det And det <= 19 Then ret = TRANSACTIONAL_COMPLEXITY_LOW End If If 20 <= det Then ret = TRANSACTIONAL_COMPLEXITY_AVG End If End If If 2 <= ftr And ftr <= 3 Then If det <= 5 Then ret = TRANSACTIONAL_COMPLEXITY_LOW End If If 6 <= det And det <= 19 Then ret = TRANSACTIONAL_COMPLEXITY_AVG End If If 20 <= det Then ret = TRANSACTIONAL_COMPLEXITY_HIGH End If End If If 4 <= ftr Then If det <= 5 Then ret = TRANSACTIONAL_COMPLEXITY_AVG End If If 6 <= det And det <= 19 Then ret = TRANSACTIONAL_COMPLEXITY_HIGH End If If 20 <= det Then ret = TRANSACTIONAL_COMPLEXITY_HIGH End If End If CalcComplexityEO_EQ = ret End Function
© 2006 矢木浩人