# Global Metrics

path: .metrics.cognitive.sum
old: 3.0
new: 456.0
path: .metrics.cognitive.average
old: 0.05357142857142857
new: 19.0
path: .metrics.cyclomatic.average
old: 1.0515463917525774
new: 9.52
path: .metrics.cyclomatic.sum
old: 102.0
new: 238.0
path: .metrics.halstead.n2
old: 312.0
new: 359.0
path: .metrics.halstead.difficulty
old: 32.66826923076923
new: 113.2158774373259
path: .metrics.halstead.purity_ratio
old: 1.4966505542434834
new: 0.6215009297277473
path: .metrics.halstead.volume
old: 15238.52147266619
new: 44984.83606047501
path: .metrics.halstead.time
old: 27656.45123043984
new: 282944.31588671874
path: .metrics.halstead.vocabulary
old: 339.0
new: 396.0
path: .metrics.halstead.length
old: 1813.0
new: 5213.0
path: .metrics.halstead.N2
old: 755.0
new: 2197.0
path: .metrics.halstead.n1
old: 27.0
new: 37.0
path: .metrics.halstead.N1
old: 1058.0
new: 3016.0
path: .metrics.halstead.level
old: 0.030610743193524647
new: 0.008832683388896407
path: .metrics.halstead.bugs
old: 2.0937494819040023
new: 9.867210604955549
path: .metrics.halstead.effort
old: 497816.1221479172
new: 5092997.685960937
path: .metrics.halstead.estimated_program_length
old: 2713.4274548434355
new: 3239.8843466707467
path: .metrics.mi.mi_sei
old: -42.87860520263887
new: -107.02430698525254
path: .metrics.mi.mi_original
old: -12.507314116601208
new: -56.91351511751072
path: .metrics.nargs.average
old: 0.32142857142857145
new: 3.7916666666666665
path: .metrics.nargs.sum
old: 18.0
new: 91.0
path: .metrics.nom.total
old: 56.0
new: 24.0
path: .metrics.nom.functions
old: 56.0
new: 24.0
path: .metrics.nexits.sum
old: 38.0
new: 74.0
path: .metrics.nexits.average
old: 0.6785714285714286
new: 3.0833333333333335
path: .metrics.loc.sloc
old: 887.0
new: 1409.0
path: .metrics.loc.ploc
old: 417.0
new: 1054.0
path: .metrics.loc.lloc
old: 50.0
new: 543.0
path: .metrics.loc.blank
old: 141.0
new: 171.0
path: .metrics.loc.cloc
old: 329.0
new: 184.0

# Spaces Data

## Minimal test - lines (82, 99)

