|
2623 | 2623 | // the type of profile |
2624 | 2624 | func getTotal(prof *profile.Profile, idx int) int64 <span class="cov2" title="2">{ |
2625 | 2625 | var total, diffTotal int64 |
2626 | | - for _, sample := range prof.Sample </span><span class="cov10" title="55">{ |
| 2626 | + for _, sample := range prof.Sample </span><span class="cov10" title="57">{ |
2627 | 2627 | var v int64 |
2628 | 2628 | v = sample.Value[idx] |
2629 | 2629 | if v < 0 </span><span class="cov0" title="0">{ |
2630 | 2630 | v = -v |
2631 | 2631 | }</span> |
2632 | | - <span class="cov10" title="55">total += v |
| 2632 | + <span class="cov10" title="57">total += v |
2633 | 2633 | if sample.DiffBaseSample() </span><span class="cov0" title="0">{ |
2634 | 2634 | diffTotal += v |
2635 | 2635 | }</span> |
|
2653 | 2653 | }</span> |
2654 | 2654 | <span class="cov1" title="1">return fmt.Sprintf("%.f%s", metric, defaultMetric)</span> |
2655 | 2655 | } |
2656 | | - <span class="cov6" title="10">for k, u := range typeMap </span><span class="cov10" title="55">{ |
2657 | | - if u >= formatter && (value/u) >= 1.0 </span><span class="cov7" title="19">{ |
| 2656 | + <span class="cov6" title="10">for k, u := range typeMap </span><span class="cov9" title="55">{ |
| 2657 | + if u >= formatter && (value/u) >= 1.0 </span><span class="cov7" title="21">{ |
2658 | 2658 | formatter = u |
2659 | 2659 | mesure = k |
2660 | 2660 | }</span> |
|
5865 | 5865 | func SelectLineWithMinimumDistance(distances map[int]int, startingFrom int) int <span class="cov5" title="8">{ |
5866 | 5866 | minDistance, lineOfMinDistance := constants.MaxInteger, startingFrom |
5867 | 5867 | for line, distance := range distances </span><span class="cov6" title="12">{ |
5868 | | - if distance < minDistance || distance == minDistance && line < lineOfMinDistance </span><span class="cov6" title="12">{ |
| 5868 | + if distance < minDistance || distance == minDistance && line < lineOfMinDistance </span><span class="cov5" title="8">{ |
5869 | 5869 | minDistance = distance |
5870 | 5870 | lineOfMinDistance = line |
5871 | 5871 | }</span> |
|
6390 | 6390 | return err |
6391 | 6391 | }</span> |
6392 | 6392 |
|
6393 | | - <span class="cov7" title="96">for _, change := range changeList.SimilarityIDChangeList </span><span class="cov10" title="802">{ |
| 6393 | + <span class="cov7" title="96">for _, change := range changeList.SimilarityIDChangeList </span><span class="cov10" title="807">{ |
6394 | 6394 | if _, ok := transitionQueryMap[change.QueryID]; ok </span><span class="cov0" title="0">{ |
6395 | 6395 | log.Warn().Msgf( |
6396 | 6396 | "Duplicate query ID found in transition information file %s: %s", d.Name(), change.QueryID) |
6397 | | - }</span> else<span class="cov10" title="802"> { |
| 6397 | + }</span> else<span class="cov10" title="807"> { |
6398 | 6398 | transitionQueryMap[change.QueryID] = change |
6399 | 6399 | }</span> |
6400 | 6400 | } |
|
7316 | 7316 |
|
7317 | 7317 | func (s *FileSystemSourceProvider) walkDir(ctx context.Context, scanPath string, resolved bool, |
7318 | 7318 | sink Sink, resolverSink ResolverSink, extensions model.Extensions) error <span class="cov1" title="3">{ |
7319 | | - return filepath.Walk(scanPath, func(path string, info os.FileInfo, err error) error </span><span class="cov9" title="34293">{ |
| 7319 | + return filepath.Walk(scanPath, func(path string, info os.FileInfo, err error) error </span><span class="cov9" title="34331">{ |
7320 | 7320 | if err != nil </span><span class="cov0" title="0">{ |
7321 | 7321 | return err |
7322 | 7322 | }</span> |
7323 | 7323 |
|
7324 | | - <span class="cov9" title="34293">if shouldSkip, skipFolder := s.checkConditions(info, extensions, path, resolved); shouldSkip </span><span class="cov9" title="33930">{ |
| 7324 | + <span class="cov9" title="34331">if shouldSkip, skipFolder := s.checkConditions(info, extensions, path, resolved); shouldSkip </span><span class="cov9" title="33968">{ |
7325 | 7325 | return skipFolder |
7326 | 7326 | }</span> |
7327 | 7327 |
|
|
7393 | 7393 | } |
7394 | 7394 |
|
7395 | 7395 | func (s *FileSystemSourceProvider) checkConditions(info os.FileInfo, extensions model.Extensions, |
7396 | | - path string, resolved bool) (bool, error) <span class="cov10" title="34312">{ |
| 7396 | + path string, resolved bool) (bool, error) <span class="cov10" title="34350">{ |
7397 | 7397 | s.mu.RLock() |
7398 | 7398 | defer s.mu.RUnlock() |
7399 | 7399 |
|
7400 | | - if info.IsDir() </span><span class="cov8" title="7144">{ |
| 7400 | + if info.IsDir() </span><span class="cov8" title="7154">{ |
7401 | 7401 | // exclude terraform cache folders |
7402 | 7402 | if queryRegexExcludeTerraCache.MatchString(path) </span><span class="cov3" title="13">{ |
7403 | 7403 | log.Info().Msgf("Directory ignored: %s", path) |
|
7408 | 7408 | }</span> |
7409 | 7409 | <span class="cov3" title="13">return true, filepath.SkipDir</span> |
7410 | 7410 | } |
7411 | | - <span class="cov8" title="7131">if f, ok := s.excludes[info.Name()]; ok && containsFile(f, info) </span><span class="cov1" title="1">{ |
| 7411 | + <span class="cov8" title="7141">if f, ok := s.excludes[info.Name()]; ok && containsFile(f, info) </span><span class="cov1" title="1">{ |
7412 | 7412 | log.Info().Msgf("Directory ignored: %s", path) |
7413 | 7413 | return true, filepath.SkipDir |
7414 | 7414 | }</span> |
7415 | | - <span class="cov8" title="7130">_, err := os.Stat(filepath.Join(path, "Chart.yaml")) |
7416 | | - if err != nil || resolved </span><span class="cov8" title="7127">{ |
| 7415 | + <span class="cov8" title="7140">_, err := os.Stat(filepath.Join(path, "Chart.yaml")) |
| 7416 | + if err != nil || resolved </span><span class="cov8" title="7137">{ |
7417 | 7417 | return true, nil |
7418 | 7418 | }</span> |
7419 | 7419 | <span class="cov1" title="3">return false, nil</span> |
7420 | 7420 | } |
7421 | 7421 |
|
7422 | | - <span class="cov9" title="27168">if f, ok := s.excludes[info.Name()]; ok && containsFile(f, info) </span><span class="cov0" title="0">{ |
| 7422 | + <span class="cov9" title="27196">if f, ok := s.excludes[info.Name()]; ok && containsFile(f, info) </span><span class="cov0" title="0">{ |
7423 | 7423 | log.Trace().Msgf("File ignored: %s", path) |
7424 | 7424 | return true, nil |
7425 | 7425 | }</span> |
7426 | | - <span class="cov9" title="27168">ext, _ := utils.GetExtension(path) |
7427 | | - if !extensions.Include(ext) </span><span class="cov9" title="26806">{ |
| 7426 | + <span class="cov9" title="27196">ext, _ := utils.GetExtension(path) |
| 7427 | + if !extensions.Include(ext) </span><span class="cov9" title="26834">{ |
7428 | 7428 | log.Trace().Msgf("File ignored: %s", path) |
7429 | 7429 | return true, nil |
7430 | 7430 | }</span> |
@@ -20877,12 +20877,12 @@ |
20877 | 20877 |
|
20878 | 20878 | // function to check if an identifier is a parameter/variable and add the required keyword if so |
20879 | 20879 | func convertToParamVar(str string, s *BicepVisitor) string <span class="cov5" title="44">{ |
20880 | | - for variable := range s.varList </span><span class="cov7" title="204">{ |
| 20880 | + for variable := range s.varList </span><span class="cov7" title="215">{ |
20881 | 20881 | if variable == str </span><span class="cov3" title="7">{ |
20882 | 20882 | return "variables('" + str + CloseParenthesis |
20883 | 20883 | }</span> |
20884 | 20884 | } |
20885 | | - <span class="cov5" title="37">for parameter := range s.paramList </span><span class="cov9" title="648">{ |
| 20885 | + <span class="cov5" title="37">for parameter := range s.paramList </span><span class="cov9" title="634">{ |
20886 | 20886 | if parameter == str </span><span class="cov4" title="22">{ |
20887 | 20887 | return "parameters('" + str + CloseParenthesis |
20888 | 20888 | }</span> |
@@ -34736,15 +34736,15 @@ |
34736 | 34736 | } |
34737 | 34737 |
|
34738 | 34738 | // MapToStringSlice extract slice of keys from a map[string]string |
34739 | | -func MapToStringSlice(stringKeyMap map[string]string) []string <span class="cov7" title="5257">{ |
| 34739 | +func MapToStringSlice(stringKeyMap map[string]string) []string <span class="cov7" title="5263">{ |
34740 | 34740 | keys := make([]string, len(stringKeyMap)) |
34741 | 34741 |
|
34742 | 34742 | i := 0 |
34743 | | - for k := range stringKeyMap </span><span class="cov10" title="84112">{ |
| 34743 | + for k := range stringKeyMap </span><span class="cov10" title="84208">{ |
34744 | 34744 | keys[i] = k |
34745 | 34745 | i++ |
34746 | 34746 | }</span> |
34747 | | - <span class="cov7" title="5257">return keys</span> |
| 34747 | + <span class="cov7" title="5263">return keys</span> |
34748 | 34748 | } |
34749 | 34749 |
|
34750 | 34750 | var queryHigh = model.QueryResult{ //nolint |
|
0 commit comments