diff --git a/Code/Mantid/Framework/CurveFitting/src/FitPowderDiffPeaks.cpp b/Code/Mantid/Framework/CurveFitting/src/FitPowderDiffPeaks.cpp
index 57c7b9ffd04e33b1c3bc96c8daf55e12e012f952..8f4fc28e8ecb906617fa6b48fec0b403eb7e1863 100644
--- a/Code/Mantid/Framework/CurveFitting/src/FitPowderDiffPeaks.cpp
+++ b/Code/Mantid/Framework/CurveFitting/src/FitPowderDiffPeaks.cpp
@@ -1297,7 +1297,7 @@ namespace CurveFitting
     compfunction->addFunction(background);
 
     // iv.  Calculate the composite function
-    if (tofs.size() == 0)
+    if (tofs.empty())
     {
       g_log.warning() << "[CalculateSinglePeak] Domain Size (number of TOF points) = 0" << endl;
       return;
diff --git a/Code/Mantid/Framework/DataHandling/src/FakeISISHistoDAE.cpp b/Code/Mantid/Framework/DataHandling/src/FakeISISHistoDAE.cpp
index a0abcae9c2d142407318878d2edb5d98920c5f1e..e2bffb072c6873d708f75f2a25007773ad4b16a2 100644
--- a/Code/Mantid/Framework/DataHandling/src/FakeISISHistoDAE.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/FakeISISHistoDAE.cpp
@@ -32,6 +32,7 @@ typedef struct
 	int pad[1];
 	// cppcheck-suppress unusedStructMember
 	char user[32];
+	// cppcheck-suppress unusedStructMember
 	char host[64];
 }  isisds_open_t;
 
diff --git a/Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp b/Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp
index c3978ccd034d1d6295b9d6f3420c1781e44479f7..da0099080446f0db86a92a6eec1b8bde620b1a04 100644
--- a/Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp
@@ -501,7 +501,7 @@ namespace Mantid
       Kernel::DateAndTime start_time = Kernel::DateAndTime(start);
       std::string time_units;
       file.getAttr("units", time_units);