path: .spaces[2].metrics.nexits.average
old: null
new: 1.0
path: .spaces[2].metrics.nexits.sum
old: 0.0
new: 1.0
path: .spaces[2].metrics.halstead.estimated_program_length
old: null
new: 130.29241368336423
path: .spaces[2].metrics.halstead.N2
old: 1.0
new: 19.0
path: .spaces[2].metrics.halstead.n1
old: 0.0
new: 21.0
path: .spaces[2].metrics.halstead.time
old: 0.0
new: 302.27272727272725
path: .spaces[2].metrics.halstead.N1
old: 0.0
new: 41.0
path: .spaces[2].metrics.halstead.purity_ratio
old: null
new: 2.1715402280560707
path: .spaces[2].metrics.halstead.length
old: 1.0
new: 60.0
path: .spaces[2].metrics.halstead.level
old: null
new: 0.05513784461152882
path: .spaces[2].metrics.halstead.vocabulary
old: 1.0
new: 32.0
path: .spaces[2].metrics.halstead.difficulty
old: 0.0
new: 18.136363636363637
path: .spaces[2].metrics.halstead.bugs
old: 0.0
new: 0.10311607926234052
path: .spaces[2].metrics.halstead.n2
old: 1.0
new: 11.0
path: .spaces[2].metrics.halstead.volume
old: 0.0
new: 300.0
path: .spaces[2].metrics.halstead.effort
old: 0.0
new: 5440.909090909091
path: .spaces[2].metrics.cognitive.average
old: null
new: 4.0
path: .spaces[2].metrics.cognitive.sum
old: 0.0
new: 4.0
path: .spaces[2].metrics.mi.mi_original
old: null
new: 93.3663086538699
path: .spaces[2].metrics.mi.mi_visual_studio
old: null
new: 54.60018049933912
path: .spaces[2].metrics.mi.mi_sei
old: null
new: 59.50735778605596
path: .spaces[2].metrics.cyclomatic.average
old: 1.0
new: 5.0
path: .spaces[2].metrics.cyclomatic.sum
old: 1.0
new: 5.0
path: .spaces[2].metrics.loc.lloc
old: 0.0
new: 12.0
path: .spaces[2].metrics.loc.sloc
old: 1.0
new: 18.0
path: .spaces[2].metrics.loc.ploc
old: 1.0
new: 18.0
path: .spaces[2].metrics.nargs.average
old: null
new: 2.0
path: .spaces[2].metrics.nargs.sum
old: 0.0
new: 2.0
path: .spaces[2].metrics.nom.total
old: 0.0
new: 1.0
path: .spaces[2].metrics.nom.functions
old: 0.0
new: 1.0

### Code

    static nsresult FindSemicolon(nsAString::const_iterator& aSemicolon_iter,
                                  const nsAString::const_iterator& aEnd_iter) {
      bool semicolonFound = false;
      while (aSemicolon_iter != aEnd_iter && !semicolonFound) {
        switch (*aSemicolon_iter) {
          case '\\':
            aSemicolon_iter.advance(2);
            break;
          case ';':
            semicolonFound = true;
            break;
          default:
            ++aSemicolon_iter;
            break;
        }
      }
      return NS_OK;
    }

## Minimal test - lines (51, 51)

path: .spaces[0].metrics.nargs.average
old: null
new: 0.0
path: .spaces[0].metrics.nexits.average
old: null
new: 0.0
path: .spaces[0].metrics.nom.total
old: 0.0
new: 1.0
path: .spaces[0].metrics.nom.functions
old: 0.0
new: 1.0
path: .spaces[0].metrics.mi.mi_visual_studio
old: null
new: 92.40962204246613
path: .spaces[0].metrics.mi.mi_original
old: null
new: 158.02045369261705
path: .spaces[0].metrics.mi.mi_sei
old: null
new: 152.37629276875444
path: .spaces[0].metrics.cognitive.average
old: null
new: 0.0
path: .spaces[0].metrics.halstead.n1
old: 0.0
new: 4.0
path: .spaces[0].metrics.halstead.purity_ratio
old: null
new: 1.6
path: .spaces[0].metrics.halstead.estimated_program_length
old: null
new: 8.0
path: .spaces[0].metrics.halstead.level
old: null
new: 0.5
path: .spaces[0].metrics.halstead.difficulty
old: 0.0
new: 2.0
path: .spaces[0].metrics.halstead.bugs
old: 0.0
new: 0.002712967490108627
path: .spaces[0].metrics.halstead.time
old: 0.0
new: 1.289960052715201
path: .spaces[0].metrics.halstead.N1
old: 0.0
new: 4.0
path: .spaces[0].metrics.halstead.effort
old: 0.0
new: 23.21928094887362
path: .spaces[0].metrics.halstead.vocabulary
old: 1.0
new: 5.0
path: .spaces[0].metrics.halstead.volume
old: 0.0
new: 11.60964047443681
path: .spaces[0].metrics.halstead.length
old: 1.0
new: 5.0

### Code

    nsOSHelperAppService::~nsOSHelperAppService() {}

## Minimal test - lines (101, 148)

