Global Metrics

path: .metrics.loc.blank
old: 5.0
new: 31.0

path: .metrics.loc.sloc
old: 37.0
new: 178.0

path: .metrics.loc.lloc
old: 12.0
new: 34.0

path: .metrics.loc.cloc
old: 1.0
new: 41.0

path: .metrics.loc.ploc
old: 31.0
new: 106.0

path: .metrics.mi.mi_original
old: 77.90682120771214
new: 35.26317088117814

path: .metrics.mi.mi_sei
old: 50.51383952122752
new: 12.580679959412194

path: .metrics.mi.mi_visual_studio
old: 45.559544565913534
new: 20.621737357414116

path: .metrics.nom.closures
old: 0.0
new: 3.0

path: .metrics.nom.functions
old: 7.0
new: 25.0

path: .metrics.nom.total
old: 7.0
new: 28.0

path: .metrics.cyclomatic.sum
old: 12.0
new: 35.0

path: .metrics.cyclomatic.average
old: 1.2
new: 1.25

path: .metrics.halstead.n1
old: 13.0
new: 27.0

path: .metrics.halstead.estimated_program_length
old: 96.2114326716684
new: 542.3294357634368

path: .metrics.halstead.purity_ratio
old: 0.9918704399141072
new: 0.7917218040342143

path: .metrics.halstead.time
old: 430.6125052897034
new: 13649.96195094863

path: .metrics.halstead.effort
old: 7751.025095214661
new: 245699.3151170753

path: .metrics.halstead.volume
old: 455.9426526596859
new: 4500.3510917067

path: .metrics.halstead.vocabulary
old: 26.0
new: 95.0

path: .metrics.halstead.bugs
old: 0.13055239415497774
new: 1.307619462246912

path: .metrics.halstead.difficulty
old: 17.0
new: 54.59558823529411

path: .metrics.halstead.N2
old: 34.0
new: 275.0

path: .metrics.halstead.n2
old: 13.0
new: 68.0

path: .metrics.halstead.N1
old: 63.0
new: 410.0

path: .metrics.halstead.level
old: 0.058823529411764705
new: 0.01831649831649832

path: .metrics.halstead.length
old: 97.0
new: 685.0

path: .metrics.nargs.sum
old: 1.0
new: 14.0

path: .metrics.nargs.average
old: 0.14285714285714285
new: 0.5

path: .metrics.cognitive.average
old: 0.2857142857142857
new: 0.14285714285714285

path: .metrics.cognitive.sum
old: 2.0
new: 4.0

path: .metrics.nexits.sum
old: 6.0
new: 15.0

path: .metrics.nexits.average
old: 0.8571428571428571
new: 0.5357142857142857

Spaces Data

Minimal test - lines (43, 48)

path: .spaces[0].spaces[0].spaces[4].metrics.cognitive.average
old: 2.0
new: 0.0

path: .spaces[0].spaces[0].spaces[4].metrics.cognitive.sum
old: 2.0
new: 0.0

path: .spaces[0].spaces[0].spaces[4].metrics.cyclomatic.sum
old: 3.0
new: 1.0

path: .spaces[0].spaces[0].spaces[4].metrics.cyclomatic.average
old: 3.0
new: 1.0

path: .spaces[0].spaces[0].spaces[4].metrics.nexits.sum
old: 3.0
new: 1.0

path: .spaces[0].spaces[0].spaces[4].metrics.nexits.average
old: 3.0
new: 1.0

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.difficulty
old: 8.333333333333334
new: 9.6

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.n2
old: 6.0
new: 5.0

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.n1
old: 10.0
new: 8.0

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.bugs
old: 0.03258841518748867
new: 0.03321496588380153

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.time
old: 53.70370370370371
new: 55.25989979090698

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.N1
old: 19.0
new: 16.0

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.vocabulary
old: 16.0
new: 13.0

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.level
old: 0.12
new: 0.10416666666666669

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.length
old: 29.0
new: 28.0

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.purity_ratio
old: 1.680312274248295
new: 1.2717728740870289

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.estimated_program_length
old: 48.72905595320056
new: 35.60964047443681

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.N2
old: 10.0
new: 12.0

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.volume
old: 116.0
new: 103.6123121079506

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.effort
old: 966.6666666666669
new: 994.6781962363256

