Good day coding godz,
I am trying to clean up some code and was wondering how to reduce the Cylcomatic Complexity on a method I have created. This method is used during an Import of a CSV file. One of the fields in the CSV file is a license type that is a string (ie "BFI Supervised Lender - Website #2 License") I am converting this to a Integer (1,2,3 or 4) that will be saved to the Database to reference the type of industry based on license type.
Below is my method. Would appreciate some tips for a shade tree VB.NET coder...
Private Function CheckIndustryType(LicName)
Dim VAR_IndType As Integer
Select Case Text_LicName
Case "BFI Level I Check Cashing - Branch License"
VAR_IndType = 3
Case "BFI Level II Check Cashing - Branch Certificate"
VAR_IndType = 3
Case "BFI Supervised Lender - Branch License"
VAR_IndType = 1
Case "BFI Deferred Presentment - Branch License"
VAR_IndType = 3
Case "BFI Supervised Lender - Website #1 License"
VAR_IndType = 1
Case "BFI Supervised Lender - Website #2 License"
VAR_IndType = 1
Case "BFI Supervised Lender - Website #3 License"
VAR_IndType = 1
Case "BFI Supervised Lender - Website #4 License"
VAR_IndType = 1
Case "BFI Supervised Lender - Website #5 License"
VAR_IndType = 1
Case "BFI Supervised Lender - Website #6 License"
VAR_IndType = 1
Case "BFI Level II Check Cashing - Company License"
VAR_IndType = 3
Case "BFI Level I Check Cashing - Company License"
VAR_IndType = 3
Case "fI Branch Mortgage Lender/Servicer"
VAR_IndType = 2
Case "BFI Branch Mortgage Lender/Servicer - Other Trade Name #1"
VAR_IndType = 2
Case "BFI Branch Mortgage Lender/Servicer - Other Trade Name #2"
VAR_IndType = 2
Case "BFI Branch Mortgage Lender/Servicer - Other Trade Name #3"
VAR_IndType = 2
Case "BFI Branch Mortgage Lender/Servicer - Other Trade Name #4"
VAR_IndType = 2
Case "BFI Branch Mortgage Lender/Servicer - Other Trade Name #5"
VAR_IndType = 2
Case "BFI Branch Mortgage Lender/Servicer - Other Trade Name #6"
VAR_IndType = 2
Case "BFI Mortgage Lender / Servicer License"
VAR_IndType = 2
Case "BFI Mortgage Lender/Servicer License - Other Trade Name #1"
VAR_IndType = 2
Case "BFI Mortgage Lender/Servicer License - Other Trade Name #2"
VAR_IndType = 2
Case "BFI Mortgage Lender/Servicer License - Other Trade Name #3"
VAR_IndType = 2
Case "BFI Mortgage Lender/Servicer License - Other Trade Name #4"
VAR_IndType = 2
Case "BFI Mortgage Lender/Servicer License - Other Trade Name #5"
VAR_IndType = 2
Case "BFI Mortgage Lender/Servicer License - Other Trade Name #6"
VAR_IndType = 2
Case Else
VAR_IndType = 4
End Select
Return VAR_IndType
End Function