diff --git a/Framework/API/test/ExperimentInfoTest.h b/Framework/API/test/ExperimentInfoTest.h
index 447b86525173a5981e8a3ed3d7b4e5168a767b48..71806ba8cc0a38e91d3d733c74df8d705ba91b91 100644
--- a/Framework/API/test/ExperimentInfoTest.h
+++ b/Framework/API/test/ExperimentInfoTest.h
@@ -526,7 +526,7 @@ public:
     std::pair<std::unordered_multimap<std::string, fromToEntry>::iterator,
               std::unordered_multimap<std::string, fromToEntry>::iterator> ret;
 
-    for (const auto & idfIdentifier : idfIdentifiers) {
+    for (const auto &idfIdentifier : idfIdentifiers) {
       ret = idfFiles.equal_range(idfIdentifier);
       for (it1 = ret.first; it1 != ret.second; ++it1) {
         for (it2 = ret.first; it2 != ret.second; ++it2) {
diff --git a/Framework/API/test/GroupingLoaderTest.h b/Framework/API/test/GroupingLoaderTest.h
index 9d610c10fa3b68028891266f60b169c99b61ae50..4258fb1cbf2d0b1679c9d325a2e55abba787356d 100644
--- a/Framework/API/test/GroupingLoaderTest.h
+++ b/Framework/API/test/GroupingLoaderTest.h
@@ -25,7 +25,7 @@ public:
     auto dataPaths = ConfigService::Instance().getDataSearchDirs();
 
     // Find the path of AutoTestData
-    for (auto & dataPath : dataPaths) {
+    for (auto &dataPath : dataPaths) {
       Poco::Path path(dataPath);
 
       if (path.directory(path.depth() - 1) == "UnitTest") {
diff --git a/Framework/API/test/MatrixWorkspaceMDIteratorTest.h b/Framework/API/test/MatrixWorkspaceMDIteratorTest.h
index c1c61f2574a82518072e48af195ee13296026cb1..53e79184e726e36a017367f1f5727b2e0ac684e8 100644
--- a/Framework/API/test/MatrixWorkspaceMDIteratorTest.h
+++ b/Framework/API/test/MatrixWorkspaceMDIteratorTest.h
@@ -92,7 +92,7 @@ public:
     // The number of output cannot be larger than the number of histograms
     std::vector<IMDIterator *> it = ws->createIterators(10, nullptr);
     TS_ASSERT_EQUALS(it.size(), 4);
-    for (auto & i : it)
+    for (auto &i : it)
       delete i;
 
     // Split in 4 iterators
diff --git a/Framework/Algorithms/src/ConjoinXRuns.cpp b/Framework/Algorithms/src/ConjoinXRuns.cpp
index 9a92ef6565722e7c8bd187383c03e63755084ce0..fa9504834ad4f8b10e3a1595a7a14465916e881d 100644
--- a/Framework/Algorithms/src/ConjoinXRuns.cpp
+++ b/Framework/Algorithms/src/ConjoinXRuns.cpp
@@ -254,7 +254,7 @@ void ConjoinXRuns::fillHistory() {
   if (!isChild()) {
     // Loop over the input workspaces, making the call that copies their
     // history to the output one
-    for (auto & inWS : m_inputWS) {
+    for (auto &inWS : m_inputWS) {
       m_outWS->history().addHistory(inWS->getHistory());
     }
     // Add the history for the current algorithm to the output
diff --git a/Framework/Algorithms/test/ChangeTimeZeroTest.h b/Framework/Algorithms/test/ChangeTimeZeroTest.h
index 38975edc7019c59dd5320cf7586f3edcb379569f..c0dd81f2f1d66f5b275966ec56bf2ce78eee3fae 100644
--- a/Framework/Algorithms/test/ChangeTimeZeroTest.h
+++ b/Framework/Algorithms/test/ChangeTimeZeroTest.h
@@ -487,7 +487,7 @@ private:
 
     auto logs = ws->run().getLogData();
     // Go over each log and check the times
-    for (auto & log : logs) {
+    for (auto &log : logs) {
       if (dynamic_cast<Mantid::Kernel::ITimeSeriesProperty *>(log)) {
         do_check_time_series(log, timeShift);
       } else if (dynamic_cast<PropertyWithValue<std::string> *>(log)) {
@@ -509,7 +509,7 @@ private:
     // Iterator over all entries of the time series and check if they are
     // altered
     double secondCounter = timeShift;
-    for (auto & time : times) {
+    for (auto &time : times) {
       double secs = DateAndTime::secondsFromDuration(time - m_startTime);
       TSM_ASSERT_DELTA("Time series logs should have shifted times.", secs,
                        secondCounter, 1e-5);
diff --git a/Framework/Algorithms/test/FilterEventsTest.h b/Framework/Algorithms/test/FilterEventsTest.h
index 28a78ced563e41d73bf0335d7bdef12918e017a4..ab7e5f64107d78121f3fb2ffc39ad542ef401a47 100644
--- a/Framework/Algorithms/test/FilterEventsTest.h
+++ b/Framework/Algorithms/test/FilterEventsTest.h
@@ -254,7 +254,7 @@ public:
     AnalysisDataService::Instance().remove("Splitter02");
     std::vector<std::string> outputwsnames =
         filter.getProperty("OutputWorkspaceNames");
-    for (const auto & outputwsname : outputwsnames) {
+    for (const auto &outputwsname : outputwsnames) {
       AnalysisDataService::Instance().remove(outputwsname);
     }
 
@@ -350,7 +350,7 @@ public:
     AnalysisDataService::Instance().remove("Splitter02");
     std::vector<std::string> outputwsnames =
         filter.getProperty("OutputWorkspaceNames");
-    for (const auto & outputwsname : outputwsnames) {
+    for (const auto &outputwsname : outputwsnames) {
       std::cout << "Delete output workspace name: " << outputwsname << "\n";
       AnalysisDataService::Instance().remove(outputwsname);
     }
@@ -435,7 +435,7 @@ public:
 
     std::vector<std::string> outputwsnames =
         filter.getProperty("OutputWorkspaceNames");
-    for (const auto & outputwsname : outputwsnames) {
+    for (const auto &outputwsname : outputwsnames) {
       AnalysisDataService::Instance().remove(outputwsname);
     }
 
@@ -493,7 +493,7 @@ public:
     // Delete all the workspaces generated here
     AnalysisDataService::Instance().remove("MockDirectEventWS");
     AnalysisDataService::Instance().remove("SplitterTableX");
-    for (const auto & i : vecwsname) {
+    for (const auto &i : vecwsname) {
       AnalysisDataService::Instance().remove(i);
     }
 
@@ -544,7 +544,7 @@ public:
     AnalysisDataService::Instance().remove("SplitterTableX");
     std::vector<std::string> outputwsnames =
         filter.getProperty("OutputWorkspaceNames");
-    for (const auto & outputwsname : outputwsnames) {
+    for (const auto &outputwsname : outputwsnames) {
       AnalysisDataService::Instance().remove(outputwsname);
     }
 
@@ -608,7 +608,7 @@ public:
     AnalysisDataService::Instance().remove("MockIndirectEventWS");
     std::vector<std::string> outputwsnames =
         filter.getProperty("OutputWorkspaceNames");
-    for (const auto & outputwsname : outputwsnames) {
+    for (const auto &outputwsname : outputwsnames) {
       AnalysisDataService::Instance().remove(outputwsname);
     }
 
@@ -781,7 +781,7 @@ public:
     //  Test the sample logs
     std::vector<std::string> outputwsnames =
         filter.getProperty("OutputWorkspaceNames");
-    for (const auto & outputwsname : outputwsnames) {
+    for (const auto &outputwsname : outputwsnames) {
       EventWorkspace_sptr filtered_ws =
           boost::dynamic_pointer_cast<DataObjects::EventWorkspace>(
               AnalysisDataService::Instance().retrieve(outputwsname));
@@ -805,7 +805,7 @@ public:
     // clean up all the workspaces generated
     AnalysisDataService::Instance().remove("Test10");
     AnalysisDataService::Instance().remove("Splitter10");
-    for (const auto & outputwsname : outputwsnames) {
+    for (const auto &outputwsname : outputwsnames) {
       AnalysisDataService::Instance().remove(outputwsname);
     }
 
@@ -977,7 +977,7 @@ public:
     AnalysisDataService::Instance().remove("TableSplitter1");
     std::vector<std::string> outputwsnames =
         filter.getProperty("OutputWorkspaceNames");
-    for (const auto & outputwsname : outputwsnames) {
+    for (const auto &outputwsname : outputwsnames) {
       AnalysisDataService::Instance().remove(outputwsname);
     }
 
@@ -1033,7 +1033,7 @@ public:
 
     std::vector<std::string> outputwsnames =
         filter.getProperty("OutputWorkspaceNames");
-    for (const auto & outputwsname : outputwsnames) {
+    for (const auto &outputwsname : outputwsnames) {
       EventWorkspace_sptr childworkspace =
           boost::dynamic_pointer_cast<EventWorkspace>(
               AnalysisDataService::Instance().retrieve(outputwsname));
@@ -1051,7 +1051,7 @@ public:
     // clean workspaces
     AnalysisDataService::Instance().remove("Test12");
     AnalysisDataService::Instance().remove("TableSplitter2");
-    for (const auto & outputwsname : outputwsnames) {
+    for (const auto &outputwsname : outputwsnames) {
       AnalysisDataService::Instance().remove(outputwsname);
     }
 
diff --git a/Framework/Algorithms/test/GroupWorkspacesTest.h b/Framework/Algorithms/test/GroupWorkspacesTest.h
index b9f4c2abec1af42ef3764dfaede05d8cca392dec..bc183339d67f933d2927f0be610fe640d5c4932d 100644
--- a/Framework/Algorithms/test/GroupWorkspacesTest.h
+++ b/Framework/Algorithms/test/GroupWorkspacesTest.h
@@ -196,7 +196,7 @@ public:
 
 private:
   void addTestMatrixWorkspacesToADS(const std::vector<std::string> &inputs) {
-    for (const auto & input : inputs) {
+    for (const auto &input : inputs) {
       addTestMatrixWorkspaceToADS(input);
     }
   }
@@ -258,7 +258,7 @@ private:
                      const std::vector<std::string> &members) {
     auto &ads = Mantid::API::AnalysisDataService::Instance();
 
-    for (const auto & member : members) {
+    for (const auto &member : members) {
       if (ads.doesExist(member))
         ads.remove(member);
     }
diff --git a/Framework/Algorithms/test/RemoveBackgroundTest.h b/Framework/Algorithms/test/RemoveBackgroundTest.h
index 93cea2736880b1cb49bc054b6dbca95b9b76b00c..8139f055e6f27be7cd8e90c4ce43321777b1e007 100644
--- a/Framework/Algorithms/test/RemoveBackgroundTest.h
+++ b/Framework/Algorithms/test/RemoveBackgroundTest.h
@@ -195,7 +195,7 @@ public:
     auto clone = cloneSourceWS();
     // set negative values to signal
     auto &Y = clone->dataY(0);
-    for (double & i : Y) {
+    for (double &i : Y) {
       i = -1000;
     }
     // Create zero background workspace
diff --git a/Framework/Algorithms/test/SassenaFFTTest.h b/Framework/Algorithms/test/SassenaFFTTest.h
index 5f5f5c4032b02b0c4973821686c641bd9586c44f..39f6472feb07ac5f877c90ab4a32374a3a598ad8 100644
--- a/Framework/Algorithms/test/SassenaFFTTest.h
+++ b/Framework/Algorithms/test/SassenaFFTTest.h
@@ -144,7 +144,7 @@ private:
       double sum = 0.0;
       double average = 0.0;
       MantidVec::iterator itx = xv.begin();
-      for (double & it : yv) {
+      for (double &it : yv) {
         factor = exp(exponentFactor * (*itx));
         sum += it * factor;
         average += it * (*itx) * factor;
@@ -186,7 +186,7 @@ private:
       xv = ws->readX(i);
       MantidVec::iterator itx = xv.begin();
       double sum = 0.0;
-      for (double & it : yv) {
+      for (double &it : yv) {
         factor = exp(exponentFactor * (*itx));
         sum += it * factor;
         ++itx;
diff --git a/Framework/Algorithms/test/UnGroupWorkspaceTest.h b/Framework/Algorithms/test/UnGroupWorkspaceTest.h
index 75515d1f21cc1c1e1dea4c18ab06eae264a8963b..62e6379b4d41eda4f2fa52b3b87c464f8824728e 100644
--- a/Framework/Algorithms/test/UnGroupWorkspaceTest.h
+++ b/Framework/Algorithms/test/UnGroupWorkspaceTest.h
@@ -102,7 +102,7 @@ private:
     auto newGroup = boost::make_shared<Mantid::API::WorkspaceGroup>();
 
     auto &ads = Mantid::API::AnalysisDataService::Instance();
-    for (const auto & input : inputs) {
+    for (const auto &input : inputs) {
       auto ws = addTestMatrixWorkspaceToADS(input);
       newGroup->addWorkspace(ws);
     }
@@ -120,7 +120,7 @@ private:
   void removeFromADS(const std::vector<std::string> &members) {
     auto &ads = Mantid::API::AnalysisDataService::Instance();
 
-    for (const auto & member : members) {
+    for (const auto &member : members) {
       if (ads.doesExist(member))
         ads.remove(member);
     }
diff --git a/Framework/Crystal/src/SCDCalibratePanels.cpp b/Framework/Crystal/src/SCDCalibratePanels.cpp
index f8be052c74e51558ebe2cd1ad9d61b0c6b10ec73..be3bd66cf023288475cbe10d1eeb676070260bdb 100644
--- a/Framework/Crystal/src/SCDCalibratePanels.cpp
+++ b/Framework/Crystal/src/SCDCalibratePanels.cpp
@@ -102,7 +102,7 @@ void SCDCalibratePanels::exec() {
   std::vector<std::string> parameter_workspaces(
       MyBankNames.size() + MyPanels.size(), "params_");
   int i = 0;
-  for (auto & MyPanel : MyPanels) {
+  for (auto &MyPanel : MyPanels) {
     fit_workspaces[i] += MyPanel;
     parameter_workspaces[i] += MyPanel;
     i++;
@@ -122,7 +122,7 @@ void SCDCalibratePanels::exec() {
                    << " degrees\n";
   }
 
-  for (auto & MyBankName : MyBankNames) {
+  for (auto &MyBankName : MyBankNames) {
     fit_workspaces[i] += MyBankName;
     parameter_workspaces[i] += MyBankName;
     i++;
diff --git a/Framework/Crystal/test/ConnectedComponentLabelingTest.h b/Framework/Crystal/test/ConnectedComponentLabelingTest.h
index 8e976b9f2be4fb8856ca1adfb31a6dae5e031951..4b82f4201a771b57f1d4365f8d6b3becd43b357b 100644
--- a/Framework/Crystal/test/ConnectedComponentLabelingTest.h
+++ b/Framework/Crystal/test/ConnectedComponentLabelingTest.h
@@ -410,7 +410,7 @@ public:
                              clusterThreeIndexes.end());
 
     // Add elevated signal to the workspace at cluster indexes.
-    for (unsigned long & allClusterIndexe : allClusterIndexes) {
+    for (unsigned long &allClusterIndexe : allClusterIndexes) {
       inWS->setSignalAt(allClusterIndexe, raisedSignal);
     }
 
diff --git a/Framework/Crystal/test/PredictPeaksTest.h b/Framework/Crystal/test/PredictPeaksTest.h
index 4e36e48f695ee923078ad45c23db872631c1f21f..6778889cdc04a831cfb6977e6951db641086f479 100644
--- a/Framework/Crystal/test/PredictPeaksTest.h
+++ b/Framework/Crystal/test/PredictPeaksTest.h
@@ -37,7 +37,7 @@ public:
     PeaksWorkspace_sptr hklPW;
     if (hkls.size() > 0) {
       hklPW = PeaksWorkspace_sptr(new PeaksWorkspace());
-      for (const auto & hkl : hkls) {
+      for (const auto &hkl : hkls) {
         Peak p(inst, detid, 1.0);
         p.setHKL(hkl);
         hklPW->addPeak(p);
diff --git a/Framework/CurveFitting/src/Algorithms/EstimateFitParameters.cpp b/Framework/CurveFitting/src/Algorithms/EstimateFitParameters.cpp
index 17ab19c42d5cb753a0101383e6b6c18394ec3c52..aa33da349282e1aaf83b77ca02b7b04c73030673 100644
--- a/Framework/CurveFitting/src/Algorithms/EstimateFitParameters.cpp
+++ b/Framework/CurveFitting/src/Algorithms/EstimateFitParameters.cpp
@@ -429,7 +429,7 @@ void EstimateFitParameters::execConcrete() {
         if (m_function->isActive(i)) {
           TableRow row = table->appendRow();
           row << m_function->parameterName(i);
-          for (auto & j : output) {
+          for (auto &j : output) {
             row << j[ia];
           }
           ++ia;
diff --git a/Framework/CurveFitting/src/FuncMinimizers/TrustRegionMinimizer.cpp b/Framework/CurveFitting/src/FuncMinimizers/TrustRegionMinimizer.cpp
index 9386efa3c2d10684bc3a19710bb495af4d63578c..8c62a15cb8bb7067bd7f4ebf1730618e38ef1de8 100644
--- a/Framework/CurveFitting/src/FuncMinimizers/TrustRegionMinimizer.cpp
+++ b/Framework/CurveFitting/src/FuncMinimizers/TrustRegionMinimizer.cpp
@@ -1274,7 +1274,7 @@ void solveSubproblem(int n, double radius, double f,
   inform.obj *= pow(scale_c, 2) / scale_h;
   inform.multiplier *= scale_h;
   inform.pole *= scale_h;
-  for (auto & i : inform.history) { //      do i = 1, inform.len_history
+  for (auto &i : inform.history) { //      do i = 1, inform.len_history
     i.lambda *= scale_h;
     i.x_norm *= scale_c / scale_h;
   }
diff --git a/Framework/CurveFitting/test/Algorithms/LeBailFunctionTest.h b/Framework/CurveFitting/test/Algorithms/LeBailFunctionTest.h
index d072227eb6c27acfaebc257c9a48fcd6b9bbe697..0aa3b2c2fbec41d15b577e334b2b78383f1a9738 100644
--- a/Framework/CurveFitting/test/Algorithms/LeBailFunctionTest.h
+++ b/Framework/CurveFitting/test/Algorithms/LeBailFunctionTest.h
@@ -687,7 +687,7 @@ public:
     vecy.push_back(0.03096179);
     vece.push_back(0.00105191);
 
-    for (double & i : vecy)
+    for (double &i : vecy)
       i -= 0.02295189;
 
     return;
diff --git a/Framework/CurveFitting/test/Algorithms/PlotPeakByLogValueTest.h b/Framework/CurveFitting/test/Algorithms/PlotPeakByLogValueTest.h
index 8ba433096f77eaf2de11fc31554facbd5441ba05..887b222e9af4f88ce50deb2ebc3212eca54c1a6a 100644
--- a/Framework/CurveFitting/test/Algorithms/PlotPeakByLogValueTest.h
+++ b/Framework/CurveFitting/test/Algorithms/PlotPeakByLogValueTest.h
@@ -496,7 +496,7 @@ public:
     TS_ASSERT(fits->getNames().size() == 2);
 
     auto wsNames = fits->getNames();
-    for (const auto & wsName : wsNames) {
+    for (const auto &wsName : wsNames) {
       auto fit =
           AnalysisDataService::Instance().retrieveWS<const MatrixWorkspace>(
               wsName);
diff --git a/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParametersTest.h b/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParametersTest.h
index b6b7d4a40fee6b07ebdf7df2d94bad94588a1115..ba013ee91cb938a06b6db4edea8d7a321caa516a 100644
--- a/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParametersTest.h
+++ b/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParametersTest.h
@@ -416,7 +416,7 @@ public:
 
     // 2. Add peak parameters' name and values
     map<string, vector<double>>::iterator finditer;
-    for (const auto & paramname : paramnames) {
+    for (const auto &paramname : paramnames) {
       API::TableRow newrow = geomws->appendRow();
       std::string parname = paramname;
       double parvalue = parameters[paramname];
diff --git a/Framework/CurveFitting/test/Functions/ProcessBackgroundTest.h b/Framework/CurveFitting/test/Functions/ProcessBackgroundTest.h
index c1dfa668cb2d0efb2d71cc537b13ccb816082069..13ca05b896b37eb05b2c99fb5147e5ac5c897dbe 100644
--- a/Framework/CurveFitting/test/Functions/ProcessBackgroundTest.h
+++ b/Framework/CurveFitting/test/Functions/ProcessBackgroundTest.h
@@ -446,7 +446,7 @@ public:
 
     MersenneTwister mt(1234, 0.0, 1000000.0);
     std::vector<double> bkgdpts(10000);
-    for (double & bkgdpt : bkgdpts) {
+    for (double &bkgdpt : bkgdpts) {
       bkgdpt = mt.nextValue();
     }
 
diff --git a/Framework/CurveFitting/test/IPeakFunctionCentreParameterNameTest.h b/Framework/CurveFitting/test/IPeakFunctionCentreParameterNameTest.h
index 5922aa4ede3ce64a7a68a67ea61fbe863b9ddfc6..843542f9221c9389d16259e0375149175c60d847 100644
--- a/Framework/CurveFitting/test/IPeakFunctionCentreParameterNameTest.h
+++ b/Framework/CurveFitting/test/IPeakFunctionCentreParameterNameTest.h
@@ -33,7 +33,7 @@ public:
   /* Test that all functions give the expected result.
    */
   void testAllFunctions() {
-    for (auto & expectedResult : m_expectedResults) {
+    for (auto &expectedResult : m_expectedResults) {
       const std::string &peakFunctionName = expectedResult.first;
       const std::string &centreParameterName = expectedResult.second;
 
diff --git a/Framework/CurveFitting/test/IPeakFunctionIntensityTest.h b/Framework/CurveFitting/test/IPeakFunctionIntensityTest.h
index e2483577cd3f7815af4b6c07f07c8ebce888a27f..7babcbecbfa1a105b2e69811c80ae3f2c6f35f03 100644
--- a/Framework/CurveFitting/test/IPeakFunctionIntensityTest.h
+++ b/Framework/CurveFitting/test/IPeakFunctionIntensityTest.h
@@ -91,7 +91,7 @@ private:
     std::vector<std::string> registeredFunctions =
         FunctionFactory::Instance().getFunctionNames<IPeakFunction>();
 
-    for (auto & registeredFunction : registeredFunctions) {
+    for (auto &registeredFunction : registeredFunctions) {
       if (blackList.count(registeredFunction) == 0) {
         IPeakFunction_sptr peakFunction =
             boost::dynamic_pointer_cast<IPeakFunction>(
@@ -109,7 +109,7 @@ private:
   void initializePeakFunctions(const std::vector<IPeakFunction_sptr> &peaks,
                                const ParameterSet &parameters) const {
 
-    for (const auto & peak : peaks) {
+    for (const auto &peak : peaks) {
       peak->setCentre(parameters.center);
 
       // for Ikeda-Carpenter it's not allowed to set Fwhm
@@ -136,7 +136,7 @@ private:
   getIntensities(const std::vector<IPeakFunction_sptr> &peaks) const {
     std::vector<double> intensities;
 
-    for (const auto & peak : peaks) {
+    for (const auto &peak : peaks) {
       intensities.push_back(peak->intensity());
     }
 
diff --git a/Framework/DataHandling/src/LoadMask.cpp b/Framework/DataHandling/src/LoadMask.cpp
index 633cbbbca75a3cf903b6ca10f873526b5ba26d28..10661889d027f597427d6020d5c0f2dfc6afa5a4 100644
--- a/Framework/DataHandling/src/LoadMask.cpp
+++ b/Framework/DataHandling/src/LoadMask.cpp
@@ -701,7 +701,7 @@ void LoadMask::convertSpMasksToDetIDs(const API::MatrixWorkspace &sourceWS,
       sourceWS.getDetectorIDToWorkspaceIndexMap(false);
 
   std::multimap<size_t, Mantid::detid_t> spectr2index_map;
-  for (auto & it : sourceDetMap) {
+  for (auto &it : sourceDetMap) {
     spectr2index_map.insert(
         std::pair<size_t, Mantid::detid_t>(it.second, it.first));
   }
@@ -710,10 +710,9 @@ void LoadMask::convertSpMasksToDetIDs(const API::MatrixWorkspace &sourceWS,
     // find spectra number from spectra ID for the source workspace
     const auto itSpec = s2imap.find(i);
     if (itSpec == s2imap.end()) {
-      throw std::runtime_error(
-          "Can not find spectra with ID: " +
-          boost::lexical_cast<std::string>(i) +
-          " in the workspace" + sourceWS.getName());
+      throw std::runtime_error("Can not find spectra with ID: " +
+                               boost::lexical_cast<std::string>(i) +
+                               " in the workspace" + sourceWS.getName());
     }
     size_t specN = itSpec->second;
 
diff --git a/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp b/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp
index b672bc6e373583ee764930ed3a2c1ba3a1ebba46..5cab29da19689c838515eb576eba3c12f86cc655 100644
--- a/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp
+++ b/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp
@@ -669,15 +669,15 @@ MatrixWorkspace_sptr LoadSpiceXML2DDet::createMatrixWorkspaceVersion2(
   }     // END-FOR (xml nodes)
 
   // Add the property to output workspace
-  for (auto & miter : str_log_map) {
+  for (auto &miter : str_log_map) {
     outws->mutableRun().addProperty(
         new PropertyWithValue<std::string>(miter.first, miter.second));
   }
-  for (auto & miter : int_log_map) {
+  for (auto &miter : int_log_map) {
     outws->mutableRun().addProperty(
         new PropertyWithValue<int>(miter.first, miter.second));
   }
-  for (auto & miter : dbl_log_map) {
+  for (auto &miter : dbl_log_map) {
     outws->mutableRun().addProperty(
         new PropertyWithValue<double>(miter.first, miter.second));
   }
@@ -710,7 +710,7 @@ LoadSpiceXML2DDet::parseDetectorNode(const std::string &detvaluestr,
   // file records data in column major)
   size_t num_empty_line = 0;
   size_t num_weird_line = 0;
-  for (auto & vecLine : vecLines) {
+  for (auto &vecLine : vecLines) {
     if (vecLine.empty())
       ++num_empty_line;
     else if (vecLine.size() < 100)
diff --git a/Framework/DataHandling/src/SaveGSS.cpp b/Framework/DataHandling/src/SaveGSS.cpp
index 1c5d47665fbc460305831fa5207c83fec4536242..dd1410209b8a4d931b552b8c9dedadc12d5bf03b 100644
--- a/Framework/DataHandling/src/SaveGSS.cpp
+++ b/Framework/DataHandling/src/SaveGSS.cpp
@@ -442,7 +442,7 @@ void SaveGSS::generateInstrumentHeader(std::stringstream &out,
 
   // write user header first
   if (m_user_specified_gsas_header.size() > 0) {
-    for (const auto & iter : m_user_specified_gsas_header) {
+    for (const auto &iter : m_user_specified_gsas_header) {
       out << iter << "\n";
     }
   }
diff --git a/Framework/DataHandling/test/FindDetectorsParTest.h b/Framework/DataHandling/test/FindDetectorsParTest.h
index 8bf40a8bbc588e7821e762da214aa71090d679f6..5d9785001adf4d766333e00ddf5ef9307c461f33 100644
--- a/Framework/DataHandling/test/FindDetectorsParTest.h
+++ b/Framework/DataHandling/test/FindDetectorsParTest.h
@@ -490,7 +490,7 @@ private:
     cont[2] = " 2.     3.   -4.     5.     6.     2";
 
     std::ofstream testFile(fileName);
-    for (const auto & i : cont) {
+    for (const auto &i : cont) {
       testFile << i << '\n';
     }
     testFile.close();
@@ -503,7 +503,7 @@ private:
     cont[3] = "3.     4.   -5.     6.     7.     3";
 
     std::ofstream testFile(fileName);
-    for (const auto & i : cont) {
+    for (const auto &i : cont) {
       testFile << i << '\n';
     }
     testFile.close();
@@ -516,7 +516,7 @@ private:
     cont[3] = "10         0     5.000     6.000    7.000    8.0000     3";
 
     std::ofstream testFile(fileName);
-    for (const auto & i : cont) {
+    for (const auto &i : cont) {
       testFile << i << '\n';
     }
     testFile.close();
@@ -527,7 +527,7 @@ private:
     cont[1] = "10         0     5.000     6.000    7.000    8.0000     1";
 
     std::ofstream testFile(fileName);
-    for (const auto & i : cont) {
+    for (const auto &i : cont) {
       testFile << i << '\n';
     }
     testFile.close();
diff --git a/Framework/DataHandling/test/LoadCalFileTest.h b/Framework/DataHandling/test/LoadCalFileTest.h
index 3b0d6c53981b6961c4b6c52a01938bc33750e220..d4724f78271a73fff6c2ea9cddd998c628b22d1d 100644
--- a/Framework/DataHandling/test/LoadCalFileTest.h
+++ b/Framework/DataHandling/test/LoadCalFileTest.h
@@ -125,7 +125,7 @@ public:
   }
 
   void tearDown() override {
-    for (auto & i : loadAlgPtrArray) {
+    for (auto &i : loadAlgPtrArray) {
       delete i;
     }
     loadAlgPtrArray.clear();
diff --git a/Framework/DataHandling/test/LoadEventNexusTest.h b/Framework/DataHandling/test/LoadEventNexusTest.h
index 5c1864b653853ee11b26e9fa6d33df46d682e15d..c49541b5900776cee35717aad404ea4a01f5126f 100644
--- a/Framework/DataHandling/test/LoadEventNexusTest.h
+++ b/Framework/DataHandling/test/LoadEventNexusTest.h
@@ -295,7 +295,7 @@ public:
 
     double max = events.begin()->tof();
     double min = events.begin()->tof();
-    for (auto & event : events) {
+    for (auto &event : events) {
       max = event.tof() > max ? event.tof() : max;
       min = event.tof() < min ? event.tof() : min;
     }
diff --git a/Framework/DataHandling/test/LoadEventPreNexus2Test.h b/Framework/DataHandling/test/LoadEventPreNexus2Test.h
index 60ae2b3d852d38da9d9c6cbd5aa37e78f7a0e46d..ab5b1d7a5a81e18776e19f69b2c3f59d17760352 100644
--- a/Framework/DataHandling/test/LoadEventPreNexus2Test.h
+++ b/Framework/DataHandling/test/LoadEventPreNexus2Test.h
@@ -135,7 +135,7 @@ public:
     Types::Core::DateAndTime start = it->first;
 
     std::vector<TofEvent> events1 = ew->getSpectrum(1000).getEvents();
-    for (auto & i : events1) {
+    for (auto &i : events1) {
       std::cout << (i.pulseTime() - start) << " sec \n";
     }
   }
diff --git a/Framework/DataHandling/test/LoadNexusMonitorsTest.h b/Framework/DataHandling/test/LoadNexusMonitorsTest.h
index 262f5ff2ababf96edfa02ea0cd50d7077bdbdfef..b1a87e19a1eb3d00f84184491b0b949dea58fc0c 100644
--- a/Framework/DataHandling/test/LoadNexusMonitorsTest.h
+++ b/Framework/DataHandling/test/LoadNexusMonitorsTest.h
@@ -167,7 +167,7 @@ public:
     // Count output workspaces
     int ws_count = 0;
     auto props = ld1.getProperties();
-    for (auto & prop : props)
+    for (auto &prop : props)
       if (prop->type() == "Workspace")
         ws_count++;
 
@@ -191,7 +191,7 @@ public:
     // Count output workspaces
     ws_count = 0;
     props = ld2.getProperties();
-    for (auto & prop : props)
+    for (auto &prop : props)
       if (prop->type() == "Workspace")
         ws_count++;
 
diff --git a/Framework/DataHandling/test/LoadTest.h b/Framework/DataHandling/test/LoadTest.h
index 9a2622c199902463b3e94f065dfa8002b433700b..8ffc38e739f04daa02a1957a8e31871403cd7d4d 100644
--- a/Framework/DataHandling/test/LoadTest.h
+++ b/Framework/DataHandling/test/LoadTest.h
@@ -112,7 +112,7 @@ public:
     const char *loadraw_props[NUMPROPS] = {
         "SpectrumMin", "SpectrumMax", "SpectrumList", "Cache", "LoadLogFiles"};
     // Basic load has no additional loader properties
-    for (auto & loadraw_prop : loadraw_props) {
+    for (auto &loadraw_prop : loadraw_props) {
       TS_ASSERT_EQUALS(loader.existsProperty(loadraw_prop), false);
     }
     // After setting the file property, the algorithm should have aquired the
@@ -120,7 +120,7 @@ public:
     TS_ASSERT_THROWS_NOTHING(
         loader.setPropertyValue("Filename", "IRS38633.raw"));
     // Now
-    for (auto & loadraw_prop : loadraw_props) {
+    for (auto &loadraw_prop : loadraw_props) {
       TS_ASSERT_EQUALS(loader.existsProperty(loadraw_prop), true);
     }
 
diff --git a/Framework/DataHandling/test/SaveAscii2Test.h b/Framework/DataHandling/test/SaveAscii2Test.h
index dd0602f2785162f55f5b6d52dbf68f565f8bbbaf..26ef97cb2da2a6be07adbe308058cf9807dc7a8e 100644
--- a/Framework/DataHandling/test/SaveAscii2Test.h
+++ b/Framework/DataHandling/test/SaveAscii2Test.h
@@ -68,7 +68,7 @@ public:
     std::getline(in, binlines);
 
     boost::split(binstr, binlines, boost::is_any_of(","));
-    for (const auto & i : binstr) {
+    for (const auto &i : binstr) {
       bins.push_back(boost::lexical_cast<double>(i));
     }
     TS_ASSERT_EQUALS(bins[0], 0);
@@ -78,7 +78,7 @@ public:
     std::getline(in, binlines);
     bins.clear();
     boost::split(binstr, binlines, boost::is_any_of(","));
-    for (const auto & i : binstr) {
+    for (const auto &i : binstr) {
       bins.push_back(boost::lexical_cast<double>(i));
     }
     TS_ASSERT_EQUALS(bins[0], 1.66667);
@@ -165,7 +165,7 @@ public:
     std::getline(in, binlines);
 
     boost::split(binstr, binlines, boost::is_any_of(","));
-    for (const auto & i : binstr) {
+    for (const auto &i : binstr) {
       bins.push_back(boost::lexical_cast<double>(i));
     }
     TS_ASSERT_EQUALS(bins[0], 0);
@@ -175,7 +175,7 @@ public:
     std::getline(in, binlines);
     bins.clear();
     boost::split(binstr, binlines, boost::is_any_of(","));
-    for (const auto & i : binstr) {
+    for (const auto &i : binstr) {
       bins.push_back(boost::lexical_cast<double>(i));
     }
     TS_ASSERT_EQUALS(bins[0], 1.66667);
@@ -589,7 +589,7 @@ public:
     std::getline(in, binlines);
 
     boost::split(binstr, binlines, boost::is_any_of(","));
-    for (const auto & i : binstr) {
+    for (const auto &i : binstr) {
       bins.push_back(boost::lexical_cast<double>(i));
     }
     TS_ASSERT_EQUALS(bins[0], 0);
@@ -599,7 +599,7 @@ public:
     std::getline(in, binlines);
     bins.clear();
     boost::split(binstr, binlines, boost::is_any_of(","));
-    for (const auto & i : binstr) {
+    for (const auto &i : binstr) {
       bins.push_back(boost::lexical_cast<double>(i));
     }
     TS_ASSERT_EQUALS(bins[0], 1.66667);
diff --git a/Framework/DataHandling/test/SavePHXTest.h b/Framework/DataHandling/test/SavePHXTest.h
index 036142ea72648b38f4ce6285ceff442a1df9cfb3..e64993177daf4c788af676c2ce12297c76de5f31 100644
--- a/Framework/DataHandling/test/SavePHXTest.h
+++ b/Framework/DataHandling/test/SavePHXTest.h
@@ -139,7 +139,7 @@ public:
         sample_value[0] = (float)spTW->rowCount();
       } else {
         size_t ii = 0;
-        for (const auto & i : column_name) {
+        for (const auto &i : column_name) {
           sample_value[ii] = (spTW->cell_cast<float>(ic - 1, i));
           ii++;
           if (ii == 1)
diff --git a/Framework/DataObjects/src/Workspace2D.cpp b/Framework/DataObjects/src/Workspace2D.cpp
index 086697eff988de4980c62345a3808495305395b9..031507b1373f2daf03deff8a50c3adaf40e419ed 100644
--- a/Framework/DataObjects/src/Workspace2D.cpp
+++ b/Framework/DataObjects/src/Workspace2D.cpp
@@ -46,7 +46,7 @@ Workspace2D::~Workspace2D() {
   PARALLEL_FOR_IF(Kernel::threadSafe(*this))
   for (int64_t i = 0; i < static_cast<int64_t>(data.size()); i++) {
 #else
-  for (auto & i : data) {
+  for (auto &i : data) {
 #endif
     // Clear out the memory
     delete i;
@@ -107,7 +107,7 @@ void Workspace2D::init(const HistogramData::Histogram &histogram) {
 
   Histogram1D spec(initializedHistogram.xMode(), initializedHistogram.yMode());
   spec.setHistogram(initializedHistogram);
-  for (auto & i : data) {
+  for (auto &i : data) {
     i = new Histogram1D(spec);
   }
 
diff --git a/Framework/DataObjects/test/EventListTest.h b/Framework/DataObjects/test/EventListTest.h
index 1b419d8a0992804fb5de9c1db80a89b0a3f5382c..30b5161f1118f42bbd28559f0c09a25a130fe075 100644
--- a/Framework/DataObjects/test/EventListTest.h
+++ b/Framework/DataObjects/test/EventListTest.h
@@ -1826,7 +1826,7 @@ public:
     }
 
     // Clean the pointers
-    for (auto & output : outputs) {
+    for (auto &output : outputs) {
       delete output.second;
     }
 
@@ -1873,7 +1873,7 @@ public:
     }
 
     // Clean the pointers
-    for (auto & output : outputs) {
+    for (auto &output : outputs) {
       delete output.second;
     }
 
@@ -2310,7 +2310,7 @@ public:
     TS_ASSERT_EQUALS(e7->getNumberEvents(), 1);
 
     // Clean the pointers
-    for (auto & output : outputs) {
+    for (auto &output : outputs) {
       delete output.second;
     }
 
@@ -2382,7 +2382,7 @@ public:
     // TS_ASSERT_EQUALS(e7->getNumberEvents(), 1);
 
     // Clean the pointers
-    for (auto & output : outputs) {
+    for (auto &output : outputs) {
       delete output.second;
     }
 
diff --git a/Framework/DataObjects/test/MDBoxTest.h b/Framework/DataObjects/test/MDBoxTest.h
index 5700c6bbcc1c743982ad2be00622abd4683d6e5e..ab9b56a8a17f71ba2fa5b3924f94f585e2bf6f0f 100644
--- a/Framework/DataObjects/test/MDBoxTest.h
+++ b/Framework/DataObjects/test/MDBoxTest.h
@@ -585,7 +585,7 @@ public:
     coord_t centroid[2] = {0, 0};
     signal_t signal = 0.0;
     b.centroidSphere(sphere, 400., centroid, signal);
-    for (float & d : centroid)
+    for (float &d : centroid)
       d /= static_cast<coord_t>(signal);
 
     // This should be the weighted centroid
@@ -595,10 +595,10 @@ public:
 
     // --- Reset and reduce the radius ------
     signal = 0;
-    for (float & d : centroid)
+    for (float &d : centroid)
       d = 0.0;
     b.centroidSphere(sphere, 16., centroid, signal);
-    for (float & d : centroid)
+    for (float &d : centroid)
       d /= static_cast<coord_t>(signal);
     // Only one event was contained
     TS_ASSERT_DELTA(signal, 2.000, 0.001);
diff --git a/Framework/DataObjects/test/MDGridBoxTest.h b/Framework/DataObjects/test/MDGridBoxTest.h
index 77b0de9c5c7bfdfbe28730aa29338b949c922051..b732a729bba53f27d3ee08336e184739b21adf12 100644
--- a/Framework/DataObjects/test/MDGridBoxTest.h
+++ b/Framework/DataObjects/test/MDGridBoxTest.h
@@ -261,7 +261,7 @@ public:
         new MDGridBox<MDLeanEvent<1>, 1>(*box, newBoxController);
 
     auto boxes = box1->getBoxes();
-    for (auto & box : boxes) {
+    for (auto &box : boxes) {
       TSM_ASSERT_EQUALS(
           "All child boxes should have the same box controller as the parent.",
           newBoxController, box->getBoxController());
@@ -329,7 +329,7 @@ public:
     // Check the boxes
     std::vector<MDBoxBase<MDLeanEvent<3>, 3> *> boxes = g->getBoxes();
     TS_ASSERT_EQUALS(boxes.size(), 10 * 5 * 2);
-    for (auto & box : boxes) {
+    for (auto &box : boxes) {
       MDBox<MDLeanEvent<3>, 3> *box =
           dynamic_cast<MDBox<MDLeanEvent<3>, 3> *>(box);
       TS_ASSERT(box);
@@ -602,7 +602,7 @@ public:
     parent->getBoxes(boxes, 3, false, function);
     TS_ASSERT_EQUALS(boxes.size(), 54);
     // The boxes extents make sense
-    for (auto & box : boxes) {
+    for (auto &box : boxes) {
       TS_ASSERT(box->getExtents(0).getMax() >= 1.51);
     }
 
@@ -611,7 +611,7 @@ public:
     parent->getBoxes(boxes, 3, true, function);
     TS_ASSERT_EQUALS(boxes.size(), 40);
     // The boxes extents make sense
-    for (auto & box : boxes) {
+    for (auto &box : boxes) {
       TS_ASSERT(box->getExtents(0).getMax() >= 1.51);
     }
 
@@ -622,7 +622,7 @@ public:
     boxes.clear();
     parent->getBoxes(boxes, 3, false, function);
     TS_ASSERT_EQUALS(boxes.size(), 33);
-    for (auto & box : boxes) {
+    for (auto &box : boxes) {
       TS_ASSERT(box->getExtents(0).getMax() >= 1.51);
       TS_ASSERT(box->getExtents(0).getMin() <= 2.99);
     }
@@ -631,7 +631,7 @@ public:
     boxes.clear();
     parent->getBoxes(boxes, 3, true, function);
     TS_ASSERT_EQUALS(boxes.size(), 24);
-    for (auto & box : boxes) {
+    for (auto &box : boxes) {
       TS_ASSERT(box->getExtents(0).getMax() >= 1.51);
       TS_ASSERT(box->getExtents(0).getMin() <= 2.99);
     }
@@ -675,7 +675,7 @@ public:
     parent->getBoxes(boxes, 3, false, function);
     TS_ASSERT_EQUALS(boxes.size(), 46);
     // The boxes extents make sense
-    for (auto & box : boxes) {
+    for (auto &box : boxes) {
       TS_ASSERT(box->getExtents(0).getMax() >= 2.00);
       TS_ASSERT(box->getExtents(0).getMin() <= 3.00);
       TS_ASSERT(box->getExtents(1).getMax() >= 2.00);
@@ -690,7 +690,7 @@ public:
         16 + 4 * 4 +
             4); // 16 in the center one + 4x4 at the 4 edges + 4 at the corners
     // The boxes extents make sense
-    for (auto & box : boxes) {
+    for (auto &box : boxes) {
       TS_ASSERT(box->getExtents(0).getMax() >= 2.00);
       TS_ASSERT(box->getExtents(0).getMin() <= 3.00);
       TS_ASSERT(box->getExtents(1).getMax() >= 2.00);
@@ -835,7 +835,7 @@ public:
     // Get all the boxes contained
     std::vector<MDBoxBase<MDLeanEvent<2>, 2> *> boxes = b->getBoxes();
     TS_ASSERT_EQUALS(boxes.size(), 100);
-    for (auto & box : boxes) {
+    for (auto &box : boxes) {
       TS_ASSERT_EQUALS(box->getNPoints(), 1);
       TS_ASSERT_EQUALS(box->getSignal(), 2.0);
       TS_ASSERT_EQUALS(box->getErrorSquared(), 2.0);
@@ -1404,7 +1404,7 @@ public:
                        signal);
     // Normalized
     if (signal != 0.0) {
-      for (float & d : centroid)
+      for (float &d : centroid)
         d /= static_cast<coord_t>(signal);
     }
 
@@ -1629,7 +1629,7 @@ public:
         rng, u);
     for (size_t i = 0; i < num; ++i) {
       double centers[3];
-      for (double & center : centers)
+      for (double &center : centers)
         center = gen();
       // Create and add the event.
       events.push_back(MDLeanEvent<3>(1.0, 1.0, centers));
@@ -1729,11 +1729,11 @@ public:
     coord_t centroid[3];
     for (size_t i = 0; i < 100; i++) {
       signal = 0;
-      for (float & d : centroid)
+      for (float &d : centroid)
         d = 0.0;
       box3b->centroidSphere(sphere, radius * radius, centroid, signal);
       if (signal != 0.0) {
-        for (float & d : centroid)
+        for (float &d : centroid)
           d /= static_cast<coord_t>(signal);
       }
     }
diff --git a/Framework/DataObjects/test/MDHistoWorkspaceIteratorTest.h b/Framework/DataObjects/test/MDHistoWorkspaceIteratorTest.h
index 7e0c5709d98d65c018d4f7ef33442ee43906b8e4..be924a2d48aacda340fa0636c7cf51d4823d72b1 100644
--- a/Framework/DataObjects/test/MDHistoWorkspaceIteratorTest.h
+++ b/Framework/DataObjects/test/MDHistoWorkspaceIteratorTest.h
@@ -681,7 +681,7 @@ public:
     neighbourIndexes = it->findNeighbourIndexesFaceTouching();
     TS_ASSERT_EQUALS(4, neighbourIndexes.size());
     std::vector<size_t> expected_neighbours = {0, 2, 5, 17};
-    for (unsigned long & expected_neighbour : expected_neighbours) {
+    for (unsigned long &expected_neighbour : expected_neighbours) {
       TS_ASSERT(doesContainIndex(neighbourIndexes, expected_neighbour));
     }
 
@@ -693,7 +693,7 @@ public:
     // Is completely enclosed
     expected_neighbours = {17, 20, 22, 25, 5, 37};
 
-    for (unsigned long & expected_neighbour : expected_neighbours) {
+    for (unsigned long &expected_neighbour : expected_neighbours) {
       TS_ASSERT(doesContainIndex(neighbourIndexes, expected_neighbour));
     }
 
@@ -704,7 +704,7 @@ public:
     // Is on edge
     expected_neighbours = {47, 59, 62};
 
-    for (unsigned long & expected_neighbour : expected_neighbours) {
+    for (unsigned long &expected_neighbour : expected_neighbours) {
       TS_ASSERT(doesContainIndex(neighbourIndexes, expected_neighbour));
     }
 
@@ -759,7 +759,7 @@ public:
     TS_ASSERT_EQUALS(11, neighbourIndexes.size());
     std::vector<size_t> expected_neighbours = {0,  2,  4,  5,  6,  16,
                                                17, 18, 20, 21, 22, 22};
-    for (unsigned long & expected_neighbour : expected_neighbours) {
+    for (unsigned long &expected_neighbour : expected_neighbours) {
       TS_ASSERT(doesContainIndex(neighbourIndexes, expected_neighbour));
     }
 
@@ -772,7 +772,7 @@ public:
     expected_neighbours = {0,  1,  2,  4,  5,  6,  8,  9,  10, 16, 17, 18, 22,
                            20, 24, 25, 26, 32, 33, 34, 37, 38, 36, 41, 40, 42};
 
-    for (unsigned long & expected_neighbour : expected_neighbours) {
+    for (unsigned long &expected_neighbour : expected_neighbours) {
       TS_ASSERT(doesContainIndex(neighbourIndexes, expected_neighbour));
     }
 
@@ -783,7 +783,7 @@ public:
     // Is on edge
     expected_neighbours = {42, 43, 46, 47, 58, 59, 62};
 
-    for (unsigned long & expected_neighbour : expected_neighbours) {
+    for (unsigned long &expected_neighbour : expected_neighbours) {
       TS_ASSERT(doesContainIndex(neighbourIndexes, expected_neighbour));
     }
 
diff --git a/Framework/Geometry/src/Rendering/vtkGeometryCacheReader.cpp b/Framework/Geometry/src/Rendering/vtkGeometryCacheReader.cpp
index ac7dce312049595903b0aebee05a73e67905de43..1b770483367e33edc7fba310da1e18134a62b487 100644
--- a/Framework/Geometry/src/Rendering/vtkGeometryCacheReader.cpp
+++ b/Framework/Geometry/src/Rendering/vtkGeometryCacheReader.cpp
@@ -128,7 +128,7 @@ void vtkGeometryCacheReader::readPoints(Poco::XML::Element *pEle,
   if (pEle->getAttribute("format") == "ascii") { // Read from Ascii
     std::stringstream buf;
     buf << pEle->innerText();
-    for (double & point : points) {
+    for (double &point : points) {
       buf >> point;
     }
   }
@@ -155,7 +155,7 @@ void vtkGeometryCacheReader::readTriangles(Poco::XML::Element *pEle,
   if (pEle->getAttribute("format") == "ascii") { // Read from Ascii
     std::stringstream buf;
     buf << pEle->innerText();
-    for (unsigned int & face : faces) {
+    for (unsigned int &face : faces) {
       buf >> face;
     }
   }
diff --git a/Framework/Geometry/test/CSGObjectTest.h b/Framework/Geometry/test/CSGObjectTest.h
index bdbfe99de76674d3d4b0feec6a0bdd179b0927df..4c4050c9375dbc92d5da2d565e33796be1219ba8 100644
--- a/Framework/Geometry/test/CSGObjectTest.h
+++ b/Framework/Geometry/test/CSGObjectTest.h
@@ -1270,12 +1270,12 @@ private:
       SurfLine.push_back(SCompT(73, "s 0.6 0 0 0.4"));
 
     // Note that the testObject now manages the "new Plane"
-    for (const auto & vc : SurfLine) {
+    for (const auto &vc : SurfLine) {
       auto A = Geometry::SurfaceFactory::Instance()->processLine(vc.second);
       TSM_ASSERT("Expected a non-null surface from the factory", A);
       A->setName(vc.first);
-      SMap.insert(STYPE::value_type(vc.first,
-                                    boost::shared_ptr<Surface>(A.release())));
+      SMap.insert(
+          STYPE::value_type(vc.first, boost::shared_ptr<Surface>(A.release())));
     }
 
     return;
diff --git a/Framework/Geometry/test/CenteringGroupTest.h b/Framework/Geometry/test/CenteringGroupTest.h
index d48eed4c235c8e082811db60a5f0def78e27fc81..8db17e52a86d6f3ccfb7cf88d8cc7fae5b96425b 100644
--- a/Framework/Geometry/test/CenteringGroupTest.h
+++ b/Framework/Geometry/test/CenteringGroupTest.h
@@ -65,8 +65,9 @@ private:
     TSM_ASSERT_EQUALS("Unexpected number of operations for " + symbol,
                       ops.size(), expectedOperations.size());
 
-    for (const auto & expectedOperation : expectedOperations) {
-      TSM_ASSERT("Operation " + expectedOperation.identifier() + " not found in " + symbol,
+    for (const auto &expectedOperation : expectedOperations) {
+      TSM_ASSERT("Operation " + expectedOperation.identifier() +
+                     " not found in " + symbol,
                  symOpExistsInCollection(expectedOperation, ops));
     }
 
diff --git a/Framework/Geometry/test/CompositeBraggScattererTest.h b/Framework/Geometry/test/CompositeBraggScattererTest.h
index 50755c0d8ee3578c2defc5468a46c578babc29d9..0ca949e61226c8a4b5f7ec3e58cffe7bf2e2b3a8 100644
--- a/Framework/Geometry/test/CompositeBraggScattererTest.h
+++ b/Framework/Geometry/test/CompositeBraggScattererTest.h
@@ -130,7 +130,7 @@ public:
         spaceGroup->getEquivalentPositions(V3D(0.2, 0.3, 0.4));
 
     CompositeBraggScatterer_sptr coll = CompositeBraggScatterer::create();
-    for (auto & position : positions) {
+    for (auto &position : positions) {
       std::ostringstream strm;
       strm << position;
       coll->addScatterer(getInitializedScatterer("Si", strm.str(), 0.01267));
diff --git a/Framework/Geometry/test/GroupTransformationTest.h b/Framework/Geometry/test/GroupTransformationTest.h
index 7179267816566bc88dd2a49b2bfac504b4560df6..8d54c5029f02ff1f7f1f57e89315b74f0933b651 100644
--- a/Framework/Geometry/test/GroupTransformationTest.h
+++ b/Framework/Geometry/test/GroupTransformationTest.h
@@ -51,7 +51,7 @@ public:
      */
     std::unordered_set<std::string> elements;
     std::vector<SymmetryOperation> ops = transformed.getSymmetryOperations();
-    for (auto & op : ops) {
+    for (auto &op : ops) {
       SymmetryElement_sptr el =
           SymmetryElementFactory::Instance().createSymElement(op);
 
diff --git a/Framework/Geometry/test/IndexingUtilsTest.h b/Framework/Geometry/test/IndexingUtilsTest.h
index f63fc709e951416dd82b9cec793682ffde937f69..e8065f52a91baf0351524d67dbcb381103c1198b 100644
--- a/Framework/Geometry/test/IndexingUtilsTest.h
+++ b/Framework/Geometry/test/IndexingUtilsTest.h
@@ -29,7 +29,7 @@ public:
                                {-0.90478, -0.50667, 0.51072},
                                {-0.50387, -0.58561, 0.43502}};
     // Dec 2011: Change convention for Q = 2 pi / wavelength
-    for (auto & q_vector : q_vectors)
+    for (auto &q_vector : q_vectors)
       q_vector *= (2.0 * M_PI);
     return q_vectors;
   }
@@ -372,7 +372,7 @@ public:
                             {2.66668320, 5.29605670, 7.9653444}};
 
     std::vector<V3D> directions;
-    for (auto & vector : vectors)
+    for (auto &vector : vectors)
       directions.emplace_back(vector[0], vector[1], vector[2]);
 
     double required_tolerance = 0.12;
@@ -410,7 +410,7 @@ public:
                             {2.66668320, 5.29605670, 7.9653444}};
 
     std::vector<V3D> directions;
-    for (auto & vector : vectors)
+    for (auto &vector : vectors)
       directions.emplace_back(vector[0], vector[1], vector[2]);
 
     std::vector<V3D> q_vectors = getNatroliteQs();
@@ -756,7 +756,7 @@ public:
     TS_ASSERT_DELTA(direction_list[7].Z(), -0.211325, 1e-5);
 
     double dot_prod;
-    for (const auto & i : direction_list) {
+    for (const auto &i : direction_list) {
       dot_prod = axis.scalar_prod(i);
       TS_ASSERT_DELTA(dot_prod, 0, 1e-10);
     }
diff --git a/Framework/Geometry/test/PointGroupTest.h b/Framework/Geometry/test/PointGroupTest.h
index a822cebbea2cf300a628823b23944674878ed413..1165941734bb33303285c5758584e801ef92d734 100644
--- a/Framework/Geometry/test/PointGroupTest.h
+++ b/Framework/Geometry/test/PointGroupTest.h
@@ -289,7 +289,7 @@ public:
 
     std::vector<PointGroup_sptr> pointgroups = getAllPointGroups();
 
-    for (auto & pointgroup : pointgroups) {
+    for (auto &pointgroup : pointgroups) {
       TSM_ASSERT_EQUALS(pointgroup->getSymbol() +
                             ": Unexpected crystal system.",
                         pointgroup->crystalSystem(),
@@ -446,7 +446,7 @@ private:
     t.reset();
     int h = 0;
     for (size_t i = 0; i < 1000; ++i) {
-      for (auto & hkl : hkls) {
+      for (auto &hkl : hkls) {
         bool eq = pointGroup->isEquivalent(base, hkl);
         if (eq) {
           ++h;
diff --git a/Framework/Geometry/test/ReflectionConditionTest.h b/Framework/Geometry/test/ReflectionConditionTest.h
index f55d5272e1f7d2c8d378b3d9275a593ee2098b04..c34005420456177dbab7700f19808b5b2ad2f4ba 100644
--- a/Framework/Geometry/test/ReflectionConditionTest.h
+++ b/Framework/Geometry/test/ReflectionConditionTest.h
@@ -58,7 +58,7 @@ public:
     centeringSymbols.insert("H");
 
     std::vector<ReflectionCondition_sptr> refs = getAllReflectionConditions();
-    for (auto & ref : refs) {
+    for (auto &ref : refs) {
       TSM_ASSERT_DIFFERS(ref->getSymbol(),
                          centeringSymbols.find(ref->getSymbol()),
                          centeringSymbols.end());
diff --git a/Framework/Geometry/test/SpaceGroupTest.h b/Framework/Geometry/test/SpaceGroupTest.h
index 1e3dec0ca6e1c1257a78e8060c92b573b6be43e9..363d32d0d38209cac1e440c30d9055b84c1a16b9 100644
--- a/Framework/Geometry/test/SpaceGroupTest.h
+++ b/Framework/Geometry/test/SpaceGroupTest.h
@@ -66,7 +66,7 @@ public:
     SpaceGroup spaceGroup(167, "R-3c", *(group * centering));
 
     std::vector<V3D> byOperator = spaceGroup * V3D(0.3, 0.0, 0.25);
-    for (auto & i : byOperator) {
+    for (auto &i : byOperator) {
       i = getWrappedVector(i);
     }
     std::sort(byOperator.begin(), byOperator.end());
@@ -86,7 +86,7 @@ public:
     SpaceGroup spaceGroup = getSpaceGroupR3m();
 
     std::vector<V3D> byOperator = spaceGroup * V3D(0.5, 0.0, 0.0);
-    for (auto & i : byOperator) {
+    for (auto &i : byOperator) {
       i = getWrappedVector(i);
     }
     std::sort(byOperator.begin(), byOperator.end());
diff --git a/Framework/Geometry/test/SymmetryOperationFactoryTest.h b/Framework/Geometry/test/SymmetryOperationFactoryTest.h
index b1a76628f191e5c8a53f9f161f784fb1d23dbb92..978514be0baf26e1fa2b51bdc70388fee5b5d357 100644
--- a/Framework/Geometry/test/SymmetryOperationFactoryTest.h
+++ b/Framework/Geometry/test/SymmetryOperationFactoryTest.h
@@ -125,7 +125,7 @@ public:
     // Clear factory
     std::vector<std::string> allSymbols =
         SymmetryOperationFactory::Instance().subscribedSymbols();
-    for (auto & symbol : allSymbols) {
+    for (auto &symbol : allSymbols) {
       SymmetryOperationFactory::Instance().unsubscribeSymOp(symbol);
     }
 
@@ -146,7 +146,7 @@ public:
     SymmetryOperationFactory::Instance().unsubscribeSymOp("-x,-y,-z");
 
     // Restore factory
-    for (auto & symbol : allSymbols) {
+    for (auto &symbol : allSymbols) {
       SymmetryOperationFactory::Instance().subscribeSymOp(symbol);
     }
   }
diff --git a/Framework/Kernel/test/ConfigServiceTest.h b/Framework/Kernel/test/ConfigServiceTest.h
index 31b1a01e135d153ba6ab923221d3a751f07472d3..0485fd2b6c03ec15a2bdd0398d9e853e626002aa 100644
--- a/Framework/Kernel/test/ConfigServiceTest.h
+++ b/Framework/Kernel/test/ConfigServiceTest.h
@@ -352,7 +352,7 @@ public:
                      ConfigService::Instance().getInstrumentDirectory());
 
     // check all of the directory entries actually exist
-    for (auto & directoryPath : directories) {
+    for (auto &directoryPath : directories) {
       Poco::File directory(directoryPath);
       TSM_ASSERT(directoryPath + " does not exist", directory.exists());
     }
diff --git a/Framework/Kernel/test/DiskBufferISaveableTest.h b/Framework/Kernel/test/DiskBufferISaveableTest.h
index 20b9639a5e0222a270f2a2452a5c3e6edd652e35..da1a11e73979182cd4d9629178c7b673e2f43a9b 100644
--- a/Framework/Kernel/test/DiskBufferISaveableTest.h
+++ b/Framework/Kernel/test/DiskBufferISaveableTest.h
@@ -90,14 +90,14 @@ public:
   }
 
   void tearDown() override {
-    for (auto & item : data) {
+    for (auto &item : data) {
       delete item;
     }
-    
-    for (auto & bigItem : bigData) {
+
+    for (auto &bigItem : bigData) {
       delete bigItem;
     }
-      
+
     ISaveableTester::fakeFile = "";
   }
   void testIsaveable() {
@@ -434,7 +434,7 @@ public:
   void test_smallCache_writeBuffer() {
     CPUTimer tim;
     DiskBuffer dbuf(3);
-    for (auto & i : data) {
+    for (auto &i : data) {
       dbuf.toWrite(i);
       i->setBusy(false);
     }
@@ -444,11 +444,11 @@ public:
   void test_smallCache_no_writeBuffer() {
     CPUTimer tim;
     DiskBuffer dbuf(0);
-    for (auto & i : data) {
+    for (auto &i : data) {
       i->setBusy(true); // Items won't do any real saving
     }
 
-    for (auto & i : data) {
+    for (auto &i : data) {
       dbuf.toWrite(i);
       i->setBusy(false);
     }
@@ -459,7 +459,7 @@ public:
   void test_largeCache_writeBuffer() {
     CPUTimer tim;
     DiskBuffer dbuf(1000);
-    for (auto & i : data) {
+    for (auto &i : data) {
       dbuf.toWrite(i);
       i->setBusy(false);
     }
@@ -469,7 +469,7 @@ public:
   void test_largeCache_noWriteBuffer() {
     CPUTimer tim;
     DiskBuffer dbuf(0);
-    for (auto & i : data) {
+    for (auto &i : data) {
       dbuf.toWrite(i);
       i->setBusy(false);
     }
diff --git a/Framework/Kernel/test/DiskBufferTest.h b/Framework/Kernel/test/DiskBufferTest.h
index 17df0e8a1cd63f2a80f39dfc7962b73578ba58bb..4911bcdaca6a9e6ba3b12ebbf41990182b86b741 100644
--- a/Framework/Kernel/test/DiskBufferTest.h
+++ b/Framework/Kernel/test/DiskBufferTest.h
@@ -115,7 +115,7 @@ public:
   }
 
   void tearDown() override {
-    for (auto & i : data) {
+    for (auto &i : data) {
       delete i;
     }
   }
@@ -170,7 +170,7 @@ public:
   ////--------------------------------------------------------------------------------
   ///** Sorts by file position when writing to a file */
   void test_writesOutInFileOrder() {
-    for (auto & i : data) {
+    for (auto &i : data) {
       i->setDataChanged();
     }
     // Room for 2 objects of size 2 in the to-write cache
@@ -795,7 +795,7 @@ public:
   void test_withFakeSeeking_withWriteBuffer() {
     CPUTimer tim;
     DiskBuffer dbuf(10);
-    for (auto & i : dataSeek) {
+    for (auto &i : dataSeek) {
       // Pretend you just loaded the data
       i->load(dbuf);
     }
@@ -808,7 +808,7 @@ public:
   void test_withFakeSeeking_noWriteBuffer() {
     CPUTimer tim;
     DiskBuffer dbuf(0);
-    for (auto & i : dataSeek) {
+    for (auto &i : dataSeek) {
       // Pretend you just loaded the data
       i->load(dbuf);
     }
@@ -822,7 +822,7 @@ public:
     CPUTimer tim;
     DiskBuffer dbuf(20);
     dbuf.setFileLength(dataSeek.size());
-    for (auto & i : dataSeek) {
+    for (auto &i : dataSeek) {
       // Pretend you just loaded the data
       i->grow(dbuf, true);
       dbuf.toWrite(i);
@@ -839,7 +839,7 @@ public:
   void test_withFakeSeeking_growingData_savingWithoutUsingMRU() {
     CPUTimer tim;
     DiskBuffer dbuf(dataSeek.size());
-    for (auto & i : dataSeek) {
+    for (auto &i : dataSeek) {
       // Pretend you just loaded the data
       i->grow(dbuf, false);
       i->save();
diff --git a/Framework/Kernel/test/FileDescriptorTest.h b/Framework/Kernel/test/FileDescriptorTest.h
index d2b6f00072d084d951db7b212c894577449d4ae5..a3957fa443394a222a4fb7cc9ff5cfa80d57afd6 100644
--- a/Framework/Kernel/test/FileDescriptorTest.h
+++ b/Framework/Kernel/test/FileDescriptorTest.h
@@ -23,7 +23,7 @@ public:
     auto &cfg = Mantid::Kernel::ConfigService::Instance();
     cfg.reset();
     const auto &dataPaths = cfg.getDataSearchDirs();
-    for (const auto & dataPath : dataPaths) {
+    for (const auto &dataPath : dataPaths) {
       Poco::Path nxsPath(dataPath, "CNCS_7860_event.nxs");
       if (Poco::File(nxsPath).exists())
         m_testNexusPath = nxsPath.toString();
diff --git a/Framework/Kernel/test/GlobTest.h b/Framework/Kernel/test/GlobTest.h
index c2ff7e21d6ca2ade008f1fe13a8e5ec7413a85e7..92057289d2f9d4c1d705e1df05b3e285c0eca443 100644
--- a/Framework/Kernel/test/GlobTest.h
+++ b/Framework/Kernel/test/GlobTest.h
@@ -34,7 +34,7 @@ public:
     TS_ASSERT(files.size() > 0);
 
     size_t matches = 0;
-    for (const auto & file : files) {
+    for (const auto &file : files) {
       Poco::Path path = file;
       std::string project = path[path.depth() - 1];
       if (project == "API")
@@ -95,7 +95,7 @@ public:
     TS_ASSERT(files.size() > 0);
 
     size_t matches = 0;
-    for (const auto & file : files) {
+    for (const auto &file : files) {
       Poco::Path path = file;
       std::string project = path[path.depth() - 1];
       if (project == "API")
diff --git a/Framework/Kernel/test/MutexTest.h b/Framework/Kernel/test/MutexTest.h
index a7398f7569d569f7dfe8cf6eab0ecec556408f67..e85fac873ccaaf6142eb8cf688133ceac5479e01 100644
--- a/Framework/Kernel/test/MutexTest.h
+++ b/Framework/Kernel/test/MutexTest.h
@@ -37,7 +37,7 @@ void unconditional_writer() {
   // do work here, with exclusive access
   shared_data.resize(shared_data.size() + 1, 2.345);
   // Dumb thing to slow down the writer
-  for (double & i : shared_data)
+  for (double &i : shared_data)
     i = 4.567;
   //  std::cout << "Write finished\n";
 }
diff --git a/Framework/Kernel/test/NexusDescriptorTest.h b/Framework/Kernel/test/NexusDescriptorTest.h
index 696985dc9b404cb34bd4887e2e334abb77d47526..0238213b82af62473eaf3d3f791bd9088b895a69 100644
--- a/Framework/Kernel/test/NexusDescriptorTest.h
+++ b/Framework/Kernel/test/NexusDescriptorTest.h
@@ -28,7 +28,7 @@ public:
   NexusDescriptorTest() {
     using Mantid::Kernel::ConfigService;
     auto dataPaths = ConfigService::Instance().getDataSearchDirs();
-    for (auto & dataPath : dataPaths) {
+    for (auto &dataPath : dataPaths) {
       Poco::Path hdf5Path(dataPath, "CNCS_7860_event.nxs");
       if (Poco::File(hdf5Path).exists())
         m_testHDF5Path = hdf5Path.toString();
diff --git a/Framework/Kernel/test/PropertyWithValueTest.h b/Framework/Kernel/test/PropertyWithValueTest.h
index f6ece0cd2a9150cab8e48d0aadabff5efd843c44..6f3d65b5a803244f7a01eee9dd024ef9692453a3 100644
--- a/Framework/Kernel/test/PropertyWithValueTest.h
+++ b/Framework/Kernel/test/PropertyWithValueTest.h
@@ -690,7 +690,7 @@ public:
     auto values = property.allowedValues();
     auto possibilities = OptionalBool::strToEmumMap();
     TSM_ASSERT_EQUALS("3 states allowed", possibilities.size(), values.size());
-    for (auto & value : values) {
+    for (auto &value : values) {
       TSM_ASSERT("value not a known state",
                  possibilities.find(value) != possibilities.end());
     }
diff --git a/Framework/Kernel/test/SobolSequenceTest.h b/Framework/Kernel/test/SobolSequenceTest.h
index f1cd582dc044b830c53a0c96d6d9e0d012abf9c0..3abe083aa37b85a76633d350505102bf5e311f80 100644
--- a/Framework/Kernel/test/SobolSequenceTest.h
+++ b/Framework/Kernel/test/SobolSequenceTest.h
@@ -87,7 +87,7 @@ private:
         {0.75, 0.25, 0.75, 0.25, 0.75},
         {0.25, 0.75, 0.25, 0.75, 0.25},
     };
-    for (auto & expectedValue : expectedValues) {
+    for (auto &expectedValue : expectedValues) {
       const std::vector<double> randPoint = randGen.nextPoint();
       for (std::size_t j = 0; j < 5; ++j) {
         TS_ASSERT_DELTA(randPoint[j], expectedValue[j], 1e-12);
diff --git a/Framework/Kernel/test/ThreadSchedulerTest.h b/Framework/Kernel/test/ThreadSchedulerTest.h
index dd55283e826149a7d167f007e7a91e0a9911e1ca..60be77fbe9b3aa5bf2eac3cf20051a22c12335b9 100644
--- a/Framework/Kernel/test/ThreadSchedulerTest.h
+++ b/Framework/Kernel/test/ThreadSchedulerTest.h
@@ -87,7 +87,7 @@ public:
 
     // And ThreadScheduler does not delete popped tasks in this way
     TS_ASSERT_EQUALS(ThreadSchedulerTest_numDestructed, 0);
-    for (auto & task : tasks) {
+    for (auto &task : tasks) {
       delete task;
     }
   }
diff --git a/Framework/Kernel/test/UsageServiceTest.h b/Framework/Kernel/test/UsageServiceTest.h
index 20e3b45b795230d7971833ccabe7ae9c6a6e39b1..022d88b7c38e1c3e6a1086a81e9747cd76df5300 100644
--- a/Framework/Kernel/test/UsageServiceTest.h
+++ b/Framework/Kernel/test/UsageServiceTest.h
@@ -101,7 +101,7 @@ public:
     }
 
     auto features = root["features"];
-    for (auto & feature : features) {
+    for (auto &feature : features) {
       std::string name = feature["name"].asString();
       std::string type = feature["type"].asString();
       bool internal = feature["internal"].asBool();
diff --git a/Framework/MDAlgorithms/test/LoadMDTest.h b/Framework/MDAlgorithms/test/LoadMDTest.h
index bc0c3cdc4698b42af757008629a15fdf4b04b561..34b6fc485f41323ff6e15547f12d583529dbd31c 100644
--- a/Framework/MDAlgorithms/test/LoadMDTest.h
+++ b/Framework/MDAlgorithms/test/LoadMDTest.h
@@ -253,7 +253,7 @@ public:
 
       typename std::vector<API::IMDNode *> boxes;
       ws->getBox()->getBoxes(boxes, 1000, false);
-      for (auto & boxe : boxes) {
+      for (auto &boxe : boxes) {
         MDBox<MDE, nd> *box = dynamic_cast<MDBox<MDE, nd> *>(boxe);
         if (box) {
           TSM_ASSERT("Large box should not be in memory",
diff --git a/Framework/MDAlgorithms/test/MDTransfQ3DTest.h b/Framework/MDAlgorithms/test/MDTransfQ3DTest.h
index 9e544bdfbabf51fd92375f077450e9d64920f25b..81f46d2f193900426196cd693d57bf6db14b7fa1 100644
--- a/Framework/MDAlgorithms/test/MDTransfQ3DTest.h
+++ b/Framework/MDAlgorithms/test/MDTransfQ3DTest.h
@@ -116,7 +116,7 @@ public:
     // testing purposes here
     auto &TwoTheta = const_cast<std::vector<double> &>(
         WSDescr.m_PreprDetTable->getColVector<double>("TwoTheta"));
-    for (double & i : TwoTheta) {
+    for (double &i : TwoTheta) {
       i = 0;
     }
 
diff --git a/Framework/MDAlgorithms/test/MergeMDFilesTest.h b/Framework/MDAlgorithms/test/MergeMDFilesTest.h
index 3ce1e665ca311b15e02deba268681e8007f2335e..f20739fa83960da1c54e4bbcac27280ab4332df2 100644
--- a/Framework/MDAlgorithms/test/MergeMDFilesTest.h
+++ b/Framework/MDAlgorithms/test/MergeMDFilesTest.h
@@ -102,7 +102,7 @@ public:
     }
 
     // Cleanup generated input files
-    for (auto & inWorkspace : inWorkspaces) {
+    for (auto &inWorkspace : inWorkspaces) {
       if (inWorkspace->getBoxController()->isFileBacked()) {
         std::string fileName =
             inWorkspace->getBoxController()->getFileIO()->getFileName();
diff --git a/Framework/MDAlgorithms/test/ReplicateMDTest.h b/Framework/MDAlgorithms/test/ReplicateMDTest.h
index 30b0ac4944361f77e15d9846690edfa8dedb659e..68a25f36780b881b47c7d48d55b81ec46aa82802 100644
--- a/Framework/MDAlgorithms/test/ReplicateMDTest.h
+++ b/Framework/MDAlgorithms/test/ReplicateMDTest.h
@@ -77,7 +77,7 @@ MDHistoWorkspace_sptr makeHistoWorkspace(const std::vector<int> &shape,
     // Generate the axis order 0, 1, 2 ... in reverse
     std::vector<int> axes(outWs->getNumDims());
     Decreasing op(outWs->getNumDims());
-    for (int & axis : axes) {
+    for (int &axis : axes) {
       axis = static_cast<int>(op());
     }
 
diff --git a/Framework/MDAlgorithms/test/TobyFitYVectorTest.h b/Framework/MDAlgorithms/test/TobyFitYVectorTest.h
index c1300285c2aaec30a36a6d998bf27fd5670be9f5..497046f3e9303c9447cb8ac37c03d744cf8efd5f 100644
--- a/Framework/MDAlgorithms/test/TobyFitYVectorTest.h
+++ b/Framework/MDAlgorithms/test/TobyFitYVectorTest.h
@@ -45,7 +45,7 @@ public:
                             "DetectorArea",  "DetectionTime"};
 
     TobyFitYVector yVector;
-    for (auto & attr : attrs) {
+    for (auto &attr : attrs) {
       yVector.setAttribute(attr, IFunction::Attribute(false));
     }
 
diff --git a/Framework/PythonInterface/mantid/dataobjects/src/Exports/Workspace2D.cpp b/Framework/PythonInterface/mantid/dataobjects/src/Exports/Workspace2D.cpp
index 3428d41720eabb812c60c761c5b3da08668eeb30..f19bdbe5279cc847b036f58f84edb397b19a2ec6 100644
--- a/Framework/PythonInterface/mantid/dataobjects/src/Exports/Workspace2D.cpp
+++ b/Framework/PythonInterface/mantid/dataobjects/src/Exports/Workspace2D.cpp
@@ -72,7 +72,7 @@ public:
       const auto &spectrumDefinition = (*spectrumDefinitions)[i];
       std::vector<size_t> detectorIndices;
 
-      for (const auto & j : spectrumDefinition) {
+      for (const auto &j : spectrumDefinition) {
         size_t detectorIndex = j.first;
         detectorIndices.emplace_back(std::move(detectorIndex));
       }
diff --git a/Framework/RemoteAlgorithms/test/AbortRemoteJob2Test.h b/Framework/RemoteAlgorithms/test/AbortRemoteJob2Test.h
index 40becff6f14466a044c6b9d5e10505251b1c1b28..56c48dc08ff1c944c96ab380958580ebb881d5a6 100644
--- a/Framework/RemoteAlgorithms/test/AbortRemoteJob2Test.h
+++ b/Framework/RemoteAlgorithms/test/AbortRemoteJob2Test.h
@@ -98,7 +98,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/AbortRemoteJobTest.h b/Framework/RemoteAlgorithms/test/AbortRemoteJobTest.h
index 5e9602f3f9b532b7c73f8de509521d9162c08ceb..5583ee32899f8f8fbe4efe3aa66be25cf41551e3 100644
--- a/Framework/RemoteAlgorithms/test/AbortRemoteJobTest.h
+++ b/Framework/RemoteAlgorithms/test/AbortRemoteJobTest.h
@@ -96,7 +96,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/Authenticate2Test.h b/Framework/RemoteAlgorithms/test/Authenticate2Test.h
index a1317b264cbb6c6a92a900aea46f0c2a6b423293..3dfb66430a7fce1d0b1849ac5c770dcb839f3c9a 100644
--- a/Framework/RemoteAlgorithms/test/Authenticate2Test.h
+++ b/Framework/RemoteAlgorithms/test/Authenticate2Test.h
@@ -99,7 +99,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/AuthenticateTest.h b/Framework/RemoteAlgorithms/test/AuthenticateTest.h
index 052af5b8b8abdfe0946d90115148c884a18a5edc..f8a074242f205f8ce09c098838000745fbcfe89a 100644
--- a/Framework/RemoteAlgorithms/test/AuthenticateTest.h
+++ b/Framework/RemoteAlgorithms/test/AuthenticateTest.h
@@ -99,7 +99,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/DownloadRemoteFile2Test.h b/Framework/RemoteAlgorithms/test/DownloadRemoteFile2Test.h
index 9f22226670b954a825367287e47aacce5bd66cd3..9d5dc8c434648c3fd88f6bfb5e014fe6f3ec6ba9 100644
--- a/Framework/RemoteAlgorithms/test/DownloadRemoteFile2Test.h
+++ b/Framework/RemoteAlgorithms/test/DownloadRemoteFile2Test.h
@@ -104,7 +104,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/DownloadRemoteFileTest.h b/Framework/RemoteAlgorithms/test/DownloadRemoteFileTest.h
index 36f6ee0e4ddc6d23e9dfd8407bca0ec65bc865e8..7ecc3244762fe770139e72cec2ab2480527fdd3d 100644
--- a/Framework/RemoteAlgorithms/test/DownloadRemoteFileTest.h
+++ b/Framework/RemoteAlgorithms/test/DownloadRemoteFileTest.h
@@ -104,7 +104,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/Logout2Test.h b/Framework/RemoteAlgorithms/test/Logout2Test.h
index 7572c52513766b6ff7f99d44fe1ba4227f54cdf2..fc271f6d8ac4913e3a8e47cefbe5159270382d0f 100644
--- a/Framework/RemoteAlgorithms/test/Logout2Test.h
+++ b/Framework/RemoteAlgorithms/test/Logout2Test.h
@@ -72,7 +72,7 @@ public:
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
     // test that job managers are created correctly for different facilities
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/QueryAllRemoteJobs2Test.h b/Framework/RemoteAlgorithms/test/QueryAllRemoteJobs2Test.h
index 7a0b97f2c588c9c37aa07a51e59b9f07d39691d3..6ec451c56581c8770b17b03554ee0148576f0832 100644
--- a/Framework/RemoteAlgorithms/test/QueryAllRemoteJobs2Test.h
+++ b/Framework/RemoteAlgorithms/test/QueryAllRemoteJobs2Test.h
@@ -81,7 +81,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const auto facName = testFacility.first;
       const auto compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/QueryAllRemoteJobsTest.h b/Framework/RemoteAlgorithms/test/QueryAllRemoteJobsTest.h
index b544d032b0c037ae63a78abc0e61843cfe0bc55e..da759801f3c9dc1e7defd69c7b643df203f7b7b4 100644
--- a/Framework/RemoteAlgorithms/test/QueryAllRemoteJobsTest.h
+++ b/Framework/RemoteAlgorithms/test/QueryAllRemoteJobsTest.h
@@ -81,7 +81,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/QueryRemoteFile2Test.h b/Framework/RemoteAlgorithms/test/QueryRemoteFile2Test.h
index d74e168ae7080d1f89b13d6173d7e3375b5963da..3d02988843a9902d9fbf23b3bf8f8ff49cb14dcd 100644
--- a/Framework/RemoteAlgorithms/test/QueryRemoteFile2Test.h
+++ b/Framework/RemoteAlgorithms/test/QueryRemoteFile2Test.h
@@ -91,7 +91,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/QueryRemoteFileTest.h b/Framework/RemoteAlgorithms/test/QueryRemoteFileTest.h
index d91419852961a1f40b940961b86e669ec5958ab0..04427da07913f098b849e41bd1a7e3b8ff116690 100644
--- a/Framework/RemoteAlgorithms/test/QueryRemoteFileTest.h
+++ b/Framework/RemoteAlgorithms/test/QueryRemoteFileTest.h
@@ -91,7 +91,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/QueryRemoteJob2Test.h b/Framework/RemoteAlgorithms/test/QueryRemoteJob2Test.h
index f5c530592d7aefe2c7e4934121d06b672319185f..bd7403c56412350f1fe202b5e21305b6e8a5ed00 100644
--- a/Framework/RemoteAlgorithms/test/QueryRemoteJob2Test.h
+++ b/Framework/RemoteAlgorithms/test/QueryRemoteJob2Test.h
@@ -90,7 +90,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/QueryRemoteJobTest.h b/Framework/RemoteAlgorithms/test/QueryRemoteJobTest.h
index a664f8f8b47ed8af9cfb47a2705024c75d583efc..97cd9d135e08eb93b6a68dfe21d9764db1110f68 100644
--- a/Framework/RemoteAlgorithms/test/QueryRemoteJobTest.h
+++ b/Framework/RemoteAlgorithms/test/QueryRemoteJobTest.h
@@ -88,7 +88,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/StartRemoteTransaction2Test.h b/Framework/RemoteAlgorithms/test/StartRemoteTransaction2Test.h
index d2f4959d20f86f58ca32be84c6e2d932e4adc6bc..f6c86ce31953bffdd1728b190f8632c70fb9b699 100644
--- a/Framework/RemoteAlgorithms/test/StartRemoteTransaction2Test.h
+++ b/Framework/RemoteAlgorithms/test/StartRemoteTransaction2Test.h
@@ -91,7 +91,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/StartRemoteTransactionTest.h b/Framework/RemoteAlgorithms/test/StartRemoteTransactionTest.h
index d232d3a4e77ebcde4ae89a5e296026d2a977c055..006b409dfc69eac3637480befba8760e2d1935b8 100644
--- a/Framework/RemoteAlgorithms/test/StartRemoteTransactionTest.h
+++ b/Framework/RemoteAlgorithms/test/StartRemoteTransactionTest.h
@@ -91,7 +91,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/StopRemoteTransaction2Test.h b/Framework/RemoteAlgorithms/test/StopRemoteTransaction2Test.h
index 3b3d66e2359fcb64782612bdaa7f673654788da1..1c3cf78170dea502db28def9f2448060f03ce680 100644
--- a/Framework/RemoteAlgorithms/test/StopRemoteTransaction2Test.h
+++ b/Framework/RemoteAlgorithms/test/StopRemoteTransaction2Test.h
@@ -93,7 +93,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/StopRemoteTransactionTest.h b/Framework/RemoteAlgorithms/test/StopRemoteTransactionTest.h
index c9f6ba979afd2b97a7338280922962d4e530da2f..1449876e8363727b357506bf0e68bb2425e4c426 100644
--- a/Framework/RemoteAlgorithms/test/StopRemoteTransactionTest.h
+++ b/Framework/RemoteAlgorithms/test/StopRemoteTransactionTest.h
@@ -93,7 +93,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/SubmitRemoteJob2Test.h b/Framework/RemoteAlgorithms/test/SubmitRemoteJob2Test.h
index ee14d4fd0749898e07b7fecf2530c357f314ed0a..edf6b121523379bcc75c4bb8446ec34ca0dafae2 100644
--- a/Framework/RemoteAlgorithms/test/SubmitRemoteJob2Test.h
+++ b/Framework/RemoteAlgorithms/test/SubmitRemoteJob2Test.h
@@ -157,7 +157,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/SubmitRemoteJobTest.h b/Framework/RemoteAlgorithms/test/SubmitRemoteJobTest.h
index b27935acc85bbc6ff4d793029ca93b7ec2a079a5..cbe9053f8adacb5e5a8dd02aa803bfab73ddaca9 100644
--- a/Framework/RemoteAlgorithms/test/SubmitRemoteJobTest.h
+++ b/Framework/RemoteAlgorithms/test/SubmitRemoteJobTest.h
@@ -157,7 +157,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/UploadRemoteFile2Test.h b/Framework/RemoteAlgorithms/test/UploadRemoteFile2Test.h
index d1f65177c03242a29bc3aa60a57b2900e4899576..18a8031f5f8a746cce99dc3ca8f9edc37d841863 100644
--- a/Framework/RemoteAlgorithms/test/UploadRemoteFile2Test.h
+++ b/Framework/RemoteAlgorithms/test/UploadRemoteFile2Test.h
@@ -124,7 +124,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/RemoteAlgorithms/test/UploadRemoteFileTest.h b/Framework/RemoteAlgorithms/test/UploadRemoteFileTest.h
index 9aaf1ac4cffa2e41b2eeb9cbf6eda9140dd82e7f..1801ad928e076d38b790737633f711926a4e047f 100644
--- a/Framework/RemoteAlgorithms/test/UploadRemoteFileTest.h
+++ b/Framework/RemoteAlgorithms/test/UploadRemoteFileTest.h
@@ -124,7 +124,7 @@ public:
 
     const Mantid::Kernel::FacilityInfo &prevFac =
         Mantid::Kernel::ConfigService::Instance().getFacility();
-    for (auto & testFacility : testFacilities) {
+    for (auto &testFacility : testFacilities) {
       const std::string facName = testFacility.first;
       const std::string compName = testFacility.second;
 
diff --git a/Framework/SINQ/test/PoldiFitPeaks1D2Test.h b/Framework/SINQ/test/PoldiFitPeaks1D2Test.h
index 1b89f3a932e4ff3b2a2000e22052361327401ea8..9fd47f6fd0c2be607cc041f921ecb003aff2f43b 100644
--- a/Framework/SINQ/test/PoldiFitPeaks1D2Test.h
+++ b/Framework/SINQ/test/PoldiFitPeaks1D2Test.h
@@ -100,7 +100,7 @@ public:
     std::vector<Property *> properties = fitPeaks1D.getProperties();
     std::unordered_set<std::string> names;
 
-    for (auto & property : properties) {
+    for (auto &property : properties) {
       names.insert(property->name());
     }
 
diff --git a/Framework/SINQ/test/PoldiFitPeaks1DTest.h b/Framework/SINQ/test/PoldiFitPeaks1DTest.h
index a58aad85ea0e2269da17851ad614a54dae8cecdf..e8ff092bb0c1a0535d88eddd36673cabed47ed9c 100644
--- a/Framework/SINQ/test/PoldiFitPeaks1DTest.h
+++ b/Framework/SINQ/test/PoldiFitPeaks1DTest.h
@@ -102,7 +102,7 @@ public:
     std::vector<Property *> properties = fitPeaks1D.getProperties();
     std::unordered_set<std::string> names;
 
-    for (auto & property : properties) {
+    for (auto &property : properties) {
       names.insert(property->name());
     }
 
diff --git a/Framework/SINQ/test/PoldiIndexKnownCompoundsTest.h b/Framework/SINQ/test/PoldiIndexKnownCompoundsTest.h
index 053f06a7d7c4ee65080f914983c4c0728b4b6935..302ef9bc8294228df0a9c860c3078b5ae7149a1d 100644
--- a/Framework/SINQ/test/PoldiIndexKnownCompoundsTest.h
+++ b/Framework/SINQ/test/PoldiIndexKnownCompoundsTest.h
@@ -669,7 +669,7 @@ private:
   }
 
   void storeRandomWorkspaces(const std::vector<std::string> &wsNames) {
-    for (const auto & wsName : wsNames) {
+    for (const auto &wsName : wsNames) {
       WorkspaceCreationHelper::storeWS(
           wsName, WorkspaceCreationHelper::create1DWorkspaceRand(10, true));
     }
@@ -684,7 +684,7 @@ private:
   }
 
   void removeRandomWorkspaces(const std::vector<std::string> &wsNames) {
-    for (const auto & wsName : wsNames) {
+    for (const auto &wsName : wsNames) {
       WorkspaceCreationHelper::removeWS(wsName);
     }
   }
diff --git a/Framework/SINQ/test/PoldiPeakSearchTest.h b/Framework/SINQ/test/PoldiPeakSearchTest.h
index 4b670f6df36e3a76203b32b4004073b3555f0b13..b4534d07500df0e93ae8d2996ae5fdf9f91e9da5 100644
--- a/Framework/SINQ/test/PoldiPeakSearchTest.h
+++ b/Framework/SINQ/test/PoldiPeakSearchTest.h
@@ -123,7 +123,7 @@ public:
     std::vector<double> testXData(testYData.size());
 
     double x = 0.0;
-    for (double & iterX : testXData) {
+    for (double &iterX : testXData) {
       x += 1.0;
       iterX = x;
     }
diff --git a/Framework/ScriptRepository/test/ScriptRepositoryTestImpl.h b/Framework/ScriptRepository/test/ScriptRepositoryTestImpl.h
index ee1de6b499749b5936276a129b94d8a4d7ea7c57..d8fe26e372db5718eba173512ecd74a91afe33b7 100644
--- a/Framework/ScriptRepository/test/ScriptRepositoryTestImpl.h
+++ b/Framework/ScriptRepository/test/ScriptRepositoryTestImpl.h
@@ -363,7 +363,7 @@ public:
     TS_ASSERT_THROWS_NOTHING(list_files = repo->listFiles());
     TS_ASSERT(list_files.size() == 5);
     // check that all the files at the central repository are inside
-    for (auto & test_entry : test_entries)
+    for (auto &test_entry : test_entries)
       TSM_ASSERT_THROWS_NOTHING(test_entry, repo->info(test_entry));
   }
 
@@ -478,7 +478,7 @@ public:
     TS_ASSERT_THROWS_NOTHING(list_of_files = repo->listFiles());
 
     std::cout << "After update, the files are: ";
-    for (auto & list_of_file : list_of_files) {
+    for (auto &list_of_file : list_of_files) {
       std::cout << list_of_file << ", ";
     }
     std::cout << '\n';