path: .spaces[0].spaces[0].spaces[4].metrics.loc.sloc
old: 9.0
new: 6.0

path: .spaces[0].spaces[0].spaces[4].metrics.loc.lloc
old: 6.0
new: 4.0

path: .spaces[0].spaces[0].spaces[4].metrics.loc.ploc
old: 9.0
new: 6.0

path: .spaces[0].spaces[0].spaces[4].metrics.mi.mi_original
old: 109.99629285340016
new: 117.6120845378796

path: .spaces[0].spaces[0].spaces[4].metrics.mi.mi_sei
old: 83.29571380197116
new: 94.07933897880416

path: .spaces[0].spaces[0].spaces[4].metrics.mi.mi_visual_studio
old: 64.32531745812875
new: 68.77899680577755

Code

  Command &operator=(const Command &Other) {
    Args = Other.Args;
    CombinedOutAndErr = Other.CombinedOutAndErr;
    OutputFile = Other.OutputFile;
    return *this;
  }

Minimal test - lines (23, 176)

path: .spaces[0].metrics.cognitive.average
old: 0.2857142857142857
new: 0.14285714285714285

path: .spaces[0].metrics.cognitive.sum
old: 2.0
new: 4.0

path: .spaces[0].metrics.nexits.sum
old: 6.0
new: 15.0

path: .spaces[0].metrics.nexits.average
old: 0.8571428571428571
new: 0.5357142857142857

path: .spaces[0].metrics.loc.ploc
old: 28.0
new: 97.0

path: .spaces[0].metrics.loc.lloc
old: 12.0
new: 34.0

path: .spaces[0].metrics.loc.sloc
old: 30.0
new: 154.0

path: .spaces[0].metrics.loc.blank
old: 2.0
new: 28.0

path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 29.0

path: .spaces[0].metrics.nom.total
old: 7.0
new: 28.0

path: .spaces[0].metrics.nom.functions
old: 7.0
new: 25.0

path: .spaces[0].metrics.nom.closures
old: 0.0
new: 3.0

path: .spaces[0].metrics.halstead.difficulty
old: 17.333333333333332
new: 56.284615384615385

path: .spaces[0].metrics.halstead.n1
old: 13.0
new: 27.0

path: .spaces[0].metrics.halstead.bugs
old: 0.12938036822089063
new: 1.3229999139577109

path: .spaces[0].metrics.halstead.n2
old: 12.0
new: 65.0

path: .spaces[0].metrics.halstead.vocabulary
old: 25.0
new: 92.0

path: .spaces[0].metrics.halstead.time
old: 424.8268440275395
new: 13891.498644833971

path: .spaces[0].metrics.halstead.length
old: 95.0
new: 681.0

path: .spaces[0].metrics.halstead.N2
old: 32.0
new: 271.0

path: .spaces[0].metrics.halstead.volume
old: 441.1663380285988
new: 4442.545692074826

path: .spaces[0].metrics.halstead.estimated_program_length
old: 91.12526634448808
new: 519.8358704052632

path: .spaces[0].metrics.halstead.N1
old: 63.0
new: 410.0

path: .spaces[0].metrics.halstead.level
old: 0.057692307692307696
new: 0.017766844335110017

path: .spaces[0].metrics.halstead.purity_ratio
old: 0.9592133299419796
new: 0.7633419536053792

path: .spaces[0].metrics.halstead.effort
old: 7646.883192495712
new: 250046.97560701153

path: .spaces[0].metrics.nargs.average
old: 0.14285714285714285
new: 0.5

path: .spaces[0].metrics.nargs.sum
old: 1.0
new: 14.0

