package com.hartwig.healthchecks.nesbit.extractor;

import com.hartwig.healthchecks.nesbit.model.VCFType;

import org.jetbrains.annotations.NotNull;

final class VCFExtractorFunctions {

    private static final int ALT_INDEX = 4;
    private static final int REF_INDEX = 3;
    private static final String MULTIPLE_ALTS_IDENTIFIER = ",";

    private VCFExtractorFunctions() {
    }

    @NotNull
    static VCFType getVCFType(@NotNull final String[] values) {
        final String refValue = values[REF_INDEX];
        final String altValue = values[ALT_INDEX];

        final String[] allAlts = altValue.split(MULTIPLE_ALTS_IDENTIFIER);

        return allAlts[0].length() != refValue.length() ? VCFType.INDELS : VCFType.SNP;

        //        VCFType type = VCFType.SNP;
        //
        //        for (String alt : allAlts) {
        //            if (refValue.length() != alt.length()) {
        //                type = VCFType.INDELS;
        //            }
        //        }
        //        return type;
    }
}

@@ -638,107 +638,8 @@
 );%0A%0A
-        return allAlts%5B0%5D.length() != refValue.length() ? VCFType.INDELS : VCFType.SNP;%0A%0A        //
     
@@ -674,29 +674,9 @@
 NP;%0A
-        //%0A        //
+%0A
     
@@ -706,32 +706,24 @@
 llAlts) %7B%0A  
-      //
             
@@ -720,18 +720,16 @@
         
-  
 if (refV
@@ -762,25 +762,16 @@
 h()) %7B%0A 
-       //
         
@@ -777,17 +777,16 @@
         
- 
 type = V
@@ -801,25 +801,16 @@
 NDELS;%0A 
-       //
         
@@ -808,25 +808,24 @@
             
- 
 %7D%0A        //
@@ -826,30 +826,10 @@
     
-//        %7D%0A        //
+%7D%0A
     

Revert to original solution for vcf type determination