-      if( time_units.find("second") != 0 && time_units != "s"
+      if( time_units.compare("second") < 0 && time_units != "s"
           && time_units != "minutes" ) //Can be s/second/seconds/minutes
       {
         file.closeData();
diff --git a/Code/Mantid/Framework/DataHandling/src/SNSLiveEventDataListener.cpp b/Code/Mantid/Framework/DataHandling/src/SNSLiveEventDataListener.cpp
index 02e5bd2ccde9873913d6e248f94f3320328b0277..0a56d6511263bfa683eca87afe94272b3c7860a2 100644
--- a/Code/Mantid/Framework/DataHandling/src/SNSLiveEventDataListener.cpp
+++ b/Code/Mantid/Framework/DataHandling/src/SNSLiveEventDataListener.cpp
@@ -143,7 +143,6 @@ namespace DataHandling
     if (m_isConnected == false) // sanity check
     {
       throw std::runtime_error( std::string("SNSLiveEventDataListener::run(): No connection to SMS server."));
-      // cppcheck-suppress duplicateBreak
       return;  // should never be called, but here just in case exceptions are disabled
     }
 
diff --git a/Code/Mantid/Framework/Geometry/src/Instrument/CompAssembly.cpp b/Code/Mantid/Framework/Geometry/src/Instrument/CompAssembly.cpp
index 1f74ed93d4a1d16caace5291ed807c2f9caf75a0..f7fcdfa17ffb19876faa047f8f67b7e0fe6c0825 100644
--- a/Code/Mantid/Framework/Geometry/src/Instrument/CompAssembly.cpp
+++ b/Code/Mantid/Framework/Geometry/src/Instrument/CompAssembly.cpp
@@ -422,7 +422,6 @@ void CompAssembly::testIntersectionWithChildren(Track & testRay, std::deque<ICom
  */
 void CompAssembly::printChildren(std::ostream& os) const
 {
-  std::vector<IComponent*>::const_iterator it;
   for (int i=0;i<nelements();i++)
   {
       boost::shared_ptr<IComponent> it = (*this)[i];
@@ -439,7 +438,6 @@ void CompAssembly::printChildren(std::ostream& os) const
  */
 void CompAssembly::printTree(std::ostream& os) const
 {
-  std::vector<IComponent*>::const_iterator it;
   for (int i=0;i<nelements();i++)
   {
     boost::shared_ptr<IComponent> it = (*this)[i];
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/DampedHisenbergFMSW.cpp b/Code/Mantid/Framework/MDAlgorithms/src/DampedHisenbergFMSW.cpp
index c2216fcb83ce0d17bd277a72b7cc8403ebeb2d93..dde9f955c4e88900968446158b8d083d4ce474e5 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/DampedHisenbergFMSW.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/DampedHisenbergFMSW.cpp
@@ -68,7 +68,6 @@ namespace Mantid
       const double qh = qhkl[0]; //
       const double qk = qhkl[1];
       const double ql = qhkl[2];
-      const double t2mev = 1.0/11.6045;
 
       const double amp = params[0];
       const double gap = params[1];
@@ -96,7 +95,10 @@ namespace Mantid
       if ( ! m_lovesey )
         gamma = gam;
       else
+      {
+        const double t2mev = 1.0/11.6045;
         gamma = dampingScale*gam * js1*gamFM ((wdisp-gap)/js1, t2mev*temp/js1, spin);
+      }
 
       //    Calculate the weight:
       double weight;
@@ -138,13 +140,19 @@ namespace Mantid
       //     gamFM   gam / 2JS
       //
       double zi,gamFm;
-      const double clo=8.0*2.153733998748905e-4, chi=8.0*1.497758900089e-4, zi0=5.009958e-2;
+      const double zi0=5.009958e-2;
 
       zi = e/t;
       if (fabs(zi) > zi0)
+      {
+        const double chi=8.0*1.497758900089e-4;
         gamFm = (chi/pow(s,2)) * pow(t,4) * sqrt(pow(fabs(zi),3));
+      }
       else
+      {
+        const double clo=8.0*2.153733998748905e-4;
         gamFm = (clo/pow(s,2)) * pow(t,4) * (pow(zi,2))*( pow(log(fabs(zi)),2)/6.0 - log(fabs(zi))/1.8 - 0.05 );
+      }
 
       return gamFm;
     }
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MagneticFormFactor.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MagneticFormFactor.cpp
index 317f89b349be898ce5b413f70d70630c8320921d..0380737047e15134c83d5ade6ce77eb2b6a5757a 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MagneticFormFactor.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MagneticFormFactor.cpp
@@ -5,29 +5,29 @@
 
 namespace Mantid
 {
-    namespace MDAlgorithms
-    {
+  namespace MDAlgorithms
+  {
 
     const double MagneticFormFactor::m_qSquMax=36.*M_PI*M_PI;
 
     MagneticFormFactor::MagneticFormFactor(const int atomicNo, const int ionisation, const int tableSize)
-	{
-    	setFormFactor(atomicNo, ionisation, tableSize);
-    	//TODO check parameters and build table
-	}
+    {
+      setFormFactor(atomicNo, ionisation, tableSize);
+      //TODO check parameters and build table
+    }
 
     double MagneticFormFactor::formTable(const double qSquared) const
     {
-    	//TODO implement tables and look up
-    	return form(qSquared);
+      //TODO implement tables and look up
+      return form(qSquared);
     }
 
     void MagneticFormFactor::setFormFactor(const int atomicNo, const int ionisation, const int tableSize)
     {
-        UNUSED_ARG(tableSize);
-        getCoefficients(atomicNo,ionisation,m_formCoeffs);
-        // if( formCoeffs[0]<0 ) ...
-        //TODO check parameters and build table
+      UNUSED_ARG(tableSize);
+      getCoefficients(atomicNo,ionisation,m_formCoeffs);
+      // if( formCoeffs[0]<0 ) ...
+      //TODO check parameters and build table
     }
 
     double MagneticFormFactor::form(const double qSqu) const
@@ -55,105 +55,6 @@ namespace Mantid
 
     void MagneticFormFactor::getCoefficients(const int atomicNo, const int ionisation, std::vector<double> & array)
     {
-      double formValues[95][10] = {
-        { 21   ,0  ,0.2512  ,90.030  ,0.3290  ,39.402  ,0.4235 ,14.322 ,-0.0043  ,0.2029 },
-        { 21   ,1  ,0.4889  ,51.160  ,0.5203  ,14.076 ,-0.0286  ,0.179  ,0.0185  ,0.1217 },
-        { 21   ,2  ,0.5048  ,31.403  ,0.5186  ,10.990 ,-0.0241  ,1.183  ,0.0000  ,0.0578 },
-        { 22   ,0  ,0.4657  ,33.590  ,0.5490  ,9.879  ,-0.0291  ,0.323  ,0.0123  ,0.1088 },
-        { 22   ,1  ,0.5093  ,36.703  ,0.5032  ,10.371 ,-0.0263  ,0.311  ,0.0116  ,0.1125 },
-        { 22   ,2  ,0.5091  ,24.976  ,0.5162   ,8.757 ,-0.6281  ,0.916  ,0.0015  ,0.0589 },
-        { 22   ,3  ,0.3571  ,22.841  ,0.6688   ,8.931 ,-0.0354  ,0.483  ,0.0099  ,0.0575 },
-        { 23   ,0  ,0.4086  ,28.811  ,0.6077   ,8.544 ,-0.0295  ,0.277  ,0.0123  ,0.0970 },
-        { 23   ,1  ,0.4444  ,32.648  ,0.5683   ,9.097 ,-0.2285  ,0.022  ,0.2150  ,0.1111 },
-        { 23   ,2  ,0.4085  ,23.853  ,0.6091   ,8.246 ,-0.1676  ,0.041  ,0.1496  ,0.0593 },
-        { 23   ,3  ,0.3598  ,19.336  ,0.6632   ,7.617 ,-0.3064  ,0.030  ,0.2835  ,0.0515 },
-        { 23   ,4  ,0.3106  ,16.816  ,0.7198   ,7.049 ,-0.0521  ,0.302  ,0.0221  ,0.0433 },
-        { 24   ,0  ,0.1135  ,45.199  ,0.3481  ,19.493  ,0.5477  ,7.354 ,-0.0092  ,0.1975 },
-        { 24   ,1 ,-0.0977   ,0.047  ,0.4544  ,26.005  ,0.5579  ,7.489  ,0.0831  ,0.1114 },
-        { 24   ,2  ,1.2024  ,-0.005  ,0.4158  ,20.548  ,0.6032  ,6.956 ,-1.2218  ,0.0572 },
-        { 24   ,3 ,-0.3094   ,0.027  ,0.3680  ,17.035  ,0.6559  ,6.524  ,0.2856  ,0.0436 },
-        { 24   ,4 ,-0.2320   ,0.043  ,0.3101  ,14.952  ,0.7182  ,6.173  ,0.2042  ,0.0419 },
-        { 25   ,0  ,0.2438  ,24.963  ,0.1472  ,15.673  ,0.6189  ,6.540 ,-0.0105  ,0.1748 },
-        { 25   ,1 ,-0.0138   ,0.421  ,0.4231  ,24.668  ,0.5905  ,6.655 ,-0.0010  ,0.1242 },
-        { 25   ,2  ,0.4220  ,17.684  ,0.5948   ,6.005  ,0.0043 ,-0.609 ,-0.0219  ,0.0589 },
-        { 25   ,3  ,0.4198  ,14.283  ,0.6054   ,5.469  ,0.9241 ,-0.009 ,-0.9498  ,0.0392 },
-        { 25   ,4  ,0.3760  ,12.566  ,0.6602   ,5.133 ,-0.0372  ,0.563  ,0.0011  ,0.0393 },
-        { 26   ,0  ,0.0706  ,35.008  ,0.3589  ,15.358  ,0.5819  ,5.561 ,-0.0114  ,0.1398 },
-        { 26   ,1  ,0.1251  ,34.963  ,0.3629  ,15.514  ,0.5223  ,5.591 ,-0.0105  ,0.1301 },
-        { 26   ,2  ,0.0263  ,34.960  ,0.3668  ,15.943  ,0.6188  ,5.594 ,-0.0119  ,0.1437 },
-        { 26   ,3  ,0.3972  ,13.244  ,0.6295   ,4.903 ,-0.0314  ,0.350  ,0.0044  ,0.0441 },
-        { 26   ,4  ,0.3782  ,11.380  ,0.6556   ,4.592 ,-0.0346  ,0.483  ,0.0005  ,0.0362 },
-        { 27   ,0  ,0.4139  ,16.162  ,0.6013   ,4.780 ,-0.1518  ,0.021  ,0.1345  ,0.1033 },
-        { 27   ,1  ,0.0990  ,33.125  ,0.3645  ,15.177  ,0.5470  ,5.008 ,-0.0109  ,0.0983 },
-        { 27   ,2  ,0.4332  ,14.355  ,0.5857   ,4.608 ,-0.0382  ,0.134  ,0.0179  ,0.0711 },
-        { 27   ,3  ,0.3902  ,12.508  ,0.6324   ,4.457 ,-0.1500  ,0.034  ,0.1272  ,0.0515 },
-        { 27   ,4  ,0.3515  ,10.778  ,0.6778   ,4.234 ,-0.0389  ,0.241  ,0.0098  ,0.0390 },
-        { 28   ,0 ,-0.0172  ,35.739  ,0.3174  ,14.269  ,0.7136  ,4.566 ,-0.0143  ,0.1072 },
-        { 28   ,1  ,0.0705  ,35.856  ,0.3984  ,13.804  ,0.5427  ,4.397 ,-0.0118  ,0.0738 },
-        { 28   ,2  ,0.0163  ,35.883  ,0.3916  ,13.223  ,0.6052  ,4.339 ,-0.0133  ,0.0817 },
-        { 28   ,3 ,-0.0134  ,35.868  ,0.2678  ,12.333  ,0.7614  ,4.237 ,-0.0162  ,0.0999 },
-        { 28   ,4 ,-0.0090  ,35.861  ,0.2776  ,11.790  ,0.7474  ,4.201 ,-0.0163  ,0.0966 },
-        { 29   ,0  ,0.0909  ,34.984  ,0.4088  ,11.443  ,0.5128  ,3.825 ,-0.0124  ,0.0513 },
-        { 29   ,1  ,0.0749  ,34.966  ,0.4147  ,11.764  ,0.5238  ,3.850 ,-0.0127  ,0.0591 },
-        { 29   ,2  ,0.0232  ,34.969  ,0.4023  ,11.564  ,0.5882  ,3.843 ,-0.0137  ,0.0532 },
-        { 29   ,3  ,0.0031  ,34.907  ,0.3582  ,10.914  ,0.6531  ,3.828 ,-0.0147  ,0.0665 },
-        { 29   ,4 ,-0.0132  ,30.682  ,0.2801  ,11.163  ,0.7490  ,3.817 ,-0.0165  ,0.0767 },
-        { 39   ,0  ,0.5915  ,67.608  ,1.5123  ,17.900 ,-1.1130 ,14.136  ,0.0080  ,0.3272 },
-        { 40   ,0  ,0.4106  ,59.996  ,1.0543  ,18.648 ,-0.4751 ,10.540  ,0.0106  ,0.3667 },
-        { 40   ,1  ,0.4532  ,59.595  ,0.7834  ,21.436 ,-0.2451  ,9.036  ,0.0098  ,0.3639 },
-        { 41   ,0  ,0.3946  ,49.230  ,1.3197  ,14.822 ,-0.7269  ,9.616  ,0.0129  ,0.3659 },
-        { 41   ,1  ,0.4572  ,49.918  ,1.0274  ,15.726 ,-0.4962  ,9.157  ,0.0118  ,0.3403 },
-        { 42   ,0  ,0.1806  ,49.057  ,1.2306  ,14.786 ,-0.4268  ,6.987  ,0.0171  ,0.4135 },
-        { 42   ,1  ,0.3500  ,48.035  ,1.0305  ,15.060 ,-0.3929  ,7.479  ,0.0139  ,0.3510 },
-        { 43   ,0  ,0.1298  ,49.661  ,1.1656  ,14.131 ,-0.3134  ,5.513  ,0.0195  ,0.3869 },
-        { 43   ,1  ,0.2674  ,48.957  ,0.9569  ,15.141 ,-0.2387  ,5.458  ,0.0160  ,0.3412 },
-        { 44   ,0  ,0.1069  ,49.424  ,1.1912  ,12.742 ,-0.3176  ,4.912  ,0.0213  ,0.3597 },
-        { 44   ,1  ,0.4410  ,33.309  ,1.4775   ,9.553 ,-0.9361  ,6.722  ,0.0176  ,0.2608 },
-        { 45   ,0  ,0.0976  ,49.882  ,1.1601  ,11.831 ,-0.2789  ,4.127  ,0.0234  ,0.3263 },
-        { 45   ,1  ,0.3342  ,29.756  ,1.2209   ,9.438 ,-0.5755  ,5.332  ,0.0210  ,0.2574 },
-        { 46   ,0  ,0.2003  ,29.363  ,1.1446   ,9.599 ,-0.3689  ,4.042  ,0.0251  ,0.2453 },
-        { 46   ,1  ,0.5033  ,24.504  ,1.9982   ,6.908 ,-1.5240  ,5.513  ,0.0213  ,0.1909 },
-        { 58   ,2  ,0.2953  ,17.685  ,0.2923   ,6.733  ,0.4313  ,5.383 ,-0.0194  ,0.0845 },
-        { 60   ,2  ,0.1645  ,25.045  ,0.2522  ,11.978  ,0.6012  ,4.946 ,-0.0180  ,0.0668 },
-        { 60   ,3  ,0.0540  ,25.029  ,0.3101  ,12.102  ,0.6575  ,4.722 ,-0.0216  ,0.0478 },
-        { 62   ,2  ,0.0909  ,25.203  ,0.3037  ,11.856  ,0.6250  ,4.237 ,-0.0200  ,0.0408 },
-        { 62   ,3  ,0.0288  ,25.207  ,0.2973  ,11.831  ,0.6954  ,4.212 ,-0.0213  ,0.0510 },
-        { 63   ,2  ,0.0755  ,25.296  ,0.3001  ,11.599  ,0.6438  ,4.025 ,-0.0196  ,0.0488 },
-        { 63   ,3  ,0.0204  ,25.308  ,0.3010  ,11.474  ,0.7005  ,3.942 ,-0.0220  ,0.0356 },
-        { 64   ,2  ,0.0636  ,25.382  ,0.3033  ,11.212  ,0.6528  ,3.788 ,-0.0199  ,0.0486 },
-        { 64   ,3  ,0.0186  ,25.387  ,0.2895  ,11.142  ,0.7135  ,3.752 ,-0.0217  ,0.0489 },
-        { 65   ,2  ,0.0547  ,25.509  ,0.3171  ,10.591  ,0.6490  ,3.517 ,-0.0212  ,0.0342 },
-        { 65   ,3  ,0.0177  ,25.510  ,0.2921  ,10.577  ,0.7133  ,3.512 ,-0.0231  ,0.0512 },
-        { 66   ,2  ,0.1308  ,18.316  ,0.3118   ,7.665  ,0.5795  ,3.147 ,-0.0226  ,0.0315 },
-        { 66   ,3  ,0.1157  ,15.073  ,0.3270   ,6.799  ,0.5821  ,3.020 ,-0.0249  ,0.0146 },
-        { 67   ,2  ,0.0995  ,18.176  ,0.3305   ,7.856  ,0.5921  ,2.980 ,-0.0230  ,0.1240 },
-        { 67   ,3  ,0.0566  ,18.318  ,0.3365   ,7.688  ,0.6317  ,2.943 ,-0.0248  ,0.0068 },
-        { 68   ,2  ,0.1122  ,18.122  ,0.3462   ,6.911  ,0.5649  ,2.761 ,-0.0235  ,0.0207 },
-        { 68   ,3  ,0.0586  ,17.980  ,0.3540   ,7.096  ,0.6126  ,2.748 ,-0.0251  ,0.0171 },
-        { 69   ,2  ,0.0983  ,18.324  ,0.3380   ,6.918  ,0.5875  ,2.662 ,-0.0241  ,0.0404 },
-        { 69   ,3  ,0.0581  ,15.092  ,0.2787   ,7.801  ,0.6854  ,2.793 ,-0.0224  ,0.0351 },
-        { 70   ,2  ,0.0855  ,18.512  ,0.2943   ,7.373  ,0.6412  ,2.678 ,-0.0213  ,0.0421 },
-        { 70   ,3  ,0.0416  ,16.095  ,0.2849   ,7.834  ,0.6961  ,2.672 ,-0.0229  ,0.0344 },
-        { 92   ,3  ,0.5058  ,23.288  ,1.3464   ,7.003 ,-0.8724  ,4.868  ,0.0192  ,0.1507 },
-        { 92   ,4  ,0.3291  ,23.548  ,1.0836   ,8.454 ,-0.4340  ,4.120  ,0.0214  ,0.1757 },
-        { 92   ,5  ,0.3650  ,19.804  ,3.2199   ,6.282 ,-2.6077  ,5.301  ,0.0233  ,0.1750 },
-        { 93   ,3  ,0.5157  ,20.865  ,2.2784   ,5.893 ,-1.8163  ,4.846  ,0.0211  ,0.1378 },
-        { 93   ,4  ,0.4206  ,19.805  ,2.8004   ,5.978 ,-2.2436  ,4.985  ,0.0228  ,0.1408 },
-        { 93   ,5  ,0.3692  ,18.190  ,3.1510   ,5.850 ,-2.5446  ,4.916  ,0.0248  ,0.1515 },
-        { 93   ,6  ,0.2929  ,17.561  ,3.4866   ,5.785 ,-2.8066  ,4.871  ,0.0267  ,0.1698 },
-        { 94   ,3  ,0.3840  ,16.679  ,3.1049   ,5.421 ,-2.5148  ,4.551  ,0.0263  ,0.1280 },
-        { 94   ,4  ,0.4934  ,16.836  ,1.6394   ,5.638 ,-1.1581  ,4.140  ,0.0248  ,0.1242 },
-        { 94   ,5  ,0.3888  ,16.559  ,2.0362   ,5.657 ,-1.4515  ,4.255  ,0.0267  ,0.1287 },
-        { 94   ,6  ,0.3172  ,16.051  ,3.4654   ,5.351 ,-2.8102  ,4.513  ,0.0281  ,0.1382 },
-        { 95   ,2  ,0.4743  ,21.776  ,1.5800   ,5.690 ,-1.0779  ,4.145  ,0.0218  ,0.1253 },
-        { 95   ,3  ,0.4239  ,19.574  ,1.4573   ,5.872 ,-0.9052  ,3.968  ,0.0238  ,0.1054 },
-        { 95   ,4  ,0.3737  ,17.862  ,1.3521   ,6.043 ,-0.7514  ,3.720  ,0.0258  ,0.1113 },
-        { 95   ,5  ,0.2956  ,17.372  ,1.4525   ,6.073 ,-0.7755  ,3.662  ,0.0277  ,0.1202 },
-        { 95   ,6  ,0.2302  ,16.953  ,1.4864   ,6.116 ,-0.7457  ,3.543  ,0.0294  ,0.1323 },
-        { 95   ,7  ,0.3601  ,12.730  ,1.9640   ,5.120 ,-1.3560  ,3.714  ,0.0316  ,0.1232 }
-      };
-
-      const double small=1e-6;
       // case of no form factor requested
       if(ionisation<1)
       {
@@ -161,29 +62,127 @@ namespace Mantid
       }
       else
       {
-         for(int i=0;i<94;i++)
-         {
-            if(fabs(formValues[i][0]-atomicNo)<small && fabs(formValues[i][1]-ionisation)<small)
-            {
-              // Sets parameters to be used by the function form
-              m_nf=7;
-              const double scale=1./(16.*M_PI*M_PI);
-              array.push_back(formValues[i][2]);        //a
-              array.push_back(formValues[i][3]*scale);  //alpha
-              array.push_back(formValues[i][4]);        //b
-              array.push_back(formValues[i][5]*scale);  //beta
-              array.push_back(formValues[i][6]);        //c
-              array.push_back(formValues[i][7]*scale);  //gamma
-              array.push_back(formValues[i][8]);        //d
-              return;
-            }
-         }
-         //throw std::invalid_argument("atomicNo/ionization pair not valid");
-         m_nf=-1;
+        double formValues[95][10] = {
+            { 21   ,0  ,0.2512  ,90.030  ,0.3290  ,39.402  ,0.4235 ,14.322 ,-0.0043  ,0.2029 },
+            { 21   ,1  ,0.4889  ,51.160  ,0.5203  ,14.076 ,-0.0286  ,0.179  ,0.0185  ,0.1217 },
+            { 21   ,2  ,0.5048  ,31.403  ,0.5186  ,10.990 ,-0.0241  ,1.183  ,0.0000  ,0.0578 },
+            { 22   ,0  ,0.4657  ,33.590  ,0.5490  ,9.879  ,-0.0291  ,0.323  ,0.0123  ,0.1088 },
+            { 22   ,1  ,0.5093  ,36.703  ,0.5032  ,10.371 ,-0.0263  ,0.311  ,0.0116  ,0.1125 },
+            { 22   ,2  ,0.5091  ,24.976  ,0.5162   ,8.757 ,-0.6281  ,0.916  ,0.0015  ,0.0589 },
+            { 22   ,3  ,0.3571  ,22.841  ,0.6688   ,8.931 ,-0.0354  ,0.483  ,0.0099  ,0.0575 },
+            { 23   ,0  ,0.4086  ,28.811  ,0.6077   ,8.544 ,-0.0295  ,0.277  ,0.0123  ,0.0970 },
+            { 23   ,1  ,0.4444  ,32.648  ,0.5683   ,9.097 ,-0.2285  ,0.022  ,0.2150  ,0.1111 },
+            { 23   ,2  ,0.4085  ,23.853  ,0.6091   ,8.246 ,-0.1676  ,0.041  ,0.1496  ,0.0593 },
+            { 23   ,3  ,0.3598  ,19.336  ,0.6632   ,7.617 ,-0.3064  ,0.030  ,0.2835  ,0.0515 },
+            { 23   ,4  ,0.3106  ,16.816  ,0.7198   ,7.049 ,-0.0521  ,0.302  ,0.0221  ,0.0433 },
+            { 24   ,0  ,0.1135  ,45.199  ,0.3481  ,19.493  ,0.5477  ,7.354 ,-0.0092  ,0.1975 },
+            { 24   ,1 ,-0.0977   ,0.047  ,0.4544  ,26.005  ,0.5579  ,7.489  ,0.0831  ,0.1114 },
+            { 24   ,2  ,1.2024  ,-0.005  ,0.4158  ,20.548  ,0.6032  ,6.956 ,-1.2218  ,0.0572 },
+            { 24   ,3 ,-0.3094   ,0.027  ,0.3680  ,17.035  ,0.6559  ,6.524  ,0.2856  ,0.0436 },
+            { 24   ,4 ,-0.2320   ,0.043  ,0.3101  ,14.952  ,0.7182  ,6.173  ,0.2042  ,0.0419 },
+            { 25   ,0  ,0.2438  ,24.963  ,0.1472  ,15.673  ,0.6189  ,6.540 ,-0.0105  ,0.1748 },
+            { 25   ,1 ,-0.0138   ,0.421  ,0.4231  ,24.668  ,0.5905  ,6.655 ,-0.0010  ,0.1242 },
+            { 25   ,2  ,0.4220  ,17.684  ,0.5948   ,6.005  ,0.0043 ,-0.609 ,-0.0219  ,0.0589 },
+            { 25   ,3  ,0.4198  ,14.283  ,0.6054   ,5.469  ,0.9241 ,-0.009 ,-0.9498  ,0.0392 },
+            { 25   ,4  ,0.3760  ,12.566  ,0.6602   ,5.133 ,-0.0372  ,0.563  ,0.0011  ,0.0393 },
+            { 26   ,0  ,0.0706  ,35.008  ,0.3589  ,15.358  ,0.5819  ,5.561 ,-0.0114  ,0.1398 },
+            { 26   ,1  ,0.1251  ,34.963  ,0.3629  ,15.514  ,0.5223  ,5.591 ,-0.0105  ,0.1301 },
+            { 26   ,2  ,0.0263  ,34.960  ,0.3668  ,15.943  ,0.6188  ,5.594 ,-0.0119  ,0.1437 },
+            { 26   ,3  ,0.3972  ,13.244  ,0.6295   ,4.903 ,-0.0314  ,0.350  ,0.0044  ,0.0441 },
+            { 26   ,4  ,0.3782  ,11.380  ,0.6556   ,4.592 ,-0.0346  ,0.483  ,0.0005  ,0.0362 },
+            { 27   ,0  ,0.4139  ,16.162  ,0.6013   ,4.780 ,-0.1518  ,0.021  ,0.1345  ,0.1033 },
+            { 27   ,1  ,0.0990  ,33.125  ,0.3645  ,15.177  ,0.5470  ,5.008 ,-0.0109  ,0.0983 },
+            { 27   ,2  ,0.4332  ,14.355  ,0.5857   ,4.608 ,-0.0382  ,0.134  ,0.0179  ,0.0711 },
+            { 27   ,3  ,0.3902  ,12.508  ,0.6324   ,4.457 ,-0.1500  ,0.034  ,0.1272  ,0.0515 },
+            { 27   ,4  ,0.3515  ,10.778  ,0.6778   ,4.234 ,-0.0389  ,0.241  ,0.0098  ,0.0390 },
+            { 28   ,0 ,-0.0172  ,35.739  ,0.3174  ,14.269  ,0.7136  ,4.566 ,-0.0143  ,0.1072 },
+            { 28   ,1  ,0.0705  ,35.856  ,0.3984  ,13.804  ,0.5427  ,4.397 ,-0.0118  ,0.0738 },
+            { 28   ,2  ,0.0163  ,35.883  ,0.3916  ,13.223  ,0.6052  ,4.339 ,-0.0133  ,0.0817 },
+            { 28   ,3 ,-0.0134  ,35.868  ,0.2678  ,12.333  ,0.7614  ,4.237 ,-0.0162  ,0.0999 },
+            { 28   ,4 ,-0.0090  ,35.861  ,0.2776  ,11.790  ,0.7474  ,4.201 ,-0.0163  ,0.0966 },
+            { 29   ,0  ,0.0909  ,34.984  ,0.4088  ,11.443  ,0.5128  ,3.825 ,-0.0124  ,0.0513 },
+            { 29   ,1  ,0.0749  ,34.966  ,0.4147  ,11.764  ,0.5238  ,3.850 ,-0.0127  ,0.0591 },
+            { 29   ,2  ,0.0232  ,34.969  ,0.4023  ,11.564  ,0.5882  ,3.843 ,-0.0137  ,0.0532 },
+            { 29   ,3  ,0.0031  ,34.907  ,0.3582  ,10.914  ,0.6531  ,3.828 ,-0.0147  ,0.0665 },
+            { 29   ,4 ,-0.0132  ,30.682  ,0.2801  ,11.163  ,0.7490  ,3.817 ,-0.0165  ,0.0767 },
+            { 39   ,0  ,0.5915  ,67.608  ,1.5123  ,17.900 ,-1.1130 ,14.136  ,0.0080  ,0.3272 },
+            { 40   ,0  ,0.4106  ,59.996  ,1.0543  ,18.648 ,-0.4751 ,10.540  ,0.0106  ,0.3667 },
+            { 40   ,1  ,0.4532  ,59.595  ,0.7834  ,21.436 ,-0.2451  ,9.036  ,0.0098  ,0.3639 },
+            { 41   ,0  ,0.3946  ,49.230  ,1.3197  ,14.822 ,-0.7269  ,9.616  ,0.0129  ,0.3659 },
+            { 41   ,1  ,0.4572  ,49.918  ,1.0274  ,15.726 ,-0.4962  ,9.157  ,0.0118  ,0.3403 },
+            { 42   ,0  ,0.1806  ,49.057  ,1.2306  ,14.786 ,-0.4268  ,6.987  ,0.0171  ,0.4135 },
+            { 42   ,1  ,0.3500  ,48.035  ,1.0305  ,15.060 ,-0.3929  ,7.479  ,0.0139  ,0.3510 },
+            { 43   ,0  ,0.1298  ,49.661  ,1.1656  ,14.131 ,-0.3134  ,5.513  ,0.0195  ,0.3869 },
+            { 43   ,1  ,0.2674  ,48.957  ,0.9569  ,15.141 ,-0.2387  ,5.458  ,0.0160  ,0.3412 },
+            { 44   ,0  ,0.1069  ,49.424  ,1.1912  ,12.742 ,-0.3176  ,4.912  ,0.0213  ,0.3597 },
+            { 44   ,1  ,0.4410  ,33.309  ,1.4775   ,9.553 ,-0.9361  ,6.722  ,0.0176  ,0.2608 },
+            { 45   ,0  ,0.0976  ,49.882  ,1.1601  ,11.831 ,-0.2789  ,4.127  ,0.0234  ,0.3263 },
+            { 45   ,1  ,0.3342  ,29.756  ,1.2209   ,9.438 ,-0.5755  ,5.332  ,0.0210  ,0.2574 },
+            { 46   ,0  ,0.2003  ,29.363  ,1.1446   ,9.599 ,-0.3689  ,4.042  ,0.0251  ,0.2453 },
+            { 46   ,1  ,0.5033  ,24.504  ,1.9982   ,6.908 ,-1.5240  ,5.513  ,0.0213  ,0.1909 },
+            { 58   ,2  ,0.2953  ,17.685  ,0.2923   ,6.733  ,0.4313  ,5.383 ,-0.0194  ,0.0845 },
+            { 60   ,2  ,0.1645  ,25.045  ,0.2522  ,11.978  ,0.6012  ,4.946 ,-0.0180  ,0.0668 },
+            { 60   ,3  ,0.0540  ,25.029  ,0.3101  ,12.102  ,0.6575  ,4.722 ,-0.0216  ,0.0478 },
+            { 62   ,2  ,0.0909  ,25.203  ,0.3037  ,11.856  ,0.6250  ,4.237 ,-0.0200  ,0.0408 },
+            { 62   ,3  ,0.0288  ,25.207  ,0.2973  ,11.831  ,0.6954  ,4.212 ,-0.0213  ,0.0510 },
+            { 63   ,2  ,0.0755  ,25.296  ,0.3001  ,11.599  ,0.6438  ,4.025 ,-0.0196  ,0.0488 },
+            { 63   ,3  ,0.0204  ,25.308  ,0.3010  ,11.474  ,0.7005  ,3.942 ,-0.0220  ,0.0356 },
+            { 64   ,2  ,0.0636  ,25.382  ,0.3033  ,11.212  ,0.6528  ,3.788 ,-0.0199  ,0.0486 },
+            { 64   ,3  ,0.0186  ,25.387  ,0.2895  ,11.142  ,0.7135  ,3.752 ,-0.0217  ,0.0489 },
+            { 65   ,2  ,0.0547  ,25.509  ,0.3171  ,10.591  ,0.6490  ,3.517 ,-0.0212  ,0.0342 },
+            { 65   ,3  ,0.0177  ,25.510  ,0.2921  ,10.577  ,0.7133  ,3.512 ,-0.0231  ,0.0512 },
+            { 66   ,2  ,0.1308  ,18.316  ,0.3118   ,7.665  ,0.5795  ,3.147 ,-0.0226  ,0.0315 },
+            { 66   ,3  ,0.1157  ,15.073  ,0.3270   ,6.799  ,0.5821  ,3.020 ,-0.0249  ,0.0146 },
+            { 67   ,2  ,0.0995  ,18.176  ,0.3305   ,7.856  ,0.5921  ,2.980 ,-0.0230  ,0.1240 },
+            { 67   ,3  ,0.0566  ,18.318  ,0.3365   ,7.688  ,0.6317  ,2.943 ,-0.0248  ,0.0068 },
+            { 68   ,2  ,0.1122  ,18.122  ,0.3462   ,6.911  ,0.5649  ,2.761 ,-0.0235  ,0.0207 },
+            { 68   ,3  ,0.0586  ,17.980  ,0.3540   ,7.096  ,0.6126  ,2.748 ,-0.0251  ,0.0171 },
+            { 69   ,2  ,0.0983  ,18.324  ,0.3380   ,6.918  ,0.5875  ,2.662 ,-0.0241  ,0.0404 },
+            { 69   ,3  ,0.0581  ,15.092  ,0.2787   ,7.801  ,0.6854  ,2.793 ,-0.0224  ,0.0351 },
+            { 70   ,2  ,0.0855  ,18.512  ,0.2943   ,7.373  ,0.6412  ,2.678 ,-0.0213  ,0.0421 },
+            { 70   ,3  ,0.0416  ,16.095  ,0.2849   ,7.834  ,0.6961  ,2.672 ,-0.0229  ,0.0344 },
+            { 92   ,3  ,0.5058  ,23.288  ,1.3464   ,7.003 ,-0.8724  ,4.868  ,0.0192  ,0.1507 },
+            { 92   ,4  ,0.3291  ,23.548  ,1.0836   ,8.454 ,-0.4340  ,4.120  ,0.0214  ,0.1757 },
+            { 92   ,5  ,0.3650  ,19.804  ,3.2199   ,6.282 ,-2.6077  ,5.301  ,0.0233  ,0.1750 },
+            { 93   ,3  ,0.5157  ,20.865  ,2.2784   ,5.893 ,-1.8163  ,4.846  ,0.0211  ,0.1378 },
+            { 93   ,4  ,0.4206  ,19.805  ,2.8004   ,5.978 ,-2.2436  ,4.985  ,0.0228  ,0.1408 },
+            { 93   ,5  ,0.3692  ,18.190  ,3.1510   ,5.850 ,-2.5446  ,4.916  ,0.0248  ,0.1515 },
+            { 93   ,6  ,0.2929  ,17.561  ,3.4866   ,5.785 ,-2.8066  ,4.871  ,0.0267  ,0.1698 },
+            { 94   ,3  ,0.3840  ,16.679  ,3.1049   ,5.421 ,-2.5148  ,4.551  ,0.0263  ,0.1280 },
+            { 94   ,4  ,0.4934  ,16.836  ,1.6394   ,5.638 ,-1.1581  ,4.140  ,0.0248  ,0.1242 },
+            { 94   ,5  ,0.3888  ,16.559  ,2.0362   ,5.657 ,-1.4515  ,4.255  ,0.0267  ,0.1287 },
+            { 94   ,6  ,0.3172  ,16.051  ,3.4654   ,5.351 ,-2.8102  ,4.513  ,0.0281  ,0.1382 },
+            { 95   ,2  ,0.4743  ,21.776  ,1.5800   ,5.690 ,-1.0779  ,4.145  ,0.0218  ,0.1253 },
+            { 95   ,3  ,0.4239  ,19.574  ,1.4573   ,5.872 ,-0.9052  ,3.968  ,0.0238  ,0.1054 },
+            { 95   ,4  ,0.3737  ,17.862  ,1.3521   ,6.043 ,-0.7514  ,3.720  ,0.0258  ,0.1113 },
+            { 95   ,5  ,0.2956  ,17.372  ,1.4525   ,6.073 ,-0.7755  ,3.662  ,0.0277  ,0.1202 },
+            { 95   ,6  ,0.2302  ,16.953  ,1.4864   ,6.116 ,-0.7457  ,3.543  ,0.0294  ,0.1323 },
+            { 95   ,7  ,0.3601  ,12.730  ,1.9640   ,5.120 ,-1.3560  ,3.714  ,0.0316  ,0.1232 }
+        };
+
+        const double small=1e-6;
+        for(int i=0;i<94;i++)
+        {
+          if(fabs(formValues[i][0]-atomicNo)<small && fabs(formValues[i][1]-ionisation)<small)
+          {
+            // Sets parameters to be used by the function form
+            m_nf=7;
+            const double scale=1./(16.*M_PI*M_PI);
+            array.push_back(formValues[i][2]);        //a
+            array.push_back(formValues[i][3]*scale);  //alpha
+            array.push_back(formValues[i][4]);        //b
+            array.push_back(formValues[i][5]*scale);  //beta
+            array.push_back(formValues[i][6]);        //c
+            array.push_back(formValues[i][7]*scale);  //gamma
+            array.push_back(formValues[i][8]);        //d
+            return;
+          }
+        }
+        //throw std::invalid_argument("atomicNo/ionization pair not valid");
+        m_nf=-1;
       }
 
     }
 
-
-    }
+  }
 }
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/MergeMDFiles.cpp b/Code/Mantid/Framework/MDAlgorithms/src/MergeMDFiles.cpp
index a806a467d9152f73df7d70d6cf2949180581ded3..2261c1e1b04f2f11c71d29d99dcc6cf47a495486 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/MergeMDFiles.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/MergeMDFiles.cpp
@@ -336,7 +336,6 @@ namespace MDAlgorithms
       for (size_t i=0; i<files.size(); i++)
         files[i]->close();
       throw;
-      return;
     }
 
     // This is how many boxes are in all the files.
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/RunParam.cpp b/Code/Mantid/Framework/MDAlgorithms/src/RunParam.cpp
index 835ea99b3ebc5db2bde0f68c707ad43ca0c9c883..e33d86e57af4dcdb5532caecb3fa1d86cd4cf376 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/RunParam.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/RunParam.cpp
@@ -601,7 +601,7 @@ namespace Mantid
                         c13= 1.0598968932302265636e-08;
 
            const double ax=x/tauF;
-           double funAx, funGx;
+           double funAx;
            if(fabs(ax)<=0.1)
            {
              funAx = c3+ax*(c4+ax*(c5+ax*(c6+ax*(c7+ax*(c8+ax*(c9+ax*(c10+ax*(c11+ax*(c12+ax*c13)))))))));
@@ -610,6 +610,7 @@ namespace Mantid
              funAx = (1.0 - exp(-(ax))*(1.0+(ax)+0.5*(ax*ax))) / (ax*ax*ax);
            if(tauS!=0. && r!=0.)
            {
+             double funGx;
              const double gx=x*(1.0/tauF - 1.0/tauS);
              if(gx<0.1)
                funGx = c3+gx*(c4+gx*(c5+gx*(c6+gx*(c7+gx*(c8+gx*(c9+gx*(c10+gx*(c11+gx*(c12+gx*c13)))))))));
diff --git a/Code/Mantid/Framework/MDAlgorithms/src/SlicingAlgorithm.cpp b/Code/Mantid/Framework/MDAlgorithms/src/SlicingAlgorithm.cpp
index 77ae6282d28072cd0708cfa818c1a6bafda5e65c..72d221427f7708bd2d04b488ae849540d03829b7 100644
--- a/Code/Mantid/Framework/MDAlgorithms/src/SlicingAlgorithm.cpp
+++ b/Code/Mantid/Framework/MDAlgorithms/src/SlicingAlgorithm.cpp
@@ -789,9 +789,8 @@ namespace MDAlgorithms
     { z = x.cross_prod(y); z.normalize(); }
 
     // Point that is sure to be inside the volume of interest
-    VMD insidePoint = (o1 + o2) / 2.0;      VMD normal = bases[0];
-
-    std::vector<VMD> points;
+    VMD insidePoint = (o1 + o2) / 2.0;
+    VMD normal = bases[0];
 
     if (boxDim == 1)
     {
diff --git a/Code/Mantid/Framework/MDEvents/src/FindPeaksMD.cpp b/Code/Mantid/Framework/MDEvents/src/FindPeaksMD.cpp
index 43af04f08a0835640076d90ab8da2436e653a2d6..ea7d90dd5d300f53f8ec2b03a37c045b812094dd 100644
--- a/Code/Mantid/Framework/MDEvents/src/FindPeaksMD.cpp
+++ b/Code/Mantid/Framework/MDEvents/src/FindPeaksMD.cpp
@@ -217,6 +217,8 @@ namespace MDEvents
     // Calculate a threshold below which a box is too diffuse to be considered a peak.
     signal_t thresholdDensity = 0.0;
     thresholdDensity = ws->getBox()->getSignalNormalized() * DensityThresholdFactor * densityScalingFactor;
+    // cppcheck get confused by NaN check
+    // cppcheck-suppress duplicateExpression
     if ((thresholdDensity != thresholdDensity) || (thresholdDensity == std::numeric_limits<double>::infinity())
         || (thresholdDensity == -std::numeric_limits<double>::infinity()))
     {
diff --git a/Code/Mantid/Framework/MDEvents/src/ImportMDEventWorkspace.cpp b/Code/Mantid/Framework/MDEvents/src/ImportMDEventWorkspace.cpp
index 3058770884ce0a78f16b8f8e5dbf0df11fad1a0e..bc3e7580261488402283790b720aad75be33e8c2 100644
--- a/Code/Mantid/Framework/MDEvents/src/ImportMDEventWorkspace.cpp
+++ b/Code/Mantid/Framework/MDEvents/src/ImportMDEventWorkspace.cpp
@@ -326,7 +326,6 @@ namespace MDEvents
 
     // Extract data from the file, excluding comment lines.
     std::string line;
-    std::vector<std::string> myLines;
     while (std::getline(file, line))
     {
       if(std::string::npos == line.find_first_of(CommentLineStartFlag()))
diff --git a/Code/Mantid/Framework/NexusCPP/src/NeXusFile.cpp b/Code/Mantid/Framework/NexusCPP/src/NeXusFile.cpp
index f9489efcbc93d83ff7b6913bba759fb20467f4be..7d6882d2d00a0af0632258bd7aa30ac37de5c077 100644
--- a/Code/Mantid/Framework/NexusCPP/src/NeXusFile.cpp
+++ b/Code/Mantid/Framework/NexusCPP/src/NeXusFile.cpp
@@ -731,7 +731,7 @@ void File::getData(vector<NumT>& data) {
   // determine the number of elements
   int length=1;
   for (vector<int>::const_iterator it = info.dims.begin();
-       it != info.dims.end(); it++) {
+       it != info.dims.end(); ++it) {
     length *= *it;
   }
 
diff --git a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp
index ef7a3a5db39250771fffd540943f69b891222e44..12813e4be918ae3b6dbcd1b00e34a821c59b9d8e 100644
--- a/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp
+++ b/Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp
@@ -87,6 +87,8 @@ namespace
     }
     // -- Use the boost preprocessor to generate a list of else if clause to cut out copy
     // and pasted code.
+    // I think cppcheck is getting confused by the define
+    // cppcheck-suppress unreadVariable
     const std::type_info & typeID = column->get_type_info();
     if(false){} // So that it always falls through to the list checking
     BOOST_PP_LIST_FOR_EACH(SET_CELL, _ , BUILTIN_TYPES)
diff --git a/Code/Mantid/Framework/TestHelpers/src/MDEventsTestHelper.cpp b/Code/Mantid/Framework/TestHelpers/src/MDEventsTestHelper.cpp
index 144eec0b90320482d02049f8ea27da8ce29263c2..ee740daf9cb70b9cabba738aac209d46630d97aa 100644
--- a/Code/Mantid/Framework/TestHelpers/src/MDEventsTestHelper.cpp
+++ b/Code/Mantid/Framework/TestHelpers/src/MDEventsTestHelper.cpp
@@ -119,9 +119,6 @@ namespace MDEventsTestHelper
    */
   MDEventWorkspace3Lean::sptr makeFileBackedMDEW(std::string wsName, bool fileBacked)
   {
-    // Name of the output workspace.
-    std::string outWSName("CloneMDWorkspaceTest_OutputWS");
-
     // ---------- Make a file-backed MDEventWorkspace -----------------------
     MDEventWorkspace3Lean::sptr ws1 = MDEventsTestHelper::makeMDEW<3>(10, 0.0, 10.0, 0);
     ws1->getBoxController()->setSplitThreshold(100);
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/EQSANSReduce.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/EQSANSReduce.cpp
index 0e03bd31fcd3751916fc0e5c68e5bb4af33b0784..299615b75a71c2b9e754b69632237a64b632cdb0 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/EQSANSReduce.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/EQSANSReduce.cpp
@@ -121,7 +121,6 @@ Workspace_sptr EQSANSReduce::postProcess(Workspace_sptr workspace)
 {
   // Construct the script's output workspace name
   const std::string outputIq = workspace->name() + "_Iq";
-  const std::string outputWSName = getPropertyValue("OutputWorkspace");
 
   // Write the Reducer python script to be executed
   std::string script = "import reduction.instruments.sans.sns_command_interface as cmd\n";
diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/SANSBeamFinder.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/SANSBeamFinder.cpp
index da80a9113fc45fe670872559c555ad5a37be20a4..a460d316f0e5e9bdcb959e9eb28df65624b43415 100644
--- a/Code/Mantid/Framework/WorkflowAlgorithms/src/SANSBeamFinder.cpp
+++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/SANSBeamFinder.cpp
@@ -89,7 +89,6 @@ MatrixWorkspace_sptr SANSBeamFinder::loadBeamFinderFile(const std::string& beamC
       loadAlg->setProperty("ReductionProperties", reductionManagerName);
       loadAlg->executeAsSubAlg();
       finderWS = loadAlg->getProperty("OutputWorkspace");
-      const std::string outMsg = loadAlg->getProperty("OutputMessage");
       m_output_message += "   |Loaded " + beamCenterFile + "\n";
       std::string msg = loadAlg->getPropertyValue("OutputMessage");
       m_output_message += "   |" + Poco::replace(msg, "\n", "\n   |") + "\n";
diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp
index 07d7725dcddaa8cfafb26fc5014686907b269380..19ee9aa7f6c526e70e63c9d02b381503418a64a6 100644
--- a/Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp
+++ b/Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp
@@ -818,9 +818,9 @@ void MantidDockWidget::removeWorkspaceEntry(const QString & ws_name)
 {
   //This will only ever be of size zero or one
   QList<QTreeWidgetItem *> name_matches = m_tree->findItems(ws_name,Qt::MatchFixedString);
-  QTreeWidgetItem *parent_item(NULL);
   if( name_matches.isEmpty() )
-  {	 
+  {
+    QTreeWidgetItem *parent_item(NULL);
     //   if there are  no toplevel items in three matching the workspace name ,loop through
     //  all child elements 
     int topitemCounts = m_tree->topLevelItemCount();
@@ -843,8 +843,7 @@ void MantidDockWidget::removeWorkspaceEntry(const QString & ws_name)
         if(!ws_name.compare(childItem->text(0)))
         {
           topItem->takeChild(chIndex);
-		  parent_item = topItem;
-		 
+          parent_item = topItem;
         }
       }
     }
@@ -1844,18 +1843,12 @@ bool MantidTreeWidgetItem::operator<(const QTreeWidgetItem &other)const
           return false;
         }
       }
-      else if (childCount() == 0 && other.childCount() > 0)
-      {
-        return false;
-      }
-      else
-      {
-        return false;
-      }
-    } catch (Mantid::Kernel::Exception::NotFoundError&)
+    }
+    catch (Mantid::Kernel::Exception::NotFoundError&)
     {
-      return false;
+      ;
     }
+    return false;
   }
 }
 
diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidWSIndexDialog.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidWSIndexDialog.cpp
index 6f68d0b1df30ee7da1a0ea16e0842626bbfc64d2..dfadff577239bf066aafdfa7e13efa18ac2ebb98 100644
--- a/Code/Mantid/MantidPlot/src/Mantid/MantidWSIndexDialog.cpp
+++ b/Code/Mantid/MantidPlot/src/Mantid/MantidWSIndexDialog.cpp
@@ -63,7 +63,6 @@ QMultiMap<QString,std::set<int> > MantidWSIndexDialog::getPlots() const
   {
     for(int i = 0; i < m_wsNames.size(); i++)
     {
-      std::set<int> intSet = m_spectraIdChoice.getIntSet();
       // Convert the spectra choices of the user into workspace indices for us to use.
       Mantid::API::MatrixWorkspace_const_sptr ws = boost::dynamic_pointer_cast<const Mantid::API::MatrixWorkspace>(Mantid::API::AnalysisDataService::Instance().retrieve(m_wsNames[i].toStdString()));
       if ( NULL == ws ) continue;