path: .spaces[0].metrics.mi.mi_original
old: 81.70560807911292
new: 37.90665704589805

path: .spaces[0].metrics.mi.mi_visual_studio
old: 47.78105735620638
new: 22.167635699355586

path: .spaces[0].metrics.mi.mi_sei
old: 43.295442049989774
new: 13.586984379783594

path: .spaces[0].metrics.cyclomatic.average
old: 1.2222222222222223
new: 1.2592592592592593

path: .spaces[0].metrics.cyclomatic.sum
old: 11.0
new: 34.0

Code

namespace fuzzer {

class Command final {
public:
  // This command line flag is used to indicate that the remaining command line
  // is immutable, meaning this flag effectively marks the end of the mutable
  // argument list.
  static inline const char *ignoreRemainingArgs() {
    return "-ignore_remaining_args=1";
  }

  Command() : CombinedOutAndErr(false) {}

  explicit Command(const Vector &ArgsToAdd)
      : Args(ArgsToAdd), CombinedOutAndErr(false) {}

  explicit Command(const Command &Other)
      : Args(Other.Args), CombinedOutAndErr(Other.CombinedOutAndErr),
        OutputFile(Other.OutputFile) {}

  Command &operator=(const Command &Other) {
    Args = Other.Args;
    CombinedOutAndErr = Other.CombinedOutAndErr;
    OutputFile = Other.OutputFile;
    return *this;
  }

  ~Command() {}

  // Returns true if the given Arg is present in Args.  Only checks up to
  // "-ignore_remaining_args=1".
  bool hasArgument(const std::string &Arg) const {
    auto i = endMutableArgs();
    return std::find(Args.begin(), i, Arg) != i;
  }

  // Gets all of the current command line arguments, **including** those after
  // "-ignore-remaining-args=1".
  const Vector &getArguments() const { return Args; }

  // Adds the given argument before "-ignore_remaining_args=1", or at the end
  // if that flag isn't present.
  void addArgument(const std::string &Arg) {
    Args.insert(endMutableArgs(), Arg);
  }

  // Adds all given arguments before "-ignore_remaining_args=1", or at the end
  // if that flag isn't present.
  void addArguments(const Vector &ArgsToAdd) {
    Args.insert(endMutableArgs(), ArgsToAdd.begin(), ArgsToAdd.end());
  }

  // Removes the given argument from the command argument list.  Ignores any
  // occurrences after "-ignore_remaining_args=1", if present.
  void removeArgument(const std::string &Arg) {
    auto i = endMutableArgs();
    Args.erase(std::remove(Args.begin(), i, Arg), i);
  }

  // Like hasArgument, but checks for "-[Flag]=...".
  bool hasFlag(const std::string &Flag) const {
    std::string Arg("-" + Flag + "=");
    auto IsMatch = [&](const std::string &Other) {
      return Arg.compare(0, std::string::npos, Other, 0, Arg.length()) == 0;
    };
    return std::any_of(Args.begin(), endMutableArgs(), IsMatch);
  }

  // Returns the value of the first instance of a given flag, or an empty string
  // if the flag isn't present.  Ignores any occurrences after
  // "-ignore_remaining_args=1", if present.
  std::string getFlagValue(const std::string &Flag) const {
    std::string Arg("-" + Flag + "=");
    auto IsMatch = [&](const std::string &Other) {
      return Arg.compare(0, std::string::npos, Other, 0, Arg.length()) == 0;
    };
    auto i = endMutableArgs();
    auto j = std::find_if(Args.begin(), i, IsMatch);
    std::string result;
    if (j != i) {
      result = j->substr(Arg.length());
    }
    return result;
  }

  // Like AddArgument, but adds "-[Flag]=[Value]".
  void addFlag(const std::string &Flag, const std::string &Value) {
    addArgument("-" + Flag + "=" + Value);
  }

