deepsourcestatus / test-repository

if condition can be moved inside the for loop as an enumerator guard SC-R1062
Anti-pattern
Minor
1 occurrence in this check
if can be moved inside the loop
64      for (_ <- array.indices) {
65        var swap = false
66
67        for (j <- 0 to array.length - 2) {68          if (array(j) > array(j + 1)) {69            val temp = array(j)70            array(j) = array(j + 1)71            array(j + 1) = temp72            swap = true73          }74        }75        if (!swap) {
76          break()
77        }