path: .spaces[3].metrics.nexits.sum
old: 38.0
new: 4.0
path: .spaces[3].metrics.nexits.average
old: 0.6785714285714286
new: 4.0
path: .spaces[3].metrics.mi.mi_original
old: -10.60631640325208
new: 71.99149904129152
path: .spaces[3].metrics.mi.mi_visual_studio
old: 0.0
new: 42.100291837012584
path: .spaces[3].metrics.mi.mi_sei
old: -40.679005027235426
new: 50.90368706216367
path: .spaces[3].metrics.nargs.average
old: 0.32142857142857145
new: 6.0
path: .spaces[3].metrics.nargs.sum
old: 18.0
new: 6.0
path: .spaces[3].metrics.nom.total
old: 56.0
new: 1.0
path: .spaces[3].metrics.nom.functions
old: 56.0
new: 1.0
path: .spaces[3].metrics.halstead.volume
old: 14731.44514513708
new: 660.6854153373498
path: .spaces[3].metrics.halstead.time
old: 28144.813619393473
new: 1151.964313921533
path: .spaces[3].metrics.halstead.bugs
old: 2.118325365844898
new: 0.2515859780403929
path: .spaces[3].metrics.halstead.estimated_program_length
old: 2452.5051236382637
new: 112.1057163358342
path: .spaces[3].metrics.halstead.purity_ratio
old: 1.3793617118325443
new: 0.8243067377634867
path: .spaces[3].metrics.halstead.n1
old: 27.0
new: 16.0
path: .spaces[3].metrics.halstead.length
old: 1778.0
new: 136.0
path: .spaces[3].metrics.halstead.N2
old: 726.0
new: 51.0
path: .spaces[3].metrics.halstead.n2
old: 285.0
new: 13.0
path: .spaces[3].metrics.halstead.N1
old: 1052.0
new: 85.0
path: .spaces[3].metrics.halstead.difficulty
old: 34.38947368421053
new: 31.384615384615383
path: .spaces[3].metrics.halstead.vocabulary
old: 312.0
new: 29.0
path: .spaces[3].metrics.halstead.effort
old: 506606.6451490825
new: 20735.357650587594
path: .spaces[3].metrics.halstead.level
old: 0.029078665442301803
new: 0.03186274509803922
path: .spaces[3].metrics.cognitive.average
old: 0.05357142857142857
new: 9.0
path: .spaces[3].metrics.cognitive.sum
old: 3.0
new: 9.0
path: .spaces[3].metrics.cyclomatic.average
old: 1.053763440860215
new: 11.0
path: .spaces[3].metrics.cyclomatic.sum
old: 98.0
new: 11.0
path: .spaces[3].metrics.loc.cloc
old: 310.0
new: 4.0
path: .spaces[3].metrics.loc.lloc
old: 50.0
new: 18.0
path: .spaces[3].metrics.loc.ploc
old: 385.0
new: 32.0
path: .spaces[3].metrics.loc.sloc
old: 844.0
new: 48.0
path: .spaces[3].metrics.loc.blank
old: 149.0
new: 12.0

### Code

    static nsresult ParseMIMEType(const nsAString::const_iterator& aStart_iter,
                                  nsAString::const_iterator& aMajorTypeStart,
                                  nsAString::const_iterator& aMajorTypeEnd,
                                  nsAString::const_iterator& aMinorTypeStart,
                                  nsAString::const_iterator& aMinorTypeEnd,
                                  const nsAString::const_iterator& aEnd_iter) {
      nsAString::const_iterator iter(aStart_iter);

      // skip leading whitespace
      while (iter != aEnd_iter && nsCRT::IsAsciiSpace(*iter)) {
        ++iter;
      }

      if (iter == aEnd_iter) {
        return NS_ERROR_INVALID_ARG;
      }

      aMajorTypeStart = iter;

      // find major/minor separator ('/')
      while (iter != aEnd_iter && *iter != '/') {
        ++iter;
      }

      if (iter == aEnd_iter) {
        return NS_ERROR_INVALID_ARG;
      }

      aMajorTypeEnd = iter;

      // skip '/'
      ++iter;

      if (iter == aEnd_iter) {
        return NS_ERROR_INVALID_ARG;
      }

      aMinorTypeStart = iter;

      // find end of minor type, delimited by whitespace or ';'
      while (iter != aEnd_iter && !nsCRT::IsAsciiSpace(*iter) && *iter != ';') {
        ++iter;
      }

      aMinorTypeEnd = iter;

      return NS_OK;
    }