  // Like RemoveArgument, but removes "-[Flag]=...".
  void removeFlag(const std::string &Flag) {
    std::string Arg("-" + Flag + "=");
    auto IsMatch = [&](const std::string &Other) {
      return Arg.compare(0, std::string::npos, Other, 0, Arg.length()) == 0;
    };
    auto i = endMutableArgs();
    Args.erase(std::remove_if(Args.begin(), i, IsMatch), i);
  }

  // Returns whether the command's stdout is being written to an output file.
  bool hasOutputFile() const { return !OutputFile.empty(); }

  // Returns the currently set output file.
  const std::string &getOutputFile() const { return OutputFile; }

  // Configures the command to redirect its output to the name file.
  void setOutputFile(const std::string &FileName) { OutputFile = FileName; }

  // Returns whether the command's stderr is redirected to stdout.
  bool isOutAndErrCombined() const { return CombinedOutAndErr; }

  // Sets whether to redirect the command's stderr to its stdout.
  void combineOutAndErr(bool combine = true) { CombinedOutAndErr = combine; }

  // Returns a string representation of the command.  On many systems this will
  // be the equivalent command line.
  std::string toString() const {
    std::stringstream SS;
    for (auto arg : getArguments())
      SS << arg << " ";
    if (hasOutputFile())
      SS << ">" << getOutputFile() << " ";
    if (isOutAndErrCombined())
      SS << "2>&1 ";
    std::string result = SS.str();
    if (!result.empty())
      result = result.substr(0, result.length() - 1);
    return result;
  }

private:
  Command(Command &&Other) = delete;
  Command &operator=(Command &&Other) = delete;

  Vector::iterator endMutableArgs() {
    return std::find(Args.begin(), Args.end(), ignoreRemainingArgs());
  }

  Vector::const_iterator endMutableArgs() const {
    return std::find(Args.begin(), Args.end(), ignoreRemainingArgs());
  }

  // The command arguments.  Args[0] is the command name.
  Vector Args;

  // True indicates stderr is redirected to stdout.
  bool CombinedOutAndErr;

  // If not empty, stdout is redirected to the named file.
  std::string OutputFile;
};

} // namespace fuzzer

Minimal test - lines (36, 37)

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.purity_ratio
old: 1.4285714285714286
new: 2.4250824696890683

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.N1
old: 5.0
new: 10.0

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.volume
old: 18.094737505048094
new: 70.32403072095333

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.bugs
old: 0.003646981838562912
new: 0.01564284975807052

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.n1
old: 4.0
new: 8.0

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.vocabulary
old: 6.0
new: 15.0

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.difficulty
old: 2.0
new: 4.571428571428571

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.time
old: 2.0105263894497885
new: 17.860071294210368

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.level
old: 0.5
new: 0.21875

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.N2
old: 2.0
new: 8.0

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.estimated_program_length
old: 10.0
new: 43.65148445440323

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.length
old: 7.0
new: 18.0

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.n2
old: 2.0
new: 7.0

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.effort
old: 36.18947501009619
new: 321.4812832957866

path: .spaces[0].spaces[0].spaces[2].metrics.mi.mi_original
old: 155.7127700178179
new: 137.42482510349694

path: .spaces[0].spaces[0].spaces[2].metrics.mi.mi_visual_studio
old: 91.0600994256245
new: 80.36539479736663

path: .spaces[0].spaces[0].spaces[2].metrics.mi.mi_sei
old: 149.04700897518126
new: 122.66308153923984

path: .spaces[0].spaces[0].spaces[2].metrics.nargs.average
old: 0.0
new: 1.0

path: .spaces[0].spaces[0].spaces[2].metrics.nargs.sum
old: 0.0
new: 1.0

path: .spaces[0].spaces[0].spaces[2].metrics.loc.ploc
old: 1.0
new: 2.0

path: .spaces[0].spaces[0].spaces[2].metrics.loc.lloc
old: 1.0
new: 0.0

path: .spaces[0].spaces[0].spaces[2].metrics.loc.sloc
old: 1.0
new: 2.0

Code

  explicit Command(const Vector &ArgsToAdd)
      : Args(ArgsToAdd), CombinedOutAndErr(false) {}

Minimal test - lines (25, 174)

path: .spaces[0].spaces[0].metrics.cognitive.sum
old: 2.0
new: 4.0

path: .spaces[0].spaces[0].metrics.cognitive.average
old: 0.2857142857142857
new: 0.14285714285714285

path: .spaces[0].spaces[0].metrics.loc.blank
old: 0.0
new: 26.0

path: .spaces[0].spaces[0].metrics.loc.ploc
old: 26.0
new: 95.0

path: .spaces[0].spaces[0].metrics.loc.sloc
old: 26.0
new: 150.0

path: .spaces[0].spaces[0].metrics.loc.lloc
old: 12.0
new: 34.0

path: .spaces[0].spaces[0].metrics.loc.cloc
old: 0.0
new: 29.0

path: .spaces[0].spaces[0].metrics.halstead.length
old: 92.0
new: 678.0

path: .spaces[0].spaces[0].metrics.halstead.effort
old: 7726.912258033525
new: 251293.40581671

path: .spaces[0].spaces[0].metrics.halstead.n1
old: 13.0
new: 27.0

path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 0.13028149466857775
new: 1.3273928487259337

path: .spaces[0].spaces[0].metrics.halstead.N1
old: 61.0
new: 408.0

path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.05459057071960298
new: 0.017558299039780522

path: .spaces[0].spaces[0].metrics.halstead.time
old: 429.2729032240848
new: 13960.744767595

path: .spaces[0].spaces[0].metrics.halstead.volume
old: 421.81655006634634
new: 4412.284766054716

path: .spaces[0].spaces[0].metrics.halstead.N2
old: 31.0
new: 270.0

path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 24.0
new: 91.0

path: .spaces[0].spaces[0].metrics.halstead.n2
old: 11.0
new: 64.0

path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 0.9365159145743964
new: 0.7557256084932354

path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 86.15946414084446
new: 512.3819625584136

path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 18.318181818181817
new: 56.953125

path: .spaces[0].spaces[0].metrics.nexits.average
old: 0.8571428571428571
new: 0.5357142857142857

path: .spaces[0].spaces[0].metrics.nexits.sum
old: 6.0
new: 15.0

path: .spaces[0].spaces[0].metrics.nom.closures
old: 0.0
new: 3.0

path: .spaces[0].spaces[0].metrics.nom.total
old: 7.0
new: 28.0

path: .spaces[0].spaces[0].metrics.nom.functions
old: 7.0
new: 25.0

path: .spaces[0].spaces[0].metrics.nargs.average
old: 0.14285714285714285
new: 0.5

path: .spaces[0].spaces[0].metrics.nargs.sum
old: 1.0
new: 14.0

path: .spaces[0].spaces[0].metrics.cyclomatic.average
old: 1.25
new: 1.2692307692307692

path: .spaces[0].spaces[0].metrics.cyclomatic.sum
old: 10.0
new: 33.0

path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 49.40764296085279
new: 22.57224505390257

path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: 47.20642273562744
new: 14.8304537733518

path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 84.48706946305828
new: 38.5985390421734

Code

class Command final {
public:
  // This command line flag is used to indicate that the remaining command line
  // is immutable, meaning this flag effectively marks the end of the mutable
  // argument list.
  static inline const char *ignoreRemainingArgs() {
    return "-ignore_remaining_args=1";
  }

  Command() : CombinedOutAndErr(false) {}

  explicit Command(const Vector &ArgsToAdd)
      : Args(ArgsToAdd), CombinedOutAndErr(false) {}

  explicit Command(const Command &Other)
      : Args(Other.Args), CombinedOutAndErr(Other.CombinedOutAndErr),
        OutputFile(Other.OutputFile) {}

  Command &operator=(const Command &Other) {
    Args = Other.Args;
    CombinedOutAndErr = Other.CombinedOutAndErr;
    OutputFile = Other.OutputFile;
    return *this;
  }

  ~Command() {}