## Minimal test - lines (59, 76)

path: .spaces[1].metrics.loc.ploc
old: 1.0
new: 14.0
path: .spaces[1].metrics.loc.cloc
old: 0.0
new: 2.0
path: .spaces[1].metrics.loc.lloc
old: 0.0
new: 6.0
path: .spaces[1].metrics.loc.sloc
old: 1.0
new: 18.0
path: .spaces[1].metrics.loc.blank
old: 0.0
new: 2.0
path: .spaces[1].metrics.cognitive.average
old: null
new: 0.0
path: .spaces[1].metrics.nargs.average
old: null
new: 4.0
path: .spaces[1].metrics.nargs.sum
old: 0.0
new: 4.0
path: .spaces[1].metrics.nexits.sum
old: 0.0
new: 1.0
path: .spaces[1].metrics.nexits.average
old: null
new: 1.0
path: .spaces[1].metrics.nom.total
old: 0.0
new: 1.0
path: .spaces[1].metrics.nom.functions
old: 0.0
new: 1.0
path: .spaces[1].metrics.halstead.difficulty
old: 0.0
new: 6.105263157894737
path: .spaces[1].metrics.halstead.length
old: 1.0
new: 64.0
path: .spaces[1].metrics.halstead.vocabulary
old: 1.0
new: 27.0
path: .spaces[1].metrics.halstead.estimated_program_length
old: null
new: 104.71062275542812
path: .spaces[1].metrics.halstead.N2
old: 1.0
new: 29.0
path: .spaces[1].metrics.halstead.volume
old: 0.0
new: 304.31280013846197
path: .spaces[1].metrics.halstead.bugs
old: 0.0
new: 0.05037655724171436
path: .spaces[1].metrics.halstead.effort
old: 0.0
new: 1857.9097271611363
path: .spaces[1].metrics.halstead.n1
old: 0.0
new: 8.0
path: .spaces[1].metrics.halstead.N1
old: 0.0
new: 35.0
path: .spaces[1].metrics.halstead.level
old: null
new: 0.16379310344827586
path: .spaces[1].metrics.halstead.n2
old: 1.0
new: 19.0
path: .spaces[1].metrics.halstead.purity_ratio
old: null
new: 1.6361034805535644
path: .spaces[1].metrics.halstead.time
old: 0.0
new: 103.21720706450758
path: .spaces[1].metrics.mi.mi_original
old: null
new: 94.2120856969062
path: .spaces[1].metrics.mi.mi_sei
old: null
new: 85.00781893448084
path: .spaces[1].metrics.mi.mi_visual_studio
old: null
new: 55.094786957255074

### Code

    nsresult nsOSHelperAppService::UnescapeCommand(const nsAString& aEscapedCommand,
                                                   const nsAString& aMajorType,
                                                   const nsAString& aMinorType,
                                                   nsACString& aUnEscapedCommand) {
      LOG(("-- UnescapeCommand"));
      LOG(("Command to escape: '%s'\n",
           NS_LossyConvertUTF16toASCII(aEscapedCommand).get()));
      //  XXX This function will need to get the mime type and various stuff like
      //  that being passed in to work properly

      LOG(
          ("UnescapeCommand really needs some work -- it should actually do some "
           "unescaping\n"));

      CopyUTF16toUTF8(aEscapedCommand, aUnEscapedCommand);
      LOG(("Escaped command: '%s'\n", PromiseFlatCString(aUnEscapedCommand).get()));
      return NS_OK;
    }