  // Returns true if the given Arg is present in Args.  Only checks up to
  // "-ignore_remaining_args=1".
  bool hasArgument(const std::string &Arg) const {
    auto i = endMutableArgs();
    return std::find(Args.begin(), i, Arg) != i;
  }

  // Gets all of the current command line arguments, **including** those after
  // "-ignore-remaining-args=1".
  const Vector &getArguments() const { return Args; }

  // Adds the given argument before "-ignore_remaining_args=1", or at the end
  // if that flag isn't present.
  void addArgument(const std::string &Arg) {
    Args.insert(endMutableArgs(), Arg);
  }

  // Adds all given arguments before "-ignore_remaining_args=1", or at the end
  // if that flag isn't present.
  void addArguments(const Vector &ArgsToAdd) {
    Args.insert(endMutableArgs(), ArgsToAdd.begin(), ArgsToAdd.end());
  }

  // Removes the given argument from the command argument list.  Ignores any
  // occurrences after "-ignore_remaining_args=1", if present.
  void removeArgument(const std::string &Arg) {
    auto i = endMutableArgs();
    Args.erase(std::remove(Args.begin(), i, Arg), i);
  }

  // Like hasArgument, but checks for "-[Flag]=...".
  bool hasFlag(const std::string &Flag) const {
    std::string Arg("-" + Flag + "=");
    auto IsMatch = [&](const std::string &Other) {
      return Arg.compare(0, std::string::npos, Other, 0, Arg.length()) == 0;
    };
    return std::any_of(Args.begin(), endMutableArgs(), IsMatch);
  }

  // Returns the value of the first instance of a given flag, or an empty string
  // if the flag isn't present.  Ignores any occurrences after
  // "-ignore_remaining_args=1", if present.
  std::string getFlagValue(const std::string &Flag) const {
    std::string Arg("-" + Flag + "=");
    auto IsMatch = [&](const std::string &Other) {
      return Arg.compare(0, std::string::npos, Other, 0, Arg.length()) == 0;
    };
    auto i = endMutableArgs();
    auto j = std::find_if(Args.begin(), i, IsMatch);
    std::string result;
    if (j != i) {
      result = j->substr(Arg.length());
    }
    return result;
  }

  // Like AddArgument, but adds "-[Flag]=[Value]".
  void addFlag(const std::string &Flag, const std::string &Value) {
    addArgument("-" + Flag + "=" + Value);
  }

  // Like RemoveArgument, but removes "-[Flag]=...".
  void removeFlag(const std::string &Flag) {
    std::string Arg("-" + Flag + "=");
    auto IsMatch = [&](const std::string &Other) {
      return Arg.compare(0, std::string::npos, Other, 0, Arg.length()) == 0;
    };
    auto i = endMutableArgs();
    Args.erase(std::remove_if(Args.begin(), i, IsMatch), i);
  }

  // Returns whether the command's stdout is being written to an output file.
  bool hasOutputFile() const { return !OutputFile.empty(); }

  // Returns the currently set output file.
  const std::string &getOutputFile() const { return OutputFile; }

  // Configures the command to redirect its output to the name file.
  void setOutputFile(const std::string &FileName) { OutputFile = FileName; }

  // Returns whether the command's stderr is redirected to stdout.
  bool isOutAndErrCombined() const { return CombinedOutAndErr; }

  // Sets whether to redirect the command's stderr to its stdout.
  void combineOutAndErr(bool combine = true) { CombinedOutAndErr = combine; }

  // Returns a string representation of the command.  On many systems this will
  // be the equivalent command line.
  std::string toString() const {
    std::stringstream SS;
    for (auto arg : getArguments())
      SS << arg << " ";
    if (hasOutputFile())
      SS << ">" << getOutputFile() << " ";
    if (isOutAndErrCombined())
      SS << "2>&1 ";
    std::string result = SS.str();
    if (!result.empty())
      result = result.substr(0, result.length() - 1);
    return result;
  }

private:
  Command(Command &&Other) = delete;
  Command &operator=(Command &&Other) = delete;

  Vector::iterator endMutableArgs() {
    return std::find(Args.begin(), Args.end(), ignoreRemainingArgs());
  }

  Vector::const_iterator endMutableArgs() const {
    return std::find(Args.begin(), Args.end(), ignoreRemainingArgs());
  }

  // The command arguments.  Args[0] is the command name.
  Vector Args;

  // True indicates stderr is redirected to stdout.
  bool CombinedOutAndErr;

  // If not empty, stdout is redirected to the named file.
  std::string OutputFile;
};

Minimal test - lines (39, 41)

path: .spaces[0].spaces[0].spaces[3].metrics.nexits.average
old: 1.0
new: 0.0

path: .spaces[0].spaces[0].spaces[3].metrics.nexits.sum
old: 1.0
new: 0.0

path: .spaces[0].spaces[0].spaces[3].metrics.loc.ploc
old: 1.0
new: 3.0

path: .spaces[0].spaces[0].spaces[3].metrics.loc.sloc
old: 1.0
new: 3.0

path: .spaces[0].spaces[0].spaces[3].metrics.loc.lloc
old: 1.0
new: 0.0

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.bugs
old: 0.006944786620971931
new: 0.023654352859280706

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.level
old: 0.3333333333333333
new: 0.1388888888888889

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.time
old: 5.2832083357371875
new: 33.21054353891806

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.length
old: 10.0
new: 24.0

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.estimated_program_length
old: 20.264662506490403
new: 27.11941547876375

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.n2
old: 3.0
new: 5.0

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.purity_ratio
old: 2.0264662506490403
new: 1.1299756449484897

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.difficulty
old: 3.0
new: 7.2

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.N2
old: 3.0
new: 12.0

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.volume
old: 31.69925001442312
new: 83.02635884729514

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.N1
old: 7.0
new: 12.0

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.effort
old: 95.09775004326936
new: 597.789783700525

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.vocabulary
old: 9.0
new: 11.0

path: .spaces[0].spaces[0].spaces[3].metrics.mi.mi_original
old: 152.79727628688778
new: 129.99285862753948

path: .spaces[0].spaces[0].spaces[3].metrics.mi.mi_sei
old: 144.8408406278255
new: 111.94102036032302

path: .spaces[0].spaces[0].spaces[3].metrics.mi.mi_visual_studio
old: 89.35513233151332
new: 76.01921557166051

path: .spaces[0].spaces[0].spaces[3].metrics.nargs.average
old: 0.0
new: 1.0

path: .spaces[0].spaces[0].spaces[3].metrics.nargs.sum
old: 0.0
new: 1.0

Code

  explicit Command(const Command &Other)
      : Args(Other.Args), CombinedOutAndErr(Other.CombinedOutAndErr),
        OutputFile(Other.OutputFile) {}

Minimal test - lines (54, 57)

path: .spaces[0].spaces[0].spaces[6].metrics.mi.mi_sei
old: 99.08709909096528
new: 102.52060683450112

path: .spaces[0].spaces[0].spaces[6].metrics.mi.mi_original
old: 121.08319934054464
new: 123.46312555240723

path: .spaces[0].spaces[0].spaces[6].metrics.mi.mi_visual_studio
old: 70.80888850324247
new: 72.200658217782

path: .spaces[0].spaces[0].spaces[6].metrics.nargs.average
old: 0.0
new: 1.0

path: .spaces[0].spaces[0].spaces[6].metrics.nargs.sum
old: 0.0
new: 1.0

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.vocabulary
old: 10.0
new: 19.0

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.N2
old: 6.0
new: 11.0

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.effort
old: 239.17882283189007
new: 899.4986509716791

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.time
old: 13.287712379549449
new: 49.9721472762044

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.N1
old: 10.0
new: 17.0

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.difficulty
old: 4.5
new: 7.5625

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.level
old: 0.2222222222222222
new: 0.1322314049586777

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.purity_ratio
old: 1.4693609377704335
new: 2.2162052787503668

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.n2
old: 4.0
new: 8.0

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.bugs
old: 0.012843810659451275
new: 0.03106078466943414

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.volume
old: 53.150849518197795
new: 118.9419703764204

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.estimated_program_length
old: 23.509775004326936
new: 62.05374780501027

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.length
old: 16.0
new: 28.0

path: .spaces[0].spaces[0].spaces[6].metrics.halstead.n1
old: 6.0
new: 11.0

path: .spaces[0].spaces[0].spaces[6].metrics.loc.lloc
old: 2.0
new: 1.0

path: .spaces[0].spaces[0].spaces[6].metrics.loc.ploc
old: 6.0
new: 4.0

path: .spaces[0].spaces[0].spaces[6].metrics.loc.sloc
old: 6.0
new: 4.0

Code

  bool hasArgument(const std::string &Arg) const {
    auto i = endMutableArgs();
    return std::find(Args.begin(), i, Arg) != i;
  }

Minimal test - lines (50, 50)

path: .spaces[0].spaces[0].spaces[5].metrics.mi.mi_original
old: 153.0837736153568
new: 159.95690398326485

path: .spaces[0].spaces[0].spaces[5].metrics.mi.mi_sei
old: 145.25416890283572
new: 155.17000000000002

path: .spaces[0].spaces[0].spaces[5].metrics.mi.mi_visual_studio
old: 89.52267462886361
new: 93.54204911302038

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.purity_ratio
old: 1.6364527976600278
new: 1.188721875540867

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.level
old: 0.3
new: 0.6666666666666666

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.difficulty
old: 3.3333333333333335
new: 1.5

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.n2
old: 3.0
new: 1.0

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.bugs
old: 0.007181448966772944
new: 0.0017471609294725976

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.N1
old: 6.0
new: 3.0

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.vocabulary
old: 8.0
new: 4.0

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.time
old: 5.555555555555555
new: 0.6666666666666666

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.volume
old: 30.0
new: 8.0

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.effort
old: 100.0
new: 12.0

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.N2
old: 4.0
new: 1.0

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.length
old: 10.0
new: 4.0

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.n1
old: 5.0
new: 3.0

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.estimated_program_length
old: 16.36452797660028
new: 4.754887502163468

path: .spaces[0].spaces[0].spaces[5].metrics.loc.lloc
old: 1.0
new: 0.0

path: .spaces[0].spaces[0].spaces[5].metrics.nargs.average
old: 1.0
new: 0.0

path: .spaces[0].spaces[0].spaces[5].metrics.nargs.sum
old: 1.0
new: 0.0

Code

  ~Command() {}

Minimal test - lines (30, 32)

path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_sei
old: 150.2034495661308
new: 121.25180248456726

path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_original
old: 156.51435355291963
new: 136.4466010057673

path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 91.5288617268536
new: 79.79333392150134

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.length
old: 6.0
new: 8.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.N2
old: 1.0
new: 2.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.n1
old: 5.0
new: 6.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.volume
old: 15.509775004326936
new: 24.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.time
old: 2.1541354172676304
new: 4.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 11.60964047443681
new: 17.509775004326936

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.n2
old: 1.0
new: 2.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.bugs
old: 0.00381864321284214
new: 0.0057689982812296325

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.level
old: 0.4
new: 0.3333333333333333

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.vocabulary
old: 6.0
new: 8.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.N1
old: 5.0
new: 6.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.difficulty
old: 2.5
new: 3.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.9349400790728015
new: 2.188721875540867

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.effort
old: 38.77443751081734
new: 72.0

path: .spaces[0].spaces[0].spaces[0].metrics.loc.ploc
old: 1.0
new: 3.0

path: .spaces[0].spaces[0].spaces[0].metrics.loc.sloc
old: 1.0
new: 3.0

Code

  static inline const char *ignoreRemainingArgs() {
    return "-ignore_remaining_args=1";
  }