From 932d12fc6af27f4758913dafc76ae4226493e666 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Thu, 14 Nov 2019 18:38:13 +0000
Subject: [PATCH 01/30] Update CMakeLists to move existing sanitizers and add
 new ones

Adds handling for multiple sanitizers using a multi option.

This includes:
- Warning users if they try to use a sanitizer on release builds
- Changing the optimization flag of RelWithDebInfo to get stack traces
- Adding more checks in case someone mis-types
- Adding option for clangs memory sanitizer though this throws an error
  at the moment
---
 CMakeLists.txt                     |  4 ++
 buildconfig/CMake/GNUSetup.cmake   | 33 ------------
 buildconfig/CMake/Sanitizers.cmake | 86 ++++++++++++++++++++++++++++++
 3 files changed, 90 insertions(+), 33 deletions(-)
 create mode 100644 buildconfig/CMake/Sanitizers.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 37666bfed12..cdd49cca7e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,10 @@ option(ENABLE_WORKBENCH "Enable Qt5-based gui & components" ON)
 
 set(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}" "Mantid" "ALL" "/")
 
+# Ensure that if we are running any sanitizers the compiler options are
+# known in sub targets
+include(Sanitizers)
+
 # Quick exit if we only want data targets
 if(DATA_TARGETS_ONLY)
   include(SetupDataTargets)
diff --git a/buildconfig/CMake/GNUSetup.cmake b/buildconfig/CMake/GNUSetup.cmake
index a129359016f..6fbf75cc724 100644
--- a/buildconfig/CMake/GNUSetup.cmake
+++ b/buildconfig/CMake/GNUSetup.cmake
@@ -72,39 +72,6 @@ endif()
 # Add some options for debug build to help the Zoom profiler
 add_compile_options ( $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:-fno-omit-frame-pointer> )
 
-option(WITH_ASAN "Enable address sanitizer" OFF)
-if(WITH_ASAN)
-  message(STATUS "enabling address sanitizer")
-  add_compile_options(-fno-omit-frame-pointer -fno-common -fsanitize=address)
-  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address" )
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
-endif()
-
-option(WITH_TSAN "Enable thread sanitizer" OFF)
-if(WITH_TSAN)
-  message(STATUS "enabling thread sanitizer")
-  add_compile_options(-fno-omit-frame-pointer -fno-common -fsanitize=thread)
-  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=thread" )
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread")
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=thread")
-endif()
-
-option(WITH_UBSAN "Enable undefined behavior sanitizer" OFF)
-if(WITH_UBSAN)
-  message(STATUS "enabling undefined behavior sanitizers")
-  set( UBSAN_NO_RECOVER "-fno-sanitize-recover")
-  if ( CMAKE_COMPILER_IS_GNUCXX AND GCC_COMPILER_VERSION VERSION_LESS "5.1.0")
-    set( UBSAN_NO_RECOVER "")
-  endif()
-  # vptr check is generating a lot of false positives, hiding other more serious warnings.
-  set(SAN_FLAGS "-fno-omit-frame-pointer -fno-common -fsanitize=undefined -fno-sanitize=vptr ${UBSAN_NO_RECOVER}")
-  add_compile_options(-fno-omit-frame-pointer -fno-common -fsanitize=undefined -fno-sanitize=vptr ${UBSAN_NO_RECOVER})
-  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${SAN_FLAGS}" )
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SAN_FLAGS}" )
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${SAN_FLAGS}" )
-endif()
-
 # XCode isn't picking up the c++ standard by CMAKE_CXX_STANDARD
 if(CMAKE_GENERATOR STREQUAL Xcode)
   set ( CMAKE_XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS "${GNUFLAGS} -Woverloaded-virtual -fno-operator-names")
diff --git a/buildconfig/CMake/Sanitizers.cmake b/buildconfig/CMake/Sanitizers.cmake
new file mode 100644
index 00000000000..ec1967bd8b0
--- /dev/null
+++ b/buildconfig/CMake/Sanitizers.cmake
@@ -0,0 +1,86 @@
+#################################################
+# Controls various project wide sanitizer options
+#################################################
+
+set(USE_SANITIZER "Off" CACHE STRING "Sanitizer mode to enable")
+set_property(CACHE USE_SANITIZER PROPERTY STRINGS
+             Off Address Address+Leak Leak Memory Thread Undefined)
+
+if(NOT ${USE_SANITIZER} MATCHES "Off")
+    if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
+        # Version 13 is needed for add_link_options, but not all platforms
+        # currently have it
+        message(FATAL_ERROR "CMake 3.13 onwards is required to run the sanitizers")
+    endif()
+
+    if(WIN32)
+        message(FATAL_ERROR "Windows does not support sanitizers")
+    endif()
+
+    # Check and warn if we are not in a mode without debug symbols
+    string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower)
+    if(${build_type_lower} MATCHES "release" OR ${build_type_lower} MATCHES "minsizerel" )
+        message(WARNING "You are running address sanitizers without debug information, try RelWithDebInfo")
+
+    elseif(${build_type_lower} MATCHES "relwithdebinfo")
+        # RelWithDebug runs with -o2 which performs inlining reducing the usefulness
+        message("Replacing -O2 flag with -O1 to preserve stack trace on sanitizers")
+        string(REPLACE "-O2" "-O1" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
+        string(REPLACE "-O2" "-O1" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
+
+        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} CACHE STRING "" FORCE)
+        set(CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO} CACHE STRING "" FORCE)
+
+        add_compile_options(-fno-omit-frame-pointer -fno-optimize-sibling-calls)
+    endif()
+
+    # Allow all instrumented code to continue beyond the first error
+    add_compile_options(-fsanitize-recover=all)
+
+    # N.b. we can switch this to add_link_options in CMake 3.13
+    # rather than have to check the linker options etc
+    if (USE_SANITIZER STREQUAL "Address")
+        message(STATUS "Enabling address sanitizer")
+
+        add_compile_options(-fsanitize=address)
+        add_link_options(-fsanitize=address)
+
+    elseif (USE_SANITIZER STREQUAL "Address+Leak")
+        message(STATUS "Enabling address and leak sanitizer")
+
+        add_compile_options(-fsanitize=address,leak)
+        add_link_options(-fsanitize=address,leak)
+
+    elseif (USE_SANITIZER STREQUAL "Leak")
+        message(STATUS "Enabling leak sanitizer")
+
+        add_compile_options(-fsanitize=leak)
+        add_link_options(-fsanitize=leak)
+
+    elseif (USE_SANITIZER STREQUAL "Memory")
+        # Requires Clang > 10 and libc++ (rather than libstdc++)
+        # so we will wire up later
+        message(FATAL_ERROR "Not Enabled Yet")
+        message(STATUS "Enabling Memory sanitizer")
+
+    elseif (USE_SANITIZER STREQUAL "Thread")
+        message(STATUS "Enabling Thread sanitizer")
+
+        add_compile_options(-fsanitize=thread)
+        add_link_options(-fsanitize=thread)
+
+    elseif (USE_SANITIZER STREQUAL "Undefined")
+        message(STATUS "Enabling undefined behaviour sanitizer")
+
+        add_compile_options(
+            -fsanitize=undefined
+            # RTTI information is not exported for some classes causing the
+            # linker to fail whilst adding vptr instrumentation
+            -fno-sanitize=vptr
+        )
+        add_link_options(-fsanitize=undefined)
+    else()
+        message(FATAL_ERROR "Unrecognised Sanitizer Option")
+    endif()
+
+endif()
-- 
GitLab


From edb6a2777875c9286736afea0beedd08048e90aa Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Fri, 15 Nov 2019 11:37:24 +0000
Subject: [PATCH 02/30] Cleanup Jenkins build scripts

Tidies the Jenkins build scripts by removing some redundant if blocks,
auto-formatting the file and adding some comments
---
 buildconfig/Jenkins/buildscript | 36 ++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 14 deletions(-)

diff --git a/buildconfig/Jenkins/buildscript b/buildconfig/Jenkins/buildscript
index 796f2625dbf..e385e77c85b 100755
--- a/buildconfig/Jenkins/buildscript
+++ b/buildconfig/Jenkins/buildscript
@@ -61,6 +61,14 @@ if [[ ${NODE_LABELS} == *rhel7* ]] || [[ ${NODE_LABELS} == *centos7* ]] || [[ ${
     USE_CORE_DUMPS=false
 fi
 
+# Setup software collections on rhel7 to allow using gcc7
+if [[ $ON_RHEL7 ]]; then
+    SCL_ENABLE="scl enable devtoolset-7"
+else
+    SCL_ENABLE="eval"
+fi
+
+
 ###############################################################################
 # Script cleanup
 ###############################################################################
@@ -100,10 +108,7 @@ $CMAKE_EXE --version
 ###############################################################################
 # Check job requirements from the name and changes
 ###############################################################################
-if [[ ${JOB_NAME} == *clean* ]]; then
-    CLEANBUILD=true
-fi
-if [[ ${JOB_NAME} == *clang_tidy* ]]; then
+if [[ ${JOB_NAME} == *clean* || ${JOB_NAME} == *clang_tidy* ]]; then
     CLEANBUILD=true
 fi
 
@@ -146,6 +151,7 @@ DO_DOCTESTS_USER=true
 DO_BUILD_DEVDOCS=true
 DO_BUILD_PKG=true
 DO_SYSTEMTESTS=false
+
 if [[ ${PRBUILD} == true ]]; then
     if ${SCRIPT_DIR}/check_for_changes dev-docs-only || ${SCRIPT_DIR}/check_for_changes user-docs-only; then
         DO_BUILD_CODE=false
@@ -157,7 +163,7 @@ if [[ ${PRBUILD} == true ]]; then
     DO_SYSTEMTESTS=false
 
     if [[ ${ON_RHEL7} == true ]]; then
-        # rhel does system testing
+        # rhel does system testing if there are any non-doc or gui changes
         if ! ${SCRIPT_DIR}/check_for_changes docs-gui-only; then
             if [[ ${PY3_BUILD} == true ]]; then
                DO_BUILD_PKG=true
@@ -196,15 +202,16 @@ fi
 if [[ "$CLEANBUILD" == true ]]; then
     rm -rf $BUILD_DIR
 fi
-if [ -d $BUILD_DIR ]; then
-    rm -rf ${BUILD_DIR:?}/bin ${BUILD_DIR:?}/ExternalData ${BUILD_DIR:?}/Testing
-    find ${BUILD_DIR:?} -name 'TEST-*.xml' -delete
-    if [[ -n ${CLEAN_EXTERNAL_PROJECTS} && "${CLEAN_EXTERNAL_PROJECTS}" == true ]]; then
-        rm -rf $BUILD_DIR/eigen-*
-        rm -rf $BUILD_DIR/googletest-*
-    fi
-else
-    mkdir $BUILD_DIR
+
+mkdir -p $BUILD_DIR
+
+# Tidy build dir
+rm -rf ${BUILD_DIR:?}/bin ${BUILD_DIR:?}/ExternalData ${BUILD_DIR:?}/Testing
+find ${BUILD_DIR:?} -name 'TEST-*.xml' -delete
+
+if [[ -n ${CLEAN_EXTERNAL_PROJECTS} && "${CLEAN_EXTERNAL_PROJECTS}" == true ]]; then
+    rm -rf $BUILD_DIR/eigen-*
+    rm -rf $BUILD_DIR/googletest-*
 fi
 
 ###############################################################################
@@ -307,6 +314,7 @@ if [ "$(command -v ninja)" ]; then
     elif [ "$(command -v ninja-build)" ]; then
     CMAKE_GENERATOR="-G Ninja"
 fi
+
 if [ -e $BUILD_DIR/CMakeCache.txt ]; then
     CMAKE_GENERATOR=""
 fi
-- 
GitLab


From 551bac26bda2ee319eb3bcd8570eca7e5a6f772e Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Fri, 15 Nov 2019 13:45:01 +0000
Subject: [PATCH 03/30] Add docs on running sanitizers

---
 dev-docs/source/RunningSanitizers.rst | 128 ++++++++++++++++++++++++++
 dev-docs/source/index.rst             |   4 +
 2 files changed, 132 insertions(+)
 create mode 100644 dev-docs/source/RunningSanitizers.rst

diff --git a/dev-docs/source/RunningSanitizers.rst b/dev-docs/source/RunningSanitizers.rst
new file mode 100644
index 00000000000..2e2604f0dc2
--- /dev/null
+++ b/dev-docs/source/RunningSanitizers.rst
@@ -0,0 +1,128 @@
+.. _RunningSanitizers:
+
+##################
+Running Sanitizers
+##################
+
+.. contents::
+    :local:
+
+Overview
+=========
+
+Sanitizers allow developers to find any issues with their code at runtime
+related to memory, threading or undefined behaviour.
+
+Pre-requisites
+==============
+
+The following tooling is required:
+
+- CMake 13.0 onwards (instructions for Ubuntu `here <https://apt.kitware.com/>`__)
+- GCC-8 onwards
+
+
+Switching to Sanitizer Build
+============================
+
+The following sanitizers modes are available:
+
+- Address
+- Memory (Not implemented yet, requires clang support)
+- Thread
+- Undefined
+
+It's recommended to build in *RelWithDebInfo* mode, CMake will automatically
+switch to -O1 and append extra flags for stack traces to work correctly whilst
+preserving high performance
+
+If required, a build can be completed in debug mode too, however the
+performance penalty will be pretty severe.
+
+Command Line
+------------
+
+First, delete *CMakeCache.txt* if your system compiler is GCC 7 or below
+(you can check with *gcc -v*).
+
+To change to a sanitized build navigate to your build folder and execute the
+following:
+
+    .. code-block:: sh
+
+        cmake *path_to_src* -DUSE_SANITIZER=*Mode* -DCMAKE_BUILD_TYPE=RelWithDebInfo
+
+If you need to specify a different compiler too (for example if your system
+default is GCC-7)
+
+    .. code-block:: sh
+
+        CC=gcc-8 CXX=g++-8 cmake *path_to_src* -DUSE_SANITIZER=*Mode* -DCMAKE_BUILD_TYPE=RelWithDebInfo
+
+
+For example, to switch to an address sanitizer build the following can be used:
+
+    .. code-block:: sh
+
+        cmake *path_to_src* -DUSE_SANITIZER=Address -DCMAKE_BUILD_TYPE=RelWithDebInfo
+
+CMake GUI
+---------
+
+- Delete the cache if your system compiler is GCC 7 or below (you can check
+  with *gcc -v*). Hit configure and click specify native compilers to *gcc-8*
+  and *g++-8*
+- Change *CMAKE_BUILD_TYPE* to *RelWithDebInfo* (or *Debug*)
+- Change *USE_SANITIZERS* to any of the options in the drop down
+- Hit generate and rebuild the project
+
+Running Tests
+=============
+
+Several upstream linked libraries currently contain leaks which we cannot
+resolve (or have been resolved but not appeared downstream).
+
+We can suppress warnings in the address sanitizer by setting environment
+variables in the console before running in each mode.
+
+Address Sanitizer
+-----------------
+
+Run the following code to set the sanitizers options, being sure to substitute
+the path to your Mantid source directly:
+
+    .. code-block:: sh
+
+        export ASAN_OPTIONS="verify_asan=0:detect_stack_use_after_return=true:halt_on_error=false:suppressions=*path_to_mantid*/buildconfig/Sanitizer/Address.supp"
+        export LSAN_OPTIONS="suppressions=*path_to_mantid*/buildconfig/Sanitizer/Leak.supp"
+
+For example, if Mantid was checked out in the home directory of user *abc* in a
+folder called mantid it would be:
+
+    .. code-block:: sh
+
+        export ASAN_OPTIONS="verify_asan=0:detect_stack_use_after_return=true:halt_on_error=false:suppressions=/home/abc/mantid/buildconfig/Sanitizer/Address.supp"
+        export LSAN_OPTIONS="suppressions=/home/abc/mantid/buildconfig/Sanitizer/Leak.supp"
+
+All code executed in **the shell where the previous commands were run in**
+will now be sanitized correctly.
+
+Common Problems
+===============
+
+Library Leaks Appearing
+-----------------------
+
+Check that you have correctly spelt *suppressions* as there will be no warnings
+for typos. A good check is to put some random characters in the .supp files,
+which will cause all tests to fail if it's begin read.
+
+Any new third party memory leaks need to go into *Leaks.supp* not
+*Address.supp* (which should ideally be completely empty) to be suppressed.
+
+ASAN was not the first library loaded
+--------------------------------------
+
+This can appear when running Python tests, as the executable is not build
+with instrumentation. To avoid this warning ensure that *verify_asan=0* is
+set in your options and that you are using GCC 8 onwards.
diff --git a/dev-docs/source/index.rst b/dev-docs/source/index.rst
index 1bd00d7980c..dde789db238 100644
--- a/dev-docs/source/index.rst
+++ b/dev-docs/source/index.rst
@@ -155,6 +155,7 @@ Testing
    SystemTests
    DataFilesForTesting
    TestingUtilities
+   RunningSanitizers
 
 :doc:`RunningTheUnitTests`
    Details on how to run the suite of unit tests.
@@ -180,6 +181,9 @@ Testing
 :doc:`TestingUtilities`
    Helper utlities used for testing.
 
+:doc:`RunningSanitizers`
+   How to run the various sanitizers locally.
+
 ===============
 GUI Development
 ===============
-- 
GitLab


From 4122ea159a78b0c7e08bbae71a0f07a793ad070a Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Fri, 15 Nov 2019 13:45:22 +0000
Subject: [PATCH 04/30] Update build script to include sanitizers and leak
 suppressions

Adds a step to the build scripts for jenkins to run sanitized builds
with the correct environment variables. Also adds leak suppressions for
upstream libraries too
---
 buildconfig/CMake/Sanitizers.cmake | 28 +++++++---------------
 buildconfig/Jenkins/buildscript    | 38 +++++++++++++++++++++++++++++-
 buildconfig/Sanitizer/Address.supp |  0
 buildconfig/Sanitizer/Leak.supp    |  2 ++
 4 files changed, 48 insertions(+), 20 deletions(-)
 create mode 100644 buildconfig/Sanitizer/Address.supp
 create mode 100644 buildconfig/Sanitizer/Leak.supp

diff --git a/buildconfig/CMake/Sanitizers.cmake b/buildconfig/CMake/Sanitizers.cmake
index ec1967bd8b0..3ab418aea98 100644
--- a/buildconfig/CMake/Sanitizers.cmake
+++ b/buildconfig/CMake/Sanitizers.cmake
@@ -4,9 +4,11 @@
 
 set(USE_SANITIZER "Off" CACHE STRING "Sanitizer mode to enable")
 set_property(CACHE USE_SANITIZER PROPERTY STRINGS
-             Off Address Address+Leak Leak Memory Thread Undefined)
+             Off Address Memory Thread Undefined)
 
-if(NOT ${USE_SANITIZER} MATCHES "Off")
+string(TOLOWER "${USE_SANITIZER}" USE_SANITIZERS_LOWER)
+
+if(NOT ${USE_SANITIZERS_LOWER} MATCHES "off")
     if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
         # Version 13 is needed for add_link_options, but not all platforms
         # currently have it
@@ -19,7 +21,7 @@ if(NOT ${USE_SANITIZER} MATCHES "Off")
 
     # Check and warn if we are not in a mode without debug symbols
     string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower)
-    if(${build_type_lower} MATCHES "release" OR ${build_type_lower} MATCHES "minsizerel" )
+    if("${build_type_lower}" MATCHES "release" OR "${build_type_lower}" MATCHES "minsizerel" )
         message(WARNING "You are running address sanitizers without debug information, try RelWithDebInfo")
 
     elseif(${build_type_lower} MATCHES "relwithdebinfo")
@@ -39,37 +41,25 @@ if(NOT ${USE_SANITIZER} MATCHES "Off")
 
     # N.b. we can switch this to add_link_options in CMake 3.13
     # rather than have to check the linker options etc
-    if (USE_SANITIZER STREQUAL "Address")
+    if (USE_SANITIZERS_LOWER STREQUAL "address")
         message(STATUS "Enabling address sanitizer")
 
         add_compile_options(-fsanitize=address)
         add_link_options(-fsanitize=address)
 
-    elseif (USE_SANITIZER STREQUAL "Address+Leak")
-        message(STATUS "Enabling address and leak sanitizer")
-
-        add_compile_options(-fsanitize=address,leak)
-        add_link_options(-fsanitize=address,leak)
-
-    elseif (USE_SANITIZER STREQUAL "Leak")
-        message(STATUS "Enabling leak sanitizer")
-
-        add_compile_options(-fsanitize=leak)
-        add_link_options(-fsanitize=leak)
-
-    elseif (USE_SANITIZER STREQUAL "Memory")
+    elseif (USE_SANITIZERS_LOWER STREQUAL "memory")
         # Requires Clang > 10 and libc++ (rather than libstdc++)
         # so we will wire up later
         message(FATAL_ERROR "Not Enabled Yet")
         message(STATUS "Enabling Memory sanitizer")
 
-    elseif (USE_SANITIZER STREQUAL "Thread")
+    elseif (USE_SANITIZERS_LOWER STREQUAL "thread")
         message(STATUS "Enabling Thread sanitizer")
 
         add_compile_options(-fsanitize=thread)
         add_link_options(-fsanitize=thread)
 
-    elseif (USE_SANITIZER STREQUAL "Undefined")
+    elseif (USE_SANITIZERS_LOWER STREQUAL "undefined")
         message(STATUS "Enabling undefined behaviour sanitizer")
 
         add_compile_options(
diff --git a/buildconfig/Jenkins/buildscript b/buildconfig/Jenkins/buildscript
index e385e77c85b..b5e4e8b6ff5 100755
--- a/buildconfig/Jenkins/buildscript
+++ b/buildconfig/Jenkins/buildscript
@@ -9,6 +9,9 @@
 # corresponds to any labels set on a slave.  BUILD_THREADS &
 # PARAVIEW_DIR should be set in the configuration of each slave.
 ###############################################################################
+# Set all string comparisons to case insensitive (i.e. Release == release)
+shopt -s nocasematch
+
 SCRIPT_DIR=$(dirname "$0")
 XVFB_SERVER_NUM=101
 ULIMIT_CORE_ORIG=$(ulimit -c)
@@ -305,6 +308,36 @@ if [[ ${DO_BUILD_PKG} == true ]]; then
     fi
 fi
 
+###############################################################################
+# Figure out if were doing a sanitizer build and setup any steps we need
+###############################################################################
+ASAN_OPTIONS=''
+LSAN_OPTIONS=''
+
+SANITIZER_FLAGS=''
+
+SUPPRESSIONS_DIR="${WORKSPACE}/buildconfig/Sanitizer"
+
+if [[ ${JOB_NAME} == *address* ]]; then
+    SANITIZER_FLAGS="-DUSE_SANITIZER=Address"
+    
+    ASAN_OPTIONS="suppressions=${SUPPRESSIONS_DIR}/Address.supp:detect_stack_use_after_return=true:halt_on_error=false:verify_asan=0"
+    LSAN_OPTIONS="suppressions=${SUPPRESSIONS_DIR}/Leak.supp"
+    
+    elif [[ ${JOB_NAME} == *memory* ]]; then
+    SANITIZER_FLAGS="-DUSE_SANITIZER=memory"
+    
+    elif [[ ${JOB_NAME} == *thread* ]]; then
+    SANITIZER_FLAGS="-DUSE_SANITIZER=thread"
+    
+    elif [[ ${JOB_NAME} == *undefined* ]]; then
+    SANITIZER_FLAGS="-DUSE_SANITIZER=undefined"
+fi
+
+if [[ -v ${SANITIZER_FLAGS} ]]; then
+    # Force build to RelWithDebInfo
+    BUILD_CONFIG="RelWithDebInfo"
+fi
 
 ###############################################################################
 # Generator
@@ -333,7 +366,7 @@ rm -f -- *.dmg *.rpm *.deb *.tar.gz *.tar.xz
 ###############################################################################
 # CMake configuration
 ###############################################################################
-$SCL_ENABLE "${CMAKE_EXE} ${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=${BUILD_CONFIG} -DENABLE_CPACK=ON -DMAKE_VATES=ON -DParaView_DIR=${PARAVIEW_DIR} -DMANTID_DATA_STORE=${MANTID_DATA_STORE} -DDOCS_HTML=ON -DENABLE_CONDA=ON -DCOLORED_COMPILER_OUTPUT=OFF ${DIST_FLAGS} ${PACKAGINGVARS} ${CLANGTIDYVAR} .."
+$SCL_ENABLE "${CMAKE_EXE} ${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=${BUILD_CONFIG} -DENABLE_CPACK=ON -DMAKE_VATES=ON -DParaView_DIR=${PARAVIEW_DIR} -DMANTID_DATA_STORE=${MANTID_DATA_STORE} -DDOCS_HTML=ON -DENABLE_CONDA=ON -DCOLORED_COMPILER_OUTPUT=OFF ${DIST_FLAGS} ${PACKAGINGVARS} ${CLANGTIDYVAR} ${SANITIZER_FLAGS} .."
 
 ###############################################################################
 # Coverity build should exit early
@@ -368,6 +401,9 @@ if [[ $USE_CLANG ]] && [[ ${JOB_NAME} == *clang_tidy* ]]; then
     exit 0
 fi
 
+# Set any ASAN options in the environment
+export ASAN_OPTIONS=${ASAN_OPTIONS}
+
 
 ###############################################################################
 # Run the unit tests
diff --git a/buildconfig/Sanitizer/Address.supp b/buildconfig/Sanitizer/Address.supp
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/buildconfig/Sanitizer/Leak.supp b/buildconfig/Sanitizer/Leak.supp
new file mode 100644
index 00000000000..8bb47e18c2c
--- /dev/null
+++ b/buildconfig/Sanitizer/Leak.supp
@@ -0,0 +1,2 @@
+leak:libNeXus
+leak:libTKernel
\ No newline at end of file
-- 
GitLab


From 11ef94744f79e62b41fa1e8f92681e13a99feb26 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Thu, 21 Nov 2019 17:45:31 +0000
Subject: [PATCH 05/30] Add notes on LD_PRELOAD for .Py tests

---
 buildconfig/CMake/Sanitizers.cmake    |  2 +-
 buildconfig/Jenkins/buildscript       |  3 ++-
 dev-docs/source/RunningSanitizers.rst | 38 ++++++++++++++++++++++++---
 3 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/buildconfig/CMake/Sanitizers.cmake b/buildconfig/CMake/Sanitizers.cmake
index 3ab418aea98..9d54e79d2a3 100644
--- a/buildconfig/CMake/Sanitizers.cmake
+++ b/buildconfig/CMake/Sanitizers.cmake
@@ -48,7 +48,7 @@ if(NOT ${USE_SANITIZERS_LOWER} MATCHES "off")
         add_link_options(-fsanitize=address)
 
     elseif (USE_SANITIZERS_LOWER STREQUAL "memory")
-        # Requires Clang > 10 and libc++ (rather than libstdc++)
+        # Requires Clang > 4 and libc++ (rather than libstdc++)
         # so we will wire up later
         message(FATAL_ERROR "Not Enabled Yet")
         message(STATUS "Enabling Memory sanitizer")
diff --git a/buildconfig/Jenkins/buildscript b/buildconfig/Jenkins/buildscript
index b5e4e8b6ff5..9c72672acfa 100755
--- a/buildconfig/Jenkins/buildscript
+++ b/buildconfig/Jenkins/buildscript
@@ -321,7 +321,8 @@ SUPPRESSIONS_DIR="${WORKSPACE}/buildconfig/Sanitizer"
 if [[ ${JOB_NAME} == *address* ]]; then
     SANITIZER_FLAGS="-DUSE_SANITIZER=Address"
     
-    ASAN_OPTIONS="suppressions=${SUPPRESSIONS_DIR}/Address.supp:detect_stack_use_after_return=true:halt_on_error=false:verify_asan=0"
+    # At a future date we could add an LD_PRELOAD export here, see docs for info
+    ASAN_OPTIONS="suppressions=${SUPPRESSIONS_DIR}/Address.supp:detect_stack_use_after_return=true:halt_on_error=false:verify_asan_link_order=0"
     LSAN_OPTIONS="suppressions=${SUPPRESSIONS_DIR}/Leak.supp"
     
     elif [[ ${JOB_NAME} == *memory* ]]; then
diff --git a/dev-docs/source/RunningSanitizers.rst b/dev-docs/source/RunningSanitizers.rst
index 2e2604f0dc2..7e6e80deb94 100644
--- a/dev-docs/source/RunningSanitizers.rst
+++ b/dev-docs/source/RunningSanitizers.rst
@@ -93,7 +93,7 @@ the path to your Mantid source directly:
 
     .. code-block:: sh
 
-        export ASAN_OPTIONS="verify_asan=0:detect_stack_use_after_return=true:halt_on_error=false:suppressions=*path_to_mantid*/buildconfig/Sanitizer/Address.supp"
+        export ASAN_OPTIONS="verify_asan_link_order=0:detect_stack_use_after_return=true:halt_on_error=false:suppressions=*path_to_mantid*/buildconfig/Sanitizer/Address.supp"
         export LSAN_OPTIONS="suppressions=*path_to_mantid*/buildconfig/Sanitizer/Leak.supp"
 
 For example, if Mantid was checked out in the home directory of user *abc* in a
@@ -101,12 +101,41 @@ folder called mantid it would be:
 
     .. code-block:: sh
 
-        export ASAN_OPTIONS="verify_asan=0:detect_stack_use_after_return=true:halt_on_error=false:suppressions=/home/abc/mantid/buildconfig/Sanitizer/Address.supp"
+        export ASAN_OPTIONS="verify_asan_link_order=0:detect_stack_use_after_return=true:halt_on_error=false:suppressions=/home/abc/mantid/buildconfig/Sanitizer/Address.supp"
         export LSAN_OPTIONS="suppressions=/home/abc/mantid/buildconfig/Sanitizer/Leak.supp"
 
 All code executed in **the shell where the previous commands were run in**
 will now be sanitized correctly.
 
+Instrumenting Python (Advanced)
+-------------------------------
+
+Currently any code started in Python (i.e. Python Unit Tests) will not pre-load
+ASAN instrumentation. This can be split into two categories:
+
+- Code which uses Python only components: Not worth instrumenting as any
+  issues will be upstream. This also will emit an error if
+  *verify_asan_link_order* is set to true, as we technically haven't
+  instrumented anything (unless you have a sanitized Python build)
+- Code which uses Mantid C++ components: This can be instrumented, but
+  (currently) isn't by default, as the user has to determine the *LD_PRELOAD*
+  path.
+
+If you need / want to profile C++ components which are triggered from Python
+the following steps should setup your environment:
+
+    .. code-block:: sh
+
+        # Get the path to your linked ASAN
+        ldd bin/KernelTest | grep "libasan"
+        export LD_PRELOAD=/usr/lib/path_to/libasan.so.x
+
+        # You may want to re-run the ASAN_OPTIONS export dropping
+        # the verify to make sure that the C++ component is being instrumented:
+
+        export ASAN_OPTIONS="detect_stack_use_after_return=true:halt_on_error=false:suppressions=*path_to_mantid*/buildconfig/Sanitizer/Address.supp"
+
+
 Common Problems
 ===============
 
@@ -124,5 +153,6 @@ ASAN was not the first library loaded
 --------------------------------------
 
 This can appear when running Python tests, as the executable is not build
-with instrumentation. To avoid this warning ensure that *verify_asan=0* is
-set in your options and that you are using GCC 8 onwards.
+with instrumentation. To avoid this warning ensure that
+*verify_asan_link_order=0* is set in your environment and that you are
+using GCC 8 onwards.
-- 
GitLab


From 14251c1d3f7c09805c068b63684ef77ba8934699 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Thu, 28 Nov 2019 14:36:35 +0000
Subject: [PATCH 06/30] Update CXXTest to inject sanitizer env

Updates CXXTest to inject the environment required for sanitizers rather
than forcing the user to do it themselves
---
 buildconfig/CMake/FindCxxTest.cmake           | 51 ++++++++++++-------
 buildconfig/CMake/Sanitizers.cmake            |  8 +--
 buildconfig/Jenkins/buildscript               | 12 -----
 dev-docs/source/RunningSanitizers.rst         | 28 +++++-----
 {buildconfig => tools}/Sanitizer/Address.supp |  0
 {buildconfig => tools}/Sanitizer/Leak.supp    |  0
 6 files changed, 48 insertions(+), 51 deletions(-)
 rename {buildconfig => tools}/Sanitizer/Address.supp (100%)
 rename {buildconfig => tools}/Sanitizer/Leak.supp (100%)

diff --git a/buildconfig/CMake/FindCxxTest.cmake b/buildconfig/CMake/FindCxxTest.cmake
index d88bbdd42c8..5526d094a26 100644
--- a/buildconfig/CMake/FindCxxTest.cmake
+++ b/buildconfig/CMake/FindCxxTest.cmake
@@ -180,26 +180,43 @@ macro(CXXTEST_ADD_TEST _cxxtest_testname)
       add_test ( NAME ${_cxxtest_separate_name}
                 COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_BINARY_DIR}/bin/Testing"
             $<TARGET_FILE:${_cxxtest_testname}> ${_suitename} )
-      set_tests_properties ( ${_cxxtest_separate_name} PROPERTIES
-                             TIMEOUT ${TESTING_TIMEOUT} )
 
-  if (CXXTEST_ADD_PERFORMANCE)
-    # ------ Performance test version -------
-    # Name of the possibly-existing Performance test suite
-    set( _performance_suite_name "${_suitename}Performance" )
-    # Read the contents of the header file
-      FILE( READ ${part} _file_contents )
-    # Is that suite defined in there at all?
-    STRING(REGEX MATCH ${_performance_suite_name} _search_res ${_file_contents} )
-    if (NOT "${_search_res}" STREQUAL "")
-      set( _cxxtest_separate_name "${_cxxtest_testname}_${_performance_suite_name}")
-      add_test ( NAME ${_cxxtest_separate_name}
-                COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_BINARY_DIR}/bin/Testing"
-            $<TARGET_FILE:${_cxxtest_testname}> ${_performance_suite_name} )
       set_tests_properties ( ${_cxxtest_separate_name} PROPERTIES
                              TIMEOUT ${TESTING_TIMEOUT} )
-    endif ()
-  endif ()
+
+      if (CXXTEST_ADD_PERFORMANCE)
+        # ------ Performance test version -------
+        # Name of the possibly-existing Performance test suite
+        set( _performance_suite_name "${_suitename}Performance" )
+        # Read the contents of the header file
+          FILE( READ ${part} _file_contents )
+        # Is that suite defined in there at all?
+        STRING(REGEX MATCH ${_performance_suite_name} _search_res ${_file_contents} )
+        if (NOT "${_search_res}" STREQUAL "")
+          set( _cxxtest_separate_name "${_cxxtest_testname}_${_performance_suite_name}")
+          add_test ( NAME ${_cxxtest_separate_name}
+                    COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_BINARY_DIR}/bin/Testing"
+                $<TARGET_FILE:${_cxxtest_testname}> ${_performance_suite_name} )
+          set_tests_properties ( ${_cxxtest_separate_name} PROPERTIES
+                                TIMEOUT ${TESTING_TIMEOUT} )
+        endif ()
+      endif ()
+
+      set( SUPPRESSIONS_DIR "${CMAKE_SOURCE_DIR}/tools/Sanitizer" )
+      if ( USE_SANITIZERS_LOWER STREQUAL "address" )
+        # See dev docs on sanitizers for details on why verify_asan_link is false
+        # Trying to quote these options causes the quotation to be forwarded
+        set(_ASAN_OPTS "suppressions=${SUPPRESSIONS_DIR}/Address.supp:detect_stack_use_after_return=true:halt_on_error=false:verify_asan_link_order=false")
+        set_property( TEST ${_cxxtest_separate_name} APPEND PROPERTY
+          ENVIRONMENT ASAN_OPTIONS=${_ASAN_OPTS} )
+
+        set( _LSAN_OPTS "suppressions=${SUPPRESSIONS_DIR}/Leak.supp" )
+          set_property( TEST ${_cxxtest_separate_name} APPEND PROPERTY
+          ENVIRONMENT LSAN_OPTIONS= ${_LSAN_OPTS} )
+
+      endif()
+
+
     endforeach ( part ${ARGN} )
 endmacro(CXXTEST_ADD_TEST)
 
diff --git a/buildconfig/CMake/Sanitizers.cmake b/buildconfig/CMake/Sanitizers.cmake
index 9d54e79d2a3..8ca22079a3c 100644
--- a/buildconfig/CMake/Sanitizers.cmake
+++ b/buildconfig/CMake/Sanitizers.cmake
@@ -4,7 +4,7 @@
 
 set(USE_SANITIZER "Off" CACHE STRING "Sanitizer mode to enable")
 set_property(CACHE USE_SANITIZER PROPERTY STRINGS
-             Off Address Memory Thread Undefined)
+             Off Address Thread Undefined)
 
 string(TOLOWER "${USE_SANITIZER}" USE_SANITIZERS_LOWER)
 
@@ -47,12 +47,6 @@ if(NOT ${USE_SANITIZERS_LOWER} MATCHES "off")
         add_compile_options(-fsanitize=address)
         add_link_options(-fsanitize=address)
 
-    elseif (USE_SANITIZERS_LOWER STREQUAL "memory")
-        # Requires Clang > 4 and libc++ (rather than libstdc++)
-        # so we will wire up later
-        message(FATAL_ERROR "Not Enabled Yet")
-        message(STATUS "Enabling Memory sanitizer")
-
     elseif (USE_SANITIZERS_LOWER STREQUAL "thread")
         message(STATUS "Enabling Thread sanitizer")
 
diff --git a/buildconfig/Jenkins/buildscript b/buildconfig/Jenkins/buildscript
index 9c72672acfa..22f06c6227b 100755
--- a/buildconfig/Jenkins/buildscript
+++ b/buildconfig/Jenkins/buildscript
@@ -311,20 +311,12 @@ fi
 ###############################################################################
 # Figure out if were doing a sanitizer build and setup any steps we need
 ###############################################################################
-ASAN_OPTIONS=''
-LSAN_OPTIONS=''
 
 SANITIZER_FLAGS=''
 
-SUPPRESSIONS_DIR="${WORKSPACE}/buildconfig/Sanitizer"
-
 if [[ ${JOB_NAME} == *address* ]]; then
     SANITIZER_FLAGS="-DUSE_SANITIZER=Address"
     
-    # At a future date we could add an LD_PRELOAD export here, see docs for info
-    ASAN_OPTIONS="suppressions=${SUPPRESSIONS_DIR}/Address.supp:detect_stack_use_after_return=true:halt_on_error=false:verify_asan_link_order=0"
-    LSAN_OPTIONS="suppressions=${SUPPRESSIONS_DIR}/Leak.supp"
-    
     elif [[ ${JOB_NAME} == *memory* ]]; then
     SANITIZER_FLAGS="-DUSE_SANITIZER=memory"
     
@@ -402,10 +394,6 @@ if [[ $USE_CLANG ]] && [[ ${JOB_NAME} == *clang_tidy* ]]; then
     exit 0
 fi
 
-# Set any ASAN options in the environment
-export ASAN_OPTIONS=${ASAN_OPTIONS}
-
-
 ###############################################################################
 # Run the unit tests
 ###############################################################################
diff --git a/dev-docs/source/RunningSanitizers.rst b/dev-docs/source/RunningSanitizers.rst
index 7e6e80deb94..f1773282050 100644
--- a/dev-docs/source/RunningSanitizers.rst
+++ b/dev-docs/source/RunningSanitizers.rst
@@ -85,27 +85,25 @@ resolve (or have been resolved but not appeared downstream).
 We can suppress warnings in the address sanitizer by setting environment
 variables in the console before running in each mode.
 
-Address Sanitizer
------------------
+Advanced Details
+================
 
-Run the following code to set the sanitizers options, being sure to substitute
-the path to your Mantid source directly:
+Most developers do not need to read this, but it's good for those who
+want to know what's happening
 
-    .. code-block:: sh
-
-        export ASAN_OPTIONS="verify_asan_link_order=0:detect_stack_use_after_return=true:halt_on_error=false:suppressions=*path_to_mantid*/buildconfig/Sanitizer/Address.supp"
-        export LSAN_OPTIONS="suppressions=*path_to_mantid*/buildconfig/Sanitizer/Leak.supp"
-
-For example, if Mantid was checked out in the home directory of user *abc* in a
-folder called mantid it would be:
+CMake substitutes in various flags for the address sanitizer builds to
+setup suppressions etc... this is the equivalent of doing the following
+in a local shell:
 
     .. code-block:: sh
 
-        export ASAN_OPTIONS="verify_asan_link_order=0:detect_stack_use_after_return=true:halt_on_error=false:suppressions=/home/abc/mantid/buildconfig/Sanitizer/Address.supp"
-        export LSAN_OPTIONS="suppressions=/home/abc/mantid/buildconfig/Sanitizer/Leak.supp"
+        export ASAN_OPTIONS="verify_asan_link_order=0:detect_stack_use_after_return=true:halt_on_error=false:suppressions=*path_to_mantid*/tools/Sanitizer/Address.supp"
+        export LSAN_OPTIONS="suppressions=*path_to_mantid*/tools/Sanitizer/Leak.supp"
 
-All code executed in **the shell where the previous commands were run in**
-will now be sanitized correctly.
+All code executed which is executed in that shell will now be sanitized
+correctly. To save developers effort the CXX_ADD_TEST macro (in
+FindCxxTest.cmake) will append these environment variables on a developers
+behalf.
 
 Instrumenting Python (Advanced)
 -------------------------------
diff --git a/buildconfig/Sanitizer/Address.supp b/tools/Sanitizer/Address.supp
similarity index 100%
rename from buildconfig/Sanitizer/Address.supp
rename to tools/Sanitizer/Address.supp
diff --git a/buildconfig/Sanitizer/Leak.supp b/tools/Sanitizer/Leak.supp
similarity index 100%
rename from buildconfig/Sanitizer/Leak.supp
rename to tools/Sanitizer/Leak.supp
-- 
GitLab


From 48794ffd7d67cfe0da7f09a978e5379b40c12702 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Thu, 28 Nov 2019 18:34:35 +0000
Subject: [PATCH 07/30] Switch to generator expressions for sanitizer flags

---
 buildconfig/CMake/Sanitizers.cmake | 52 +++++++++++-------------------
 1 file changed, 19 insertions(+), 33 deletions(-)

diff --git a/buildconfig/CMake/Sanitizers.cmake b/buildconfig/CMake/Sanitizers.cmake
index 8ca22079a3c..b87adaada2e 100644
--- a/buildconfig/CMake/Sanitizers.cmake
+++ b/buildconfig/CMake/Sanitizers.cmake
@@ -9,12 +9,6 @@ set_property(CACHE USE_SANITIZER PROPERTY STRINGS
 string(TOLOWER "${USE_SANITIZER}" USE_SANITIZERS_LOWER)
 
 if(NOT ${USE_SANITIZERS_LOWER} MATCHES "off")
-    if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
-        # Version 13 is needed for add_link_options, but not all platforms
-        # currently have it
-        message(FATAL_ERROR "CMake 3.13 onwards is required to run the sanitizers")
-    endif()
-
     if(WIN32)
         message(FATAL_ERROR "Windows does not support sanitizers")
     endif()
@@ -39,32 +33,24 @@ if(NOT ${USE_SANITIZERS_LOWER} MATCHES "off")
     # Allow all instrumented code to continue beyond the first error
     add_compile_options(-fsanitize-recover=all)
 
-    # N.b. we can switch this to add_link_options in CMake 3.13
-    # rather than have to check the linker options etc
-    if (USE_SANITIZERS_LOWER STREQUAL "address")
-        message(STATUS "Enabling address sanitizer")
-
-        add_compile_options(-fsanitize=address)
-        add_link_options(-fsanitize=address)
-
-    elseif (USE_SANITIZERS_LOWER STREQUAL "thread")
-        message(STATUS "Enabling Thread sanitizer")
-
-        add_compile_options(-fsanitize=thread)
-        add_link_options(-fsanitize=thread)
-
-    elseif (USE_SANITIZERS_LOWER STREQUAL "undefined")
-        message(STATUS "Enabling undefined behaviour sanitizer")
-
-        add_compile_options(
-            -fsanitize=undefined
-            # RTTI information is not exported for some classes causing the
-            # linker to fail whilst adding vptr instrumentation
-            -fno-sanitize=vptr
-        )
-        add_link_options(-fsanitize=undefined)
-    else()
-        message(FATAL_ERROR "Unrecognised Sanitizer Option")
-    endif()
+    # Address
+    add_compile_options(
+        $<$<STREQUAL:$<LOWER_CASE:${USE_SANITIZER}>,"address">:-fsanitize=address>)
+    add_link_options(
+        $<$<STREQUAL:$<LOWER_CASE:${USE_SANITIZER}>,"address">:-fsanitize=address>)
+
+    # Thread
+    add_compile_options(
+        $<$<STREQUAL:$<LOWER_CASE:${USE_SANITIZER}>,"thread">:-fsanitize=thread>)
+    add_link_options(
+        $<$<STREQUAL:$<LOWER_CASE:${USE_SANITIZER}>,"thread">:-fsanitize=thread>)
+
+    # Undefined
+    # RTTI information is not exported for some classes causing the
+    # linker to fail whilst adding vptr instrumentation
+    add_compile_options(
+        $<$<STREQUAL:$<LOWER_CASE:${USE_SANITIZER}>,"undefined">:-fsanitize=undefined -fno-sanitize=vptr>)
+    add_link_options(
+        $<$<STREQUAL:$<LOWER_CASE:${USE_SANITIZER}>,"undefined">:-fsanitize=undefined>)
 
 endif()
-- 
GitLab


From 84c33d8dcb67c1627c49b0d057fd63e23b578f1c Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Mon, 27 Jan 2020 16:13:46 +0000
Subject: [PATCH 08/30] Update Sanitizers with PR feedback and edge cases

Updates the Sanitizers to handle whitespace anywhere in the selected
sanitizer mode
Fixes an issue where undefined sanitizer would not work (generator
expressions do not handle whitespace)
Updates documentation following some feedback, and drops some old
information (such as min CMake version)

Fix indentation and suppress all Python warnings

Reverts the indentation changes introduced in an earlier commit by auto
formatting tools. Changes the regex for the address suppressions so we
match Python 2 and 3
---
 buildconfig/CMake/Sanitizers.cmake    | 19 +++++++++++++------
 buildconfig/Jenkins/buildscript       |  6 +++---
 dev-docs/source/RunningSanitizers.rst |  3 +--
 tools/Sanitizer/Address.supp          |  2 ++
 tools/Sanitizer/Leak.supp             | 25 ++++++++++++++++++++++++-
 5 files changed, 43 insertions(+), 12 deletions(-)

diff --git a/buildconfig/CMake/Sanitizers.cmake b/buildconfig/CMake/Sanitizers.cmake
index b87adaada2e..3850a7db099 100644
--- a/buildconfig/CMake/Sanitizers.cmake
+++ b/buildconfig/CMake/Sanitizers.cmake
@@ -9,10 +9,15 @@ set_property(CACHE USE_SANITIZER PROPERTY STRINGS
 string(TOLOWER "${USE_SANITIZER}" USE_SANITIZERS_LOWER)
 
 if(NOT ${USE_SANITIZERS_LOWER} MATCHES "off")
+    # Check we have a supported compiler
     if(WIN32)
         message(FATAL_ERROR "Windows does not support sanitizers")
     endif()
 
+    if(CMAKE_COMPILER_IS_GNUCXX AND (NOT CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8))
+        message(FATAL_ERROR "GCC 7 and below do not support sanitizers")
+    endif()
+
     # Check and warn if we are not in a mode without debug symbols
     string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower)
     if("${build_type_lower}" MATCHES "release" OR "${build_type_lower}" MATCHES "minsizerel" )
@@ -35,22 +40,24 @@ if(NOT ${USE_SANITIZERS_LOWER} MATCHES "off")
 
     # Address
     add_compile_options(
-        $<$<STREQUAL:$<LOWER_CASE:${USE_SANITIZER}>,"address">:-fsanitize=address>)
+        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"address">:-fsanitize=address>)
     add_link_options(
-        $<$<STREQUAL:$<LOWER_CASE:${USE_SANITIZER}>,"address">:-fsanitize=address>)
+        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"address">:-fsanitize=address>)
 
     # Thread
     add_compile_options(
-        $<$<STREQUAL:$<LOWER_CASE:${USE_SANITIZER}>,"thread">:-fsanitize=thread>)
+        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"thread">:-fsanitize=thread>)
     add_link_options(
-        $<$<STREQUAL:$<LOWER_CASE:${USE_SANITIZER}>,"thread">:-fsanitize=thread>)
+        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"thread">:-fsanitize=thread>)
 
     # Undefined
     # RTTI information is not exported for some classes causing the
     # linker to fail whilst adding vptr instrumentation
     add_compile_options(
-        $<$<STREQUAL:$<LOWER_CASE:${USE_SANITIZER}>,"undefined">:-fsanitize=undefined -fno-sanitize=vptr>)
+        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"undefined">:-fsanitize=undefined>
+        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"undefined">:-fno-sanitize=vptr>)
+
     add_link_options(
-        $<$<STREQUAL:$<LOWER_CASE:${USE_SANITIZER}>,"undefined">:-fsanitize=undefined>)
+        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"undefined">:-fsanitize=undefined>)
 
 endif()
diff --git a/buildconfig/Jenkins/buildscript b/buildconfig/Jenkins/buildscript
index 22f06c6227b..10343ba8c7a 100755
--- a/buildconfig/Jenkins/buildscript
+++ b/buildconfig/Jenkins/buildscript
@@ -317,13 +317,13 @@ SANITIZER_FLAGS=''
 if [[ ${JOB_NAME} == *address* ]]; then
     SANITIZER_FLAGS="-DUSE_SANITIZER=Address"
     
-    elif [[ ${JOB_NAME} == *memory* ]]; then
+elif [[ ${JOB_NAME} == *memory* ]]; then
     SANITIZER_FLAGS="-DUSE_SANITIZER=memory"
     
-    elif [[ ${JOB_NAME} == *thread* ]]; then
+elif [[ ${JOB_NAME} == *thread* ]]; then
     SANITIZER_FLAGS="-DUSE_SANITIZER=thread"
     
-    elif [[ ${JOB_NAME} == *undefined* ]]; then
+elif [[ ${JOB_NAME} == *undefined* ]]; then
     SANITIZER_FLAGS="-DUSE_SANITIZER=undefined"
 fi
 
diff --git a/dev-docs/source/RunningSanitizers.rst b/dev-docs/source/RunningSanitizers.rst
index f1773282050..b3d916c0f6d 100644
--- a/dev-docs/source/RunningSanitizers.rst
+++ b/dev-docs/source/RunningSanitizers.rst
@@ -18,8 +18,8 @@ Pre-requisites
 
 The following tooling is required:
 
-- CMake 13.0 onwards (instructions for Ubuntu `here <https://apt.kitware.com/>`__)
 - GCC-8 onwards
+- Clang 3.2 onwards
 
 
 Switching to Sanitizer Build
@@ -28,7 +28,6 @@ Switching to Sanitizer Build
 The following sanitizers modes are available:
 
 - Address
-- Memory (Not implemented yet, requires clang support)
 - Thread
 - Undefined
 
diff --git a/tools/Sanitizer/Address.supp b/tools/Sanitizer/Address.supp
index e69de29bb2d..ba6df22297f 100644
--- a/tools/Sanitizer/Address.supp
+++ b/tools/Sanitizer/Address.supp
@@ -0,0 +1,2 @@
+# This file is a placeholder for future suppressions. It is passed through
+# the ctest harness to the currently running test
\ No newline at end of file
diff --git a/tools/Sanitizer/Leak.supp b/tools/Sanitizer/Leak.supp
index 8bb47e18c2c..f900da7b50b 100644
--- a/tools/Sanitizer/Leak.supp
+++ b/tools/Sanitizer/Leak.supp
@@ -1,2 +1,25 @@
+# NeXus has a known memory leak when reading attributes.
+# It is fixed upstream but not made it to distribution packages
+# Direct leak of 12114 byte(s) in 1346 object(s) allocated from:
+#     #0 0x7fb126db5538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
+#     #1 0x7fb120a534cb  (/usr/lib/libNeXus.so.0+0xc4cb)
+#     #2 0x7fb100000000  (<unknown module>)
 leak:libNeXus
-leak:libTKernel
\ No newline at end of file
+
+# OpenCascade memory allocation seems to confuse ASAN
+# Direct leak of 544 byte(s) in 1 object(s) allocated from:
+#     #0 0x7f77eec3a618 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0618)
+#     #1 0x7f77e4141b08  (/usr/lib/x86_64-linux-gnu/libTKernel.so.11+0x7bb08)
+leak:libTKernel
+
+# TBB leaks some memory allocated in singleton depending on deinitialization order
+# Direct leak of 1560 byte(s) in 3 object(s) allocated from:
+#     #0 0x7f7ae72a80a0 in operator new[](unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc80a0)
+#     #1 0x7f7ae595d13e  (/usr/lib/x86_64-linux-gnu/libtbb.so.2+0x2213e)
+leak:libtbb
+
+# Python and associated libraries *appears* to leak memory.
+leak:libpython
+leak:umath
+leak:multiarray
+leak:_ctypes
-- 
GitLab


From 9253cc6d3b7c29c61a287e3a931601615e8007af Mon Sep 17 00:00:00 2001
From: Owen Arnold <owen.arnold@stfc.ac.uk>
Date: Wed, 4 Mar 2020 14:09:53 +0000
Subject: [PATCH 09/30] Detector count on spectrum info

---
 Framework/API/inc/MantidAPI/SpectrumInfo.h          |  1 +
 Framework/API/src/SpectrumInfo.cpp                  |  4 ++++
 .../Beamline/inc/MantidBeamline/SpectrumInfo.h      |  1 +
 Framework/Beamline/src/SpectrumInfo.cpp             |  9 +++++++++
 Framework/Beamline/test/SpectrumInfoTest.h          | 13 +++++++++++++
 .../mantid/api/src/Exports/SpectrumInfo.cpp         |  6 ++++--
 .../test/python/mantid/api/SpectrumInfoTest.py      |  5 +++++
 7 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/Framework/API/inc/MantidAPI/SpectrumInfo.h b/Framework/API/inc/MantidAPI/SpectrumInfo.h
index 359b361aa59..75d8caaf0f6 100644
--- a/Framework/API/inc/MantidAPI/SpectrumInfo.h
+++ b/Framework/API/inc/MantidAPI/SpectrumInfo.h
@@ -57,6 +57,7 @@ public:
   ~SpectrumInfo();
 
   size_t size() const;
+  size_t detectorCount() const;
 
   const SpectrumDefinition &spectrumDefinition(const size_t index) const;
   const Kernel::cow_ptr<std::vector<SpectrumDefinition>> &
diff --git a/Framework/API/src/SpectrumInfo.cpp b/Framework/API/src/SpectrumInfo.cpp
index 1f341da38fd..fb6a7e2bace 100644
--- a/Framework/API/src/SpectrumInfo.cpp
+++ b/Framework/API/src/SpectrumInfo.cpp
@@ -33,6 +33,10 @@ SpectrumInfo::~SpectrumInfo() = default;
 /// Returns the size of the SpectrumInfo, i.e., the number of spectra.
 size_t SpectrumInfo::size() const { return m_spectrumInfo.size(); }
 
+size_t SpectrumInfo::detectorCount() const {
+  return m_spectrumInfo.detectorCount();
+}
+
 /// Returns a const reference to the SpectrumDefinition of the spectrum.
 const SpectrumDefinition &
 SpectrumInfo::spectrumDefinition(const size_t index) const {
diff --git a/Framework/Beamline/inc/MantidBeamline/SpectrumInfo.h b/Framework/Beamline/inc/MantidBeamline/SpectrumInfo.h
index a9254dee4c4..ad030d848c1 100644
--- a/Framework/Beamline/inc/MantidBeamline/SpectrumInfo.h
+++ b/Framework/Beamline/inc/MantidBeamline/SpectrumInfo.h
@@ -47,6 +47,7 @@ public:
       Kernel::cow_ptr<std::vector<SpectrumDefinition>> spectrumDefinition);
 
   size_t size() const;
+  size_t detectorCount() const;
 
   const SpectrumDefinition &spectrumDefinition(const size_t index) const;
   void setSpectrumDefinition(const size_t index, SpectrumDefinition def);
diff --git a/Framework/Beamline/src/SpectrumInfo.cpp b/Framework/Beamline/src/SpectrumInfo.cpp
index 9097d60b3c7..11fcd7924d3 100644
--- a/Framework/Beamline/src/SpectrumInfo.cpp
+++ b/Framework/Beamline/src/SpectrumInfo.cpp
@@ -26,6 +26,15 @@ size_t SpectrumInfo::size() const {
   return m_spectrumDefinition->size();
 }
 
+/// Return count of all detectors used within spectrum
+size_t SpectrumInfo::detectorCount() const {
+    size_t count = 0;
+  for (const auto &spec : *m_spectrumDefinition) {
+    count += spec.size();
+  }
+  return count;
+}
+
 /// Returns a const reference to the SpectrumDefinition of the spectrum.
 const SpectrumDefinition &
 SpectrumInfo::spectrumDefinition(const size_t index) const {
diff --git a/Framework/Beamline/test/SpectrumInfoTest.h b/Framework/Beamline/test/SpectrumInfoTest.h
index 3e7b5e0081f..aff8bb864b9 100644
--- a/Framework/Beamline/test/SpectrumInfoTest.h
+++ b/Framework/Beamline/test/SpectrumInfoTest.h
@@ -108,6 +108,19 @@ public:
                        (std::pair<size_t, size_t>(i, 0)));
     }
   }
+
+  void test_detectorCount() {
+    SpectrumDefinition def1;
+    def1.add(1);
+    def1.add(2);
+    SpectrumDefinition def2;
+    def2.add(1);
+    SpectrumInfo info{2};
+    info.setSpectrumDefinition(0, def1);
+    info.setSpectrumDefinition(1, def2);
+    TS_ASSERT_EQUALS(info.size(), 2);
+    TS_ASSERT_EQUALS(info.detectorCount(), 3);
+  }
 };
 
 #endif /* MANTID_BEAMLINE_SPECTRUMINFOTEST_H_ */
diff --git a/Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfo.cpp b/Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfo.cpp
index c44d7a8d3db..c993ca26bbd 100644
--- a/Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfo.cpp
+++ b/Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfo.cpp
@@ -15,11 +15,11 @@
 #include <boost/python/list.hpp>
 #include <boost/python/return_value_policy.hpp>
 
-using Mantid::SpectrumDefinition;
 using Mantid::API::SpectrumInfo;
 using Mantid::API::SpectrumInfoItem;
 using Mantid::API::SpectrumInfoIterator;
 using Mantid::PythonInterface::SpectrumInfoPythonIterator;
+using Mantid::SpectrumDefinition;
 using namespace boost::python;
 
 // Helper method to make the python iterator
@@ -76,5 +76,7 @@ void export_SpectrumInfo() {
       .def("getSpectrumDefinition", &SpectrumInfo::spectrumDefinition,
            return_value_policy<return_by_value>(), (arg("self"), arg("index")),
            "Returns the SpectrumDefinition of the spectrum with the given "
-           "index.");
+           "index.")
+      .def("detectorCount", &SpectrumInfo::detectorCount, arg("self"),
+           "Returns the total number of detectors used across spectrum info.");
 }
diff --git a/Framework/PythonInterface/test/python/mantid/api/SpectrumInfoTest.py b/Framework/PythonInterface/test/python/mantid/api/SpectrumInfoTest.py
index daa23d3ec09..e73718977f1 100644
--- a/Framework/PythonInterface/test/python/mantid/api/SpectrumInfoTest.py
+++ b/Framework/PythonInterface/test/python/mantid/api/SpectrumInfoTest.py
@@ -40,6 +40,11 @@ class SpectrumInfoTest(unittest.TestCase):
         info = self._ws.spectrumInfo()
         self.assertEqual(info.size(), 3)
 
+    def test_detectorCount(self):
+        """ Check total detector count """
+        info = self._ws.spectrumInfo()
+        self.assertEqual(info.detectorCount, 3)
+
     def test_isMonitor(self):
         """ Check if a monitor is present. """
         info = self._ws.spectrumInfo()
-- 
GitLab


From e45c8c0d5b820094dc13bc32aeaffb03bc6de17a Mon Sep 17 00:00:00 2001
From: Owen Arnold <owen.arnold@stfc.ac.uk>
Date: Wed, 4 Mar 2020 14:53:31 +0000
Subject: [PATCH 10/30] Has detectors to iterator

---
 Framework/API/inc/MantidAPI/SpectrumInfoItem.h                | 4 +++-
 Framework/Beamline/src/SpectrumInfo.cpp                       | 2 +-
 .../mantid/api/src/Exports/SpectrumInfoItem.cpp               | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Framework/API/inc/MantidAPI/SpectrumInfoItem.h b/Framework/API/inc/MantidAPI/SpectrumInfoItem.h
index 29ac3b3c900..916d649daeb 100644
--- a/Framework/API/inc/MantidAPI/SpectrumInfoItem.h
+++ b/Framework/API/inc/MantidAPI/SpectrumInfoItem.h
@@ -12,8 +12,8 @@
 #include "MantidTypes/SpectrumDefinition.h"
 #include <type_traits>
 
-using Mantid::SpectrumDefinition;
 using Mantid::Kernel::V3D;
+using Mantid::SpectrumDefinition;
 
 namespace Mantid {
 namespace API {
@@ -60,6 +60,8 @@ public:
     return m_spectrumInfo->hasUniqueDetector(m_index);
   }
 
+  bool hasDetectors() const { return m_spectrumInfo->hasDetectors(m_index); }
+
   const Mantid::SpectrumDefinition &spectrumDefinition() const {
     return m_spectrumInfo->spectrumDefinition(m_index);
   }
diff --git a/Framework/Beamline/src/SpectrumInfo.cpp b/Framework/Beamline/src/SpectrumInfo.cpp
index 11fcd7924d3..403dbf67001 100644
--- a/Framework/Beamline/src/SpectrumInfo.cpp
+++ b/Framework/Beamline/src/SpectrumInfo.cpp
@@ -28,7 +28,7 @@ size_t SpectrumInfo::size() const {
 
 /// Return count of all detectors used within spectrum
 size_t SpectrumInfo::detectorCount() const {
-    size_t count = 0;
+  size_t count = 0;
   for (const auto &spec : *m_spectrumDefinition) {
     count += spec.size();
   }
diff --git a/Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfoItem.cpp b/Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfoItem.cpp
index 322e5d17066..eca0ed72313 100644
--- a/Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfoItem.cpp
+++ b/Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfoItem.cpp
@@ -27,6 +27,8 @@ void export_SpectrumInfoItem() {
       .add_property("signedTwoTheta",
                     &SpectrumInfoItem<SpectrumInfo>::signedTwoTheta)
       .add_property("l2", &SpectrumInfoItem<SpectrumInfo>::l2)
+      .add_property("hasDetectors",
+                    &SpectrumInfoItem<SpectrumInfo>::hasDetectors)
       .add_property("hasUniqueDetector",
                     &SpectrumInfoItem<SpectrumInfo>::hasUniqueDetector)
       .add_property(
-- 
GitLab


From e27beb0570861a75f64d5d8d43a0b33a44e405f9 Mon Sep 17 00:00:00 2001
From: Owen Arnold <owen.arnold@stfc.ac.uk>
Date: Wed, 4 Mar 2020 14:57:10 +0000
Subject: [PATCH 11/30] clang formatting fix

---
 Framework/API/inc/MantidAPI/SpectrumInfoItem.h                  | 2 +-
 .../PythonInterface/mantid/api/src/Exports/SpectrumInfo.cpp     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Framework/API/inc/MantidAPI/SpectrumInfoItem.h b/Framework/API/inc/MantidAPI/SpectrumInfoItem.h
index 916d649daeb..1afeda1c3fc 100644
--- a/Framework/API/inc/MantidAPI/SpectrumInfoItem.h
+++ b/Framework/API/inc/MantidAPI/SpectrumInfoItem.h
@@ -12,8 +12,8 @@
 #include "MantidTypes/SpectrumDefinition.h"
 #include <type_traits>
 
-using Mantid::Kernel::V3D;
 using Mantid::SpectrumDefinition;
+using Mantid::Kernel::V3D;
 
 namespace Mantid {
 namespace API {
diff --git a/Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfo.cpp b/Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfo.cpp
index c993ca26bbd..51ff5227465 100644
--- a/Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfo.cpp
+++ b/Framework/PythonInterface/mantid/api/src/Exports/SpectrumInfo.cpp
@@ -15,11 +15,11 @@
 #include <boost/python/list.hpp>
 #include <boost/python/return_value_policy.hpp>
 
+using Mantid::SpectrumDefinition;
 using Mantid::API::SpectrumInfo;
 using Mantid::API::SpectrumInfoItem;
 using Mantid::API::SpectrumInfoIterator;
 using Mantid::PythonInterface::SpectrumInfoPythonIterator;
-using Mantid::SpectrumDefinition;
 using namespace boost::python;
 
 // Helper method to make the python iterator
-- 
GitLab


From 302c288297f0ea54867d8bf2733b6cf26cee1a8f Mon Sep 17 00:00:00 2001
From: Owen Arnold <owen.arnold@stfc.ac.uk>
Date: Thu, 5 Mar 2020 17:10:58 +0000
Subject: [PATCH 12/30] Correct test

---
 .../test/python/mantid/api/SpectrumInfoTest.py                | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Framework/PythonInterface/test/python/mantid/api/SpectrumInfoTest.py b/Framework/PythonInterface/test/python/mantid/api/SpectrumInfoTest.py
index e73718977f1..99ddecb005a 100644
--- a/Framework/PythonInterface/test/python/mantid/api/SpectrumInfoTest.py
+++ b/Framework/PythonInterface/test/python/mantid/api/SpectrumInfoTest.py
@@ -43,7 +43,9 @@ class SpectrumInfoTest(unittest.TestCase):
     def test_detectorCount(self):
         """ Check total detector count """
         info = self._ws.spectrumInfo()
-        self.assertEqual(info.detectorCount, 3)
+        # One detector cleared. So not counted.
+        self.assertEqual(info.detectorCount(), 2)
+
 
     def test_isMonitor(self):
         """ Check if a monitor is present. """
-- 
GitLab


From 18407c4bc57c234e536d9a7972930f30a6aee46c Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Mon, 23 Mar 2020 11:22:18 +0000
Subject: [PATCH 13/30] Exit sanitizer build on first error

Exits the sanitizer build on first exit, since Ctest is the handler it
will continue to schedule other tests, but mark the current test as
failed this way.
---
 buildconfig/CMake/FindCxxTest.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/buildconfig/CMake/FindCxxTest.cmake b/buildconfig/CMake/FindCxxTest.cmake
index 5526d094a26..301130c75e9 100644
--- a/buildconfig/CMake/FindCxxTest.cmake
+++ b/buildconfig/CMake/FindCxxTest.cmake
@@ -206,7 +206,7 @@ macro(CXXTEST_ADD_TEST _cxxtest_testname)
       if ( USE_SANITIZERS_LOWER STREQUAL "address" )
         # See dev docs on sanitizers for details on why verify_asan_link is false
         # Trying to quote these options causes the quotation to be forwarded
-        set(_ASAN_OPTS "suppressions=${SUPPRESSIONS_DIR}/Address.supp:detect_stack_use_after_return=true:halt_on_error=false:verify_asan_link_order=false")
+        set(_ASAN_OPTS "suppressions=${SUPPRESSIONS_DIR}/Address.supp:detect_stack_use_after_return=true")
         set_property( TEST ${_cxxtest_separate_name} APPEND PROPERTY
           ENVIRONMENT ASAN_OPTIONS=${_ASAN_OPTS} )
 
-- 
GitLab


From 9328462df9008926cfa03166291f0ef45d2e67bd Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Tue, 24 Mar 2020 09:37:13 +0000
Subject: [PATCH 14/30] Add quotes to patching step, in case there are spaces

Adds quotes to the patching step for span in case there are spaces in
the path causing it to fail
---
 buildconfig/CMake/Span.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/buildconfig/CMake/Span.cmake b/buildconfig/CMake/Span.cmake
index e5020d24c8a..426d1880d95 100644
--- a/buildconfig/CMake/Span.cmake
+++ b/buildconfig/CMake/Span.cmake
@@ -9,8 +9,8 @@ FetchContent_Declare(
   span
   GIT_REPOSITORY https://github.com/tcbrindle/span.git
   GIT_TAG        08cb4bf0e06c0e36f7e2b64e488ede711a8bb5ad
-  PATCH_COMMAND     ${GIT_EXECUTABLE} reset --hard ${_tag}
-    COMMAND ${GIT_EXECUTABLE} apply ${_apply_flags} ${CMAKE_SOURCE_DIR}/buildconfig/CMake/span_disable_testing.patch
+  PATCH_COMMAND     "${GIT_EXECUTABLE}" reset --hard ${_tag}
+    COMMAND "${GIT_EXECUTABLE}" apply ${_apply_flags} "${CMAKE_SOURCE_DIR}/buildconfig/CMake/span_disable_testing.patch"
 )
 
 FetchContent_GetProperties(span)
-- 
GitLab


From 964686492feceb89aa1762f25a29f8189b61108c Mon Sep 17 00:00:00 2001
From: Harriet Brown <harriet.brown@stfc.ac.uk>
Date: Tue, 24 Mar 2020 14:54:05 +0000
Subject: [PATCH 15/30] Change output ws names in
 Polaris.create_total_scattering_pdf

This commit adds lines in generate_ts_pdf to change the names of the workspaces produced as a result from the function.

re: #28414
---
 .../isis_powder/polaris_routines/polaris_algs.py    | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py b/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
index 125d6d63427..13dbee46715 100644
--- a/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
+++ b/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
@@ -9,6 +9,7 @@ import numpy as np
 import math
 
 import mantid.simpleapi as mantid
+from mantid.api import WorkspaceGroup
 from six import string_types
 
 from isis_powder.routines import absorb_corrections, common
@@ -125,6 +126,18 @@ def generate_ts_pdf(run_number, focus_file_path, merge_banks=False, q_lims=None,
             pdf_output = mantid.Rebin(InputWorkspace=pdf_output, Params=output_binning)
         except RuntimeError:
             return pdf_output
+    # Rename output ws
+    if 'merged_ws' in locals():
+        mantid.RenameWorkspace(InputWorkspace=merged_ws, OutputWorkspace=run_number + '_merged_Q')
+    mantid.RenameWorkspace(InputWorkspace=focused_ws, OutputWorkspace=run_number+'_focused_Q')
+    if isinstance(focused_ws, WorkspaceGroup):
+        for i in range(len(focused_ws)):
+            print(focused_ws[i])
+            mantid.RenameWorkspace(InputWorkspace=focused_ws[i], OutputWorkspace=run_number+'_focused_Q_'+str(i+1))
+    mantid.RenameWorkspace(InputWorkspace=pdf_output, OutputWorkspace=run_number+'_pdf_R')
+    if isinstance(pdf_output, WorkspaceGroup):
+        for i in range(len(pdf_output)):
+            mantid.RenameWorkspace(InputWorkspace=pdf_output[i], OutputWorkspace=run_number+'_pdf_R_'+str(i+1))
     return pdf_output
 
 
-- 
GitLab


From de15bb64a182606849ab50f7bb527c555a67198b Mon Sep 17 00:00:00 2001
From: Harriet Brown <harriet.brown@stfc.ac.uk>
Date: Tue, 24 Mar 2020 15:08:09 +0000
Subject: [PATCH 16/30] Add release notes for changes to
 create_total_scattering_pdf

This commit adds release notes detailing the change of output names from Polaris.create_total_scattering_pdf

re: #28414
---
 docs/source/release/v5.1.0/diffraction.rst                    | 2 ++
 .../Diffraction/isis_powder/polaris_routines/polaris_algs.py  | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/source/release/v5.1.0/diffraction.rst b/docs/source/release/v5.1.0/diffraction.rst
index d4c0041287b..de85c351553 100644
--- a/docs/source/release/v5.1.0/diffraction.rst
+++ b/docs/source/release/v5.1.0/diffraction.rst
@@ -12,6 +12,8 @@ Diffraction Changes
 Powder Diffraction
 ------------------
 
+- Polaris.create_total_scattering_pdf output workspaces now have the run number in the names.
+
 Engineering Diffraction
 -----------------------
 
diff --git a/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py b/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
index 13dbee46715..bc121452505 100644
--- a/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
+++ b/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
@@ -129,12 +129,12 @@ def generate_ts_pdf(run_number, focus_file_path, merge_banks=False, q_lims=None,
     # Rename output ws
     if 'merged_ws' in locals():
         mantid.RenameWorkspace(InputWorkspace=merged_ws, OutputWorkspace=run_number + '_merged_Q')
-    mantid.RenameWorkspace(InputWorkspace=focused_ws, OutputWorkspace=run_number+'_focused_Q')
+    mantid.RenameWorkspace(InputWorkspace='focused_ws', OutputWorkspace=run_number+'_focused_Q')
     if isinstance(focused_ws, WorkspaceGroup):
         for i in range(len(focused_ws)):
             print(focused_ws[i])
             mantid.RenameWorkspace(InputWorkspace=focused_ws[i], OutputWorkspace=run_number+'_focused_Q_'+str(i+1))
-    mantid.RenameWorkspace(InputWorkspace=pdf_output, OutputWorkspace=run_number+'_pdf_R')
+    mantid.RenameWorkspace(InputWorkspace='pdf_output', OutputWorkspace=run_number+'_pdf_R')
     if isinstance(pdf_output, WorkspaceGroup):
         for i in range(len(pdf_output)):
             mantid.RenameWorkspace(InputWorkspace=pdf_output[i], OutputWorkspace=run_number+'_pdf_R_'+str(i+1))
-- 
GitLab


From 92455e437ad73f220d80c98974535215bd69fe5c Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Wed, 25 Mar 2020 11:38:31 +0000
Subject: [PATCH 17/30] Emit Kafka exception when err callback used

Previously Kafka dropped the exception and just incremented using the
same callback our wait. This will now print the exception message
associated, so we can distinguish between a successful and failed
callback in unit test logs.

I could have made it so that the exception is thrown in the main thread
by taking a s_ptr. However it quickly becomes unweildly for a simple
probe, and we only gain the stack trace - which was already lost when
extractData re throws the exception.
---
 .../test/KafkaEventStreamDecoderTest.h        | 51 ++++++++++++-------
 1 file changed, 33 insertions(+), 18 deletions(-)

diff --git a/Framework/LiveData/test/KafkaEventStreamDecoderTest.h b/Framework/LiveData/test/KafkaEventStreamDecoderTest.h
index 244435a658b..a50564e62c1 100644
--- a/Framework/LiveData/test/KafkaEventStreamDecoderTest.h
+++ b/Framework/LiveData/test/KafkaEventStreamDecoderTest.h
@@ -19,8 +19,11 @@
 
 #include <Poco/Path.h>
 #include <condition_variable>
+#include <iostream>
 #include <thread>
 
+using Mantid::LiveData::KafkaEventStreamDecoder;
+
 class KafkaEventStreamDecoderTest : public CxxTest::TestSuite {
 public:
   // This pair of boilerplate methods prevent the suite being created statically
@@ -512,38 +515,49 @@ private:
   void startCapturing(Mantid::LiveData::KafkaEventStreamDecoder &decoder,
                       uint8_t maxIterations) {
     // Register callback to know when a whole loop as been iterated through
+    m_maxIterations = maxIterations;
     m_niterations = 0;
-    auto callback = [this, maxIterations]() {
-      this->iterationCallback(maxIterations);
-    };
-    decoder.registerIterationEndCb(callback);
-    decoder.registerErrorCb(callback);
+    decoder.registerIterationEndCb([this]() { this->iterationCallback(); });
+
+    decoder.registerErrorCb([this, &decoder]() { errCallback(decoder); });
     TS_ASSERT_THROWS_NOTHING(decoder.startCapture());
     continueCapturing(decoder, maxIterations);
   }
 
-  void iterationCallback(uint8_t maxIterations) {
+  void iterationCallback() {
     std::unique_lock<std::mutex> lock(this->m_callbackMutex);
     this->m_niterations++;
-    if (this->m_niterations == maxIterations) {
+    if (this->m_niterations == m_maxIterations) {
       lock.unlock();
       this->m_callbackCondition.notify_one();
     }
   }
 
-  void continueCapturing(Mantid::LiveData::KafkaEventStreamDecoder &decoder,
+  void errCallback(KafkaEventStreamDecoder &decoder) {
+    try {
+      // Get the stored exception by calling extract data again
+      decoder.extractData();
+    } catch (std::exception &e) {
+      // We could try to port the exception from this child thread to the main
+      // thread, or just print it here which is significantly easier
+      std::cerr << "Exception: " << e.what() << "\n";
+      // Always keep incrementing so we don't deadlock
+      iterationCallback();
+    }
+  }
+
+  void continueCapturing(KafkaEventStreamDecoder &decoder,
                          uint8_t maxIterations) {
+    m_maxIterations = maxIterations;
+
     // Re-register callback with the (potentially) new value of maxIterations
-    auto callback = [this, maxIterations]() {
-      this->iterationCallback(maxIterations);
-    };
-    decoder.registerIterationEndCb(callback);
-    decoder.registerErrorCb(callback);
+    decoder.registerIterationEndCb([this]() { this->iterationCallback(); });
+    decoder.registerErrorCb([this, &decoder]() { errCallback(decoder); });
+
     {
       std::unique_lock<std::mutex> lk(m_callbackMutex);
-      this->m_callbackCondition.wait(lk, [this, maxIterations]() {
-        return this->m_niterations == maxIterations;
-      });
+      this->m_callbackCondition.wait(
+          lk, [this]() { return this->m_niterations == m_maxIterations; });
     }
   }
 
@@ -574,8 +588,8 @@ private:
 
   void checkWorkspaceEventData(
       const Mantid::DataObjects::EventWorkspace &eventWksp) {
-    // A timer-based test and each message contains 6 events so the total should
-    // be divisible by 6, but not be 0
+    // A timer-based test and each message contains 6 events so the total
+    // should be divisible by 6, but not be 0
     TS_ASSERT(eventWksp.getNumberEvents() % 6 == 0);
     TS_ASSERT(eventWksp.getNumberEvents() != 0);
   }
@@ -597,4 +611,5 @@ private:
   std::mutex m_callbackMutex;
   std::condition_variable m_callbackCondition;
   uint8_t m_niterations = 0;
+  std::atomic<uint8_t> m_maxIterations = 0;
 };
-- 
GitLab


From 706b8ccc47dca8258c425d65318334265a45dc0d Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Wed, 25 Mar 2020 12:15:28 +0000
Subject: [PATCH 18/30] Fix sanitizers not switching off and leak env var

Fixes sanitizers not switching off if USE_SANITIZER was set to off.
Additionally gets rid of a space between LSAN_OPTIONS and the actual
options, which was causing the suppressions file to be ignored.
---
 buildconfig/CMake/FindCxxTest.cmake |  2 +-
 buildconfig/CMake/Sanitizers.cmake  | 51 ++++++++++++++---------------
 2 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/buildconfig/CMake/FindCxxTest.cmake b/buildconfig/CMake/FindCxxTest.cmake
index 301130c75e9..ffb3dad5f08 100644
--- a/buildconfig/CMake/FindCxxTest.cmake
+++ b/buildconfig/CMake/FindCxxTest.cmake
@@ -212,7 +212,7 @@ macro(CXXTEST_ADD_TEST _cxxtest_testname)
 
         set( _LSAN_OPTS "suppressions=${SUPPRESSIONS_DIR}/Leak.supp" )
           set_property( TEST ${_cxxtest_separate_name} APPEND PROPERTY
-          ENVIRONMENT LSAN_OPTIONS= ${_LSAN_OPTS} )
+          ENVIRONMENT LSAN_OPTIONS=${_LSAN_OPTS} )
 
       endif()
 
diff --git a/buildconfig/CMake/Sanitizers.cmake b/buildconfig/CMake/Sanitizers.cmake
index 3850a7db099..4e8c29a8e27 100644
--- a/buildconfig/CMake/Sanitizers.cmake
+++ b/buildconfig/CMake/Sanitizers.cmake
@@ -34,30 +34,29 @@ if(NOT ${USE_SANITIZERS_LOWER} MATCHES "off")
 
         add_compile_options(-fno-omit-frame-pointer -fno-optimize-sibling-calls)
     endif()
-
-    # Allow all instrumented code to continue beyond the first error
-    add_compile_options(-fsanitize-recover=all)
-
-    # Address
-    add_compile_options(
-        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"address">:-fsanitize=address>)
-    add_link_options(
-        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"address">:-fsanitize=address>)
-
-    # Thread
-    add_compile_options(
-        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"thread">:-fsanitize=thread>)
-    add_link_options(
-        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"thread">:-fsanitize=thread>)
-
-    # Undefined
-    # RTTI information is not exported for some classes causing the
-    # linker to fail whilst adding vptr instrumentation
-    add_compile_options(
-        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"undefined">:-fsanitize=undefined>
-        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"undefined">:-fno-sanitize=vptr>)
-
-    add_link_options(
-        $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"undefined">:-fsanitize=undefined>)
-
 endif()
+
+# Allow all instrumented code to continue beyond the first error
+add_compile_options($<$<NOT:$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"off">>:-fsanitize-recover=all>)
+
+# Address
+add_compile_options(
+    $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"address">:-fsanitize=address>)
+add_link_options(
+    $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"address">:-fsanitize=address>)
+
+# Thread
+add_compile_options(
+    $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"thread">:-fsanitize=thread>)
+add_link_options(
+    $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"thread">:-fsanitize=thread>)
+
+# Undefined
+# RTTI information is not exported for some classes causing the
+# linker to fail whilst adding vptr instrumentation
+add_compile_options(
+    $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"undefined">:-fsanitize=undefined>
+    $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"undefined">:-fno-sanitize=vptr>)
+
+add_link_options(
+    $<$<STREQUAL:$<LOWER_CASE:"${USE_SANITIZER}">,"undefined">:-fsanitize=undefined>)
-- 
GitLab


From 684546ddad6bbd28968d64f4807ea5863bbb7e9b Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Wed, 25 Mar 2020 12:16:28 +0000
Subject: [PATCH 19/30] Update gitignore with clangd index

Adds clangd to the gitignore, this is generated by using the language
server on a source dir in VS code
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 7d9b761d440..c273e6b394b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -166,6 +166,7 @@ Desktop.ini
 
 # VSCode
 .vscode/
+.clangd/
 XDG_CACHE_HOME/
 # The file that contains metadata for VSCode Workspace
 *.code-workspace
-- 
GitLab


From 453bf557cd28e0b7d99f90573e1195a4acfd56a2 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Thu, 19 Mar 2020 16:33:55 +0000
Subject: [PATCH 20/30] Update cppcheck in CMake build config

Updates the cppcheck target to run like a typical compilation. This
means CMake will fix-up the headers required on the fly. This reduces
the time compared to adding all headers, and improves the accuracy
significantly.
---
 buildconfig/CMake/CppCheckSetup.cmake         | 131 ++----------------
 buildconfig/CMake/CppCheck_Suppressions.txt   |  14 --
 .../CMake/CppCheck_Suppressions.txt.in        |   5 +
 buildconfig/CMake/FindCppcheck.cmake          |   9 --
 4 files changed, 18 insertions(+), 141 deletions(-)
 delete mode 100644 buildconfig/CMake/CppCheck_Suppressions.txt
 create mode 100644 buildconfig/CMake/CppCheck_Suppressions.txt.in

diff --git a/buildconfig/CMake/CppCheckSetup.cmake b/buildconfig/CMake/CppCheckSetup.cmake
index 75d183a1a10..b825a1086b1 100644
--- a/buildconfig/CMake/CppCheckSetup.cmake
+++ b/buildconfig/CMake/CppCheckSetup.cmake
@@ -1,133 +1,26 @@
 find_package ( Cppcheck )
 
 if ( CPPCHECK_EXECUTABLE )
-  set ( CPPCHECK_SOURCE_DIRS
-        Framework
-        MantidPlot
-        qt/paraview_ext
-        qt/scientific_interfaces
-        qt/widgets/common
-        qt/widgets/instrumentView
-        qt/widgets/mplcpp
-      )
 
-  option ( CPPCHECK_USE_INCLUDE_DIRS "Use specified include directories. WARNING: cppcheck will run significantly slower." )
+  # We must export the compile commands for cppcheck to be able to check
+  # everything correctly
+  set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
 
-  set ( CPPCHECK_INCLUDE_DIRS
-        Framework/Algorithms/inc
-        Framework/PythonInterface/inc
-        Framework/Nexus/inc
-        Framework/MPIAlgorithms/inc
-        Framework/MDAlgorithms/inc
-        Framework/DataHandling/inc
-        Framework/WorkflowAlgorithms/inc
-        Framework/MDEvents/inc
-        Framework/DataObjects/inc
-        Framework/Geometry/inc
-        Framework/ICat/inc
-        Framework/CurveFitting/inc
-        Framework/API/inc
-        Framework/TestHelpers/inc
-        Framework/Crystal/inc
-        Framework/Kernel/inc
-        qt/paraview_ext/VatesAPI/inc
-        qt/paraview_ext/VatesSimpleGui/ViewWidgets/inc
-        qt/paraview_ext/VatesSimpleGui/QtWidgets/inc
-        qt/widgets/common/inc
-        qt/widgets/factory/inc
-        qt/widgets/instrumentview/inc
-        qt/widgets/refdetectrview/inc
-        qt/widgets/sliceviewer/inc
-        qt/widgets/spectrumviewer/inc
-        qt/widgets/plugins/algorithm_dialogs/inc
-        qt/widgets/plugins/designer/inc
-        qt/scientific_interfaces
-      )
-
-  set ( CPPCHECK_EXCLUDES
-        Framework/LiveData/src/ISIS/DAE/
-        Framework/LiveData/src/Kafka/private/Schema/
-        Framework/DataHandling/src/LoadRaw/
-        Framework/ICat/inc/MantidICat/ICat3/GSoapGenerated/
-        Framework/ICat/src/ICat3/GSoapGenerated/
-        Framework/ICat/src/ICat3/ICat3GSoapGenerated.cpp
-        Framework/ICat/inc/MantidICat/ICat4/GSoapGenerated/
-        Framework/ICat/src/ICat4/GSoapGenerated/
-        Framework/ICat/src/ICat4/ICat4GSoapGenerated.cpp
-        Framework/ICat/src/GSoap/
-        Framework/ICat/src/GSoap.cpp
-        Framework/Kernel/src/ANN/
-        Framework/Kernel/src/ANN_complete.cpp
-        Framework/Kernel/src/Math/Optimization/SLSQPMinimizer.cpp
-        MantidPlot/src/nrutil.cpp
-        MantidPlot/src/origin/OPJFile.cpp
-        MantidPlot/src/zlib123/minigzip.c
-        Framework/SINQ/src/PoldiPeakFit.cpp
-        qt/widgets/common/src/QtPropertyBrowser/
-        qt/widgets/common/inc/MantidQtWidgets/Common/QtPropertyBrowser/
-      )
-
-  # Header files to be ignored require different handling
-  set ( CPPCHECK_HEADER_EXCLUDES
-        Framework/LiveData/src/Kafka/private/Schema/ba57_run_info_generated.h
-        Framework/LiveData/src/Kafka/private/Schema/df12_det_spec_map_generated.h
-        Framework/LiveData/src/Kafka/private/Schema/ev42_events_generated.h
-        Framework/LiveData/src/Kafka/private/Schema/fwdi_forwarder_internal_generated.h
-        Framework/LiveData/src/Kafka/private/Schema/f142_logdata_generated.h
-        Framework/LiveData/src/Kafka/private/Schema/is84_isis_events_generated.h
-        Framework/LiveData/src/Kafka/private/Schema/flatbuffers/base.h
-        Framework/LiveData/src/Kafka/private/Schema/flatbuffers/flatbuffers.h
-        Framework/LiveData/src/Kafka/private/Schema/flatbuffers/stl_emulation.h
-        MantidPlot/src/origin/OPJFile.h
-        MantidPlot/src/origin/tree.hh
-      )
+  configure_file(${CMAKE_SOURCE_DIR}/buildconfig/CMake/CppCheck_Suppressions.txt.in ${CMAKE_BINARY_DIR}/CppCheck_Suppressions.txt)
 
   # setup the standard arguments
+  set ( CPPCHECK_ARGS --enable=all --inline-suppr --max-configs=120
+  --suppressions-list=${CMAKE_BINARY_DIR}/CppCheck_Suppressions.txt
+  --suppress=*:*${CMAKE_BINARY_DIR}/*
+  --project=${CMAKE_BINARY_DIR}/compile_commands.json
+  )
+
   set (_cppcheck_args "${CPPCHECK_ARGS}")
     list ( APPEND _cppcheck_args ${CPPCHECK_TEMPLATE_ARG} )
     if ( CPPCHECK_NUM_THREADS GREATER 0)
         list ( APPEND _cppcheck_args -j ${CPPCHECK_NUM_THREADS} )
   endif ( CPPCHECK_NUM_THREADS GREATER 0)
 
-  # process list of include/exclude directories
-  set (_cppcheck_source_dirs)
-  foreach (_dir ${CPPCHECK_SOURCE_DIRS} )
-    set ( _tmpdir "${CMAKE_SOURCE_DIR}/${_dir}" )
-    if ( EXISTS ${_tmpdir} )
-      list ( APPEND _cppcheck_source_dirs ${_tmpdir} )
-    endif ()
-  endforeach()
-
-  set (_cppcheck_includes)
-  foreach( _dir ${CPPCHECK_INCLUDE_DIRS} )
-    set ( _tmpdir "${CMAKE_SOURCE_DIR}/${_dir}" )
-    if ( EXISTS ${_tmpdir} )
-      list ( APPEND _cppcheck_includes -I ${_tmpdir} )
-    endif ()
-  endforeach()
-  if (CPPCHECK_USE_INCLUDE_DIRS)
-    list ( APPEND _cppcheck_args ${_cppcheck_includes} )
-  endif (CPPCHECK_USE_INCLUDE_DIRS)
-
-  set (_cppcheck_excludes)
-  foreach( _file ${CPPCHECK_EXCLUDES} )
-    set ( _tmp "${CMAKE_SOURCE_DIR}/${_file}" )
-    if ( EXISTS ${_tmp} )
-      list ( APPEND _cppcheck_excludes -i ${_tmp} )
-    endif ()
-  endforeach()
-  list ( APPEND _cppcheck_args ${_cppcheck_excludes} )
-
-  # Handle header files in the required manner
-  set (_cppcheck_header_excludes)
-  foreach( _file ${CPPCHECK_HEADER_EXCLUDES} )
-    set ( _tmp "${CMAKE_SOURCE_DIR}/${_file}" )
-    if ( EXISTS ${_tmp} )
-      list ( APPEND _cppcheck_header_excludes --suppress=*:${_tmp} )
-    endif()
-  endforeach()
-  list ( APPEND _cppcheck_args ${_cppcheck_header_excludes} )
-
   # put the finishing bits on the final command call
   set (_cppcheck_xml_args)
   if (CPPCHECK_GENERATE_XML)
@@ -136,10 +29,12 @@ if ( CPPCHECK_EXECUTABLE )
     list( APPEND _cppcheck_xml_args  ${_cppcheck_source_dirs} )
   endif (CPPCHECK_GENERATE_XML)
 
+  
+
   # generate the target
   if (NOT TARGET cppcheck)
     add_custom_target ( cppcheck
-                        COMMAND ${CPPCHECK_EXECUTABLE} ${_cppcheck_args} ${_cppcheck_header_excludes} ${_cppcheck_xml_args}
+                        COMMAND ${CPPCHECK_EXECUTABLE} ${_cppcheck_args} ${_cppcheck_xml_args}
                         WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
                         COMMENT "Running cppcheck"
                       )
diff --git a/buildconfig/CMake/CppCheck_Suppressions.txt b/buildconfig/CMake/CppCheck_Suppressions.txt
deleted file mode 100644
index 8ea3af11393..00000000000
--- a/buildconfig/CMake/CppCheck_Suppressions.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// suppress specific rule in specific files
-// NOTE this needs the full path to the file, so would need this file to be generated by cmake
-//      as different build servers have different starts to the file path
-// Example:
-// memsetClassFloat:/Users/builder/Jenkins/workspace/cppcheck-1.72/Framework/DataHandling/src/LoadRaw/isisraw.h
-
-
-// suppress in all files - BE CAREFUL not to leave trailing spaces after the rule id. or empty lines
-// For a library this is not a problem per se
-// unusedFunction
-// cppcheck has problems handling the number of pre-processor definitions used in the DLL_EXPORTs
-class_X_Y
-// the exported functions are not used in the cpp land
-unusedFunction:Framework/PythonInterface/mantid/*/src/Exports/*.cpp
diff --git a/buildconfig/CMake/CppCheck_Suppressions.txt.in b/buildconfig/CMake/CppCheck_Suppressions.txt.in
new file mode 100644
index 00000000000..39acb57ee21
--- /dev/null
+++ b/buildconfig/CMake/CppCheck_Suppressions.txt.in
@@ -0,0 +1,5 @@
+// suppress specific rule in specific files
+// NOTE this needs the full path to the file, so would need this file to be generated by cmake
+//      as different build servers have different starts to the file path
+// Example:
+// memsetClassFloat:/Users/builder/Jenkins/workspace/cppcheck-1.72/
diff --git a/buildconfig/CMake/FindCppcheck.cmake b/buildconfig/CMake/FindCppcheck.cmake
index fad22793cb0..89bb0b88ec5 100644
--- a/buildconfig/CMake/FindCppcheck.cmake
+++ b/buildconfig/CMake/FindCppcheck.cmake
@@ -61,15 +61,6 @@ if(CPPCHECK_EXECUTABLE)
 endif()
 
 mark_as_advanced(CPPCHECK_EXECUTABLE)
-if(CPPCHECK_EXECUTABLE)
-  if (${CPPCHECK_VERSION} VERSION_LESS 1.71)
-    set ( CPPCHECK_ARGS --enable=all --inline-suppr --max-configs=120
-                        --suppressions ${CMAKE_CURRENT_SOURCE_DIR}/buildconfig/CMake/CppCheck_Suppressions.txt )
-  else()
-    set ( CPPCHECK_ARGS --enable=all --inline-suppr --max-configs=120
-                        --suppressions-list=${CMAKE_CURRENT_SOURCE_DIR}/buildconfig/CMake/CppCheck_Suppressions.txt )
-  endif()
-endif()
 set ( CPPCHECK_NUM_THREADS 0 CACHE STRING "Number of threads to use when running cppcheck" )
 set ( CPPCHECK_GENERATE_XML OFF CACHE BOOL "Generate xml output files from cppcheck" )
 
-- 
GitLab


From 08088625620bbb6b8a39fbe378138b41158fd577 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Thu, 19 Mar 2020 16:35:24 +0000
Subject: [PATCH 21/30] Hand-fix some cppcheck warnings

Hand-fixes some cppcheck warnings, this was work prior to fixing the
cppcheck target.
---
 Framework/API/src/Algorithm.cpp                |  1 +
 Framework/API/src/CatalogManager.cpp           |  8 +++++---
 Framework/API/src/CompositeDomainMD.cpp        |  9 ++++++++-
 Framework/API/src/ExperimentInfo.cpp           |  6 ++++--
 Framework/API/src/IFunction.cpp                |  7 ++++---
 Framework/API/src/IndexProperty.cpp            |  1 +
 Framework/API/src/MatrixWorkspace.cpp          | 11 +++++++----
 Framework/API/src/ParameterTie.cpp             |  5 ++---
 Framework/API/src/WorkspaceGroup.cpp           |  8 +++++---
 Framework/API/test/MultiDomainFunctionTest.h   |  6 +++---
 Framework/Algorithms/src/AddLogDerivative.cpp  |  5 +++--
 .../Algorithms/src/CalculateDynamicRange.cpp   |  6 +++---
 .../src/CalculatePlaczekSelfScattering.cpp     | 13 ++++++++-----
 Framework/Algorithms/src/ChangeBinOffset.cpp   |  4 ++--
 Framework/Algorithms/src/ChangeTimeZero.cpp    | 11 +++++------
 .../Algorithms/src/ConvertSpectrumAxis2.cpp    |  7 ++++---
 .../Algorithms/src/CorelliCrossCorrelate.cpp   |  5 +++--
 .../Algorithms/src/CreateDummyCalFile.cpp      | 12 +++---------
 .../Algorithms/src/CreateLogPropertyTable.cpp  |  9 ++++++---
 .../Algorithms/src/EQSANSCorrectFrame.cpp      |  6 +++---
 .../Algorithms/src/MagFormFactorCorrection.cpp |  8 +++++---
 .../src/MaxEnt/MaxentTransformMultiFourier.cpp |  4 +---
 Framework/Algorithms/src/ModeratorTzero.cpp    |  6 +++---
 .../Algorithms/src/PaddingAndApodization.cpp   |  1 -
 .../Algorithms/src/PointByPointVCorrection.cpp |  8 ++++----
 .../src/PolarizationCorrectionWildes.cpp       | 17 +++++++++++++++++
 .../src/ReflectometryReductionOne2.cpp         |  2 +-
 Framework/Algorithms/src/ResetNegatives.cpp    |  6 +++---
 Framework/Algorithms/src/SmoothData.cpp        |  9 +++++----
 Framework/Algorithms/src/Stitch1DMany.cpp      |  6 ++++--
 .../Crystal/src/FindUBUsingIndexedPeaks.cpp    |  6 +++---
 Framework/Crystal/src/LoadIsawPeaks.cpp        |  2 --
 Framework/Crystal/src/LoadIsawSpectrum.cpp     |  1 -
 Framework/Crystal/src/PeakAlgorithmHelpers.cpp | 11 +++++------
 Framework/Crystal/src/SaveIsawPeaks.cpp        |  1 -
 .../Crystal/src/SetSpecialCoordinates.cpp      |  4 ++--
 .../src/Algorithms/EstimateFitParameters.cpp   |  9 ++++-----
 .../Algorithms/PlotPeakByLogValueHelper.cpp    |  1 -
 .../src/Algorithms/QENSFitSequential.cpp       | 11 ++++++-----
 .../src/Algorithms/SplineSmoothing.cpp         |  9 +++++----
 .../src/AugmentedLagrangianOptimizer.cpp       |  6 +++---
 .../src/CostFunctions/CostFuncFitting.cpp      |  2 --
 .../Functions/CrystalFieldMultiSpectrum.cpp    |  8 +++++---
 Framework/CurveFitting/src/GSLVector.cpp       | 10 ++++------
 .../src/TableWorkspaceDomainCreator.cpp        |  2 --
 .../DataHandling/src/DataBlockComposite.cpp    |  9 ++++++---
 Framework/DataHandling/src/GroupDetectors2.cpp | 18 ++++++------------
 Framework/Kernel/test/CowPtrTest.h             |  5 ++---
 48 files changed, 174 insertions(+), 148 deletions(-)

diff --git a/Framework/API/src/Algorithm.cpp b/Framework/API/src/Algorithm.cpp
index 3420f7b7aff..1bd805d03f9 100644
--- a/Framework/API/src/Algorithm.cpp
+++ b/Framework/API/src/Algorithm.cpp
@@ -1569,6 +1569,7 @@ void Algorithm::copyNonWorkspaceProperties(IAlgorithm *alg, int periodNum) {
   const auto &props = this->getProperties();
   for (const auto &prop : props) {
     if (prop) {
+
       auto *wsProp = dynamic_cast<IWorkspaceProperty *>(prop);
       // Copy the property using the string
       if (!wsProp)
diff --git a/Framework/API/src/CatalogManager.cpp b/Framework/API/src/CatalogManager.cpp
index 9dd38cd2f51..e5dd10da271 100644
--- a/Framework/API/src/CatalogManager.cpp
+++ b/Framework/API/src/CatalogManager.cpp
@@ -7,6 +7,7 @@
 #include "MantidAPI/CatalogManager.h"
 #include "MantidAPI/CatalogFactory.h"
 #include "MantidAPI/CompositeCatalog.h"
+#include "MantidAPI/FunctionFactory.h"
 #include "MantidKernel/ConfigService.h"
 #include "MantidKernel/FacilityInfo.h"
 
@@ -105,9 +106,10 @@ void CatalogManagerImpl::destroyCatalog(const std::string &sessionID) {
 std::vector<CatalogSession_sptr> CatalogManagerImpl::getActiveSessions() {
   std::vector<CatalogSession_sptr> sessions;
   sessions.reserve(m_activeCatalogs.size());
-  for (const auto &activeCatalog : m_activeCatalogs) {
-    sessions.emplace_back(activeCatalog.first);
-  }
+
+  std::transform(m_activeCatalogs.begin(), m_activeCatalogs.end(),
+                 std::back_inserter(sessions),
+                 [](const auto &activeCatalog) { return activeCatalog.first; });
   return sessions;
 }
 
diff --git a/Framework/API/src/CompositeDomainMD.cpp b/Framework/API/src/CompositeDomainMD.cpp
index 1a549852bc5..cd4ac347923 100644
--- a/Framework/API/src/CompositeDomainMD.cpp
+++ b/Framework/API/src/CompositeDomainMD.cpp
@@ -25,7 +25,14 @@ CompositeDomainMD::CompositeDomainMD(IMDWorkspace_const_sptr ws,
                                      size_t maxDomainSize)
     : m_iterator(ws->createIterator()) {
   m_totalSize = m_iterator->getDataSize();
-  size_t nParts = m_totalSize / maxDomainSize + 1;
+
+  size_t maxDomainSizeDiv = maxDomainSize + 1;
+  if (maxDomainSizeDiv == 0) {
+    throw std::runtime_error(
+        "Attempted to use a maximum domain size that equals 0");
+  }
+  size_t nParts = m_totalSize / maxDomainSizeDiv;
+
   m_domains.resize(nParts);
   for (size_t i = 0; i < nParts - 1; ++i) {
     size_t start = i * maxDomainSize;
diff --git a/Framework/API/src/ExperimentInfo.cpp b/Framework/API/src/ExperimentInfo.cpp
index 8b351649ca6..f369dad741b 100644
--- a/Framework/API/src/ExperimentInfo.cpp
+++ b/Framework/API/src/ExperimentInfo.cpp
@@ -944,8 +944,10 @@ std::vector<std::string> ExperimentInfo::getResourceFilenames(
   std::vector<std::string> pathNames;
   if (!matchingFiles.empty()) {
     pathNames.reserve(matchingFiles.size());
-    for (auto &elem : matchingFiles)
-      pathNames.emplace_back(std::move(elem.second));
+
+    std::transform(matchingFiles.begin(), matchingFiles.end(),
+                   std::back_inserter(pathNames),
+                   [](const auto &elem) { return elem.second; });
   } else {
     pathNames.emplace_back(std::move(mostRecentFile));
   }
diff --git a/Framework/API/src/IFunction.cpp b/Framework/API/src/IFunction.cpp
index 425ca89b111..848edf8ec09 100644
--- a/Framework/API/src/IFunction.cpp
+++ b/Framework/API/src/IFunction.cpp
@@ -1361,9 +1361,10 @@ IFunction_sptr IFunction::getFunction(std::size_t) const {
 std::vector<std::string> IFunction::getAttributeNames() const {
   std::vector<std::string> names;
   names.reserve(m_attrs.size());
-  for (const auto &attr : m_attrs) {
-    names.emplace_back(attr.first);
-  }
+
+  std::transform(m_attrs.begin(), m_attrs.end(), std::back_inserter(names),
+                 [](const auto &attr) { return attr.first; });
+
   return names;
 }
 
diff --git a/Framework/API/src/IndexProperty.cpp b/Framework/API/src/IndexProperty.cpp
index d3dece74626..e26dd75e507 100644
--- a/Framework/API/src/IndexProperty.cpp
+++ b/Framework/API/src/IndexProperty.cpp
@@ -75,6 +75,7 @@ Indexing::SpectrumIndexSet IndexProperty::getIndices() const {
             static_cast<Indexing::SpectrumNumber>(static_cast<int32_t>(max)));
       }
     } else {
+      // cppcheck-suppress constArgument
       MSVC_DIAG_OFF(4244);
       switch (type) {
       case IndexType::WorkspaceIndex:
diff --git a/Framework/API/src/MatrixWorkspace.cpp b/Framework/API/src/MatrixWorkspace.cpp
index 41d8c4fe152..479adf454d0 100644
--- a/Framework/API/src/MatrixWorkspace.cpp
+++ b/Framework/API/src/MatrixWorkspace.cpp
@@ -1237,9 +1237,10 @@ MatrixWorkspace::maskedBinsIndices(const size_t &workspaceIndex) const {
   auto maskedBins = it->second;
   std::vector<size_t> maskedIds;
   maskedIds.reserve(maskedBins.size());
-  for (const auto &mb : maskedBins) {
-    maskedIds.emplace_back(mb.first);
-  }
+
+  std::transform(maskedBins.begin(), maskedBins.end(),
+                 std::back_inserter(maskedIds),
+                 [](const auto &mb) { return mb.first; });
   return maskedIds;
 }
 
@@ -1939,7 +1940,8 @@ MatrixWorkspace::findY(double value,
   if (std::isnan(value)) {
     for (int64_t i = idx.first; i < numHists; ++i) {
       const auto &Y = this->y(i);
-      // cppcheck-suppress syntaxError
+      // https://trac.cppcheck.net/ticket/9237 if init buggy with cppcheck
+      // cppcheck-suppress stlIfFind
       if (auto it = std::find_if(std::next(Y.begin(), idx.second), Y.end(),
                                  [](double v) { return std::isnan(v); });
           it != Y.end()) {
@@ -1950,6 +1952,7 @@ MatrixWorkspace::findY(double value,
   } else {
     for (int64_t i = idx.first; i < numHists; ++i) {
       const auto &Y = this->y(i);
+      // cppcheck-suppress stlIfFind
       if (auto it = std::find(std::next(Y.begin(), idx.second), Y.end(), value);
           it != Y.end()) {
         out = {i, std::distance(Y.begin(), it)};
diff --git a/Framework/API/src/ParameterTie.cpp b/Framework/API/src/ParameterTie.cpp
index eddfb788399..a3ae0083301 100644
--- a/Framework/API/src/ParameterTie.cpp
+++ b/Framework/API/src/ParameterTie.cpp
@@ -202,9 +202,8 @@ bool ParameterTie::isConstant() const { return m_varMap.empty(); }
 std::vector<ParameterReference> ParameterTie::getRHSParameters() const {
   std::vector<ParameterReference> out;
   out.reserve(m_varMap.size());
-  for (auto &&varPair : m_varMap) {
-    out.emplace_back(varPair.second);
-  }
+  std::transform(m_varMap.begin(), m_varMap.end(), std::back_inserter(out),
+                 [](auto &&varPair) { return varPair.second; });
   return out;
 }
 
diff --git a/Framework/API/src/WorkspaceGroup.cpp b/Framework/API/src/WorkspaceGroup.cpp
index a251a3b2ed3..3db1116e68b 100644
--- a/Framework/API/src/WorkspaceGroup.cpp
+++ b/Framework/API/src/WorkspaceGroup.cpp
@@ -191,9 +191,11 @@ std::vector<std::string> WorkspaceGroup::getNames() const {
   std::vector<std::string> out;
   std::lock_guard<std::recursive_mutex> _lock(m_mutex);
   out.reserve(m_workspaces.size());
-  for (const auto &workspace : m_workspaces) {
-    out.emplace_back(workspace->getName());
-  }
+
+  std::transform(m_workspaces.begin(), m_workspaces.end(),
+                 std::back_inserter(out),
+                 [](const auto &ws) { return ws->getName(); });
+
   return out;
 }
 
diff --git a/Framework/API/test/MultiDomainFunctionTest.h b/Framework/API/test/MultiDomainFunctionTest.h
index 3b87ef057f3..141e3ce8591 100644
--- a/Framework/API/test/MultiDomainFunctionTest.h
+++ b/Framework/API/test/MultiDomainFunctionTest.h
@@ -336,7 +336,7 @@ public:
     const FunctionDomain1D &d0 =
         static_cast<const FunctionDomain1D &>(domain.getDomain(0));
     for (size_t i = 0; i < 9; ++i) {
-      TS_ASSERT_EQUALS(values.getCalculated(i), A + B * d0[i]);
+      TS_ASSERT_DELTA(values.getCalculated(i), A + B * d0[i], 1e-6);
     }
 
     A = multi.getFunction(0)->getParameter("A") +
@@ -346,7 +346,7 @@ public:
     const FunctionDomain1D &d1 =
         static_cast<const FunctionDomain1D &>(domain.getDomain(1));
     for (size_t i = 9; i < 19; ++i) {
-      TS_ASSERT_EQUALS(values.getCalculated(i), A + B * d1[i - 9]);
+      TS_ASSERT_DELTA(values.getCalculated(i), A + B * d1[i - 9], 1e-6);
     }
 
     A = multi.getFunction(0)->getParameter("A") +
@@ -356,7 +356,7 @@ public:
     const FunctionDomain1D &d2 =
         static_cast<const FunctionDomain1D &>(domain.getDomain(2));
     for (size_t i = 19; i < 30; ++i) {
-      TS_ASSERT_EQUALS(values.getCalculated(i), A + B * d2[i - 19]);
+      TS_ASSERT_DELTA(values.getCalculated(i), A + B * d2[i - 19], 1e-6);
     }
   }
 
diff --git a/Framework/Algorithms/src/AddLogDerivative.cpp b/Framework/Algorithms/src/AddLogDerivative.cpp
index 2e9dc599a61..a30db421d65 100644
--- a/Framework/Algorithms/src/AddLogDerivative.cpp
+++ b/Framework/Algorithms/src/AddLogDerivative.cpp
@@ -103,8 +103,9 @@ Mantid::Kernel::TimeSeriesProperty<double> *AddLogDerivative::makeDerivative(
   DateAndTime start = input->nthTime(0);
   std::vector<DateAndTime> timeFull;
   timeFull.reserve(times.size());
-  for (const double time : times)
-    timeFull.emplace_back(start + time);
+
+  std::transform(times.begin(), times.end(), std::back_inserter(timeFull),
+                 [&start](const double time) { return start + time; });
 
   // Create the TSP out of it
   auto out = new TimeSeriesProperty<double>(name);
diff --git a/Framework/Algorithms/src/CalculateDynamicRange.cpp b/Framework/Algorithms/src/CalculateDynamicRange.cpp
index f7a871d6b2c..50e7b95c74e 100644
--- a/Framework/Algorithms/src/CalculateDynamicRange.cpp
+++ b/Framework/Algorithms/src/CalculateDynamicRange.cpp
@@ -146,9 +146,9 @@ void CalculateDynamicRange::exec() {
       }
       if (!dets.empty()) {
         detIDs.reserve(dets.size());
-        for (const auto &det : dets) {
-          detIDs.emplace_back(det->getID());
-        }
+        std::transform(dets.begin(), dets.end(), std::back_inserter(detIDs),
+                       [](const auto &det) { return det->getID(); });
+
         const auto indices = workspace->getIndicesFromDetectorIDs(detIDs);
         calculateQMinMax(workspace, indices, compName);
       }
diff --git a/Framework/Algorithms/src/CalculatePlaczekSelfScattering.cpp b/Framework/Algorithms/src/CalculatePlaczekSelfScattering.cpp
index a6cf141beb0..4869be6a5d0 100644
--- a/Framework/Algorithms/src/CalculatePlaczekSelfScattering.cpp
+++ b/Framework/Algorithms/src/CalculatePlaczekSelfScattering.cpp
@@ -91,7 +91,6 @@ CalculatePlaczekSelfScattering::validateInputs() {
 void CalculatePlaczekSelfScattering::exec() {
   const API::MatrixWorkspace_sptr inWS = getProperty("InputWorkspace");
   const API::MatrixWorkspace_sptr incidentWS = getProperty("IncidentSpecta");
-  API::MatrixWorkspace_sptr outWS = getProperty("OutputWorkspace");
   constexpr double factor =
       1.0 / 1.66053906660e-27; // atomic mass unit-kilogram relationship
   constexpr double neutronMass = factor * 1.674927471e-27; // neutron mass
@@ -99,11 +98,15 @@ void CalculatePlaczekSelfScattering::exec() {
   // of each species
   auto atomSpecies = getSampleSpeciesInfo(inWS);
   // calculate summation term w/ neutron mass over molecular mass ratio
-  double summationTerm = 0.0;
-  for (auto atom : atomSpecies) {
-    summationTerm += atom.second["concentration"] * atom.second["bSqrdBar"] *
+
+  auto sumLambda = [&neutronMass](double sum, auto &atom) {
+    return sum + atom.second["concentration"] * atom.second["bSqrdBar"] *
                      neutronMass / atom.second["mass"];
-  }
+  };
+
+  double summationTerm =
+      std::accumulate(atomSpecies.begin(), atomSpecies.end(), 0.0, sumLambda);
+
   // get incident spectrum and 1st derivative
   const MantidVec xLambda = incidentWS->readX(0);
   const MantidVec incident = incidentWS->readY(0);
diff --git a/Framework/Algorithms/src/ChangeBinOffset.cpp b/Framework/Algorithms/src/ChangeBinOffset.cpp
index aecd1761eae..869acd987f5 100644
--- a/Framework/Algorithms/src/ChangeBinOffset.cpp
+++ b/Framework/Algorithms/src/ChangeBinOffset.cpp
@@ -54,8 +54,8 @@ void ChangeBinOffset::exec() {
     this->for_each<Indices::FromProperty>(
         *outputW, std::make_tuple(MatrixWorkspaceAccess::x),
         [offset](std::vector<double> &dataX) {
-          for (auto &x : dataX)
-            x += offset;
+          std::transform(dataX.begin(), dataX.end(), dataX.begin(),
+                         [offset](double x) { return x + offset; });
         });
   }
 }
diff --git a/Framework/Algorithms/src/ChangeTimeZero.cpp b/Framework/Algorithms/src/ChangeTimeZero.cpp
index 83a54079d4d..201a387d5bf 100644
--- a/Framework/Algorithms/src/ChangeTimeZero.cpp
+++ b/Framework/Algorithms/src/ChangeTimeZero.cpp
@@ -82,12 +82,11 @@ void ChangeTimeZero::exec() {
 
   // Set up remaining progress points
   const double progressStartShiftTimeLogs = progressStopCreateOutputWs;
-  double progressStopShiftTimeLogs = progressStartShiftTimeLogs;
-  if (boost::dynamic_pointer_cast<Mantid::API::IEventWorkspace>(out_ws)) {
-    progressStopShiftTimeLogs = progressStartShiftTimeLogs + 0.1;
-  } else {
-    progressStopShiftTimeLogs = 1.0;
-  }
+
+  double progressStopShiftTimeLogs =
+      boost::dynamic_pointer_cast<Mantid::API::IEventWorkspace>(out_ws)
+          ? progressStartShiftTimeLogs + 0.1
+          : 1.0;
 
   const double progressStartShiftNeutrons = progressStopShiftTimeLogs;
   const double progressStopShiftNeutrons = 1.0;
diff --git a/Framework/Algorithms/src/ConvertSpectrumAxis2.cpp b/Framework/Algorithms/src/ConvertSpectrumAxis2.cpp
index eaba2ca93a9..f224599c47a 100644
--- a/Framework/Algorithms/src/ConvertSpectrumAxis2.cpp
+++ b/Framework/Algorithms/src/ConvertSpectrumAxis2.cpp
@@ -238,9 +238,10 @@ MatrixWorkspace_sptr ConvertSpectrumAxis2::createOutputWorkspace(
         create<MatrixWorkspace>(*inputWS, m_indexMap.size(), hist);
     std::vector<double> axis;
     axis.reserve(m_indexMap.size());
-    for (const auto &it : m_indexMap) {
-      axis.emplace_back(it.first);
-    }
+    std::transform(m_indexMap.begin(), m_indexMap.end(),
+                   std::back_inserter(axis),
+                   [](const auto &it) { return it.first; });
+
     newAxis = std::make_unique<NumericAxis>(std::move(axis));
   } else {
     // If there is no reordering we can simply clone.
diff --git a/Framework/Algorithms/src/CorelliCrossCorrelate.cpp b/Framework/Algorithms/src/CorelliCrossCorrelate.cpp
index 5ee37f06a77..29162143663 100644
--- a/Framework/Algorithms/src/CorelliCrossCorrelate.cpp
+++ b/Framework/Algorithms/src/CorelliCrossCorrelate.cpp
@@ -157,8 +157,9 @@ void CorelliCrossCorrelate::exec() {
 
   int offset_int = getProperty("TimingOffset");
   const auto offset = static_cast<int64_t>(offset_int);
-  for (auto &timing : tdc)
-    timing += offset;
+
+  std::transform(tdc.begin(), tdc.end(), tdc.begin(),
+                 [offset](auto timing) { return timing + offset; });
 
   // Determine period from chopper frequency.
   auto motorSpeed = dynamic_cast<TimeSeriesProperty<double> *>(
diff --git a/Framework/Algorithms/src/CreateDummyCalFile.cpp b/Framework/Algorithms/src/CreateDummyCalFile.cpp
index 5fd56a26e74..afa35e62f7b 100644
--- a/Framework/Algorithms/src/CreateDummyCalFile.cpp
+++ b/Framework/Algorithms/src/CreateDummyCalFile.cpp
@@ -110,9 +110,6 @@ void CreateDummyCalFile::exec() {
 
   std::string filename = getProperty("CalFilename");
 
-  // Plan to overwrite file, so do not check if it exists
-  const bool overwrite = false;
-
   int number = 0;
   Progress prog(this, 0.0, 0.8, assemblies.size());
   while (!assemblies.empty()) // Travel the tree from the instrument point
@@ -128,12 +125,7 @@ void CreateDummyCalFile::exec() {
             currentIComp);
         if (currentDet.get()) // Is detector
         {
-          if (overwrite) // Map will contains udet as the key
-            instrcalib[currentDet->getID()] =
-                std::make_pair(number++, top_group);
-          else // Map will contains the entry number as the key
-            instrcalib[number++] =
-                std::make_pair(currentDet->getID(), top_group);
+          instrcalib[number++] = std::make_pair(currentDet->getID(), top_group);
         } else // Is an assembly, push in the queue
         {
           currentchild =
@@ -151,6 +143,8 @@ void CreateDummyCalFile::exec() {
     prog.report();
   }
   // Write the results in a file
+  // Plan to overwrite file, so do not check if it exists
+  const bool overwrite = false;
   saveGroupingFile(filename, overwrite);
   progress(0.2);
 }
diff --git a/Framework/Algorithms/src/CreateLogPropertyTable.cpp b/Framework/Algorithms/src/CreateLogPropertyTable.cpp
index 7b67c9e232b..ab9cda98e38 100644
--- a/Framework/Algorithms/src/CreateLogPropertyTable.cpp
+++ b/Framework/Algorithms/src/CreateLogPropertyTable.cpp
@@ -195,9 +195,12 @@ retrieveMatrixWsList(const std::vector<std::string> &wsNames,
       // Retrieve pointers to all the child workspaces.
       std::vector<MatrixWorkspace_sptr> childWsList;
       childWsList.reserve(childNames.size());
-      for (const auto &childName : childNames) {
-        childWsList.emplace_back(ADS.retrieveWS<MatrixWorkspace>(childName));
-      }
+
+      std::transform(childNames.begin(), childNames.end(),
+                     std::back_inserter(childWsList),
+                     [&ADS](const auto &childName) {
+                       return ADS.retrieveWS<MatrixWorkspace>(childName);
+                     });
 
       // Deal with child workspaces according to policy.
       switch (groupPolicy) {
diff --git a/Framework/Algorithms/src/EQSANSCorrectFrame.cpp b/Framework/Algorithms/src/EQSANSCorrectFrame.cpp
index 58b64d47ad6..b7cebbb4dec 100644
--- a/Framework/Algorithms/src/EQSANSCorrectFrame.cpp
+++ b/Framework/Algorithms/src/EQSANSCorrectFrame.cpp
@@ -95,11 +95,11 @@ void EQSANSCorrectFrame::exec() {
       double newTOF = tof + m_framesOffsetTime;
       // TOF values smaller than that of the fastest neutrons have been
       // 'folded' by the data acquisition system. They must be shifted
-      double minTOF = m_minTOF * pathToPixelFactor;
-      if (newTOF < minTOF)
+      double scaledMinTOF = m_minTOF * pathToPixelFactor;
+      if (newTOF < scaledMinTOF)
         newTOF += m_frameWidth;
       // Events from the skipped pulse are delayed by one pulse period
-      if (m_isFrameSkipping && newTOF > minTOF + m_pulsePeriod)
+      if (m_isFrameSkipping && newTOF > scaledMinTOF + m_pulsePeriod)
         newTOF += m_pulsePeriod;
       return newTOF;
     }
diff --git a/Framework/Algorithms/src/MagFormFactorCorrection.cpp b/Framework/Algorithms/src/MagFormFactorCorrection.cpp
index 5cd00fbdf35..d49836999fc 100644
--- a/Framework/Algorithms/src/MagFormFactorCorrection.cpp
+++ b/Framework/Algorithms/src/MagFormFactorCorrection.cpp
@@ -96,9 +96,11 @@ void MagFormFactorCorrection::exec() {
   // Gets the vector of form factor values
   std::vector<double> FF;
   FF.reserve(Qvals.size());
-  for (double Qval : Qvals) {
-    FF.emplace_back(ion.analyticalFormFactor(Qval * Qval));
-  }
+
+  std::transform(
+      Qvals.begin(), Qvals.end(), std::back_inserter(FF),
+      [&ion](double qval) { return ion.analyticalFormFactor(qval * qval); });
+
   if (!ffwsStr.empty()) {
     HistogramBuilder builder;
     builder.setX(Qvals.size());
diff --git a/Framework/Algorithms/src/MaxEnt/MaxentTransformMultiFourier.cpp b/Framework/Algorithms/src/MaxEnt/MaxentTransformMultiFourier.cpp
index 19dac6d580f..fe3a9aabcac 100644
--- a/Framework/Algorithms/src/MaxEnt/MaxentTransformMultiFourier.cpp
+++ b/Framework/Algorithms/src/MaxEnt/MaxentTransformMultiFourier.cpp
@@ -40,9 +40,7 @@ MaxentTransformMultiFourier::imageToData(const std::vector<double> &image) {
   std::vector<double> data;
   data.reserve(m_numSpec * dataOneSpec.size());
   for (size_t s = 0; s < m_numSpec; s++) {
-    for (const double &data_item : dataOneSpec) {
-      data.emplace_back(data_item);
-    }
+    std::copy(dataOneSpec.begin(), dataOneSpec.end(), std::back_inserter(data));
   }
 
   // Apply adjustments (we assume there are sufficient adjustments supplied)
diff --git a/Framework/Algorithms/src/ModeratorTzero.cpp b/Framework/Algorithms/src/ModeratorTzero.cpp
index 6960ca6d2d9..67e1a3395f1 100644
--- a/Framework/Algorithms/src/ModeratorTzero.cpp
+++ b/Framework/Algorithms/src/ModeratorTzero.cpp
@@ -354,9 +354,9 @@ void ModeratorTzero::execEvent(const std::string &emode) {
           evlist.mutableX() -= t0_direct;
 
           MantidVec tofs = evlist.getTofs();
-          for (double &tof : tofs) {
-            tof -= t0_direct;
-          }
+
+          std::transform(tofs.begin(), tofs.end(), tofs.begin(),
+                         [&t0_direct](double tof) { return tof - t0_direct; });
           evlist.setTofs(tofs);
           evlist.setSortOrder(Mantid::DataObjects::EventSortType::UNSORTED);
         } // end of else if(emode=="Direct")
diff --git a/Framework/Algorithms/src/PaddingAndApodization.cpp b/Framework/Algorithms/src/PaddingAndApodization.cpp
index a2975167ee4..9aaad011702 100644
--- a/Framework/Algorithms/src/PaddingAndApodization.cpp
+++ b/Framework/Algorithms/src/PaddingAndApodization.cpp
@@ -115,7 +115,6 @@ void PaddingAndApodization::exec() {
   fptr apodizationFunction = getApodizationFunction(method);
   // Do the specified spectra only
   auto specLength = static_cast<int>(spectra.size());
-  std::vector<double> norm(specLength, 0.0);
   PARALLEL_FOR_IF(Kernel::threadSafe(*inputWS, *outputWS))
   for (int i = 0; i < specLength; ++i) {
     PARALLEL_START_INTERUPT_REGION
diff --git a/Framework/Algorithms/src/PointByPointVCorrection.cpp b/Framework/Algorithms/src/PointByPointVCorrection.cpp
index ee0591db07a..96fc5e9a6e9 100644
--- a/Framework/Algorithms/src/PointByPointVCorrection.cpp
+++ b/Framework/Algorithms/src/PointByPointVCorrection.cpp
@@ -125,10 +125,10 @@ void PointByPointVCorrection::exec() {
     //       builds which caused the unit tests
     //       to sometimes fail.  Maybe this is some compiler bug to do with
     //       using bind2nd within the parrallel macros.
-    for (double &rY : resultY) {
-      // Now result is s_i/v_i*Dlam_i*(sum_i s_i)/(sum_i S_i/v_i*Dlam_i)
-      rY *= factor;
-    }
+
+    // Now result is s_i/v_i*Dlam_i*(sum_i s_i)/(sum_i S_i/v_i*Dlam_i)
+    std::transform(resultY.begin(), resultY.end(), resultY.begin(),
+                   [&factor](double rY) { return rY * factor; });
 
     // Finally get the normalized errors
     for (int j = 0; j < size - 1; j++)
diff --git a/Framework/Algorithms/src/PolarizationCorrectionWildes.cpp b/Framework/Algorithms/src/PolarizationCorrectionWildes.cpp
index 8547cdd06f8..4d7d409f427 100644
--- a/Framework/Algorithms/src/PolarizationCorrectionWildes.cpp
+++ b/Framework/Algorithms/src/PolarizationCorrectionWildes.cpp
@@ -96,21 +96,30 @@ void fourInputsCorrectedAndErrors(
   const auto diag1 = 1. / f1;
   const auto off1 = (f1 - 1.) / f1;
   Eigen::Matrix4d F1m;
+  // Suppress warnings about suspicious init with Eigen
+  // cppcheck-suppress constStatement
   F1m << 1., 0., 0., 0., 0., 1., 0., 0., off1, 0., diag1, 0., 0., off1, 0.,
       diag1;
+
   const auto diag2 = 1. / f2;
   const auto off2 = (f2 - 1.) / f2;
   Eigen::Matrix4d F2m;
+
+  // cppcheck-suppress constStatement
   F2m << 1., 0., 0., 0., off2, diag2, 0., 0., 0., 0., 1., 0., 0., 0., off2,
       diag2;
   const auto diag3 = (p1 - 1.) / (2. * p1 - 1.);
   const auto off3 = p1 / (2. * p1 - 1);
   Eigen::Matrix4d P1m;
+
+  // cppcheck-suppress constStatement
   P1m << diag3, 0, off3, 0, 0, diag3, 0, off3, off3, 0, diag3, 0, 0, off3, 0,
       diag3;
   const auto diag4 = (p2 - 1.) / (2. * p2 - 1.);
   const auto off4 = p2 / (2. * p2 - 1.);
   Eigen::Matrix4d P2m;
+
+  // cppcheck-suppress constStatement
   P2m << diag4, off4, 0., 0., off4, diag4, 0., 0., 0., 0., diag4, off4, 0., 0.,
       off4, diag4;
   const Eigen::Vector4d intensities(ppy, pmy, mpy, mmy);
@@ -122,18 +131,26 @@ void fourInputsCorrectedAndErrors(
   // the matrices above, multiplied by the error.
   const auto elemE1 = -1. / pow<2>(f1) * f1E;
   Eigen::Matrix4d F1Em;
+
+  // cppcheck-suppress constStatement
   F1Em << 0., 0., 0., 0., 0., 0., 0., 0., -elemE1, 0., elemE1, 0., 0., -elemE1,
       0., elemE1;
   const auto elemE2 = -1. / pow<2>(f2) * f2E;
   Eigen::Matrix4d F2Em;
+
+  // cppcheck-suppress constStatement
   F2Em << 0., 0., 0., 0., -elemE2, elemE2, 0., 0., 0., 0., 0., 0., 0., 0.,
       -elemE2, elemE2;
   const auto elemE3 = 1. / pow<2>(2. * p1 - 1.) * p1E;
   Eigen::Matrix4d P1Em;
+
+  // cppcheck-suppress constStatement
   P1Em << elemE3, 0., -elemE3, 0., 0., elemE3, 0., -elemE3, -elemE3, 0., elemE3,
       0., 0., -elemE3, 0., elemE3;
   const auto elemE4 = 1. / pow<2>(2. * p2 - 1.) * p2E;
   Eigen::Matrix4d P2Em;
+
+  // cppcheck-suppress constStatement
   P2Em << elemE4, -elemE4, 0., 0., -elemE4, elemE4, 0., 0., 0., 0., elemE4,
       -elemE4, 0., 0., -elemE4, elemE4;
   const Eigen::Vector4d yErrors(ppyE, pmyE, mpyE, mmyE);
diff --git a/Framework/Algorithms/src/ReflectometryReductionOne2.cpp b/Framework/Algorithms/src/ReflectometryReductionOne2.cpp
index 4a30b192f8a..9f887d7e93c 100644
--- a/Framework/Algorithms/src/ReflectometryReductionOne2.cpp
+++ b/Framework/Algorithms/src/ReflectometryReductionOne2.cpp
@@ -709,7 +709,7 @@ void ReflectometryReductionOne2::findDetectorGroups() {
   // Sort the groups by the first spectrum number in the group (to give the same
   // output order as GroupDetectors)
   std::sort(m_detectorGroups.begin(), m_detectorGroups.end(),
-            [](const std::vector<size_t> a, const std::vector<size_t> b) {
+            [](const std::vector<size_t> &a, const std::vector<size_t> &b) {
               return a.front() < b.front();
             });
 
diff --git a/Framework/Algorithms/src/ResetNegatives.cpp b/Framework/Algorithms/src/ResetNegatives.cpp
index 93fda48e7f8..430b9dc3870 100644
--- a/Framework/Algorithms/src/ResetNegatives.cpp
+++ b/Framework/Algorithms/src/ResetNegatives.cpp
@@ -151,9 +151,9 @@ void ResetNegatives::pushMinimum(MatrixWorkspace_const_sptr minWS,
     if (minValue <= 0) {
       minValue *= -1.;
       auto &y = wksp->mutableY(i);
-      for (double &value : y) {
-        value = fixZero(value + minValue);
-      }
+      std::transform(y.begin(), y.end(), y.begin(), [minValue](double value) {
+        return fixZero(value + minValue);
+      });
     }
     prog.report();
     PARALLEL_END_INTERUPT_REGION
diff --git a/Framework/Algorithms/src/SmoothData.cpp b/Framework/Algorithms/src/SmoothData.cpp
index b7ed93f3449..8893838585b 100644
--- a/Framework/Algorithms/src/SmoothData.cpp
+++ b/Framework/Algorithms/src/SmoothData.cpp
@@ -73,11 +73,12 @@ void SmoothData::exec() {
     int npts = nptsGroup[0];
     if (groupWS) {
       const int group = validateSpectrumInGroup(static_cast<size_t>(i));
-      if (group < 0)
+      if (group == -1) {
         npts = 3;
-      else
-        // group is never 0. We can safely subtract.
+      } else {
+        assert(group != 0);
         npts = nptsGroup[group - 1];
+      }
     }
     if (npts >= vecSize) {
       g_log.error("The number of averaging points requested is larger than the "
@@ -103,7 +104,7 @@ void SmoothData::exec() {
 
   // Set the output workspace to its property
   setProperty("OutputWorkspace", outputWorkspace);
-}
+} // namespace Algorithms
 //=============================================================================
 /** Verify that all the contributing detectors to a spectrum belongs to the same
  * group
diff --git a/Framework/Algorithms/src/Stitch1DMany.cpp b/Framework/Algorithms/src/Stitch1DMany.cpp
index d89ceb8c802..bc582d28486 100644
--- a/Framework/Algorithms/src/Stitch1DMany.cpp
+++ b/Framework/Algorithms/src/Stitch1DMany.cpp
@@ -269,8 +269,10 @@ void Stitch1DMany::exec() {
       for (size_t i = 0; i < m_inputWSMatrix.front().size(); ++i) {
         std::vector<MatrixWorkspace_sptr> inMatrix;
         inMatrix.reserve(m_inputWSMatrix.size());
-        for (const auto &ws : m_inputWSMatrix)
-          inMatrix.emplace_back(ws[i]);
+
+        std::transform(m_inputWSMatrix.begin(), m_inputWSMatrix.end(),
+                       std::back_inserter(inMatrix),
+                       [i](const auto &ws) { return ws[i]; });
 
         outName = groupName;
         Workspace_sptr outStitchedWS;
diff --git a/Framework/Crystal/src/FindUBUsingIndexedPeaks.cpp b/Framework/Crystal/src/FindUBUsingIndexedPeaks.cpp
index 7cbe615d2f9..4d9444bffea 100644
--- a/Framework/Crystal/src/FindUBUsingIndexedPeaks.cpp
+++ b/Framework/Crystal/src/FindUBUsingIndexedPeaks.cpp
@@ -108,9 +108,9 @@ void FindUBUsingIndexedPeaks::exec() {
   {                    // from the full list of peaks, and
     q_vectors.clear(); // save the UB in the sample
     q_vectors.reserve(n_peaks);
-    for (const auto &peak : peaks) {
-      q_vectors.emplace_back(peak.getQSampleFrame());
-    }
+
+    std::transform(peaks.begin(), peaks.end(), std::back_inserter(q_vectors),
+                   [](const auto &peak) { return peak.getQSampleFrame(); });
 
     int num_indexed = IndexingUtils::NumberIndexed(UB, q_vectors, tolerance);
     int sate_indexed = 0;
diff --git a/Framework/Crystal/src/LoadIsawPeaks.cpp b/Framework/Crystal/src/LoadIsawPeaks.cpp
index 4ce06b8fed3..4efad112094 100644
--- a/Framework/Crystal/src/LoadIsawPeaks.cpp
+++ b/Framework/Crystal/src/LoadIsawPeaks.cpp
@@ -67,7 +67,6 @@ int LoadIsawPeaks::confidence(Kernel::FileDescriptor &descriptor) const {
       throw std::logic_error(std::string("No Version for Peaks file"));
 
     getWord(in, false); // tag
-    // cppcheck-suppress unreadVariable
     std::string C_Facility = getWord(in, false);
 
     getWord(in, false); // tag
@@ -142,7 +141,6 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS,
     throw std::logic_error(std::string("No Version for Peaks file"));
 
   getWord(in, false); // tag
-  // cppcheck-suppress unreadVariable
   std::string C_Facility = getWord(in, false);
 
   getWord(in, false); // tag
diff --git a/Framework/Crystal/src/LoadIsawSpectrum.cpp b/Framework/Crystal/src/LoadIsawSpectrum.cpp
index 3e24646201a..9263a6de4d3 100644
--- a/Framework/Crystal/src/LoadIsawSpectrum.cpp
+++ b/Framework/Crystal/src/LoadIsawSpectrum.cpp
@@ -56,7 +56,6 @@ void LoadIsawSpectrum::exec() {
   const V3D pos = inst->getSource()->getPos() - samplePos;
   double l1 = pos.norm();
 
-  std::vector<double> spec(11);
   std::string STRING;
   std::ifstream infile;
   std::string spectraFile = getPropertyValue("SpectraFile");
diff --git a/Framework/Crystal/src/PeakAlgorithmHelpers.cpp b/Framework/Crystal/src/PeakAlgorithmHelpers.cpp
index 493f447ec2a..6d01489f6c8 100644
--- a/Framework/Crystal/src/PeakAlgorithmHelpers.cpp
+++ b/Framework/Crystal/src/PeakAlgorithmHelpers.cpp
@@ -200,12 +200,11 @@ generateOffsetVectors(const std::vector<double> &hOffsets,
   std::vector<MNPOffset> offsets;
   for (double hOffset : hOffsets) {
     for (double kOffset : kOffsets) {
-      for (double lOffset : lOffsets) {
-        // mnp = 0, 0, 0 as
-        // it's not quite clear how to interpret them as mnp indices
-        offsets.emplace_back(
-            std::make_tuple(0, 0, 0, V3D(hOffset, kOffset, lOffset)));
-      }
+      std::transform(
+          lOffsets.begin(), lOffsets.end(), std::back_inserter(offsets),
+          [&hOffset, &kOffset](double lOffset) {
+            return std::make_tuple(0, 0, 0, V3D(hOffset, kOffset, lOffset));
+          });
     }
   }
   return offsets;
diff --git a/Framework/Crystal/src/SaveIsawPeaks.cpp b/Framework/Crystal/src/SaveIsawPeaks.cpp
index deed32269bb..83d817599b9 100644
--- a/Framework/Crystal/src/SaveIsawPeaks.cpp
+++ b/Framework/Crystal/src/SaveIsawPeaks.cpp
@@ -318,7 +318,6 @@ void SaveIsawPeaks::exec() {
     const int run = runBankMap.first;
     const auto &bankMap = runBankMap.second;
 
-    bankMap_t::iterator bankMap_it;
     for (const auto &bankIDs : bankMap) {
       // Start of a new bank.
       const int bank = bankIDs.first;
diff --git a/Framework/Crystal/src/SetSpecialCoordinates.cpp b/Framework/Crystal/src/SetSpecialCoordinates.cpp
index ec7453d2044..5139e8b13ce 100644
--- a/Framework/Crystal/src/SetSpecialCoordinates.cpp
+++ b/Framework/Crystal/src/SetSpecialCoordinates.cpp
@@ -95,7 +95,7 @@ void SetSpecialCoordinates::init() {
 bool SetSpecialCoordinates::writeCoordinatesToMDEventWorkspace(
     Workspace_sptr inWS, SpecialCoordinateSystem /*unused*/) {
   bool written = false;
-  if (auto mdEventWS = boost::dynamic_pointer_cast<IMDEventWorkspace>(inWS)) {
+  if (boost::dynamic_pointer_cast<IMDEventWorkspace>(inWS)) {
     g_log.warning("SetSpecialCoordinates: This algorithm cannot set the "
                   "special coordinate system for an MDEvent workspace any "
                   "longer.");
@@ -107,7 +107,7 @@ bool SetSpecialCoordinates::writeCoordinatesToMDEventWorkspace(
 bool SetSpecialCoordinates::writeCoordinatesToMDHistoWorkspace(
     Workspace_sptr inWS, SpecialCoordinateSystem /*unused*/) {
   bool written = false;
-  if (auto mdHistoWS = boost::dynamic_pointer_cast<IMDHistoWorkspace>(inWS)) {
+  if (boost::dynamic_pointer_cast<IMDHistoWorkspace>(inWS)) {
     g_log.warning("SetSpecialCoordinates: This algorithm cannot set the "
                   "special coordinate system for an MDHisto workspace any "
                   "longer.");
diff --git a/Framework/CurveFitting/src/Algorithms/EstimateFitParameters.cpp b/Framework/CurveFitting/src/Algorithms/EstimateFitParameters.cpp
index 00cbc81571d..1c9273de679 100644
--- a/Framework/CurveFitting/src/Algorithms/EstimateFitParameters.cpp
+++ b/Framework/CurveFitting/src/Algorithms/EstimateFitParameters.cpp
@@ -138,9 +138,8 @@ public:
   std::vector<GSLVector> getParams() const {
     std::vector<GSLVector> res;
     res.reserve(m_params.size());
-    for (auto &it : m_params) {
-      res.emplace_back(it.second);
-    }
+    std::transform(m_params.begin(), m_params.end(), std::back_inserter(res),
+                   [](const auto &it) { return it.second; });
     return res;
   }
 };
@@ -383,12 +382,12 @@ void EstimateFitParameters::execConcrete() {
       continue;
     }
     auto constraint = func->getConstraint(i);
-    if (constraint == nullptr) {
+    if (!constraint) {
       func->fix(i);
       continue;
     }
     auto boundary = dynamic_cast<Constraints::BoundaryConstraint *>(constraint);
-    if (boundary == nullptr) {
+    if (!boundary) {
       throw std::runtime_error("Parameter " + func->parameterName(i) +
                                " must have a boundary constraint. ");
     }
diff --git a/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValueHelper.cpp b/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValueHelper.cpp
index 3382a04eaa3..d6c2bfa8721 100644
--- a/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValueHelper.cpp
+++ b/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValueHelper.cpp
@@ -212,7 +212,6 @@ std::vector<int> getWorkspaceIndicesFromAxes(API::MatrixWorkspace &ws,
       }
     }
   } else { // numeric axis
-    spectrumNumber = SpecialIndex::NOT_SET;
     if (workspaceIndex >= 0) {
       out.clear();
     } else {
diff --git a/Framework/CurveFitting/src/Algorithms/QENSFitSequential.cpp b/Framework/CurveFitting/src/Algorithms/QENSFitSequential.cpp
index 2af32db01fe..dee0ebc28b1 100644
--- a/Framework/CurveFitting/src/Algorithms/QENSFitSequential.cpp
+++ b/Framework/CurveFitting/src/Algorithms/QENSFitSequential.cpp
@@ -170,9 +170,10 @@ std::vector<MatrixWorkspace_sptr> extractWorkspaces(const std::string &input) {
 
   std::vector<MatrixWorkspace_sptr> workspaces;
 
-  for (const auto &wsName : workspaceNames) {
-    workspaces.emplace_back(getADSMatrixWorkspace(wsName));
-  }
+  std::transform(workspaceNames.begin(), workspaceNames.end(),
+                 std::back_inserter(workspaces), [](const auto &wsName) {
+                   return getADSMatrixWorkspace(wsName);
+                 });
 
   return workspaces;
 }
@@ -541,9 +542,9 @@ void QENSFitSequential::exec() {
       getPropertyValue("OutputWorkspace"), resultWs);
 
   if (containsMultipleData(workspaces)) {
-    const auto inputString = getPropertyValue("Input");
+    const auto inputStringProp = getPropertyValue("Input");
     renameWorkspaces(groupWs, spectra, outputBaseName, "_Workspace",
-                     extractWorkspaceNames(inputString));
+                     extractWorkspaceNames(inputStringProp));
   } else {
     renameWorkspaces(groupWs, spectra, outputBaseName, "_Workspace");
   }
diff --git a/Framework/CurveFitting/src/Algorithms/SplineSmoothing.cpp b/Framework/CurveFitting/src/Algorithms/SplineSmoothing.cpp
index b0b09aab49c..dff88dc8f29 100644
--- a/Framework/CurveFitting/src/Algorithms/SplineSmoothing.cpp
+++ b/Framework/CurveFitting/src/Algorithms/SplineSmoothing.cpp
@@ -306,9 +306,10 @@ void SplineSmoothing::addSmoothingPoints(const std::set<int> &points,
   std::vector<double> breakPoints;
   breakPoints.reserve(num_points);
   // set each of the x and y points to redefine the spline
-  for (auto const &point : points) {
-    breakPoints.emplace_back(xs[point]);
-  }
+
+  std::transform(points.begin(), points.end(), std::back_inserter(breakPoints),
+                 [&xs](const auto &point) { return xs[point]; });
+
   m_cspline->setAttribute("BreakPoints",
                           API::IFunction::Attribute(breakPoints));
 
@@ -367,7 +368,7 @@ void SplineSmoothing::selectSmoothingPoints(
         break;
       }
 
-    } else if (!incBreaks) {
+    } else {
       if (smoothPts.size() >= xs.size() - 1) {
         break;
       }
diff --git a/Framework/CurveFitting/src/AugmentedLagrangianOptimizer.cpp b/Framework/CurveFitting/src/AugmentedLagrangianOptimizer.cpp
index edbeff12fe1..2b325168c3c 100644
--- a/Framework/CurveFitting/src/AugmentedLagrangianOptimizer.cpp
+++ b/Framework/CurveFitting/src/AugmentedLagrangianOptimizer.cpp
@@ -137,7 +137,7 @@ void AugmentedLagrangianOptimizer::minimize(std::vector<double> &xv) const {
   assert(numParameters() == xv.size());
 
   double ICM(HUGE_VAL), minf_penalty(HUGE_VAL), rho(0.0);
-  double fcur(0.0), minf(HUGE_VAL), penalty(0.0);
+  double minf(HUGE_VAL), penalty(0.0);
   std::vector<double> xcur(xv), lambda(numEqualityConstraints(), 0),
       mu(numInequalityConstraints());
   int minfIsFeasible = 0;
@@ -149,7 +149,7 @@ void AugmentedLagrangianOptimizer::minimize(std::vector<double> &xv) const {
 
   if (numEqualityConstraints() > 0 || numInequalityConstraints() > 0) {
     double con2 = 0;
-    fcur = m_userfunc(numParameters(), xcur.data());
+    double fcur = m_userfunc(numParameters(), xcur.data());
     int feasible = 1;
     for (size_t i = 0; i < numEqualityConstraints(); ++i) {
       double hi = evaluateConstraint(m_eq, i, numParameters(), xcur.data());
@@ -177,7 +177,7 @@ void AugmentedLagrangianOptimizer::minimize(std::vector<double> &xv) const {
 
     unconstrainedOptimization(lambda, mu, rho, xcur);
 
-    fcur = m_userfunc(numParameters(), xcur.data());
+    double fcur = m_userfunc(numParameters(), xcur.data());
     ICM = 0.0;
     penalty = 0.0;
     int feasible = 1;
diff --git a/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp b/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp
index d5163767645..07c6a543b7b 100644
--- a/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp
+++ b/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp
@@ -418,9 +418,7 @@ double CostFuncFitting::valDerivHessian(bool evalDeriv,
       }
     }
     m_dirtyDeriv = false;
-  }
 
-  if (evalDeriv) {
     if (m_includePenalty) {
       size_t i = 0;
       for (size_t ip = 0; ip < np; ++ip) {
diff --git a/Framework/CurveFitting/src/Functions/CrystalFieldMultiSpectrum.cpp b/Framework/CurveFitting/src/Functions/CrystalFieldMultiSpectrum.cpp
index 2841d4b75ba..2134f11c772 100644
--- a/Framework/CurveFitting/src/Functions/CrystalFieldMultiSpectrum.cpp
+++ b/Framework/CurveFitting/src/Functions/CrystalFieldMultiSpectrum.cpp
@@ -125,10 +125,12 @@ CrystalFieldMultiSpectrum::CrystalFieldMultiSpectrum()
 size_t CrystalFieldMultiSpectrum::getNumberDomains() const {
   if (!m_target) {
     buildTargetFunction();
+
+    if (!m_target) {
+      throw std::runtime_error("Failed to build target function.");
+    }
   }
-  if (!m_target) {
-    throw std::runtime_error("Failed to build target function.");
-  }
+
   return m_target->getNumberDomains();
 }
 
diff --git a/Framework/CurveFitting/src/GSLVector.cpp b/Framework/CurveFitting/src/GSLVector.cpp
index 03f64506103..87bdc8c1f11 100644
--- a/Framework/CurveFitting/src/GSLVector.cpp
+++ b/Framework/CurveFitting/src/GSLVector.cpp
@@ -168,18 +168,16 @@ GSLVector &GSLVector::operator*=(const GSLVector &v) {
 /// Multiply by a number
 /// @param d :: The number
 GSLVector &GSLVector::operator*=(const double d) {
-  for (auto &x : m_data) {
-    x *= d;
-  }
+  std::transform(m_data.begin(), m_data.end(), m_data.begin(),
+                 [d](double x) { return x * d; });
   return *this;
 }
 
 /// Add a number
 /// @param d :: The number
 GSLVector &GSLVector::operator+=(const double d) {
-  for (auto &x : m_data) {
-    x += d;
-  }
+  std::transform(m_data.begin(), m_data.end(), m_data.begin(),
+                 [d](double x) { return x + d; });
   return *this;
 }
 
diff --git a/Framework/CurveFitting/src/TableWorkspaceDomainCreator.cpp b/Framework/CurveFitting/src/TableWorkspaceDomainCreator.cpp
index 566167061b7..ee80a475e4a 100644
--- a/Framework/CurveFitting/src/TableWorkspaceDomainCreator.cpp
+++ b/Framework/CurveFitting/src/TableWorkspaceDomainCreator.cpp
@@ -174,8 +174,6 @@ void TableWorkspaceDomainCreator::declareDatasetProperties(
         "(default the highest value of x)");
     if (m_domainType != Simple &&
         !m_manager->existsProperty(m_maxSizePropertyName)) {
-      auto mustBePositive = boost::make_shared<BoundedValidator<int>>();
-      mustBePositive->setLower(0);
       declareProperty(
           new PropertyWithValue<int>(m_maxSizePropertyName, 1, mustBePositive),
           "The maximum number of values per a simple domain.");
diff --git a/Framework/DataHandling/src/DataBlockComposite.cpp b/Framework/DataHandling/src/DataBlockComposite.cpp
index 6560c92166d..e8c7da11196 100644
--- a/Framework/DataHandling/src/DataBlockComposite.cpp
+++ b/Framework/DataHandling/src/DataBlockComposite.cpp
@@ -208,9 +208,12 @@ std::vector<std::pair<int64_t, int64_t>> spectrumIDIntervals(
     const std::vector<Mantid::DataHandling::DataBlock> &blocks) {
   std::vector<std::pair<int64_t, int64_t>> intervals;
   intervals.reserve(blocks.size());
-  for (const auto &block : blocks) {
-    intervals.emplace_back(block.getMinSpectrumID(), block.getMaxSpectrumID());
-  }
+
+  std::transform(blocks.begin(), blocks.end(), std::back_inserter(intervals),
+                 [](const auto &block) {
+                   return std::make_pair(block.getMinSpectrumID(),
+                                         block.getMaxSpectrumID());
+                 });
   return intervals;
 }
 } // namespace
diff --git a/Framework/DataHandling/src/GroupDetectors2.cpp b/Framework/DataHandling/src/GroupDetectors2.cpp
index 82af6435fda..366ab1ef5fe 100644
--- a/Framework/DataHandling/src/GroupDetectors2.cpp
+++ b/Framework/DataHandling/src/GroupDetectors2.cpp
@@ -589,9 +589,7 @@ void GroupDetectors2::processXMLFile(const std::string &fname,
       if (ind != detIdToWiMap.end()) {
         size_t wsid = ind->second;
         wsindexes.emplace_back(wsid);
-        if (unUsedSpec[wsid] != (USED)) {
-          unUsedSpec[wsid] = (USED);
-        }
+        unUsedSpec[wsid] = (USED);
       } else {
         g_log.error() << "Detector with ID " << detid
                       << " is not found in instrument \n";
@@ -615,9 +613,7 @@ void GroupDetectors2::processXMLFile(const std::string &fname,
       if (ind != specs2index.end()) {
         size_t wsid = ind->second;
         wsindexes.emplace_back(wsid);
-        if (unUsedSpec[wsid] != (USED)) {
-          unUsedSpec[wsid] = (USED);
-        }
+        unUsedSpec[wsid] = (USED);
       } else {
         g_log.error() << "Spectrum with ID " << specNum
                       << " is not found in instrument \n";
@@ -649,6 +645,7 @@ void GroupDetectors2::processGroupingWorkspace(
     size_t groupid = static_cast<int>(groupWS->y(i)[0]);
     // group 0 is are unused spectra - don't process them
     if (groupid > 0) {
+      // cppcheck-suppress stlFindInsert
       if (group2WSIndexSetmap.find(groupid) == group2WSIndexSetmap.end()) {
         // not found - create an empty set
         group2WSIndexSetmap.emplace(groupid, std::set<size_t>());
@@ -662,9 +659,7 @@ void GroupDetectors2::processGroupingWorkspace(
             detIdToWiMap[detectorIDs[spectrumDefinition.first]];
         targetWSIndexSet.insert(targetWSIndex);
         // mark as used
-        if (unUsedSpec[targetWSIndex] != (USED)) {
-          unUsedSpec[targetWSIndex] = (USED);
-        }
+        unUsedSpec[targetWSIndex] = (USED);
       }
     }
   }
@@ -701,6 +696,7 @@ void GroupDetectors2::processMatrixWorkspace(
     // read spectra from groupingws
     size_t groupid = i;
 
+    // cppcheck-suppress stlFindInsert
     if (group2WSIndexSetmap.find(groupid) == group2WSIndexSetmap.end()) {
       // not found - create an empty set
       group2WSIndexSetmap.emplace(groupid, std::set<size_t>());
@@ -716,9 +712,7 @@ void GroupDetectors2::processMatrixWorkspace(
             detIdToWiMap[detectorIDs[spectrumDefinition.first]];
         targetWSIndexSet.insert(targetWSIndex);
         // mark as used
-        if (unUsedSpec[targetWSIndex] != (USED)) {
-          unUsedSpec[targetWSIndex] = (USED);
-        }
+        unUsedSpec[targetWSIndex] = (USED);
       }
     }
   }
diff --git a/Framework/Kernel/test/CowPtrTest.h b/Framework/Kernel/test/CowPtrTest.h
index e8de0414bac..d4a97a9cc9e 100644
--- a/Framework/Kernel/test/CowPtrTest.h
+++ b/Framework/Kernel/test/CowPtrTest.h
@@ -38,9 +38,8 @@ public:
   }
 
   void testConstructorByPtr() {
-
-    auto *resource = new MyType{2};
-    cow_ptr<MyType> cow{resource};
+    auto resource = std::make_unique<MyType>(2);
+    cow_ptr<MyType> cow{resource.release()};
 
     TSM_ASSERT_EQUALS("COW does not hold the expected value", 2, cow->value);
   }
-- 
GitLab


From 2357c748849044bbbe05a4181dcbe47099c5e795 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Thu, 19 Mar 2020 18:35:40 +0000
Subject: [PATCH 22/30] Clang-tidy pass by ref

Runs clang-tidy pass by ref across the codebase to fix-up various
warnings we are seeing in cppcheck
---
 Framework/API/inc/MantidAPI/Algorithm.h       |    2 +-
 .../API/inc/MantidAPI/AlgorithmFactory.h      |    4 +-
 .../API/inc/MantidAPI/AlgorithmHistory.h      |    2 +-
 .../API/inc/MantidAPI/AlgorithmManager.h      |    3 +-
 .../API/inc/MantidAPI/AlgorithmObserver.h     |   14 +-
 Framework/API/inc/MantidAPI/AlgorithmProxy.h  |    2 +-
 .../BoostOptionalToAlgorithmProperty.h        |   20 +-
 Framework/API/inc/MantidAPI/BoxController.h   |    2 +-
 .../API/inc/MantidAPI/CompositeCatalog.h      |    2 +-
 .../API/inc/MantidAPI/CompositeDomainMD.h     |    2 +-
 .../API/inc/MantidAPI/CompositeFunction.h     |    5 +-
 .../inc/MantidAPI/DataProcessorAlgorithm.h    |    2 +-
 .../API/inc/MantidAPI/DetectorSearcher.h      |    2 +-
 .../MantidAPI/EnabledWhenWorkspaceIsType.h    |    4 +-
 Framework/API/inc/MantidAPI/ExperimentInfo.h  |    6 +-
 .../API/inc/MantidAPI/FunctionDomainGeneral.h |    2 +-
 .../API/inc/MantidAPI/FunctionDomainMD.h      |    2 +-
 Framework/API/inc/MantidAPI/FunctionFactory.h |   12 +-
 .../API/inc/MantidAPI/FunctionGenerator.h     |    2 +-
 Framework/API/inc/MantidAPI/GridDomain1D.h    |    3 +-
 Framework/API/inc/MantidAPI/GroupingLoader.h  |    2 +-
 Framework/API/inc/MantidAPI/IFunction.h       |   11 +-
 Framework/API/inc/MantidAPI/ITableWorkspace.h |    5 +-
 Framework/API/inc/MantidAPI/IndexProperty.h   |    2 +-
 Framework/API/inc/MantidAPI/JointDomain.h     |    2 +-
 Framework/API/inc/MantidAPI/MDGeometry.h      |    3 +-
 .../inc/MantidAPI/MultiPeriodGroupWorker.h    |    2 +-
 .../inc/MantidAPI/MultipleExperimentInfos.h   |    2 +-
 Framework/API/inc/MantidAPI/NotebookBuilder.h |   13 +-
 Framework/API/inc/MantidAPI/NotebookWriter.h  |    4 +-
 .../inc/MantidAPI/RemoteJobManagerFactory.h   |    4 +-
 Framework/API/inc/MantidAPI/Sample.h          |    2 +-
 Framework/API/inc/MantidAPI/ScopedWorkspace.h |    4 +-
 Framework/API/inc/MantidAPI/ScriptBuilder.h   |    2 +-
 .../inc/MantidAPI/SpectrumDetectorMapping.h   |    2 +-
 .../API/inc/MantidAPI/WorkspaceHistory.h      |    6 +-
 .../API/inc/MantidAPI/WorkspaceOpOverloads.h  |   60 +-
 .../API/inc/MantidAPI/WorkspaceProperty.h     |    9 +-
 .../API/inc/MantidAPI/WorkspaceProperty.tcc   |   28 +-
 Framework/API/src/Algorithm.cpp               |    5 +-
 Framework/API/src/AlgorithmFactory.cpp        |    4 +-
 Framework/API/src/AlgorithmHistory.cpp        |    5 +-
 Framework/API/src/AlgorithmObserver.cpp       |   20 +-
 Framework/API/src/AlgorithmProperty.cpp       |    6 +-
 Framework/API/src/AlgorithmProxy.cpp          |    2 +-
 .../src/BoostOptionalToAlgorithmProperty.cpp  |   10 +-
 Framework/API/src/BoxController.cpp           |    5 +-
 Framework/API/src/CompositeCatalog.cpp        |    2 +-
 Framework/API/src/CompositeDomainMD.cpp       |    2 +-
 Framework/API/src/CompositeFunction.cpp       |    9 +-
 Framework/API/src/DataProcessorAlgorithm.cpp  |    6 +-
 Framework/API/src/DetectorSearcher.cpp        |    5 +-
 Framework/API/src/ExperimentInfo.cpp          |    2 +-
 Framework/API/src/FunctionDomainGeneral.cpp   |    2 +-
 Framework/API/src/FunctionDomainMD.cpp        |    4 +-
 Framework/API/src/FunctionFactory.cpp         |   10 +-
 Framework/API/src/FunctionGenerator.cpp       |    6 +-
 Framework/API/src/GridDomain1D.cpp            |    2 +-
 Framework/API/src/GroupingLoader.cpp          |    8 +-
 Framework/API/src/HistoryItem.cpp             |    4 +-
 Framework/API/src/IFunction.cpp               |   14 +-
 Framework/API/src/IMDWorkspace.cpp            |    3 +-
 Framework/API/src/IndexProperty.cpp           |    9 +-
 Framework/API/src/JointDomain.cpp             |    2 +-
 Framework/API/src/MDGeometry.cpp              |    5 +-
 Framework/API/src/MultiPeriodGroupWorker.cpp  |    2 +-
 Framework/API/src/MultipleExperimentInfos.cpp |    6 +-
 Framework/API/src/NotebookBuilder.cpp         |   19 +-
 Framework/API/src/NotebookWriter.cpp          |   10 +-
 Framework/API/src/RemoteJobManagerFactory.cpp |    4 +-
 Framework/API/src/Sample.cpp                  |    2 +-
 Framework/API/src/ScopedWorkspace.cpp         |   10 +-
 Framework/API/src/ScriptBuilder.cpp           |   10 +-
 Framework/API/src/SpectrumDetectorMapping.cpp |    2 +-
 Framework/API/src/WorkspaceHistory.cpp        |    2 +-
 Framework/API/src/WorkspaceOpOverloads.cpp    |   58 +-
 Framework/API/test/AlgorithmHistoryTest.h     |    2 +-
 Framework/API/test/AlgorithmProxyTest.h       |    4 +-
 Framework/API/test/AlgorithmTest.h            |   25 +-
 .../test/AnalysisDataServiceObserverTest.h    |    2 +-
 Framework/API/test/ExperimentInfoTest.h       |    4 +-
 Framework/API/test/FunctionFactoryTest.h      |    2 +-
 Framework/API/test/LiveListenerFactoryTest.h  |    4 +-
 Framework/API/test/LogManagerTest.h           |    3 +-
 Framework/API/test/MultiPeriodGroupTestBase.h |    4 +-
 .../API/test/PeakFunctionIntegratorTest.h     |    3 +-
 Framework/API/test/RunTest.h                  |    2 +-
 Framework/API/test/WorkspaceGroupTest.h       |    2 +-
 .../API/test/WorkspaceNearestNeighboursTest.h |    2 +-
 .../inc/MantidAlgorithms/AddSampleLog.h       |   13 +-
 .../inc/MantidAlgorithms/AlignDetectors.h     |    4 +-
 .../MantidAlgorithms/Bin2DPowderDiffraction.h |    2 +-
 .../inc/MantidAlgorithms/BinaryOperation.h    |    6 +-
 .../CalculateCarpenterSampleCorrection.h      |    6 +-
 .../MantidAlgorithms/CalculateDynamicRange.h  |    4 +-
 .../MantidAlgorithms/CalculateEfficiency.h    |   12 +-
 .../inc/MantidAlgorithms/CalculateIqt.h       |   26 +-
 .../MantidAlgorithms/CalculateTransmission.h  |   18 +-
 .../CalculateTransmissionBeamSpreader.h       |    6 +-
 .../CarpenterSampleCorrection.h               |    8 +-
 .../inc/MantidAlgorithms/ChangeTimeZero.h     |   19 +-
 .../inc/MantidAlgorithms/CompareWorkspaces.h  |   34 +-
 .../inc/MantidAlgorithms/ConjoinXRuns.h       |    4 +-
 .../inc/MantidAlgorithms/ConvertEmptyToTof.h  |    3 +-
 .../MantidAlgorithms/ConvertSpectrumAxis.h    |    3 +-
 .../MantidAlgorithms/ConvertToConstantL2.h    |    4 +-
 .../inc/MantidAlgorithms/ConvertUnits.h       |   20 +-
 .../inc/MantidAlgorithms/CorrectKiKf.h        |    2 +-
 .../inc/MantidAlgorithms/CorrectTOFAxis.h     |    4 +-
 .../inc/MantidAlgorithms/CorrectToFile.h      |    5 +-
 .../MantidAlgorithms/CreateFloodWorkspace.h   |    4 +-
 .../CreateLogTimeCorrection.h                 |    2 +-
 .../inc/MantidAlgorithms/CreatePSDBleedMask.h |    6 +-
 .../MantidAlgorithms/CreateSampleWorkspace.h  |   12 +-
 .../CreateTransmissionWorkspace.h             |    2 +-
 .../CreateTransmissionWorkspace2.h            |    6 +-
 .../CreateTransmissionWorkspaceAuto.h         |    3 +-
 .../inc/MantidAlgorithms/DetectorDiagnostic.h |   15 +-
 .../DetectorEfficiencyVariation.h             |    4 +-
 .../DiffractionEventCalibrateDetectors.h      |   11 +-
 .../MantidAlgorithms/DiffractionFocussing.h   |    2 +-
 .../inc/MantidAlgorithms/EQSANSTofStructure.h |    4 +-
 .../MantidAlgorithms/ExportTimeSeriesLog.h    |    2 +-
 .../inc/MantidAlgorithms/ExtractMaskToTable.h |   11 +-
 .../inc/MantidAlgorithms/FindPeaks.h          |    4 +-
 .../Algorithms/inc/MantidAlgorithms/FitPeak.h |   54 +-
 .../inc/MantidAlgorithms/FitPeaks.h           |   59 +-
 .../MantidAlgorithms/GenerateEventsFilter.h   |   18 +-
 .../inc/MantidAlgorithms/GeneratePeaks.h      |   12 +-
 .../GetDetOffsetsMultiPeaks.h                 |    8 +-
 .../Algorithms/inc/MantidAlgorithms/GetEi.h   |   14 +-
 .../Algorithms/inc/MantidAlgorithms/GetEi2.h  |   13 +-
 .../inc/MantidAlgorithms/GetQsInQENSData.h    |    2 +-
 .../GetTimeSeriesLogInformation.h             |    2 +-
 .../inc/MantidAlgorithms/He3TubeEfficiency.h  |    5 +-
 .../inc/MantidAlgorithms/IQTransform.h        |   27 +-
 .../MantidAlgorithms/IdentifyNoisyDetectors.h |    4 +-
 .../MantidAlgorithms/IntegrateByComponent.h   |    6 +-
 .../inc/MantidAlgorithms/Integration.h        |    2 +-
 .../inc/MantidAlgorithms/InterpolatingRebin.h |    4 +-
 .../inc/MantidAlgorithms/MaskBinsFromTable.h  |   11 +-
 .../Algorithms/inc/MantidAlgorithms/MaxEnt.h  |    2 +-
 .../MaxEnt/MaxentTransformMultiFourier.h      |    2 +-
 .../inc/MantidAlgorithms/MedianDetectorTest.h |   10 +-
 .../Algorithms/inc/MantidAlgorithms/Minus.h   |    4 +-
 .../inc/MantidAlgorithms/NormaliseByCurrent.h |    5 +-
 .../MantidAlgorithms/NormaliseByDetector.h    |   10 +-
 .../inc/MantidAlgorithms/NormaliseToMonitor.h |    2 +-
 .../inc/MantidAlgorithms/PDCalibration.h      |    7 +-
 .../MantidAlgorithms/PaddingAndApodization.h  |    2 +-
 .../inc/MantidAlgorithms/ParallaxCorrection.h |    5 +-
 .../Algorithms/inc/MantidAlgorithms/Plus.h    |    4 +-
 .../PolarizationCorrectionFredrikze.h         |    4 +-
 .../PolarizationEfficiencyCor.h               |    5 +-
 .../Algorithms/inc/MantidAlgorithms/Q1D2.h    |    6 +-
 .../inc/MantidAlgorithms/Q1DWeighted.h        |    8 +-
 .../Algorithms/inc/MantidAlgorithms/Qhelper.h |   21 +-
 .../Algorithms/inc/MantidAlgorithms/Qxy.h     |    2 +-
 .../inc/MantidAlgorithms/RadiusSum.h          |   11 +-
 .../Algorithms/inc/MantidAlgorithms/Rebin.h   |    4 +-
 .../ReflectometryBackgroundSubtraction.h      |    4 +-
 .../ReflectometryBeamStatistics.h             |    6 +-
 .../ReflectometryReductionOne2.h              |   30 +-
 .../ReflectometryReductionOneAuto2.h          |   21 +-
 .../ReflectometryReductionOneAuto3.h          |   18 +-
 .../ReflectometryWorkflowBase.h               |   17 +-
 .../ReflectometryWorkflowBase2.h              |   43 +-
 .../inc/MantidAlgorithms/ResetNegatives.h     |    9 +-
 .../inc/MantidAlgorithms/RingProfile.h        |   11 +-
 .../RunCombinationHelper.h                    |    4 +-
 .../SampleLogsBehaviour.h                     |   15 +-
 .../SANSCollimationLengthEstimator.h          |    5 +-
 .../SampleCorrections/MCAbsorptionStrategy.h  |    3 +-
 .../inc/MantidAlgorithms/SmoothNeighbours.h   |    2 +-
 .../inc/MantidAlgorithms/SofQWPolygon.h       |    2 +-
 .../inc/MantidAlgorithms/SortXAxis.h          |    2 +-
 .../SpecularReflectionAlgorithm.h             |    6 +-
 .../SpecularReflectionPositionCorrect.h       |   10 +-
 .../inc/MantidAlgorithms/Stitch1D.h           |    2 +-
 .../inc/MantidAlgorithms/StripPeaks.h         |    7 +-
 .../MantidAlgorithms/SumEventsByLogValue.h    |    2 +-
 .../inc/MantidAlgorithms/SumSpectra.h         |    9 +-
 .../TOFSANSResolutionByPixel.h                |    8 +-
 .../TimeAtSampleStrategyDirect.h              |    3 +-
 .../inc/MantidAlgorithms/Transpose.h          |    5 +-
 .../inc/MantidAlgorithms/WienerSmooth.h       |    2 +-
 .../inc/MantidAlgorithms/XDataConverter.h     |    6 +-
 Framework/Algorithms/src/AddSampleLog.cpp     |    8 +-
 Framework/Algorithms/src/AlignDetectors.cpp   |   13 +-
 .../Algorithms/src/Bin2DPowderDiffraction.cpp |    3 +-
 Framework/Algorithms/src/BinaryOperation.cpp  |    5 +-
 .../CalculateCarpenterSampleCorrection.cpp    |    6 +-
 .../Algorithms/src/CalculateDynamicRange.cpp  |    6 +-
 .../Algorithms/src/CalculateEfficiency.cpp    |   17 +-
 Framework/Algorithms/src/CalculateIqt.cpp     |   35 +-
 .../src/CalculatePlaczekSelfScattering.cpp    |    2 +-
 .../Algorithms/src/CalculateTransmission.cpp  |   24 +-
 .../src/CalculateTransmissionBeamSpreader.cpp |   13 +-
 .../src/CarpenterSampleCorrection.cpp         |    8 +-
 Framework/Algorithms/src/ChangeTimeZero.cpp   |   27 +-
 .../Algorithms/src/CompareWorkspaces.cpp      |   35 +-
 Framework/Algorithms/src/ConjoinXRuns.cpp     |    5 +-
 Framework/Algorithms/src/ConvertDiffCal.cpp   |    9 +-
 .../Algorithms/src/ConvertEmptyToTof.cpp      |    2 +-
 .../Algorithms/src/ConvertSpectrumAxis.cpp    |    2 +-
 .../Algorithms/src/ConvertToConstantL2.cpp    |    4 +-
 Framework/Algorithms/src/ConvertUnits.cpp     |   18 +-
 Framework/Algorithms/src/CopyDataRange.cpp    |   20 +-
 Framework/Algorithms/src/CorrectKiKf.cpp      |    2 +-
 Framework/Algorithms/src/CorrectTOFAxis.cpp   |    8 +-
 Framework/Algorithms/src/CorrectToFile.cpp    |    4 +-
 Framework/Algorithms/src/CreateEPP.cpp        |    2 +-
 .../Algorithms/src/CreateFloodWorkspace.cpp   |    6 +-
 .../src/CreateGroupingWorkspace.cpp           |   14 +-
 .../src/CreateLogTimeCorrection.cpp           |    2 +-
 .../Algorithms/src/CreatePSDBleedMask.cpp     |    4 +-
 .../Algorithms/src/CreateSampleWorkspace.cpp  |    9 +-
 .../src/CreateTransmissionWorkspace.cpp       |    8 +-
 .../src/CreateTransmissionWorkspace2.cpp      |    6 +-
 .../src/CreateTransmissionWorkspaceAuto.cpp   |    2 +-
 .../Algorithms/src/DetectorDiagnostic.cpp     |   14 +-
 .../src/DetectorEfficiencyVariation.cpp       |    4 +-
 .../DiffractionEventCalibrateDetectors.cpp    |    7 +-
 .../Algorithms/src/DiffractionFocussing.cpp   |    2 +-
 .../Algorithms/src/EQSANSTofStructure.cpp     |    7 +-
 .../Algorithms/src/ExportTimeSeriesLog.cpp    |    2 +-
 .../Algorithms/src/ExtractMaskToTable.cpp     |    8 +-
 Framework/Algorithms/src/FindPeaks.cpp        |    4 +-
 Framework/Algorithms/src/FitPeak.cpp          |   64 +-
 Framework/Algorithms/src/FitPeaks.cpp         |   76 +-
 .../Algorithms/src/GenerateEventsFilter.cpp   |   20 +-
 Framework/Algorithms/src/GeneratePeaks.cpp    |   14 +-
 .../src/GetDetOffsetsMultiPeaks.cpp           |    6 +-
 Framework/Algorithms/src/GetEi.cpp            |   10 +-
 Framework/Algorithms/src/GetEi2.cpp           |   15 +-
 Framework/Algorithms/src/GetQsInQENSData.cpp  |    2 +-
 .../src/GetTimeSeriesLogInformation.cpp       |    2 +-
 .../Algorithms/src/He3TubeEfficiency.cpp      |    4 +-
 Framework/Algorithms/src/IQTransform.cpp      |   30 +-
 .../Algorithms/src/IdentifyNoisyDetectors.cpp |    4 +-
 .../Algorithms/src/IntegrateByComponent.cpp   |    7 +-
 Framework/Algorithms/src/Integration.cpp      |    6 +-
 .../Algorithms/src/InterpolatingRebin.cpp     |    4 +-
 .../Algorithms/src/MaskBinsFromTable.cpp      |    9 +-
 Framework/Algorithms/src/MaxEnt.cpp           |    2 +-
 .../src/MaxEnt/MaxentCalculator.cpp           |    3 +-
 .../src/MaxEnt/MaxentTransformFourier.cpp     |    4 +-
 .../MaxEnt/MaxentTransformMultiFourier.cpp    |    8 +-
 .../Algorithms/src/MedianDetectorTest.cpp     |    9 +-
 Framework/Algorithms/src/Minus.cpp            |    4 +-
 .../Algorithms/src/NormaliseByCurrent.cpp     |    2 +-
 .../Algorithms/src/NormaliseByDetector.cpp    |   11 +-
 .../Algorithms/src/NormaliseToMonitor.cpp     |    2 +-
 Framework/Algorithms/src/PDCalibration.cpp    |   11 +-
 .../Algorithms/src/PaddingAndApodization.cpp  |    2 +-
 .../Algorithms/src/ParallaxCorrection.cpp     |    7 +-
 .../Algorithms/src/PerformIndexOperations.cpp |    3 +-
 Framework/Algorithms/src/Plus.cpp             |    4 +-
 .../src/PolarizationCorrectionFredrikze.cpp   |    4 +-
 .../src/PolarizationCorrectionWildes.cpp      |    4 +-
 .../src/PolarizationEfficiencyCor.cpp         |    4 +-
 Framework/Algorithms/src/Q1D2.cpp             |   15 +-
 Framework/Algorithms/src/Q1DWeighted.cpp      |    8 +-
 Framework/Algorithms/src/Qhelper.cpp          |   26 +-
 Framework/Algorithms/src/Qxy.cpp              |    4 +-
 Framework/Algorithms/src/RadiusSum.cpp        |   12 +-
 Framework/Algorithms/src/Rebin.cpp            |    5 +-
 .../ReflectometryBackgroundSubtraction.cpp    |    5 +-
 .../src/ReflectometryBeamStatistics.cpp       |    4 +-
 .../src/ReflectometryReductionOne2.cpp        |   42 +-
 .../src/ReflectometryReductionOneAuto2.cpp    |   23 +-
 .../src/ReflectometryReductionOneAuto3.cpp    |   18 +-
 .../src/ReflectometryWorkflowBase.cpp         |   22 +-
 .../src/ReflectometryWorkflowBase2.cpp        |   53 +-
 .../Algorithms/src/RemovePromptPulse.cpp      |    3 +-
 Framework/Algorithms/src/ResampleX.cpp        |    4 +-
 Framework/Algorithms/src/ResetNegatives.cpp   |    9 +-
 Framework/Algorithms/src/RingProfile.cpp      |   12 +-
 .../RunCombinationHelper.cpp                  |    5 +-
 .../SampleLogsBehaviour.cpp                   |   15 +-
 .../src/SANSCollimationLengthEstimator.cpp    |    6 +-
 .../MCAbsorptionStrategy.cpp                  |    2 +-
 Framework/Algorithms/src/SmoothNeighbours.cpp |    2 +-
 Framework/Algorithms/src/SofQWPolygon.cpp     |    3 +-
 Framework/Algorithms/src/SortXAxis.cpp        |    2 +-
 .../src/SpecularReflectionAlgorithm.cpp       |    4 +-
 .../src/SpecularReflectionPositionCorrect.cpp |    9 +-
 Framework/Algorithms/src/Stitch1D.cpp         |    2 +-
 Framework/Algorithms/src/StripPeaks.cpp       |    7 +-
 .../Algorithms/src/SumEventsByLogValue.cpp    |    6 +-
 Framework/Algorithms/src/SumSpectra.cpp       |    8 +-
 .../src/TOFSANSResolutionByPixel.cpp          |    6 +-
 .../src/TimeAtSampleStrategyDirect.cpp        |    2 +-
 .../src/TimeAtSampleStrategyElastic.cpp       |    6 +-
 .../src/TimeAtSampleStrategyIndirect.cpp      |    3 +-
 Framework/Algorithms/src/Transpose.cpp        |    6 +-
 Framework/Algorithms/src/WienerSmooth.cpp     |    3 +-
 .../src/WorkflowAlgorithmRunner.cpp           |    3 +-
 Framework/Algorithms/src/XDataConverter.cpp   |    6 +-
 Framework/Algorithms/test/AddNoteTest.h       |    8 +-
 Framework/Algorithms/test/AddSampleLogTest.h  |   11 +-
 .../Algorithms/test/AddTimeSeriesLogTest.h    |    4 +-
 Framework/Algorithms/test/AppendSpectraTest.h |    4 +-
 .../Algorithms/test/ApplyFloodWorkspaceTest.h |    6 +-
 .../test/Bin2DPowderDiffractionTest.h         |    2 +-
 .../Algorithms/test/BinaryOperationTest.h     |   12 +-
 Framework/Algorithms/test/CalculateDIFCTest.h |    4 +-
 .../test/CalculateFlatBackgroundTest.h        |    3 +-
 Framework/Algorithms/test/CalculateIqtTest.h  |    4 +-
 .../Algorithms/test/ChainedOperatorTest.h     |   16 +-
 Framework/Algorithms/test/ChangeLogTimeTest.h |    2 +-
 .../Algorithms/test/ChangePulsetime2Test.h    |    9 +-
 .../Algorithms/test/ChangePulsetimeTest.h     |    9 +-
 .../Algorithms/test/ChangeTimeZeroTest.h      |   35 +-
 .../test/CheckWorkspacesMatchTest.h           |    2 +-
 Framework/Algorithms/test/ClearCacheTest.h    |    2 +-
 .../test/ClearInstrumentParametersTest.h      |    8 +-
 .../test/CommutativeBinaryOperationTest.h     |    4 +-
 .../Algorithms/test/CompareWorkspacesTest.h   |    2 +-
 .../Algorithms/test/ConjoinWorkspacesTest.h   |    2 +-
 .../test/ConvertAxesToRealSpaceTest.h         |    8 +-
 .../test/ConvertAxisByFormulaTest.h           |    5 +-
 .../test/ConvertSpectrumAxis2Test.h           |   15 +-
 .../Algorithms/test/ConvertSpectrumAxisTest.h |    4 +-
 .../Algorithms/test/ConvertToConstantL2Test.h |    4 +-
 .../Algorithms/test/ConvertToHistogramTest.h  |    2 +-
 .../Algorithms/test/ConvertToPointDataTest.h  |    2 +-
 Framework/Algorithms/test/ConvertUnitsTest.h  |    2 +-
 Framework/Algorithms/test/CopyDataRangeTest.h |   14 +-
 Framework/Algorithms/test/CopyLogsTest.h      |    6 +-
 .../Algorithms/test/CorrectTOFAxisTest.h      |    8 +-
 Framework/Algorithms/test/CorrectToFileTest.h |    2 +-
 .../test/CreateGroupingWorkspaceTest.h        |    2 +-
 .../test/CreateLogPropertyTableTest.h         |    2 +-
 .../test/CreateSampleWorkspaceTest.h          |    7 +-
 .../test/CreateTransmissionWorkspace2Test.h   |    2 +-
 .../test/CreateUserDefinedBackgroundTest.h    |    4 +-
 .../Algorithms/test/CropToComponentTest.h     |    2 +-
 Framework/Algorithms/test/CropWorkspaceTest.h |    2 +-
 .../Algorithms/test/CrossCorrelateTest.h      |    2 +-
 .../Algorithms/test/CylinderAbsorptionTest.h  |    6 +-
 .../Algorithms/test/DeleteWorkspacesTest.h    |    2 +-
 .../test/EditInstrumentGeometryTest.h         |    6 +-
 Framework/Algorithms/test/ElasticWindowTest.h |    4 +-
 Framework/Algorithms/test/ExponentialTest.h   |    6 +-
 Framework/Algorithms/test/ExtractMaskTest.h   |    4 +-
 .../test/ExtractSingleSpectrumTest.h          |    6 +-
 .../Algorithms/test/ExtractSpectraTest.h      |    2 +-
 .../test/ExtractUnmaskedSpectraTest.h         |    6 +-
 Framework/Algorithms/test/FFTSmooth2Test.h    |    5 +-
 Framework/Algorithms/test/FFTTest.h           |   12 +-
 .../Algorithms/test/FilterByLogValueTest.h    |    2 +-
 Framework/Algorithms/test/FilterEventsTest.h  |    3 +-
 Framework/Algorithms/test/FindEPPTest.h       |    2 +-
 Framework/Algorithms/test/FindPeaksTest.h     |    2 +-
 .../test/FixGSASInstrumentFileTest.h          |    2 +-
 .../test/GenerateEventsFilterTest.h           |    2 +-
 .../test/GetDetOffsetsMultiPeaksTest.h        |    2 +-
 Framework/Algorithms/test/GetEiMonDet3Test.h  |   11 +-
 .../Algorithms/test/He3TubeEfficiencyTest.h   |    4 +-
 .../test/IndirectFitDataCreationHelperTest.h  |    2 +-
 .../test/IntegrateByComponentTest.h           |    2 +-
 Framework/Algorithms/test/IntegrationTest.h   |   32 +-
 Framework/Algorithms/test/LineProfileTest.h   |    6 +-
 .../Algorithms/test/MCInteractionVolumeTest.h |    3 +-
 .../test/MagFormFactorCorrectionTest.h        |    7 +-
 Framework/Algorithms/test/MergeLogsTest.h     |    4 +-
 Framework/Algorithms/test/MergeRunsTest.h     |   21 +-
 .../test/ModeratorTzeroLinearTest.h           |    2 +-
 .../test/MonteCarloAbsorptionTest.h           |    9 +-
 .../Algorithms/test/NormaliseByCurrentTest.h  |   20 +-
 .../Algorithms/test/NormaliseByDetectorTest.h |   18 +-
 .../test/PDDetermineCharacterizationsTest.h   |    8 +-
 .../Algorithms/test/PDFFourierTransformTest.h |    2 +-
 .../Algorithms/test/ParallaxCorrectionTest.h  |    2 +-
 .../test/PerformIndexOperationsTest.h         |    2 +-
 Framework/Algorithms/test/PoissonErrorsTest.h |   21 +-
 .../PolarizationCorrectionFredrikzeTest.h     |    5 +-
 Framework/Algorithms/test/Rebin2DTest.h       |    8 +-
 .../test/ReflectometryMomentumTransferTest.h  |    2 +-
 .../test/ReflectometryReductionOne2Test.h     |   22 +-
 .../test/ReflectometryReductionOneAuto2Test.h |    5 +-
 .../test/ReflectometryReductionOneAuto3Test.h |    5 +-
 .../Algorithms/test/ReflectometrySumInQTest.h |    4 +-
 .../Algorithms/test/RemoveLowResTOFTest.h     |    2 +-
 .../Algorithms/test/RemoveMaskedSpectraTest.h |    6 +-
 .../Algorithms/test/RemovePromptPulseTest.h   |    2 +-
 .../test/RemoveWorkspaceHistoryTest.h         |    2 +-
 .../test/ReplaceSpecialValuesTest.h           |    5 +-
 Framework/Algorithms/test/RingProfileTest.h   |    5 +-
 .../test/RunCombinationHelperTest.h           |    2 +-
 .../test/SANSCollimationLengthEstimatorTest.h |   16 +-
 .../Algorithms/test/SampleLogsBehaviourTest.h |    2 +-
 Framework/Algorithms/test/ScaleTest.h         |    2 +-
 .../test/SetInstrumentParameterTest.h         |    8 +-
 Framework/Algorithms/test/ShiftLogTimeTest.h  |    2 +-
 .../Algorithms/test/SmoothNeighboursTest.h    |    6 +-
 Framework/Algorithms/test/SofQCommonTest.h    |    2 +-
 .../test/SofQWNormalisedPolygonTest.h         |    9 +-
 .../test/SpecularReflectionAlgorithmTest.h    |    3 +-
 .../SpecularReflectionPositionCorrectTest.h   |   13 +-
 Framework/Algorithms/test/Stitch1DManyTest.h  |    7 +-
 .../Algorithms/test/SumOverlappingTubesTest.h |    8 +-
 Framework/Algorithms/test/SumSpectraTest.h    |    4 +-
 .../test/TOFSANSResolutionByPixelTest.h       |   15 +-
 Framework/Algorithms/test/UnwrapMonitorTest.h |    2 +-
 Framework/Algorithms/test/UnwrapSNSTest.h     |    2 +-
 .../test/VesuvioL1ThetaResolutionTest.h       |    4 +-
 Framework/Algorithms/test/WienerSmoothTest.h  |    2 +-
 .../Algorithms/test/WorkspaceGroupTest.h      |   20 +-
 .../inc/MantidCrystal/AnvredCorrection.h      |    6 +-
 .../Crystal/inc/MantidCrystal/CentroidPeaks.h |    2 +-
 .../ConnectedComponentLabeling.h              |    7 +-
 .../Crystal/inc/MantidCrystal/FindSXPeaks.h   |    2 +-
 .../MantidCrystal/IntegratePeakTimeSlices.h   |    4 +-
 .../Crystal/inc/MantidCrystal/LoadIsawPeaks.h |   18 +-
 .../inc/MantidCrystal/MaskPeaksWorkspace.h    |    6 +-
 .../Crystal/inc/MantidCrystal/PeakHKLErrors.h |   16 +-
 .../inc/MantidCrystal/PeakIntegration.h       |    5 +-
 .../inc/MantidCrystal/SCDCalibratePanels.h    |   13 +-
 .../inc/MantidCrystal/SCDPanelErrors.h        |    3 +-
 Framework/Crystal/inc/MantidCrystal/SaveHKL.h |    2 +-
 .../Crystal/inc/MantidCrystal/SaveIsawPeaks.h |    8 +-
 .../Crystal/inc/MantidCrystal/SaveLauenorm.h  |    2 +-
 .../inc/MantidCrystal/SetSpecialCoordinates.h |    6 +-
 Framework/Crystal/inc/MantidCrystal/SortHKL.h |    3 +-
 .../StatisticsOfPeaksWorkspace.h              |    3 +-
 Framework/Crystal/src/AnvredCorrection.cpp    |    5 +-
 Framework/Crystal/src/CentroidPeaks.cpp       |    2 +-
 .../src/ConnectedComponentLabeling.cpp        |    9 +-
 Framework/Crystal/src/FindClusterFaces.cpp    |    2 +-
 Framework/Crystal/src/FindSXPeaks.cpp         |    4 +-
 .../Crystal/src/IntegratePeakTimeSlices.cpp   |   10 +-
 Framework/Crystal/src/LoadIsawPeaks.cpp       |   27 +-
 Framework/Crystal/src/MaskPeaksWorkspace.cpp  |   10 +-
 Framework/Crystal/src/PeakBackground.cpp      |    6 +-
 Framework/Crystal/src/PeakHKLErrors.cpp       |    8 +-
 Framework/Crystal/src/PeakIntegration.cpp     |    4 +-
 Framework/Crystal/src/SCDCalibratePanels.cpp  |   22 +-
 Framework/Crystal/src/SCDPanelErrors.cpp      |    5 +-
 Framework/Crystal/src/SaveHKL.cpp             |    2 +-
 Framework/Crystal/src/SaveIsawPeaks.cpp       |    8 +-
 Framework/Crystal/src/SaveLauenorm.cpp        |    3 +-
 .../Crystal/src/SetSpecialCoordinates.cpp     |    6 +-
 Framework/Crystal/src/SortHKL.cpp             |    3 +-
 .../src/StatisticsOfPeaksWorkspace.cpp        |    4 +-
 Framework/Crystal/test/AnvredCorrectionTest.h |    2 +-
 Framework/Crystal/test/CalculateUMatrixTest.h |    2 +-
 .../Crystal/test/ClusterIntegrationBaseTest.h |    6 +-
 Framework/Crystal/test/FilterPeaksTest.h      |    2 +-
 Framework/Crystal/test/FindClusterFacesTest.h |    2 +-
 Framework/Crystal/test/FindSXPeaksTest.h      |    7 +-
 Framework/Crystal/test/IndexPeaksTest.h       |    2 +-
 Framework/Crystal/test/IndexSXPeaksTest.h     |    4 +-
 .../test/IntegratePeakTimeSlicesTest.h        |    2 +-
 .../Crystal/test/PeakClusterProjectionTest.h  |    2 +-
 .../Crystal/test/PeakIntensityVsRadiusTest.h  |    4 +-
 Framework/Crystal/test/PeaksInRegionTest.h    |    4 +-
 Framework/Crystal/test/PeaksOnSurfaceTest.h   |    2 +-
 Framework/Crystal/test/PredictPeaksTest.h     |   14 +-
 Framework/Crystal/test/SetGoniometerTest.h    |    2 +-
 .../Crystal/test/SortPeaksWorkspaceTest.h     |    3 +-
 .../Algorithms/FitPowderDiffPeaks.h           |  134 +-
 .../MantidCurveFitting/Algorithms/LeBailFit.h |   23 +-
 .../Algorithms/LeBailFunction.h               |   25 +-
 .../Algorithms/PlotPeakByLogValue.h           |    6 +-
 .../Algorithms/PlotPeakByLogValueHelper.h     |    2 +-
 .../Algorithms/QENSFitSequential.h            |   26 +-
 .../Algorithms/QENSFitSimultaneous.h          |   22 +-
 .../Algorithms/QENSFitUtilities.h             |    2 +-
 .../RefinePowderInstrumentParameters.h        |   31 +-
 .../RefinePowderInstrumentParameters3.h       |   40 +-
 .../Algorithms/SplineBackground.h             |    4 +-
 .../Algorithms/SplineInterpolation.h          |   30 +-
 .../Algorithms/SplineSmoothing.h              |    3 +-
 .../Constraints/BoundaryConstraint.h          |    4 +-
 .../CostFunctions/CostFuncRwp.h               |    4 +-
 .../Functions/ChebfunBase.h                   |    2 +-
 .../Functions/IkedaCarpenterPV.h              |    2 +-
 .../Functions/PawleyFunction.h                |    2 +-
 .../Functions/ProcessBackground.h             |   19 +-
 .../Functions/SimpleChebfun.h                 |    6 +-
 .../Functions/ThermalNeutronDtoTOFFunction.h  |    2 +-
 .../inc/MantidCurveFitting/GSLFunctions.h     |    2 +-
 .../inc/MantidCurveFitting/IMWDomainCreator.h |    5 +-
 .../inc/MantidCurveFitting/SeqDomain.h        |    2 +-
 .../SeqDomainSpectrumCreator.h                |    2 +-
 .../TableWorkspaceDomainCreator.h             |   11 +-
 .../src/Algorithms/ConvolutionFit.cpp         |   20 +-
 .../src/Algorithms/EstimatePeakErrors.cpp     |    2 +-
 .../src/Algorithms/FitPowderDiffPeaks.cpp     |  115 +-
 .../CurveFitting/src/Algorithms/IqtFit.cpp    |    8 +-
 .../CurveFitting/src/Algorithms/LeBailFit.cpp |   17 +-
 .../src/Algorithms/LeBailFunction.cpp         |   34 +-
 .../src/Algorithms/PlotPeakByLogValue.cpp     |    4 +-
 .../Algorithms/PlotPeakByLogValueHelper.cpp   |    4 +-
 .../src/Algorithms/QENSFitSequential.cpp      |   94 +-
 .../src/Algorithms/QENSFitSimultaneous.cpp    |   55 +-
 .../src/Algorithms/QENSFitUtilities.cpp       |   13 +-
 .../RefinePowderInstrumentParameters.cpp      |   24 +-
 .../RefinePowderInstrumentParameters3.cpp     |   48 +-
 .../src/Algorithms/SplineBackground.cpp       |    2 +-
 .../src/Algorithms/SplineInterpolation.cpp    |   26 +-
 .../src/Algorithms/SplineSmoothing.cpp        |    2 +-
 .../src/Constraints/BoundaryConstraint.cpp    |    4 +-
 .../src/CostFunctions/CostFuncFitting.cpp     |    7 +-
 .../src/CostFunctions/CostFuncRwp.cpp         |    4 +-
 .../src/FunctionDomain1DSpectrumCreator.cpp   |    4 +-
 .../src/Functions/ChebfunBase.cpp             |    7 +-
 .../src/Functions/CrystalFieldFunction.cpp    |    3 +-
 .../Functions/CrystalFieldMagnetisation.cpp   |    2 +-
 .../src/Functions/CrystalFieldMoment.cpp      |    2 +-
 .../src/Functions/IkedaCarpenterPV.cpp        |    2 +-
 .../src/Functions/PawleyFunction.cpp          |    3 +-
 .../src/Functions/ProcessBackground.cpp       |   27 +-
 .../src/Functions/SimpleChebfun.cpp           |   11 +-
 .../src/Functions/TabulatedFunction.cpp       |    3 +-
 .../ThermalNeutronDtoTOFFunction.cpp          |    2 +-
 Framework/CurveFitting/src/GSLFunctions.cpp   |    2 +-
 .../CurveFitting/src/IMWDomainCreator.cpp     |    2 +-
 Framework/CurveFitting/src/SeqDomain.cpp      |    2 +-
 .../src/SeqDomainSpectrumCreator.cpp          |    2 +-
 .../src/TableWorkspaceDomainCreator.cpp       |    6 +-
 .../Algorithms/ConvolutionFitSequentialTest.h |    5 +-
 .../test/Algorithms/FitPowderDiffPeaksTest.h  |    7 +-
 .../test/Algorithms/FitTestHelpers.h          |    4 +-
 .../test/Algorithms/LeBailFitTest.h           |    5 +-
 .../test/Algorithms/LeBailFunctionTest.h      |    3 +-
 .../test/Algorithms/PlotPeakByLogValueTest.h  |    5 +-
 .../test/Algorithms/QENSFitSequentialTest.h   |    6 +-
 .../test/Algorithms/QENSFitSimultaneousTest.h |   16 +-
 .../RefinePowderInstrumentParameters3Test.h   |    2 +-
 .../RefinePowderInstrumentParametersTest.h    |   10 +-
 Framework/CurveFitting/test/FitMWTest.h       |    4 +-
 .../test/FuncMinimizers/FABADAMinimizerTest.h |    2 +-
 .../FuncMinimizers/LevenbergMarquardtMDTest.h |    3 +-
 .../test/Functions/ChebfunBaseTest.h          |   18 +-
 .../test/Functions/ProcessBackgroundTest.h    |   10 +-
 .../test/Functions/SimpleChebfunTest.h        |    4 +-
 .../test/HistogramDomainCreatorTest.h         |    5 +-
 .../test/MultiDomainCreatorTest.h             |    2 +-
 .../test/TableWorkspaceDomainCreatorTest.h    |    4 +-
 .../AppendGeometryToSNSNexus.h                |    4 +-
 .../inc/MantidDataHandling/BankPulseTimes.h   |    2 +-
 .../CreateSimulationWorkspace.h               |    2 +-
 .../MantidDataHandling/DataBlockComposite.h   |    2 +-
 .../MantidDataHandling/DetermineChunking.h    |    2 +-
 .../EventWorkspaceCollection.h                |    7 +-
 .../FilterEventsByLogValuePreNexus.h          |    8 +-
 .../inc/MantidDataHandling/GroupDetectors2.h  |   29 +-
 .../JoinISISPolarizationEfficiencies.h        |    4 +-
 .../inc/MantidDataHandling/Load.h             |    3 +-
 .../inc/MantidDataHandling/LoadAsciiStl.h     |    8 +-
 .../inc/MantidDataHandling/LoadBinaryStl.h    |   11 +-
 .../inc/MantidDataHandling/LoadCalFile.h      |   11 +-
 .../inc/MantidDataHandling/LoadCanSAS1D.h     |   13 +-
 .../inc/MantidDataHandling/LoadDaveGrp.h      |    4 +-
 .../LoadDetectorsGroupingFile.h               |    4 +-
 .../inc/MantidDataHandling/LoadDspacemap.h    |    6 +-
 .../inc/MantidDataHandling/LoadEventNexus.h   |    6 +-
 .../LoadEventNexusIndexSetup.h                |    2 +-
 .../MantidDataHandling/LoadEventPreNexus2.h   |    6 +-
 .../inc/MantidDataHandling/LoadFITS.h         |    9 +-
 .../LoadFullprofResolution.h                  |   22 +-
 .../LoadGSASInstrumentFile.h                  |    2 +-
 .../inc/MantidDataHandling/LoadGSS.h          |    2 +-
 .../inc/MantidDataHandling/LoadHelper.h       |   11 +-
 .../inc/MantidDataHandling/LoadIDFFromNexus.h |    4 +-
 .../MantidDataHandling/LoadILLDiffraction.h   |    5 +-
 .../inc/MantidDataHandling/LoadILLIndirect2.h |    2 +-
 .../inc/MantidDataHandling/LoadISISNexus2.h   |    2 +-
 .../inc/MantidDataHandling/LoadInstrument.h   |    6 +-
 .../inc/MantidDataHandling/LoadIsawDetCal.h   |    6 +-
 .../inc/MantidDataHandling/LoadLog.h          |    2 +-
 .../inc/MantidDataHandling/LoadMuonNexus.h    |    2 +-
 .../inc/MantidDataHandling/LoadMuonNexus1.h   |   12 +-
 .../inc/MantidDataHandling/LoadMuonNexus2.h   |    6 +-
 .../inc/MantidDataHandling/LoadNexusLogs.h    |   24 +-
 .../MantidDataHandling/LoadNexusMonitors2.h   |    4 +-
 .../MantidDataHandling/LoadNexusProcessed.h   |   14 +-
 .../inc/MantidDataHandling/LoadOff.h          |    2 +-
 .../inc/MantidDataHandling/LoadPDFgetNFile.h  |    4 +-
 .../inc/MantidDataHandling/LoadPSIMuonBin.h   |    3 +-
 .../MantidDataHandling/LoadPreNexusMonitors.h |    2 +-
 .../inc/MantidDataHandling/LoadRKH.h          |    2 +-
 .../inc/MantidDataHandling/LoadRaw3.h         |    8 +-
 .../inc/MantidDataHandling/LoadRawHelper.h    |   38 +-
 .../inc/MantidDataHandling/LoadSPE.h          |    2 +-
 .../inc/MantidDataHandling/LoadSampleShape.h  |    2 +-
 .../inc/MantidDataHandling/LoadSassena.h      |   19 +-
 .../inc/MantidDataHandling/LoadSpice2D.h      |    2 +-
 .../inc/MantidDataHandling/LoadSpiceAscii.h   |    6 +-
 .../MantidDataHandling/LoadSpiceXML2DDet.h    |   15 +-
 .../inc/MantidDataHandling/LoadStl.h          |   11 +-
 .../inc/MantidDataHandling/LoadStlFactory.h   |    2 +-
 .../inc/MantidDataHandling/LoadTBL.h          |    6 +-
 .../inc/MantidDataHandling/LoadTOFRawNexus.h  |    3 +-
 .../inc/MantidDataHandling/MaskDetectors.h    |   35 +-
 .../MantidDataHandling/MaskDetectorsInShape.h |    9 +-
 .../inc/MantidDataHandling/MeshFileIO.h       |    9 +-
 .../PDLoadCharacterizations.h                 |    2 +-
 .../inc/MantidDataHandling/ReadMaterial.h     |    2 +-
 .../SampleEnvironmentSpecParser.h             |    4 +-
 .../inc/MantidDataHandling/SaveAscii2.h       |    2 +-
 .../inc/MantidDataHandling/SaveCSV.h          |    2 +-
 .../inc/MantidDataHandling/SaveCalFile.h      |    6 +-
 .../SaveDetectorsGrouping.h                   |    4 +-
 .../inc/MantidDataHandling/SaveDiffCal.h      |    5 +-
 .../MantidDataHandling/SaveDiffFittingAscii.h |    6 +-
 .../inc/MantidDataHandling/SaveDspacemap.h    |    6 +-
 .../inc/MantidDataHandling/SaveFITS.h         |    8 +-
 .../SaveFullprofResolution.h                  |    2 +-
 .../SaveGSASInstrumentFile.h                  |    4 +-
 .../inc/MantidDataHandling/SaveIsawDetCal.h   |    6 +-
 .../inc/MantidDataHandling/SaveNXTomo.h       |    8 +-
 .../MantidDataHandling/SaveNexusProcessed.h   |    7 +-
 .../inc/MantidDataHandling/SavePDFGui.h       |    5 +-
 .../inc/MantidDataHandling/SaveRMCProfile.h   |    5 +-
 .../SaveReflectometryAscii.h                  |   10 +-
 .../inc/MantidDataHandling/SaveSPE.h          |    4 +-
 .../inc/MantidDataHandling/SaveStl.h          |    9 +-
 .../inc/MantidDataHandling/SaveTBL.h          |    2 +-
 .../SaveToSNSHistogramNexus.h                 |    7 +-
 .../inc/MantidDataHandling/SetScalingPSD.h    |    3 +-
 .../inc/MantidDataHandling/XmlHandler.h       |    2 +-
 .../src/AppendGeometryToSNSNexus.cpp          |    8 +-
 Framework/DataHandling/src/BankPulseTimes.cpp |    3 +-
 .../src/CreateChunkingFromInstrument.cpp      |    5 +-
 .../src/CreateSimulationWorkspace.cpp         |    6 +-
 .../DataHandling/src/DataBlockComposite.cpp   |    2 +-
 .../DataHandling/src/DetermineChunking.cpp    |    2 +-
 .../src/EventWorkspaceCollection.cpp          |    6 +-
 .../src/FilterEventsByLogValuePreNexus.cpp    |   11 +-
 .../DataHandling/src/GroupDetectors2.cpp      |   42 +-
 .../src/JoinISISPolarizationEfficiencies.cpp  |    4 +-
 Framework/DataHandling/src/Load.cpp           |    6 +-
 Framework/DataHandling/src/LoadAsciiStl.cpp   |    2 +-
 Framework/DataHandling/src/LoadBBY.cpp        |    2 +-
 Framework/DataHandling/src/LoadBinaryStl.cpp  |    2 +-
 Framework/DataHandling/src/LoadCalFile.cpp    |    8 +-
 Framework/DataHandling/src/LoadCanSAS1D.cpp   |   15 +-
 Framework/DataHandling/src/LoadDaveGrp.cpp    |    4 +-
 .../src/LoadDetectorsGroupingFile.cpp         |    7 +-
 Framework/DataHandling/src/LoadDiffCal.cpp    |    6 +-
 Framework/DataHandling/src/LoadDspacemap.cpp  |    6 +-
 Framework/DataHandling/src/LoadEMU.cpp        |    2 +-
 Framework/DataHandling/src/LoadEventNexus.cpp |    6 +-
 .../src/LoadEventNexusIndexSetup.cpp          |   10 +-
 .../DataHandling/src/LoadEventPreNexus2.cpp   |    7 +-
 Framework/DataHandling/src/LoadFITS.cpp       |   10 +-
 .../src/LoadFullprofResolution.cpp            |   23 +-
 .../src/LoadGSASInstrumentFile.cpp            |    3 +-
 Framework/DataHandling/src/LoadGSS.cpp        |    2 +-
 Framework/DataHandling/src/LoadHelper.cpp     |   10 +-
 .../DataHandling/src/LoadIDFFromNexus.cpp     |    4 +-
 .../DataHandling/src/LoadILLIndirect2.cpp     |    2 +-
 Framework/DataHandling/src/LoadISISNexus2.cpp |    2 +-
 Framework/DataHandling/src/LoadInstrument.cpp |    8 +-
 Framework/DataHandling/src/LoadIsawDetCal.cpp |   12 +-
 Framework/DataHandling/src/LoadLog.cpp        |    8 +-
 Framework/DataHandling/src/LoadMuonNexus.cpp  |    2 +-
 Framework/DataHandling/src/LoadMuonNexus1.cpp |   26 +-
 Framework/DataHandling/src/LoadMuonNexus2.cpp |    6 +-
 Framework/DataHandling/src/LoadNXcanSAS.cpp   |   28 +-
 Framework/DataHandling/src/LoadNexusLogs.cpp  |   10 +-
 .../DataHandling/src/LoadNexusMonitors2.cpp   |    7 +-
 .../DataHandling/src/LoadNexusProcessed.cpp   |   43 +-
 Framework/DataHandling/src/LoadOff.cpp        |    2 +-
 .../DataHandling/src/LoadPDFgetNFile.cpp      |    4 +-
 Framework/DataHandling/src/LoadPSIMuonBin.cpp |    4 +-
 .../DataHandling/src/LoadPreNexusMonitors.cpp |    2 +-
 Framework/DataHandling/src/LoadRKH.cpp        |    2 +-
 Framework/DataHandling/src/LoadRaw3.cpp       |    8 +-
 Framework/DataHandling/src/LoadRawHelper.cpp  |   55 +-
 Framework/DataHandling/src/LoadSPE.cpp        |    3 +-
 .../DataHandling/src/LoadSampleShape.cpp      |    2 +-
 Framework/DataHandling/src/LoadSassena.cpp    |   30 +-
 Framework/DataHandling/src/LoadSpice2D.cpp    |    7 +-
 Framework/DataHandling/src/LoadSpiceAscii.cpp |    4 +-
 .../DataHandling/src/LoadSpiceXML2DDet.cpp    |   11 +-
 Framework/DataHandling/src/LoadTBL.cpp        |    6 +-
 .../DataHandling/src/LoadTOFRawNexus.cpp      |    5 +-
 Framework/DataHandling/src/MaskDetectors.cpp  |   22 +-
 .../DataHandling/src/MaskDetectorsInShape.cpp |    5 +-
 Framework/DataHandling/src/MeshFileIO.cpp     |    2 +-
 .../src/PDLoadCharacterizations.cpp           |    2 +-
 .../DataHandling/src/ProcessBankData.cpp      |   18 +-
 Framework/DataHandling/src/ReadMaterial.cpp   |    2 +-
 .../src/SampleEnvironmentSpecParser.cpp       |    4 +-
 Framework/DataHandling/src/SaveAscii2.cpp     |    2 +-
 Framework/DataHandling/src/SaveCSV.cpp        |    7 +-
 Framework/DataHandling/src/SaveCalFile.cpp    |    6 +-
 .../src/SaveDetectorsGrouping.cpp             |    4 +-
 Framework/DataHandling/src/SaveDiffCal.cpp    |    2 +-
 .../DataHandling/src/SaveDiffFittingAscii.cpp |    4 +-
 Framework/DataHandling/src/SaveDspacemap.cpp  |    4 +-
 Framework/DataHandling/src/SaveFITS.cpp       |    8 +-
 .../src/SaveFullprofResolution.cpp            |    2 +-
 .../src/SaveGSASInstrumentFile.cpp            |    4 +-
 Framework/DataHandling/src/SaveIsawDetCal.cpp |    7 +-
 Framework/DataHandling/src/SaveNXTomo.cpp     |    8 +-
 Framework/DataHandling/src/SaveNXcanSAS.cpp   |   69 +-
 .../DataHandling/src/SaveNexusProcessed.cpp   |    9 +-
 Framework/DataHandling/src/SavePDFGui.cpp     |    4 +-
 Framework/DataHandling/src/SaveRMCProfile.cpp |    8 +-
 .../src/SaveReflectometryAscii.cpp            |   10 +-
 Framework/DataHandling/src/SaveSPE.cpp        |    4 +-
 Framework/DataHandling/src/SaveTBL.cpp        |    2 +-
 .../src/SaveToSNSHistogramNexus.cpp           |    6 +-
 Framework/DataHandling/src/SetScalingPSD.cpp  |    2 +-
 .../StartAndEndTimeFromNexusFileExtractor.cpp |   20 +-
 Framework/DataHandling/src/XmlHandler.cpp     |    2 +-
 .../test/CheckMantidVersionTest.h             |    6 +-
 .../DataHandling/test/CompressEventsTest.h    |    5 +-
 .../DataHandling/test/CreateSampleShapeTest.h |    4 +-
 .../test/CreateSimulationWorkspaceTest.h      |    6 +-
 .../test/DataBlockGeneratorTest.h             |    5 +-
 .../DataHandling/test/DownloadFileTest.h      |    4 +-
 .../test/DownloadInstrumentTest.h             |    2 +-
 .../test/ExtractMonitorWorkspaceTest.h        |    3 +-
 .../test/FindDetectorsInShapeTest.h           |    2 +-
 .../test/InstrumentRayTracerTest.h            |    2 +-
 Framework/DataHandling/test/LoadAscii2Test.h  |    4 +-
 .../DataHandling/test/LoadAsciiStlTest.h      |    2 +-
 Framework/DataHandling/test/LoadAsciiTest.h   |    2 +-
 .../test/LoadDetectorsGroupingFileTest.h      |    6 +-
 .../DataHandling/test/LoadDspacemapTest.h     |    3 +-
 Framework/DataHandling/test/LoadEMUauTest.h   |    4 +-
 .../test/LoadEmptyInstrumentTest.h            |    2 +-
 .../DataHandling/test/LoadEventNexusTest.h    |    4 +-
 .../test/LoadEventPreNexus2Test.h             |    4 +-
 .../test/LoadFullprofResolutionTest.h         |   14 +-
 .../test/LoadGSASInstrumentFileTest.h         |   12 +-
 .../test/LoadILLDiffractionTest.h             |    2 +-
 .../test/LoadILLReflectometryTest.h           |    4 +-
 Framework/DataHandling/test/LoadILLTOF2Test.h |    2 +-
 Framework/DataHandling/test/LoadILLTest.h     |    2 +-
 .../DataHandling/test/LoadISISNexusTest.h     |    6 +-
 .../DataHandling/test/LoadInstrumentTest.h    |   10 +-
 .../DataHandling/test/LoadIsawDetCalTest.h    |    8 +-
 Framework/DataHandling/test/LoadLogTest.h     |    4 +-
 Framework/DataHandling/test/LoadMaskTest.h    |    8 +-
 Framework/DataHandling/test/LoadMcStasTest.h  |    6 +-
 .../DataHandling/test/LoadMuonNexus2Test.h    |    2 +-
 .../DataHandling/test/LoadNXcanSASTest.h      |   79 +-
 .../test/LoadNexusProcessed2Test.h            |    2 +-
 .../test/LoadNexusProcessedTest.h             |    4 +-
 Framework/DataHandling/test/LoadPLNTest.h     |    4 +-
 Framework/DataHandling/test/LoadRaw3Test.h    |    6 +-
 Framework/DataHandling/test/LoadRawBin0Test.h |    2 +-
 .../DataHandling/test/LoadRawSpectrum0Test.h  |    2 +-
 .../DataHandling/test/LoadSampleShapeTest.h   |    6 +-
 Framework/DataHandling/test/LoadSpice2dTest.h |    3 +-
 .../test/MaskDetectorsInShapeTest.h           |   14 +-
 Framework/DataHandling/test/MaskSpectraTest.h |    2 +-
 .../DataHandling/test/NXcanSASTestHelper.cpp  |   19 +-
 .../DataHandling/test/NXcanSASTestHelper.h    |   19 +-
 Framework/DataHandling/test/RenameLogTest.h   |    4 +-
 Framework/DataHandling/test/SaveCSVTest.h     |    3 +-
 .../test/SaveFullprofResolutionTest.h         |    6 +-
 .../test/SaveGSASInstrumentFileTest.h         |    7 +-
 .../test/SaveILLCosmosAsciiTest.h             |    3 +-
 Framework/DataHandling/test/SaveNXSPETest.h   |    2 +-
 .../DataHandling/test/SaveNXcanSASTest.h      |   10 +-
 .../DataHandling/test/SaveNexusESSTest.h      |    2 +-
 .../test/SaveNexusProcessedTest.h             |    2 +-
 .../test/SaveOpenGenieAsciiTest.h             |    2 +-
 Framework/DataHandling/test/SavePDFGuiTest.h  |    2 +-
 .../DataHandling/test/SaveParameterFileTest.h |   26 +-
 .../DataHandling/test/SaveRMCProfileTest.h    |    2 +-
 Framework/DataHandling/test/SetSampleTest.h   |    3 +-
 .../DataHandling/test/SetScalingPSDTest.h     |    2 +-
 .../MantidDataObjects/AffineMatrixParameter.h |    2 +-
 .../MantidDataObjects/BoxControllerNeXusIO.h  |    2 +-
 .../inc/MantidDataObjects/EventList.h         |    2 +-
 .../MantidDataObjects/EventWorkspaceHelpers.h |    2 +-
 .../inc/MantidDataObjects/FakeMD.h            |    2 +-
 .../MantidDataObjects/FractionalRebinning.h   |    4 +-
 .../inc/MantidDataObjects/GroupingWorkspace.h |    2 +-
 .../inc/MantidDataObjects/MDBoxFlatTree.h     |   26 +-
 .../MDFramesToSpecialCoordinateSystem.h       |    4 +-
 .../inc/MantidDataObjects/MDHistoWorkspace.h  |    3 +-
 .../MDHistoWorkspaceIterator.h                |    5 +-
 .../inc/MantidDataObjects/MaskWorkspace.h     |    4 +-
 .../MantidDataObjects/MementoTableWorkspace.h |    4 +-
 .../inc/MantidDataObjects/OffsetsWorkspace.h  |    2 +-
 .../ReflectometryTransform.h                  |   17 +-
 .../MantidDataObjects/SpecialWorkspace2D.h    |   12 +-
 .../inc/MantidDataObjects/TableColumn.h       |    2 +-
 .../inc/MantidDataObjects/TableWorkspace.h    |   21 +-
 .../DataObjects/src/AffineMatrixParameter.cpp |    2 +-
 .../DataObjects/src/BoxControllerNeXusIO.cpp  |    2 +-
 Framework/DataObjects/src/EventList.cpp       |    2 +-
 .../DataObjects/src/EventWorkspaceHelpers.cpp |    4 +-
 Framework/DataObjects/src/FakeMD.cpp          |    2 +-
 .../DataObjects/src/FractionalRebinning.cpp   |    5 +-
 .../DataObjects/src/GroupingWorkspace.cpp     |    9 +-
 Framework/DataObjects/src/MDBoxFlatTree.cpp   |   23 +-
 .../src/MDFramesToSpecialCoordinateSystem.cpp |    2 +-
 .../DataObjects/src/MDHistoWorkspace.cpp      |    2 +-
 .../src/MDHistoWorkspaceIterator.cpp          |    5 +-
 Framework/DataObjects/src/MaskWorkspace.cpp   |   13 +-
 .../DataObjects/src/MementoTableWorkspace.cpp |    4 +-
 .../DataObjects/src/OffsetsWorkspace.cpp      |    8 +-
 Framework/DataObjects/src/Peak.cpp            |    7 +-
 Framework/DataObjects/src/PeakShapeBase.cpp   |    4 +-
 .../DataObjects/src/PeakShapeEllipsoid.cpp    |    4 +-
 .../DataObjects/src/PeakShapeSpherical.cpp    |    5 +-
 .../src/ReflectometryTransform.cpp            |   23 +-
 .../DataObjects/src/SpecialWorkspace2D.cpp    |   15 +-
 Framework/DataObjects/src/TableWorkspace.cpp  |    2 +-
 .../DataObjects/test/EventWorkspaceTest.h     |    2 +-
 .../DataObjects/test/MDBoxSaveableTest.h      |   15 +-
 .../DataObjects/test/MDEventWorkspaceTest.h   |    4 +-
 Framework/DataObjects/test/MDGridBoxTest.h    |    8 +-
 .../test/MDHistoWorkspaceIteratorTest.h       |    8 +-
 .../DataObjects/test/MDHistoWorkspaceTest.h   |    4 +-
 .../DataObjects/test/WorkspaceCreationTest.h  |    2 +-
 .../inc/MantidGeometry/Crystal/EdgePixel.h    |    6 +-
 .../MantidGeometry/Crystal/IndexingUtils.h    |    4 +-
 .../Crystal/PeakTransformSelector.h           |   10 +-
 .../Crystal/ReflectionGenerator.h             |    4 +-
 .../Crystal/SpaceGroupFactory.h               |    2 +-
 .../Geometry/inc/MantidGeometry/Instrument.h  |    4 +-
 .../inc/MantidGeometry/Instrument/Detector.h  |    4 +-
 .../MantidGeometry/Instrument/DetectorGroup.h |    2 +-
 .../MantidGeometry/Instrument/Goniometer.h    |   18 +-
 .../Instrument/GridDetectorPixel.h            |    2 +-
 .../Instrument/InstrumentDefinitionParser.h   |   10 +-
 .../Instrument/ParComponentFactory.h          |    3 +-
 .../Instrument/SampleEnvironment.h            |    2 +-
 .../MDGeometry/CompositeImplicitFunction.h    |    4 +-
 .../MDGeometry/MDGeometryXMLBuilder.h         |   10 +-
 .../MDGeometry/MDGeometryXMLParser.h          |    8 +-
 .../MDGeometry/MDHistoDimension.h             |    6 +-
 .../MDGeometry/MDHistoDimensionBuilder.h      |    2 +-
 .../inc/MantidGeometry/Objects/CSGObject.h    |    2 +-
 .../inc/MantidGeometry/Objects/MeshObject.h   |    4 +-
 .../Rendering/GeometryHandler.h               |    6 +-
 .../Rendering/vtkGeometryCacheReader.h        |    2 +-
 Framework/Geometry/src/Crystal/EdgePixel.cpp  |    4 +-
 .../Geometry/src/Crystal/IndexingUtils.cpp    |    4 +-
 .../src/Crystal/PeakTransformSelector.cpp     |    8 +-
 .../src/Crystal/ReflectionGenerator.cpp       |    4 +-
 .../src/Crystal/SpaceGroupFactory.cpp         |    2 +-
 Framework/Geometry/src/Instrument.cpp         |    7 +-
 .../Geometry/src/Instrument/Container.cpp     |    3 +-
 .../Geometry/src/Instrument/Detector.cpp      |    2 +-
 .../Geometry/src/Instrument/DetectorGroup.cpp |    2 +-
 .../Geometry/src/Instrument/DetectorInfo.cpp  |   10 +-
 .../Geometry/src/Instrument/Goniometer.cpp    |   14 +-
 .../Geometry/src/Instrument/GridDetector.cpp  |    9 +-
 .../src/Instrument/GridDetectorPixel.cpp      |   10 +-
 .../Instrument/InstrumentDefinitionParser.cpp |   16 +-
 .../src/Instrument/ObjCompAssembly.cpp        |    3 +-
 .../Geometry/src/Instrument/ObjComponent.cpp  |    5 +-
 .../src/Instrument/ParComponentFactory.cpp    |    2 +-
 .../src/Instrument/RectangularDetector.cpp    |    5 +-
 .../src/Instrument/SampleEnvironment.cpp      |    2 +-
 .../MDGeometry/CompositeImplicitFunction.cpp  |    2 +-
 .../src/MDGeometry/MDGeometryXMLBuilder.cpp   |   10 +-
 .../src/MDGeometry/MDGeometryXMLParser.cpp    |   15 +-
 .../MDGeometry/MDHistoDimensionBuilder.cpp    |   10 +-
 Framework/Geometry/src/Objects/CSGObject.cpp  |    8 +-
 .../src/Objects/InstrumentRayTracer.cpp       |    3 +-
 Framework/Geometry/src/Objects/MeshObject.cpp |    5 +-
 .../src/Rendering/GeometryHandler.cpp         |    2 +-
 .../src/Rendering/vtkGeometryCacheReader.cpp  |    6 +-
 .../src/Rendering/vtkGeometryCacheWriter.cpp  |    3 +-
 Framework/Geometry/test/CSGObjectTest.h       |    2 +-
 Framework/Geometry/test/IndexingUtilsTest.h   |    7 +-
 .../test/InstrumentDefinitionParserTest.h     |   10 +-
 .../Geometry/test/InstrumentRayTracerTest.h   |    5 +-
 Framework/Geometry/test/PointGroupTest.h      |    2 +-
 Framework/Geometry/test/ShapeFactoryTest.h    |    2 +-
 .../ICat/inc/MantidICat/ICat4/ICat4Catalog.h  |    2 +-
 Framework/ICat/src/CatalogLogin.cpp           |    2 +-
 Framework/ICat/src/ICat4/ICat4Catalog.cpp     |    2 +-
 .../Indexing/inc/MantidIndexing/IndexInfo.h   |    5 +-
 Framework/Indexing/src/IndexInfo.cpp          |    3 +-
 Framework/Indexing/test/PartitionerTest.h     |    5 +-
 .../Kernel/inc/MantidKernel/ArrayProperty.h   |   18 +-
 .../inc/MantidKernel/CompositeValidator.h     |    2 +-
 .../Kernel/inc/MantidKernel/ErrorReporter.h   |   21 +-
 .../Kernel/inc/MantidKernel/FunctionTask.h    |    4 +-
 Framework/Kernel/inc/MantidKernel/IndexSet.h  |    2 +-
 .../Kernel/inc/MantidKernel/MaskedProperty.h  |    7 +-
 Framework/Kernel/inc/MantidKernel/Material.h  |    3 +-
 .../Kernel/inc/MantidKernel/MatrixProperty.h  |    7 +-
 .../inc/MantidKernel/PropertyWithValue.h      |    6 +-
 .../inc/MantidKernel/PropertyWithValue.tcc    |    9 +-
 .../inc/MantidKernel/RemoteJobManager.h       |   10 +-
 .../Kernel/inc/MantidKernel/SingletonHolder.h |    2 +-
 .../Kernel/inc/MantidKernel/ThreadPool.h      |    2 +-
 Framework/Kernel/inc/MantidKernel/Unit.h      |   13 +-
 .../Kernel/inc/MantidKernel/UserCatalogInfo.h |    4 +-
 .../inc/MantidKernel/VisibleWhenProperty.h    |    4 +-
 Framework/Kernel/src/ArrayProperty.cpp        |   15 +-
 Framework/Kernel/src/CompositeValidator.cpp   |    4 +-
 Framework/Kernel/src/ErrorReporter.cpp        |   28 +-
 Framework/Kernel/src/IndexSet.cpp             |    2 +-
 Framework/Kernel/src/MaskedProperty.cpp       |    2 +-
 Framework/Kernel/src/Material.cpp             |    2 +-
 Framework/Kernel/src/MaterialBuilder.cpp      |    2 +-
 Framework/Kernel/src/MatrixProperty.cpp       |    2 +-
 Framework/Kernel/src/RemoteJobManager.cpp     |   18 +-
 Framework/Kernel/src/SingletonHolder.cpp      |    2 +-
 Framework/Kernel/src/ThreadPool.cpp           |    2 +-
 Framework/Kernel/src/Unit.cpp                 |    3 +-
 Framework/Kernel/src/VisibleWhenProperty.cpp  |    4 +-
 Framework/Kernel/test/BinaryFileTest.h        |    2 +-
 .../Kernel/test/ConfigPropertyObserverTest.h  |    2 +-
 Framework/Kernel/test/InterpolationTest.h     |    6 +-
 .../Kernel/test/ThreadSchedulerMutexesTest.h  |    4 +-
 Framework/Kernel/test/TypedValidatorTest.h    |    2 +-
 Framework/Kernel/test/UnitLabelTest.h         |    2 +-
 .../ISIS/ISISHistoDataListener.h              |    7 +-
 .../Kafka/IKafkaStreamDecoder.h               |    2 +-
 .../inc/MantidLiveData/LoadLiveData.h         |   13 +-
 .../LiveData/src/ISIS/FakeISISEventDAE.cpp    |    8 +-
 .../src/ISIS/ISISHistoDataListener.cpp        |    4 +-
 .../src/Kafka/IKafkaStreamDecoder.cpp         |    6 +-
 Framework/LiveData/src/Kafka/KafkaBroker.cpp  |    4 +-
 .../src/Kafka/KafkaEventStreamDecoder.cpp     |    7 +-
 .../src/Kafka/KafkaHistoStreamDecoder.cpp     |    6 +-
 .../src/Kafka/KafkaTopicSubscriber.cpp        |    5 +-
 Framework/LiveData/src/LiveDataAlgorithm.cpp  |    3 +-
 Framework/LiveData/src/LoadLiveData.cpp       |   18 +-
 .../test/KafkaEventStreamDecoderTest.h        |    4 +-
 .../test/KafkaHistoStreamDecoderTest.h        |    4 +-
 Framework/LiveData/test/KafkaTesting.h        |    2 +-
 Framework/LiveData/test/LoadLiveDataTest.h    |   12 +-
 Framework/LiveData/test/MonitorLiveDataTest.h |   10 +-
 Framework/LiveData/test/StartLiveDataTest.h   |   12 +-
 .../BoxControllerSettingsAlgorithm.h          |   13 +-
 .../inc/MantidMDAlgorithms/CompactMD.h        |    8 +-
 .../MantidMDAlgorithms/CompareMDWorkspaces.h  |    9 +-
 .../inc/MantidMDAlgorithms/ConvToMDSelector.h |    2 +-
 .../ConvertCWPDMDToSpectra.h                  |   26 +-
 .../ConvertCWSDExpToMomentum.h                |    6 +-
 .../MantidMDAlgorithms/ConvertCWSDMDtoHKL.h   |    4 +-
 .../ConvertSpiceDataToRealSpace.h             |   33 +-
 .../inc/MantidMDAlgorithms/ConvertToMD.h      |   10 +-
 .../inc/MantidMDAlgorithms/CreateMD.h         |   16 +-
 .../MantidMDAlgorithms/CreateMDWorkspace.h    |    4 +-
 .../inc/MantidMDAlgorithms/CutMD.h            |    6 +-
 .../DisplayNormalizationSetter.h              |    6 +-
 .../inc/MantidMDAlgorithms/FindPeaksMD.h      |    2 +-
 .../inc/MantidMDAlgorithms/FitMD.h            |    8 +-
 .../GetSpiceDataRawCountsFromMD.h             |   27 +-
 .../ImportMDHistoWorkspaceBase.h              |    4 +-
 .../MantidMDAlgorithms/Integrate3DEvents.h    |    8 +-
 .../MantidMDAlgorithms/IntegrateEllipsoids.h  |    4 +-
 .../IntegrateEllipsoidsTwoStep.h              |    4 +-
 .../MantidMDAlgorithms/IntegratePeaksCWSD.h   |    5 +-
 .../MantidMDAlgorithms/IntegratePeaksMD2.h    |    7 +-
 .../MantidMDAlgorithms/IntegratePeaksMDHKL.h  |    4 +-
 .../inc/MantidMDAlgorithms/LoadDNSSCD.h       |    4 +-
 .../inc/MantidMDAlgorithms/LoadMD.h           |   14 +-
 .../inc/MantidMDAlgorithms/LoadSQW2.h         |    2 +-
 .../inc/MantidMDAlgorithms/MDNorm.h           |   10 +-
 .../inc/MantidMDAlgorithms/MDTransfNoQ.h      |    2 +-
 .../inc/MantidMDAlgorithms/MDWSDescription.h  |    8 +-
 .../inc/MantidMDAlgorithms/MergeMDFiles.h     |    2 +-
 .../PreprocessDetectorsToMD.h                 |    3 +-
 .../inc/MantidMDAlgorithms/SaveIsawQvector.h  |    2 +-
 .../inc/MantidMDAlgorithms/SaveMD.h           |    2 +-
 .../inc/MantidMDAlgorithms/SaveMD2.h          |    2 +-
 .../inc/MantidMDAlgorithms/SlicingAlgorithm.h |    6 +-
 .../inc/MantidMDAlgorithms/SmoothMD.h         |    4 +-
 .../src/BoxControllerSettingsAlgorithm.cpp    |   15 +-
 Framework/MDAlgorithms/src/CompactMD.cpp      |    4 +-
 .../MDAlgorithms/src/CompareMDWorkspaces.cpp  |    7 +-
 Framework/MDAlgorithms/src/ConvToMDBase.cpp   |    6 +-
 .../MDAlgorithms/src/ConvToMDSelector.cpp     |    2 +-
 .../src/ConvertCWPDMDToSpectra.cpp            |   31 +-
 .../src/ConvertCWSDExpToMomentum.cpp          |   11 +-
 .../MDAlgorithms/src/ConvertCWSDMDtoHKL.cpp   |    5 +-
 .../src/ConvertSpiceDataToRealSpace.cpp       |   28 +-
 Framework/MDAlgorithms/src/ConvertToMD.cpp    |   11 +-
 .../src/ConvertToReflectometryQ.cpp           |    5 +-
 Framework/MDAlgorithms/src/CreateMD.cpp       |   36 +-
 .../MDAlgorithms/src/CreateMDWorkspace.cpp    |    4 +-
 Framework/MDAlgorithms/src/CutMD.cpp          |    6 +-
 .../src/DisplayNormalizationSetter.cpp        |   12 +-
 Framework/MDAlgorithms/src/FindPeaksMD.cpp    |    2 +-
 Framework/MDAlgorithms/src/FitMD.cpp          |    4 +-
 .../src/GetSpiceDataRawCountsFromMD.cpp       |   26 +-
 .../src/ImportMDHistoWorkspaceBase.cpp        |    5 +-
 .../MDAlgorithms/src/Integrate3DEvents.cpp    |   33 +-
 .../MDAlgorithms/src/IntegrateEllipsoids.cpp  |    4 +-
 .../src/IntegrateEllipsoidsTwoStep.cpp        |    4 +-
 .../MDAlgorithms/src/IntegratePeaksCWSD.cpp   |    7 +-
 .../MDAlgorithms/src/IntegratePeaksMD2.cpp    |    6 +-
 .../MDAlgorithms/src/IntegratePeaksMDHKL.cpp  |    2 +-
 .../MDAlgorithms/src/InvalidParameter.cpp     |    5 +-
 .../src/InvalidParameterParser.cpp            |    3 +-
 Framework/MDAlgorithms/src/LoadDNSSCD.cpp     |    4 +-
 Framework/MDAlgorithms/src/LoadMD.cpp         |   14 +-
 Framework/MDAlgorithms/src/LoadSQW2.cpp       |    2 +-
 .../MDAlgorithms/src/MDEventWSWrapper.cpp     |    6 +-
 Framework/MDAlgorithms/src/MDNorm.cpp         |   10 +-
 Framework/MDAlgorithms/src/MDTransfNoQ.cpp    |    2 +-
 .../MDAlgorithms/src/MDWSDescription.cpp      |   11 +-
 Framework/MDAlgorithms/src/MaskMD.cpp         |    2 +-
 Framework/MDAlgorithms/src/MergeMDFiles.cpp   |    5 +-
 .../src/PreprocessDetectorsToMD.cpp           |    2 +-
 .../MDAlgorithms/src/SaveIsawQvector.cpp      |    2 +-
 Framework/MDAlgorithms/src/SaveMD.cpp         |    4 +-
 Framework/MDAlgorithms/src/SaveMD2.cpp        |    3 +-
 .../MDAlgorithms/src/SlicingAlgorithm.cpp     |    8 +-
 Framework/MDAlgorithms/src/SmoothMD.cpp       |    4 +-
 Framework/MDAlgorithms/test/BinMDTest.h       |   18 +-
 .../MDAlgorithms/test/BinaryOperationMDTest.h |    5 +-
 .../test/BoxControllerSettingsAlgorithmTest.h |   14 +-
 .../MDAlgorithms/test/CentroidPeaksMD2Test.h  |    9 +-
 .../MDAlgorithms/test/CentroidPeaksMDTest.h   |    6 +-
 .../MDAlgorithms/test/CloneMDWorkspaceTest.h  |    4 +-
 .../test/CompareMDWorkspacesTest.h            |    6 +-
 .../test/ConvertToMDComponentsTest.h          |   17 +-
 Framework/MDAlgorithms/test/ConvertToMDTest.h |   11 +-
 .../MDAlgorithms/test/ConvertToQ3DdETest.h    |    2 +-
 .../test/ConvertToReflectometryQTest.h        |    2 +-
 .../MDAlgorithms/test/CreateMDWorkspaceTest.h |    5 +-
 Framework/MDAlgorithms/test/CutMDTest.h       |    2 +-
 Framework/MDAlgorithms/test/DivideMDTest.h    |    2 +-
 .../test/FlippingRatioCorrectionMDTest.h      |    2 +-
 .../test/ImportMDEventWorkspaceTest.h         |    2 +-
 .../test/IntegrateMDHistoWorkspaceTest.h      |    2 +-
 .../MDAlgorithms/test/IntegratePeaksMD2Test.h |   10 +-
 .../test/IntegratePeaksMDHKLTest.h            |    2 +-
 .../MDAlgorithms/test/IntegratePeaksMDTest.h  |    9 +-
 Framework/MDAlgorithms/test/LoadMDTest.h      |    6 +-
 Framework/MDAlgorithms/test/LoadSQW2Test.h    |   16 +-
 .../MDAlgorithms/test/MergeMDFilesTest.h      |    2 +-
 Framework/MDAlgorithms/test/MultiplyMDTest.h  |    2 +-
 .../MDAlgorithms/test/QueryMDWorkspaceTest.h  |    2 +-
 .../test/RecalculateTrajectoriesExtentsTest.h |    6 +-
 Framework/MDAlgorithms/test/SaveMD2Test.h     |    8 +-
 Framework/MDAlgorithms/test/SaveMDTest.h      |   12 +-
 Framework/MDAlgorithms/test/SaveZODSTest.h    |    4 +-
 .../MDAlgorithms/test/SetMDUsingMaskTest.h    |    7 +-
 Framework/MDAlgorithms/test/SliceMDTest.h     |    4 +-
 .../MDAlgorithms/test/SlicingAlgorithmTest.h  |    9 +-
 Framework/MDAlgorithms/test/ThresholdMDTest.h |    2 +-
 Framework/MDAlgorithms/test/TransformMDTest.h |    2 +-
 .../MDAlgorithms/test/UnaryOperationMDTest.h  |    4 +-
 .../MDAlgorithms/test/WeightedMeanMDTest.h    |    7 +-
 .../ApplyMuonDetectorGroupPairing.h           |   13 +-
 .../MantidMuon/ApplyMuonDetectorGrouping.h    |    8 +-
 .../inc/MantidMuon/CalMuonDetectorPhases.h    |    3 +-
 .../inc/MantidMuon/CalculateMuonAsymmetry.h   |    4 +-
 .../LoadAndApplyMuonDetectorGrouping.h        |   13 +-
 .../Muon/inc/MantidMuon/MuonAlgorithmHelper.h |   18 +-
 .../inc/MantidMuon/MuonGroupingAsymmetry.h    |    4 +-
 .../Muon/inc/MantidMuon/MuonGroupingCounts.h  |    2 +-
 .../inc/MantidMuon/MuonPairingAsymmetry.h     |   14 +-
 .../Muon/inc/MantidMuon/MuonPreProcess.h      |    8 +-
 .../inc/MantidMuon/PlotAsymmetryByLogValue.h  |    9 +-
 Framework/Muon/inc/MantidMuon/RRFMuon.h       |    2 +-
 .../Muon/inc/MantidMuon/RemoveExpDecay.h      |    3 +-
 .../src/ApplyMuonDetectorGroupPairing.cpp     |   12 +-
 .../Muon/src/ApplyMuonDetectorGrouping.cpp    |   11 +-
 Framework/Muon/src/CalMuonDetectorPhases.cpp  |    8 +-
 Framework/Muon/src/CalculateMuonAsymmetry.cpp |    4 +-
 .../src/LoadAndApplyMuonDetectorGrouping.cpp  |   19 +-
 Framework/Muon/src/MuonAlgorithmHelper.cpp    |   24 +-
 Framework/Muon/src/MuonGroupingAsymmetry.cpp  |   10 +-
 Framework/Muon/src/MuonGroupingCounts.cpp     |    7 +-
 Framework/Muon/src/MuonPairingAsymmetry.cpp   |   30 +-
 Framework/Muon/src/MuonPreProcess.cpp         |    9 +-
 .../Muon/src/PlotAsymmetryByLogValue.cpp      |   16 +-
 Framework/Muon/src/RRFMuon.cpp                |    3 +-
 Framework/Muon/src/RemoveExpDecay.cpp         |    5 +-
 .../test/ApplyMuonDetectorGroupPairingTest.h  |   10 +-
 .../Muon/test/ApplyMuonDetectorGroupingTest.h |    2 +-
 .../Muon/test/CalMuonDetectorPhasesTest.h     |    2 +-
 .../Muon/test/CalculateMuonAsymmetryTest.h    |   19 +-
 ...ConvertFitFunctionForMuonTFAsymmetryTest.h |    2 +-
 .../LoadAndApplyMuonDetectorGroupingTest.h    |    2 +-
 .../Muon/test/MuonGroupingAsymmetryTest.h     |    6 +-
 Framework/Muon/test/MuonGroupingCountsTest.h  |   10 +-
 .../Muon/test/MuonPairingAsymmetryTest.h      |   16 +-
 Framework/Muon/test/MuonPreProcessTest.h      |   23 +-
 Framework/Muon/test/PhaseQuadMuonTest.h       |   36 +-
 .../Nexus/inc/MantidNexus/MuonNexusReader.h   |    2 +-
 Framework/Nexus/inc/MantidNexus/NexusFileIO.h |    8 +-
 .../Nexus/inc/MantidNexus/NexusIOHelper.h     |   23 +-
 Framework/Nexus/src/NexusFileIO.cpp           |    6 +-
 .../MantidNexusGeometry/InstrumentBuilder.h   |   12 +-
 .../inc/MantidNexusGeometry/TubeBuilder.h     |    3 +-
 .../NexusGeometry/src/InstrumentBuilder.cpp   |    7 +-
 Framework/NexusGeometry/src/TubeBuilder.cpp   |    2 +-
 .../inc/MantidParallel/IO/EventLoader.h       |    4 +-
 .../MantidParallel/IO/EventLoaderHelpers.h    |    9 +-
 Framework/Parallel/src/Communicator.cpp       |    4 +-
 Framework/Parallel/src/IO/EventLoader.cpp     |   12 +-
 .../api/src/Exports/AlgorithmHistory.cpp      |    2 +-
 .../api/src/Exports/AlgorithmObserver.cpp     |    9 +-
 .../mantid/api/src/Exports/FileFinder.cpp     |    3 +-
 .../api/src/Exports/IPeaksWorkspace.cpp       |    7 +-
 .../api/src/Exports/ITableWorkspace.cpp       |    6 +-
 .../mantid/api/src/Exports/Run.cpp            |    7 +-
 .../api/src/FitFunctions/IFunctionAdapter.cpp |    3 +-
 .../mantid/geometry/src/Exports/UnitCell.cpp  |    2 +-
 .../kernel/src/Exports/ArrayProperty.cpp      |   10 +-
 .../kernel/src/Exports/CompositeValidator.cpp |    2 +-
 .../kernel/src/Exports/IPropertyManager.cpp   |    4 +-
 .../MantidWebServiceAPIHelper.h               |   10 +-
 .../src/MantidWebServiceAPIHelper.cpp         |   25 +-
 Framework/SINQ/inc/MantidSINQ/InvertMDDim.h   |   15 +-
 .../SINQ/inc/MantidSINQ/LoadFlexiNexus.h      |    8 +-
 .../inc/MantidSINQ/MDHistoToWorkspace2D.h     |   12 +-
 .../inc/MantidSINQ/PoldiAutoCorrelation5.h    |    4 +-
 .../SINQ/inc/MantidSINQ/PoldiFitPeaks1D.h     |    5 +-
 .../SINQ/inc/MantidSINQ/PoldiFitPeaks1D2.h    |    5 +-
 .../SINQ/inc/MantidSINQ/PoldiFitPeaks2D.h     |    8 +-
 .../SINQ/inc/MantidSINQ/PoldiPeakSearch.h     |   20 +-
 .../SINQ/inc/MantidSINQ/PoldiTruncateData.h   |   17 +-
 .../PoldiUtilities/PoldiDeadWireDecorator.h   |   14 +-
 .../PoldiUtilities/PoldiPeakCollection.h      |    2 +-
 .../PoldiUtilities/PoldiSourceSpectrum.h      |   18 +-
 Framework/SINQ/inc/MantidSINQ/ProjectMD.h     |   16 +-
 .../SINQ/inc/MantidSINQ/SINQHMListener.h      |    6 +-
 .../SINQ/inc/MantidSINQ/SINQTranspose3D.h     |   12 +-
 Framework/SINQ/inc/MantidSINQ/SliceMDHisto.h  |    8 +-
 Framework/SINQ/src/InvertMDDim.cpp            |   16 +-
 Framework/SINQ/src/LoadFlexiNexus.cpp         |    8 +-
 Framework/SINQ/src/MDHistoToWorkspace2D.cpp   |   13 +-
 Framework/SINQ/src/PoldiAutoCorrelation5.cpp  |    4 +-
 Framework/SINQ/src/PoldiFitPeaks1D.cpp        |    7 +-
 Framework/SINQ/src/PoldiFitPeaks1D2.cpp       |    7 +-
 Framework/SINQ/src/PoldiFitPeaks2D.cpp        |   11 +-
 Framework/SINQ/src/PoldiPeakSearch.cpp        |   14 +-
 Framework/SINQ/src/PoldiTruncateData.cpp      |   28 +-
 .../SINQ/src/PoldiUtilities/PoldiDGrid.cpp    |   15 +-
 .../PoldiUtilities/PoldiDeadWireDecorator.cpp |    9 +-
 .../PoldiUtilities/PoldiDetectorDecorator.cpp |    6 +-
 .../SINQ/src/PoldiUtilities/PoldiPeak.cpp     |   13 +-
 .../PoldiUtilities/PoldiPeakCollection.cpp    |   10 +-
 .../PoldiUtilities/PoldiSourceSpectrum.cpp    |   22 +-
 Framework/SINQ/src/ProjectMD.cpp              |   15 +-
 Framework/SINQ/src/SINQHMListener.cpp         |    9 +-
 Framework/SINQ/src/SINQTranspose3D.cpp        |   13 +-
 Framework/SINQ/src/SliceMDHisto.cpp           |    9 +-
 Framework/SINQ/test/PoldiDGridTest.h          |    4 +-
 Framework/SINQ/test/PoldiFitPeaks2DTest.h     |    4 +-
 Framework/SINQ/test/PoldiPeakCollectionTest.h |    2 +-
 Framework/SINQ/test/PoldiSourceSpectrumTest.h |    5 +-
 .../ScriptRepositoryImpl.h                    |    2 +-
 .../src/ScriptRepositoryImpl.cpp              |    2 +-
 .../test/ScriptRepositoryTestImpl.h           |    3 +-
 .../BinaryOperationMDTestHelper.h             |   14 +-
 .../ComponentCreationHelper.h                 |    2 +-
 .../DataProcessorTestHelper.h                 |   14 +-
 .../inc/MantidTestHelpers/FakeObjects.h       |    5 +-
 .../MantidTestHelpers/MDEventsTestHelper.h    |   25 +-
 .../inc/MantidTestHelpers/NexusFileReader.h   |    8 +-
 .../SANSInstrumentCreationHelper.h            |    6 +-
 .../WorkspaceCreationHelper.h                 |   33 +-
 .../src/BinaryOperationMDTestHelper.cpp       |   18 +-
 .../src/ComponentCreationHelper.cpp           |    2 +-
 .../src/DataProcessorTestHelper.cpp           |    4 +-
 .../TestHelpers/src/MDEventsTestHelper.cpp    |   13 +-
 .../TestHelpers/src/ReflectometryHelper.cpp   |    9 +-
 .../src/SANSInstrumentCreationHelper.cpp      |    7 +-
 .../src/WorkspaceCreationHelper.cpp           |   33 +-
 .../Types/inc/MantidTypes/Core/DateAndTime.h  |    8 +-
 Framework/Types/src/Core/DateAndTime.cpp      |    8 +-
 .../AlignAndFocusPowder.h                     |   19 +-
 .../MantidWorkflowAlgorithms/DgsReduction.h   |    9 +-
 .../inc/MantidWorkflowAlgorithms/DgsRemap.h   |    4 +-
 .../EQSANSInstrument.h                        |   14 +-
 .../EQSANSMonitorTOF.h                        |    2 +-
 .../ExtractQENSMembers.h                      |   13 +-
 .../HFIRDarkCurrentSubtraction.h              |    2 +-
 .../MantidWorkflowAlgorithms/HFIRInstrument.h |   16 +-
 .../IMuonAsymmetryCalculator.h                |    6 +-
 .../MuonGroupAsymmetryCalculator.h            |    8 +-
 .../MuonGroupCalculator.h                     |    8 +-
 .../MuonGroupCountsCalculator.h               |    6 +-
 .../MuonPairAsymmetryCalculator.h             |    6 +-
 .../MantidWorkflowAlgorithms/MuonProcess.h    |   13 +-
 .../MantidWorkflowAlgorithms/SANSBeamFinder.h |    4 +-
 .../SetupEQSANSReduction.h                    |   10 +-
 .../SetupHFIRReduction.h                      |   10 +-
 .../inc/MantidWorkflowAlgorithms/StepScan.h   |   12 +-
 .../src/AlignAndFocusPowder.cpp               |   14 +-
 .../WorkflowAlgorithms/src/DgsReduction.cpp   |    9 +-
 Framework/WorkflowAlgorithms/src/DgsRemap.cpp |    4 +-
 .../src/EQSANSInstrument.cpp                  |   24 +-
 .../WorkflowAlgorithms/src/EQSANSLoad.cpp     |    2 +-
 .../src/EQSANSMonitorTOF.cpp                  |    2 +-
 .../WorkflowAlgorithms/src/EQSANSQ2D.cpp      |    3 +-
 .../src/ExtractQENSMembers.cpp                |   15 +-
 .../src/HFIRDarkCurrentSubtraction.cpp        |    4 +-
 .../WorkflowAlgorithms/src/HFIRInstrument.cpp |   19 +-
 .../src/IMuonAsymmetryCalculator.cpp          |    4 +-
 .../src/MuonGroupAsymmetryCalculator.cpp      |    8 +-
 .../src/MuonGroupCalculator.cpp               |    8 +-
 .../src/MuonGroupCountsCalculator.cpp         |    6 +-
 .../src/MuonPairAsymmetryCalculator.cpp       |    6 +-
 .../WorkflowAlgorithms/src/MuonProcess.cpp    |   14 +-
 .../src/ProcessIndirectFitParameters.cpp      |    6 +-
 .../WorkflowAlgorithms/src/SANSBeamFinder.cpp |    4 +-
 .../src/SetupEQSANSReduction.cpp              |    6 +-
 .../src/SetupHFIRReduction.cpp                |    6 +-
 Framework/WorkflowAlgorithms/src/StepScan.cpp |   10 +-
 .../test/AlignAndFocusPowderTest.h            |   12 +-
 .../test/ExtractQENSMembersTest.h             |   41 +-
 MantidPlot/src/ApplicationWindow.cpp          |   17 +-
 MantidPlot/src/ApplicationWindow.h            |   13 +-
 MantidPlot/src/AssociationsDialog.cpp         |    5 +-
 MantidPlot/src/AssociationsDialog.h           |    2 +-
 MantidPlot/src/AxesDialog.cpp                 |    2 +-
 MantidPlot/src/AxesDialog.h                   |    2 +-
 MantidPlot/src/BoxCurve.h                     |    4 +-
 MantidPlot/src/ColorMapDialog.cpp             |    2 +-
 MantidPlot/src/ColorMapDialog.h               |    2 +-
 MantidPlot/src/ConfigDialog.cpp               |    2 +-
 MantidPlot/src/ConfigDialog.h                 |    2 +-
 MantidPlot/src/CurveRangeDialog.cpp           |    2 +-
 MantidPlot/src/CurveRangeDialog.h             |    2 +-
 MantidPlot/src/CurvesDialog.cpp               |    3 +-
 MantidPlot/src/CurvesDialog.h                 |    3 +-
 MantidPlot/src/CustomActionDialog.cpp         |    2 +-
 MantidPlot/src/CustomActionDialog.h           |    2 +-
 MantidPlot/src/DataSetDialog.cpp              |    2 +-
 MantidPlot/src/DataSetDialog.h                |    2 +-
 MantidPlot/src/ErrDialog.cpp                  |    4 +-
 MantidPlot/src/ErrDialog.h                    |    4 +-
 MantidPlot/src/ExpDecayDialog.cpp             |    2 +-
 MantidPlot/src/ExpDecayDialog.h               |    3 +-
 MantidPlot/src/ExportDialog.cpp               |    2 +-
 MantidPlot/src/ExportDialog.h                 |    2 +-
 MantidPlot/src/FFTDialog.cpp                  |    2 +-
 MantidPlot/src/FFTDialog.h                    |    3 +-
 MantidPlot/src/FilterDialog.cpp               |    2 +-
 MantidPlot/src/FilterDialog.h                 |    3 +-
 MantidPlot/src/FindDialog.cpp                 |    3 +-
 MantidPlot/src/FindDialog.h                   |    2 +-
 MantidPlot/src/FitDialog.cpp                  |    4 +-
 MantidPlot/src/FitDialog.h                    |    5 +-
 MantidPlot/src/FloatingWindow.cpp             |    3 +-
 MantidPlot/src/FloatingWindow.h               |    3 +-
 MantidPlot/src/FunctionCurve.cpp              |    5 +-
 MantidPlot/src/FunctionCurve.h                |    5 +-
 MantidPlot/src/FunctionDialog.cpp             |    3 +-
 MantidPlot/src/FunctionDialog.h               |    2 +-
 MantidPlot/src/Graph.cpp                      |    9 +-
 MantidPlot/src/Graph.h                        |    8 +-
 MantidPlot/src/Graph3D.cpp                    |    4 +-
 MantidPlot/src/Graph3D.h                      |    4 +-
 MantidPlot/src/ImageDialog.cpp                |    2 +-
 MantidPlot/src/ImageDialog.h                  |    2 +-
 MantidPlot/src/ImageExportDialog.cpp          |    2 +-
 MantidPlot/src/ImageExportDialog.h            |    4 +-
 MantidPlot/src/ImportASCIIDialog.cpp          |    2 +-
 MantidPlot/src/ImportASCIIDialog.h            |    4 +-
 MantidPlot/src/IntDialog.cpp                  |    2 +-
 MantidPlot/src/IntDialog.h                    |    2 +-
 MantidPlot/src/InterpolationDialog.cpp        |    2 +-
 MantidPlot/src/InterpolationDialog.h          |    3 +-
 MantidPlot/src/LayerDialog.cpp                |    2 +-
 MantidPlot/src/LayerDialog.h                  |    2 +-
 MantidPlot/src/LineDialog.cpp                 |    2 +-
 MantidPlot/src/LineDialog.h                   |    2 +-
 MantidPlot/src/Mantid/AlgorithmMonitor.cpp    |    2 +-
 MantidPlot/src/Mantid/AlgorithmMonitor.h      |    4 +-
 MantidPlot/src/Mantid/FitParameterTie.cpp     |    3 +-
 MantidPlot/src/Mantid/IFunctionWrapper.cpp    |    5 +-
 MantidPlot/src/Mantid/InputHistory.cpp        |    3 +-
 MantidPlot/src/Mantid/InputHistory.h          |    2 +-
 .../src/Mantid/LabelToolLogValuesDialog.cpp   |    2 +-
 .../src/Mantid/LabelToolLogValuesDialog.h     |    2 +-
 MantidPlot/src/Mantid/MantidApplication.cpp   |    4 +-
 MantidPlot/src/Mantid/MantidApplication.h     |    4 +-
 MantidPlot/src/Mantid/MantidMDCurveDialog.cpp |    2 +-
 MantidPlot/src/Mantid/MantidMDCurveDialog.h   |    3 +-
 MantidPlot/src/Mantid/MantidMatrix.cpp        |   15 +-
 MantidPlot/src/Mantid/MantidMatrix.h          |   14 +-
 MantidPlot/src/Mantid/MantidMatrixCurve.cpp   |    2 +-
 MantidPlot/src/Mantid/MantidMatrixCurve.h     |    2 +-
 MantidPlot/src/Mantid/MantidMatrixDialog.cpp  |    2 +-
 MantidPlot/src/Mantid/MantidMatrixDialog.h    |    2 +-
 .../src/Mantid/MantidMatrixTabExtension.h     |    2 +-
 .../src/Mantid/MantidSampleLogDialog.cpp      |    3 +-
 MantidPlot/src/Mantid/MantidSampleLogDialog.h |    2 +-
 .../src/Mantid/MantidSampleMaterialDialog.cpp |    2 +-
 .../src/Mantid/MantidSampleMaterialDialog.h   |    2 +-
 MantidPlot/src/Mantid/MantidTable.cpp         |    2 +-
 MantidPlot/src/Mantid/MantidTable.h           |    2 +-
 MantidPlot/src/Mantid/MantidUI.cpp            |    9 +-
 MantidPlot/src/Mantid/MantidUI.h              |   20 +-
 MantidPlot/src/Mantid/PeakPickerTool.cpp      |    4 +-
 MantidPlot/src/Mantid/PeakPickerTool.h        |    3 +-
 MantidPlot/src/Mantid/SampleLogDialogBase.cpp |    2 +-
 MantidPlot/src/Mantid/SampleLogDialogBase.h   |    2 +-
 MantidPlot/src/Matrix.cpp                     |    6 +-
 MantidPlot/src/Matrix.h                       |    6 +-
 MantidPlot/src/MatrixDialog.cpp               |    2 +-
 MantidPlot/src/MatrixDialog.h                 |    2 +-
 MantidPlot/src/MatrixSizeDialog.cpp           |    3 +-
 MantidPlot/src/MatrixSizeDialog.h             |    2 +-
 MantidPlot/src/MatrixValuesDialog.cpp         |    2 +-
 MantidPlot/src/MatrixValuesDialog.h           |    2 +-
 MantidPlot/src/MdPlottingCmapsProvider.cpp    |    4 +-
 MantidPlot/src/MdPlottingCmapsProvider.h      |    6 +-
 MantidPlot/src/MdiSubWindow.cpp               |    4 +-
 MantidPlot/src/MdiSubWindow.h                 |    6 +-
 MantidPlot/src/MultiLayer.cpp                 |    3 +-
 MantidPlot/src/MultiLayer.h                   |    2 +-
 MantidPlot/src/Note.cpp                       |    2 +-
 MantidPlot/src/Note.h                         |    2 +-
 MantidPlot/src/Plot3DDialog.cpp               |    2 +-
 MantidPlot/src/Plot3DDialog.h                 |    2 +-
 MantidPlot/src/PlotDialog.cpp                 |    2 +-
 MantidPlot/src/PlotDialog.h                   |    2 +-
 MantidPlot/src/PlotWizard.cpp                 |    3 +-
 MantidPlot/src/PlotWizard.h                   |    2 +-
 MantidPlot/src/PolynomFitDialog.cpp           |    2 +-
 MantidPlot/src/PolynomFitDialog.h             |    2 +-
 MantidPlot/src/Processes.cpp                  |    2 +-
 MantidPlot/src/ProjectRecovery.cpp            |    3 +-
 MantidPlot/src/ProjectRecovery.h              |    2 +-
 MantidPlot/src/ProjectSerialiser.cpp          |    2 +-
 MantidPlot/src/ProjectSerialiser.h            |    2 +-
 MantidPlot/src/RenameWindowDialog.cpp         |    2 +-
 MantidPlot/src/RenameWindowDialog.h           |    2 +-
 MantidPlot/src/ScriptingLangDialog.cpp        |    2 +-
 MantidPlot/src/ScriptingLangDialog.h          |    2 +-
 MantidPlot/src/ScriptingWindow.cpp            |    2 +-
 MantidPlot/src/ScriptingWindow.h              |    3 +-
 MantidPlot/src/SendToProgramDialog.cpp        |    7 +-
 MantidPlot/src/SendToProgramDialog.h          |    6 +-
 MantidPlot/src/SetColValuesDialog.cpp         |    2 +-
 MantidPlot/src/SetColValuesDialog.h           |    3 +-
 MantidPlot/src/SmoothCurveDialog.cpp          |    3 +-
 MantidPlot/src/SmoothCurveDialog.h            |    2 +-
 MantidPlot/src/SortDialog.cpp                 |    3 +-
 MantidPlot/src/SortDialog.h                   |    2 +-
 MantidPlot/src/Spectrogram.cpp                |    5 +-
 MantidPlot/src/SurfaceDialog.cpp              |    2 +-
 MantidPlot/src/SurfaceDialog.h                |    2 +-
 MantidPlot/src/Table.cpp                      |    6 +-
 MantidPlot/src/Table.h                        |   12 +-
 MantidPlot/src/TableDialog.cpp                |    3 +-
 MantidPlot/src/TableDialog.h                  |    2 +-
 MantidPlot/src/TableStatistics.cpp            |    2 +-
 MantidPlot/src/TableStatistics.h              |    2 +-
 MantidPlot/src/TextDialog.cpp                 |    2 +-
 MantidPlot/src/TextDialog.h                   |    3 +-
 MantidPlot/src/TextFileIO.cpp                 |    3 +-
 MantidPlot/src/TextFileIO.h                   |    2 +-
 MantidPlot/src/TiledWindow.cpp                |    2 +-
 MantidPlot/src/TiledWindow.h                  |    2 +-
 .../src/lib/include/ExtensibleFileDialog.h    |    7 +-
 MantidPlot/src/lib/include/SymbolDialog.h     |    2 +-
 .../src/lib/src/ExtensibleFileDialog.cpp      |    2 +-
 MantidPlot/src/lib/src/SymbolDialog.cpp       |    3 +-
 MantidPlot/src/origin/OPJFile.h               |   34 +-
 .../CMake/CppCheck_Suppressions.txt.in        |    3 +
 qt/icons/inc/MantidQtIcons/CharIconEngine.h   |    2 +-
 qt/icons/src/CharIconEngine.cpp               |    6 +-
 qt/icons/src/Icon.cpp                         |    2 +-
 .../Direct/ALFCustomInstrumentView.cpp        |    5 +-
 .../Direct/ALFCustomInstrumentView.h          |    2 +-
 .../DynamicPDF/DPDFFitControl.cpp             |    3 +-
 .../EnggDiffraction/EnggDiffFittingModel.cpp  |  609 ++++
 .../EnggDiffraction/EnggDiffFittingModel.h    |  152 +
 .../EnggDiffFittingPresenter.cpp              |  745 +++++
 .../EnggDiffFittingPresenter.h                |  142 +
 .../EnggDiffFittingViewQtWidget.cpp           |  577 ++++
 .../EnggDiffGSASFittingModel.cpp              |  353 ++
 .../EnggDiffGSASFittingModel.h                |  132 +
 .../EnggDiffGSASFittingPresenter.cpp          |  301 ++
 .../EnggDiffGSASFittingPresenter.h            |  100 +
 .../EnggDiffGSASFittingViewQtWidget.cpp       |  389 +++
 .../EnggDiffGSASFittingViewQtWidget.h         |  118 +
 .../EnggDiffMultiRunFittingQtWidget.cpp       |  255 ++
 ...EnggDiffMultiRunFittingWidgetPresenter.cpp |  227 ++
 .../EnggDiffractionPresenter.cpp              | 2899 +++++++++++++++++
 .../EnggDiffractionPresenter.h                |  354 ++
 .../EnggDiffractionViewQtGUI.cpp              | 1105 +++++++
 .../EnggDiffractionViewQtGUI.h                |  301 ++
 .../EnggVanadiumCorrectionsModel.cpp          |  196 ++
 .../EnggVanadiumCorrectionsModel.h            |   83 +
 .../GSASIIRefineFitPeaksOutputProperties.cpp  |   34 +
 .../GSASIIRefineFitPeaksOutputProperties.h    |   49 +
 .../GSASIIRefineFitPeaksParameters.cpp        |   47 +
 .../GSASIIRefineFitPeaksParameters.h          |   59 +
 .../General/DataComparison.cpp                |    4 +-
 .../General/DataComparison.h                  |    4 +-
 qt/scientific_interfaces/General/MantidEV.cpp |    9 +-
 qt/scientific_interfaces/General/MantidEV.h   |    8 +-
 qt/scientific_interfaces/General/StepScan.cpp |    5 +-
 qt/scientific_interfaces/General/StepScan.h   |    2 +-
 .../Common/GetInstrumentParameter.cpp         |    8 +-
 .../Common/GetInstrumentParameter.h           |   17 +-
 .../Common/OptionDefaults.cpp                 |    5 +-
 .../GUI/Batch/AlgorithmProperties.cpp         |    2 +-
 .../GUI/Batch/AlgorithmProperties.h           |    2 +-
 .../GUI/Batch/BatchJobAlgorithm.cpp           |    7 +-
 .../GUI/Batch/BatchJobAlgorithm.h             |    2 +-
 .../GUI/Batch/GroupProcessingAlgorithm.cpp    |   10 +-
 .../GUI/Batch/QtBatchView.cpp                 |    9 +-
 .../ISISReflectometry/GUI/Batch/QtBatchView.h |    2 +-
 .../GUI/Batch/RowProcessingAlgorithm.cpp      |    5 +-
 .../Experiment/ExperimentOptionDefaults.cpp   |    5 +-
 .../PerThetaDefaultsTableValidationError.cpp  |    5 +-
 .../GUI/Experiment/QtExperimentView.cpp       |   26 +-
 .../GUI/Experiment/QtExperimentView.h         |   25 +-
 .../Instrument/InstrumentOptionDefaults.cpp   |    5 +-
 .../GUI/Instrument/QtInstrumentView.cpp       |   17 +-
 .../GUI/Instrument/QtInstrumentView.h         |   14 +-
 .../GUI/Runs/QtCatalogSearcher.cpp            |    3 +-
 .../ISISReflectometry/GUI/Runs/QtRunsView.cpp |    3 +-
 .../ISISReflectometry/GUI/Runs/QtRunsView.h   |    2 +-
 .../GUI/RunsTable/RegexRowFilter.cpp          |    2 +-
 .../GUI/RunsTable/RegexRowFilter.h            |    2 +-
 .../ISISReflectometry/GUI/Save/AsciiSaver.cpp |   13 +-
 .../ISISReflectometry/GUI/Save/AsciiSaver.h   |    4 +-
 .../GUI/Save/SavePresenter.cpp                |    4 +-
 .../Reduction/FloodCorrections.cpp            |    5 +-
 .../Reduction/MonitorCorrections.cpp          |    6 +-
 .../ISISReflectometry/Reduction/RangeInQ.cpp  |    4 +-
 .../Reduction/ReductionJobs.cpp               |    8 +-
 .../Reduction/ReductionJobs.h                 |    8 +-
 .../Reduction/ReductionWorkspaces.cpp         |    5 +-
 .../Reduction/ValidatePerThetaDefaults.cpp    |    2 +-
 .../Reduction/ValidateRow.cpp                 |    2 +-
 .../TestHelpers/ModelCreationHelper.cpp       |    6 +-
 .../ISISSANS/SANSAddFiles.cpp                 |    8 +-
 .../ISISSANS/SANSAddFiles.h                   |    6 +-
 .../SANSBackgroundCorrectionSettings.cpp      |    3 +-
 .../SANSBackgroundCorrectionSettings.h        |    4 +-
 .../SANSBackgroundCorrectionWidget.cpp        |   11 +-
 .../ISISSANS/SANSBackgroundCorrectionWidget.h |   16 +-
 .../ISISSANS/SANSDiagnostics.cpp              |    8 +-
 .../ISISSANS/SANSDiagnostics.h                |   12 +-
 .../ISISSANS/SANSEventSlicing.cpp             |    3 +-
 .../ISISSANS/SANSEventSlicing.h               |    2 +-
 .../ISISSANS/SANSPlotSpecial.cpp              |    2 +-
 .../ISISSANS/SANSPlotSpecial.h                |    2 +-
 .../ISISSANS/SANSRunWindow.cpp                |   42 +-
 .../ISISSANS/SANSRunWindow.h                  |   35 +-
 .../Indirect/AbsorptionCorrections.cpp        |   41 +-
 .../Indirect/AbsorptionCorrections.h          |   50 +-
 .../Indirect/ApplyAbsorptionCorrections.cpp   |    5 +-
 .../Indirect/ApplyAbsorptionCorrections.h     |    5 +-
 .../Indirect/CalculatePaalmanPings.cpp        |   10 +-
 .../Indirect/CalculatePaalmanPings.h          |   14 +-
 .../Indirect/ContainerSubtraction.cpp         |   55 +-
 .../Indirect/ContainerSubtraction.h           |   35 +-
 .../Indirect/ConvFitAddWorkspaceDialog.cpp    |    8 +-
 .../Indirect/ConvFitModel.cpp                 |   37 +-
 .../Indirect/ConvFitModel.h                   |    2 +-
 .../Indirect/CorrectionsTab.cpp               |    5 +-
 .../Indirect/CorrectionsTab.h                 |    8 +-
 qt/scientific_interfaces/Indirect/Elwin.cpp   |    8 +-
 qt/scientific_interfaces/Indirect/Elwin.h     |    4 +-
 .../Indirect/ILLEnergyTransfer.cpp            |    4 +-
 .../Indirect/ILLEnergyTransfer.h              |    4 +-
 .../Indirect/ISISCalibration.cpp              |    7 +-
 .../Indirect/ISISCalibration.h                |    7 +-
 .../Indirect/ISISDiagnostics.cpp              |    4 +-
 .../Indirect/ISISDiagnostics.h                |    4 +-
 .../Indirect/ISISEnergyTransfer.cpp           |    8 +-
 .../Indirect/ISISEnergyTransfer.h             |    4 +-
 .../Indirect/IndirectAddWorkspaceDialog.cpp   |    8 +-
 .../Indirect/IndirectDataAnalysisTab.cpp      |   11 +-
 .../Indirect/IndirectDataAnalysisTab.h        |    9 +-
 .../Indirect/IndirectDataReduction.cpp        |    5 +-
 .../Indirect/IndirectDataReduction.h          |    8 +-
 .../Indirect/IndirectDiffractionReduction.cpp |    4 +-
 .../Indirect/IndirectDiffractionReduction.h   |    2 +-
 .../Indirect/IndirectFitAnalysisTab.cpp       |    7 +-
 .../Indirect/IndirectFitAnalysisTab.h         |    3 +-
 .../Indirect/IndirectFitAnalysisTabLegacy.cpp |   20 +-
 .../Indirect/IndirectFitAnalysisTabLegacy.h   |    7 +-
 .../Indirect/IndirectFitData.cpp              |    6 +-
 .../Indirect/IndirectFitData.h                |    2 +-
 .../Indirect/IndirectFitDataLegacy.cpp        |    6 +-
 .../Indirect/IndirectFitDataPresenter.cpp     |    7 +-
 .../Indirect/IndirectFitDataPresenter.h       |    2 +-
 .../Indirect/IndirectFitOutput.cpp            |   61 +-
 .../Indirect/IndirectFitOutput.h              |   34 +-
 .../Indirect/IndirectFitOutputLegacy.cpp      |   67 +-
 .../Indirect/IndirectFitOutputLegacy.h        |   35 +-
 .../IndirectFitOutputOptionsModel.cpp         |   66 +-
 .../Indirect/IndirectFitOutputOptionsModel.h  |   32 +-
 .../IndirectFitOutputOptionsPresenter.cpp     |    6 +-
 .../Indirect/IndirectFitPlotModel.cpp         |   68 +-
 .../Indirect/IndirectFitPlotModel.h           |   34 +-
 .../Indirect/IndirectFitPlotModelLegacy.cpp   |   58 +-
 .../Indirect/IndirectFitPlotModelLegacy.h     |   34 +-
 .../Indirect/IndirectFitPlotPresenter.cpp     |   17 +-
 .../Indirect/IndirectFitPlotPresenter.h       |    5 +-
 .../IndirectFitPlotPresenterLegacy.cpp        |   17 +-
 .../Indirect/IndirectFitPlotPresenterLegacy.h |    5 +-
 .../Indirect/IndirectFitPlotView.h            |    5 +-
 .../Indirect/IndirectFitPlotViewLegacy.h      |    5 +-
 .../Indirect/IndirectFitPropertyBrowser.cpp   |    3 +-
 .../Indirect/IndirectFitPropertyBrowser.h     |    2 +-
 .../Indirect/IndirectFittingModel.cpp         |  113 +-
 .../Indirect/IndirectFittingModel.h           |   35 +-
 .../Indirect/IndirectFittingModelLegacy.cpp   |  113 +-
 .../Indirect/IndirectFittingModelLegacy.h     |   29 +-
 .../ConvFunctionModel.cpp                     |    6 +-
 .../ConvFunctionModel.h                       |    7 +-
 .../IndirectFunctionBrowser/ConvTypes.h       |    2 +-
 .../FQTemplateBrowser.cpp                     |    8 +-
 .../FQTemplateBrowser.h                       |    7 +-
 .../IqtFunctionModel.cpp                      |    2 +-
 .../IqtFunctionModel.h                        |    3 +-
 .../MSDFunctionModel.cpp                      |    2 +-
 .../MSDFunctionModel.h                        |    3 +-
 .../Indirect/IndirectInstrumentConfig.cpp     |    3 +-
 .../Indirect/IndirectInstrumentConfig.h       |    2 +-
 .../Indirect/IndirectLoadILL.cpp              |    2 +-
 .../Indirect/IndirectMoments.cpp              |    4 +-
 .../Indirect/IndirectMoments.h                |    4 +-
 .../Indirect/IndirectPlotOptionsModel.cpp     |   10 +-
 .../Indirect/IndirectPlotOptionsModel.h       |    4 +-
 .../Indirect/IndirectPlotter.cpp              |   11 +-
 .../Indirect/IndirectPlotter.h                |    6 +-
 .../Indirect/IndirectSettings.cpp             |    2 +-
 .../Indirect/IndirectSettings.h               |    2 +-
 .../Indirect/IndirectSqw.cpp                  |    4 +-
 .../Indirect/IndirectSqw.h                    |    4 +-
 .../Indirect/IndirectSymmetrise.cpp           |    4 +-
 .../Indirect/IndirectSymmetrise.h             |    4 +-
 .../Indirect/IndirectTab.cpp                  |   17 +-
 .../Indirect/IndirectTab.h                    |   21 +-
 .../Indirect/IndirectTransmission.cpp         |    4 +-
 .../Indirect/IndirectTransmission.h           |    4 +-
 qt/scientific_interfaces/Indirect/Iqt.cpp     |   29 +-
 .../Indirect/IqtFitModel.cpp                  |   25 +-
 .../Indirect/IqtFitModel.h                    |    4 +-
 .../Indirect/JumpFitModel.cpp                 |   16 +-
 .../Indirect/JumpFitModel.h                   |    3 +-
 qt/scientific_interfaces/Indirect/ResNorm.cpp |   12 +-
 qt/scientific_interfaces/Indirect/ResNorm.h   |   14 +-
 .../test/IndirectDataValidationHelperTest.h   |    3 +-
 .../Indirect/test/IndirectFitOutputTest.h     |   12 +-
 .../Indirect/test/IndirectFitPlotModelTest.h  |   13 +-
 .../Indirect/test/IndirectFittingModelTest.h  |   11 +-
 .../test/IndirectPlotOptionsModelTest.h       |    3 +-
 .../Indirect/test/IndirectPlotterTest.h       |    3 +-
 .../MultiDatasetFit/MDFFunctionPlotData.cpp   |    4 +-
 .../MultiDatasetFit/MultiDatasetFit.cpp       |    2 +-
 .../MultiDatasetFit/MultiDatasetFit.h         |    2 +-
 .../Muon/ALCBaselineModellingModel.cpp        |   22 +-
 .../Muon/ALCBaselineModellingModel.h          |    8 +-
 .../Muon/ALCDataLoadingPresenter.cpp          |    2 +-
 .../Muon/ALCDataLoadingPresenter.h            |    2 +-
 .../Muon/ALCPeakFittingModel.cpp              |   12 +-
 .../Muon/MuonAnalysis.cpp                     |   13 +-
 qt/scientific_interfaces/Muon/MuonAnalysis.h  |    6 +-
 .../Muon/MuonAnalysisDataLoader.cpp           |    6 +-
 .../Muon/MuonAnalysisDataLoader.h             |    6 +-
 .../Muon/MuonAnalysisFitDataPresenter.cpp     |    2 +-
 .../Muon/MuonAnalysisFitDataPresenter.h       |    2 +-
 .../Muon/MuonAnalysisHelper.cpp               |   24 +-
 .../Muon/MuonAnalysisHelper.h                 |   21 +-
 .../Muon/MuonAnalysisResultTableCreator.cpp   |    4 +-
 .../Muon/MuonAnalysisResultTableCreator.h     |    2 +-
 .../Muon/MuonAnalysisResultTableTab.cpp       |    2 +-
 .../Muon/MuonAnalysisResultTableTab.h         |    3 +-
 .../Muon/MuonSequentialFitDialog.cpp          |    9 +-
 .../Muon/MuonSequentialFitDialog.h            |    4 +-
 .../test/EnggDiffFittingModelTest.h           |  312 ++
 .../test/EnggDiffFittingPresenterTest.h       |  764 +++++
 .../test/EnggDiffGSASFittingModelTest.h       |  289 ++
 ...ggDiffMultiRunFittingWidgetPresenterTest.h |  393 +++
 .../test/EnggVanadiumCorrectionsModelTest.h   |  206 ++
 .../Experiment/ExperimentPresenterTest.h      |    3 +-
 .../PerThetaDefaultsTableValidatorTest.h      |   11 +-
 .../Runs/RunsPresenterTest.h                  |    6 +-
 .../Save/SavePresenterTest.h                  |   12 +-
 .../test/MuonAnalysisDataLoaderTest.h         |    7 +-
 .../test/MuonAnalysisResultTableCreatorTest.h |    8 +-
 .../MantidQtWidgets/Common/AlgorithmDialog.h  |    4 +-
 .../Common/AlgorithmHintStrategy.h            |    4 +-
 .../Common/AlgorithmHistoryWindow.h           |   23 +-
 .../Common/AlgorithmInputHistory.h            |    2 +-
 .../Common/AlgorithmPropertiesWidget.h        |    2 +-
 .../Common/AlgorithmSelectorWidget.h          |    2 +-
 .../Common/BatchAlgorithmRunner.h             |   14 +-
 .../MantidQtWidgets/Common/CatalogSearch.h    |    4 +-
 .../Common/ConvolutionFunctionModel.h         |   13 +-
 .../Common/DataProcessorUI/GenerateNotebook.h |    7 +-
 .../GenericDataProcessorPresenter.h           |   42 +-
 ...icDataProcessorPresenterRowReducerWorker.h |    5 +-
 .../DataProcessorUI/OneLevelTreeManager.h     |    6 +-
 .../DataProcessorUI/PostprocessingStep.h      |    5 +-
 .../DataProcessorUI/PreprocessingAlgorithm.h  |   11 +-
 .../DataProcessorUI/ProcessingAlgorithm.h     |    6 +-
 .../DataProcessorUI/QOneLevelTreeModel.h      |    2 +-
 .../DataProcessorUI/QTwoLevelTreeModel.h      |    4 +-
 .../Common/DataProcessorUI/TreeData.h         |    4 +-
 .../DataProcessorUI/TwoLevelTreeManager.h     |    6 +-
 .../DataProcessorUI/WorkspaceNameUtils.h      |    4 +-
 .../inc/MantidQtWidgets/Common/DiagResults.h  |    4 +-
 .../MantidQtWidgets/Common/DoubleSpinBox.h    |    2 +-
 .../Common/EditLocalParameterDialog.h         |   11 +-
 .../Common/FileDialogHandler.h                |    2 +-
 .../Common/FitOptionsBrowser.h                |    2 +-
 .../Common/FitPropertyBrowser.h               |    8 +-
 .../MantidQtWidgets/Common/FunctionBrowser.h  |    2 +-
 .../MantidQtWidgets/Common/FunctionModel.h    |    2 +-
 .../Common/FunctionMultiDomainPresenter.h     |    4 +-
 .../MantidQtWidgets/Common/FunctionTreeView.h |   24 +-
 .../Common/IndirectFitPropertyBrowserLegacy.h |    7 +-
 .../MantidQtWidgets/Common/InterfaceManager.h |    4 +-
 .../Common/LocalParameterEditor.h             |    8 +-
 .../inc/MantidQtWidgets/Common/MantidDialog.h |    4 +-
 .../MantidQtWidgets/Common/MantidHelpWindow.h |    5 +-
 .../MantidQtWidgets/Common/MantidTreeModel.h  |    2 +-
 .../Common/MantidTreeWidgetItem.h             |    3 +-
 .../Common/MantidWSIndexDialog.h              |   12 +-
 .../inc/MantidQtWidgets/Common/MdSettings.h   |   13 +-
 .../inc/MantidQtWidgets/Common/Message.h      |    6 +-
 .../Common/MuonFitDataSelector.h              |    8 +-
 .../Common/MuonFitPropertyBrowser.h           |    8 +-
 .../MantidQtWidgets/Common/NonOrthogonal.h    |    3 +-
 .../MantidQtWidgets/Common/PluginLibraries.h  |    7 +-
 .../Common/ProcessingAlgoWidget.h             |    4 +-
 .../MantidQtWidgets/Common/ProjectSaveModel.h |    9 +-
 .../MantidQtWidgets/Common/PropertyHandler.h  |    6 +-
 .../qtpropertybrowserutils_p.h                |    2 +-
 .../MantidQtWidgets/Common/SaveWorkspaces.h   |    2 +-
 .../Common/ScriptRepositoryView.h             |    4 +-
 .../Common/SequentialFitDialog.h              |    4 +-
 .../Common/SlicingAlgorithmDialog.h           |    6 +-
 .../MantidQtWidgets/Common/SlitCalculator.h   |    4 +-
 .../MantidQtWidgets/Common/TSVSerialiser.h    |    2 +-
 .../Common/UserInputValidator.h               |    7 +-
 .../WorkspacePresenter/WorkspaceTreeWidget.h  |    5 +-
 .../Common/WorkspaceSelector.h                |    4 +-
 .../inc/MantidQtWidgets/Common/pqHelpWindow.h |    2 +-
 qt/widgets/common/src/AlgorithmDialog.cpp     |    4 +-
 .../common/src/AlgorithmHistoryWindow.cpp     |   15 +-
 .../common/src/AlgorithmInputHistory.cpp      |    7 +-
 .../common/src/AlgorithmPropertiesWidget.cpp  |    6 +-
 qt/widgets/common/src/Batch/RowLocation.cpp   |    3 +-
 .../common/src/BatchAlgorithmRunner.cpp       |   11 +-
 qt/widgets/common/src/CatalogSearch.cpp       |    4 +-
 .../common/src/ConvolutionFunctionModel.cpp   |   16 +-
 .../src/DataProcessorUI/AbstractTreeModel.cpp |    6 +-
 .../src/DataProcessorUI/GenerateNotebook.cpp  |    6 +-
 .../GenericDataProcessorPresenter.cpp         |   57 +-
 .../DataProcessorUI/OneLevelTreeManager.cpp   |   11 +-
 .../DataProcessorUI/PostprocessingStep.cpp    |    6 +-
 .../PreprocessingAlgorithm.cpp                |   11 +-
 .../DataProcessorUI/ProcessingAlgorithm.cpp   |    8 +-
 .../DataProcessorUI/QOneLevelTreeModel.cpp    |    4 +-
 .../DataProcessorUI/QTwoLevelTreeModel.cpp    |    8 +-
 .../common/src/DataProcessorUI/TreeData.cpp   |    4 +-
 .../DataProcessorUI/TwoLevelTreeManager.cpp   |   11 +-
 .../DataProcessorUI/WorkspaceNameUtils.cpp    |   12 +-
 qt/widgets/common/src/DiagResults.cpp         |    5 +-
 qt/widgets/common/src/DoubleSpinBox.cpp       |    2 +-
 .../common/src/EditLocalParameterDialog.cpp   |   13 +-
 qt/widgets/common/src/FileDialogHandler.cpp   |    2 +-
 .../common/src/FindFilesThreadPoolManager.cpp |    3 +-
 qt/widgets/common/src/FitOptionsBrowser.cpp   |    2 +-
 qt/widgets/common/src/FitPropertyBrowser.cpp  |   13 +-
 qt/widgets/common/src/FunctionBrowser.cpp     |    7 +-
 qt/widgets/common/src/FunctionModel.cpp       |    3 +-
 .../src/FunctionMultiDomainPresenter.cpp      |    8 +-
 qt/widgets/common/src/FunctionTreeView.cpp    |   34 +-
 qt/widgets/common/src/HintingLineEdit.cpp     |    3 +-
 .../src/IndirectFitPropertyBrowserLegacy.cpp  |    9 +-
 qt/widgets/common/src/InterfaceManager.cpp    |    2 +-
 .../common/src/LocalParameterEditor.cpp       |   21 +-
 qt/widgets/common/src/MantidDialog.cpp        |    2 +-
 qt/widgets/common/src/MantidHelpWindow.cpp    |    5 +-
 qt/widgets/common/src/MantidTreeModel.cpp     |    4 +-
 qt/widgets/common/src/MantidTreeWidget.cpp    |    2 +-
 .../common/src/MantidTreeWidgetItem.cpp       |    2 +-
 qt/widgets/common/src/MantidWSIndexDialog.cpp |   27 +-
 qt/widgets/common/src/MdSettings.cpp          |   14 +-
 qt/widgets/common/src/Message.cpp             |   18 +-
 .../common/src/MuonFitPropertyBrowser.cpp     |   11 +-
 qt/widgets/common/src/NonOrthogonal.cpp       |    6 +-
 qt/widgets/common/src/PlotAxis.cpp            |    2 +-
 qt/widgets/common/src/PluginLibraries.cpp     |    6 +-
 .../common/src/ProcessingAlgoWidget.cpp       |    2 +-
 qt/widgets/common/src/ProjectSaveModel.cpp    |    6 +-
 qt/widgets/common/src/PropertyHandler.cpp     |   14 +-
 qt/widgets/common/src/QtJSONUtils.cpp         |    4 +-
 .../qtpropertybrowserutils.cpp                |    2 +-
 qt/widgets/common/src/SaveWorkspaces.cpp      |    2 +-
 .../common/src/ScriptRepositoryView.cpp       |    4 +-
 .../common/src/SelectWorkspacesDialog.cpp     |    2 +-
 qt/widgets/common/src/SequentialFitDialog.cpp |    4 +-
 .../common/src/SlicingAlgorithmDialog.cpp     |   14 +-
 qt/widgets/common/src/SlitCalculator.cpp      |    4 +-
 qt/widgets/common/src/TSVSerialiser.cpp       |    2 +-
 qt/widgets/common/src/UserInputValidator.cpp  |    6 +-
 qt/widgets/common/src/WorkspaceObserver.cpp   |   10 +-
 .../WorkspaceTreeWidget.cpp                   |    4 +-
 .../WorkspaceTreeWidgetSimple.cpp             |    2 +-
 qt/widgets/common/src/WorkspaceSelector.cpp   |    4 +-
 qt/widgets/common/src/pqHelpWindow.cxx        |    2 +-
 .../GenericDataProcessorPresenterTest.h       |   43 +-
 qt/widgets/common/test/ProjectSaveModelTest.h |    9 +-
 .../WorkspacePresenterTest.h                  |    4 +-
 .../InstrumentView/InstrumentActor.h          |    7 +-
 .../InstrumentView/InstrumentTreeWidget.h     |    2 +-
 .../InstrumentView/InstrumentWidget.h         |   12 +-
 .../InstrumentWidgetRenderTab.h               |    2 +-
 .../InstrumentView/MantidGLWidget.h           |    2 +-
 .../InstrumentView/PeakMarker2D.h             |    7 +-
 .../InstrumentView/PeakOverlay.h              |    4 +-
 .../InstrumentView/PlotFitAnalysisPaneModel.h |    2 +-
 .../InstrumentView/PlotFitAnalysisPaneView.h  |    6 +-
 .../InstrumentView/ProjectionSurface.h        |    6 +-
 .../InstrumentView/Shape2DCollection.h        |    3 +-
 .../InstrumentView/UnwrappedDetector.h        |    2 +-
 .../InstrumentView/UnwrappedSurface.h         |    3 +-
 .../instrumentview/src/InstrumentActor.cpp    |    6 +-
 .../src/InstrumentTreeWidget.cpp              |    2 +-
 .../instrumentview/src/InstrumentWidget.cpp   |   18 +-
 .../src/InstrumentWidgetRenderTab.cpp         |    5 +-
 .../instrumentview/src/MantidGLWidget.cpp     |    5 +-
 qt/widgets/instrumentview/src/MiniPlotMpl.cpp |    3 +-
 qt/widgets/instrumentview/src/MiniPlotQwt.cpp |    7 +-
 qt/widgets/instrumentview/src/PeakOverlay.cpp |    8 +-
 .../src/PlotFitAnalysisPaneModel.cpp          |    2 +-
 .../src/PlotFitAnalysisPanePresenter.cpp      |    3 +-
 .../src/PlotFitAnalysisPaneView.cpp           |   11 +-
 .../instrumentview/src/ProjectionSurface.cpp  |    7 +-
 .../instrumentview/src/Shape2DCollection.cpp  |    2 +-
 .../instrumentview/src/SimpleWidget.cpp       |    3 +-
 .../instrumentview/src/UnwrappedDetector.cpp  |    2 +-
 .../instrumentview/src/UnwrappedSurface.cpp   |    7 +-
 .../inc/MantidQtWidgets/MplCpp/Artist.h       |    2 +-
 .../mplcpp/inc/MantidQtWidgets/MplCpp/Axes.h  |    6 +-
 .../inc/MantidQtWidgets/MplCpp/Cycler.h       |    2 +-
 .../inc/MantidQtWidgets/MplCpp/Figure.h       |    4 +-
 .../MantidQtWidgets/MplCpp/FigureCanvasQt.h   |    2 +-
 .../inc/MantidQtWidgets/MplCpp/MantidAxes.h   |    8 +-
 qt/widgets/mplcpp/src/Artist.cpp              |    2 +-
 qt/widgets/mplcpp/src/Axes.cpp                |    6 +-
 qt/widgets/mplcpp/src/Colormap.cpp            |    4 +-
 qt/widgets/mplcpp/src/Cycler.cpp              |    2 +-
 qt/widgets/mplcpp/src/Figure.cpp              |    4 +-
 qt/widgets/mplcpp/src/FigureCanvasQt.cpp      |    7 +-
 qt/widgets/mplcpp/src/MantidAxes.cpp          |    6 +-
 qt/widgets/mplcpp/src/Plot.cpp                |   10 +-
 .../Plotting/Mpl/ContourPreviewPlot.h         |    2 +-
 .../Plotting/Mpl/PreviewPlot.h                |    6 +-
 .../Plotting/Qwt/ContourPreviewPlot.h         |    2 +-
 .../Plotting/Qwt/DisplayCurveFit.h            |    6 +-
 .../inc/MantidQtWidgets/Plotting/Qwt/MWView.h |    4 +-
 .../MantidQtWidgets/Plotting/Qwt/PeakPicker.h |    4 +-
 .../Plotting/Qwt/PreviewPlot.h                |   15 +-
 .../MantidQtWidgets/Plotting/Qwt/QwtHelper.h  |   12 +-
 .../Plotting/Qwt/QwtRasterDataMD.h            |    2 +-
 .../Plotting/Qwt/RangeSelector.h              |    2 +-
 .../plotting/src/Mpl/ContourPreviewPlot.cpp   |    2 +-
 qt/widgets/plotting/src/Mpl/PreviewPlot.cpp   |    9 +-
 .../plotting/src/Qwt/ContourPreviewPlot.cpp   |    4 +-
 .../plotting/src/Qwt/DisplayCurveFit.cpp      |    6 +-
 qt/widgets/plotting/src/Qwt/MWView.cpp        |    4 +-
 .../src/Qwt/MantidQwtIMDWorkspaceData.cpp     |    3 +-
 qt/widgets/plotting/src/Qwt/PeakPicker.cpp    |    4 +-
 qt/widgets/plotting/src/Qwt/PreviewPlot.cpp   |   17 +-
 qt/widgets/plotting/src/Qwt/QwtHelper.cpp     |   14 +-
 .../plotting/src/Qwt/QwtRasterDataMD.cpp      |    7 +-
 qt/widgets/plotting/src/Qwt/RangeSelector.cpp |    2 +-
 qt/widgets/plotting/src/Qwt/SafeQwtPlot.cpp   |    8 +-
 .../AlgorithmDialogs/PeriodicTableWidget.h    |    9 +-
 .../AlgorithmDialogs/SampleShapeHelpers.h     |    2 +-
 .../algorithm_dialogs/src/FitDialog.cpp       |    2 +-
 .../algorithm_dialogs/src/MantidGLWidget.cpp  |    3 +-
 .../src/PeriodicTableWidget.cpp               |   12 +-
 .../src/SampleShapeHelpers.cpp                |    2 +-
 .../RefDetectorView/RefMatrixWSImageView.h    |    6 +-
 .../refdetectorview/src/RefImageView.cpp      |    3 +-
 .../src/RefMatrixWSImageView.cpp              |    5 +-
 .../SliceViewer/CompositePeaksPresenter.h     |   48 +-
 .../SliceViewer/ConcretePeaksPresenter.h      |    8 +-
 .../MantidQtWidgets/SliceViewer/LineOverlay.h |    2 +-
 .../SliceViewer/LinePlotOptions.h             |    2 +-
 .../MantidQtWidgets/SliceViewer/LineViewer.h  |   12 +-
 .../SliceViewer/NonOrthogonalOverlay.h        |    4 +-
 .../SliceViewer/PeakBoundingBox.h             |    2 +-
 .../SliceViewer/PeakRepresentationEllipsoid.h |    8 +-
 .../SliceViewer/PeakViewColor.h               |    5 +-
 .../SliceViewer/PeakViewFactory.h             |    2 +-
 .../MantidQtWidgets/SliceViewer/PeaksViewer.h |   12 +-
 .../SliceViewer/PeaksViewerOverlayDialog.h    |    2 +-
 .../SliceViewer/PeaksWorkspaceWidget.h        |    4 +-
 .../ProxyCompositePeaksPresenter.h            |    9 +-
 .../SliceViewer/QwtScaleDrawNonOrthogonal.h   |    5 +-
 .../MantidQtWidgets/SliceViewer/SliceViewer.h |    4 +-
 .../SliceViewer/SliceViewerWindow.h           |    4 +-
 .../SliceViewer/XYLimitsDialog.h              |    4 +-
 .../src/CompositePeaksPresenter.cpp           |   64 +-
 .../src/ConcretePeaksPresenter.cpp            |   14 +-
 .../sliceviewer/src/DimensionSliceWidget.cpp  |    3 +-
 .../src/EllipsoidPlaneSliceCalculator.cpp     |   18 +-
 qt/widgets/sliceviewer/src/LineOverlay.cpp    |    3 +-
 .../sliceviewer/src/LinePlotOptions.cpp       |    3 +-
 qt/widgets/sliceviewer/src/LineViewer.cpp     |   16 +-
 .../sliceviewer/src/NonOrthogonalOverlay.cpp  |    6 +-
 .../sliceviewer/src/PeakBoundingBox.cpp       |    2 +-
 .../src/PeakRepresentationEllipsoid.cpp       |   11 +-
 qt/widgets/sliceviewer/src/PeakView.cpp       |    5 +-
 .../sliceviewer/src/PeakViewFactory.cpp       |   18 +-
 qt/widgets/sliceviewer/src/PeaksViewer.cpp    |   21 +-
 .../src/PeaksViewerOverlayDialog.cpp          |    2 +-
 .../sliceviewer/src/PeaksWorkspaceWidget.cpp  |   12 +-
 .../src/ProxyCompositePeaksPresenter.cpp      |   32 +-
 .../sliceviewer/src/QPeaksTableModel.cpp      |    5 +-
 .../src/QwtScaleDrawNonOrthogonal.cpp         |   11 +-
 qt/widgets/sliceviewer/src/SliceViewer.cpp    |    4 +-
 .../sliceviewer/src/SliceViewerWindow.cpp     |    5 +-
 qt/widgets/sliceviewer/src/XYLimitsDialog.cpp |    6 +-
 .../test/ConcretePeaksPresenterTest.h         |   15 +-
 .../test/PeakRepresentationEllipsoidTest.h    |    6 +-
 .../test/SliceViewerFunctionsTest.h           |    4 +-
 .../SpectrumViewer/MatrixWSDataSource.h       |    2 +-
 .../SpectrumViewer/SliderHandler.h            |    3 +-
 .../SpectrumViewer/SpectrumPlotItem.h         |    2 +-
 .../SpectrumViewer/SpectrumView.h             |    2 +-
 .../spectrumviewer/src/ArrayDataSource.cpp    |    3 +-
 .../spectrumviewer/src/GraphDisplay.cpp       |    4 +-
 .../spectrumviewer/src/MatrixWSDataSource.cpp |    2 +-
 .../spectrumviewer/src/SliderHandler.cpp      |    4 +-
 .../spectrumviewer/src/SpectrumDisplay.cpp    |    4 +-
 .../spectrumviewer/src/SpectrumPlotItem.cpp   |    2 +-
 .../spectrumviewer/src/SpectrumView.cpp       |    2 +-
 1836 files changed, 19066 insertions(+), 6564 deletions(-)
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingModel.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingModel.h
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingPresenter.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingPresenter.h
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingViewQtWidget.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingModel.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingModel.h
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingPresenter.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingPresenter.h
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingViewQtWidget.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingViewQtWidget.h
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffMultiRunFittingQtWidget.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffMultiRunFittingWidgetPresenter.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffractionPresenter.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffractionPresenter.h
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffractionViewQtGUI.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggDiffractionViewQtGUI.h
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggVanadiumCorrectionsModel.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/EnggVanadiumCorrectionsModel.h
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksOutputProperties.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksOutputProperties.h
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksParameters.cpp
 create mode 100644 qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksParameters.h
 create mode 100644 qt/scientific_interfaces/test/EnggDiffFittingModelTest.h
 create mode 100644 qt/scientific_interfaces/test/EnggDiffFittingPresenterTest.h
 create mode 100644 qt/scientific_interfaces/test/EnggDiffGSASFittingModelTest.h
 create mode 100644 qt/scientific_interfaces/test/EnggDiffMultiRunFittingWidgetPresenterTest.h
 create mode 100644 qt/scientific_interfaces/test/EnggVanadiumCorrectionsModelTest.h

diff --git a/Framework/API/inc/MantidAPI/Algorithm.h b/Framework/API/inc/MantidAPI/Algorithm.h
index 044cb684770..b92a36024ec 100644
--- a/Framework/API/inc/MantidAPI/Algorithm.h
+++ b/Framework/API/inc/MantidAPI/Algorithm.h
@@ -288,7 +288,7 @@ public:
       const std::string &name, const double startProgress = -1.,
       const double endProgress = -1., const bool enableLogging = true,
       const int &version = -1);
-  void setupAsChildAlgorithm(boost::shared_ptr<Algorithm> algorithm,
+  void setupAsChildAlgorithm(const boost::shared_ptr<Algorithm> &algorithm,
                              const double startProgress = -1.,
                              const double endProgress = -1.,
                              const bool enableLogging = true);
diff --git a/Framework/API/inc/MantidAPI/AlgorithmFactory.h b/Framework/API/inc/MantidAPI/AlgorithmFactory.h
index af81adc43d9..0bbcea94b8a 100644
--- a/Framework/API/inc/MantidAPI/AlgorithmFactory.h
+++ b/Framework/API/inc/MantidAPI/AlgorithmFactory.h
@@ -129,9 +129,9 @@ private:
 
   /// Extract the name of an algorithm
   const std::string
-  extractAlgName(const boost::shared_ptr<IAlgorithm> alg) const;
+  extractAlgName(const boost::shared_ptr<IAlgorithm> &alg) const;
   /// Extract the version of an algorithm
-  int extractAlgVersion(const boost::shared_ptr<IAlgorithm> alg) const;
+  int extractAlgVersion(const boost::shared_ptr<IAlgorithm> &alg) const;
 
   /// Create an algorithm object with the specified name
   boost::shared_ptr<Algorithm> createAlgorithm(const std::string &name,
diff --git a/Framework/API/inc/MantidAPI/AlgorithmHistory.h b/Framework/API/inc/MantidAPI/AlgorithmHistory.h
index 28c95f5a247..9da3a963252 100644
--- a/Framework/API/inc/MantidAPI/AlgorithmHistory.h
+++ b/Framework/API/inc/MantidAPI/AlgorithmHistory.h
@@ -63,7 +63,7 @@ public:
                    bool isdefault, const unsigned int &direction = 99);
 
   /// add a child algorithm history record to this history object
-  void addChildHistory(AlgorithmHistory_sptr childHist);
+  void addChildHistory(const AlgorithmHistory_sptr &childHist);
   // get functions
   /// get name of algorithm in history const
   const std::string &name() const { return m_name; }
diff --git a/Framework/API/inc/MantidAPI/AlgorithmManager.h b/Framework/API/inc/MantidAPI/AlgorithmManager.h
index a881c7dab3c..3ad91d867e6 100644
--- a/Framework/API/inc/MantidAPI/AlgorithmManager.h
+++ b/Framework/API/inc/MantidAPI/AlgorithmManager.h
@@ -17,6 +17,7 @@
 #include <deque>
 #include <mutex>
 #include <string>
+#include <utility>
 
 namespace Mantid {
 namespace API {
@@ -26,7 +27,7 @@ namespace API {
 class AlgorithmStartingNotification : public Poco::Notification {
 public:
   AlgorithmStartingNotification(IAlgorithm_sptr alg)
-      : Poco::Notification(), m_alg(alg) {}
+      : Poco::Notification(), m_alg(std::move(alg)) {}
   /// Returns the algorithm that is starting
   IAlgorithm_sptr getAlgorithm() const { return m_alg; }
 
diff --git a/Framework/API/inc/MantidAPI/AlgorithmObserver.h b/Framework/API/inc/MantidAPI/AlgorithmObserver.h
index 699204626d8..3de449bd9cc 100644
--- a/Framework/API/inc/MantidAPI/AlgorithmObserver.h
+++ b/Framework/API/inc/MantidAPI/AlgorithmObserver.h
@@ -23,17 +23,17 @@ Hides Poco::Notification API from the user.
 class MANTID_API_DLL AlgorithmObserver {
 public:
   AlgorithmObserver();
-  AlgorithmObserver(IAlgorithm_const_sptr alg);
+  AlgorithmObserver(const IAlgorithm_const_sptr &alg);
   virtual ~AlgorithmObserver();
 
-  void observeAll(IAlgorithm_const_sptr alg);
-  void observeProgress(IAlgorithm_const_sptr alg);
+  void observeAll(const IAlgorithm_const_sptr &alg);
+  void observeProgress(const IAlgorithm_const_sptr &alg);
   void observeStarting();
-  void observeStart(IAlgorithm_const_sptr alg);
-  void observeFinish(IAlgorithm_const_sptr alg);
-  void observeError(IAlgorithm_const_sptr alg);
+  void observeStart(const IAlgorithm_const_sptr &alg);
+  void observeFinish(const IAlgorithm_const_sptr &alg);
+  void observeError(const IAlgorithm_const_sptr &alg);
 
-  void stopObserving(IAlgorithm_const_sptr alg);
+  void stopObserving(const IAlgorithm_const_sptr &alg);
   void stopObserving(const Mantid::API::IAlgorithm *alg);
   void stopObservingManager();
 
diff --git a/Framework/API/inc/MantidAPI/AlgorithmProxy.h b/Framework/API/inc/MantidAPI/AlgorithmProxy.h
index face35a4875..45490f3bcb7 100644
--- a/Framework/API/inc/MantidAPI/AlgorithmProxy.h
+++ b/Framework/API/inc/MantidAPI/AlgorithmProxy.h
@@ -50,7 +50,7 @@ http://proj-gaudi.web.cern.ch/proj-gaudi/)
 class MANTID_API_DLL AlgorithmProxy : public IAlgorithm,
                                       public Kernel::PropertyManagerOwner {
 public:
-  AlgorithmProxy(Algorithm_sptr alg);
+  AlgorithmProxy(const Algorithm_sptr &alg);
   AlgorithmProxy(const AlgorithmProxy &) = delete;
   AlgorithmProxy &operator=(const AlgorithmProxy &) = delete;
   ~AlgorithmProxy() override;
diff --git a/Framework/API/inc/MantidAPI/BoostOptionalToAlgorithmProperty.h b/Framework/API/inc/MantidAPI/BoostOptionalToAlgorithmProperty.h
index 15e7c685f88..39af124f01c 100644
--- a/Framework/API/inc/MantidAPI/BoostOptionalToAlgorithmProperty.h
+++ b/Framework/API/inc/MantidAPI/BoostOptionalToAlgorithmProperty.h
@@ -36,8 +36,9 @@ value of type boost::optional<T> will be returned.
  */
 template <typename T>
 T checkForMandatoryInstrumentDefault(
-    Mantid::API::Algorithm *const alg, std::string propName,
-    Mantid::Geometry::Instrument_const_sptr instrument, std::string idf_name) {
+    Mantid::API::Algorithm *const alg, const std::string &propName,
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
+    const std::string &idf_name) {
   auto algProperty = alg->getPointerToProperty(propName);
   if (algProperty->isDefault()) {
     auto defaults = instrument->getNumberParameter(idf_name);
@@ -68,8 +69,9 @@ T checkForMandatoryInstrumentDefault(
  */
 template <typename T>
 boost::optional<T> checkForOptionalInstrumentDefault(
-    Mantid::API::Algorithm *const alg, std::string propName,
-    Mantid::Geometry::Instrument_const_sptr instrument, std::string idf_name) {
+    Mantid::API::Algorithm *const alg, const std::string &propName,
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
+    const std::string &idf_name) {
   auto algProperty = alg->getPointerToProperty(propName);
   if (algProperty->isDefault()) {
     auto defaults = instrument->getNumberParameter(idf_name);
@@ -90,12 +92,14 @@ boost::optional<T> checkForOptionalInstrumentDefault(
  */
 template <>
 MANTID_API_DLL std::string checkForMandatoryInstrumentDefault(
-    Mantid::API::Algorithm *const alg, std::string propName,
-    Mantid::Geometry::Instrument_const_sptr instrument, std::string idf_name);
+    Mantid::API::Algorithm *const alg, const std::string &propName,
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
+    const std::string &idf_name);
 
 template <>
 MANTID_API_DLL boost::optional<std::string> checkForOptionalInstrumentDefault(
-    Mantid::API::Algorithm *const alg, std::string propName,
-    Mantid::Geometry::Instrument_const_sptr instrument, std::string idf_name);
+    Mantid::API::Algorithm *const alg, const std::string &propName,
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
+    const std::string &idf_name);
 } // namespace API
 } // namespace Mantid
diff --git a/Framework/API/inc/MantidAPI/BoxController.h b/Framework/API/inc/MantidAPI/BoxController.h
index 0a2b93a421e..9c52e87a400 100644
--- a/Framework/API/inc/MantidAPI/BoxController.h
+++ b/Framework/API/inc/MantidAPI/BoxController.h
@@ -399,7 +399,7 @@ public:
   IBoxControllerIO *getFileIO() { return m_fileIO.get(); }
   /// makes box controller file based by providing class, responsible for
   /// fileIO.
-  void setFileBacked(boost::shared_ptr<IBoxControllerIO> newFileIO,
+  void setFileBacked(const boost::shared_ptr<IBoxControllerIO> &newFileIO,
                      const std::string &fileName = "");
   void clearFileBacked();
   //-----------------------------------------------------------------------------------
diff --git a/Framework/API/inc/MantidAPI/CompositeCatalog.h b/Framework/API/inc/MantidAPI/CompositeCatalog.h
index 630d9c37419..b4ebf7022f9 100644
--- a/Framework/API/inc/MantidAPI/CompositeCatalog.h
+++ b/Framework/API/inc/MantidAPI/CompositeCatalog.h
@@ -25,7 +25,7 @@ public:
   /// Constructor
   CompositeCatalog();
   /// Adds a catalog to the list of catalogs (m_catalogs)
-  void add(const ICatalog_sptr catalog);
+  void add(const ICatalog_sptr &catalog);
   /// Log the user into the catalog system.
   CatalogSession_sptr login(const std::string &username,
                             const std::string &password,
diff --git a/Framework/API/inc/MantidAPI/CompositeDomainMD.h b/Framework/API/inc/MantidAPI/CompositeDomainMD.h
index fb48245da0d..0ef223294d2 100644
--- a/Framework/API/inc/MantidAPI/CompositeDomainMD.h
+++ b/Framework/API/inc/MantidAPI/CompositeDomainMD.h
@@ -27,7 +27,7 @@ class FunctionDomainMD;
 */
 class MANTID_API_DLL CompositeDomainMD : public CompositeDomain {
 public:
-  CompositeDomainMD(IMDWorkspace_const_sptr ws, size_t maxDomainSize);
+  CompositeDomainMD(const IMDWorkspace_const_sptr &ws, size_t maxDomainSize);
   ~CompositeDomainMD() override;
   /// Return the total number of arguments in the domain
   size_t size() const override { return m_totalSize; }
diff --git a/Framework/API/inc/MantidAPI/CompositeFunction.h b/Framework/API/inc/MantidAPI/CompositeFunction.h
index 602389ba1a0..d7034583b1d 100644
--- a/Framework/API/inc/MantidAPI/CompositeFunction.h
+++ b/Framework/API/inc/MantidAPI/CompositeFunction.h
@@ -148,9 +148,10 @@ public:
   /// Remove a function
   void removeFunction(size_t i);
   /// Replace a function
-  void replaceFunction(size_t i, IFunction_sptr f);
+  void replaceFunction(size_t i, const IFunction_sptr &f);
   /// Replace a function
-  void replaceFunctionPtr(const IFunction_sptr f_old, IFunction_sptr f_new);
+  void replaceFunctionPtr(const IFunction_sptr &f_old,
+                          const IFunction_sptr &f_new);
   /// Get the function index
   std::size_t functionIndex(std::size_t i) const;
   /// Returns the index of parameter i as it declared in its function
diff --git a/Framework/API/inc/MantidAPI/DataProcessorAlgorithm.h b/Framework/API/inc/MantidAPI/DataProcessorAlgorithm.h
index 49db7621c3d..ae1dfeb7cb6 100644
--- a/Framework/API/inc/MantidAPI/DataProcessorAlgorithm.h
+++ b/Framework/API/inc/MantidAPI/DataProcessorAlgorithm.h
@@ -45,7 +45,7 @@ protected:
   void setPropManagerPropName(const std::string &propName);
   void mapPropertyName(const std::string &nameInProp,
                        const std::string &nameInPropManager);
-  void copyProperty(API::Algorithm_sptr alg, const std::string &name);
+  void copyProperty(const API::Algorithm_sptr &alg, const std::string &name);
   virtual ITableWorkspace_sptr determineChunk(const std::string &filename);
   virtual MatrixWorkspace_sptr loadChunk(const size_t rowIndex);
   Workspace_sptr load(const std::string &inputData,
diff --git a/Framework/API/inc/MantidAPI/DetectorSearcher.h b/Framework/API/inc/MantidAPI/DetectorSearcher.h
index 22af6d76cfe..27c4a4f7b2c 100644
--- a/Framework/API/inc/MantidAPI/DetectorSearcher.h
+++ b/Framework/API/inc/MantidAPI/DetectorSearcher.h
@@ -43,7 +43,7 @@ public:
   using DetectorSearchResult = std::tuple<bool, size_t>;
 
   /// Create a new DetectorSearcher with the given instrument & detectors
-  DetectorSearcher(Geometry::Instrument_const_sptr instrument,
+  DetectorSearcher(const Geometry::Instrument_const_sptr &instrument,
                    const Geometry::DetectorInfo &detInfo);
   /// Find a detector that intsects with the given Qlab vector
   DetectorSearchResult findDetectorIndex(const Kernel::V3D &q);
diff --git a/Framework/API/inc/MantidAPI/EnabledWhenWorkspaceIsType.h b/Framework/API/inc/MantidAPI/EnabledWhenWorkspaceIsType.h
index 30160436a5c..a849731c9ff 100644
--- a/Framework/API/inc/MantidAPI/EnabledWhenWorkspaceIsType.h
+++ b/Framework/API/inc/MantidAPI/EnabledWhenWorkspaceIsType.h
@@ -6,6 +6,8 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #pragma once
 
+#include <utility>
+
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/Workspace_fwd.h"
 #include "MantidKernel/DataService.h"
@@ -35,7 +37,7 @@ public:
    */
   EnabledWhenWorkspaceIsType(std::string otherPropName,
                              bool enabledSetting = true)
-      : IPropertySettings(), m_otherPropName(otherPropName),
+      : IPropertySettings(), m_otherPropName(std::move(otherPropName)),
         m_enabledSetting(enabledSetting) {}
 
   //--------------------------------------------------------------------------------------------
diff --git a/Framework/API/inc/MantidAPI/ExperimentInfo.h b/Framework/API/inc/MantidAPI/ExperimentInfo.h
index fd15de6045e..4d3134e9e43 100644
--- a/Framework/API/inc/MantidAPI/ExperimentInfo.h
+++ b/Framework/API/inc/MantidAPI/ExperimentInfo.h
@@ -107,9 +107,9 @@ public:
   /// Easy access to the efixed value for this run & detector ID
   double getEFixed(const detid_t detID) const;
   /// Easy access to the efixed value for this run & optional detector
-  double getEFixed(const boost::shared_ptr<const Geometry::IDetector> detector =
-                       boost::shared_ptr<const Geometry::IDetector>{
-                           nullptr}) const;
+  double
+  getEFixed(const boost::shared_ptr<const Geometry::IDetector> &detector =
+                boost::shared_ptr<const Geometry::IDetector>{nullptr}) const;
   /// Set the efixed value for a given detector ID
   void setEFixed(const detid_t detID, const double value);
 
diff --git a/Framework/API/inc/MantidAPI/FunctionDomainGeneral.h b/Framework/API/inc/MantidAPI/FunctionDomainGeneral.h
index 333bfd46ac3..d87f3d7c9d5 100644
--- a/Framework/API/inc/MantidAPI/FunctionDomainGeneral.h
+++ b/Framework/API/inc/MantidAPI/FunctionDomainGeneral.h
@@ -25,7 +25,7 @@ public:
   /// Get the number of columns
   size_t columnCount() const;
   /// Add a new column. All columns must have the same size.
-  void addColumn(boost::shared_ptr<Column> column);
+  void addColumn(const boost::shared_ptr<Column> &column);
   /// Get i-th column
   boost::shared_ptr<Column> getColumn(size_t i) const;
 
diff --git a/Framework/API/inc/MantidAPI/FunctionDomainMD.h b/Framework/API/inc/MantidAPI/FunctionDomainMD.h
index d1641310378..43ebc9efa04 100644
--- a/Framework/API/inc/MantidAPI/FunctionDomainMD.h
+++ b/Framework/API/inc/MantidAPI/FunctionDomainMD.h
@@ -22,7 +22,7 @@ namespace API {
 class MANTID_API_DLL FunctionDomainMD : public FunctionDomain {
 public:
   /// Constructor.
-  FunctionDomainMD(IMDWorkspace_const_sptr ws, size_t start = 0,
+  FunctionDomainMD(const IMDWorkspace_const_sptr &ws, size_t start = 0,
                    size_t length = 0);
   /// Destructor.
   ~FunctionDomainMD() override;
diff --git a/Framework/API/inc/MantidAPI/FunctionFactory.h b/Framework/API/inc/MantidAPI/FunctionFactory.h
index b77dd2a80be..bfb3b208013 100644
--- a/Framework/API/inc/MantidAPI/FunctionFactory.h
+++ b/Framework/API/inc/MantidAPI/FunctionFactory.h
@@ -90,19 +90,21 @@ private:
   /// Throw an exception
   void inputError(const std::string &str = "") const;
   /// Add constraints to the created function
-  void addConstraints(boost::shared_ptr<IFunction> fun,
+  void addConstraints(const boost::shared_ptr<IFunction> &fun,
                       const Expression &expr) const;
   /// Add a single constraint to the created function
-  void addConstraint(boost::shared_ptr<IFunction> fun,
+  void addConstraint(const boost::shared_ptr<IFunction> &fun,
                      const Expression &expr) const;
   /// Add a single constraint to the created function with non-default penalty
-  void addConstraint(boost::shared_ptr<IFunction> fun,
+  void addConstraint(const boost::shared_ptr<IFunction> &fun,
                      const Expression &constraint_expr,
                      const Expression &penalty_expr) const;
   /// Add ties to the created function
-  void addTies(boost::shared_ptr<IFunction> fun, const Expression &expr) const;
+  void addTies(const boost::shared_ptr<IFunction> &fun,
+               const Expression &expr) const;
   /// Add a tie to the created function
-  void addTie(boost::shared_ptr<IFunction> fun, const Expression &expr) const;
+  void addTie(const boost::shared_ptr<IFunction> &fun,
+              const Expression &expr) const;
 
   mutable std::map<std::string, std::vector<std::string>> m_cachedFunctionNames;
   mutable std::mutex m_mutex;
diff --git a/Framework/API/inc/MantidAPI/FunctionGenerator.h b/Framework/API/inc/MantidAPI/FunctionGenerator.h
index 61bdc373d3a..68fafe0b7a0 100644
--- a/Framework/API/inc/MantidAPI/FunctionGenerator.h
+++ b/Framework/API/inc/MantidAPI/FunctionGenerator.h
@@ -31,7 +31,7 @@ belongs to. By default if a name has the signature of a composite function
 class MANTID_API_DLL FunctionGenerator : public IFunction {
 public:
   /// Constructor
-  FunctionGenerator(IFunction_sptr source);
+  FunctionGenerator(const IFunction_sptr &source);
 
   /// @name Overrides implementing composition of two functions:
   /// m_source and m_target.
diff --git a/Framework/API/inc/MantidAPI/GridDomain1D.h b/Framework/API/inc/MantidAPI/GridDomain1D.h
index b0d95f18ce8..2ba4ac5047b 100644
--- a/Framework/API/inc/MantidAPI/GridDomain1D.h
+++ b/Framework/API/inc/MantidAPI/GridDomain1D.h
@@ -26,7 +26,8 @@ namespace API {
 class MANTID_API_DLL GridDomain1D : public API::GridDomain {
 public:
   /// initialize
-  void initialize(double &startX, double &endX, size_t &n, std::string scaling);
+  void initialize(double &startX, double &endX, size_t &n,
+                  const std::string &scaling);
   /// number of grid point	s
   size_t size() const override { return m_points.size(); }
   /// number of dimensions in the grid
diff --git a/Framework/API/inc/MantidAPI/GroupingLoader.h b/Framework/API/inc/MantidAPI/GroupingLoader.h
index ed18239a7e1..622e9090e26 100644
--- a/Framework/API/inc/MantidAPI/GroupingLoader.h
+++ b/Framework/API/inc/MantidAPI/GroupingLoader.h
@@ -33,7 +33,7 @@ public:
   ~Grouping();
 
   /// Construct a Grouping from a table
-  Grouping(ITableWorkspace_sptr table);
+  Grouping(const ITableWorkspace_sptr &table);
 
   /// Convert to grouping table
   ITableWorkspace_sptr toTable() const;
diff --git a/Framework/API/inc/MantidAPI/IFunction.h b/Framework/API/inc/MantidAPI/IFunction.h
index 36a5f403292..327f1c190a4 100644
--- a/Framework/API/inc/MantidAPI/IFunction.h
+++ b/Framework/API/inc/MantidAPI/IFunction.h
@@ -24,6 +24,8 @@
 #endif
 
 #include <string>
+#include <utility>
+
 #include <vector>
 
 #ifdef _WIN32
@@ -521,7 +523,8 @@ public:
   /// Calculate numerical derivatives
   void calNumericalDeriv(const FunctionDomain &domain, Jacobian &jacobian);
   /// Set the covariance matrix
-  void setCovarianceMatrix(boost::shared_ptr<Kernel::Matrix<double>> covar);
+  void
+  setCovarianceMatrix(const boost::shared_ptr<Kernel::Matrix<double>> &covar);
   /// Get the covariance matrix
   boost::shared_ptr<const Kernel::Matrix<double>> getCovarianceMatrix() const {
     return m_covar;
@@ -562,11 +565,11 @@ protected:
 
   /// Convert a value from one unit (inUnit) to unit defined in workspace (ws)
   double convertValue(double value, Kernel::Unit_sptr &outUnit,
-                      boost::shared_ptr<const MatrixWorkspace> ws,
+                      const boost::shared_ptr<const MatrixWorkspace> &ws,
                       size_t wsIndex) const;
 
   void convertValue(std::vector<double> &values, Kernel::Unit_sptr &outUnit,
-                    boost::shared_ptr<const MatrixWorkspace> ws,
+                    const boost::shared_ptr<const MatrixWorkspace> &ws,
                     size_t wsIndex) const;
 
   /// Override to declare function attributes
@@ -635,7 +638,7 @@ using IFunction_const_sptr = boost::shared_ptr<const IFunction>;
 class FunctionHandler {
 public:
   /// Constructor
-  FunctionHandler(IFunction_sptr fun) : m_fun(fun) {}
+  FunctionHandler(IFunction_sptr fun) : m_fun(std::move(fun)) {}
   /// Virtual destructor
   virtual ~FunctionHandler() = default;
   /// abstract init method. It is called after setting handler to the function
diff --git a/Framework/API/inc/MantidAPI/ITableWorkspace.h b/Framework/API/inc/MantidAPI/ITableWorkspace.h
index 9beba0fae1d..74a11149ce6 100644
--- a/Framework/API/inc/MantidAPI/ITableWorkspace.h
+++ b/Framework/API/inc/MantidAPI/ITableWorkspace.h
@@ -22,6 +22,7 @@
 #endif
 
 #include <sstream>
+#include <utility>
 
 namespace Mantid {
 
@@ -349,7 +350,7 @@ public:
     }
   }
   /// Construct directly from column
-  ColumnVector(Column_sptr column) : m_column(column) {
+  ColumnVector(Column_sptr column) : m_column(std::move(column)) {
     if (!m_column->isType<T>()) {
       std::stringstream mess;
       mess << "Type mismatch when creating a ColumnVector<" << typeid(T).name()
@@ -387,7 +388,7 @@ public:
     }
   }
   /// Construct directly from column
-  ConstColumnVector(Column_const_sptr column) : m_column(column) {
+  ConstColumnVector(Column_const_sptr column) : m_column(std::move(column)) {
     if (!m_column->isType<T>()) {
       std::stringstream mess;
       mess << "Type mismatch when creating a ColumnVector<" << typeid(T).name()
diff --git a/Framework/API/inc/MantidAPI/IndexProperty.h b/Framework/API/inc/MantidAPI/IndexProperty.h
index 99918f926eb..f6261fe2e23 100644
--- a/Framework/API/inc/MantidAPI/IndexProperty.h
+++ b/Framework/API/inc/MantidAPI/IndexProperty.h
@@ -32,7 +32,7 @@ public:
   IndexProperty(const std::string &name,
                 const IWorkspaceProperty &workspaceProp,
                 const IndexTypeProperty &indexTypeProp,
-                Kernel::IValidator_sptr validator =
+                const Kernel::IValidator_sptr &validator =
                     Kernel::IValidator_sptr(new Kernel::NullValidator));
 
   IndexProperty *clone() const override;
diff --git a/Framework/API/inc/MantidAPI/JointDomain.h b/Framework/API/inc/MantidAPI/JointDomain.h
index b027938aeae..1fd5eb6b4ee 100644
--- a/Framework/API/inc/MantidAPI/JointDomain.h
+++ b/Framework/API/inc/MantidAPI/JointDomain.h
@@ -31,7 +31,7 @@ public:
   size_t getNParts() const override;
   /// Return i-th domain
   const FunctionDomain &getDomain(size_t i) const override;
-  void addDomain(FunctionDomain_sptr domain);
+  void addDomain(const FunctionDomain_sptr &domain);
 
 protected:
   /// Vector with member domains.
diff --git a/Framework/API/inc/MantidAPI/MDGeometry.h b/Framework/API/inc/MantidAPI/MDGeometry.h
index d46ecaf2000..d97cbfbe2fe 100644
--- a/Framework/API/inc/MantidAPI/MDGeometry.h
+++ b/Framework/API/inc/MantidAPI/MDGeometry.h
@@ -64,7 +64,8 @@ public:
 
   std::string getGeometryXML() const;
 
-  void addDimension(boost::shared_ptr<Mantid::Geometry::IMDDimension> dim);
+  void
+  addDimension(const boost::shared_ptr<Mantid::Geometry::IMDDimension> &dim);
   void addDimension(Mantid::Geometry::IMDDimension *dim);
 
   // --------------------------------------------------------------------------------------------
diff --git a/Framework/API/inc/MantidAPI/MultiPeriodGroupWorker.h b/Framework/API/inc/MantidAPI/MultiPeriodGroupWorker.h
index 8a68f6fa3d6..e787848a1b6 100644
--- a/Framework/API/inc/MantidAPI/MultiPeriodGroupWorker.h
+++ b/Framework/API/inc/MantidAPI/MultiPeriodGroupWorker.h
@@ -52,7 +52,7 @@ private:
 
   /// Try ot add a workspace to the group of input workspaces.
   void tryAddInputWorkspaceToInputGroups(
-      Workspace_sptr ws, VecWSGroupType &vecMultiPeriodWorkspaceGroups,
+      const Workspace_sptr &ws, VecWSGroupType &vecMultiPeriodWorkspaceGroups,
       VecWSGroupType &vecWorkspaceGroups) const;
 
   /// Copy input workspace properties to spawned algorithm.
diff --git a/Framework/API/inc/MantidAPI/MultipleExperimentInfos.h b/Framework/API/inc/MantidAPI/MultipleExperimentInfos.h
index db9b5c2e68d..58a11c8c6b0 100644
--- a/Framework/API/inc/MantidAPI/MultipleExperimentInfos.h
+++ b/Framework/API/inc/MantidAPI/MultipleExperimentInfos.h
@@ -27,7 +27,7 @@ public:
 
   ExperimentInfo_const_sptr getExperimentInfo(const uint16_t runIndex) const;
 
-  uint16_t addExperimentInfo(ExperimentInfo_sptr ei);
+  uint16_t addExperimentInfo(const ExperimentInfo_sptr &ei);
 
   void setExperimentInfo(const uint16_t runIndex, ExperimentInfo_sptr ei);
 
diff --git a/Framework/API/inc/MantidAPI/NotebookBuilder.h b/Framework/API/inc/MantidAPI/NotebookBuilder.h
index fcd24402872..5e620037130 100644
--- a/Framework/API/inc/MantidAPI/NotebookBuilder.h
+++ b/Framework/API/inc/MantidAPI/NotebookBuilder.h
@@ -26,20 +26,21 @@ namespace API {
 
 class MANTID_API_DLL NotebookBuilder {
 public:
-  NotebookBuilder(boost::shared_ptr<HistoryView> view,
+  NotebookBuilder(const boost::shared_ptr<HistoryView> &view,
                   std::string versionSpecificity = "old");
   virtual ~NotebookBuilder() = default;
   /// build an ipython notebook from the history view
-  const std::string build(std::string ws_name, std::string ws_title,
-                          std::string ws_comment);
+  const std::string build(const std::string &ws_name,
+                          const std::string &ws_title,
+                          const std::string &ws_comment);
 
 private:
   void writeHistoryToStream(std::vector<HistoryItem>::const_iterator &iter);
   void buildChildren(std::vector<HistoryItem>::const_iterator &iter);
   const std::string
-  buildAlgorithmString(AlgorithmHistory_const_sptr algHistory);
-  const std::string
-  buildPropertyString(Mantid::Kernel::PropertyHistory_const_sptr propHistory);
+  buildAlgorithmString(const AlgorithmHistory_const_sptr &algHistory);
+  const std::string buildPropertyString(
+      const Mantid::Kernel::PropertyHistory_const_sptr &propHistory);
 
   const std::vector<HistoryItem> m_historyItems;
   std::string m_output;
diff --git a/Framework/API/inc/MantidAPI/NotebookWriter.h b/Framework/API/inc/MantidAPI/NotebookWriter.h
index 039b58c2af1..d9d914f17e2 100644
--- a/Framework/API/inc/MantidAPI/NotebookWriter.h
+++ b/Framework/API/inc/MantidAPI/NotebookWriter.h
@@ -24,8 +24,8 @@ class MANTID_API_DLL NotebookWriter {
 public:
   NotebookWriter();
   virtual ~NotebookWriter() = default;
-  std::string markdownCell(std::string string_text);
-  std::string codeCell(std::string string_code);
+  std::string markdownCell(const std::string &string_text);
+  std::string codeCell(const std::string &string_code);
   std::string writeNotebook();
 
 private:
diff --git a/Framework/API/inc/MantidAPI/RemoteJobManagerFactory.h b/Framework/API/inc/MantidAPI/RemoteJobManagerFactory.h
index 30a18555469..5646d0da63e 100644
--- a/Framework/API/inc/MantidAPI/RemoteJobManagerFactory.h
+++ b/Framework/API/inc/MantidAPI/RemoteJobManagerFactory.h
@@ -47,8 +47,8 @@ public:
 
   /// alternative (lower level) create where the specific type of
   /// manager and base URL are directly given
-  IRemoteJobManager_sptr create(const std::string baseURL,
-                                const std::string jobManagerType) const;
+  IRemoteJobManager_sptr create(const std::string &baseURL,
+                                const std::string &jobManagerType) const;
 
 private:
   /// So that the singleton can be created (cons/destructor are private)
diff --git a/Framework/API/inc/MantidAPI/Sample.h b/Framework/API/inc/MantidAPI/Sample.h
index 5004a47d8e0..dc70c2391fa 100644
--- a/Framework/API/inc/MantidAPI/Sample.h
+++ b/Framework/API/inc/MantidAPI/Sample.h
@@ -45,7 +45,7 @@ public:
   /// the number of samples
   std::size_t size() const;
   /// Adds a sample to the list
-  void addSample(boost::shared_ptr<Sample> childSample);
+  void addSample(const boost::shared_ptr<Sample> &childSample);
 
   /// Returns the name of the sample
   const std::string &getName() const;
diff --git a/Framework/API/inc/MantidAPI/ScopedWorkspace.h b/Framework/API/inc/MantidAPI/ScopedWorkspace.h
index e8e513de799..00ddb510e2b 100644
--- a/Framework/API/inc/MantidAPI/ScopedWorkspace.h
+++ b/Framework/API/inc/MantidAPI/ScopedWorkspace.h
@@ -37,7 +37,7 @@ public:
   ScopedWorkspace();
 
   /// Workspace constructor
-  ScopedWorkspace(Workspace_sptr ws);
+  ScopedWorkspace(const Workspace_sptr &ws);
 
   /// Destructor
   virtual ~ScopedWorkspace();
@@ -61,7 +61,7 @@ public:
   operator bool() const;
 
   /// Make ADS entry to point to the given workspace
-  void set(Workspace_sptr newWS);
+  void set(const Workspace_sptr &newWS);
 
 private:
   /// ADS name of the workspace
diff --git a/Framework/API/inc/MantidAPI/ScriptBuilder.h b/Framework/API/inc/MantidAPI/ScriptBuilder.h
index e852d99d7da..eba2f95a206 100644
--- a/Framework/API/inc/MantidAPI/ScriptBuilder.h
+++ b/Framework/API/inc/MantidAPI/ScriptBuilder.h
@@ -31,7 +31,7 @@ namespace API {
 class MANTID_API_DLL ScriptBuilder {
 public:
   ScriptBuilder(
-      boost::shared_ptr<HistoryView> view,
+      const boost::shared_ptr<HistoryView> &view,
       std::string versionSpecificity = "old", bool appendTimestamp = false,
       std::vector<std::string> ignoreTheseAlgs = {},
       std::vector<std::vector<std::string>> ignoreTheseAlgProperties = {},
diff --git a/Framework/API/inc/MantidAPI/SpectrumDetectorMapping.h b/Framework/API/inc/MantidAPI/SpectrumDetectorMapping.h
index 2f2b218194e..08885eb4bc9 100644
--- a/Framework/API/inc/MantidAPI/SpectrumDetectorMapping.h
+++ b/Framework/API/inc/MantidAPI/SpectrumDetectorMapping.h
@@ -31,7 +31,7 @@ class MANTID_API_DLL SpectrumDetectorMapping {
   using sdmap = std::unordered_map<specnum_t, std::set<detid_t>>;
 
 public:
-  explicit SpectrumDetectorMapping(MatrixWorkspace_const_sptr workspace,
+  explicit SpectrumDetectorMapping(const MatrixWorkspace_const_sptr &workspace,
                                    const bool useSpecNoIndex = true);
   SpectrumDetectorMapping(
       const std::vector<specnum_t> &spectrumNumbers,
diff --git a/Framework/API/inc/MantidAPI/WorkspaceHistory.h b/Framework/API/inc/MantidAPI/WorkspaceHistory.h
index cc7097afbf9..153651206cc 100644
--- a/Framework/API/inc/MantidAPI/WorkspaceHistory.h
+++ b/Framework/API/inc/MantidAPI/WorkspaceHistory.h
@@ -79,9 +79,9 @@ public:
 
 private:
   /// Recursive function to load the algorithm history tree from file
-  void loadNestedHistory(
-      ::NeXus::File *file,
-      AlgorithmHistory_sptr parent = boost::shared_ptr<AlgorithmHistory>());
+  void loadNestedHistory(::NeXus::File *file,
+                         const AlgorithmHistory_sptr &parent =
+                             boost::shared_ptr<AlgorithmHistory>());
   /// Parse an algorithm history string loaded from file
   AlgorithmHistory_sptr parseAlgorithmHistory(const std::string &rawData);
   /// Find the history entries at this level in the file.
diff --git a/Framework/API/inc/MantidAPI/WorkspaceOpOverloads.h b/Framework/API/inc/MantidAPI/WorkspaceOpOverloads.h
index 06eaa10debe..f40c7b19dbe 100644
--- a/Framework/API/inc/MantidAPI/WorkspaceOpOverloads.h
+++ b/Framework/API/inc/MantidAPI/WorkspaceOpOverloads.h
@@ -22,51 +22,51 @@ DLLExport ResultType executeBinaryOperation(
     bool rethrow = false);
 } // namespace OperatorOverloads
 
-bool MANTID_API_DLL equals(const MatrixWorkspace_sptr lhs,
-                           const MatrixWorkspace_sptr rhs,
+bool MANTID_API_DLL equals(const MatrixWorkspace_sptr &lhs,
+                           const MatrixWorkspace_sptr &rhs,
                            double tolerance = 0.0);
 
 // Workspace operator overloads
-MatrixWorkspace_sptr MANTID_API_DLL operator+(const MatrixWorkspace_sptr lhs,
-                                              const MatrixWorkspace_sptr rhs);
-MatrixWorkspace_sptr MANTID_API_DLL operator-(const MatrixWorkspace_sptr lhs,
-                                              const MatrixWorkspace_sptr rhs);
-MatrixWorkspace_sptr MANTID_API_DLL operator*(const MatrixWorkspace_sptr lhs,
-                                              const MatrixWorkspace_sptr rhs);
-MatrixWorkspace_sptr MANTID_API_DLL operator/(const MatrixWorkspace_sptr lhs,
-                                              const MatrixWorkspace_sptr rhs);
+MatrixWorkspace_sptr MANTID_API_DLL operator+(const MatrixWorkspace_sptr &lhs,
+                                              const MatrixWorkspace_sptr &rhs);
+MatrixWorkspace_sptr MANTID_API_DLL operator-(const MatrixWorkspace_sptr &lhs,
+                                              const MatrixWorkspace_sptr &rhs);
+MatrixWorkspace_sptr MANTID_API_DLL operator*(const MatrixWorkspace_sptr &lhs,
+                                              const MatrixWorkspace_sptr &rhs);
+MatrixWorkspace_sptr MANTID_API_DLL operator/(const MatrixWorkspace_sptr &lhs,
+                                              const MatrixWorkspace_sptr &rhs);
 
-MatrixWorkspace_sptr MANTID_API_DLL operator+(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr MANTID_API_DLL operator+(const MatrixWorkspace_sptr &lhs,
                                               const double &rhsValue);
-MatrixWorkspace_sptr MANTID_API_DLL operator-(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr MANTID_API_DLL operator-(const MatrixWorkspace_sptr &lhs,
                                               const double &rhsValue);
 MatrixWorkspace_sptr MANTID_API_DLL operator-(const double &lhsValue,
-                                              const MatrixWorkspace_sptr rhs);
-MatrixWorkspace_sptr MANTID_API_DLL operator*(const MatrixWorkspace_sptr lhs,
+                                              const MatrixWorkspace_sptr &rhs);
+MatrixWorkspace_sptr MANTID_API_DLL operator*(const MatrixWorkspace_sptr &lhs,
                                               const double &rhsValue);
 MatrixWorkspace_sptr MANTID_API_DLL operator*(const double &lhsValue,
-                                              const MatrixWorkspace_sptr rhs);
-MatrixWorkspace_sptr MANTID_API_DLL operator/(const MatrixWorkspace_sptr lhs,
+                                              const MatrixWorkspace_sptr &rhs);
+MatrixWorkspace_sptr MANTID_API_DLL operator/(const MatrixWorkspace_sptr &lhs,
                                               const double &rhsValue);
 MatrixWorkspace_sptr MANTID_API_DLL operator/(const double &lhsValue,
-                                              const MatrixWorkspace_sptr rhs);
+                                              const MatrixWorkspace_sptr &rhs);
 
-MatrixWorkspace_sptr MANTID_API_DLL operator+=(const MatrixWorkspace_sptr lhs,
-                                               const MatrixWorkspace_sptr rhs);
-MatrixWorkspace_sptr MANTID_API_DLL operator-=(const MatrixWorkspace_sptr lhs,
-                                               const MatrixWorkspace_sptr rhs);
-MatrixWorkspace_sptr MANTID_API_DLL operator*=(const MatrixWorkspace_sptr lhs,
-                                               const MatrixWorkspace_sptr rhs);
-MatrixWorkspace_sptr MANTID_API_DLL operator/=(const MatrixWorkspace_sptr lhs,
-                                               const MatrixWorkspace_sptr rhs);
+MatrixWorkspace_sptr MANTID_API_DLL operator+=(const MatrixWorkspace_sptr &lhs,
+                                               const MatrixWorkspace_sptr &rhs);
+MatrixWorkspace_sptr MANTID_API_DLL operator-=(const MatrixWorkspace_sptr &lhs,
+                                               const MatrixWorkspace_sptr &rhs);
+MatrixWorkspace_sptr MANTID_API_DLL operator*=(const MatrixWorkspace_sptr &lhs,
+                                               const MatrixWorkspace_sptr &rhs);
+MatrixWorkspace_sptr MANTID_API_DLL operator/=(const MatrixWorkspace_sptr &lhs,
+                                               const MatrixWorkspace_sptr &rhs);
 
-MatrixWorkspace_sptr MANTID_API_DLL operator+=(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr MANTID_API_DLL operator+=(const MatrixWorkspace_sptr &lhs,
                                                const double &rhsValue);
-MatrixWorkspace_sptr MANTID_API_DLL operator-=(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr MANTID_API_DLL operator-=(const MatrixWorkspace_sptr &lhs,
                                                const double &rhsValue);
-MatrixWorkspace_sptr MANTID_API_DLL operator*=(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr MANTID_API_DLL operator*=(const MatrixWorkspace_sptr &lhs,
                                                const double &rhsValue);
-MatrixWorkspace_sptr MANTID_API_DLL operator/=(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr MANTID_API_DLL operator/=(const MatrixWorkspace_sptr &lhs,
                                                const double &rhsValue);
 
 /** A collection of static functions for use with workspaces
@@ -83,7 +83,7 @@ struct MANTID_API_DLL WorkspaceHelpers {
   static bool sharedXData(const MatrixWorkspace &WS);
   // Divides the data in a workspace by the bin width to make it a distribution
   // (or the reverse)
-  static void makeDistribution(MatrixWorkspace_sptr workspace,
+  static void makeDistribution(const MatrixWorkspace_sptr &workspace,
                                const bool forwards = true);
 };
 
diff --git a/Framework/API/inc/MantidAPI/WorkspaceProperty.h b/Framework/API/inc/MantidAPI/WorkspaceProperty.h
index 487b29032f5..0b0a32d2c3b 100644
--- a/Framework/API/inc/MantidAPI/WorkspaceProperty.h
+++ b/Framework/API/inc/MantidAPI/WorkspaceProperty.h
@@ -59,20 +59,20 @@ public:
   explicit WorkspaceProperty(
       const std::string &name, const std::string &wsName,
       const unsigned int direction,
-      Kernel::IValidator_sptr validator =
+      const Kernel::IValidator_sptr &validator =
           Kernel::IValidator_sptr(new Kernel::NullValidator));
 
   explicit WorkspaceProperty(
       const std::string &name, const std::string &wsName,
       const unsigned int direction, const PropertyMode::Type optional,
-      Kernel::IValidator_sptr validator =
+      const Kernel::IValidator_sptr &validator =
           Kernel::IValidator_sptr(new Kernel::NullValidator));
 
   explicit WorkspaceProperty(
       const std::string &name, const std::string &wsName,
       const unsigned int direction, const PropertyMode::Type optional,
       const LockMode::Type locking,
-      Kernel::IValidator_sptr validator =
+      const Kernel::IValidator_sptr &validator =
           Kernel::IValidator_sptr(new Kernel::NullValidator));
 
   WorkspaceProperty(const WorkspaceProperty &right);
@@ -118,7 +118,8 @@ public:
   void setIsMasterRank(bool isMasterRank) override;
 
 private:
-  std::string isValidGroup(boost::shared_ptr<WorkspaceGroup> wsGroup) const;
+  std::string
+  isValidGroup(const boost::shared_ptr<WorkspaceGroup> &wsGroup) const;
 
   std::string isValidOutputWs() const;
 
diff --git a/Framework/API/inc/MantidAPI/WorkspaceProperty.tcc b/Framework/API/inc/MantidAPI/WorkspaceProperty.tcc
index b60627596e4..6908bc7a6c2 100644
--- a/Framework/API/inc/MantidAPI/WorkspaceProperty.tcc
+++ b/Framework/API/inc/MantidAPI/WorkspaceProperty.tcc
@@ -29,10 +29,9 @@ namespace API {
  * Direction enum (i.e. 0-2)
  */
 template <typename TYPE>
-WorkspaceProperty<TYPE>::WorkspaceProperty(const std::string &name,
-                                           const std::string &wsName,
-                                           const unsigned int direction,
-                                           Kernel::IValidator_sptr validator)
+WorkspaceProperty<TYPE>::WorkspaceProperty(
+    const std::string &name, const std::string &wsName,
+    const unsigned int direction, const Kernel::IValidator_sptr &validator)
     : Kernel::PropertyWithValue<boost::shared_ptr<TYPE>>(
           name, boost::shared_ptr<TYPE>(), validator, direction),
       m_workspaceName(wsName), m_initialWSName(wsName),
@@ -51,11 +50,10 @@ WorkspaceProperty<TYPE>::WorkspaceProperty(const std::string &name,
  * Direction enum (i.e. 0-2)
  */
 template <typename TYPE>
-WorkspaceProperty<TYPE>::WorkspaceProperty(const std::string &name,
-                                           const std::string &wsName,
-                                           const unsigned int direction,
-                                           const PropertyMode::Type optional,
-                                           Kernel::IValidator_sptr validator)
+WorkspaceProperty<TYPE>::WorkspaceProperty(
+    const std::string &name, const std::string &wsName,
+    const unsigned int direction, const PropertyMode::Type optional,
+    const Kernel::IValidator_sptr &validator)
     : Kernel::PropertyWithValue<boost::shared_ptr<TYPE>>(
           name, boost::shared_ptr<TYPE>(), validator, direction),
       m_workspaceName(wsName), m_initialWSName(wsName), m_optional(optional),
@@ -78,12 +76,10 @@ WorkspaceProperty<TYPE>::WorkspaceProperty(const std::string &name,
  * Direction enum (i.e. 0-2)
  */
 template <typename TYPE>
-WorkspaceProperty<TYPE>::WorkspaceProperty(const std::string &name,
-                                           const std::string &wsName,
-                                           const unsigned int direction,
-                                           const PropertyMode::Type optional,
-                                           const LockMode::Type locking,
-                                           Kernel::IValidator_sptr validator)
+WorkspaceProperty<TYPE>::WorkspaceProperty(
+    const std::string &name, const std::string &wsName,
+    const unsigned int direction, const PropertyMode::Type optional,
+    const LockMode::Type locking, const Kernel::IValidator_sptr &validator)
     : Kernel::PropertyWithValue<boost::shared_ptr<TYPE>>(
           name, boost::shared_ptr<TYPE>(), validator, direction),
       m_workspaceName(wsName), m_initialWSName(wsName), m_optional(optional),
@@ -410,7 +406,7 @@ void WorkspaceProperty<TYPE>::setIsMasterRank(bool isMasterRank) {
  */
 template <typename TYPE>
 std::string WorkspaceProperty<TYPE>::isValidGroup(
-    boost::shared_ptr<WorkspaceGroup> wsGroup) const {
+    const boost::shared_ptr<WorkspaceGroup> &wsGroup) const {
   g_log.debug() << " Input WorkspaceGroup found \n";
 
   std::vector<std::string> wsGroupNames = wsGroup->getNames();
diff --git a/Framework/API/src/Algorithm.cpp b/Framework/API/src/Algorithm.cpp
index 1bd805d03f9..8a96b5f4619 100644
--- a/Framework/API/src/Algorithm.cpp
+++ b/Framework/API/src/Algorithm.cpp
@@ -39,6 +39,7 @@
 #include <json/json.h>
 
 #include <map>
+#include <utility>
 
 // Index property handling template definitions
 #include "MantidAPI/Algorithm.tcc"
@@ -845,7 +846,7 @@ Algorithm_sptr Algorithm::createChildAlgorithm(const std::string &name,
  * Can also be used manually for algorithms created otherwise. This allows
  * running algorithms that are not declared into the factory as child
  * algorithms. */
-void Algorithm::setupAsChildAlgorithm(Algorithm_sptr alg,
+void Algorithm::setupAsChildAlgorithm(const Algorithm_sptr &alg,
                                       const double startProgress,
                                       const double endProgress,
                                       const bool enableLogging) {
@@ -1077,7 +1078,7 @@ void Algorithm::linkHistoryWithLastChild() {
 void Algorithm::trackAlgorithmHistory(
     boost::shared_ptr<AlgorithmHistory> parentHist) {
   enableHistoryRecordingForChild(true);
-  m_parentHistory = parentHist;
+  m_parentHistory = std::move(parentHist);
 }
 
 /** Check if we are tracking history for this algorithm
diff --git a/Framework/API/src/AlgorithmFactory.cpp b/Framework/API/src/AlgorithmFactory.cpp
index 778a83eba06..5379a1b6dfc 100644
--- a/Framework/API/src/AlgorithmFactory.cpp
+++ b/Framework/API/src/AlgorithmFactory.cpp
@@ -406,7 +406,7 @@ void AlgorithmFactoryImpl::fillHiddenCategories(
  * @returns the name of the algroithm
  */
 const std::string AlgorithmFactoryImpl::extractAlgName(
-    const boost::shared_ptr<IAlgorithm> alg) const {
+    const boost::shared_ptr<IAlgorithm> &alg) const {
   return alg->name();
 }
 
@@ -415,7 +415,7 @@ const std::string AlgorithmFactoryImpl::extractAlgName(
  * @returns the version of the algroithm
  */
 int AlgorithmFactoryImpl::extractAlgVersion(
-    const boost::shared_ptr<IAlgorithm> alg) const {
+    const boost::shared_ptr<IAlgorithm> &alg) const {
   return alg->version();
 }
 
diff --git a/Framework/API/src/AlgorithmHistory.cpp b/Framework/API/src/AlgorithmHistory.cpp
index 388b498f030..fd4208da5e5 100644
--- a/Framework/API/src/AlgorithmHistory.cpp
+++ b/Framework/API/src/AlgorithmHistory.cpp
@@ -21,6 +21,7 @@
 #include <boost/uuid/uuid_generators.hpp>
 #include <boost/uuid/uuid_io.hpp>
 #include <sstream>
+#include <utility>
 
 namespace Mantid {
 namespace API {
@@ -85,7 +86,7 @@ AlgorithmHistory::AlgorithmHistory(const std::string &name, int vers,
                                    std::size_t uexeccount)
     : m_name(name), m_version(vers), m_executionDate(start),
       m_executionDuration(duration), m_execCount(uexeccount),
-      m_childHistories(), m_uuid(uuid) {}
+      m_childHistories(), m_uuid(std::move(uuid)) {}
 
 /**
  *  Set the history properties for an algorithm pointer
@@ -162,7 +163,7 @@ void AlgorithmHistory::addProperty(const std::string &name,
 /** Add a child algorithm history to history
  *  @param childHist :: The child history
  */
-void AlgorithmHistory::addChildHistory(AlgorithmHistory_sptr childHist) {
+void AlgorithmHistory::addChildHistory(const AlgorithmHistory_sptr &childHist) {
   // Don't copy one's own history onto oneself
   if (this == &(*childHist)) {
     return;
diff --git a/Framework/API/src/AlgorithmObserver.cpp b/Framework/API/src/AlgorithmObserver.cpp
index d8bd534c920..5fb257a1a9a 100644
--- a/Framework/API/src/AlgorithmObserver.cpp
+++ b/Framework/API/src/AlgorithmObserver.cpp
@@ -7,8 +7,10 @@
 //----------------------------------------------------------------------
 // Includes
 //----------------------------------------------------------------------
-#include "MantidAPI/AlgorithmObserver.h"
+#include <utility>
+
 #include "MantidAPI/AlgorithmManager.h"
+#include "MantidAPI/AlgorithmObserver.h"
 
 namespace Mantid {
 namespace API {
@@ -26,13 +28,13 @@ AlgorithmObserver::AlgorithmObserver()
 alg.
   @param alg :: Algorithm to be observed
 */
-AlgorithmObserver::AlgorithmObserver(IAlgorithm_const_sptr alg)
+AlgorithmObserver::AlgorithmObserver(const IAlgorithm_const_sptr &alg)
     : m_progressObserver(*this, &AlgorithmObserver::_progressHandle),
       m_startObserver(*this, &AlgorithmObserver::_startHandle),
       m_finishObserver(*this, &AlgorithmObserver::_finishHandle),
       m_errorObserver(*this, &AlgorithmObserver::_errorHandle),
       m_startingObserver(*this, &AlgorithmObserver::_startingHandle) {
-  observeAll(alg);
+  observeAll(std::move(alg));
 }
 
 /// Virtual destructor
@@ -41,7 +43,7 @@ AlgorithmObserver::~AlgorithmObserver() = default;
 /**   Connect to algorithm alg and observe all its notifications
   @param alg :: Algorithm to be observed
 */
-void AlgorithmObserver::observeAll(IAlgorithm_const_sptr alg) {
+void AlgorithmObserver::observeAll(const IAlgorithm_const_sptr &alg) {
   alg->addObserver(m_progressObserver);
   alg->addObserver(m_startObserver);
   alg->addObserver(m_finishObserver);
@@ -51,7 +53,7 @@ void AlgorithmObserver::observeAll(IAlgorithm_const_sptr alg) {
 /**   Connect to algorithm alg and observe its progress notification
   @param alg :: Algorithm to be observed
 */
-void AlgorithmObserver::observeProgress(IAlgorithm_const_sptr alg) {
+void AlgorithmObserver::observeProgress(const IAlgorithm_const_sptr &alg) {
   alg->addObserver(m_progressObserver);
 }
 
@@ -65,21 +67,21 @@ void AlgorithmObserver::observeStarting() {
 /**   Connect to algorithm alg and observe its start notification
   @param alg :: Algorithm to be observed
 */
-void AlgorithmObserver::observeStart(IAlgorithm_const_sptr alg) {
+void AlgorithmObserver::observeStart(const IAlgorithm_const_sptr &alg) {
   alg->addObserver(m_startObserver);
 }
 
 /**   Connect to algorithm alg and observe its finish notification
   @param alg :: Algorithm to be observed
 */
-void AlgorithmObserver::observeFinish(IAlgorithm_const_sptr alg) {
+void AlgorithmObserver::observeFinish(const IAlgorithm_const_sptr &alg) {
   alg->addObserver(m_finishObserver);
 }
 
 /**   Connect to algorithm alg and observe its error notification
   @param alg :: Algorithm to be observed
 */
-void AlgorithmObserver::observeError(IAlgorithm_const_sptr alg) {
+void AlgorithmObserver::observeError(const IAlgorithm_const_sptr &alg) {
   alg->addObserver(m_errorObserver);
 }
 
@@ -87,7 +89,7 @@ void AlgorithmObserver::observeError(IAlgorithm_const_sptr alg) {
 inherited classes.
   @param alg :: Algorithm to be disconnected
 */
-void AlgorithmObserver::stopObserving(IAlgorithm_const_sptr alg) {
+void AlgorithmObserver::stopObserving(const IAlgorithm_const_sptr &alg) {
   this->stopObserving(alg.get());
 }
 
diff --git a/Framework/API/src/AlgorithmProperty.cpp b/Framework/API/src/AlgorithmProperty.cpp
index 31e3f471c89..512ae7a5bfe 100644
--- a/Framework/API/src/AlgorithmProperty.cpp
+++ b/Framework/API/src/AlgorithmProperty.cpp
@@ -12,6 +12,8 @@
 
 #include <json/value.h>
 
+#include <utility>
+
 namespace Mantid {
 namespace API {
 
@@ -29,8 +31,8 @@ namespace API {
 AlgorithmProperty::AlgorithmProperty(const std::string &propName,
                                      Kernel::IValidator_sptr validator,
                                      unsigned int direction)
-    : Kernel::PropertyWithValue<HeldType>(propName, HeldType(), validator,
-                                          direction),
+    : Kernel::PropertyWithValue<HeldType>(propName, HeldType(),
+                                          std::move(validator), direction),
       m_algmStr() {}
 
 /**
diff --git a/Framework/API/src/AlgorithmProxy.cpp b/Framework/API/src/AlgorithmProxy.cpp
index 4730a275f43..876a9b51d1b 100644
--- a/Framework/API/src/AlgorithmProxy.cpp
+++ b/Framework/API/src/AlgorithmProxy.cpp
@@ -21,7 +21,7 @@ namespace Mantid {
 namespace API {
 
 /// Constructor
-AlgorithmProxy::AlgorithmProxy(Algorithm_sptr alg)
+AlgorithmProxy::AlgorithmProxy(const Algorithm_sptr &alg)
     : PropertyManagerOwner(),
       m_executeAsync(new Poco::ActiveMethod<bool, Poco::Void, AlgorithmProxy>(
           this, &AlgorithmProxy::executeAsyncImpl)),
diff --git a/Framework/API/src/BoostOptionalToAlgorithmProperty.cpp b/Framework/API/src/BoostOptionalToAlgorithmProperty.cpp
index 109e56d0a3a..ca6898c604e 100644
--- a/Framework/API/src/BoostOptionalToAlgorithmProperty.cpp
+++ b/Framework/API/src/BoostOptionalToAlgorithmProperty.cpp
@@ -10,8 +10,9 @@ namespace Mantid {
 namespace API {
 template <>
 std::string checkForMandatoryInstrumentDefault(
-    Mantid::API::Algorithm *const alg, std::string propName,
-    Mantid::Geometry::Instrument_const_sptr instrument, std::string idf_name) {
+    Mantid::API::Algorithm *const alg, const std::string &propName,
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
+    const std::string &idf_name) {
   auto algProperty = alg->getPointerToProperty(propName);
   if (algProperty->isDefault()) {
     auto defaults = instrument->getStringParameter(idf_name);
@@ -28,8 +29,9 @@ std::string checkForMandatoryInstrumentDefault(
 
 template <>
 boost::optional<std::string> checkForOptionalInstrumentDefault(
-    Mantid::API::Algorithm *const alg, std::string propName,
-    Mantid::Geometry::Instrument_const_sptr instrument, std::string idf_name) {
+    Mantid::API::Algorithm *const alg, const std::string &propName,
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
+    const std::string &idf_name) {
   auto algProperty = alg->getPointerToProperty(propName);
   if (algProperty->isDefault()) {
     auto defaults = instrument->getStringParameter(idf_name);
diff --git a/Framework/API/src/BoxController.cpp b/Framework/API/src/BoxController.cpp
index 16e8a31e11b..1590696cb4c 100644
--- a/Framework/API/src/BoxController.cpp
+++ b/Framework/API/src/BoxController.cpp
@@ -296,8 +296,9 @@ void BoxController::clearFileBacked() {
  *@param fileName  -- if newFileIO comes without opened file, this is the file
  *name to open for the file based IO operations
  */
-void BoxController::setFileBacked(boost::shared_ptr<IBoxControllerIO> newFileIO,
-                                  const std::string &fileName) {
+void BoxController::setFileBacked(
+    const boost::shared_ptr<IBoxControllerIO> &newFileIO,
+    const std::string &fileName) {
   if (!newFileIO->isOpened())
     newFileIO->openFile(fileName, "w");
 
diff --git a/Framework/API/src/CompositeCatalog.cpp b/Framework/API/src/CompositeCatalog.cpp
index d6e50e3b97d..f838b719ca0 100644
--- a/Framework/API/src/CompositeCatalog.cpp
+++ b/Framework/API/src/CompositeCatalog.cpp
@@ -16,7 +16,7 @@ CompositeCatalog::CompositeCatalog() : m_catalogs() {}
  * Add a catalog to the catalog container.
  * @param catalog :: The catalog to add to the container.
  */
-void CompositeCatalog::add(const ICatalog_sptr catalog) {
+void CompositeCatalog::add(const ICatalog_sptr &catalog) {
   m_catalogs.emplace_back(catalog);
 }
 
diff --git a/Framework/API/src/CompositeDomainMD.cpp b/Framework/API/src/CompositeDomainMD.cpp
index cd4ac347923..6762e9be597 100644
--- a/Framework/API/src/CompositeDomainMD.cpp
+++ b/Framework/API/src/CompositeDomainMD.cpp
@@ -21,7 +21,7 @@ namespace API {
  * @param ws :: Pointer to a workspace.
  * @param maxDomainSize :: The maximum size each domain can have.
  */
-CompositeDomainMD::CompositeDomainMD(IMDWorkspace_const_sptr ws,
+CompositeDomainMD::CompositeDomainMD(const IMDWorkspace_const_sptr &ws,
                                      size_t maxDomainSize)
     : m_iterator(ws->createIterator()) {
   m_totalSize = m_iterator->getDataSize();
diff --git a/Framework/API/src/CompositeFunction.cpp b/Framework/API/src/CompositeFunction.cpp
index ec17675164b..39c4976ea00 100644
--- a/Framework/API/src/CompositeFunction.cpp
+++ b/Framework/API/src/CompositeFunction.cpp
@@ -19,6 +19,7 @@
 #include <boost/lexical_cast.hpp>
 #include <boost/shared_array.hpp>
 #include <sstream>
+#include <utility>
 
 namespace Mantid {
 namespace API {
@@ -468,21 +469,21 @@ void CompositeFunction::removeFunction(size_t i) {
  *  a member of this composite function nothing happens
  * @param f_new :: A pointer to the new function
  */
-void CompositeFunction::replaceFunctionPtr(const IFunction_sptr f_old,
-                                           IFunction_sptr f_new) {
+void CompositeFunction::replaceFunctionPtr(const IFunction_sptr &f_old,
+                                           const IFunction_sptr &f_new) {
   std::vector<IFunction_sptr>::const_iterator it =
       std::find(m_functions.begin(), m_functions.end(), f_old);
   if (it == m_functions.end())
     return;
   std::vector<IFunction_sptr>::difference_type iFun = it - m_functions.begin();
-  replaceFunction(iFun, f_new);
+  replaceFunction(iFun, std::move(f_new));
 }
 
 /** Replace a function with a new one. The old function is deleted.
  * @param i :: The index of the function to replace
  * @param f :: A pointer to the new function
  */
-void CompositeFunction::replaceFunction(size_t i, IFunction_sptr f) {
+void CompositeFunction::replaceFunction(size_t i, const IFunction_sptr &f) {
   if (i >= nFunctions()) {
     throw std::out_of_range("Function index (" + std::to_string(i) +
                             ") out of range (" + std::to_string(nFunctions()) +
diff --git a/Framework/API/src/DataProcessorAlgorithm.cpp b/Framework/API/src/DataProcessorAlgorithm.cpp
index 4f82c06e981..ebd21763b9c 100644
--- a/Framework/API/src/DataProcessorAlgorithm.cpp
+++ b/Framework/API/src/DataProcessorAlgorithm.cpp
@@ -19,6 +19,8 @@
 #include "MantidKernel/System.h"
 #include "Poco/Path.h"
 #include <stdexcept>
+#include <utility>
+
 #ifdef MPI_BUILD
 #include <boost/mpi.hpp>
 #endif
@@ -135,7 +137,7 @@ void GenericDataProcessorAlgorithm<Base>::mapPropertyName(
  */
 template <class Base>
 void GenericDataProcessorAlgorithm<Base>::copyProperty(
-    API::Algorithm_sptr alg, const std::string &name) {
+    const API::Algorithm_sptr &alg, const std::string &name) {
   if (!alg->existsProperty(name)) {
     std::stringstream msg;
     msg << "Algorithm \"" << alg->name() << "\" does not have property \""
@@ -232,7 +234,7 @@ GenericDataProcessorAlgorithm<Base>::loadChunk(const size_t rowIndex) {
 template <class Base>
 Workspace_sptr
 GenericDataProcessorAlgorithm<Base>::assemble(Workspace_sptr partialWS) {
-  Workspace_sptr outputWS = partialWS;
+  Workspace_sptr outputWS = std::move(partialWS);
 #ifdef MPI_BUILD
   IAlgorithm_sptr gatherAlg = createChildAlgorithm("GatherWorkspaces");
   gatherAlg->setLogging(true);
diff --git a/Framework/API/src/DetectorSearcher.cpp b/Framework/API/src/DetectorSearcher.cpp
index a183c4841f6..cd25bce0e98 100644
--- a/Framework/API/src/DetectorSearcher.cpp
+++ b/Framework/API/src/DetectorSearcher.cpp
@@ -30,8 +30,9 @@ double getQSign() {
  * @param instrument :: the instrument to find detectors in
  * @param detInfo :: the Geometry::DetectorInfo object for this instrument
  */
-DetectorSearcher::DetectorSearcher(Geometry::Instrument_const_sptr instrument,
-                                   const Geometry::DetectorInfo &detInfo)
+DetectorSearcher::DetectorSearcher(
+    const Geometry::Instrument_const_sptr &instrument,
+    const Geometry::DetectorInfo &detInfo)
     : m_usingFullRayTrace(instrument->containsRectDetectors() ==
                           Geometry::Instrument::ContainsState::Full),
       m_crystallography_convention(getQSign()), m_detInfo(detInfo),
diff --git a/Framework/API/src/ExperimentInfo.cpp b/Framework/API/src/ExperimentInfo.cpp
index f369dad741b..5310526a330 100644
--- a/Framework/API/src/ExperimentInfo.cpp
+++ b/Framework/API/src/ExperimentInfo.cpp
@@ -711,7 +711,7 @@ double ExperimentInfo::getEFixed(const detid_t detID) const {
  * @return The current efixed value
  */
 double ExperimentInfo::getEFixed(
-    const boost::shared_ptr<const Geometry::IDetector> detector) const {
+    const boost::shared_ptr<const Geometry::IDetector> &detector) const {
   populateIfNotLoaded();
   Kernel::DeltaEMode::Type emode = getEMode();
   if (emode == Kernel::DeltaEMode::Direct) {
diff --git a/Framework/API/src/FunctionDomainGeneral.cpp b/Framework/API/src/FunctionDomainGeneral.cpp
index 6be66bafb29..7000ed1580f 100644
--- a/Framework/API/src/FunctionDomainGeneral.cpp
+++ b/Framework/API/src/FunctionDomainGeneral.cpp
@@ -22,7 +22,7 @@ size_t FunctionDomainGeneral::size() const {
 size_t FunctionDomainGeneral::columnCount() const { return m_columns.size(); }
 
 /// Add a new column. All columns must have the same size.
-void FunctionDomainGeneral::addColumn(boost::shared_ptr<Column> column) {
+void FunctionDomainGeneral::addColumn(const boost::shared_ptr<Column> &column) {
   if (!column) {
     throw std::runtime_error(
         "Cannot add null column to FunctionDomainGeneral.");
diff --git a/Framework/API/src/FunctionDomainMD.cpp b/Framework/API/src/FunctionDomainMD.cpp
index 4dab31a2fae..51cf298b927 100644
--- a/Framework/API/src/FunctionDomainMD.cpp
+++ b/Framework/API/src/FunctionDomainMD.cpp
@@ -21,8 +21,8 @@ namespace API {
  * @param start :: Index of the first iterator in this domain.
  * @param length :: Size of this domain. If 0 use all workspace.
  */
-FunctionDomainMD::FunctionDomainMD(IMDWorkspace_const_sptr ws, size_t start,
-                                   size_t length)
+FunctionDomainMD::FunctionDomainMD(const IMDWorkspace_const_sptr &ws,
+                                   size_t start, size_t length)
     : m_iterator(ws->createIterator()), m_startIndex(start), m_currentIndex(0),
       m_justReset(true), m_workspace(ws) {
   size_t dataSize = m_iterator->getDataSize();
diff --git a/Framework/API/src/FunctionFactory.cpp b/Framework/API/src/FunctionFactory.cpp
index 79936f3668d..9ada8ccf36c 100644
--- a/Framework/API/src/FunctionFactory.cpp
+++ b/Framework/API/src/FunctionFactory.cpp
@@ -271,7 +271,7 @@ void FunctionFactoryImpl::inputError(const std::string &str) const {
  * separated by commas ','
  *    and enclosed in brackets "(...)" .
  */
-void FunctionFactoryImpl::addConstraints(IFunction_sptr fun,
+void FunctionFactoryImpl::addConstraints(const IFunction_sptr &fun,
                                          const Expression &expr) const {
   if (expr.name() == ",") {
     for (auto it = expr.begin(); it != expr.end(); ++it) {
@@ -305,7 +305,7 @@ void FunctionFactoryImpl::addConstraints(IFunction_sptr fun,
  * @param fun :: The function
  * @param expr :: The constraint expression.
  */
-void FunctionFactoryImpl::addConstraint(boost::shared_ptr<IFunction> fun,
+void FunctionFactoryImpl::addConstraint(const boost::shared_ptr<IFunction> &fun,
                                         const Expression &expr) const {
   auto c = std::unique_ptr<IConstraint>(
       ConstraintFactory::Instance().createInitialized(fun.get(), expr));
@@ -319,7 +319,7 @@ void FunctionFactoryImpl::addConstraint(boost::shared_ptr<IFunction> fun,
  * @param constraint_expr :: The constraint expression.
  * @param penalty_expr :: The penalty expression.
  */
-void FunctionFactoryImpl::addConstraint(boost::shared_ptr<IFunction> fun,
+void FunctionFactoryImpl::addConstraint(const boost::shared_ptr<IFunction> &fun,
                                         const Expression &constraint_expr,
                                         const Expression &penalty_expr) const {
   auto c = std::unique_ptr<IConstraint>(
@@ -335,7 +335,7 @@ void FunctionFactoryImpl::addConstraint(boost::shared_ptr<IFunction> fun,
  * @param expr :: The tie expression: either parName = TieString or a list
  *   of name = string pairs
  */
-void FunctionFactoryImpl::addTies(IFunction_sptr fun,
+void FunctionFactoryImpl::addTies(const IFunction_sptr &fun,
                                   const Expression &expr) const {
   if (expr.name() == "=") {
     addTie(fun, expr);
@@ -350,7 +350,7 @@ void FunctionFactoryImpl::addTies(IFunction_sptr fun,
  * @param fun :: The function
  * @param expr :: The tie expression: parName = TieString
  */
-void FunctionFactoryImpl::addTie(IFunction_sptr fun,
+void FunctionFactoryImpl::addTie(const IFunction_sptr &fun,
                                  const Expression &expr) const {
   if (expr.size() > 1) { // if size > 2 it is interpreted as setting a tie (last
     // expr.term) to multiple parameters, e.g
diff --git a/Framework/API/src/FunctionGenerator.cpp b/Framework/API/src/FunctionGenerator.cpp
index 5a601242606..a5b08fe5361 100644
--- a/Framework/API/src/FunctionGenerator.cpp
+++ b/Framework/API/src/FunctionGenerator.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidAPI/FunctionGenerator.h"
 #include "MantidAPI/IConstraint.h"
 #include "MantidAPI/ParameterTie.h"
@@ -14,7 +16,7 @@ namespace API {
 using namespace Kernel;
 
 /// Constructor
-FunctionGenerator::FunctionGenerator(IFunction_sptr source)
+FunctionGenerator::FunctionGenerator(const IFunction_sptr &source)
     : m_source(source), m_dirty(true) {
   if (source) {
     m_nOwnParams = source->nParams();
@@ -27,7 +29,7 @@ void FunctionGenerator::init() {}
 /// Set the source function
 /// @param source :: New source function.
 void FunctionGenerator::setSource(IFunction_sptr source) const {
-  m_source = source;
+  m_source = std::move(source);
 }
 
 /// Set i-th parameter
diff --git a/Framework/API/src/GridDomain1D.cpp b/Framework/API/src/GridDomain1D.cpp
index b177e7c0d10..3f076e75aca 100644
--- a/Framework/API/src/GridDomain1D.cpp
+++ b/Framework/API/src/GridDomain1D.cpp
@@ -17,7 +17,7 @@ namespace Mantid {
 namespace API {
 
 void GridDomain1D::initialize(double &startX, double &endX, size_t &n,
-                              const std::string scaling) {
+                              const std::string &scaling) {
   m_points.resize(n);
   m_points.front() = startX;
   m_points.back() = endX;
diff --git a/Framework/API/src/GroupingLoader.cpp b/Framework/API/src/GroupingLoader.cpp
index 527ad4d151b..d34c9b75864 100644
--- a/Framework/API/src/GroupingLoader.cpp
+++ b/Framework/API/src/GroupingLoader.cpp
@@ -16,6 +16,7 @@
 #include <Poco/DOM/Document.h>
 #include <Poco/DOM/NodeList.h>
 #include <boost/make_shared.hpp>
+#include <utility>
 
 using namespace Poco::XML;
 
@@ -27,7 +28,7 @@ namespace API {
  * @param instrument :: [input] Instrument
  */
 GroupingLoader::GroupingLoader(Geometry::Instrument_const_sptr instrument)
-    : m_instrument(instrument) {}
+    : m_instrument(std::move(instrument)) {}
 
 /** Constructor with field direction
  * @param instrument :: [input] Instrument
@@ -35,7 +36,8 @@ GroupingLoader::GroupingLoader(Geometry::Instrument_const_sptr instrument)
  */
 GroupingLoader::GroupingLoader(Geometry::Instrument_const_sptr instrument,
                                const std::string &mainFieldDirection)
-    : m_instrument(instrument), m_mainFieldDirection(mainFieldDirection) {}
+    : m_instrument(std::move(instrument)),
+      m_mainFieldDirection(mainFieldDirection) {}
 
 //----------------------------------------------------------------------------------------------
 /** Destructor
@@ -248,7 +250,7 @@ boost::shared_ptr<Grouping> GroupingLoader::getDummyGrouping() {
  * Construct a Grouping from a table
  * @param table :: [input] Table to construct from
  */
-Grouping::Grouping(ITableWorkspace_sptr table) {
+Grouping::Grouping(const ITableWorkspace_sptr &table) {
   for (size_t row = 0; row < table->rowCount(); ++row) {
     std::vector<int> detectors = table->cell<std::vector<int>>(row, 0);
 
diff --git a/Framework/API/src/HistoryItem.cpp b/Framework/API/src/HistoryItem.cpp
index 917e1d076ea..34208d196c3 100644
--- a/Framework/API/src/HistoryItem.cpp
+++ b/Framework/API/src/HistoryItem.cpp
@@ -7,13 +7,15 @@
 //----------------------------------------------------------------------
 // Includes
 //----------------------------------------------------------------------
+#include <utility>
+
 #include "MantidAPI/HistoryItem.h"
 
 namespace Mantid {
 namespace API {
 
 HistoryItem::HistoryItem(AlgorithmHistory_const_sptr algHist)
-    : m_algorithmHistory(algHist), m_unrolled(false) {}
+    : m_algorithmHistory(std::move(algHist)), m_unrolled(false) {}
 
 } // namespace API
 } // namespace Mantid
diff --git a/Framework/API/src/IFunction.cpp b/Framework/API/src/IFunction.cpp
index 848edf8ec09..43c5e4b1e69 100644
--- a/Framework/API/src/IFunction.cpp
+++ b/Framework/API/src/IFunction.cpp
@@ -38,6 +38,7 @@
 #include <algorithm>
 #include <limits>
 #include <sstream>
+#include <utility>
 
 namespace Mantid {
 namespace API {
@@ -87,7 +88,7 @@ boost::shared_ptr<IFunction> IFunction::clone() const {
  */
 void IFunction::setProgressReporter(
     boost::shared_ptr<Kernel::ProgressBase> reporter) {
-  m_progReporter = reporter;
+  m_progReporter = std::move(reporter);
   m_progReporter->setNotifyStep(0.01);
 }
 
@@ -1241,9 +1242,10 @@ void IFunction::setMatrixWorkspace(
  *  @param wsIndex :: workspace index
  *  @return converted value
  */
-double IFunction::convertValue(double value, Kernel::Unit_sptr &outUnit,
-                               boost::shared_ptr<const MatrixWorkspace> ws,
-                               size_t wsIndex) const {
+double
+IFunction::convertValue(double value, Kernel::Unit_sptr &outUnit,
+                        const boost::shared_ptr<const MatrixWorkspace> &ws,
+                        size_t wsIndex) const {
   // only required if formula or look-up-table different from ws unit
   const auto &wsUnit = ws->getAxis(0)->unit();
   if (outUnit->unitID() == wsUnit->unitID())
@@ -1271,7 +1273,7 @@ double IFunction::convertValue(double value, Kernel::Unit_sptr &outUnit,
  */
 void IFunction::convertValue(std::vector<double> &values,
                              Kernel::Unit_sptr &outUnit,
-                             boost::shared_ptr<const MatrixWorkspace> ws,
+                             const boost::shared_ptr<const MatrixWorkspace> &ws,
                              size_t wsIndex) const {
   // only required if  formula or look-up-table different from ws unit
   const auto &wsUnit = ws->getAxis(0)->unit();
@@ -1448,7 +1450,7 @@ void IFunction::storeReadOnlyAttribute(
  * @param covar :: A matrix to set.
  */
 void IFunction::setCovarianceMatrix(
-    boost::shared_ptr<Kernel::Matrix<double>> covar) {
+    const boost::shared_ptr<Kernel::Matrix<double>> &covar) {
   // the matrix shouldn't be empty
   if (!covar) {
     throw std::invalid_argument(
diff --git a/Framework/API/src/IMDWorkspace.cpp b/Framework/API/src/IMDWorkspace.cpp
index 4933089184a..4e84206a2f8 100644
--- a/Framework/API/src/IMDWorkspace.cpp
+++ b/Framework/API/src/IMDWorkspace.cpp
@@ -12,6 +12,7 @@
 #include "MantidKernel/VMD.h"
 
 #include <sstream>
+#include <utility>
 
 using Mantid::Kernel::VMD;
 
@@ -53,7 +54,7 @@ std::string IMDWorkspace::getConvention() const { return m_convention; }
 /** @return the convention
  */
 void IMDWorkspace::setConvention(std::string convention) {
-  m_convention = convention;
+  m_convention = std::move(convention);
 }
 
 //---------------------------------------------------------------------------------------------
diff --git a/Framework/API/src/IndexProperty.cpp b/Framework/API/src/IndexProperty.cpp
index e26dd75e507..e1b5e3b5499 100644
--- a/Framework/API/src/IndexProperty.cpp
+++ b/Framework/API/src/IndexProperty.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidAPI/IndexProperty.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidIndexing/GlobalSpectrumIndex.h"
@@ -16,9 +18,10 @@ namespace API {
 IndexProperty::IndexProperty(const std::string &name,
                              const IWorkspaceProperty &workspaceProp,
                              const IndexTypeProperty &indexTypeProp,
-                             Kernel::IValidator_sptr validator)
-    : ArrayProperty(name, "", validator), m_workspaceProp(workspaceProp),
-      m_indexTypeProp(indexTypeProp), m_indices(0), m_indicesExtracted(false) {}
+                             const Kernel::IValidator_sptr &validator)
+    : ArrayProperty(name, "", std::move(validator)),
+      m_workspaceProp(workspaceProp), m_indexTypeProp(indexTypeProp),
+      m_indices(0), m_indicesExtracted(false) {}
 
 IndexProperty *IndexProperty::clone() const { return new IndexProperty(*this); }
 
diff --git a/Framework/API/src/JointDomain.cpp b/Framework/API/src/JointDomain.cpp
index b77efd80293..f6b6490db31 100644
--- a/Framework/API/src/JointDomain.cpp
+++ b/Framework/API/src/JointDomain.cpp
@@ -33,7 +33,7 @@ const FunctionDomain &JointDomain::getDomain(size_t i) const {
  * Add a new domain.
  * @param domain :: A shared pointer to a domain.
  */
-void JointDomain::addDomain(FunctionDomain_sptr domain) {
+void JointDomain::addDomain(const FunctionDomain_sptr &domain) {
   m_domains.emplace_back(domain);
 }
 
diff --git a/Framework/API/src/MDGeometry.cpp b/Framework/API/src/MDGeometry.cpp
index 8c0291e077c..08de2f9e6dd 100644
--- a/Framework/API/src/MDGeometry.cpp
+++ b/Framework/API/src/MDGeometry.cpp
@@ -14,6 +14,7 @@
 
 #include <Poco/NObserver.h>
 #include <boost/make_shared.hpp>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -244,7 +245,7 @@ size_t MDGeometry::getDimensionIndexById(const std::string &id) const {
 /** Add a dimension
  * @param dim :: shared pointer to the dimension object   */
 void MDGeometry::addDimension(
-    boost::shared_ptr<Mantid::Geometry::IMDDimension> dim) {
+    const boost::shared_ptr<Mantid::Geometry::IMDDimension> &dim) {
   m_dimensions.emplace_back(dim);
 }
 
@@ -382,7 +383,7 @@ void MDGeometry::setOriginalWorkspace(boost::shared_ptr<Workspace> ws,
                                       size_t index) {
   if (index >= m_originalWorkspaces.size())
     m_originalWorkspaces.resize(index + 1);
-  m_originalWorkspaces[index] = ws;
+  m_originalWorkspaces[index] = std::move(ws);
   m_notificationHelper->watchForWorkspaceDeletions();
 }
 
diff --git a/Framework/API/src/MultiPeriodGroupWorker.cpp b/Framework/API/src/MultiPeriodGroupWorker.cpp
index 0631fe5d508..19e2b1ba6e4 100644
--- a/Framework/API/src/MultiPeriodGroupWorker.cpp
+++ b/Framework/API/src/MultiPeriodGroupWorker.cpp
@@ -36,7 +36,7 @@ MultiPeriodGroupWorker::MultiPeriodGroupWorker(
  * @param vecWorkspaceGroups: Vector of non-multi period workspace groups.
  */
 void MultiPeriodGroupWorker::tryAddInputWorkspaceToInputGroups(
-    Workspace_sptr ws,
+    const Workspace_sptr &ws,
     MultiPeriodGroupWorker::VecWSGroupType &vecMultiPeriodWorkspaceGroups,
     MultiPeriodGroupWorker::VecWSGroupType &vecWorkspaceGroups) const {
   WorkspaceGroup_sptr inputGroup =
diff --git a/Framework/API/src/MultipleExperimentInfos.cpp b/Framework/API/src/MultipleExperimentInfos.cpp
index 9906877314c..7433e6efa12 100644
--- a/Framework/API/src/MultipleExperimentInfos.cpp
+++ b/Framework/API/src/MultipleExperimentInfos.cpp
@@ -11,6 +11,7 @@
 
 #include <boost/make_shared.hpp>
 #include <sstream>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -62,7 +63,8 @@ MultipleExperimentInfos::getExperimentInfo(const uint16_t runIndex) const {
  * @return the runIndex at which it was added
  * @throw std::runtime_error if you reach the limit of 65536 entries.
  */
-uint16_t MultipleExperimentInfos::addExperimentInfo(ExperimentInfo_sptr ei) {
+uint16_t
+MultipleExperimentInfos::addExperimentInfo(const ExperimentInfo_sptr &ei) {
   m_expInfos.emplace_back(ei);
   if (m_expInfos.size() >=
       static_cast<size_t>(std::numeric_limits<uint16_t>::max()))
@@ -82,7 +84,7 @@ void MultipleExperimentInfos::setExperimentInfo(const uint16_t runIndex,
   if (size_t(runIndex) >= m_expInfos.size())
     throw std::invalid_argument(
         "MDEventWorkspace::setExperimentInfo(): runIndex is out of range.");
-  m_expInfos[runIndex] = ei;
+  m_expInfos[runIndex] = std::move(ei);
 }
 
 //-----------------------------------------------------------------------------------------------
diff --git a/Framework/API/src/NotebookBuilder.cpp b/Framework/API/src/NotebookBuilder.cpp
index f74ac286749..e3f2bcc48dd 100644
--- a/Framework/API/src/NotebookBuilder.cpp
+++ b/Framework/API/src/NotebookBuilder.cpp
@@ -14,6 +14,7 @@
 #include "MantidKernel/Property.h"
 
 #include <boost/utility.hpp>
+#include <utility>
 
 namespace Mantid {
 namespace API {
@@ -25,10 +26,10 @@ namespace {
 Mantid::Kernel::Logger g_log("NotebookBuilder");
 }
 
-NotebookBuilder::NotebookBuilder(boost::shared_ptr<HistoryView> view,
+NotebookBuilder::NotebookBuilder(const boost::shared_ptr<HistoryView> &view,
                                  std::string versionSpecificity)
     : m_historyItems(view->getAlgorithmsList()), m_output(),
-      m_versionSpecificity(versionSpecificity),
+      m_versionSpecificity(std::move(versionSpecificity)),
       m_nb_writer(new NotebookWriter()) {}
 
 /**
@@ -39,9 +40,9 @@ NotebookBuilder::NotebookBuilder(boost::shared_ptr<HistoryView> view,
  * @param ws_comment :: workspace comment
  * @return a formatted ipython notebook string of the history
  */
-const std::string NotebookBuilder::build(std::string ws_name,
-                                         std::string ws_title,
-                                         std::string ws_comment) {
+const std::string NotebookBuilder::build(const std::string &ws_name,
+                                         const std::string &ws_title,
+                                         const std::string &ws_comment) {
   // record workspace details in notebook
   std::string workspace_details;
   workspace_details = "Workspace History: " + ws_name + "\n";
@@ -109,8 +110,8 @@ void NotebookBuilder::buildChildren(
  * @param algHistory :: pointer to an algorithm history object
  * @returns std::string to run this algorithm
  */
-const std::string
-NotebookBuilder::buildAlgorithmString(AlgorithmHistory_const_sptr algHistory) {
+const std::string NotebookBuilder::buildAlgorithmString(
+    const AlgorithmHistory_const_sptr &algHistory) {
   std::ostringstream properties;
   const std::string name = algHistory->name();
   std::string prop;
@@ -159,8 +160,8 @@ NotebookBuilder::buildAlgorithmString(AlgorithmHistory_const_sptr algHistory) {
  * @param propHistory :: reference to a property history object
  * @returns std::string for this property
  */
-const std::string
-NotebookBuilder::buildPropertyString(PropertyHistory_const_sptr propHistory) {
+const std::string NotebookBuilder::buildPropertyString(
+    const PropertyHistory_const_sptr &propHistory) {
   using Mantid::Kernel::Direction;
 
   // Create a vector of all non workspace property type names
diff --git a/Framework/API/src/NotebookWriter.cpp b/Framework/API/src/NotebookWriter.cpp
index e61de82600f..25d7e80de99 100644
--- a/Framework/API/src/NotebookWriter.cpp
+++ b/Framework/API/src/NotebookWriter.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidAPI/NotebookWriter.h"
 #include "MantidKernel/Logger.h"
 #include "MantidKernel/MantidVersion.h"
@@ -34,7 +36,7 @@ void NotebookWriter::codeCell(Json::Value array_code) {
 
   cell_data["cell_type"] = "code";
   cell_data["collapsed"] = false;
-  cell_data["input"] = array_code;
+  cell_data["input"] = std::move(array_code);
   cell_data["language"] = "python";
   cell_data["metadata"] = empty;
   cell_data["outputs"] = Json::Value(Json::arrayValue);
@@ -47,7 +49,7 @@ void NotebookWriter::codeCell(Json::Value array_code) {
  *
  * @param string_code :: string containing the python for the code cell
  */
-std::string NotebookWriter::codeCell(std::string string_code) {
+std::string NotebookWriter::codeCell(const std::string &string_code) {
 
   Json::Value cell_data;
   const Json::Value empty = Json::Value(Json::ValueType::objectValue);
@@ -77,7 +79,7 @@ void NotebookWriter::markdownCell(Json::Value string_array) {
 
   cell_data["cell_type"] = "markdown";
   cell_data["metadata"] = empty;
-  cell_data["source"] = string_array;
+  cell_data["source"] = std::move(string_array);
 
   m_cell_buffer.append(cell_data);
 }
@@ -87,7 +89,7 @@ void NotebookWriter::markdownCell(Json::Value string_array) {
  *
  * @param string_text :: string containing the python code for the code cell
  */
-std::string NotebookWriter::markdownCell(std::string string_text) {
+std::string NotebookWriter::markdownCell(const std::string &string_text) {
 
   Json::Value cell_data;
   const Json::Value empty = Json::Value(Json::ValueType::objectValue);
diff --git a/Framework/API/src/RemoteJobManagerFactory.cpp b/Framework/API/src/RemoteJobManagerFactory.cpp
index 08709cac5ca..1231e13dde9 100644
--- a/Framework/API/src/RemoteJobManagerFactory.cpp
+++ b/Framework/API/src/RemoteJobManagerFactory.cpp
@@ -65,8 +65,8 @@ IRemoteJobManager_sptr RemoteJobManagerFactoryImpl::create(
  * the type (for example the type is not recognized).
  */
 Mantid::API::IRemoteJobManager_sptr
-RemoteJobManagerFactoryImpl::create(const std::string baseURL,
-                                    const std::string jobManagerType) const {
+RemoteJobManagerFactoryImpl::create(const std::string &baseURL,
+                                    const std::string &jobManagerType) const {
   Mantid::API::IRemoteJobManager_sptr jm;
 
   // use the inherited/generic create method
diff --git a/Framework/API/src/Sample.cpp b/Framework/API/src/Sample.cpp
index 36b92ab36b6..b26a1a04baf 100644
--- a/Framework/API/src/Sample.cpp
+++ b/Framework/API/src/Sample.cpp
@@ -284,7 +284,7 @@ std::size_t Sample::size() const { return m_samples.size() + 1; }
  * Adds a sample to the sample collection
  * @param childSample The child sample to be added
  */
-void Sample::addSample(boost::shared_ptr<Sample> childSample) {
+void Sample::addSample(const boost::shared_ptr<Sample> &childSample) {
   m_samples.emplace_back(childSample);
 }
 
diff --git a/Framework/API/src/ScopedWorkspace.cpp b/Framework/API/src/ScopedWorkspace.cpp
index 177288a3f3a..58a5085d275 100644
--- a/Framework/API/src/ScopedWorkspace.cpp
+++ b/Framework/API/src/ScopedWorkspace.cpp
@@ -4,8 +4,10 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidAPI/ScopedWorkspace.h"
+#include <utility>
+
 #include "MantidAPI/AnalysisDataService.h"
+#include "MantidAPI/ScopedWorkspace.h"
 #include "MantidAPI/WorkspaceGroup.h"
 
 namespace Mantid {
@@ -22,9 +24,9 @@ ScopedWorkspace::ScopedWorkspace() : m_name(generateUniqueName()) {}
 /**
  * Workspace constructor
  */
-ScopedWorkspace::ScopedWorkspace(Workspace_sptr ws)
+ScopedWorkspace::ScopedWorkspace(const Workspace_sptr &ws)
     : m_name(generateUniqueName()) {
-  set(ws);
+  set(std::move(ws));
 }
 
 //----------------------------------------------------------------------------------------------
@@ -77,7 +79,7 @@ void ScopedWorkspace::remove() {
 /**
  * Make ADS entry to point to the given workspace.
  */
-void ScopedWorkspace::set(Workspace_sptr newWS) {
+void ScopedWorkspace::set(const Workspace_sptr &newWS) {
   AnalysisDataServiceImpl &ads = AnalysisDataService::Instance();
 
   if (!newWS->getName().empty() && ads.doesExist(newWS->getName()))
diff --git a/Framework/API/src/ScriptBuilder.cpp b/Framework/API/src/ScriptBuilder.cpp
index 127f9380be2..07d800bebdf 100644
--- a/Framework/API/src/ScriptBuilder.cpp
+++ b/Framework/API/src/ScriptBuilder.cpp
@@ -22,6 +22,7 @@
 #include <boost/range/algorithm/remove_if.hpp>
 #include <boost/utility.hpp>
 #include <set>
+#include <utility>
 
 namespace Mantid {
 namespace API {
@@ -36,14 +37,15 @@ Mantid::Kernel::Logger g_log("ScriptBuilder");
 const std::string COMMENT_ALG = "Comment";
 
 ScriptBuilder::ScriptBuilder(
-    boost::shared_ptr<HistoryView> view, std::string versionSpecificity,
+    const boost::shared_ptr<HistoryView> &view, std::string versionSpecificity,
     bool appendTimestamp, std::vector<std::string> ignoreTheseAlgs,
     std::vector<std::vector<std::string>> ignoreTheseAlgProperties,
     bool appendExecCount)
     : m_historyItems(view->getAlgorithmsList()), m_output(),
-      m_versionSpecificity(versionSpecificity),
-      m_timestampCommands(appendTimestamp), m_algsToIgnore(ignoreTheseAlgs),
-      m_propertiesToIgnore(ignoreTheseAlgProperties),
+      m_versionSpecificity(std::move(versionSpecificity)),
+      m_timestampCommands(appendTimestamp),
+      m_algsToIgnore(std::move(ignoreTheseAlgs)),
+      m_propertiesToIgnore(std::move(ignoreTheseAlgProperties)),
       m_execCount(appendExecCount) {}
 
 /**
diff --git a/Framework/API/src/SpectrumDetectorMapping.cpp b/Framework/API/src/SpectrumDetectorMapping.cpp
index 6a1213489a9..c05ed206e8d 100644
--- a/Framework/API/src/SpectrumDetectorMapping.cpp
+++ b/Framework/API/src/SpectrumDetectorMapping.cpp
@@ -15,7 +15,7 @@ namespace API {
  *  @throws std::invalid_argument if a null workspace pointer is passed in
  */
 SpectrumDetectorMapping::SpectrumDetectorMapping(
-    MatrixWorkspace_const_sptr workspace, const bool useSpecNoIndex)
+    const MatrixWorkspace_const_sptr &workspace, const bool useSpecNoIndex)
     : m_indexIsSpecNo(useSpecNoIndex) {
   if (!workspace) {
     throw std::invalid_argument(
diff --git a/Framework/API/src/WorkspaceHistory.cpp b/Framework/API/src/WorkspaceHistory.cpp
index 167409dbd6c..dfa12b0cafc 100644
--- a/Framework/API/src/WorkspaceHistory.cpp
+++ b/Framework/API/src/WorkspaceHistory.cpp
@@ -317,7 +317,7 @@ void WorkspaceHistory::loadNexus(::NeXus::File *file) {
  * the workspace history.
  */
 void WorkspaceHistory::loadNestedHistory(::NeXus::File *file,
-                                         AlgorithmHistory_sptr parent) {
+                                         const AlgorithmHistory_sptr &parent) {
   // historyNumbers should be sorted by number
   std::set<int> historyNumbers = findHistoryEntries(file);
   for (auto historyNumber : historyNumbers) {
diff --git a/Framework/API/src/WorkspaceOpOverloads.cpp b/Framework/API/src/WorkspaceOpOverloads.cpp
index 770c1b8b9b2..e640abf0cdd 100644
--- a/Framework/API/src/WorkspaceOpOverloads.cpp
+++ b/Framework/API/src/WorkspaceOpOverloads.cpp
@@ -141,7 +141,7 @@ template MANTID_API_DLL IMDHistoWorkspace_sptr executeBinaryOperation(
  *  @param tolerance :: acceptable difference for floating point numbers
  *  @return bool, true if workspaces match
  */
-bool equals(const MatrixWorkspace_sptr lhs, const MatrixWorkspace_sptr rhs,
+bool equals(const MatrixWorkspace_sptr &lhs, const MatrixWorkspace_sptr &rhs,
             double tolerance) {
   IAlgorithm_sptr alg =
       AlgorithmManager::Instance().createUnmanaged("CompareWorkspaces");
@@ -180,8 +180,8 @@ using OperatorOverloads::executeBinaryOperation;
  *  @param rhs :: right hand side workspace shared pointer
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs,
-                               const MatrixWorkspace_sptr rhs) {
+MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr &lhs,
+                               const MatrixWorkspace_sptr &rhs) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>("Plus", lhs, rhs);
 }
@@ -191,7 +191,7 @@ MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs,
  *  @param rhsValue :: the single value
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr &lhs,
                                const double &rhsValue) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>(
@@ -203,8 +203,8 @@ MatrixWorkspace_sptr operator+(const MatrixWorkspace_sptr lhs,
  *  @param rhs :: right hand side workspace shared pointer
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr lhs,
-                               const MatrixWorkspace_sptr rhs) {
+MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr &lhs,
+                               const MatrixWorkspace_sptr &rhs) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>("Minus", lhs, rhs);
 }
@@ -214,7 +214,7 @@ MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr lhs,
  *  @param rhsValue :: the single value
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr &lhs,
                                const double &rhsValue) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>(
@@ -227,7 +227,7 @@ MatrixWorkspace_sptr operator-(const MatrixWorkspace_sptr lhs,
  *  @return The result in a workspace shared pointer
  */
 MatrixWorkspace_sptr operator-(const double &lhsValue,
-                               const MatrixWorkspace_sptr rhs) {
+                               const MatrixWorkspace_sptr &rhs) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>(
       "Minus", createWorkspaceSingleValue(lhsValue), rhs);
@@ -237,8 +237,8 @@ MatrixWorkspace_sptr operator-(const double &lhsValue,
  *  @param rhs :: right hand side workspace shared pointer
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator*(const MatrixWorkspace_sptr lhs,
-                               const MatrixWorkspace_sptr rhs) {
+MatrixWorkspace_sptr operator*(const MatrixWorkspace_sptr &lhs,
+                               const MatrixWorkspace_sptr &rhs) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>("Multiply", lhs, rhs);
 }
@@ -248,7 +248,7 @@ MatrixWorkspace_sptr operator*(const MatrixWorkspace_sptr lhs,
  *  @param rhsValue :: the single value
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator*(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr operator*(const MatrixWorkspace_sptr &lhs,
                                const double &rhsValue) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>(
@@ -262,7 +262,7 @@ MatrixWorkspace_sptr operator*(const MatrixWorkspace_sptr lhs,
  *  @return The result in a workspace shared pointer
  */
 MatrixWorkspace_sptr operator*(const double &lhsValue,
-                               const MatrixWorkspace_sptr rhs) {
+                               const MatrixWorkspace_sptr &rhs) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>(
       "Multiply", createWorkspaceSingleValue(lhsValue), rhs);
@@ -273,8 +273,8 @@ MatrixWorkspace_sptr operator*(const double &lhsValue,
  *  @param rhs :: right hand side workspace shared pointer
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator/(const MatrixWorkspace_sptr lhs,
-                               const MatrixWorkspace_sptr rhs) {
+MatrixWorkspace_sptr operator/(const MatrixWorkspace_sptr &lhs,
+                               const MatrixWorkspace_sptr &rhs) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>("Divide", lhs, rhs);
 }
@@ -284,7 +284,7 @@ MatrixWorkspace_sptr operator/(const MatrixWorkspace_sptr lhs,
  *  @param rhsValue :: the single value
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator/(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr operator/(const MatrixWorkspace_sptr &lhs,
                                const double &rhsValue) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>(
@@ -298,7 +298,7 @@ MatrixWorkspace_sptr operator/(const MatrixWorkspace_sptr lhs,
  *  @return The result in a workspace shared pointer
  */
 MatrixWorkspace_sptr operator/(const double &lhsValue,
-                               const MatrixWorkspace_sptr rhs) {
+                               const MatrixWorkspace_sptr &rhs) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>(
       "Divide", createWorkspaceSingleValue(lhsValue), rhs);
@@ -309,8 +309,8 @@ MatrixWorkspace_sptr operator/(const double &lhsValue,
  *  @param rhs :: right hand side workspace shared pointer
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator+=(const MatrixWorkspace_sptr lhs,
-                                const MatrixWorkspace_sptr rhs) {
+MatrixWorkspace_sptr operator+=(const MatrixWorkspace_sptr &lhs,
+                                const MatrixWorkspace_sptr &rhs) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>("Plus", lhs, rhs, true);
 }
@@ -320,7 +320,7 @@ MatrixWorkspace_sptr operator+=(const MatrixWorkspace_sptr lhs,
  *  @param rhsValue :: the single value
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator+=(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr operator+=(const MatrixWorkspace_sptr &lhs,
                                 const double &rhsValue) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>(
@@ -332,8 +332,8 @@ MatrixWorkspace_sptr operator+=(const MatrixWorkspace_sptr lhs,
  *  @param rhs :: right hand side workspace shared pointer
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator-=(const MatrixWorkspace_sptr lhs,
-                                const MatrixWorkspace_sptr rhs) {
+MatrixWorkspace_sptr operator-=(const MatrixWorkspace_sptr &lhs,
+                                const MatrixWorkspace_sptr &rhs) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>("Minus", lhs, rhs, true);
 }
@@ -343,7 +343,7 @@ MatrixWorkspace_sptr operator-=(const MatrixWorkspace_sptr lhs,
  *  @param rhsValue :: the single value
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator-=(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr operator-=(const MatrixWorkspace_sptr &lhs,
                                 const double &rhsValue) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>(
@@ -355,8 +355,8 @@ MatrixWorkspace_sptr operator-=(const MatrixWorkspace_sptr lhs,
  *  @param rhs :: right hand side workspace shared pointer
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator*=(const MatrixWorkspace_sptr lhs,
-                                const MatrixWorkspace_sptr rhs) {
+MatrixWorkspace_sptr operator*=(const MatrixWorkspace_sptr &lhs,
+                                const MatrixWorkspace_sptr &rhs) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>("Multiply", lhs, rhs,
                                                       true);
@@ -367,7 +367,7 @@ MatrixWorkspace_sptr operator*=(const MatrixWorkspace_sptr lhs,
  *  @param rhsValue :: the single value
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator*=(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr operator*=(const MatrixWorkspace_sptr &lhs,
                                 const double &rhsValue) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>(
@@ -379,8 +379,8 @@ MatrixWorkspace_sptr operator*=(const MatrixWorkspace_sptr lhs,
  *  @param rhs :: right hand side workspace shared pointer
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator/=(const MatrixWorkspace_sptr lhs,
-                                const MatrixWorkspace_sptr rhs) {
+MatrixWorkspace_sptr operator/=(const MatrixWorkspace_sptr &lhs,
+                                const MatrixWorkspace_sptr &rhs) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>("Divide", lhs, rhs, true);
 }
@@ -390,7 +390,7 @@ MatrixWorkspace_sptr operator/=(const MatrixWorkspace_sptr lhs,
  *  @param rhsValue :: the single value
  *  @return The result in a workspace shared pointer
  */
-MatrixWorkspace_sptr operator/=(const MatrixWorkspace_sptr lhs,
+MatrixWorkspace_sptr operator/=(const MatrixWorkspace_sptr &lhs,
                                 const double &rhsValue) {
   return executeBinaryOperation<MatrixWorkspace_sptr, MatrixWorkspace_sptr,
                                 MatrixWorkspace_sptr>(
@@ -490,7 +490,7 @@ bool WorkspaceHelpers::sharedXData(const MatrixWorkspace &WS) {
  *  @param forwards :: If true (the default) divides by bin width, if false
  * multiplies
  */
-void WorkspaceHelpers::makeDistribution(MatrixWorkspace_sptr workspace,
+void WorkspaceHelpers::makeDistribution(const MatrixWorkspace_sptr &workspace,
                                         const bool forwards) {
   // If we're not able to get a writable reference to Y, then this is an event
   // workspace, which we can't operate on.
diff --git a/Framework/API/test/AlgorithmHistoryTest.h b/Framework/API/test/AlgorithmHistoryTest.h
index f3025039cdb..735c71f5fa4 100644
--- a/Framework/API/test/AlgorithmHistoryTest.h
+++ b/Framework/API/test/AlgorithmHistoryTest.h
@@ -239,7 +239,7 @@ private:
     return AlgorithmHistory(&alg, execTime, 14.0, m_execCount++);
   }
 
-  AlgorithmHistory createFromTestAlg(std::string paramValue) {
+  AlgorithmHistory createFromTestAlg(const std::string &paramValue) {
     Algorithm *testInput = new testalg;
     testInput->initialize();
     testInput->setPropertyValue("arg1_param", paramValue);
diff --git a/Framework/API/test/AlgorithmProxyTest.h b/Framework/API/test/AlgorithmProxyTest.h
index 8dc5017571a..bff605adc01 100644
--- a/Framework/API/test/AlgorithmProxyTest.h
+++ b/Framework/API/test/AlgorithmProxyTest.h
@@ -17,6 +17,7 @@
 #include <Poco/Thread.h>
 
 #include <boost/lexical_cast.hpp>
+#include <utility>
 
 using namespace Mantid::API;
 using namespace Mantid::Kernel;
@@ -121,7 +122,8 @@ public:
   TestProxyObserver()
       : AlgorithmObserver(), start(false), progress(false), finish(false) {}
   TestProxyObserver(IAlgorithm_const_sptr alg)
-      : AlgorithmObserver(alg), start(false), progress(false), finish(false) {}
+      : AlgorithmObserver(std::move(alg)), start(false), progress(false),
+        finish(false) {}
   void startHandle(const IAlgorithm *) override { start = true; }
   void progressHandle(const IAlgorithm *, double p,
                       const std::string &msg) override {
diff --git a/Framework/API/test/AlgorithmTest.h b/Framework/API/test/AlgorithmTest.h
index cc5350719e3..e0d91c1adc0 100644
--- a/Framework/API/test/AlgorithmTest.h
+++ b/Framework/API/test/AlgorithmTest.h
@@ -27,6 +27,7 @@
 #include "MantidTestHelpers/FakeObjects.h"
 #include "PropertyManagerHelper.h"
 #include <map>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -511,8 +512,9 @@ public:
   /** Test of setting read and/or write locks
    * for various combinations of input/output workspaces.
    */
-  void do_test_locking(std::string in1, std::string in2, std::string inout,
-                       std::string out1, std::string out2) {
+  void do_test_locking(const std::string &in1, const std::string &in2,
+                       const std::string &inout, const std::string &out1,
+                       const std::string &out2) {
     for (size_t i = 0; i < 6; i++) {
       boost::shared_ptr<WorkspaceTester> ws =
           boost::make_shared<WorkspaceTester>();
@@ -586,7 +588,8 @@ public:
    *        Make no group if blank, just 1 workspace
    * @return The new WorkspaceGroup object
    */
-  Workspace_sptr makeWorkspaceGroup(std::string group1, std::string contents1) {
+  Workspace_sptr makeWorkspaceGroup(const std::string &group1,
+                                    std::string contents1) {
     auto &ads = AnalysisDataService::Instance();
     if (contents1.empty()) {
       if (group1.empty())
@@ -614,14 +617,14 @@ public:
   }
 
   //------------------------------------------------------------------------
-  WorkspaceGroup_sptr do_test_groups(std::string group1, std::string contents1,
-                                     std::string group2, std::string contents2,
-                                     std::string group3, std::string contents3,
-                                     bool expectFail = false,
-                                     int expectedNumber = 3) {
-    makeWorkspaceGroup(group1, contents1);
-    makeWorkspaceGroup(group2, contents2);
-    makeWorkspaceGroup(group3, contents3);
+  WorkspaceGroup_sptr
+  do_test_groups(const std::string &group1, std::string contents1,
+                 const std::string &group2, std::string contents2,
+                 const std::string &group3, std::string contents3,
+                 bool expectFail = false, int expectedNumber = 3) {
+    makeWorkspaceGroup(group1, std::move(contents1));
+    makeWorkspaceGroup(group2, std::move(contents2));
+    makeWorkspaceGroup(group3, std::move(contents3));
 
     StubbedWorkspaceAlgorithm alg;
     alg.initialize();
diff --git a/Framework/API/test/AnalysisDataServiceObserverTest.h b/Framework/API/test/AnalysisDataServiceObserverTest.h
index 11240363aeb..46bbbee6271 100644
--- a/Framework/API/test/AnalysisDataServiceObserverTest.h
+++ b/Framework/API/test/AnalysisDataServiceObserverTest.h
@@ -109,7 +109,7 @@ public:
     m_mockInheritingClass = std::make_unique<FakeAnalysisDataServiceObserver>();
   }
 
-  void addWorkspaceToADS(std::string name = "dummy") {
+  void addWorkspaceToADS(const std::string &name = "dummy") {
     IAlgorithm_sptr alg =
         Mantid::API::AlgorithmManager::Instance().createUnmanaged(
             "CreateSampleWorkspace");
diff --git a/Framework/API/test/ExperimentInfoTest.h b/Framework/API/test/ExperimentInfoTest.h
index c7bb1f79bb9..09cef48c58a 100644
--- a/Framework/API/test/ExperimentInfoTest.h
+++ b/Framework/API/test/ExperimentInfoTest.h
@@ -880,14 +880,14 @@ private:
   }
 
   Instrument_sptr
-  addInstrumentWithIndirectEmodeParameter(ExperimentInfo_sptr exptInfo) {
+  addInstrumentWithIndirectEmodeParameter(const ExperimentInfo_sptr &exptInfo) {
     Instrument_sptr inst = addInstrument(exptInfo);
     exptInfo->instrumentParameters().addString(inst.get(), "deltaE-mode",
                                                "indirect");
     return inst;
   }
 
-  Instrument_sptr addInstrument(ExperimentInfo_sptr exptInfo) {
+  Instrument_sptr addInstrument(const ExperimentInfo_sptr &exptInfo) {
     Instrument_sptr inst =
         ComponentCreationHelper::createTestInstrumentCylindrical(1);
     exptInfo->setInstrument(inst);
diff --git a/Framework/API/test/FunctionFactoryTest.h b/Framework/API/test/FunctionFactoryTest.h
index 520179ff17a..71f77b73cce 100644
--- a/Framework/API/test/FunctionFactoryTest.h
+++ b/Framework/API/test/FunctionFactoryTest.h
@@ -476,7 +476,7 @@ public:
       TS_ASSERT(second);
 
       // test each individual function
-      auto testFunc = [](CompositeFunction_sptr f) {
+      auto testFunc = [](const CompositeFunction_sptr &f) {
         if (f) {
           TS_ASSERT_EQUALS(f->nFunctions(), 2);
           TS_ASSERT_EQUALS(f->getFunction(0)->name(),
diff --git a/Framework/API/test/LiveListenerFactoryTest.h b/Framework/API/test/LiveListenerFactoryTest.h
index 6bcf7bf29dd..c3fa9bdc095 100644
--- a/Framework/API/test/LiveListenerFactoryTest.h
+++ b/Framework/API/test/LiveListenerFactoryTest.h
@@ -14,6 +14,8 @@
 #include <Poco/Path.h>
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 using namespace Mantid;
 using namespace Mantid::API;
 
@@ -29,7 +31,7 @@ class MockLiveListenerInstantiator
 public:
   MockLiveListenerInstantiator(
       boost::shared_ptr<Mantid::API::ILiveListener> product)
-      : product(product) {}
+      : product(std::move(product)) {}
 
   boost::shared_ptr<Mantid::API::ILiveListener>
   createInstance() const override {
diff --git a/Framework/API/test/LogManagerTest.h b/Framework/API/test/LogManagerTest.h
index aa677c3e04e..fbcb69b8112 100644
--- a/Framework/API/test/LogManagerTest.h
+++ b/Framework/API/test/LogManagerTest.h
@@ -63,7 +63,8 @@ void addTestTimeSeries(LogManager &run, const std::string &name) {
 }
 } // namespace
 
-void addTimeSeriesEntry(LogManager &runInfo, std::string name, double val) {
+void addTimeSeriesEntry(LogManager &runInfo, const std::string &name,
+                        double val) {
   TimeSeriesProperty<double> *tsp;
   tsp = new TimeSeriesProperty<double>(name);
   tsp->addValue("2011-05-24T00:00:00", val);
diff --git a/Framework/API/test/MultiPeriodGroupTestBase.h b/Framework/API/test/MultiPeriodGroupTestBase.h
index a164ac16081..6a27600bb90 100644
--- a/Framework/API/test/MultiPeriodGroupTestBase.h
+++ b/Framework/API/test/MultiPeriodGroupTestBase.h
@@ -28,7 +28,7 @@ class MultiPeriodGroupTestBase {
 protected:
   // Helper method to add multiperiod logs to make a workspacegroup look like a
   // real multiperiod workspace group.
-  void add_periods_logs(WorkspaceGroup_sptr ws) {
+  void add_periods_logs(const WorkspaceGroup_sptr &ws) {
     int nperiods = static_cast<int>(ws->size());
     for (size_t i = 0; i < ws->size(); ++i) {
       MatrixWorkspace_sptr currentWS =
@@ -45,7 +45,7 @@ protected:
   /// Helper to fabricate a workspace group consisting of equal sized
   /// matrixworkspaces.
   WorkspaceGroup_sptr
-  create_good_multiperiod_workspace_group(const std::string name) {
+  create_good_multiperiod_workspace_group(const std::string &name) {
     MatrixWorkspace_sptr a = MatrixWorkspace_sptr(new WorkspaceTester);
     MatrixWorkspace_sptr b = MatrixWorkspace_sptr(new WorkspaceTester);
 
diff --git a/Framework/API/test/PeakFunctionIntegratorTest.h b/Framework/API/test/PeakFunctionIntegratorTest.h
index 6c5730fc3bc..e6a3303cd4d 100644
--- a/Framework/API/test/PeakFunctionIntegratorTest.h
+++ b/Framework/API/test/PeakFunctionIntegratorTest.h
@@ -84,7 +84,8 @@ private:
     return gaussian;
   }
 
-  double getGaussianAnalyticalInfiniteIntegral(IPeakFunction_sptr gaussian) {
+  double
+  getGaussianAnalyticalInfiniteIntegral(const IPeakFunction_sptr &gaussian) {
     return gaussian->height() * gaussian->fwhm() / (2.0 * sqrt(M_LN2)) *
            sqrt(M_PI);
   }
diff --git a/Framework/API/test/RunTest.h b/Framework/API/test/RunTest.h
index e74db89faf0..288ee1643e1 100644
--- a/Framework/API/test/RunTest.h
+++ b/Framework/API/test/RunTest.h
@@ -427,7 +427,7 @@ public:
     TS_ASSERT_EQUALS(runCopy.getGoniometer().getNumberAxes(), 3);
   }
 
-  void addTimeSeriesEntry(Run &runInfo, std::string name, double val) {
+  void addTimeSeriesEntry(Run &runInfo, const std::string &name, double val) {
     TimeSeriesProperty<double> *tsp;
     tsp = new TimeSeriesProperty<double>(name);
     tsp->addValue("2011-05-24T00:00:00", val);
diff --git a/Framework/API/test/WorkspaceGroupTest.h b/Framework/API/test/WorkspaceGroupTest.h
index 953000c8b23..37565ec2f01 100644
--- a/Framework/API/test/WorkspaceGroupTest.h
+++ b/Framework/API/test/WorkspaceGroupTest.h
@@ -50,7 +50,7 @@ public:
 class WorkspaceGroupTest : public CxxTest::TestSuite {
 private:
   /// Helper method to add an 'nperiods' log value to each workspace in a group.
-  void add_periods_logs(WorkspaceGroup_sptr ws, int nperiods = -1) {
+  void add_periods_logs(const WorkspaceGroup_sptr &ws, int nperiods = -1) {
     for (size_t i = 0; i < ws->size(); ++i) {
       MatrixWorkspace_sptr currentWS =
           boost::dynamic_pointer_cast<MatrixWorkspace>(ws->getItem(i));
diff --git a/Framework/API/test/WorkspaceNearestNeighboursTest.h b/Framework/API/test/WorkspaceNearestNeighboursTest.h
index 763903a9d9d..d5ec89e9485 100644
--- a/Framework/API/test/WorkspaceNearestNeighboursTest.h
+++ b/Framework/API/test/WorkspaceNearestNeighboursTest.h
@@ -59,7 +59,7 @@ private:
       : public Mantid::API::WorkspaceNearestNeighbours {
   public:
     ExposedNearestNeighbours(const SpectrumInfo &spectrumInfo,
-                             const std::vector<specnum_t> spectrumNumbers,
+                             const std::vector<specnum_t> &spectrumNumbers,
                              bool ignoreMasked = false)
         : WorkspaceNearestNeighbours(8, spectrumInfo, spectrumNumbers,
                                      ignoreMasked) {}
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/AddSampleLog.h b/Framework/Algorithms/inc/MantidAlgorithms/AddSampleLog.h
index fd2709dfec9..5f59e620a7b 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/AddSampleLog.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/AddSampleLog.h
@@ -76,21 +76,22 @@ private:
   Types::Core::DateAndTime getRunStart(API::Run &run_obj);
 
   /// get value vector of the integer TimeSeriesProperty entries
-  std::vector<int> getIntValues(API::MatrixWorkspace_const_sptr dataws,
+  std::vector<int> getIntValues(const API::MatrixWorkspace_const_sptr &dataws,
                                 int workspace_index);
 
   /// get value vector of the double TimeSeriesProperty entries
-  std::vector<double> getDblValues(API::MatrixWorkspace_const_sptr dataws,
-                                   int workspace_index);
+  std::vector<double>
+  getDblValues(const API::MatrixWorkspace_const_sptr &dataws,
+               int workspace_index);
 
   /// get the vector of times of the TimeSeriesProperty entries
   std::vector<Types::Core::DateAndTime>
-  getTimes(API::MatrixWorkspace_const_sptr dataws, int workspace_index,
+  getTimes(const API::MatrixWorkspace_const_sptr &dataws, int workspace_index,
            bool is_epoch, bool is_second, API::Run &run_obj);
 
   /// get meta data from input workspace or user input
-  void getMetaData(API::MatrixWorkspace_const_sptr dataws, bool &epochtime,
-                   std::string &timeunit);
+  void getMetaData(const API::MatrixWorkspace_const_sptr &dataws,
+                   bool &epochtime, std::string &timeunit);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/AlignDetectors.h b/Framework/Algorithms/inc/MantidAlgorithms/AlignDetectors.h
index 262863c52e9..b2dba6d8716 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/AlignDetectors.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/AlignDetectors.h
@@ -73,9 +73,9 @@ private:
   void align(const ConversionFactors &converter, API::Progress &progress,
              DataObjects::EventWorkspace &outputWS);
 
-  void loadCalFile(API::MatrixWorkspace_sptr inputWS,
+  void loadCalFile(const API::MatrixWorkspace_sptr &inputWS,
                    const std::string &filename);
-  void getCalibrationWS(API::MatrixWorkspace_sptr inputWS);
+  void getCalibrationWS(const API::MatrixWorkspace_sptr &inputWS);
 
   Mantid::API::ITableWorkspace_sptr m_calibrationWS;
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/Bin2DPowderDiffraction.h b/Framework/Algorithms/inc/MantidAlgorithms/Bin2DPowderDiffraction.h
index 8df86f65df3..5bd4f7d1bd5 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/Bin2DPowderDiffraction.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/Bin2DPowderDiffraction.h
@@ -47,7 +47,7 @@ private:
   DataObjects::EventWorkspace_sptr
       m_inputWS;         ///< Pointer to the input event workspace
   int m_numberOfSpectra; ///< The number of spectra in the workspace
-  void normalizeToBinArea(API::MatrixWorkspace_sptr outWS);
+  void normalizeToBinArea(const API::MatrixWorkspace_sptr &outWS);
 };
 
 double calcD(double wavelength, double sintheta);
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/BinaryOperation.h b/Framework/Algorithms/inc/MantidAlgorithms/BinaryOperation.h
index 095d6e2c18a..f8598c52cdf 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/BinaryOperation.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/BinaryOperation.h
@@ -193,7 +193,7 @@ protected:
     (void)ans;
   };
 
-  OperandType getOperandType(const API::MatrixWorkspace_const_sptr ws);
+  OperandType getOperandType(const API::MatrixWorkspace_const_sptr &ws);
 
   virtual void checkRequirements();
 
@@ -255,8 +255,8 @@ private:
   void doSingleColumn();
   void do2D(bool mismatchedSpectra);
 
-  void propagateBinMasks(const API::MatrixWorkspace_const_sptr rhs,
-                         API::MatrixWorkspace_sptr out);
+  void propagateBinMasks(const API::MatrixWorkspace_const_sptr &rhs,
+                         const API::MatrixWorkspace_sptr &out);
   /// Progress reporting
   std::unique_ptr<API::Progress> m_progress = nullptr;
 };
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CalculateCarpenterSampleCorrection.h b/Framework/Algorithms/inc/MantidAlgorithms/CalculateCarpenterSampleCorrection.h
index 3342d463b0f..f1be5292a6b 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CalculateCarpenterSampleCorrection.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CalculateCarpenterSampleCorrection.h
@@ -61,10 +61,10 @@ private:
 
   API::MatrixWorkspace_sptr
   createOutputWorkspace(const API::MatrixWorkspace_sptr &inputWS,
-                        const std::string) const;
-  void deleteWorkspace(API::MatrixWorkspace_sptr workspace);
+                        const std::string &) const;
+  void deleteWorkspace(const API::MatrixWorkspace_sptr &workspace);
   API::MatrixWorkspace_sptr
-  setUncertainties(API::MatrixWorkspace_sptr workspace);
+  setUncertainties(const API::MatrixWorkspace_sptr &workspace);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CalculateDynamicRange.h b/Framework/Algorithms/inc/MantidAlgorithms/CalculateDynamicRange.h
index 4af1002d855..bdf3f4a5bfc 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CalculateDynamicRange.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CalculateDynamicRange.h
@@ -25,8 +25,8 @@ public:
 private:
   void init() override;
   void exec() override;
-  void calculateQMinMax(API::MatrixWorkspace_sptr, const std::vector<size_t> &,
-                        const std::string &);
+  void calculateQMinMax(const API::MatrixWorkspace_sptr &,
+                        const std::vector<size_t> &, const std::string &);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CalculateEfficiency.h b/Framework/Algorithms/inc/MantidAlgorithms/CalculateEfficiency.h
index a781121fb44..b88b74a74fa 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CalculateEfficiency.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CalculateEfficiency.h
@@ -70,19 +70,19 @@ private:
   void exec() override;
 
   /// Sum all detectors, excluding monitors and masked detectors
-  void sumUnmaskedDetectors(API::MatrixWorkspace_sptr rebinnedWS, double &sum,
-                            double &error, int &nPixels);
+  void sumUnmaskedDetectors(const API::MatrixWorkspace_sptr &rebinnedWS,
+                            double &sum, double &error, int &nPixels);
 
   /// Normalize all detectors to get the relative efficiency
-  void normalizeDetectors(API::MatrixWorkspace_sptr rebinnedWS,
-                          API::MatrixWorkspace_sptr outputWS, double sum,
+  void normalizeDetectors(const API::MatrixWorkspace_sptr &rebinnedWS,
+                          const API::MatrixWorkspace_sptr &outputWS, double sum,
                           double error, int nPixels, double min_eff,
                           double max_eff);
 
   void maskComponent(API::MatrixWorkspace &ws,
                      const std::string &componentName);
-  void maskEdges(API::MatrixWorkspace_sptr ws, int high, int low, int left,
-                 int right, const std::string &componentName);
+  void maskEdges(const API::MatrixWorkspace_sptr &ws, int high, int low,
+                 int left, int right, const std::string &componentName);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CalculateIqt.h b/Framework/Algorithms/inc/MantidAlgorithms/CalculateIqt.h
index c2267bea170..e060732d340 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CalculateIqt.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CalculateIqt.h
@@ -28,24 +28,26 @@ private:
   std::map<std::string, std::string> validateInputs() override;
   std::string rebinParamsAsString();
   API::MatrixWorkspace_sptr
-  monteCarloErrorCalculation(API::MatrixWorkspace_sptr sample,
-                             API::MatrixWorkspace_sptr resolution,
+  monteCarloErrorCalculation(const API::MatrixWorkspace_sptr &sample,
+                             const API::MatrixWorkspace_sptr &resolution,
                              const std::string &rebinParams, const int seed,
                              const bool calculateErrors, const int nIterations);
 
-  API::MatrixWorkspace_sptr rebin(API::MatrixWorkspace_sptr workspace,
+  API::MatrixWorkspace_sptr rebin(const API::MatrixWorkspace_sptr &workspace,
                                   const std::string &params);
-  API::MatrixWorkspace_sptr integration(API::MatrixWorkspace_sptr workspace);
   API::MatrixWorkspace_sptr
-  convertToPointData(API::MatrixWorkspace_sptr workspace);
+  integration(const API::MatrixWorkspace_sptr &workspace);
   API::MatrixWorkspace_sptr
-  extractFFTSpectrum(API::MatrixWorkspace_sptr workspace);
-  API::MatrixWorkspace_sptr divide(API::MatrixWorkspace_sptr lhsWorkspace,
-                                   API::MatrixWorkspace_sptr rhsWorkspace);
-  API::MatrixWorkspace_sptr cropWorkspace(API::MatrixWorkspace_sptr workspace,
-                                          const double xMax);
+  convertToPointData(const API::MatrixWorkspace_sptr &workspace);
   API::MatrixWorkspace_sptr
-  replaceSpecialValues(API::MatrixWorkspace_sptr workspace);
+  extractFFTSpectrum(const API::MatrixWorkspace_sptr &workspace);
+  API::MatrixWorkspace_sptr
+  divide(const API::MatrixWorkspace_sptr &lhsWorkspace,
+         const API::MatrixWorkspace_sptr &rhsWorkspace);
+  API::MatrixWorkspace_sptr
+  cropWorkspace(const API::MatrixWorkspace_sptr &workspace, const double xMax);
+  API::MatrixWorkspace_sptr
+  replaceSpecialValues(const API::MatrixWorkspace_sptr &workspace);
 
   API::MatrixWorkspace_sptr
   removeInvalidData(API::MatrixWorkspace_sptr workspace);
@@ -54,7 +56,7 @@ private:
                              const std::string &rebinParams);
   API::MatrixWorkspace_sptr
   calculateIqt(API::MatrixWorkspace_sptr workspace,
-               API::MatrixWorkspace_sptr resolutionWorkspace,
+               const API::MatrixWorkspace_sptr &resolutionWorkspace,
                const std::string &rebinParams);
   API::MatrixWorkspace_sptr doSimulation(API::MatrixWorkspace_sptr sample,
                                          API::MatrixWorkspace_sptr resolution,
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CalculateTransmission.h b/Framework/Algorithms/inc/MantidAlgorithms/CalculateTransmission.h
index bd42d4ffaa6..1a9c176f944 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CalculateTransmission.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CalculateTransmission.h
@@ -80,27 +80,27 @@ private:
   void exec() override;
 
   /// Pull out a single spectrum from a 2D workspace
-  API::MatrixWorkspace_sptr extractSpectra(API::MatrixWorkspace_sptr ws,
+  API::MatrixWorkspace_sptr extractSpectra(const API::MatrixWorkspace_sptr &ws,
                                            const std::vector<size_t> &indices);
   /// Returns a workspace with the evaulation of the fit to the calculated
   /// transmission fraction
-  API::MatrixWorkspace_sptr fit(API::MatrixWorkspace_sptr raw,
+  API::MatrixWorkspace_sptr fit(const API::MatrixWorkspace_sptr &raw,
                                 const std::vector<double> &rebinParams,
-                                const std::string fitMethod);
+                                const std::string &fitMethod);
   /// Call the Linear fitting algorithm as a child algorithm
-  API::MatrixWorkspace_sptr fitData(API::MatrixWorkspace_sptr WS, double &grad,
-                                    double &offset);
+  API::MatrixWorkspace_sptr fitData(const API::MatrixWorkspace_sptr &WS,
+                                    double &grad, double &offset);
   /// Call the Polynomial fitting algorithm as a child algorithm
-  API::MatrixWorkspace_sptr fitPolynomial(API::MatrixWorkspace_sptr WS,
+  API::MatrixWorkspace_sptr fitPolynomial(const API::MatrixWorkspace_sptr &WS,
                                           int order,
                                           std::vector<double> &coeficients);
   /// Calls the rebin algorithm
   API::MatrixWorkspace_sptr rebin(const std::vector<double> &binParams,
-                                  API::MatrixWorkspace_sptr ws);
+                                  const API::MatrixWorkspace_sptr &ws);
   /// Outpus message to log if the detector at the given index is not a monitor
   /// in both input workspaces.
-  void logIfNotMonitor(API::MatrixWorkspace_sptr sampleWS,
-                       API::MatrixWorkspace_sptr directWS, size_t index);
+  void logIfNotMonitor(const API::MatrixWorkspace_sptr &sampleWS,
+                       const API::MatrixWorkspace_sptr &directWS, size_t index);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CalculateTransmissionBeamSpreader.h b/Framework/Algorithms/inc/MantidAlgorithms/CalculateTransmissionBeamSpreader.h
index 1e594003283..ed1123c2419 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CalculateTransmissionBeamSpreader.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CalculateTransmissionBeamSpreader.h
@@ -85,12 +85,12 @@ private:
   void exec() override;
 
   /// Pull out a single spectrum from a 2D workspace
-  API::MatrixWorkspace_sptr extractSpectrum(API::MatrixWorkspace_sptr WS,
+  API::MatrixWorkspace_sptr extractSpectrum(const API::MatrixWorkspace_sptr &WS,
                                             const size_t index);
   /// Call the Linear fitting algorithm as a child algorithm
-  API::MatrixWorkspace_sptr fitToData(API::MatrixWorkspace_sptr WS);
+  API::MatrixWorkspace_sptr fitToData(const API::MatrixWorkspace_sptr &WS);
   /// Sum the total detector, excluding masked pixels and monitors
-  API::MatrixWorkspace_sptr sumSpectra(API::MatrixWorkspace_sptr WS);
+  API::MatrixWorkspace_sptr sumSpectra(const API::MatrixWorkspace_sptr &WS);
 
   bool logFit =
       false; ///< If true, will take log of transmission curve before fitting
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CarpenterSampleCorrection.h b/Framework/Algorithms/inc/MantidAlgorithms/CarpenterSampleCorrection.h
index a2f95dfe923..3077f12a103 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CarpenterSampleCorrection.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CarpenterSampleCorrection.h
@@ -58,10 +58,10 @@ private:
                       double coeff1, double coeff2, double coeff3, bool doAbs,
                       bool doMS);
 
-  API::MatrixWorkspace_sptr multiply(const API::MatrixWorkspace_sptr lhsWS,
-                                     const API::MatrixWorkspace_sptr rhsWS);
-  API::MatrixWorkspace_sptr minus(const API::MatrixWorkspace_sptr lhsWS,
-                                  const API::MatrixWorkspace_sptr rhsWS);
+  API::MatrixWorkspace_sptr multiply(const API::MatrixWorkspace_sptr &lhsWS,
+                                     const API::MatrixWorkspace_sptr &rhsWS);
+  API::MatrixWorkspace_sptr minus(const API::MatrixWorkspace_sptr &lhsWS,
+                                  const API::MatrixWorkspace_sptr &rhsWS);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ChangeTimeZero.h b/Framework/Algorithms/inc/MantidAlgorithms/ChangeTimeZero.h
index f2ce9132961..ec2099ea8f2 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ChangeTimeZero.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ChangeTimeZero.h
@@ -39,23 +39,24 @@ private:
   void exec() override;
   /// Create the output workspace
   Mantid::API::MatrixWorkspace_sptr
-  createOutputWS(Mantid::API::MatrixWorkspace_sptr input, double startProgress,
-                 double stopProgress);
+  createOutputWS(const Mantid::API::MatrixWorkspace_sptr &input,
+                 double startProgress, double stopProgress);
   /// Get the time shift
-  double getTimeShift(API::MatrixWorkspace_sptr ws) const;
+  double getTimeShift(const API::MatrixWorkspace_sptr &ws) const;
   /// Shift the time of the logs
-  void shiftTimeOfLogs(Mantid::API::MatrixWorkspace_sptr ws, double timeShift,
-                       double startProgress, double stopProgress);
+  void shiftTimeOfLogs(const Mantid::API::MatrixWorkspace_sptr &ws,
+                       double timeShift, double startProgress,
+                       double stopProgress);
   /// Get the date and time of the first good frame of a workspace
   Mantid::Types::Core::DateAndTime
-  getStartTimeFromWorkspace(Mantid::API::MatrixWorkspace_sptr ws) const;
+  getStartTimeFromWorkspace(const Mantid::API::MatrixWorkspace_sptr &ws) const;
   /// Can the string be transformed to double
-  bool checkForDouble(std::string val) const;
+  bool checkForDouble(const std::string &val) const;
   /// Can the string be transformed to a DateTime
   bool checkForDateTime(const std::string &val) const;
 
   /// Time shift the log of a double series property
-  void shiftTimeInLogForTimeSeries(Mantid::API::MatrixWorkspace_sptr ws,
+  void shiftTimeInLogForTimeSeries(const Mantid::API::MatrixWorkspace_sptr &ws,
                                    Mantid::Kernel::Property *prop,
                                    double timeShift) const;
   /// Time shift the log of a string property
@@ -63,7 +64,7 @@ private:
       Mantid::Kernel::PropertyWithValue<std::string> *logEntry,
       double timeShift) const;
   // Shift the time of the neutrons
-  void shiftTimeOfNeutrons(Mantid::API::MatrixWorkspace_sptr ws,
+  void shiftTimeOfNeutrons(const Mantid::API::MatrixWorkspace_sptr &ws,
                            double timeShift, double startProgress,
                            double stopProgress);
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CompareWorkspaces.h b/Framework/Algorithms/inc/MantidAlgorithms/CompareWorkspaces.h
index 67af3faa165..107db8a58bf 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CompareWorkspaces.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CompareWorkspaces.h
@@ -95,28 +95,30 @@ private:
   bool processGroups() override;
 
   /// Process the two groups
-  void processGroups(boost::shared_ptr<const API::WorkspaceGroup> groupOne,
-                     boost::shared_ptr<const API::WorkspaceGroup> groupTwo);
+  void
+  processGroups(const boost::shared_ptr<const API::WorkspaceGroup> &groupOne,
+                const boost::shared_ptr<const API::WorkspaceGroup> &groupTwo);
 
   void doComparison();
 
   void doPeaksComparison(DataObjects::PeaksWorkspace_sptr tws1,
                          DataObjects::PeaksWorkspace_sptr tws2);
-  void doTableComparison(API::ITableWorkspace_const_sptr tws1,
-                         API::ITableWorkspace_const_sptr tws2);
-  void doMDComparison(API::Workspace_sptr w1, API::Workspace_sptr w2);
+  void doTableComparison(const API::ITableWorkspace_const_sptr &tws1,
+                         const API::ITableWorkspace_const_sptr &tws2);
+  void doMDComparison(const API::Workspace_sptr &w1,
+                      const API::Workspace_sptr &w2);
   bool compareEventWorkspaces(const DataObjects::EventWorkspace &ews1,
                               const DataObjects::EventWorkspace &ews2);
-  bool checkData(API::MatrixWorkspace_const_sptr ws1,
-                 API::MatrixWorkspace_const_sptr ws2);
-  bool checkAxes(API::MatrixWorkspace_const_sptr ws1,
-                 API::MatrixWorkspace_const_sptr ws2);
-  bool checkSpectraMap(API::MatrixWorkspace_const_sptr ws1,
-                       API::MatrixWorkspace_const_sptr ws2);
-  bool checkInstrument(API::MatrixWorkspace_const_sptr ws1,
-                       API::MatrixWorkspace_const_sptr ws2);
-  bool checkMasking(API::MatrixWorkspace_const_sptr ws1,
-                    API::MatrixWorkspace_const_sptr ws2);
+  bool checkData(const API::MatrixWorkspace_const_sptr &ws1,
+                 const API::MatrixWorkspace_const_sptr &ws2);
+  bool checkAxes(const API::MatrixWorkspace_const_sptr &ws1,
+                 const API::MatrixWorkspace_const_sptr &ws2);
+  bool checkSpectraMap(const API::MatrixWorkspace_const_sptr &ws1,
+                       const API::MatrixWorkspace_const_sptr &ws2);
+  bool checkInstrument(const API::MatrixWorkspace_const_sptr &ws1,
+                       const API::MatrixWorkspace_const_sptr &ws2);
+  bool checkMasking(const API::MatrixWorkspace_const_sptr &ws1,
+                    const API::MatrixWorkspace_const_sptr &ws2);
   bool checkSample(const API::Sample &sample1, const API::Sample &sample2);
   bool checkRunProperties(const API::Run &run1, const API::Run &run2);
 
@@ -130,7 +132,7 @@ private:
                                  size_t &numdiffweight) const;
 
   /// Records a mismatch in the Messages workspace and sets Result to false
-  void recordMismatch(std::string msg, std::string ws1 = "",
+  void recordMismatch(const std::string &msg, std::string ws1 = "",
                       std::string ws2 = "");
 
   bool relErr(double x1, double x2, double errorVal) const;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ConjoinXRuns.h b/Framework/Algorithms/inc/MantidAlgorithms/ConjoinXRuns.h
index 382d9012d01..bd95f9d9988 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ConjoinXRuns.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ConjoinXRuns.h
@@ -42,8 +42,8 @@ private:
   void init() override;
   void exec() override;
 
-  std::string checkLogEntry(API::MatrixWorkspace_sptr) const;
-  std::vector<double> getXAxis(API::MatrixWorkspace_sptr) const;
+  std::string checkLogEntry(const API::MatrixWorkspace_sptr &) const;
+  std::vector<double> getXAxis(const API::MatrixWorkspace_sptr &) const;
   void joinSpectrum(int64_t);
 
   /// Sample log entry name
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ConvertEmptyToTof.h b/Framework/Algorithms/inc/MantidAlgorithms/ConvertEmptyToTof.h
index 064281492b0..ddb8efc44bf 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ConvertEmptyToTof.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ConvertEmptyToTof.h
@@ -58,7 +58,8 @@ private:
   bool areEqual(double, double, double);
   int roundUp(double);
   std::vector<double> makeTofAxis(int, double, size_t, double);
-  void setTofInWS(const std::vector<double> &, API::MatrixWorkspace_sptr);
+  void setTofInWS(const std::vector<double> &,
+                  const API::MatrixWorkspace_sptr &);
 
   DataObjects::Workspace2D_sptr m_inputWS;
   API::MatrixWorkspace_sptr m_outputWS;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ConvertSpectrumAxis.h b/Framework/Algorithms/inc/MantidAlgorithms/ConvertSpectrumAxis.h
index 16370d79ad3..c901152c2a8 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ConvertSpectrumAxis.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ConvertSpectrumAxis.h
@@ -61,7 +61,8 @@ private:
   void exec() override;
   /// Getting Efixed
   double getEfixed(const Mantid::Geometry::IDetector &detector,
-                   API::MatrixWorkspace_const_sptr inputWS, int emode) const;
+                   const API::MatrixWorkspace_const_sptr &inputWS,
+                   int emode) const;
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ConvertToConstantL2.h b/Framework/Algorithms/inc/MantidAlgorithms/ConvertToConstantL2.h
index 77ee90c93e7..0b7263119f7 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ConvertToConstantL2.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ConvertToConstantL2.h
@@ -51,8 +51,8 @@ private:
   void init() override;
   void exec() override;
   void initWorkspaces();
-  double getRunProperty(std::string);
-  double getInstrumentProperty(std::string);
+  double getRunProperty(const std::string &);
+  double getInstrumentProperty(const std::string &);
   double calculateTOF(double);
 
   /// The user selected (input) workspace
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ConvertUnits.h b/Framework/Algorithms/inc/MantidAlgorithms/ConvertUnits.h
index 44ae9d412ba..aef3ddfa017 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ConvertUnits.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ConvertUnits.h
@@ -69,12 +69,12 @@ public:
 
 protected:
   /// Reverses the workspace if X values are in descending order
-  void reverse(API::MatrixWorkspace_sptr WS);
+  void reverse(const API::MatrixWorkspace_sptr &WS);
 
   /// For conversions to energy transfer, removes bins corresponding to
   /// inaccessible values
   API::MatrixWorkspace_sptr
-  removeUnphysicalBins(const API::MatrixWorkspace_const_sptr workspace);
+  removeUnphysicalBins(const API::MatrixWorkspace_const_sptr &workspace);
 
   const std::string workspaceMethodName() const override {
     return "convertUnits";
@@ -87,21 +87,21 @@ protected:
   void init() override;
   void exec() override;
 
-  void setupMemberVariables(const API::MatrixWorkspace_const_sptr inputWS);
+  void setupMemberVariables(const API::MatrixWorkspace_const_sptr &inputWS);
   virtual void storeEModeOnWorkspace(API::MatrixWorkspace_sptr outputWS);
   API::MatrixWorkspace_sptr
-  setupOutputWorkspace(const API::MatrixWorkspace_const_sptr inputWS);
+  setupOutputWorkspace(const API::MatrixWorkspace_const_sptr &inputWS);
 
   /// Executes the main part of the algorithm that handles the conversion of the
   /// units
   API::MatrixWorkspace_sptr
-  executeUnitConversion(const API::MatrixWorkspace_sptr inputWS);
+  executeUnitConversion(const API::MatrixWorkspace_sptr &inputWS);
 
   /// Convert the workspace units according to a simple output = a * (input^b)
   /// relationship
   API::MatrixWorkspace_sptr
-  convertQuickly(API::MatrixWorkspace_const_sptr inputWS, const double &factor,
-                 const double &power);
+  convertQuickly(const API::MatrixWorkspace_const_sptr &inputWS,
+                 const double &factor, const double &power);
 
   /// Internal function to gather detector specific L2, theta and efixed values
   bool getDetectorValues(const API::SpectrumInfo &spectrumInfo,
@@ -118,11 +118,11 @@ protected:
 
   // Calls Rebin as a Child Algorithm to align the bins of the output workspace
   API::MatrixWorkspace_sptr
-  alignBins(const API::MatrixWorkspace_sptr workspace);
+  alignBins(const API::MatrixWorkspace_sptr &workspace);
   const std::vector<double>
-  calculateRebinParams(const API::MatrixWorkspace_const_sptr workspace) const;
+  calculateRebinParams(const API::MatrixWorkspace_const_sptr &workspace) const;
 
-  void putBackBinWidth(const API::MatrixWorkspace_sptr outputWS);
+  void putBackBinWidth(const API::MatrixWorkspace_sptr &outputWS);
 
   std::size_t m_numberOfSpectra{
       0};                     ///< The number of spectra in the input workspace
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CorrectKiKf.h b/Framework/Algorithms/inc/MantidAlgorithms/CorrectKiKf.h
index b6d92fc6624..3d802a8f70a 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CorrectKiKf.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CorrectKiKf.h
@@ -75,7 +75,7 @@ private:
    */
   template <class T>
   void correctKiKfEventHelper(std::vector<T> &wevector, double efixed,
-                              const std::string emodeStr);
+                              const std::string &emodeStr);
   void getEfixedFromParameterMap(double &Efi, int64_t i,
                                  const Mantid::API::SpectrumInfo &spectrumInfo,
                                  const Mantid::Geometry::ParameterMap &pmap);
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CorrectTOFAxis.h b/Framework/Algorithms/inc/MantidAlgorithms/CorrectTOFAxis.h
index 487e6eeefc0..cc380fc5809 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CorrectTOFAxis.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CorrectTOFAxis.h
@@ -43,8 +43,8 @@ private:
   void init() override;
   std::map<std::string, std::string> validateInputs() override;
   void exec() override;
-  void useReferenceWorkspace(API::MatrixWorkspace_sptr outputWs);
-  void correctManually(API::MatrixWorkspace_sptr outputWs);
+  void useReferenceWorkspace(const API::MatrixWorkspace_sptr &outputWs);
+  void correctManually(const API::MatrixWorkspace_sptr &outputWs);
   double averageL2(const API::SpectrumInfo &spectrumInfo);
   void averageL2AndEPP(const API::SpectrumInfo &spectrumInfo, double &l2,
                        double &epp);
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CorrectToFile.h b/Framework/Algorithms/inc/MantidAlgorithms/CorrectToFile.h
index b460a19d2ed..345a4d5f1c9 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CorrectToFile.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CorrectToFile.h
@@ -54,8 +54,9 @@ private:
   /// Load in the RKH file for that has the correction information
   API::MatrixWorkspace_sptr loadInFile(const std::string &corrFile);
   /// Multiply or divide the input workspace as specified by the user
-  void doWkspAlgebra(API::MatrixWorkspace_sptr lhs,
-                     API::MatrixWorkspace_sptr rhs, const std::string &algName,
+  void doWkspAlgebra(const API::MatrixWorkspace_sptr &lhs,
+                     const API::MatrixWorkspace_sptr &rhs,
+                     const std::string &algName,
                      API::MatrixWorkspace_sptr &result);
 };
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreateFloodWorkspace.h b/Framework/Algorithms/inc/MantidAlgorithms/CreateFloodWorkspace.h
index 0a6222f000c..5ee9bb5ebaa 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreateFloodWorkspace.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreateFloodWorkspace.h
@@ -30,8 +30,8 @@ private:
   void exec() override;
   API::MatrixWorkspace_sptr getInputWorkspace();
   std::string getBackgroundFunction();
-  API::MatrixWorkspace_sptr integrate(API::MatrixWorkspace_sptr ws);
-  API::MatrixWorkspace_sptr transpose(API::MatrixWorkspace_sptr ws);
+  API::MatrixWorkspace_sptr integrate(const API::MatrixWorkspace_sptr &ws);
+  API::MatrixWorkspace_sptr transpose(const API::MatrixWorkspace_sptr &ws);
   bool shouldRemoveBackground();
   void collectExcludedSpectra();
   bool isExcludedSpectrum(double spec) const;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreateLogTimeCorrection.h b/Framework/Algorithms/inc/MantidAlgorithms/CreateLogTimeCorrection.h
index 1b5ac646c72..3b394e4a005 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreateLogTimeCorrection.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreateLogTimeCorrection.h
@@ -65,7 +65,7 @@ private:
                           const std::vector<double> &corrections) const;
 
   /// Write correction map to a text file
-  void writeCorrectionToFile(const std::string filename,
+  void writeCorrectionToFile(const std::string &filename,
                              const Geometry::DetectorInfo &detectorInfo,
                              const std::vector<double> &corrections) const;
 };
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreatePSDBleedMask.h b/Framework/Algorithms/inc/MantidAlgorithms/CreatePSDBleedMask.h
index 983716706a5..eef18d270f1 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreatePSDBleedMask.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreatePSDBleedMask.h
@@ -53,11 +53,11 @@ private:
 
   /// Process a tube
   bool performBleedTest(const std::vector<int> &tubeIndices,
-                        API::MatrixWorkspace_const_sptr inputWS, double maxRate,
-                        int numIgnoredPixels);
+                        const API::MatrixWorkspace_const_sptr &inputWS,
+                        double maxRate, int numIgnoredPixels);
   /// Mask a tube with the given workspace indices
   void maskTube(const std::vector<int> &tubeIndices,
-                API::MatrixWorkspace_sptr workspace);
+                const API::MatrixWorkspace_sptr &workspace);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreateSampleWorkspace.h b/Framework/Algorithms/inc/MantidAlgorithms/CreateSampleWorkspace.h
index ca5266bb922..31f7422b0e5 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreateSampleWorkspace.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreateSampleWorkspace.h
@@ -42,16 +42,18 @@ private:
   DataObjects::EventWorkspace_sptr
   createEventWorkspace(int numPixels, int numBins, int numMonitors,
                        int numEvents, double x0, double binDelta,
-                       Geometry::Instrument_sptr inst,
+                       const Geometry::Instrument_sptr &inst,
                        const std::string &functionString, bool isRandom);
   API::MatrixWorkspace_sptr
   createHistogramWorkspace(int numPixels, int numBins, int numMonitors,
                            double x0, double binDelta,
-                           Geometry::Instrument_sptr inst,
+                           const Geometry::Instrument_sptr &inst,
                            const std::string &functionString, bool isRandom);
-  API::MatrixWorkspace_sptr createScanningWorkspace(
-      int numBins, double x0, double binDelta, Geometry::Instrument_sptr inst,
-      const std::string &functionString, bool isRandom, int numScanPoints);
+  API::MatrixWorkspace_sptr
+  createScanningWorkspace(int numBins, double x0, double binDelta,
+                          const Geometry::Instrument_sptr &inst,
+                          const std::string &functionString, bool isRandom,
+                          int numScanPoints);
   Geometry::Instrument_sptr createTestInstrumentRectangular(
       API::Progress &progress, int numBanks, int numMonitors, int pixels,
       double pixelSpacing, const double bankDistanceFromSample,
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace.h b/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace.h
index 5d9c55fece6..2b0f5b58f40 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace.h
@@ -35,7 +35,7 @@ private:
       const OptionalMinMax &wavelengthMonitorBackgroundInterval,
       const OptionalMinMax &wavelengthMonitorIntegrationInterval,
       const OptionalInteger &i0MonitorIndex,
-      API::MatrixWorkspace_sptr firstTransmissionRun,
+      const API::MatrixWorkspace_sptr &firstTransmissionRun,
       OptionalMatrixWorkspace_sptr secondTransmissionRun,
       const OptionalDouble &stitchingStart,
       const OptionalDouble &stitchingDelta, const OptionalDouble &stitchingEnd,
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace2.h b/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace2.h
index 5bb06887508..b277f7a7315 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace2.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace2.h
@@ -36,15 +36,15 @@ private:
 
   /// Normalize by monitors
   API::MatrixWorkspace_sptr
-  normalizeDetectorsByMonitors(API::MatrixWorkspace_sptr IvsTOF);
+  normalizeDetectorsByMonitors(const API::MatrixWorkspace_sptr &IvsTOF);
   /// Get the run numbers of the input workspaces
   void getRunNumbers();
   /// Get the run number of a given workspace
   std::string getRunNumber(std::string const &propertyName);
   /// Store a transition run in ADS
-  void setOutputTransmissionRun(int which, API::MatrixWorkspace_sptr ws);
+  void setOutputTransmissionRun(int which, const API::MatrixWorkspace_sptr &ws);
   /// Store the stitched transition workspace run in ADS
-  void setOutputWorkspace(API::MatrixWorkspace_sptr ws);
+  void setOutputWorkspace(const API::MatrixWorkspace_sptr &ws);
 
   /// Run numbers for the first/second transmission run
   std::string m_firstTransmissionRunNumber;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspaceAuto.h b/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspaceAuto.h
index 471625df43a..75546c2e085 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspaceAuto.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspaceAuto.h
@@ -36,7 +36,8 @@ private:
   void init() override;
   void exec() override;
 
-  template <typename T> boost::optional<T> isSet(std::string propName) const;
+  template <typename T>
+  boost::optional<T> isSet(const std::string &propName) const;
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/DetectorDiagnostic.h b/Framework/Algorithms/inc/MantidAlgorithms/DetectorDiagnostic.h
index e0b95553eaf..61288319221 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/DetectorDiagnostic.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/DetectorDiagnostic.h
@@ -54,21 +54,21 @@ private:
   void init() override;
   void exec() override;
   /// Apply a given mask
-  void applyMask(API::MatrixWorkspace_sptr inputWS,
-                 API::MatrixWorkspace_sptr maskWS);
+  void applyMask(const API::MatrixWorkspace_sptr &inputWS,
+                 const API::MatrixWorkspace_sptr &maskWS);
   /// Perform checks on detector vanadium
-  API::MatrixWorkspace_sptr doDetVanTest(API::MatrixWorkspace_sptr inputWS,
-                                         int &nFails);
+  API::MatrixWorkspace_sptr
+  doDetVanTest(const API::MatrixWorkspace_sptr &inputWS, int &nFails);
 
 protected:
   /// Get the total counts for each spectra
   API::MatrixWorkspace_sptr
-  integrateSpectra(API::MatrixWorkspace_sptr inputWS, const int indexMin,
+  integrateSpectra(const API::MatrixWorkspace_sptr &inputWS, const int indexMin,
                    const int indexMax, const double lower, const double upper,
                    const bool outputWorkspace2D = false);
 
   DataObjects::MaskWorkspace_sptr
-  generateEmptyMask(API::MatrixWorkspace_const_sptr inputWS);
+  generateEmptyMask(const API::MatrixWorkspace_const_sptr &inputWS);
 
   /// Calculate the median of the given workspace. This assumes that the input
   /// workspace contains
@@ -80,7 +80,8 @@ protected:
   API::MatrixWorkspace_sptr convertToRate(API::MatrixWorkspace_sptr workspace);
   /// method to check which spectra should be grouped when calculating the
   /// median
-  std::vector<std::vector<size_t>> makeMap(API::MatrixWorkspace_sptr countsWS);
+  std::vector<std::vector<size_t>>
+  makeMap(const API::MatrixWorkspace_sptr &countsWS);
   /// method to create the map with all spectra
   std::vector<std::vector<size_t>>
   makeInstrumentMap(const API::MatrixWorkspace &countsWS);
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyVariation.h b/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyVariation.h
index 45618d55871..205ada7ea22 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyVariation.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/DetectorEfficiencyVariation.h
@@ -72,8 +72,8 @@ protected:
                           API::MatrixWorkspace_sptr &whiteBeam2,
                           double &variation, int &minSpec, int &maxSpec);
   /// Apply the detector test criterion
-  int doDetectorTests(API::MatrixWorkspace_const_sptr counts1,
-                      API::MatrixWorkspace_const_sptr counts2,
+  int doDetectorTests(const API::MatrixWorkspace_const_sptr &counts1,
+                      const API::MatrixWorkspace_const_sptr &counts2,
                       const double average, double variation);
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/DiffractionEventCalibrateDetectors.h b/Framework/Algorithms/inc/MantidAlgorithms/DiffractionEventCalibrateDetectors.h
index 059a5714105..1bf164a22f2 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/DiffractionEventCalibrateDetectors.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/DiffractionEventCalibrateDetectors.h
@@ -49,12 +49,13 @@ public:
   }
   /// Function to optimize
   double intensity(double x, double y, double z, double rotx, double roty,
-                   double rotz, std::string detname, std::string inname,
-                   std::string outname, std::string peakOpt,
-                   std::string rb_param, std::string groupWSName);
+                   double rotz, const std::string &detname,
+                   const std::string &inname, const std::string &outname,
+                   const std::string &peakOpt, const std::string &rb_param,
+                   const std::string &groupWSName);
   void movedetector(double x, double y, double z, double rotx, double roty,
-                    double rotz, std::string detname,
-                    Mantid::DataObjects::EventWorkspace_sptr inputW);
+                    double rotz, const std::string &detname,
+                    const Mantid::DataObjects::EventWorkspace_sptr &inputW);
 
 private:
   // Overridden Algorithm methods
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/DiffractionFocussing.h b/Framework/Algorithms/inc/MantidAlgorithms/DiffractionFocussing.h
index 8795383fb3a..ffe71bb24d0 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/DiffractionFocussing.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/DiffractionFocussing.h
@@ -78,7 +78,7 @@ private:
   void calculateRebinParams(const API::MatrixWorkspace_const_sptr &workspace,
                             double &min, double &max, double &step);
   std::multimap<int64_t, int64_t>
-  readGroupingFile(std::string groupingFileName);
+  readGroupingFile(const std::string &groupingFileName);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/EQSANSTofStructure.h b/Framework/Algorithms/inc/MantidAlgorithms/EQSANSTofStructure.h
index 65a3f8b9730..3b131ab4ed5 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/EQSANSTofStructure.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/EQSANSTofStructure.h
@@ -60,12 +60,12 @@ private:
   void exec() override;
   // void execEvent(Mantid::DataObjects::EventWorkspace_sptr inputWS, bool
   // frame_skipping);
-  void execEvent(Mantid::DataObjects::EventWorkspace_sptr inputWS,
+  void execEvent(const Mantid::DataObjects::EventWorkspace_sptr &inputWS,
                  double threshold, double frame_offset, double tof_frame_width,
                  double tmp_frame_width, bool frame_skipping);
 
   /// Compute TOF offset
-  double getTofOffset(DataObjects::EventWorkspace_const_sptr inputWS,
+  double getTofOffset(const DataObjects::EventWorkspace_const_sptr &inputWS,
                       bool frame_skipping);
   double frame_tof0;
   bool flight_path_correction;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ExportTimeSeriesLog.h b/Framework/Algorithms/inc/MantidAlgorithms/ExportTimeSeriesLog.h
index 53771879bf5..e2e3a903912 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ExportTimeSeriesLog.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ExportTimeSeriesLog.h
@@ -58,7 +58,7 @@ private:
       const double &rel_start_time, size_t &i_start,
       const double &rel_stop_time, size_t &i_stop, const double &time_factor);
 
-  void exportLog(const std::string &logname, const std::string timeunit,
+  void exportLog(const std::string &logname, const std::string &timeunit,
                  const double &starttime, const double &stoptime,
                  const bool exportepoch, bool outputeventws, int numentries,
                  bool cal_first_deriv);
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ExtractMaskToTable.h b/Framework/Algorithms/inc/MantidAlgorithms/ExtractMaskToTable.h
index 51caf074ea8..7c0173f5e99 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ExtractMaskToTable.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ExtractMaskToTable.h
@@ -54,11 +54,11 @@ private:
   /// Parse input TableWorkspace to get a list of detectors IDs of which
   /// detector are already masked
   std::vector<detid_t>
-  parseMaskTable(DataObjects::TableWorkspace_sptr masktablews);
+  parseMaskTable(const DataObjects::TableWorkspace_sptr &masktablews);
 
   /// Parse a string containing list in format (x, xx-yy, x, x, ...) to a vector
   /// of detid_t
-  std::vector<detid_t> parseStringToVector(std::string liststr);
+  std::vector<detid_t> parseStringToVector(const std::string &liststr);
 
   /// Extract mask from a workspace to a list of detectors
   std::vector<detid_t> extractMaskFromMatrixWorkspace();
@@ -67,11 +67,12 @@ private:
   std::vector<detid_t> extractMaskFromMaskWorkspace();
 
   /// Copy table workspace content from one workspace to another
-  void copyTableWorkspaceContent(DataObjects::TableWorkspace_sptr sourceWS,
-                                 DataObjects::TableWorkspace_sptr targetWS);
+  void
+  copyTableWorkspaceContent(const DataObjects::TableWorkspace_sptr &sourceWS,
+                            const DataObjects::TableWorkspace_sptr &targetWS);
 
   /// Add a list of spectra (detector IDs) to the output table workspace
-  void addToTableWorkspace(DataObjects::TableWorkspace_sptr outws,
+  void addToTableWorkspace(const DataObjects::TableWorkspace_sptr &outws,
                            std::vector<detid_t> maskeddetids, double xmin,
                            double xmax, std::vector<detid_t> prevmaskedids);
 };
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/FindPeaks.h b/Framework/Algorithms/inc/MantidAlgorithms/FindPeaks.h
index a91db4d2de5..95f0cedf2c8 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/FindPeaks.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/FindPeaks.h
@@ -170,8 +170,8 @@ private:
 
   /// Fit peak by calling 'FitPeak'
   double callFitPeak(const API::MatrixWorkspace_sptr &dataws, int wsindex,
-                     const API::IPeakFunction_sptr peakfunction,
-                     const API::IBackgroundFunction_sptr backgroundfunction,
+                     const API::IPeakFunction_sptr &peakfunction,
+                     const API::IBackgroundFunction_sptr &backgroundfunction,
                      const std::vector<double> &vec_fitwindow,
                      const std::vector<double> &vec_peakrange, int minGuessFWHM,
                      int maxGuessFWHM, int guessedFWHMStep,
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/FitPeak.h b/Framework/Algorithms/inc/MantidAlgorithms/FitPeak.h
index 2cf6b455d0c..692741c7a35 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/FitPeak.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/FitPeak.h
@@ -38,14 +38,14 @@ public:
   }
 
   /// Set workspaces
-  void setWorskpace(API::MatrixWorkspace_sptr dataws, size_t wsindex);
+  void setWorskpace(const API::MatrixWorkspace_sptr &dataws, size_t wsindex);
 
   /// Set fitting method
-  void setFittingMethod(std::string minimizer, std::string costfunction);
+  void setFittingMethod(std::string minimizer, const std::string &costfunction);
 
   /// Set functions
-  void setFunctions(API::IPeakFunction_sptr peakfunc,
-                    API::IBackgroundFunction_sptr bkgdfunc);
+  void setFunctions(const API::IPeakFunction_sptr &peakfunc,
+                    const API::IBackgroundFunction_sptr &bkgdfunc);
 
   /// Set fit range
   void setFitWindow(double leftwindow, double rightwindow);
@@ -95,52 +95,52 @@ private:
   bool hasSetupToFitPeak(std::string &errmsg);
 
   /// Estimate the peak height from a set of data containing pure peaks
-  double estimatePeakHeight(API::IPeakFunction_const_sptr peakfunc,
-                            API::MatrixWorkspace_sptr dataws, size_t wsindex,
-                            size_t ixmin, size_t ixmax);
+  double estimatePeakHeight(const API::IPeakFunction_const_sptr &peakfunc,
+                            const API::MatrixWorkspace_sptr &dataws,
+                            size_t wsindex, size_t ixmin, size_t ixmax);
 
   /// Check a peak function whether it is valid comparing to user specified
   /// criteria
-  double checkFittedPeak(API::IPeakFunction_sptr peakfunc, double costfuncvalue,
-                         std::string &errorreason);
+  double checkFittedPeak(const API::IPeakFunction_sptr &peakfunc,
+                         double costfuncvalue, std::string &errorreason);
 
   /// Fit peak function (flexible)
-  double fitPeakFunction(API::IPeakFunction_sptr peakfunc,
-                         API::MatrixWorkspace_sptr dataws, size_t wsindex,
-                         double startx, double endx);
+  double fitPeakFunction(const API::IPeakFunction_sptr &peakfunc,
+                         const API::MatrixWorkspace_sptr &dataws,
+                         size_t wsindex, double startx, double endx);
 
   /// Fit function in single domain
   double fitFunctionSD(API::IFunction_sptr fitfunc,
-                       API::MatrixWorkspace_sptr dataws, size_t wsindex,
+                       const API::MatrixWorkspace_sptr &dataws, size_t wsindex,
                        double xmin, double xmax);
 
   /// Calculate chi-square of a single domain function
-  double calChiSquareSD(API::IFunction_sptr fitfunc,
-                        API::MatrixWorkspace_sptr dataws, size_t wsindex,
+  double calChiSquareSD(const API::IFunction_sptr &fitfunc,
+                        const API::MatrixWorkspace_sptr &dataws, size_t wsindex,
                         double xmin, double xmax);
 
   /// Fit peak and background composite function
-  double fitCompositeFunction(API::IPeakFunction_sptr peakfunc,
-                              API::IBackgroundFunction_sptr bkgdfunc,
-                              API::MatrixWorkspace_sptr dataws, size_t wsindex,
-                              double startx, double endx);
+  double fitCompositeFunction(const API::IPeakFunction_sptr &peakfunc,
+                              const API::IBackgroundFunction_sptr &bkgdfunc,
+                              const API::MatrixWorkspace_sptr &dataws,
+                              size_t wsindex, double startx, double endx);
 
   /// Fit function in multiple-domain
-  double fitFunctionMD(API::IFunction_sptr fitfunc,
-                       API::MatrixWorkspace_sptr dataws, size_t wsindex,
+  double fitFunctionMD(const API::IFunction_sptr &fitfunc,
+                       const API::MatrixWorkspace_sptr &dataws, size_t wsindex,
                        std::vector<double> vec_xmin,
                        std::vector<double> vec_xmax);
   /// remove background
-  void removeBackground(API::MatrixWorkspace_sptr purePeakWS);
+  void removeBackground(const API::MatrixWorkspace_sptr &purePeakWS);
 
   /// Process and store fit result
   void processNStoreFitResult(double rwp, bool storebkgd);
 
   /// Back up fit result
-  std::map<std::string, double> backup(API::IFunction_const_sptr func);
+  std::map<std::string, double> backup(const API::IFunction_const_sptr &func);
 
   void pop(const std::map<std::string, double> &funcparammap,
-           API::IFunction_sptr func);
+           const API::IFunction_sptr &func);
 
   /// Store function fitting error
   std::map<std::string, double>
@@ -316,14 +316,14 @@ private:
 
   /// Generate table workspace
   DataObjects::TableWorkspace_sptr
-  genOutputTableWS(API::IPeakFunction_sptr peakfunc,
+  genOutputTableWS(const API::IPeakFunction_sptr &peakfunc,
                    std::map<std::string, double> peakerrormap,
-                   API::IBackgroundFunction_sptr bkgdfunc,
+                   const API::IBackgroundFunction_sptr &bkgdfunc,
                    std::map<std::string, double> bkgderrormap);
 
   /// Add function's parameter names after peak function name
   std::vector<std::string>
-  addFunctionParameterNames(std::vector<std::string> funcnames);
+  addFunctionParameterNames(const std::vector<std::string> &funcnames);
 
   /// Parse peak type from full peak type/parameter names string
   std::string parseFunctionTypeFull(const std::string &fullstring,
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/FitPeaks.h b/Framework/Algorithms/inc/MantidAlgorithms/FitPeaks.h
index 44374d1f073..286faf480db 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/FitPeaks.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/FitPeaks.h
@@ -43,7 +43,7 @@ public:
   double getParameterValue(size_t ipeak, size_t iparam) const;
   double getParameterError(size_t ipeak, size_t iparam) const;
   void setRecord(size_t ipeak, const double cost, const double peak_position,
-                 const FitFunction fit_functions);
+                 const FitFunction &fit_functions);
   void setBadRecord(size_t ipeak, const double peak_position);
   void setFunctionParameters(size_t ipeak, std::vector<double> &param_values);
 
@@ -122,46 +122,45 @@ private:
   /// fit peaks in a same spectrum
   void fitSpectrumPeaks(
       size_t wi, const std::vector<double> &expected_peak_centers,
-      boost::shared_ptr<FitPeaksAlgorithm::PeakFitResult> fit_result);
+      const boost::shared_ptr<FitPeaksAlgorithm::PeakFitResult> &fit_result);
 
   /// fit background
   bool fitBackground(const size_t &ws_index,
                      const std::pair<double, double> &fit_window,
                      const double &expected_peak_pos,
-                     API::IBackgroundFunction_sptr bkgd_func);
+                     const API::IBackgroundFunction_sptr &bkgd_func);
 
   // Peak fitting suite
-  double fitIndividualPeak(size_t wi, API::IAlgorithm_sptr fitter,
+  double fitIndividualPeak(size_t wi, const API::IAlgorithm_sptr &fitter,
                            const double expected_peak_center,
                            const std::pair<double, double> &fitwindow,
                            const bool observe_peak_params,
-                           API::IPeakFunction_sptr peakfunction,
-                           API::IBackgroundFunction_sptr bkgdfunc);
+                           const API::IPeakFunction_sptr &peakfunction,
+                           const API::IBackgroundFunction_sptr &bkgdfunc);
 
   /// Methods to fit functions (general)
-  double fitFunctionSD(API::IAlgorithm_sptr fit,
-                       API::IPeakFunction_sptr peak_function,
-                       API::IBackgroundFunction_sptr bkgd_function,
-                       API::MatrixWorkspace_sptr dataws, size_t wsindex,
+  double fitFunctionSD(const API::IAlgorithm_sptr &fit,
+                       const API::IPeakFunction_sptr &peak_function,
+                       const API::IBackgroundFunction_sptr &bkgd_function,
+                       const API::MatrixWorkspace_sptr &dataws, size_t wsindex,
                        double xmin, double xmax,
                        const double &expected_peak_center,
                        bool observe_peak_shape, bool estimate_background);
 
   double fitFunctionMD(API::IFunction_sptr fit_function,
-                       API::MatrixWorkspace_sptr dataws, size_t wsindex,
+                       const API::MatrixWorkspace_sptr &dataws, size_t wsindex,
                        std::vector<double> &vec_xmin,
                        std::vector<double> &vec_xmax);
 
   /// fit a single peak with high background
-  double fitFunctionHighBackground(API::IAlgorithm_sptr fit,
-                                   const std::pair<double, double> &fit_window,
-                                   const size_t &ws_index,
-                                   const double &expected_peak_center,
-                                   bool observe_peak_shape,
-                                   API::IPeakFunction_sptr peakfunction,
-                                   API::IBackgroundFunction_sptr bkgdfunc);
-
-  void setupParameterTableWorkspace(API::ITableWorkspace_sptr table_ws,
+  double fitFunctionHighBackground(
+      const API::IAlgorithm_sptr &fit,
+      const std::pair<double, double> &fit_window, const size_t &ws_index,
+      const double &expected_peak_center, bool observe_peak_shape,
+      const API::IPeakFunction_sptr &peakfunction,
+      const API::IBackgroundFunction_sptr &bkgdfunc);
+
+  void setupParameterTableWorkspace(const API::ITableWorkspace_sptr &table_ws,
                                     const std::vector<std::string> &param_names,
                                     bool with_chi2);
 
@@ -171,7 +170,7 @@ private:
                     std::vector<double> &vec_e);
 
   /// Reduce background
-  void reduceByBackground(API::IBackgroundFunction_sptr bkgd_func,
+  void reduceByBackground(const API::IBackgroundFunction_sptr &bkgd_func,
                           const std::vector<double> &vec_x,
                           std::vector<double> &vec_y);
 
@@ -183,7 +182,7 @@ private:
   /// Esitmate background by 'observation'
   void estimateBackground(const HistogramData::Histogram &histogram,
                           const std::pair<double, double> &peak_window,
-                          API::IBackgroundFunction_sptr bkgd_function);
+                          const API::IBackgroundFunction_sptr &bkgd_function);
   /// estimate linear background
   void estimateLinearBackground(const HistogramData::Histogram &histogram,
                                 double left_window_boundary,
@@ -193,12 +192,12 @@ private:
   /// Estimate peak parameters by 'observation'
   int estimatePeakParameters(const HistogramData::Histogram &histogram,
                              const std::pair<double, double> &peak_window,
-                             API::IPeakFunction_sptr peakfunction,
-                             API::IBackgroundFunction_sptr bkgdfunction,
+                             const API::IPeakFunction_sptr &peakfunction,
+                             const API::IBackgroundFunction_sptr &bkgdfunction,
                              bool observe_peak_width);
 
   bool decideToEstimatePeakParams(const bool firstPeakInSpectrum,
-                                  API::IPeakFunction_sptr peak_function);
+                                  const API::IPeakFunction_sptr &peak_function);
 
   /// observe peak center
   int observePeakCenter(const HistogramData::Histogram &histogram,
@@ -215,8 +214,8 @@ private:
   void processSinglePeakFitResult(
       size_t wsindex, size_t peakindex, const double cost,
       const std::vector<double> &expected_peak_positions,
-      FitPeaksAlgorithm::FitFunction fitfunction,
-      boost::shared_ptr<FitPeaksAlgorithm::PeakFitResult> fit_result);
+      const FitPeaksAlgorithm::FitFunction &fitfunction,
+      const boost::shared_ptr<FitPeaksAlgorithm::PeakFitResult> &fit_result);
 
   /// calculate peak+background for fitted
   void calculateFittedPeaks(
@@ -224,8 +223,8 @@ private:
           fit_results);
 
   /// Get the parameter name for peak height (I or height or etc)
-  std::string
-  getPeakHeightParameterName(API::IPeakFunction_const_sptr peak_function);
+  std::string getPeakHeightParameterName(
+      const API::IPeakFunction_const_sptr &peak_function);
 
   /// Set the workspaces and etc to output properties
   void processOutputs(
@@ -235,7 +234,7 @@ private:
   /// Write result of peak fit per spectrum to output analysis workspaces
   void writeFitResult(
       size_t wi, const std::vector<double> &expected_positions,
-      boost::shared_ptr<FitPeaksAlgorithm::PeakFitResult> fit_result);
+      const boost::shared_ptr<FitPeaksAlgorithm::PeakFitResult> &fit_result);
 
   /// check whether FitPeaks supports observation on a certain peak profile's
   /// parameters (width!)
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GenerateEventsFilter.h b/Framework/Algorithms/inc/MantidAlgorithms/GenerateEventsFilter.h
index bb65b15ab66..5326180be08 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GenerateEventsFilter.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GenerateEventsFilter.h
@@ -76,7 +76,7 @@ private:
 
   void processInputTime();
   void setFilterByTimeOnly();
-  void setFilterByLogValue(std::string logname);
+  void setFilterByLogValue(const std::string &logname);
 
   void processSingleValueFilter(double minvalue, double maxvalue,
                                 bool filterincrease, bool filterdecrease);
@@ -93,7 +93,7 @@ private:
 
   /// Make multiple-log-value filters in serial
   void makeMultipleFiltersByValues(std::map<size_t, int> indexwsindexmap,
-                                   std::vector<double> logvalueranges,
+                                   const std::vector<double> &logvalueranges,
                                    bool centre, bool filterIncrease,
                                    bool filterDecrease,
                                    Types::Core::DateAndTime startTime,
@@ -101,17 +101,19 @@ private:
 
   /// Make multiple-log-value filters in serial in parallel
   void makeMultipleFiltersByValuesParallel(
-      std::map<size_t, int> indexwsindexmap, std::vector<double> logvalueranges,
-      bool centre, bool filterIncrease, bool filterDecrease,
+      const std::map<size_t, int> &indexwsindexmap,
+      const std::vector<double> &logvalueranges, bool centre,
+      bool filterIncrease, bool filterDecrease,
       Types::Core::DateAndTime startTime, Types::Core::DateAndTime stopTime);
 
   /// Generate event splitters for partial sample log (serial)
   void makeMultipleFiltersByValuesPartialLog(
       int istart, int iend, std::vector<Types::Core::DateAndTime> &vecSplitTime,
       std::vector<int> &vecSplitGroup, std::map<size_t, int> indexwsindexmap,
-      const std::vector<double> &logvalueranges, Types::Core::time_duration tol,
-      bool filterIncrease, bool filterDecrease,
-      Types::Core::DateAndTime startTime, Types::Core::DateAndTime stopTime);
+      const std::vector<double> &logvalueranges,
+      const Types::Core::time_duration &tol, bool filterIncrease,
+      bool filterDecrease, Types::Core::DateAndTime startTime,
+      Types::Core::DateAndTime stopTime);
 
   /// Generate event filters for integer sample log
   void processIntegerValueFilter(int minvalue, int maxvalue,
@@ -124,7 +126,7 @@ private:
   /// Add a splitter
   void addNewTimeFilterSplitter(Types::Core::DateAndTime starttime,
                                 Types::Core::DateAndTime stoptime, int wsindex,
-                                std::string info);
+                                const std::string &info);
 
   /// Create a splitter and add to the vector of time splitters
   Types::Core::DateAndTime
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GeneratePeaks.h b/Framework/Algorithms/inc/MantidAlgorithms/GeneratePeaks.h
index 68e1fad7954..b10f8c3c6de 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GeneratePeaks.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GeneratePeaks.h
@@ -69,10 +69,11 @@ private:
       const std::map<specnum_t,
                      std::vector<std::pair<double, API::IFunction_sptr>>>
           &functionmap,
-      API::MatrixWorkspace_sptr dataWS);
+      const API::MatrixWorkspace_sptr &dataWS);
 
   /// Check whether function has a certain parameter
-  bool hasParameter(API::IFunction_sptr function, std::string paramname);
+  bool hasParameter(const API::IFunction_sptr &function,
+                    const std::string &paramname);
 
   /// Create output workspace
   API::MatrixWorkspace_sptr createOutputWorkspace();
@@ -82,14 +83,15 @@ private:
 
   void createFunction(std::string &peaktype, std::string &bkgdtype);
 
-  void getSpectraSet(DataObjects::TableWorkspace_const_sptr peakParmsWS);
+  void getSpectraSet(const DataObjects::TableWorkspace_const_sptr &peakParmsWS);
 
   /// Get the IPeakFunction part in the input function
-  API::IPeakFunction_sptr getPeakFunction(API::IFunction_sptr infunction);
+  API::IPeakFunction_sptr
+  getPeakFunction(const API::IFunction_sptr &infunction);
 
   /// Add function parameter names to
   std::vector<std::string>
-  addFunctionParameterNames(std::vector<std::string> funcnames);
+  addFunctionParameterNames(const std::vector<std::string> &funcnames);
 
   /// Peak function
   API::IPeakFunction_sptr m_peakFunction;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GetDetOffsetsMultiPeaks.h b/Framework/Algorithms/inc/MantidAlgorithms/GetDetOffsetsMultiPeaks.h
index 455a940dc7b..acdd8557461 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GetDetOffsetsMultiPeaks.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GetDetOffsetsMultiPeaks.h
@@ -80,11 +80,11 @@ private:
   /// Main function to calculate all detectors' offsets
   void calculateDetectorsOffsets();
 
-  void
-  importFitWindowTableWorkspace(DataObjects::TableWorkspace_sptr windowtablews);
+  void importFitWindowTableWorkspace(
+      const DataObjects::TableWorkspace_sptr &windowtablews);
 
   /// Call Gaussian as a Child Algorithm to fit the peak in a spectrum
-  int fitSpectra(const int64_t wi, API::MatrixWorkspace_sptr inputW,
+  int fitSpectra(const int64_t wi, const API::MatrixWorkspace_sptr &inputW,
                  const std::vector<double> &peakPositions,
                  const std::vector<double> &fitWindows, size_t &nparams,
                  double &minD, double &maxD, std::vector<double> &peakPosToFit,
@@ -94,7 +94,7 @@ private:
 
   /// Add peak fitting and offset calculation information to information table
   /// workspaces per spectrum
-  void addInfoToReportWS(int wi, FitPeakOffsetResult offsetresult,
+  void addInfoToReportWS(int wi, const FitPeakOffsetResult &offsetresult,
                          const std::vector<double> &tofitpeakpositions,
                          const std::vector<double> &fittedpeakpositions);
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GetEi.h b/Framework/Algorithms/inc/MantidAlgorithms/GetEi.h
index d9733304bb1..424499f333c 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GetEi.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GetEi.h
@@ -68,15 +68,15 @@ private:
   void init() override;
   void exec() override;
 
-  void getGeometry(API::MatrixWorkspace_const_sptr WS, specnum_t mon0Spec,
-                   specnum_t mon1Spec, double &monitor0Dist,
+  void getGeometry(const API::MatrixWorkspace_const_sptr &WS,
+                   specnum_t mon0Spec, specnum_t mon1Spec, double &monitor0Dist,
                    double &monitor1Dist) const;
-  std::vector<size_t> getMonitorWsIndexs(API::MatrixWorkspace_const_sptr WS,
-                                         specnum_t specNum1,
-                                         specnum_t specNum2) const;
+  std::vector<size_t>
+  getMonitorWsIndexs(const API::MatrixWorkspace_const_sptr &WS,
+                     specnum_t specNum1, specnum_t specNum2) const;
   double timeToFly(double s, double E_KE) const;
-  double getPeakCentre(API::MatrixWorkspace_const_sptr WS, const size_t monitIn,
-                       const double peakTime);
+  double getPeakCentre(const API::MatrixWorkspace_const_sptr &WS,
+                       const size_t monitIn, const double peakTime);
   void extractSpec(int wsInd, double start, double end);
   void getPeakEstimates(double &height, int64_t &centreInd,
                         double &background) const;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GetEi2.h b/Framework/Algorithms/inc/MantidAlgorithms/GetEi2.h
index 56e478e4349..ac6fc8d9d71 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GetEi2.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GetEi2.h
@@ -84,16 +84,15 @@ private:
   API::MatrixWorkspace_sptr
   extractSpectrum(const size_t ws_index, const double start, const double end);
   /// Calculate peak width
-  double calculatePeakWidthAtHalfHeight(API::MatrixWorkspace_sptr data_ws,
-                                        const double prominence,
-                                        std::vector<double> &peak_x,
-                                        std::vector<double> &peak_y,
-                                        std::vector<double> &peak_e) const;
+  double calculatePeakWidthAtHalfHeight(
+      const API::MatrixWorkspace_sptr &data_ws, const double prominence,
+      std::vector<double> &peak_x, std::vector<double> &peak_y,
+      std::vector<double> &peak_e) const;
   /// Calculate the value of the first moment of the given spectrum
-  double calculateFirstMoment(API::MatrixWorkspace_sptr monitor_ws,
+  double calculateFirstMoment(const API::MatrixWorkspace_sptr &monitor_ws,
                               const double prominence);
   /// Rebin the given workspace using the given parameters
-  API::MatrixWorkspace_sptr rebin(API::MatrixWorkspace_sptr monitor_ws,
+  API::MatrixWorkspace_sptr rebin(const API::MatrixWorkspace_sptr &monitor_ws,
                                   const double first, const double width,
                                   const double end);
   /// Integrate the point data
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GetQsInQENSData.h b/Framework/Algorithms/inc/MantidAlgorithms/GetQsInQENSData.h
index d552b35ae5d..26243e70c43 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GetQsInQENSData.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GetQsInQENSData.h
@@ -53,7 +53,7 @@ private:
   void exec() override;
 
   /// Extracts Q-values from the specified matrix workspace
-  MantidVec extractQValues(const Mantid::API::MatrixWorkspace_sptr workspace);
+  MantidVec extractQValues(const Mantid::API::MatrixWorkspace_sptr &workspace);
 };
 } // namespace Algorithms
 } // namespace Mantid
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GetTimeSeriesLogInformation.h b/Framework/Algorithms/inc/MantidAlgorithms/GetTimeSeriesLogInformation.h
index 9ab9912083e..d271bef466d 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/GetTimeSeriesLogInformation.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/GetTimeSeriesLogInformation.h
@@ -89,7 +89,7 @@ private:
 
   void execQuickStatistics();
 
-  void exportErrorLog(API::MatrixWorkspace_sptr ws,
+  void exportErrorLog(const API::MatrixWorkspace_sptr &ws,
                       std::vector<Types::Core::DateAndTime> abstimevec,
                       double dts);
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/He3TubeEfficiency.h b/Framework/Algorithms/inc/MantidAlgorithms/He3TubeEfficiency.h
index d9dcc513940..77c6a08bdd5 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/He3TubeEfficiency.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/He3TubeEfficiency.h
@@ -94,8 +94,9 @@ private:
   /// Log any errors with spectra that occurred
   void logErrors() const;
   /// Retrieve the detector parameters from workspace or detector properties
-  double getParameter(std::string wsPropName, std::size_t currentIndex,
-                      std::string detPropName, const Geometry::IDetector &idet);
+  double getParameter(const std::string &wsPropName, std::size_t currentIndex,
+                      const std::string &detPropName,
+                      const Geometry::IDetector &idet);
   /// Helper for event handling
   template <class T> void eventHelper(std::vector<T> &events, double expval);
   /// Function to calculate exponential contribution
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/IQTransform.h b/Framework/Algorithms/inc/MantidAlgorithms/IQTransform.h
index e58b10754e7..6343d9f8392 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/IQTransform.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/IQTransform.h
@@ -67,10 +67,11 @@ private:
   void exec() override;
 
   inline API::MatrixWorkspace_sptr
-  subtractBackgroundWS(API::MatrixWorkspace_sptr ws,
-                       API::MatrixWorkspace_sptr background);
+  subtractBackgroundWS(const API::MatrixWorkspace_sptr &ws,
+                       const API::MatrixWorkspace_sptr &background);
 
-  using TransformFunc = void (IQTransform::*)(API::MatrixWorkspace_sptr);
+  using TransformFunc =
+      void (IQTransform::*)(const API::MatrixWorkspace_sptr &);
   using TransformMap = std::map<std::string, TransformFunc>;
   TransformMap
       m_transforms; ///< A map of transformation name and function pointers
@@ -78,16 +79,16 @@ private:
   boost::shared_ptr<Kernel::Units::Label> m_label;
 
   // A function for each transformation
-  void guinierSpheres(API::MatrixWorkspace_sptr ws);
-  void guinierRods(API::MatrixWorkspace_sptr ws);
-  void guinierSheets(API::MatrixWorkspace_sptr ws);
-  void zimm(API::MatrixWorkspace_sptr ws);
-  void debyeBueche(API::MatrixWorkspace_sptr ws);
-  void kratky(API::MatrixWorkspace_sptr ws);
-  void porod(API::MatrixWorkspace_sptr ws);
-  void holtzer(API::MatrixWorkspace_sptr ws);
-  void logLog(API::MatrixWorkspace_sptr ws);
-  void general(API::MatrixWorkspace_sptr ws);
+  void guinierSpheres(const API::MatrixWorkspace_sptr &ws);
+  void guinierRods(const API::MatrixWorkspace_sptr &ws);
+  void guinierSheets(const API::MatrixWorkspace_sptr &ws);
+  void zimm(const API::MatrixWorkspace_sptr &ws);
+  void debyeBueche(const API::MatrixWorkspace_sptr &ws);
+  void kratky(const API::MatrixWorkspace_sptr &ws);
+  void porod(const API::MatrixWorkspace_sptr &ws);
+  void holtzer(const API::MatrixWorkspace_sptr &ws);
+  void logLog(const API::MatrixWorkspace_sptr &ws);
+  void general(const API::MatrixWorkspace_sptr &ws);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/IdentifyNoisyDetectors.h b/Framework/Algorithms/inc/MantidAlgorithms/IdentifyNoisyDetectors.h
index 611e4f3f4de..39b39f5bec5 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/IdentifyNoisyDetectors.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/IdentifyNoisyDetectors.h
@@ -49,8 +49,8 @@ private:
   void exec() override; ///< Executes the algorithm.
 
   void getStdDev(API::Progress &progress,
-                 Mantid::API::MatrixWorkspace_sptr valid,
-                 Mantid::API::MatrixWorkspace_sptr values);
+                 const Mantid::API::MatrixWorkspace_sptr &valid,
+                 const Mantid::API::MatrixWorkspace_sptr &values);
 };
 } // namespace Algorithms
 } // namespace Mantid
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/IntegrateByComponent.h b/Framework/Algorithms/inc/MantidAlgorithms/IntegrateByComponent.h
index 637e829e118..526d705d2a8 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/IntegrateByComponent.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/IntegrateByComponent.h
@@ -34,11 +34,11 @@ private:
   void exec() override;
 
   /// method to check which spectra should be averaged
-  std::vector<std::vector<size_t>> makeMap(API::MatrixWorkspace_sptr countsWS,
-                                           int parents);
+  std::vector<std::vector<size_t>>
+  makeMap(const API::MatrixWorkspace_sptr &countsWS, int parents);
   /// method to create the map with all spectra
   std::vector<std::vector<size_t>>
-  makeInstrumentMap(API::MatrixWorkspace_sptr countsWS);
+  makeInstrumentMap(const API::MatrixWorkspace_sptr &countsWS);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/Integration.h b/Framework/Algorithms/inc/MantidAlgorithms/Integration.h
index b8265a5ed03..d35d07f4742 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/Integration.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/Integration.h
@@ -66,7 +66,7 @@ private:
   void exec() override;
 
   API::MatrixWorkspace_sptr
-  rangeFilterEventWorkspace(API::MatrixWorkspace_sptr workspace,
+  rangeFilterEventWorkspace(const API::MatrixWorkspace_sptr &workspace,
                             double minRange, double maxRange);
 
   /// Get the input workspace
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/InterpolatingRebin.h b/Framework/Algorithms/inc/MantidAlgorithms/InterpolatingRebin.h
index ea1e72ecefb..fb5c7d26736 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/InterpolatingRebin.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/InterpolatingRebin.h
@@ -78,9 +78,9 @@ protected:
   void init() override;
   void exec() override;
 
-  void outputYandEValues(API::MatrixWorkspace_const_sptr inputW,
+  void outputYandEValues(const API::MatrixWorkspace_const_sptr &inputW,
                          const HistogramData::BinEdges &XValues_new,
-                         API::MatrixWorkspace_sptr outputW);
+                         const API::MatrixWorkspace_sptr &outputW);
   HistogramData::Histogram
   cubicInterpolation(const HistogramData::Histogram &oldHistogram,
                      const HistogramData::BinEdges &xNew) const;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/MaskBinsFromTable.h b/Framework/Algorithms/inc/MantidAlgorithms/MaskBinsFromTable.h
index 33628ee864e..e5db169d12f 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/MaskBinsFromTable.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/MaskBinsFromTable.h
@@ -43,14 +43,15 @@ private:
   void exec() override;
 
   /// Process input Mask bin TableWorkspace.
-  void processMaskBinWorkspace(DataObjects::TableWorkspace_sptr masktblws,
-                               API::MatrixWorkspace_sptr dataws);
+  void
+  processMaskBinWorkspace(const DataObjects::TableWorkspace_sptr &masktblws,
+                          const API::MatrixWorkspace_sptr &dataws);
   /// Call MaskBins
-  void maskBins(API::MatrixWorkspace_sptr dataws);
+  void maskBins(const API::MatrixWorkspace_sptr &dataws);
   /// Convert a list of detector IDs list (string) to a list of
   /// spectra/workspace indexes list
-  std::string convertToSpectraList(API::MatrixWorkspace_sptr dataws,
-                                   std::string detidliststr);
+  std::string convertToSpectraList(const API::MatrixWorkspace_sptr &dataws,
+                                   const std::string &detidliststr);
 
   /// Column indexes of XMin, XMax, SpectraList, DetectorIDsList
   int id_xmin, id_xmax, id_spec, id_dets;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/MaxEnt.h b/Framework/Algorithms/inc/MantidAlgorithms/MaxEnt.h
index 3c3e7a6ce5e..970b3a383e9 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/MaxEnt.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/MaxEnt.h
@@ -67,7 +67,7 @@ private:
   /// Updates the image
   std::vector<double> updateImage(const std::vector<double> &image,
                                   const std::vector<double> &delta,
-                                  const std::vector<std::vector<double>> dirs);
+                                  const std::vector<std::vector<double>> &dirs);
 
   /// Populates the output workspace containing the reconstructed data
   void populateDataWS(API::MatrixWorkspace_const_sptr &inWS, size_t spec,
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/MaxEnt/MaxentTransformMultiFourier.h b/Framework/Algorithms/inc/MantidAlgorithms/MaxEnt/MaxentTransformMultiFourier.h
index 1c3d348bab8..69d1ac3e34c 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/MaxEnt/MaxentTransformMultiFourier.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/MaxEnt/MaxentTransformMultiFourier.h
@@ -36,7 +36,7 @@ public:
   // Deleted default constructor
   MaxentTransformMultiFourier() = delete;
   // Constructor
-  MaxentTransformMultiFourier(MaxentSpaceComplex_sptr dataSpace,
+  MaxentTransformMultiFourier(const MaxentSpaceComplex_sptr &dataSpace,
                               MaxentSpace_sptr imageSpace, size_t numSpec);
   // Transfoms form image space to data space
   std::vector<double> imageToData(const std::vector<double> &image) override;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/MedianDetectorTest.h b/Framework/Algorithms/inc/MantidAlgorithms/MedianDetectorTest.h
index a4bb40b58ab..e1ab2d7c02c 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/MedianDetectorTest.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/MedianDetectorTest.h
@@ -76,14 +76,14 @@ private:
   /// Calculates the sum of solid angles of detectors for each histogram
   API::MatrixWorkspace_sptr getSolidAngles(int firstSpec, int lastSpec);
   /// Mask the outlier values to get a better median value
-  int maskOutliers(const std::vector<double> medianvec,
-                   API::MatrixWorkspace_sptr countsWS,
+  int maskOutliers(const std::vector<double> &medianvec,
+                   const API::MatrixWorkspace_sptr &countsWS,
                    std::vector<std::vector<size_t>> indexmap);
   /// Do the tests and mask those that fail
-  int doDetectorTests(const API::MatrixWorkspace_sptr countsWS,
-                      const std::vector<double> medianvec,
+  int doDetectorTests(const API::MatrixWorkspace_sptr &countsWS,
+                      const std::vector<double> &medianvec,
                       std::vector<std::vector<size_t>> indexmap,
-                      API::MatrixWorkspace_sptr maskWS);
+                      const API::MatrixWorkspace_sptr &maskWS);
 
   API::MatrixWorkspace_sptr m_inputWS;
   /// The proportion of the median value below which a detector is considered
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/Minus.h b/Framework/Algorithms/inc/MantidAlgorithms/Minus.h
index f685724e2e7..8dd89656087 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/Minus.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/Minus.h
@@ -66,8 +66,8 @@ private:
   std::string checkSizeCompatibility(
       const API::MatrixWorkspace_const_sptr lhs,
       const API::MatrixWorkspace_const_sptr rhs) const override;
-  bool checkUnitCompatibility(const API::MatrixWorkspace_const_sptr lhs,
-                              const API::MatrixWorkspace_const_sptr rhs) const;
+  bool checkUnitCompatibility(const API::MatrixWorkspace_const_sptr &lhs,
+                              const API::MatrixWorkspace_const_sptr &rhs) const;
   bool
   checkCompatibility(const API::MatrixWorkspace_const_sptr lhs,
                      const API::MatrixWorkspace_const_sptr rhs) const override;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/NormaliseByCurrent.h b/Framework/Algorithms/inc/MantidAlgorithms/NormaliseByCurrent.h
index 017061aa369..3fbe4eb3e86 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/NormaliseByCurrent.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/NormaliseByCurrent.h
@@ -55,8 +55,9 @@ private:
   void init() override;
   void exec() override;
   // Extract the charge value from the logs.
-  double extractCharge(boost::shared_ptr<Mantid::API::MatrixWorkspace> inputWS,
-                       const bool integratePCharge) const;
+  double
+  extractCharge(const boost::shared_ptr<Mantid::API::MatrixWorkspace> &inputWS,
+                const bool integratePCharge) const;
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/NormaliseByDetector.h b/Framework/Algorithms/inc/MantidAlgorithms/NormaliseByDetector.h
index d7459788ebe..6a9a6febdb0 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/NormaliseByDetector.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/NormaliseByDetector.h
@@ -48,16 +48,16 @@ private:
   /// Try to parse a function parameter and extract the correctly typed
   /// parameter.
   const Mantid::Geometry::FitParameter
-  tryParseFunctionParameter(Mantid::Geometry::Parameter_sptr parameter,
+  tryParseFunctionParameter(const Mantid::Geometry::Parameter_sptr &parameter,
                             const Geometry::IDetector &det);
   /// Block to process histograms.
-  boost::shared_ptr<Mantid::API::MatrixWorkspace>
-  processHistograms(boost::shared_ptr<Mantid::API::MatrixWorkspace> inWS);
+  boost::shared_ptr<Mantid::API::MatrixWorkspace> processHistograms(
+      const boost::shared_ptr<Mantid::API::MatrixWorkspace> &inWS);
   /// Process indivdual histogram.
   void processHistogram(
       size_t wsIndex,
-      boost::shared_ptr<const Mantid::API::MatrixWorkspace> inWS,
-      boost::shared_ptr<Mantid::API::MatrixWorkspace> denominatorWS,
+      const boost::shared_ptr<const Mantid::API::MatrixWorkspace> &inWS,
+      const boost::shared_ptr<Mantid::API::MatrixWorkspace> &denominatorWS,
       Mantid::API::Progress &prog);
 
   void init() override;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/NormaliseToMonitor.h b/Framework/Algorithms/inc/MantidAlgorithms/NormaliseToMonitor.h
index ca162015c75..c36d200e4f4 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/NormaliseToMonitor.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/NormaliseToMonitor.h
@@ -166,7 +166,7 @@ private:
   mutable bool is_enabled;
   // auxiliary function to obtain list of monitor's ID-s (allowed_values) from a
   // workspace;
-  bool monitorIdReader(API::MatrixWorkspace_const_sptr inputWS) const;
+  bool monitorIdReader(const API::MatrixWorkspace_const_sptr &inputWS) const;
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/PDCalibration.h b/Framework/Algorithms/inc/MantidAlgorithms/PDCalibration.h
index 5cfd7e9ef81..aa46946a518 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/PDCalibration.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/PDCalibration.h
@@ -40,7 +40,7 @@ private:
   void exec() override;
   API::MatrixWorkspace_sptr loadAndBin();
   API::MatrixWorkspace_sptr rebin(API::MatrixWorkspace_sptr wksp);
-  API::MatrixWorkspace_sptr load(const std::string filename);
+  API::MatrixWorkspace_sptr load(const std::string &filename);
   void createCalTableFromExisting();
   void createCalTableNew();
   void createInformationWorkspaces();
@@ -59,8 +59,9 @@ private:
 
   /// NEW: convert peak positions in dSpacing to peak centers workspace
   std::pair<API::MatrixWorkspace_sptr, API::MatrixWorkspace_sptr>
-  createTOFPeakCenterFitWindowWorkspaces(API::MatrixWorkspace_sptr dataws,
-                                         const double peakWindowMaxInDSpacing);
+  createTOFPeakCenterFitWindowWorkspaces(
+      const API::MatrixWorkspace_sptr &dataws,
+      const double peakWindowMaxInDSpacing);
 
   API::ITableWorkspace_sptr
   sortTableWorkspace(API::ITableWorkspace_sptr &table);
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/PaddingAndApodization.h b/Framework/Algorithms/inc/MantidAlgorithms/PaddingAndApodization.h
index a047a942567..748cb886689 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/PaddingAndApodization.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/PaddingAndApodization.h
@@ -53,7 +53,7 @@ private:
   void init() override;
   void exec() override;
   using fptr = double (*)(const double, const double);
-  fptr getApodizationFunction(const std::string method);
+  fptr getApodizationFunction(const std::string &method);
   HistogramData::Histogram
   applyApodizationFunction(const HistogramData::Histogram &histogram,
                            const double decayConstant, fptr function);
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ParallaxCorrection.h b/Framework/Algorithms/inc/MantidAlgorithms/ParallaxCorrection.h
index 6eab498ba75..d3d2bf817b9 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ParallaxCorrection.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ParallaxCorrection.h
@@ -25,8 +25,9 @@ public:
 private:
   void init() override;
   void exec() override;
-  void performCorrection(API::MatrixWorkspace_sptr, const std::vector<size_t> &,
-                         const std::string &, const std::string &);
+  void performCorrection(const API::MatrixWorkspace_sptr &,
+                         const std::vector<size_t> &, const std::string &,
+                         const std::string &);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/Plus.h b/Framework/Algorithms/inc/MantidAlgorithms/Plus.h
index 3f850d029a9..c6c7a6d1b4f 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/Plus.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/Plus.h
@@ -75,8 +75,8 @@ private:
                     API::Run &ans) const override;
 
   // Overridden event-specific operation
-  bool checkUnitCompatibility(const API::MatrixWorkspace_const_sptr lhs,
-                              const API::MatrixWorkspace_const_sptr rhs) const;
+  bool checkUnitCompatibility(const API::MatrixWorkspace_const_sptr &lhs,
+                              const API::MatrixWorkspace_const_sptr &rhs) const;
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/PolarizationCorrectionFredrikze.h b/Framework/Algorithms/inc/MantidAlgorithms/PolarizationCorrectionFredrikze.h
index 92674758de7..e6586dbb805 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/PolarizationCorrectionFredrikze.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/PolarizationCorrectionFredrikze.h
@@ -41,9 +41,9 @@ private:
   boost::shared_ptr<Mantid::API::MatrixWorkspace>
   getEfficiencyWorkspace(const std::string &label);
   boost::shared_ptr<Mantid::API::WorkspaceGroup>
-  execPA(boost::shared_ptr<Mantid::API::WorkspaceGroup> inWS);
+  execPA(const boost::shared_ptr<Mantid::API::WorkspaceGroup> &inWS);
   boost::shared_ptr<Mantid::API::WorkspaceGroup>
-  execPNR(boost::shared_ptr<Mantid::API::WorkspaceGroup> inWS);
+  execPNR(const boost::shared_ptr<Mantid::API::WorkspaceGroup> &inWS);
   boost::shared_ptr<Mantid::API::MatrixWorkspace>
   add(boost::shared_ptr<Mantid::API::MatrixWorkspace> &lhsWS,
       const double &rhs);
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/PolarizationEfficiencyCor.h b/Framework/Algorithms/inc/MantidAlgorithms/PolarizationEfficiencyCor.h
index aa9679f5446..46d3da8102a 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/PolarizationEfficiencyCor.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/PolarizationEfficiencyCor.h
@@ -45,8 +45,9 @@ private:
                          API::MatrixWorkspace const &inWS) const;
   API::MatrixWorkspace_sptr
   convertToHistogram(API::MatrixWorkspace_sptr efficiencies);
-  API::MatrixWorkspace_sptr interpolate(API::MatrixWorkspace_sptr efficiencies,
-                                        API::MatrixWorkspace_sptr inWS);
+  API::MatrixWorkspace_sptr
+  interpolate(const API::MatrixWorkspace_sptr &efficiencies,
+              const API::MatrixWorkspace_sptr &inWS);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/Q1D2.h b/Framework/Algorithms/inc/MantidAlgorithms/Q1D2.h
index 386d8278273..a930255c0c5 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/Q1D2.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/Q1D2.h
@@ -63,13 +63,13 @@ private:
   // these are the steps that are run on each individual spectrum
   void
   calculateNormalization(const size_t wavStart, const size_t wsIndex,
-                         API::MatrixWorkspace_const_sptr pixelAdj,
-                         API::MatrixWorkspace_const_sptr wavePixelAdj,
+                         const API::MatrixWorkspace_const_sptr &pixelAdj,
+                         const API::MatrixWorkspace_const_sptr &wavePixelAdj,
                          double const *const binNorms,
                          double const *const binNormEs,
                          HistogramData::HistogramY::iterator norm,
                          HistogramData::HistogramY::iterator normETo2) const;
-  void pixelWeight(API::MatrixWorkspace_const_sptr pixelAdj,
+  void pixelWeight(const API::MatrixWorkspace_const_sptr &pixelAdj,
                    const size_t wsIndex, double &weight, double &error) const;
   void addWaveAdj(const double *c, const double *Dc,
                   HistogramData::HistogramY::iterator bInOut,
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/Q1DWeighted.h b/Framework/Algorithms/inc/MantidAlgorithms/Q1DWeighted.h
index 7404e96a708..a542b5ee4fc 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/Q1DWeighted.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/Q1DWeighted.h
@@ -70,12 +70,12 @@ public:
 private:
   /// Create an output workspace
   API::MatrixWorkspace_sptr
-  createOutputWorkspace(API::MatrixWorkspace_const_sptr, const size_t,
+  createOutputWorkspace(const API::MatrixWorkspace_const_sptr &, const size_t,
                         const std::vector<double> &);
 
-  void bootstrap(API::MatrixWorkspace_const_sptr);
-  void calculate(API::MatrixWorkspace_const_sptr);
-  void finalize(API::MatrixWorkspace_const_sptr);
+  void bootstrap(const API::MatrixWorkspace_const_sptr &);
+  void calculate(const API::MatrixWorkspace_const_sptr &);
+  void finalize(const API::MatrixWorkspace_const_sptr &);
 
   std::vector<std::vector<std::vector<double>>> m_intensities;
   std::vector<std::vector<std::vector<double>>> m_errors;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/Qhelper.h b/Framework/Algorithms/inc/MantidAlgorithms/Qhelper.h
index 53ade307e5c..30d9028be9c 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/Qhelper.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/Qhelper.h
@@ -19,22 +19,23 @@ namespace Algorithms {
 */
 class Qhelper {
 public:
-  void examineInput(API::MatrixWorkspace_const_sptr dataWS,
-                    API::MatrixWorkspace_const_sptr binAdj,
-                    API::MatrixWorkspace_const_sptr detectAdj,
-                    API::MatrixWorkspace_const_sptr qResolution);
+  void examineInput(const API::MatrixWorkspace_const_sptr &dataWS,
+                    const API::MatrixWorkspace_const_sptr &binAdj,
+                    const API::MatrixWorkspace_const_sptr &detectAdj,
+                    const API::MatrixWorkspace_const_sptr &qResolution);
 
-  void examineInput(API::MatrixWorkspace_const_sptr dataWS,
-                    API::MatrixWorkspace_const_sptr binAdj,
-                    API::MatrixWorkspace_const_sptr detectAdj);
+  void examineInput(const API::MatrixWorkspace_const_sptr &dataWS,
+                    const API::MatrixWorkspace_const_sptr &binAdj,
+                    const API::MatrixWorkspace_const_sptr &detectAdj);
 
-  size_t waveLengthCutOff(API::MatrixWorkspace_const_sptr dataWS,
+  size_t waveLengthCutOff(const API::MatrixWorkspace_const_sptr &dataWS,
                           const API::SpectrumInfo &spectrumInfo,
                           const double RCut, const double WCut,
                           const size_t wsInd) const;
 
-  void outputParts(API::Algorithm *alg, API::MatrixWorkspace_sptr sumOfCounts,
-                   API::MatrixWorkspace_sptr sumOfNormFactors);
+  void outputParts(API::Algorithm *alg,
+                   const API::MatrixWorkspace_sptr &sumOfCounts,
+                   const API::MatrixWorkspace_sptr &sumOfNormFactors);
 
 private:
   /// the experimental workspace with counts across the detector
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/Qxy.h b/Framework/Algorithms/inc/MantidAlgorithms/Qxy.h
index f290e9fe824..49b1cef9c86 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/Qxy.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/Qxy.h
@@ -55,7 +55,7 @@ private:
 
   std::vector<double> logBinning(double min, double max, int num);
   API::MatrixWorkspace_sptr
-  setUpOutputWorkspace(API::MatrixWorkspace_const_sptr inputWorkspace);
+  setUpOutputWorkspace(const API::MatrixWorkspace_const_sptr &inputWorkspace);
   double getQminFromWs(const API::MatrixWorkspace &inputWorkspace);
 };
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/RadiusSum.h b/Framework/Algorithms/inc/MantidAlgorithms/RadiusSum.h
index 0e216e60669..1a10f80ca0e 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/RadiusSum.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/RadiusSum.h
@@ -35,13 +35,14 @@ public:
   }
   const std::string category() const override;
 
-  static bool inputWorkspaceHasInstrumentAssociated(API::MatrixWorkspace_sptr);
+  static bool
+  inputWorkspaceHasInstrumentAssociated(const API::MatrixWorkspace_sptr &);
 
   static std::vector<double>
-      getBoundariesOfNumericImage(API::MatrixWorkspace_sptr);
+  getBoundariesOfNumericImage(const API::MatrixWorkspace_sptr &);
 
   static std::vector<double>
-      getBoundariesOfInstrument(API::MatrixWorkspace_sptr);
+  getBoundariesOfInstrument(const API::MatrixWorkspace_sptr &);
 
   static void centerIsInsideLimits(const std::vector<double> &centre,
                                    const std::vector<double> &boundaries);
@@ -71,8 +72,8 @@ private:
   API::MatrixWorkspace_sptr inputWS;
   double min_radius = 0.0, max_radius = 0.0;
 
-  double getMinBinSizeForInstrument(API::MatrixWorkspace_sptr);
-  double getMinBinSizeForNumericImage(API::MatrixWorkspace_sptr);
+  double getMinBinSizeForInstrument(const API::MatrixWorkspace_sptr &);
+  double getMinBinSizeForNumericImage(const API::MatrixWorkspace_sptr &);
 
   /** Return the bin position for a given distance
    *  From the input, it is defined the limits of distances as:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/Rebin.h b/Framework/Algorithms/inc/MantidAlgorithms/Rebin.h
index 3c2e64c67dc..d46fda033bb 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/Rebin.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/Rebin.h
@@ -76,8 +76,8 @@ protected:
   void init() override;
   void exec() override;
 
-  void propagateMasks(API::MatrixWorkspace_const_sptr inputWS,
-                      API::MatrixWorkspace_sptr outputWS, int hist);
+  void propagateMasks(const API::MatrixWorkspace_const_sptr &inputWS,
+                      const API::MatrixWorkspace_sptr &outputWS, int hist);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryBackgroundSubtraction.h b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryBackgroundSubtraction.h
index 78d3cef2827..c24eb84ccb9 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryBackgroundSubtraction.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryBackgroundSubtraction.h
@@ -27,13 +27,13 @@ public:
 
 private:
   void
-  calculateAverageSpectrumBackground(API::MatrixWorkspace_sptr inputWS,
+  calculateAverageSpectrumBackground(const API::MatrixWorkspace_sptr &inputWS,
                                      const std::vector<specnum_t> &spectraList);
   void calculatePolynomialBackground(API::MatrixWorkspace_sptr inputWS,
                                      const std::vector<double> &spectrumRanges);
   std::vector<double>
   findSpectrumRanges(const std::vector<specnum_t> &spectraList);
-  void calculatePixelBackground(API::MatrixWorkspace_sptr inputWS,
+  void calculatePixelBackground(const API::MatrixWorkspace_sptr &inputWS,
                                 const std::vector<double> &indexRanges);
 
   /** Overridden Algorithm methods **/
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryBeamStatistics.h b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryBeamStatistics.h
index 459e89e6862..9f995f2f39e 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryBeamStatistics.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryBeamStatistics.h
@@ -26,9 +26,9 @@ public:
     const static std::string SAMPLE_WAVINESS;
     const static std::string SECOND_SLIT_ANGULAR_SPREAD;
   };
-  static double slitSeparation(Geometry::Instrument_const_sptr instrument,
-                               const std::string &slit1Name,
-                               const std::string &slit2Name);
+  static double
+  slitSeparation(const Geometry::Instrument_const_sptr &instrument,
+                 const std::string &slit1Name, const std::string &slit2Name);
   const std::string name() const override;
   int version() const override;
   const std::string category() const override;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne2.h b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne2.h
index 17cc0d6f69a..4c720c38d54 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne2.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne2.h
@@ -66,30 +66,30 @@ private:
   directBeamCorrection(Mantid::API::MatrixWorkspace_sptr detectorWS);
   // Performs transmission or algorithm correction
   Mantid::API::MatrixWorkspace_sptr
-  transOrAlgCorrection(Mantid::API::MatrixWorkspace_sptr detectorWS,
+  transOrAlgCorrection(const Mantid::API::MatrixWorkspace_sptr &detectorWS,
                        const bool detectorWSReduced);
   // Performs background subtraction
   Mantid::API::MatrixWorkspace_sptr
   backgroundSubtraction(Mantid::API::MatrixWorkspace_sptr detectorWS);
   // Performs transmission corrections
   Mantid::API::MatrixWorkspace_sptr
-  transmissionCorrection(Mantid::API::MatrixWorkspace_sptr detectorWS,
+  transmissionCorrection(const Mantid::API::MatrixWorkspace_sptr &detectorWS,
                          const bool detectorWSReduced);
   // Performs transmission corrections using alternative correction algorithms
   Mantid::API::MatrixWorkspace_sptr
-  algorithmicCorrection(Mantid::API::MatrixWorkspace_sptr detectorWS);
+  algorithmicCorrection(const Mantid::API::MatrixWorkspace_sptr &detectorWS);
   // Performs monitor corrections
   Mantid::API::MatrixWorkspace_sptr
   monitorCorrection(Mantid::API::MatrixWorkspace_sptr detectorWS);
   // convert to momentum transfer
   Mantid::API::MatrixWorkspace_sptr
-  convertToQ(Mantid::API::MatrixWorkspace_sptr inputWS);
+  convertToQ(const Mantid::API::MatrixWorkspace_sptr &inputWS);
   // Get the twoTheta width of a given detector
   double getDetectorTwoThetaRange(const size_t spectrumIdx);
   // Utility function to create name for diagnostic workspaces
   std::string createDebugWorkspaceName(const std::string &inputName);
   // Utility function to output a diagnostic workspace to the ADS
-  void outputDebugWorkspace(API::MatrixWorkspace_sptr ws,
+  void outputDebugWorkspace(const API::MatrixWorkspace_sptr &ws,
                             const std::string &wsName,
                             const std::string &wsSuffix, const bool debug,
                             int &step);
@@ -97,7 +97,7 @@ private:
   Mantid::API::MatrixWorkspace_sptr makeIvsLam();
   // Do the reduction by summation in Q
   Mantid::API::MatrixWorkspace_sptr
-  sumInQ(API::MatrixWorkspace_sptr detectorWS);
+  sumInQ(const API::MatrixWorkspace_sptr &detectorWS);
   // Do the summation in Q for a single input value
   void sumInQProcessValue(const int inputIdx, const double twoTheta,
                           const double bTwoTheta,
@@ -106,23 +106,23 @@ private:
                           const HistogramData::HistogramE &inputE,
                           const std::vector<size_t> &detectors,
                           const size_t outSpecIdx,
-                          API::MatrixWorkspace_sptr IvsLam,
+                          const API::MatrixWorkspace_sptr &IvsLam,
                           std::vector<double> &outputE);
   // Share counts to a projected value for summation in Q
   void sumInQShareCounts(const double inputCounts, const double inputErr,
                          const double bLambda, const double lambdaMin,
                          const double lambdaMax, const size_t outSpecIdx,
-                         API::MatrixWorkspace_sptr IvsLam,
+                         const API::MatrixWorkspace_sptr &IvsLam,
                          std::vector<double> &outputE);
-  void findWavelengthMinMax(API::MatrixWorkspace_sptr inputWS);
+  void findWavelengthMinMax(const API::MatrixWorkspace_sptr &inputWS);
   // Construct the output workspace
-  void findIvsLamRange(API::MatrixWorkspace_sptr detectorWS,
+  void findIvsLamRange(const API::MatrixWorkspace_sptr &detectorWS,
                        const std::vector<size_t> &detectors,
                        const double lambdaMin, const double lambdaMax,
                        double &projectedMin, double &projectedMax);
   // Construct the output workspace
   Mantid::API::MatrixWorkspace_sptr
-  constructIvsLamWS(API::MatrixWorkspace_sptr detectorWS);
+  constructIvsLamWS(const API::MatrixWorkspace_sptr &detectorWS);
   // Whether summation should be done in Q or the default lambda
   bool summingInQ();
   // Get projected coordinates onto twoThetaR
@@ -132,8 +132,8 @@ private:
                                double &lambdaTop, double &lambdaBot,
                                const bool outerCorners = true);
   // Check whether two spectrum maps match
-  void verifySpectrumMaps(API::MatrixWorkspace_const_sptr ws1,
-                          API::MatrixWorkspace_const_sptr ws2);
+  void verifySpectrumMaps(const API::MatrixWorkspace_const_sptr &ws1,
+                          const API::MatrixWorkspace_const_sptr &ws2);
 
   // Find and cache constants
   void findDetectorGroups();
@@ -149,10 +149,10 @@ private:
   double wavelengthMax() { return m_wavelengthMax; };
   size_t findIvsLamRangeMinDetector(const std::vector<size_t> &detectors);
   size_t findIvsLamRangeMaxDetector(const std::vector<size_t> &detectors);
-  double findIvsLamRangeMin(Mantid::API::MatrixWorkspace_sptr detectorWS,
+  double findIvsLamRangeMin(const Mantid::API::MatrixWorkspace_sptr &detectorWS,
                             const std::vector<size_t> &detectors,
                             const double lambda);
-  double findIvsLamRangeMax(Mantid::API::MatrixWorkspace_sptr detectorWS,
+  double findIvsLamRangeMax(const Mantid::API::MatrixWorkspace_sptr &detectorWS,
                             const std::vector<size_t> &detectors,
                             const double lambda);
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOneAuto2.h b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOneAuto2.h
index 57a153afa8a..e769ba96ff5 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOneAuto2.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOneAuto2.h
@@ -47,7 +47,7 @@ private:
   class RebinParams {
   public:
     RebinParams(const double qMin, const bool qMinIsDefault, const double qMax,
-                const bool qMaxIsDefault, const boost::optional<double> qStep)
+                const bool qMaxIsDefault, const boost::optional<double> &qStep)
         : m_qMin(qMin), m_qMinIsDefault(qMinIsDefault), m_qMax(qMax),
           m_qMaxIsDefault(qMaxIsDefault), m_qStep(qStep){};
 
@@ -72,33 +72,34 @@ private:
   void init() override;
   void exec() override;
   std::string
-  getRunNumberForWorkspaceGroup(WorkspaceGroup_const_sptr workspace);
+  getRunNumberForWorkspaceGroup(const WorkspaceGroup_const_sptr &workspace);
   WorkspaceNames getOutputWorkspaceNames();
   void setDefaultOutputWorkspaceNames();
   /// Get the name of the detectors of interest based on processing instructions
   std::vector<std::string>
-  getDetectorNames(Mantid::API::MatrixWorkspace_sptr inputWS);
+  getDetectorNames(const Mantid::API::MatrixWorkspace_sptr &inputWS);
   /// Correct detector positions vertically
   Mantid::API::MatrixWorkspace_sptr
   correctDetectorPositions(Mantid::API::MatrixWorkspace_sptr inputWS,
                            const double twoTheta);
   /// Calculate theta
-  double calculateTheta(Mantid::API::MatrixWorkspace_sptr inputWS);
+  double calculateTheta(const Mantid::API::MatrixWorkspace_sptr &inputWS);
   /// Find cropping and binning parameters
-  RebinParams getRebinParams(MatrixWorkspace_sptr inputWS, const double theta);
-  boost::optional<double> getQStep(MatrixWorkspace_sptr inputWS,
+  RebinParams getRebinParams(const MatrixWorkspace_sptr &inputWS,
+                             const double theta);
+  boost::optional<double> getQStep(const MatrixWorkspace_sptr &inputWS,
                                    const double theta);
   /// Rebin and scale a workspace in Q
   Mantid::API::MatrixWorkspace_sptr
-  rebinAndScale(Mantid::API::MatrixWorkspace_sptr inputWS,
+  rebinAndScale(const Mantid::API::MatrixWorkspace_sptr &inputWS,
                 RebinParams const &params);
   /// Crop a workspace in Q
-  MatrixWorkspace_sptr cropQ(MatrixWorkspace_sptr inputWS,
+  MatrixWorkspace_sptr cropQ(const MatrixWorkspace_sptr &inputWS,
                              RebinParams const &params);
   /// Populate algorithmic correction properties
   void populateAlgorithmicCorrectionProperties(
-      Mantid::API::IAlgorithm_sptr alg,
-      Mantid::Geometry::Instrument_const_sptr instrument);
+      const Mantid::API::IAlgorithm_sptr &alg,
+      const Mantid::Geometry::Instrument_const_sptr &instrument);
   /// Get a polarization efficiencies workspace.
   std::tuple<API::MatrixWorkspace_sptr, std::string, std::string>
   getPolarizationEfficiencies();
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOneAuto3.h b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOneAuto3.h
index 61b931ff375..7c019330912 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOneAuto3.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOneAuto3.h
@@ -58,35 +58,37 @@ private:
   void init() override;
   void exec() override;
   std::string
-  getRunNumberForWorkspaceGroup(WorkspaceGroup_const_sptr workspace);
+  getRunNumberForWorkspaceGroup(const WorkspaceGroup_const_sptr &workspace);
   WorkspaceNames getOutputWorkspaceNames();
   void setDefaultOutputWorkspaceNames();
   /// Get the name of the detectors of interest based on processing instructions
   std::vector<std::string>
-  getDetectorNames(Mantid::API::MatrixWorkspace_sptr inputWS);
+  getDetectorNames(const Mantid::API::MatrixWorkspace_sptr &inputWS);
   /// Correct detector positions vertically
   Mantid::API::MatrixWorkspace_sptr
   correctDetectorPositions(Mantid::API::MatrixWorkspace_sptr inputWS,
                            const double twoTheta);
   /// Calculate theta
-  double calculateTheta(Mantid::API::MatrixWorkspace_sptr inputWS);
+  double calculateTheta(const Mantid::API::MatrixWorkspace_sptr &inputWS);
   /// Find cropping and binning parameters
-  RebinParams getRebinParams(MatrixWorkspace_sptr inputWS, const double theta);
-  boost::optional<double> getQStep(MatrixWorkspace_sptr inputWS,
+  RebinParams getRebinParams(const MatrixWorkspace_sptr &inputWS,
+                             const double theta);
+  boost::optional<double> getQStep(const MatrixWorkspace_sptr &inputWS,
                                    const double theta);
   // Optionally scale a workspace
   Mantid::API::MatrixWorkspace_sptr
   scale(Mantid::API::MatrixWorkspace_sptr inputWS);
   /// Rebin a workspace in Q
   Mantid::API::MatrixWorkspace_sptr
-  rebin(Mantid::API::MatrixWorkspace_sptr inputWS, const RebinParams &params);
+  rebin(const Mantid::API::MatrixWorkspace_sptr &inputWS,
+        const RebinParams &params);
   /// Optionally crop a workspace in Q
   MatrixWorkspace_sptr cropQ(MatrixWorkspace_sptr inputWS,
                              const RebinParams &params);
   /// Populate algorithmic correction properties
   void populateAlgorithmicCorrectionProperties(
-      Mantid::API::IAlgorithm_sptr alg,
-      Mantid::Geometry::Instrument_const_sptr instrument);
+      const Mantid::API::IAlgorithm_sptr &alg,
+      const Mantid::Geometry::Instrument_const_sptr &instrument);
   /// Get a polarization efficiencies workspace.
   std::tuple<API::MatrixWorkspace_sptr, std::string, std::string>
   getPolarizationEfficiencies();
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryWorkflowBase.h b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryWorkflowBase.h
index 81d13a755d1..f79bd7b6713 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryWorkflowBase.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryWorkflowBase.h
@@ -44,9 +44,9 @@ public:
   /// Convert the input workspace to wavelength, splitting according to the
   /// properties provided.
   DetectorMonitorWorkspacePair
-  toLam(Mantid::API::MatrixWorkspace_sptr toConvert,
+  toLam(const Mantid::API::MatrixWorkspace_sptr &toConvert,
         const std::string &processingCommands,
-        const OptionalInteger monitorIndex, const MinMax &wavelengthMinMax,
+        const OptionalInteger &monitorIndex, const MinMax &wavelengthMinMax,
         const OptionalMinMax &backgroundMinMax);
 
   /// Convert the detector spectrum of the input workspace to wavelength
@@ -70,12 +70,11 @@ protected:
   /// Get the min/max property values
   MinMax getMinMax(const std::string &minProperty,
                    const std::string &maxProperty) const;
-  OptionalMinMax getOptionalMinMax(Mantid::API::Algorithm *const alg,
-                                   const std::string &minProperty,
-                                   const std::string &maxProperty,
-                                   Mantid::Geometry::Instrument_const_sptr inst,
-                                   std::string minIdfName,
-                                   std::string maxIdfName) const;
+  OptionalMinMax getOptionalMinMax(
+      Mantid::API::Algorithm *const alg, const std::string &minProperty,
+      const std::string &maxProperty,
+      const Mantid::Geometry::Instrument_const_sptr &inst,
+      const std::string &minIdfName, const std::string &maxIdfName) const;
   /// Get the transmission correction properties
   void getTransmissionRunInfo(
       OptionalMatrixWorkspace_sptr &firstTransmissionRun,
@@ -102,7 +101,7 @@ private:
   /// Convert the monitor parts of the input workspace to wavelength
   API::MatrixWorkspace_sptr
   toLamMonitor(const API::MatrixWorkspace_sptr &toConvert,
-               const OptionalInteger monitorIndex,
+               const OptionalInteger &monitorIndex,
                const OptionalMinMax &backgroundMinMax);
 
   /// Make a unity workspace
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryWorkflowBase2.h b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryWorkflowBase2.h
index 9962e1cb063..6b28e816c9d 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryWorkflowBase2.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryWorkflowBase2.h
@@ -54,10 +54,10 @@ protected:
   std::map<std::string, std::string> validateWavelengthRanges() const;
   /// Convert a workspace from TOF to wavelength
   Mantid::API::MatrixWorkspace_sptr
-  convertToWavelength(Mantid::API::MatrixWorkspace_sptr inputWS);
+  convertToWavelength(const Mantid::API::MatrixWorkspace_sptr &inputWS);
   /// Crop a workspace in wavelength
   Mantid::API::MatrixWorkspace_sptr
-  cropWavelength(Mantid::API::MatrixWorkspace_sptr inputWS,
+  cropWavelength(const Mantid::API::MatrixWorkspace_sptr &inputWS,
                  const bool useArgs = false, const double argMin = 0.0,
                  const double argMax = 0.0);
   // Create a detector workspace from input workspace in wavelength
@@ -66,43 +66,44 @@ protected:
                  const bool convert = true, const bool sum = true);
   // Create a monitor workspace from input workspace in wavelength
   Mantid::API::MatrixWorkspace_sptr
-  makeMonitorWS(Mantid::API::MatrixWorkspace_sptr inputWS,
+  makeMonitorWS(const Mantid::API::MatrixWorkspace_sptr &inputWS,
                 bool integratedMonitors);
   // Rebin detectors to monitors
   Mantid::API::MatrixWorkspace_sptr
-  rebinDetectorsToMonitors(Mantid::API::MatrixWorkspace_sptr detectorWS,
-                           Mantid::API::MatrixWorkspace_sptr monitorWS);
+  rebinDetectorsToMonitors(const Mantid::API::MatrixWorkspace_sptr &detectorWS,
+                           const Mantid::API::MatrixWorkspace_sptr &monitorWS);
   // Read monitor properties from instrument
-  void
-  populateMonitorProperties(Mantid::API::IAlgorithm_sptr alg,
-                            Mantid::Geometry::Instrument_const_sptr instrument);
+  void populateMonitorProperties(
+      const Mantid::API::IAlgorithm_sptr &alg,
+      const Mantid::Geometry::Instrument_const_sptr &instrument);
   /// Populate processing instructions
-  std::string
-  findProcessingInstructions(Mantid::Geometry::Instrument_const_sptr instrument,
-                             Mantid::API::MatrixWorkspace_sptr inputWS) const;
+  std::string findProcessingInstructions(
+      const Mantid::Geometry::Instrument_const_sptr &instrument,
+      const Mantid::API::MatrixWorkspace_sptr &inputWS) const;
   /// Populate transmission properties
-  bool populateTransmissionProperties(Mantid::API::IAlgorithm_sptr alg) const;
+  bool
+  populateTransmissionProperties(const Mantid::API::IAlgorithm_sptr &alg) const;
   /// Find theta from a named log value
-  double getThetaFromLogs(Mantid::API::MatrixWorkspace_sptr inputWs,
+  double getThetaFromLogs(const Mantid::API::MatrixWorkspace_sptr &inputWs,
                           const std::string &logName);
   // Retrieve the run number from the logs of the input workspace.
   std::string getRunNumber(Mantid::API::MatrixWorkspace const &ws) const;
 
-  void convertProcessingInstructions(Instrument_const_sptr instrument,
-                                     MatrixWorkspace_sptr inputWS);
-  void convertProcessingInstructions(MatrixWorkspace_sptr inputWS);
+  void convertProcessingInstructions(const Instrument_const_sptr &instrument,
+                                     const MatrixWorkspace_sptr &inputWS);
+  void convertProcessingInstructions(const MatrixWorkspace_sptr &inputWS);
   std::string m_processingInstructionsWorkspaceIndex;
   std::string m_processingInstructions;
 
 protected:
-  std::string
-  convertToSpectrumNumber(const std::string &workspaceIndex,
-                          Mantid::API::MatrixWorkspace_const_sptr ws) const;
+  std::string convertToSpectrumNumber(
+      const std::string &workspaceIndex,
+      const Mantid::API::MatrixWorkspace_const_sptr &ws) const;
   std::string convertProcessingInstructionsToSpectrumNumbers(
       const std::string &instructions,
-      Mantid::API::MatrixWorkspace_const_sptr ws) const;
+      const Mantid::API::MatrixWorkspace_const_sptr &ws) const;
 
-  void setWorkspacePropertyFromChild(Algorithm_sptr alg,
+  void setWorkspacePropertyFromChild(const Algorithm_sptr &alg,
                                      std::string const &propertyName);
 };
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ResetNegatives.h b/Framework/Algorithms/inc/MantidAlgorithms/ResetNegatives.h
index c07cf9fd890..f39ddda7220 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/ResetNegatives.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/ResetNegatives.h
@@ -30,11 +30,12 @@ public:
 private:
   void init() override;
   void exec() override;
-  void pushMinimum(API::MatrixWorkspace_const_sptr minWS,
-                   API::MatrixWorkspace_sptr wksp, API::Progress &prog);
-  void changeNegatives(API::MatrixWorkspace_const_sptr minWS,
+  void pushMinimum(const API::MatrixWorkspace_const_sptr &minWS,
+                   const API::MatrixWorkspace_sptr &wksp, API::Progress &prog);
+  void changeNegatives(const API::MatrixWorkspace_const_sptr &minWS,
                        const double spectrumNegativeValues,
-                       API::MatrixWorkspace_sptr wksp, API::Progress &prog);
+                       const API::MatrixWorkspace_sptr &wksp,
+                       API::Progress &prog);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/RingProfile.h b/Framework/Algorithms/inc/MantidAlgorithms/RingProfile.h
index b22d34fdca6..40d04682f61 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/RingProfile.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/RingProfile.h
@@ -47,17 +47,18 @@ private:
   /// get the bin position for the given angle
   int fromAngleToBin(double angle, bool degree = true);
   /// validate the inputs of the algorithm for instrument based workspace
-  void checkInputsForSpectraWorkspace(const API::MatrixWorkspace_sptr);
+  void checkInputsForSpectraWorkspace(const API::MatrixWorkspace_sptr &);
   /// validate the inputs of the algorithm for 2d matrix based instrument
-  void checkInputsForNumericWorkspace(const API::MatrixWorkspace_sptr);
+  void checkInputsForNumericWorkspace(const API::MatrixWorkspace_sptr &);
   /// process ring profile for instrument based workspace
-  void processInstrumentRingProfile(const API::MatrixWorkspace_sptr inputWS,
+  void processInstrumentRingProfile(const API::MatrixWorkspace_sptr &inputWS,
                                     std::vector<double> &output_bins);
   /// process ring profile for image based workspace
-  void processNumericImageRingProfile(const API::MatrixWorkspace_sptr inputWS,
+  void processNumericImageRingProfile(const API::MatrixWorkspace_sptr &inputWS,
                                       std::vector<double> &output_bins);
   /// identify the bin position for the given pixel in the image based workspace
-  void getBinForPixel(const API::MatrixWorkspace_sptr, int, std::vector<int> &);
+  void getBinForPixel(const API::MatrixWorkspace_sptr &, int,
+                      std::vector<int> &);
   //// identify the bin position for the pixel related to the given detector
   int getBinForPixel(const Kernel::V3D &position);
   /// copy of the minRadius input
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/RunCombinationHelpers/RunCombinationHelper.h b/Framework/Algorithms/inc/MantidAlgorithms/RunCombinationHelpers/RunCombinationHelper.h
index f4ba7901003..5f9c6260346 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/RunCombinationHelpers/RunCombinationHelper.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/RunCombinationHelpers/RunCombinationHelper.h
@@ -30,9 +30,9 @@ static const std::string FAIL_BEHAVIOUR = "Fail";
 
 class MANTID_ALGORITHMS_DLL RunCombinationHelper {
 public:
-  std::string checkCompatibility(API::MatrixWorkspace_sptr,
+  std::string checkCompatibility(const API::MatrixWorkspace_sptr &,
                                  bool checkNumberHistograms = false);
-  void setReferenceProperties(API::MatrixWorkspace_sptr);
+  void setReferenceProperties(const API::MatrixWorkspace_sptr &);
   static std::vector<std::string>
   unWrapGroups(const std::vector<std::string> &);
   std::list<API::MatrixWorkspace_sptr>
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/RunCombinationHelpers/SampleLogsBehaviour.h b/Framework/Algorithms/inc/MantidAlgorithms/RunCombinationHelpers/SampleLogsBehaviour.h
index ef7f695bb9b..81a1e521e5d 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/RunCombinationHelpers/SampleLogsBehaviour.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/RunCombinationHelpers/SampleLogsBehaviour.h
@@ -69,17 +69,18 @@ public:
     std::string sampleLogsFailTolerances;
   };
 
-  SampleLogsBehaviour(API::MatrixWorkspace_sptr ws, Kernel::Logger &logger,
+  SampleLogsBehaviour(const API::MatrixWorkspace_sptr &ws,
+                      Kernel::Logger &logger,
                       const SampleLogNames &logEntries = {},
                       const ParameterName &parName = {});
 
   /// Create and update sample logs according to instrument parameters
-  void mergeSampleLogs(API::MatrixWorkspace_sptr addeeWS,
-                       API::MatrixWorkspace_sptr outWS);
-  void setUpdatedSampleLogs(API::MatrixWorkspace_sptr outWS);
-  void removeSampleLogsFromWorkspace(API::MatrixWorkspace_sptr addeeWS);
-  void readdSampleLogToWorkspace(API::MatrixWorkspace_sptr addeeWS);
-  void resetSampleLogs(API::MatrixWorkspace_sptr ws);
+  void mergeSampleLogs(const API::MatrixWorkspace_sptr &addeeWS,
+                       const API::MatrixWorkspace_sptr &outWS);
+  void setUpdatedSampleLogs(const API::MatrixWorkspace_sptr &outWS);
+  void removeSampleLogsFromWorkspace(const API::MatrixWorkspace_sptr &addeeWS);
+  void readdSampleLogToWorkspace(const API::MatrixWorkspace_sptr &addeeWS);
+  void resetSampleLogs(const API::MatrixWorkspace_sptr &ws);
 
 private:
   Kernel::Logger &m_logger;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SANSCollimationLengthEstimator.h b/Framework/Algorithms/inc/MantidAlgorithms/SANSCollimationLengthEstimator.h
index 384b5ef152a..77290e6f478 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SANSCollimationLengthEstimator.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SANSCollimationLengthEstimator.h
@@ -15,11 +15,12 @@ namespace Mantid {
 namespace Algorithms {
 class MANTID_ALGORITHMS_DLL SANSCollimationLengthEstimator {
 public:
-  double provideCollimationLength(Mantid::API::MatrixWorkspace_sptr workspace);
+  double
+  provideCollimationLength(const Mantid::API::MatrixWorkspace_sptr &workspace);
 
 private:
   double getCollimationLengthWithGuides(
-      Mantid::API::MatrixWorkspace_sptr inOutWS, const double L1,
+      const Mantid::API::MatrixWorkspace_sptr &inOutWS, const double L1,
       const double collimationLengthCorrection) const;
   double getGuideValue(Mantid::Kernel::Property *prop) const;
 };
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SampleCorrections/MCAbsorptionStrategy.h b/Framework/Algorithms/inc/MantidAlgorithms/SampleCorrections/MCAbsorptionStrategy.h
index 620b2eefde7..f418bb49411 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SampleCorrections/MCAbsorptionStrategy.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SampleCorrections/MCAbsorptionStrategy.h
@@ -47,7 +47,8 @@ public:
                        Kernel::Logger &logger);
   void calculate(Kernel::PseudoRandomNumberGenerator &rng,
                  const Kernel::V3D &finalPos,
-                 Mantid::HistogramData::Points lambdas, double lambdaFixed,
+                 const Mantid::HistogramData::Points &lambdas,
+                 double lambdaFixed,
                  Mantid::API::ISpectrum &attenuationFactorsSpectrum);
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SmoothNeighbours.h b/Framework/Algorithms/inc/MantidAlgorithms/SmoothNeighbours.h
index 24e1bc56b2e..3faf5a6651c 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SmoothNeighbours.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SmoothNeighbours.h
@@ -105,7 +105,7 @@ private:
   void setupNewInstrument(API::MatrixWorkspace &outws) const;
 
   /// Build the instrument/detector setup in workspace
-  void spreadPixels(API::MatrixWorkspace_sptr outws);
+  void spreadPixels(const API::MatrixWorkspace_sptr &outws);
 
   /// Non rectangular detector group name
   static const std::string NON_UNIFORM_GROUP;
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SofQWPolygon.h b/Framework/Algorithms/inc/MantidAlgorithms/SofQWPolygon.h
index aaab8d15c76..7bcad9d82b4 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SofQWPolygon.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SofQWPolygon.h
@@ -65,7 +65,7 @@ private:
   /// Run the algorithm
   void exec() override;
   /// Init variables cache base on the given workspace
-  void initCachedValues(API::MatrixWorkspace_const_sptr workspace);
+  void initCachedValues(const API::MatrixWorkspace_const_sptr &workspace);
   /// Init the theta index
   void initThetaCache(const API::MatrixWorkspace &workspace);
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SortXAxis.h b/Framework/Algorithms/inc/MantidAlgorithms/SortXAxis.h
index 138f3a76833..c55bd2ba79f 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SortXAxis.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SortXAxis.h
@@ -34,7 +34,7 @@ private:
   std::vector<std::size_t> createIndexes(const size_t);
 
   void sortIndicesByX(std::vector<std::size_t> &workspaceIndecies,
-                      std::string order,
+                      const std::string &order,
                       const Mantid::API::MatrixWorkspace &inputWorkspace,
                       unsigned int specNum);
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SpecularReflectionAlgorithm.h b/Framework/Algorithms/inc/MantidAlgorithms/SpecularReflectionAlgorithm.h
index 2203dc92183..2a5b2f7fa4c 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SpecularReflectionAlgorithm.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SpecularReflectionAlgorithm.h
@@ -25,12 +25,12 @@ protected:
   SpecularReflectionAlgorithm() = default;
 
   /// Get the surface sample component
-  Mantid::Geometry::IComponent_const_sptr
-  getSurfaceSampleComponent(Mantid::Geometry::Instrument_const_sptr inst) const;
+  Mantid::Geometry::IComponent_const_sptr getSurfaceSampleComponent(
+      const Mantid::Geometry::Instrument_const_sptr &inst) const;
 
   /// Get the detector component
   Mantid::Geometry::IComponent_const_sptr
-  getDetectorComponent(Mantid::API::MatrixWorkspace_sptr workspace,
+  getDetectorComponent(const Mantid::API::MatrixWorkspace_sptr &workspace,
                        const bool isPointDetector) const;
 
   /// Does the property have a default value.
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SpecularReflectionPositionCorrect.h b/Framework/Algorithms/inc/MantidAlgorithms/SpecularReflectionPositionCorrect.h
index b3801e1e062..06fb59bbfaf 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SpecularReflectionPositionCorrect.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SpecularReflectionPositionCorrect.h
@@ -34,15 +34,15 @@ private:
   void exec() override;
 
   /// Correct detector positions.
-  void correctPosition(API::MatrixWorkspace_sptr toCorrect,
+  void correctPosition(const API::MatrixWorkspace_sptr &toCorrect,
                        const double &twoThetaInDeg,
-                       Geometry::IComponent_const_sptr sample,
-                       Geometry::IComponent_const_sptr detector);
+                       const Geometry::IComponent_const_sptr &sample,
+                       const Geometry::IComponent_const_sptr &detector);
 
   /// Move detectors.
-  void moveDetectors(API::MatrixWorkspace_sptr toCorrect,
+  void moveDetectors(const API::MatrixWorkspace_sptr &toCorrect,
                      Geometry::IComponent_const_sptr detector,
-                     Geometry::IComponent_const_sptr sample,
+                     const Geometry::IComponent_const_sptr &sample,
                      const double &upOffset, const double &acrossOffset,
                      const Mantid::Kernel::V3D &detectorPosition);
 };
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h b/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h
index f7d3b702ebc..bd3f19787a9 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h
@@ -84,7 +84,7 @@ private:
   /// Mask out everything but the data in the ranges, but do it inplace.
   void maskInPlace(int a1, int a2, Mantid::API::MatrixWorkspace_sptr &source);
   /// Add back in any special values
-  void reinsertSpecialValues(Mantid::API::MatrixWorkspace_sptr ws);
+  void reinsertSpecialValues(const Mantid::API::MatrixWorkspace_sptr &ws);
   /// Range tolerance
   static const double range_tolerance;
   /// Scaling factors
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/StripPeaks.h b/Framework/Algorithms/inc/MantidAlgorithms/StripPeaks.h
index 90e588a8845..6e5db58f75b 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/StripPeaks.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/StripPeaks.h
@@ -62,9 +62,10 @@ private:
   /// Execution code
   void exec() override;
 
-  API::ITableWorkspace_sptr findPeaks(API::MatrixWorkspace_sptr WS);
-  API::MatrixWorkspace_sptr removePeaks(API::MatrixWorkspace_const_sptr input,
-                                        API::ITableWorkspace_sptr peakslist);
+  API::ITableWorkspace_sptr findPeaks(const API::MatrixWorkspace_sptr &WS);
+  API::MatrixWorkspace_sptr
+  removePeaks(const API::MatrixWorkspace_const_sptr &input,
+              const API::ITableWorkspace_sptr &peakslist);
   double m_maxChiSq{0.0};
 };
 
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SumEventsByLogValue.h b/Framework/Algorithms/inc/MantidAlgorithms/SumEventsByLogValue.h
index 81709e58b40..fc92892ce81 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SumEventsByLogValue.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SumEventsByLogValue.h
@@ -55,7 +55,7 @@ private:
                        const int maxVal,
                        const Kernel::TimeSeriesProperty<int> *log,
                        std::vector<int> &Y);
-  void addMonitorCounts(API::ITableWorkspace_sptr outputWorkspace,
+  void addMonitorCounts(const API::ITableWorkspace_sptr &outputWorkspace,
                         const Kernel::TimeSeriesProperty<int> *log,
                         const int minVal, const int maxVal);
   std::vector<std::pair<std::string, const Kernel::ITimeSeriesProperty *>>
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/SumSpectra.h b/Framework/Algorithms/inc/MantidAlgorithms/SumSpectra.h
index cddb3e3e886..1c5e291c7b3 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/SumSpectra.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/SumSpectra.h
@@ -60,21 +60,22 @@ public:
 
 private:
   /// Handle logic for RebinnedOutput workspaces
-  void doFractionalSum(API::MatrixWorkspace_sptr outputWorkspace,
+  void doFractionalSum(const API::MatrixWorkspace_sptr &outputWorkspace,
                        API::Progress &progress, size_t &numSpectra,
                        size_t &numMasked, size_t &numZeros);
   /// Handle logic for Workspace2D workspaces
-  void doSimpleSum(API::MatrixWorkspace_sptr outputWorkspace,
+  void doSimpleSum(const API::MatrixWorkspace_sptr &outputWorkspace,
                    API::Progress &progress, size_t &numSpectra,
                    size_t &numMasked, size_t &numZeros);
 
   // Overridden Algorithm methods
   void init() override;
   void exec() override;
-  void execEvent(API::MatrixWorkspace_sptr outputWorkspace,
+  void execEvent(const API::MatrixWorkspace_sptr &outputWorkspace,
                  API::Progress &progress, size_t &numSpectra, size_t &numMasked,
                  size_t &numZeros);
-  specnum_t getOutputSpecNo(API::MatrixWorkspace_const_sptr localworkspace);
+  specnum_t
+  getOutputSpecNo(const API::MatrixWorkspace_const_sptr &localworkspace);
 
   API::MatrixWorkspace_sptr replaceSpecialValues();
   void determineIndices(const size_t numberOfSpectra);
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/TOFSANSResolutionByPixel.h b/Framework/Algorithms/inc/MantidAlgorithms/TOFSANSResolutionByPixel.h
index dc97f7594f4..7ab48b1ff47 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/TOFSANSResolutionByPixel.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/TOFSANSResolutionByPixel.h
@@ -58,13 +58,13 @@ private:
   double provideDefaultLCollimationLength(
       Mantid::API::MatrixWorkspace_sptr inWS) const;
   /// Check input
-  void checkInput(Mantid::API::MatrixWorkspace_sptr inWS);
+  void checkInput(const Mantid::API::MatrixWorkspace_sptr &inWS);
   /// Get the moderator workspace
-  Mantid::API::MatrixWorkspace_sptr
-  getModeratorWorkspace(Mantid::API::MatrixWorkspace_sptr inputWorkspace);
+  Mantid::API::MatrixWorkspace_sptr getModeratorWorkspace(
+      const Mantid::API::MatrixWorkspace_sptr &inputWorkspace);
   /// Create an output workspace
   Mantid::API::MatrixWorkspace_sptr
-  setupOutputWorkspace(Mantid::API::MatrixWorkspace_sptr inputWorkspace);
+  setupOutputWorkspace(const Mantid::API::MatrixWorkspace_sptr &inputWorkspace);
   /// Wavelength resolution (constant for all wavelengths)
   double m_wl_resolution;
 };
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/TimeAtSampleStrategyDirect.h b/Framework/Algorithms/inc/MantidAlgorithms/TimeAtSampleStrategyDirect.h
index 595d6efe549..6ba3418f9a3 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/TimeAtSampleStrategyDirect.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/TimeAtSampleStrategyDirect.h
@@ -23,7 +23,8 @@ class MANTID_ALGORITHMS_DLL TimeAtSampleStrategyDirect
     : public TimeAtSampleStrategy {
 public:
   TimeAtSampleStrategyDirect(
-      boost::shared_ptr<const Mantid::API::MatrixWorkspace> ws, double ei);
+      const boost::shared_ptr<const Mantid::API::MatrixWorkspace> &ws,
+      double ei);
   Correction calculate(const size_t &workspace_index) const override;
 
 private:
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/Transpose.h b/Framework/Algorithms/inc/MantidAlgorithms/Transpose.h
index 00640af1f88..db1e2c7b70f 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/Transpose.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/Transpose.h
@@ -56,9 +56,10 @@ private:
   void exec() override;
   /// Create the output workspace
   API::MatrixWorkspace_sptr
-  createOutputWorkspace(API::MatrixWorkspace_const_sptr inputWorkspace);
+  createOutputWorkspace(const API::MatrixWorkspace_const_sptr &inputWorkspace);
   /// Return the vertical axis on the workspace, throwing if it is not valid
-  API::Axis *getVerticalAxis(API::MatrixWorkspace_const_sptr workspace) const;
+  API::Axis *
+  getVerticalAxis(const API::MatrixWorkspace_const_sptr &workspace) const;
 };
 
 } // namespace Algorithms
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/WienerSmooth.h b/Framework/Algorithms/inc/MantidAlgorithms/WienerSmooth.h
index 49c7772d6eb..f7888fff4df 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/WienerSmooth.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/WienerSmooth.h
@@ -35,7 +35,7 @@ private:
   std::pair<double, double>
   getStartEnd(const Mantid::HistogramData::HistogramX &X,
               bool isHistogram) const;
-  API::MatrixWorkspace_sptr copyInput(API::MatrixWorkspace_sptr inputWS,
+  API::MatrixWorkspace_sptr copyInput(const API::MatrixWorkspace_sptr &inputWS,
                                       size_t wsIndex);
   API::MatrixWorkspace_sptr
   smoothSingleSpectrum(API::MatrixWorkspace_sptr inputWS, size_t wsIndex);
diff --git a/Framework/Algorithms/inc/MantidAlgorithms/XDataConverter.h b/Framework/Algorithms/inc/MantidAlgorithms/XDataConverter.h
index 2f6cdc8cf15..b15e66e66bc 100644
--- a/Framework/Algorithms/inc/MantidAlgorithms/XDataConverter.h
+++ b/Framework/Algorithms/inc/MantidAlgorithms/XDataConverter.h
@@ -51,11 +51,11 @@ private:
   /// Override exec
   void exec() override;
 
-  std::size_t getNewYSize(const API::MatrixWorkspace_sptr inputWS);
+  std::size_t getNewYSize(const API::MatrixWorkspace_sptr &inputWS);
 
   /// Set the X data on given spectra
-  void setXData(API::MatrixWorkspace_sptr outputWS,
-                const API::MatrixWorkspace_sptr inputWS, const int index);
+  void setXData(const API::MatrixWorkspace_sptr &outputWS,
+                const API::MatrixWorkspace_sptr &inputWS, const int index);
 
   /// Flag if the X data is shared
   bool m_sharedX;
diff --git a/Framework/Algorithms/src/AddSampleLog.cpp b/Framework/Algorithms/src/AddSampleLog.cpp
index 3227abe3460..4f49a043558 100644
--- a/Framework/Algorithms/src/AddSampleLog.cpp
+++ b/Framework/Algorithms/src/AddSampleLog.cpp
@@ -369,7 +369,7 @@ void AddSampleLog::setTimeSeriesData(Run &run_obj,
  * @return
  */
 std::vector<Types::Core::DateAndTime>
-AddSampleLog::getTimes(API::MatrixWorkspace_const_sptr dataws,
+AddSampleLog::getTimes(const API::MatrixWorkspace_const_sptr &dataws,
                        int workspace_index, bool is_epoch, bool is_second,
                        API::Run &run_obj) {
   // get run start time
@@ -421,7 +421,7 @@ Types::Core::DateAndTime AddSampleLog::getRunStart(API::Run &run_obj) {
  * @return
  */
 std::vector<double>
-AddSampleLog::getDblValues(API::MatrixWorkspace_const_sptr dataws,
+AddSampleLog::getDblValues(const API::MatrixWorkspace_const_sptr &dataws,
                            int workspace_index) {
   std::vector<double> valuevec;
   size_t vecsize = dataws->readY(workspace_index).size();
@@ -439,7 +439,7 @@ AddSampleLog::getDblValues(API::MatrixWorkspace_const_sptr dataws,
  * @return
  */
 std::vector<int>
-AddSampleLog::getIntValues(API::MatrixWorkspace_const_sptr dataws,
+AddSampleLog::getIntValues(const API::MatrixWorkspace_const_sptr &dataws,
                            int workspace_index) {
   std::vector<int> valuevec;
   size_t vecsize = dataws->readY(workspace_index).size();
@@ -455,7 +455,7 @@ AddSampleLog::getIntValues(API::MatrixWorkspace_const_sptr dataws,
  * @param epochtime
  * @param timeunit
  */
-void AddSampleLog::getMetaData(API::MatrixWorkspace_const_sptr dataws,
+void AddSampleLog::getMetaData(const API::MatrixWorkspace_const_sptr &dataws,
                                bool &epochtime, std::string &timeunit) {
   bool auto_meta = getProperty("AutoMetaData");
   if (auto_meta) {
diff --git a/Framework/Algorithms/src/AlignDetectors.cpp b/Framework/Algorithms/src/AlignDetectors.cpp
index 60d3cea2e8c..5df9f9c859b 100644
--- a/Framework/Algorithms/src/AlignDetectors.cpp
+++ b/Framework/Algorithms/src/AlignDetectors.cpp
@@ -24,6 +24,7 @@
 
 #include <fstream>
 #include <sstream>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -41,7 +42,7 @@ namespace { // anonymous namespace
 
 class ConversionFactors {
 public:
-  explicit ConversionFactors(ITableWorkspace_const_sptr table)
+  explicit ConversionFactors(const ITableWorkspace_const_sptr &table)
       : m_difcCol(table->getColumn("difc")),
         m_difaCol(table->getColumn("difa")),
         m_tzeroCol(table->getColumn("tzero")) {
@@ -70,7 +71,7 @@ public:
   }
 
 private:
-  void generateDetidToRow(ITableWorkspace_const_sptr table) {
+  void generateDetidToRow(const ITableWorkspace_const_sptr &table) {
     ConstColumnVector<int> detIDs = table->getVector("detid");
     const size_t numDets = detIDs.size();
     for (size_t i = 0; i < numDets; ++i) {
@@ -188,7 +189,7 @@ std::map<std::string, std::string> AlignDetectors::validateInputs() {
   return result;
 }
 
-void AlignDetectors::loadCalFile(MatrixWorkspace_sptr inputWS,
+void AlignDetectors::loadCalFile(const MatrixWorkspace_sptr &inputWS,
                                  const std::string &filename) {
   IAlgorithm_sptr alg = createChildAlgorithm("LoadDiffCal");
   alg->setProperty("InputWorkspace", inputWS);
@@ -202,7 +203,7 @@ void AlignDetectors::loadCalFile(MatrixWorkspace_sptr inputWS,
   m_calibrationWS = alg->getProperty("OutputCalWorkspace");
 }
 
-void AlignDetectors::getCalibrationWS(MatrixWorkspace_sptr inputWS) {
+void AlignDetectors::getCalibrationWS(const MatrixWorkspace_sptr &inputWS) {
   m_calibrationWS = getProperty("CalibrationWorkspace");
   if (m_calibrationWS)
     return; // nothing more to do
@@ -220,14 +221,14 @@ void AlignDetectors::getCalibrationWS(MatrixWorkspace_sptr inputWS) {
   const std::string calFileName = getPropertyValue("CalibrationFile");
   if (!calFileName.empty()) {
     progress(0.0, "Reading calibration file");
-    loadCalFile(inputWS, calFileName);
+    loadCalFile(std::move(inputWS), calFileName);
     return;
   }
 
   throw std::runtime_error("Failed to determine calibration information");
 }
 
-void setXAxisUnits(API::MatrixWorkspace_sptr outputWS) {
+void setXAxisUnits(const API::MatrixWorkspace_sptr &outputWS) {
   outputWS->getAxis(0)->unit() = UnitFactory::Instance().create("dSpacing");
 }
 
diff --git a/Framework/Algorithms/src/Bin2DPowderDiffraction.cpp b/Framework/Algorithms/src/Bin2DPowderDiffraction.cpp
index 2b555c68c0f..1ec74a6976e 100644
--- a/Framework/Algorithms/src/Bin2DPowderDiffraction.cpp
+++ b/Framework/Algorithms/src/Bin2DPowderDiffraction.cpp
@@ -365,7 +365,8 @@ size_t Bin2DPowderDiffraction::UnifyXBins(
   return max_size;
 }
 
-void Bin2DPowderDiffraction::normalizeToBinArea(MatrixWorkspace_sptr outWS) {
+void Bin2DPowderDiffraction::normalizeToBinArea(
+    const MatrixWorkspace_sptr &outWS) {
   NumericAxis *verticalAxis = dynamic_cast<NumericAxis *>(outWS->getAxis(1));
   const std::vector<double> &yValues = verticalAxis->getValues();
   auto nhist = outWS->getNumberHistograms();
diff --git a/Framework/Algorithms/src/BinaryOperation.cpp b/Framework/Algorithms/src/BinaryOperation.cpp
index 62954e801bb..df4143ea17c 100644
--- a/Framework/Algorithms/src/BinaryOperation.cpp
+++ b/Framework/Algorithms/src/BinaryOperation.cpp
@@ -795,7 +795,8 @@ void BinaryOperation::do2D(bool mismatchedSpectra) {
  *  @param out :: The result workspace
  */
 void BinaryOperation::propagateBinMasks(
-    const API::MatrixWorkspace_const_sptr rhs, API::MatrixWorkspace_sptr out) {
+    const API::MatrixWorkspace_const_sptr &rhs,
+    const API::MatrixWorkspace_sptr &out) {
   const int64_t outHists = out->getNumberHistograms();
   const int64_t rhsHists = rhs->getNumberHistograms();
   for (int64_t i = 0; i < outHists; ++i) {
@@ -876,7 +877,7 @@ void BinaryOperation::performEventBinaryOperation(DataObjects::EventList &lhs,
  * @return OperandType describing what type of workspace it will be operated as.
  */
 OperandType
-BinaryOperation::getOperandType(const API::MatrixWorkspace_const_sptr ws) {
+BinaryOperation::getOperandType(const API::MatrixWorkspace_const_sptr &ws) {
   // An event workspace?
   EventWorkspace_const_sptr ews =
       boost::dynamic_pointer_cast<const EventWorkspace>(ws);
diff --git a/Framework/Algorithms/src/CalculateCarpenterSampleCorrection.cpp b/Framework/Algorithms/src/CalculateCarpenterSampleCorrection.cpp
index c0d62145aa1..7d2997186d5 100644
--- a/Framework/Algorithms/src/CalculateCarpenterSampleCorrection.cpp
+++ b/Framework/Algorithms/src/CalculateCarpenterSampleCorrection.cpp
@@ -413,7 +413,7 @@ void CalculateCarpenterSampleCorrection::calculate_ms_correction(
 }
 
 MatrixWorkspace_sptr CalculateCarpenterSampleCorrection::createOutputWorkspace(
-    const MatrixWorkspace_sptr &inputWksp, const std::string ylabel) const {
+    const MatrixWorkspace_sptr &inputWksp, const std::string &ylabel) const {
   MatrixWorkspace_sptr outputWS = create<HistoWorkspace>(*inputWksp);
   // The algorithm computes the signal values at bin centres so they should
   // be treated as a distribution
@@ -424,7 +424,7 @@ MatrixWorkspace_sptr CalculateCarpenterSampleCorrection::createOutputWorkspace(
 }
 
 MatrixWorkspace_sptr CalculateCarpenterSampleCorrection::setUncertainties(
-    MatrixWorkspace_sptr workspace) {
+    const MatrixWorkspace_sptr &workspace) {
   auto alg = this->createChildAlgorithm("SetUncertainties");
   alg->initialize();
   alg->setProperty("InputWorkspace", workspace);
@@ -433,7 +433,7 @@ MatrixWorkspace_sptr CalculateCarpenterSampleCorrection::setUncertainties(
 }
 
 void CalculateCarpenterSampleCorrection::deleteWorkspace(
-    MatrixWorkspace_sptr workspace) {
+    const MatrixWorkspace_sptr &workspace) {
   auto alg = this->createChildAlgorithm("DeleteWorkspace");
   alg->initialize();
   alg->setChild(true);
diff --git a/Framework/Algorithms/src/CalculateDynamicRange.cpp b/Framework/Algorithms/src/CalculateDynamicRange.cpp
index 50e7b95c74e..c3793399282 100644
--- a/Framework/Algorithms/src/CalculateDynamicRange.cpp
+++ b/Framework/Algorithms/src/CalculateDynamicRange.cpp
@@ -73,9 +73,9 @@ void CalculateDynamicRange::init() {
  * @param indices : the list of workspace indices
  * @param compName : the name of the detector component
  */
-void CalculateDynamicRange::calculateQMinMax(MatrixWorkspace_sptr workspace,
-                                             const std::vector<size_t> &indices,
-                                             const std::string &compName = "") {
+void CalculateDynamicRange::calculateQMinMax(
+    const MatrixWorkspace_sptr &workspace, const std::vector<size_t> &indices,
+    const std::string &compName = "") {
   const auto &spectrumInfo = workspace->spectrumInfo();
   double min = std::numeric_limits<double>::max(),
          max = std::numeric_limits<double>::min();
diff --git a/Framework/Algorithms/src/CalculateEfficiency.cpp b/Framework/Algorithms/src/CalculateEfficiency.cpp
index 84a379264db..97d115ef78c 100644
--- a/Framework/Algorithms/src/CalculateEfficiency.cpp
+++ b/Framework/Algorithms/src/CalculateEfficiency.cpp
@@ -156,9 +156,9 @@ void CalculateEfficiency::exec() {
  * @param error: error on sum (counts)
  * @param nPixels: number of unmasked detector pixels that contributed to sum
  */
-void CalculateEfficiency::sumUnmaskedDetectors(MatrixWorkspace_sptr rebinnedWS,
-                                               double &sum, double &error,
-                                               int &nPixels) {
+void CalculateEfficiency::sumUnmaskedDetectors(
+    const MatrixWorkspace_sptr &rebinnedWS, double &sum, double &error,
+    int &nPixels) {
   // Number of spectra
   const auto numberOfSpectra =
       static_cast<int>(rebinnedWS->getNumberHistograms());
@@ -200,11 +200,10 @@ void CalculateEfficiency::sumUnmaskedDetectors(MatrixWorkspace_sptr rebinnedWS,
  * @param nPixels: number of unmasked detector pixels that contributed to sum
  */
 
-void CalculateEfficiency::normalizeDetectors(MatrixWorkspace_sptr rebinnedWS,
-                                             MatrixWorkspace_sptr outputWS,
-                                             double sum, double error,
-                                             int nPixels, double min_eff,
-                                             double max_eff) {
+void CalculateEfficiency::normalizeDetectors(
+    const MatrixWorkspace_sptr &rebinnedWS,
+    const MatrixWorkspace_sptr &outputWS, double sum, double error, int nPixels,
+    double min_eff, double max_eff) {
   // Number of spectra
   const size_t numberOfSpectra = rebinnedWS->getNumberHistograms();
 
@@ -337,7 +336,7 @@ void CalculateEfficiency::maskComponent(MatrixWorkspace &ws,
  * @param low :: number of rows to mask Bottom
  * @param componentName :: Must be a RectangularDetector
  */
-void CalculateEfficiency::maskEdges(MatrixWorkspace_sptr ws, int left,
+void CalculateEfficiency::maskEdges(const MatrixWorkspace_sptr &ws, int left,
                                     int right, int high, int low,
                                     const std::string &componentName) {
 
diff --git a/Framework/Algorithms/src/CalculateIqt.cpp b/Framework/Algorithms/src/CalculateIqt.cpp
index ee3a5012c42..6d18d84ed86 100644
--- a/Framework/Algorithms/src/CalculateIqt.cpp
+++ b/Framework/Algorithms/src/CalculateIqt.cpp
@@ -15,6 +15,7 @@
 #include <boost/numeric/conversion/cast.hpp>
 #include <cmath>
 #include <functional>
+#include <utility>
 
 using namespace Mantid::Algorithms;
 using namespace Mantid::API;
@@ -90,7 +91,7 @@ allYValuesAtIndex(const std::vector<MatrixWorkspace_sptr> &workspaces,
   return yValues;
 }
 
-int getWorkspaceNumberOfHistograms(MatrixWorkspace_sptr workspace) {
+int getWorkspaceNumberOfHistograms(const MatrixWorkspace_sptr &workspace) {
   return boost::numeric_cast<int>(workspace->getNumberHistograms());
 }
 
@@ -172,7 +173,7 @@ std::string CalculateIqt::rebinParamsAsString() {
 }
 
 MatrixWorkspace_sptr CalculateIqt::monteCarloErrorCalculation(
-    MatrixWorkspace_sptr sample, MatrixWorkspace_sptr resolution,
+    const MatrixWorkspace_sptr &sample, const MatrixWorkspace_sptr &resolution,
     const std::string &rebinParams, const int seed, const bool calculateErrors,
     const int nIterations) {
   auto outputWorkspace = calculateIqt(sample, resolution, rebinParams);
@@ -211,7 +212,7 @@ std::map<std::string, std::string> CalculateIqt::validateInputs() {
   return issues;
 }
 
-MatrixWorkspace_sptr CalculateIqt::rebin(MatrixWorkspace_sptr workspace,
+MatrixWorkspace_sptr CalculateIqt::rebin(const MatrixWorkspace_sptr &workspace,
                                          const std::string &params) {
   IAlgorithm_sptr rebinAlgorithm = this->createChildAlgorithm("Rebin");
   rebinAlgorithm->initialize();
@@ -222,7 +223,8 @@ MatrixWorkspace_sptr CalculateIqt::rebin(MatrixWorkspace_sptr workspace,
   return rebinAlgorithm->getProperty("OutputWorkspace");
 }
 
-MatrixWorkspace_sptr CalculateIqt::integration(MatrixWorkspace_sptr workspace) {
+MatrixWorkspace_sptr
+CalculateIqt::integration(const MatrixWorkspace_sptr &workspace) {
   IAlgorithm_sptr integrationAlgorithm =
       this->createChildAlgorithm("Integration");
   integrationAlgorithm->initialize();
@@ -233,7 +235,7 @@ MatrixWorkspace_sptr CalculateIqt::integration(MatrixWorkspace_sptr workspace) {
 }
 
 MatrixWorkspace_sptr
-CalculateIqt::convertToPointData(MatrixWorkspace_sptr workspace) {
+CalculateIqt::convertToPointData(const MatrixWorkspace_sptr &workspace) {
   IAlgorithm_sptr pointDataAlgorithm =
       this->createChildAlgorithm("ConvertToPointData");
   pointDataAlgorithm->initialize();
@@ -244,7 +246,7 @@ CalculateIqt::convertToPointData(MatrixWorkspace_sptr workspace) {
 }
 
 MatrixWorkspace_sptr
-CalculateIqt::extractFFTSpectrum(MatrixWorkspace_sptr workspace) {
+CalculateIqt::extractFFTSpectrum(const MatrixWorkspace_sptr &workspace) {
   IAlgorithm_sptr FFTAlgorithm =
       this->createChildAlgorithm("ExtractFFTSpectrum");
   FFTAlgorithm->initialize();
@@ -255,8 +257,9 @@ CalculateIqt::extractFFTSpectrum(MatrixWorkspace_sptr workspace) {
   return FFTAlgorithm->getProperty("OutputWorkspace");
 }
 
-MatrixWorkspace_sptr CalculateIqt::divide(MatrixWorkspace_sptr lhsWorkspace,
-                                          MatrixWorkspace_sptr rhsWorkspace) {
+MatrixWorkspace_sptr
+CalculateIqt::divide(const MatrixWorkspace_sptr &lhsWorkspace,
+                     const MatrixWorkspace_sptr &rhsWorkspace) {
   IAlgorithm_sptr divideAlgorithm = this->createChildAlgorithm("Divide");
   divideAlgorithm->initialize();
   divideAlgorithm->setProperty("LHSWorkspace", lhsWorkspace);
@@ -266,8 +269,9 @@ MatrixWorkspace_sptr CalculateIqt::divide(MatrixWorkspace_sptr lhsWorkspace,
   return divideAlgorithm->getProperty("OutputWorkspace");
 }
 
-MatrixWorkspace_sptr CalculateIqt::cropWorkspace(MatrixWorkspace_sptr workspace,
-                                                 const double xMax) {
+MatrixWorkspace_sptr
+CalculateIqt::cropWorkspace(const MatrixWorkspace_sptr &workspace,
+                            const double xMax) {
   IAlgorithm_sptr cropAlgorithm = this->createChildAlgorithm("CropWorkspace");
   cropAlgorithm->initialize();
   cropAlgorithm->setProperty("InputWorkspace", workspace);
@@ -278,7 +282,7 @@ MatrixWorkspace_sptr CalculateIqt::cropWorkspace(MatrixWorkspace_sptr workspace,
 }
 
 MatrixWorkspace_sptr
-CalculateIqt::replaceSpecialValues(MatrixWorkspace_sptr workspace) {
+CalculateIqt::replaceSpecialValues(const MatrixWorkspace_sptr &workspace) {
   IAlgorithm_sptr specialValuesAlgorithm =
       this->createChildAlgorithm("ReplaceSpecialValues");
   specialValuesAlgorithm->initialize();
@@ -311,18 +315,19 @@ CalculateIqt::normalizedFourierTransform(MatrixWorkspace_sptr workspace,
 
 MatrixWorkspace_sptr
 CalculateIqt::calculateIqt(MatrixWorkspace_sptr workspace,
-                           MatrixWorkspace_sptr resolutionWorkspace,
+                           const MatrixWorkspace_sptr &resolutionWorkspace,
                            const std::string &rebinParams) {
   workspace = normalizedFourierTransform(workspace, rebinParams);
-  return divide(workspace, resolutionWorkspace);
+  return divide(workspace, std::move(resolutionWorkspace));
 }
 
 MatrixWorkspace_sptr CalculateIqt::doSimulation(MatrixWorkspace_sptr sample,
                                                 MatrixWorkspace_sptr resolution,
                                                 const std::string &rebinParams,
                                                 MersenneTwister &mTwister) {
-  auto simulatedWorkspace = randomizeWorkspaceWithinError(sample, mTwister);
-  return calculateIqt(simulatedWorkspace, resolution, rebinParams);
+  auto simulatedWorkspace =
+      randomizeWorkspaceWithinError(std::move(sample), mTwister);
+  return calculateIqt(simulatedWorkspace, std::move(resolution), rebinParams);
 }
 
 MatrixWorkspace_sptr CalculateIqt::setErrorsToStandardDeviation(
diff --git a/Framework/Algorithms/src/CalculatePlaczekSelfScattering.cpp b/Framework/Algorithms/src/CalculatePlaczekSelfScattering.cpp
index 4869be6a5d0..9db3a1f2615 100644
--- a/Framework/Algorithms/src/CalculatePlaczekSelfScattering.cpp
+++ b/Framework/Algorithms/src/CalculatePlaczekSelfScattering.cpp
@@ -21,7 +21,7 @@ namespace Mantid {
 namespace Algorithms {
 
 std::map<std::string, std::map<std::string, double>>
-getSampleSpeciesInfo(const API::MatrixWorkspace_const_sptr ws) {
+getSampleSpeciesInfo(const API::MatrixWorkspace_const_sptr &ws) {
   // get sample information : mass, total scattering length, and concentration
   // of each species
   double totalStoich = 0.0;
diff --git a/Framework/Algorithms/src/CalculateTransmission.cpp b/Framework/Algorithms/src/CalculateTransmission.cpp
index a4534b3209f..e2269b9791d 100644
--- a/Framework/Algorithms/src/CalculateTransmission.cpp
+++ b/Framework/Algorithms/src/CalculateTransmission.cpp
@@ -25,6 +25,7 @@
 
 #include <boost/algorithm/string/join.hpp>
 #include <boost/lexical_cast.hpp>
+#include <utility>
 
 namespace Mantid {
 namespace Algorithms {
@@ -264,7 +265,7 @@ void CalculateTransmission::exec() {
  *execution
  */
 API::MatrixWorkspace_sptr
-CalculateTransmission::extractSpectra(API::MatrixWorkspace_sptr ws,
+CalculateTransmission::extractSpectra(const API::MatrixWorkspace_sptr &ws,
                                       const std::vector<size_t> &indices) {
   // Compile a comma separated list of indices that we can pass to SumSpectra.
   std::vector<std::string> indexStrings(indices.size());
@@ -301,11 +302,11 @@ CalculateTransmission::extractSpectra(API::MatrixWorkspace_sptr ws,
  * execution
  */
 API::MatrixWorkspace_sptr
-CalculateTransmission::fit(API::MatrixWorkspace_sptr raw,
+CalculateTransmission::fit(const API::MatrixWorkspace_sptr &raw,
                            const std::vector<double> &rebinParams,
-                           const std::string fitMethod) {
+                           const std::string &fitMethod) {
   MatrixWorkspace_sptr output =
-      this->extractSpectra(raw, std::vector<size_t>(1, 0));
+      this->extractSpectra(std::move(raw), std::vector<size_t>(1, 0));
 
   Progress progress(this, m_done, 1.0, 4);
   progress.report("CalculateTransmission: Performing fit");
@@ -403,8 +404,8 @@ CalculateTransmission::fit(API::MatrixWorkspace_sptr raw,
  *  @throw runtime_error if the Linear algorithm fails during execution
  */
 API::MatrixWorkspace_sptr
-CalculateTransmission::fitData(API::MatrixWorkspace_sptr WS, double &grad,
-                               double &offset) {
+CalculateTransmission::fitData(const API::MatrixWorkspace_sptr &WS,
+                               double &grad, double &offset) {
   g_log.information("Fitting the experimental transmission curve");
   double start = m_done;
   IAlgorithm_sptr childAlg = createChildAlgorithm("Fit", start, m_done + 0.9);
@@ -436,7 +437,8 @@ CalculateTransmission::fitData(API::MatrixWorkspace_sptr WS, double &grad,
  * @param[out] coeficients of the polynomial. c[0] + c[1]x + c[2]x^2 + ...
  */
 API::MatrixWorkspace_sptr
-CalculateTransmission::fitPolynomial(API::MatrixWorkspace_sptr WS, int order,
+CalculateTransmission::fitPolynomial(const API::MatrixWorkspace_sptr &WS,
+                                     int order,
                                      std::vector<double> &coeficients) {
   g_log.notice("Fitting the experimental transmission curve fitpolyno");
   double start = m_done;
@@ -473,7 +475,7 @@ CalculateTransmission::fitPolynomial(API::MatrixWorkspace_sptr WS, int order,
  */
 API::MatrixWorkspace_sptr
 CalculateTransmission::rebin(const std::vector<double> &binParams,
-                             API::MatrixWorkspace_sptr ws) {
+                             const API::MatrixWorkspace_sptr &ws) {
   double start = m_done;
   IAlgorithm_sptr childAlg =
       createChildAlgorithm("Rebin", start, m_done += 0.05);
@@ -493,9 +495,9 @@ CalculateTransmission::rebin(const std::vector<double> &binParams,
  * @param directWS :: the input direct workspace
  * @param index    :: the index of the detector to checked
  */
-void CalculateTransmission::logIfNotMonitor(API::MatrixWorkspace_sptr sampleWS,
-                                            API::MatrixWorkspace_sptr directWS,
-                                            size_t index) {
+void CalculateTransmission::logIfNotMonitor(
+    const API::MatrixWorkspace_sptr &sampleWS,
+    const API::MatrixWorkspace_sptr &directWS, size_t index) {
   const std::string message = "The detector at index " + std::to_string(index) +
                               " is not a monitor in the ";
   if (!sampleWS->spectrumInfo().isMonitor(index))
diff --git a/Framework/Algorithms/src/CalculateTransmissionBeamSpreader.cpp b/Framework/Algorithms/src/CalculateTransmissionBeamSpreader.cpp
index 19df98df700..2fde4715f04 100644
--- a/Framework/Algorithms/src/CalculateTransmissionBeamSpreader.cpp
+++ b/Framework/Algorithms/src/CalculateTransmissionBeamSpreader.cpp
@@ -240,8 +240,8 @@ void CalculateTransmissionBeamSpreader::exec() {
  *  @param WS ::    The workspace containing the spectrum to sum
  *  @return A Workspace2D containing the sum
  */
-API::MatrixWorkspace_sptr
-CalculateTransmissionBeamSpreader::sumSpectra(API::MatrixWorkspace_sptr WS) {
+API::MatrixWorkspace_sptr CalculateTransmissionBeamSpreader::sumSpectra(
+    const API::MatrixWorkspace_sptr &WS) {
   Algorithm_sptr childAlg = createChildAlgorithm("SumSpectra");
   childAlg->setProperty<MatrixWorkspace_sptr>("InputWorkspace", WS);
   childAlg->setProperty<bool>("IncludeMonitors", false);
@@ -255,9 +255,8 @@ CalculateTransmissionBeamSpreader::sumSpectra(API::MatrixWorkspace_sptr WS) {
  *  @param index :: The workspace index of the spectrum to extract
  *  @return A Workspace2D containing the extracted spectrum
  */
-API::MatrixWorkspace_sptr
-CalculateTransmissionBeamSpreader::extractSpectrum(API::MatrixWorkspace_sptr WS,
-                                                   const size_t index) {
+API::MatrixWorkspace_sptr CalculateTransmissionBeamSpreader::extractSpectrum(
+    const API::MatrixWorkspace_sptr &WS, const size_t index) {
   // Check that given spectra are monitors
   if (!WS->spectrumInfo().isMonitor(index)) {
     g_log.information(
@@ -277,8 +276,8 @@ CalculateTransmissionBeamSpreader::extractSpectrum(API::MatrixWorkspace_sptr WS,
  *  @param WS :: The single-spectrum workspace to fit
  *  @return A workspace containing the fit
  */
-API::MatrixWorkspace_sptr
-CalculateTransmissionBeamSpreader::fitToData(API::MatrixWorkspace_sptr WS) {
+API::MatrixWorkspace_sptr CalculateTransmissionBeamSpreader::fitToData(
+    const API::MatrixWorkspace_sptr &WS) {
   g_log.information("Fitting the experimental transmission curve");
   Algorithm_sptr childAlg = createChildAlgorithm("Linear", 0.6, 1.0);
   childAlg->setProperty<MatrixWorkspace_sptr>("InputWorkspace", WS);
diff --git a/Framework/Algorithms/src/CarpenterSampleCorrection.cpp b/Framework/Algorithms/src/CarpenterSampleCorrection.cpp
index 87e2af3caa1..404c19988b3 100644
--- a/Framework/Algorithms/src/CarpenterSampleCorrection.cpp
+++ b/Framework/Algorithms/src/CarpenterSampleCorrection.cpp
@@ -131,8 +131,8 @@ WorkspaceGroup_sptr CarpenterSampleCorrection::calculateCorrection(
 }
 
 MatrixWorkspace_sptr
-CarpenterSampleCorrection::minus(const MatrixWorkspace_sptr lhsWS,
-                                 const MatrixWorkspace_sptr rhsWS) {
+CarpenterSampleCorrection::minus(const MatrixWorkspace_sptr &lhsWS,
+                                 const MatrixWorkspace_sptr &rhsWS) {
   auto minus = this->createChildAlgorithm("Minus", 0.5, 0.75);
   minus->setProperty("LHSWorkspace", lhsWS);
   minus->setProperty("RHSWorkspace", rhsWS);
@@ -142,8 +142,8 @@ CarpenterSampleCorrection::minus(const MatrixWorkspace_sptr lhsWS,
 }
 
 MatrixWorkspace_sptr
-CarpenterSampleCorrection::multiply(const MatrixWorkspace_sptr lhsWS,
-                                    const MatrixWorkspace_sptr rhsWS) {
+CarpenterSampleCorrection::multiply(const MatrixWorkspace_sptr &lhsWS,
+                                    const MatrixWorkspace_sptr &rhsWS) {
   auto multiply = this->createChildAlgorithm("Multiply", 0.75, 1.0);
   multiply->setProperty("LHSWorkspace", lhsWS);
   multiply->setProperty("RHSWorkspace", rhsWS);
diff --git a/Framework/Algorithms/src/ChangeTimeZero.cpp b/Framework/Algorithms/src/ChangeTimeZero.cpp
index 201a387d5bf..f8375d2062a 100644
--- a/Framework/Algorithms/src/ChangeTimeZero.cpp
+++ b/Framework/Algorithms/src/ChangeTimeZero.cpp
@@ -20,6 +20,7 @@
 
 #include <boost/lexical_cast.hpp>
 #include <boost/shared_ptr.hpp>
+#include <utility>
 
 namespace Mantid {
 namespace Algorithms {
@@ -111,7 +112,7 @@ void ChangeTimeZero::exec() {
  * @returns :: pointer to the outputworkspace
  */
 API::MatrixWorkspace_sptr
-ChangeTimeZero::createOutputWS(API::MatrixWorkspace_sptr input,
+ChangeTimeZero::createOutputWS(const API::MatrixWorkspace_sptr &input,
                                double startProgress, double stopProgress) {
   MatrixWorkspace_sptr output = getProperty("OutputWorkspace");
   // Check whether input == output to see whether a new workspace is required.
@@ -134,13 +135,13 @@ ChangeTimeZero::createOutputWS(API::MatrixWorkspace_sptr input,
  * @param ws :: a workspace with time stamp information
  * @returns A time shift in seconds
  */
-double ChangeTimeZero::getTimeShift(API::MatrixWorkspace_sptr ws) const {
+double ChangeTimeZero::getTimeShift(const API::MatrixWorkspace_sptr &ws) const {
   auto timeShift = m_defaultTimeShift;
   // Check if we are dealing with an absolute time
   std::string timeOffset = getProperty("AbsoluteTimeOffset");
   if (isAbsoluteTimeShift(timeOffset)) {
     DateAndTime desiredTime(timeOffset);
-    DateAndTime originalTime(getStartTimeFromWorkspace(ws));
+    DateAndTime originalTime(getStartTimeFromWorkspace(std::move(ws)));
     timeShift = DateAndTime::secondsFromDuration(desiredTime - originalTime);
   } else {
     timeShift = getProperty("RelativeTimeOffset");
@@ -155,9 +156,9 @@ double ChangeTimeZero::getTimeShift(API::MatrixWorkspace_sptr ws) const {
  * @param startProgress :: start point of the progress
  * @param stopProgress :: end point of the progress
  */
-void ChangeTimeZero::shiftTimeOfLogs(Mantid::API::MatrixWorkspace_sptr ws,
-                                     double timeShift, double startProgress,
-                                     double stopProgress) {
+void ChangeTimeZero::shiftTimeOfLogs(
+    const Mantid::API::MatrixWorkspace_sptr &ws, double timeShift,
+    double startProgress, double stopProgress) {
   // We need to change the entries for each log which can be:
   // 1. any time series: here we change the time values
   // 2. string properties: here we change the values if they are ISO8601 times
@@ -183,7 +184,7 @@ void ChangeTimeZero::shiftTimeOfLogs(Mantid::API::MatrixWorkspace_sptr ws,
  * @param timeShift :: the time shift in seconds
  */
 void ChangeTimeZero::shiftTimeInLogForTimeSeries(
-    Mantid::API::MatrixWorkspace_sptr ws, Mantid::Kernel::Property *prop,
+    const Mantid::API::MatrixWorkspace_sptr &ws, Mantid::Kernel::Property *prop,
     double timeShift) const {
   if (auto timeSeries =
           dynamic_cast<Mantid::Kernel::ITimeSeriesProperty *>(prop)) {
@@ -215,9 +216,9 @@ void ChangeTimeZero::shiftTimeOfLogForStringProperty(
  * @param startProgress :: start point of the progress
  * @param stopProgress :: end point of the progress
  */
-void ChangeTimeZero::shiftTimeOfNeutrons(Mantid::API::MatrixWorkspace_sptr ws,
-                                         double timeShift, double startProgress,
-                                         double stopProgress) {
+void ChangeTimeZero::shiftTimeOfNeutrons(
+    const Mantid::API::MatrixWorkspace_sptr &ws, double timeShift,
+    double startProgress, double stopProgress) {
   if (auto eventWs =
           boost::dynamic_pointer_cast<Mantid::API::IEventWorkspace>(ws)) {
     // Use the change pulse time algorithm to change the neutron time stamp
@@ -236,8 +237,8 @@ void ChangeTimeZero::shiftTimeOfNeutrons(Mantid::API::MatrixWorkspace_sptr ws,
  * @param ws :: a workspace
  * @returns the date and time of the first good frame
  */
-DateAndTime
-ChangeTimeZero::getStartTimeFromWorkspace(API::MatrixWorkspace_sptr ws) const {
+DateAndTime ChangeTimeZero::getStartTimeFromWorkspace(
+    const API::MatrixWorkspace_sptr &ws) const {
   auto run = ws->run();
   // Check for the first good frame in the log
   Mantid::Kernel::TimeSeriesProperty<double> *goodFrame = nullptr;
@@ -317,7 +318,7 @@ std::map<std::string, std::string> ChangeTimeZero::validateInputs() {
  * @param val :: value to check
  * @return True if the string can be cast to double and otherwise false.
  */
-bool ChangeTimeZero::checkForDouble(std::string val) const {
+bool ChangeTimeZero::checkForDouble(const std::string &val) const {
   auto isDouble = false;
   try {
     boost::lexical_cast<double>(val);
diff --git a/Framework/Algorithms/src/CompareWorkspaces.cpp b/Framework/Algorithms/src/CompareWorkspaces.cpp
index abeba3b054a..156043256c1 100644
--- a/Framework/Algorithms/src/CompareWorkspaces.cpp
+++ b/Framework/Algorithms/src/CompareWorkspaces.cpp
@@ -262,8 +262,8 @@ bool CompareWorkspaces::processGroups() {
  * @param groupTwo
  */
 void CompareWorkspaces::processGroups(
-    boost::shared_ptr<const API::WorkspaceGroup> groupOne,
-    boost::shared_ptr<const API::WorkspaceGroup> groupTwo) {
+    const boost::shared_ptr<const API::WorkspaceGroup> &groupOne,
+    const boost::shared_ptr<const API::WorkspaceGroup> &groupTwo) {
 
   // Check their sizes
   const auto totalNum = static_cast<size_t>(groupOne->getNumberOfEntries());
@@ -618,8 +618,8 @@ bool CompareWorkspaces::compareEventWorkspaces(
  *  @retval true The data matches
  *  @retval false The data does not matches
  */
-bool CompareWorkspaces::checkData(API::MatrixWorkspace_const_sptr ws1,
-                                  API::MatrixWorkspace_const_sptr ws2) {
+bool CompareWorkspaces::checkData(const API::MatrixWorkspace_const_sptr &ws1,
+                                  const API::MatrixWorkspace_const_sptr &ws2) {
   // Cache a few things for later use
   const size_t numHists = ws1->getNumberHistograms();
   const size_t numBins = ws1->blocksize();
@@ -712,8 +712,8 @@ bool CompareWorkspaces::checkData(API::MatrixWorkspace_const_sptr ws1,
  * @retval true The axes match
  * @retval false The axes do not match
  */
-bool CompareWorkspaces::checkAxes(API::MatrixWorkspace_const_sptr ws1,
-                                  API::MatrixWorkspace_const_sptr ws2) {
+bool CompareWorkspaces::checkAxes(const API::MatrixWorkspace_const_sptr &ws1,
+                                  const API::MatrixWorkspace_const_sptr &ws2) {
   const int numAxes = ws1->axes();
 
   if (numAxes != ws2->axes()) {
@@ -790,8 +790,8 @@ bool CompareWorkspaces::checkAxes(API::MatrixWorkspace_const_sptr ws1,
 /// @param ws2 :: the second sp det map
 /// @retval true The maps match
 /// @retval false The maps do not match
-bool CompareWorkspaces::checkSpectraMap(MatrixWorkspace_const_sptr ws1,
-                                        MatrixWorkspace_const_sptr ws2) {
+bool CompareWorkspaces::checkSpectraMap(const MatrixWorkspace_const_sptr &ws1,
+                                        const MatrixWorkspace_const_sptr &ws2) {
   if (ws1->getNumberHistograms() != ws2->getNumberHistograms()) {
     recordMismatch("Number of spectra mismatch");
     return false;
@@ -832,8 +832,9 @@ bool CompareWorkspaces::checkSpectraMap(MatrixWorkspace_const_sptr ws1,
 /// @param ws2 :: the second workspace
 /// @retval true The instruments match
 /// @retval false The instruments do not match
-bool CompareWorkspaces::checkInstrument(API::MatrixWorkspace_const_sptr ws1,
-                                        API::MatrixWorkspace_const_sptr ws2) {
+bool CompareWorkspaces::checkInstrument(
+    const API::MatrixWorkspace_const_sptr &ws1,
+    const API::MatrixWorkspace_const_sptr &ws2) {
   // First check the name matches
   if (ws1->getInstrument()->getName() != ws2->getInstrument()->getName()) {
     g_log.debug() << "Instrument names: WS1 = "
@@ -871,8 +872,9 @@ bool CompareWorkspaces::checkInstrument(API::MatrixWorkspace_const_sptr ws1,
 /// @param ws2 :: the second workspace
 /// @retval true The masking matches
 /// @retval false The masking does not match
-bool CompareWorkspaces::checkMasking(API::MatrixWorkspace_const_sptr ws1,
-                                     API::MatrixWorkspace_const_sptr ws2) {
+bool CompareWorkspaces::checkMasking(
+    const API::MatrixWorkspace_const_sptr &ws1,
+    const API::MatrixWorkspace_const_sptr &ws2) {
   const auto numHists = static_cast<int>(ws1->getNumberHistograms());
 
   for (int i = 0; i < numHists; ++i) {
@@ -1111,8 +1113,8 @@ void CompareWorkspaces::doPeaksComparison(PeaksWorkspace_sptr tws1,
 
 //------------------------------------------------------------------------------------------------
 void CompareWorkspaces::doTableComparison(
-    API::ITableWorkspace_const_sptr tws1,
-    API::ITableWorkspace_const_sptr tws2) {
+    const API::ITableWorkspace_const_sptr &tws1,
+    const API::ITableWorkspace_const_sptr &tws2) {
   // First the easy things
   const auto numCols = tws1->columnCount();
   if (numCols != tws2->columnCount()) {
@@ -1177,7 +1179,8 @@ void CompareWorkspaces::doTableComparison(
 }
 
 //------------------------------------------------------------------------------------------------
-void CompareWorkspaces::doMDComparison(Workspace_sptr w1, Workspace_sptr w2) {
+void CompareWorkspaces::doMDComparison(const Workspace_sptr &w1,
+                                       const Workspace_sptr &w2) {
   IMDWorkspace_sptr mdws1, mdws2;
   mdws1 = boost::dynamic_pointer_cast<IMDWorkspace>(w1);
   mdws2 = boost::dynamic_pointer_cast<IMDWorkspace>(w2);
@@ -1204,7 +1207,7 @@ void CompareWorkspaces::doMDComparison(Workspace_sptr w1, Workspace_sptr w2) {
  * @param ws1 Name of first workspace being compared
  * @param ws2 Name of second workspace being compared
  */
-void CompareWorkspaces::recordMismatch(std::string msg, std::string ws1,
+void CompareWorkspaces::recordMismatch(const std::string &msg, std::string ws1,
                                        std::string ws2) {
   // Workspace names default to the workspaces currently being compared
   if (ws1.empty()) {
diff --git a/Framework/Algorithms/src/ConjoinXRuns.cpp b/Framework/Algorithms/src/ConjoinXRuns.cpp
index 6af9ed086e1..0378cc11101 100644
--- a/Framework/Algorithms/src/ConjoinXRuns.cpp
+++ b/Framework/Algorithms/src/ConjoinXRuns.cpp
@@ -198,7 +198,7 @@ std::map<std::string, std::string> ConjoinXRuns::validateInputs() {
  * @return : empty if the log exists, is numeric, and matches the size of the
  * workspace, error message otherwise
  */
-std::string ConjoinXRuns::checkLogEntry(MatrixWorkspace_sptr ws) const {
+std::string ConjoinXRuns::checkLogEntry(const MatrixWorkspace_sptr &ws) const {
   std::string result;
   if (!m_logEntry.empty()) {
 
@@ -250,7 +250,8 @@ std::string ConjoinXRuns::checkLogEntry(MatrixWorkspace_sptr ws) const {
  * @param ws : the input workspace
  * @return : the x-axis to use for the output workspace
  */
-std::vector<double> ConjoinXRuns::getXAxis(MatrixWorkspace_sptr ws) const {
+std::vector<double>
+ConjoinXRuns::getXAxis(const MatrixWorkspace_sptr &ws) const {
 
   std::vector<double> axis;
   axis.reserve(ws->y(0).size());
diff --git a/Framework/Algorithms/src/ConvertDiffCal.cpp b/Framework/Algorithms/src/ConvertDiffCal.cpp
index 988c023d248..a8c0718a3f5 100644
--- a/Framework/Algorithms/src/ConvertDiffCal.cpp
+++ b/Framework/Algorithms/src/ConvertDiffCal.cpp
@@ -69,7 +69,8 @@ void ConvertDiffCal::init() {
  * @param index
  * @return The proper detector id.
  */
-detid_t getDetID(OffsetsWorkspace_const_sptr offsetsWS, const size_t index) {
+detid_t getDetID(const OffsetsWorkspace_const_sptr &offsetsWS,
+                 const size_t index) {
   auto detIDs = offsetsWS->getSpectrum(index).getDetectorIDs();
   if (detIDs.size() != 1) {
     std::stringstream msg;
@@ -86,7 +87,8 @@ detid_t getDetID(OffsetsWorkspace_const_sptr offsetsWS, const size_t index) {
  * @param detid
  * @return The offset value or zero if not specified.
  */
-double getOffset(OffsetsWorkspace_const_sptr offsetsWS, const detid_t detid) {
+double getOffset(const OffsetsWorkspace_const_sptr &offsetsWS,
+                 const detid_t detid) {
   const double offset = offsetsWS->getValue(detid, 0.0);
   if (offset <= -1.) { // non-physical
     std::stringstream msg;
@@ -104,7 +106,8 @@ double getOffset(OffsetsWorkspace_const_sptr offsetsWS, const detid_t detid) {
  * @param spectrumInfo
  * @return The offset adjusted value of DIFC
  */
-double calculateDIFC(OffsetsWorkspace_const_sptr offsetsWS, const size_t index,
+double calculateDIFC(const OffsetsWorkspace_const_sptr &offsetsWS,
+                     const size_t index,
                      const Mantid::API::SpectrumInfo &spectrumInfo) {
   const detid_t detid = getDetID(offsetsWS, index);
   const double offset = getOffset(offsetsWS, detid);
diff --git a/Framework/Algorithms/src/ConvertEmptyToTof.cpp b/Framework/Algorithms/src/ConvertEmptyToTof.cpp
index 2a462a7bd75..70dd3af9bf6 100644
--- a/Framework/Algorithms/src/ConvertEmptyToTof.cpp
+++ b/Framework/Algorithms/src/ConvertEmptyToTof.cpp
@@ -500,7 +500,7 @@ std::vector<double> ConvertEmptyToTof::makeTofAxis(int epp, double epTof,
 }
 
 void ConvertEmptyToTof::setTofInWS(const std::vector<double> &tofAxis,
-                                   API::MatrixWorkspace_sptr outputWS) {
+                                   const API::MatrixWorkspace_sptr &outputWS) {
 
   const size_t numberOfSpectra = m_inputWS->getNumberHistograms();
 
diff --git a/Framework/Algorithms/src/ConvertSpectrumAxis.cpp b/Framework/Algorithms/src/ConvertSpectrumAxis.cpp
index a3d5eda5862..4445fa6829e 100644
--- a/Framework/Algorithms/src/ConvertSpectrumAxis.cpp
+++ b/Framework/Algorithms/src/ConvertSpectrumAxis.cpp
@@ -186,7 +186,7 @@ void ConvertSpectrumAxis::exec() {
 
 double
 ConvertSpectrumAxis::getEfixed(const Mantid::Geometry::IDetector &detector,
-                               MatrixWorkspace_const_sptr inputWS,
+                               const MatrixWorkspace_const_sptr &inputWS,
                                int emode) const {
   double efixed(0);
   double efixedProp = getProperty("Efixed");
diff --git a/Framework/Algorithms/src/ConvertToConstantL2.cpp b/Framework/Algorithms/src/ConvertToConstantL2.cpp
index d49e9e96750..d863ded2822 100644
--- a/Framework/Algorithms/src/ConvertToConstantL2.cpp
+++ b/Framework/Algorithms/src/ConvertToConstantL2.cpp
@@ -141,7 +141,7 @@ void ConvertToConstantL2::exec() {
  * @s - input property name
  *
  */
-double ConvertToConstantL2::getRunProperty(std::string s) {
+double ConvertToConstantL2::getRunProperty(const std::string &s) {
   const auto &run = m_inputWS->run();
   if (!run.hasProperty(s)) {
     throw Exception::NotFoundError("Sample log property not found", s);
@@ -160,7 +160,7 @@ double ConvertToConstantL2::getRunProperty(std::string s) {
  * @s - input property name
  *
  */
-double ConvertToConstantL2::getInstrumentProperty(std::string s) {
+double ConvertToConstantL2::getInstrumentProperty(const std::string &s) {
   std::vector<std::string> prop = m_instrument->getStringParameter(s);
   if (prop.empty()) {
     const std::string mesg = "Property <" + s + "> doesn't exist!";
diff --git a/Framework/Algorithms/src/ConvertUnits.cpp b/Framework/Algorithms/src/ConvertUnits.cpp
index df6cb856adb..fd8d9fbe290 100644
--- a/Framework/Algorithms/src/ConvertUnits.cpp
+++ b/Framework/Algorithms/src/ConvertUnits.cpp
@@ -186,7 +186,7 @@ void ConvertUnits::exec() {
  * @return A pointer to a MatrixWorkspace_sptr that contains the converted units
  */
 MatrixWorkspace_sptr
-ConvertUnits::executeUnitConversion(const API::MatrixWorkspace_sptr inputWS) {
+ConvertUnits::executeUnitConversion(const API::MatrixWorkspace_sptr &inputWS) {
 
   // A WS holding BinEdges cannot have less than 2 values, as a bin has
   // 2 edges, having less than 2 values would mean that the WS contains Points
@@ -251,7 +251,7 @@ ConvertUnits::executeUnitConversion(const API::MatrixWorkspace_sptr inputWS) {
  *  @param inputWS The input workspace
  */
 void ConvertUnits::setupMemberVariables(
-    const API::MatrixWorkspace_const_sptr inputWS) {
+    const API::MatrixWorkspace_const_sptr &inputWS) {
   m_numberOfSpectra = inputWS->getNumberHistograms();
   // In the context of this algorithm, we treat things as a distribution if
   // the flag is set AND the data are not dimensionless
@@ -271,7 +271,7 @@ void ConvertUnits::setupMemberVariables(
  *  @param inputWS The input workspace
  */
 API::MatrixWorkspace_sptr ConvertUnits::setupOutputWorkspace(
-    const API::MatrixWorkspace_const_sptr inputWS) {
+    const API::MatrixWorkspace_const_sptr &inputWS) {
   MatrixWorkspace_sptr outputWS = getProperty("OutputWorkspace");
 
   // If input and output workspaces are NOT the same, create a new workspace
@@ -328,7 +328,7 @@ void ConvertUnits::storeEModeOnWorkspace(API::MatrixWorkspace_sptr outputWS) {
  *  @returns A shared pointer to the output workspace
  */
 MatrixWorkspace_sptr
-ConvertUnits::convertQuickly(API::MatrixWorkspace_const_sptr inputWS,
+ConvertUnits::convertQuickly(const API::MatrixWorkspace_const_sptr &inputWS,
                              const double &factor, const double &power) {
   Progress prog(this, 0.2, 1.0, m_numberOfSpectra);
   auto numberOfSpectra_i =
@@ -603,7 +603,7 @@ ConvertUnits::convertViaTOF(Kernel::Unit_const_sptr fromUnit,
 
 /// Calls Rebin as a Child Algorithm to align the bins
 API::MatrixWorkspace_sptr
-ConvertUnits::alignBins(API::MatrixWorkspace_sptr workspace) {
+ConvertUnits::alignBins(const API::MatrixWorkspace_sptr &workspace) {
   if (communicator().size() != 1)
     throw std::runtime_error(
         "ConvertUnits: Parallel support for aligning bins not implemented.");
@@ -623,7 +623,7 @@ ConvertUnits::alignBins(API::MatrixWorkspace_sptr workspace) {
 /// The Rebin parameters should cover the full range of the converted unit,
 /// with the same number of bins
 const std::vector<double> ConvertUnits::calculateRebinParams(
-    const API::MatrixWorkspace_const_sptr workspace) const {
+    const API::MatrixWorkspace_const_sptr &workspace) const {
   const auto &spectrumInfo = workspace->spectrumInfo();
   // Need to loop round and find the full range
   double XMin = DBL_MAX, XMax = DBL_MIN;
@@ -650,7 +650,7 @@ const std::vector<double> ConvertUnits::calculateRebinParams(
 /** Reverses the workspace if X values are in descending order
  *  @param WS The workspace to operate on
  */
-void ConvertUnits::reverse(API::MatrixWorkspace_sptr WS) {
+void ConvertUnits::reverse(const API::MatrixWorkspace_sptr &WS) {
   EventWorkspace_sptr eventWS = boost::dynamic_pointer_cast<EventWorkspace>(WS);
   auto isInputEvents = static_cast<bool>(eventWS);
   size_t numberOfSpectra = WS->getNumberHistograms();
@@ -700,7 +700,7 @@ void ConvertUnits::reverse(API::MatrixWorkspace_sptr WS) {
  *  @return The workspace after bins have been removed
  */
 API::MatrixWorkspace_sptr ConvertUnits::removeUnphysicalBins(
-    const Mantid::API::MatrixWorkspace_const_sptr workspace) {
+    const Mantid::API::MatrixWorkspace_const_sptr &workspace) {
   MatrixWorkspace_sptr result;
 
   const auto &spectrumInfo = workspace->spectrumInfo();
@@ -786,7 +786,7 @@ API::MatrixWorkspace_sptr ConvertUnits::removeUnphysicalBins(
 /** Divide by the bin width if workspace is a distribution
  *  @param outputWS The workspace to operate on
  */
-void ConvertUnits::putBackBinWidth(const API::MatrixWorkspace_sptr outputWS) {
+void ConvertUnits::putBackBinWidth(const API::MatrixWorkspace_sptr &outputWS) {
   const size_t outSize = outputWS->blocksize();
 
   for (size_t i = 0; i < m_numberOfSpectra; ++i) {
diff --git a/Framework/Algorithms/src/CopyDataRange.cpp b/Framework/Algorithms/src/CopyDataRange.cpp
index f7d36388c84..1697ef5f70d 100644
--- a/Framework/Algorithms/src/CopyDataRange.cpp
+++ b/Framework/Algorithms/src/CopyDataRange.cpp
@@ -11,6 +11,7 @@
 #include "MantidKernel/BoundedValidator.h"
 
 #include <algorithm>
+#include <utility>
 
 using namespace Mantid::API;
 using namespace Mantid::Kernel;
@@ -18,9 +19,9 @@ using namespace Mantid::HistogramData;
 
 namespace {
 
-void copyDataRange(MatrixWorkspace_const_sptr inputWorkspace,
-                   MatrixWorkspace_sptr destWorkspace, int const &specMin,
-                   int const &specMax, int const &xMinIndex,
+void copyDataRange(const MatrixWorkspace_const_sptr &inputWorkspace,
+                   const MatrixWorkspace_sptr &destWorkspace,
+                   int const &specMin, int const &specMax, int const &xMinIndex,
                    int const &xMaxIndex, int yInsertionIndex,
                    int const &xInsertionIndex) {
   for (auto specIndex = specMin; specIndex <= specMax; ++specIndex) {
@@ -36,17 +37,18 @@ void copyDataRange(MatrixWorkspace_const_sptr inputWorkspace,
   }
 }
 
-void copyDataRange(MatrixWorkspace_const_sptr inputWorkspace,
-                   MatrixWorkspace_sptr destWorkspace, int const &specMin,
-                   int const &specMax, double const &xMin, double const &xMax,
-                   int yInsertionIndex, int const &xInsertionIndex) {
+void copyDataRange(const MatrixWorkspace_const_sptr &inputWorkspace,
+                   const MatrixWorkspace_sptr &destWorkspace,
+                   int const &specMin, int const &specMax, double const &xMin,
+                   double const &xMax, int yInsertionIndex,
+                   int const &xInsertionIndex) {
   auto const xMinIndex =
       static_cast<int>(inputWorkspace->yIndexOfX(xMin, 0, 0.000001));
   auto const xMaxIndex =
       static_cast<int>(inputWorkspace->yIndexOfX(xMax, 0, 0.000001));
 
-  copyDataRange(inputWorkspace, destWorkspace, specMin, specMax, xMinIndex,
-                xMaxIndex, yInsertionIndex, xInsertionIndex);
+  copyDataRange(inputWorkspace, std::move(destWorkspace), specMin, specMax,
+                xMinIndex, xMaxIndex, yInsertionIndex, xInsertionIndex);
 }
 
 } // namespace
diff --git a/Framework/Algorithms/src/CorrectKiKf.cpp b/Framework/Algorithms/src/CorrectKiKf.cpp
index 4c7d5f401a2..492a047143a 100644
--- a/Framework/Algorithms/src/CorrectKiKf.cpp
+++ b/Framework/Algorithms/src/CorrectKiKf.cpp
@@ -279,7 +279,7 @@ void CorrectKiKf::execEvent() {
 template <class T>
 void CorrectKiKf::correctKiKfEventHelper(std::vector<T> &wevector,
                                          double efixed,
-                                         const std::string emodeStr) {
+                                         const std::string &emodeStr) {
   double Ei, Ef;
   float kioverkf;
   typename std::vector<T>::iterator it;
diff --git a/Framework/Algorithms/src/CorrectTOFAxis.cpp b/Framework/Algorithms/src/CorrectTOFAxis.cpp
index 804ec046dd0..c6840afcdee 100644
--- a/Framework/Algorithms/src/CorrectTOFAxis.cpp
+++ b/Framework/Algorithms/src/CorrectTOFAxis.cpp
@@ -105,7 +105,7 @@ template <typename Map> size_t mapIndex(const int index, const Map &indexMap) {
  *  @return A workspace index corresponding to index.
  */
 size_t toWorkspaceIndex(const int index, const std::string &indexType,
-                        API::MatrixWorkspace_const_sptr ws) {
+                        const API::MatrixWorkspace_const_sptr &ws) {
   if (indexType == IndexTypes::DETECTOR_ID) {
     const auto indexMap = ws->getDetectorIDToWorkspaceIndexMap();
     return mapIndex(index, indexMap);
@@ -345,7 +345,8 @@ void CorrectTOFAxis::exec() {
  *  corrected workspace.
  *  @param outputWs The corrected workspace
  */
-void CorrectTOFAxis::useReferenceWorkspace(API::MatrixWorkspace_sptr outputWs) {
+void CorrectTOFAxis::useReferenceWorkspace(
+    const API::MatrixWorkspace_sptr &outputWs) {
   const auto histogramCount =
       static_cast<int64_t>(m_referenceWs->getNumberHistograms());
   PARALLEL_FOR_IF(threadSafe(*m_referenceWs, *outputWs))
@@ -377,7 +378,8 @@ void CorrectTOFAxis::useReferenceWorkspace(API::MatrixWorkspace_sptr outputWs) {
  *  specifically, also adjusts the 'Ei' and 'wavelength' sample logs.
  *  @param outputWs The corrected workspace
  */
-void CorrectTOFAxis::correctManually(API::MatrixWorkspace_sptr outputWs) {
+void CorrectTOFAxis::correctManually(
+    const API::MatrixWorkspace_sptr &outputWs) {
   const auto &spectrumInfo = m_inputWs->spectrumInfo();
   const double l1 = spectrumInfo.l1();
   double l2 = 0;
diff --git a/Framework/Algorithms/src/CorrectToFile.cpp b/Framework/Algorithms/src/CorrectToFile.cpp
index a45c30bfadf..8c426ffa0f5 100644
--- a/Framework/Algorithms/src/CorrectToFile.cpp
+++ b/Framework/Algorithms/src/CorrectToFile.cpp
@@ -186,8 +186,8 @@ MatrixWorkspace_sptr CorrectToFile::loadInFile(const std::string &corrFile) {
  *  @throw NotFoundError if requested algorithm requested doesn't exist
  *  @throw runtime_error if algorithm encounters an error
  */
-void CorrectToFile::doWkspAlgebra(API::MatrixWorkspace_sptr lhs,
-                                  API::MatrixWorkspace_sptr rhs,
+void CorrectToFile::doWkspAlgebra(const API::MatrixWorkspace_sptr &lhs,
+                                  const API::MatrixWorkspace_sptr &rhs,
                                   const std::string &algName,
                                   API::MatrixWorkspace_sptr &result) {
   g_log.information() << "Initalising the algorithm " << algName << '\n';
diff --git a/Framework/Algorithms/src/CreateEPP.cpp b/Framework/Algorithms/src/CreateEPP.cpp
index 285b6743a13..0efb5dc3954 100644
--- a/Framework/Algorithms/src/CreateEPP.cpp
+++ b/Framework/Algorithms/src/CreateEPP.cpp
@@ -49,7 +49,7 @@ const static std::string STATUS("FitStatus");
  *
  * @param ws The TableWorkspace to add the columns to.
  */
-void addEPPColumns(API::ITableWorkspace_sptr ws) {
+void addEPPColumns(const API::ITableWorkspace_sptr &ws) {
   ws->addColumn("int", ColumnNames::WS_INDEX);
   ws->addColumn("double", ColumnNames::PEAK_CENTRE);
   ws->addColumn("double", ColumnNames::PEAK_CENTRE_ERR);
diff --git a/Framework/Algorithms/src/CreateFloodWorkspace.cpp b/Framework/Algorithms/src/CreateFloodWorkspace.cpp
index 6d281c5b536..c7099c8ccc6 100644
--- a/Framework/Algorithms/src/CreateFloodWorkspace.cpp
+++ b/Framework/Algorithms/src/CreateFloodWorkspace.cpp
@@ -129,7 +129,8 @@ std::string CreateFloodWorkspace::getBackgroundFunction() {
   return funMap.at(getPropertyValue(Prop::BACKGROUND));
 }
 
-MatrixWorkspace_sptr CreateFloodWorkspace::integrate(MatrixWorkspace_sptr ws) {
+MatrixWorkspace_sptr
+CreateFloodWorkspace::integrate(const MatrixWorkspace_sptr &ws) {
   auto alg = createChildAlgorithm("Integration");
   alg->setProperty("InputWorkspace", ws);
   alg->setProperty("OutputWorkspace", "dummy");
@@ -145,7 +146,8 @@ MatrixWorkspace_sptr CreateFloodWorkspace::integrate(MatrixWorkspace_sptr ws) {
   return alg->getProperty("OutputWorkspace");
 }
 
-MatrixWorkspace_sptr CreateFloodWorkspace::transpose(MatrixWorkspace_sptr ws) {
+MatrixWorkspace_sptr
+CreateFloodWorkspace::transpose(const MatrixWorkspace_sptr &ws) {
   auto alg = createChildAlgorithm("Transpose");
   alg->setProperty("InputWorkspace", ws);
   alg->setProperty("OutputWorkspace", "dummy");
diff --git a/Framework/Algorithms/src/CreateGroupingWorkspace.cpp b/Framework/Algorithms/src/CreateGroupingWorkspace.cpp
index 05cfbd7ce3a..63eea8809ca 100644
--- a/Framework/Algorithms/src/CreateGroupingWorkspace.cpp
+++ b/Framework/Algorithms/src/CreateGroupingWorkspace.cpp
@@ -19,6 +19,7 @@
 #include <boost/algorithm/string/trim.hpp>
 #include <fstream>
 #include <queue>
+#include <utility>
 
 namespace {
 Mantid::Kernel::Logger g_log("CreateGroupingWorkspace");
@@ -207,10 +208,9 @@ std::map<detid_t, int> readGroupingFile(const std::string &groupingFileName,
  * @param prog Progress reporter
  * @returns :: Map of detector IDs to group number
  */
-std::map<detid_t, int> makeGroupingByNumGroups(const std::string compName,
-                                               int numGroups,
-                                               Instrument_const_sptr inst,
-                                               Progress &prog) {
+std::map<detid_t, int>
+makeGroupingByNumGroups(const std::string &compName, int numGroups,
+                        const Instrument_const_sptr &inst, Progress &prog) {
   std::map<detid_t, int> detIDtoGroup;
 
   // Get detectors for given instument component
@@ -250,14 +250,14 @@ std::map<detid_t, int> makeGroupingByNumGroups(const std::string compName,
 
 bool groupnumber(std::string groupi, std::string groupj) {
   int i = 0;
-  std::string groupName = groupi;
+  std::string groupName = std::move(groupi);
   // Take out the "group" part of the group name and convert to an int
   groupName.erase(
       remove_if(groupName.begin(), groupName.end(), std::not_fn(::isdigit)),
       groupName.end());
   Strings::convert(groupName, i);
   int j = 0;
-  groupName = groupj;
+  groupName = std::move(groupj);
   // Take out the "group" part of the group name and convert to an int
   groupName.erase(
       remove_if(groupName.begin(), groupName.end(), std::not_fn(::isdigit)),
@@ -276,7 +276,7 @@ bool groupnumber(std::string groupi, std::string groupj) {
  * @returns:: map of detID to group number
  */
 std::map<detid_t, int> makeGroupingByNames(std::string GroupNames,
-                                           Instrument_const_sptr inst,
+                                           const Instrument_const_sptr &inst,
                                            Progress &prog, bool sortnames) {
   // This will contain the grouping
   std::map<detid_t, int> detIDtoGroup;
diff --git a/Framework/Algorithms/src/CreateLogTimeCorrection.cpp b/Framework/Algorithms/src/CreateLogTimeCorrection.cpp
index 98618d4b31c..9eed0c6079e 100644
--- a/Framework/Algorithms/src/CreateLogTimeCorrection.cpp
+++ b/Framework/Algorithms/src/CreateLogTimeCorrection.cpp
@@ -149,7 +149,7 @@ TableWorkspace_sptr CreateLogTimeCorrection::generateCorrectionTable(
 /** Write correction map to a text file
  */
 void CreateLogTimeCorrection::writeCorrectionToFile(
-    const string filename, const Geometry::DetectorInfo &detectorInfo,
+    const string &filename, const Geometry::DetectorInfo &detectorInfo,
     const std::vector<double> &corrections) const {
   ofstream ofile;
   ofile.open(filename.c_str());
diff --git a/Framework/Algorithms/src/CreatePSDBleedMask.cpp b/Framework/Algorithms/src/CreatePSDBleedMask.cpp
index 66f62ba851f..8b1aba621f7 100644
--- a/Framework/Algorithms/src/CreatePSDBleedMask.cpp
+++ b/Framework/Algorithms/src/CreatePSDBleedMask.cpp
@@ -201,7 +201,7 @@ void CreatePSDBleedMask::exec() {
  */
 bool CreatePSDBleedMask::performBleedTest(
     const std::vector<int> &tubeIndices,
-    API::MatrixWorkspace_const_sptr inputWS, double maxRate,
+    const API::MatrixWorkspace_const_sptr &inputWS, double maxRate,
     int numIgnoredPixels) {
 
   // Require ordered pixels so that we can define the centre.
@@ -263,7 +263,7 @@ bool CreatePSDBleedMask::performBleedTest(
  * @param workspace :: The workspace to accumulate the masking
  */
 void CreatePSDBleedMask::maskTube(const std::vector<int> &tubeIndices,
-                                  API::MatrixWorkspace_sptr workspace) {
+                                  const API::MatrixWorkspace_sptr &workspace) {
   const double deadValue(1.0); // delete the data
   for (auto tubeIndice : tubeIndices) {
     workspace->mutableY(tubeIndice)[0] = deadValue;
diff --git a/Framework/Algorithms/src/CreateSampleWorkspace.cpp b/Framework/Algorithms/src/CreateSampleWorkspace.cpp
index 42352e54ace..300a2842a67 100644
--- a/Framework/Algorithms/src/CreateSampleWorkspace.cpp
+++ b/Framework/Algorithms/src/CreateSampleWorkspace.cpp
@@ -309,7 +309,7 @@ void CreateSampleWorkspace::addChopperParameters(
  */
 MatrixWorkspace_sptr CreateSampleWorkspace::createHistogramWorkspace(
     int numPixels, int numBins, int numMonitors, double x0, double binDelta,
-    Geometry::Instrument_sptr inst, const std::string &functionString,
+    const Geometry::Instrument_sptr &inst, const std::string &functionString,
     bool isRandom) {
   BinEdges x(numBins + 1, LinearGenerator(x0, binDelta));
 
@@ -330,8 +330,9 @@ MatrixWorkspace_sptr CreateSampleWorkspace::createHistogramWorkspace(
 /** Create scanning histogram workspace
  */
 MatrixWorkspace_sptr CreateSampleWorkspace::createScanningWorkspace(
-    int numBins, double x0, double binDelta, Geometry::Instrument_sptr inst,
-    const std::string &functionString, bool isRandom, int numScanPoints) {
+    int numBins, double x0, double binDelta,
+    const Geometry::Instrument_sptr &inst, const std::string &functionString,
+    bool isRandom, int numScanPoints) {
   auto builder = ScanningWorkspaceBuilder(inst, numScanPoints, numBins);
 
   auto angles = std::vector<double>();
@@ -359,7 +360,7 @@ MatrixWorkspace_sptr CreateSampleWorkspace::createScanningWorkspace(
  */
 EventWorkspace_sptr CreateSampleWorkspace::createEventWorkspace(
     int numPixels, int numBins, int numMonitors, int numEvents, double x0,
-    double binDelta, Geometry::Instrument_sptr inst,
+    double binDelta, const Geometry::Instrument_sptr &inst,
     const std::string &functionString, bool isRandom) {
   DateAndTime run_start("2010-01-01T00:00:00");
 
diff --git a/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp b/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp
index 1a51af9c5f5..a4332c2603f 100644
--- a/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp
+++ b/Framework/Algorithms/src/CreateTransmissionWorkspace.cpp
@@ -4,8 +4,10 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidAlgorithms/CreateTransmissionWorkspace.h"
+#include <utility>
+
 #include "MantidAPI/BoostOptionalToAlgorithmProperty.h"
+#include "MantidAlgorithms/CreateTransmissionWorkspace.h"
 
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
@@ -154,7 +156,7 @@ MatrixWorkspace_sptr CreateTransmissionWorkspace::makeTransmissionCorrection(
     const OptionalMinMax &wavelengthMonitorBackgroundInterval,
     const OptionalMinMax &wavelengthMonitorIntegrationInterval,
     const OptionalInteger &i0MonitorIndex,
-    MatrixWorkspace_sptr firstTransmissionRun,
+    const MatrixWorkspace_sptr &firstTransmissionRun,
     OptionalMatrixWorkspace_sptr secondTransmissionRun,
     const OptionalDouble &stitchingStart, const OptionalDouble &stitchingDelta,
     const OptionalDouble &stitchingEnd,
@@ -163,7 +165,7 @@ MatrixWorkspace_sptr CreateTransmissionWorkspace::makeTransmissionCorrection(
   /*make struct of optional inputs to refactor method arguments*/
   /*make a using statements defining OptionalInteger for MonitorIndex*/
   auto trans1InLam =
-      toLam(firstTransmissionRun, processingCommands, i0MonitorIndex,
+      toLam(std::move(firstTransmissionRun), processingCommands, i0MonitorIndex,
             wavelengthInterval, wavelengthMonitorBackgroundInterval);
   MatrixWorkspace_sptr trans1Detector = trans1InLam.get<0>();
   MatrixWorkspace_sptr trans1Monitor = trans1InLam.get<1>();
diff --git a/Framework/Algorithms/src/CreateTransmissionWorkspace2.cpp b/Framework/Algorithms/src/CreateTransmissionWorkspace2.cpp
index 5010dbffc41..bf6b018ee13 100644
--- a/Framework/Algorithms/src/CreateTransmissionWorkspace2.cpp
+++ b/Framework/Algorithms/src/CreateTransmissionWorkspace2.cpp
@@ -183,7 +183,7 @@ void CreateTransmissionWorkspace2::exec() {
  * @return :: the normalized workspace in Wavelength
  */
 MatrixWorkspace_sptr CreateTransmissionWorkspace2::normalizeDetectorsByMonitors(
-    const MatrixWorkspace_sptr IvsTOF) {
+    const MatrixWorkspace_sptr &IvsTOF) {
 
   // Detector workspace
   MatrixWorkspace_sptr detectorWS = makeDetectorWS(IvsTOF);
@@ -249,7 +249,7 @@ CreateTransmissionWorkspace2::getRunNumber(std::string const &propertyName) {
  * @param ws A workspace to store.
  */
 void CreateTransmissionWorkspace2::setOutputTransmissionRun(
-    int which, MatrixWorkspace_sptr ws) {
+    int which, const MatrixWorkspace_sptr &ws) {
   bool const isDebug = getProperty("Debug");
   if (!isDebug)
     return;
@@ -291,7 +291,7 @@ void CreateTransmissionWorkspace2::setOutputTransmissionRun(
  * be found
  */
 void CreateTransmissionWorkspace2::setOutputWorkspace(
-    API::MatrixWorkspace_sptr ws) {
+    const API::MatrixWorkspace_sptr &ws) {
   // If the user provided an output name, just set the value
   if (!isDefault("OutputWorkspace")) {
     setProperty("OutputWorkspace", ws);
diff --git a/Framework/Algorithms/src/CreateTransmissionWorkspaceAuto.cpp b/Framework/Algorithms/src/CreateTransmissionWorkspaceAuto.cpp
index 8ada727d004..132efa67800 100644
--- a/Framework/Algorithms/src/CreateTransmissionWorkspaceAuto.cpp
+++ b/Framework/Algorithms/src/CreateTransmissionWorkspaceAuto.cpp
@@ -240,7 +240,7 @@ void CreateTransmissionWorkspaceAuto::exec() {
 
 template <typename T>
 boost::optional<T>
-CreateTransmissionWorkspaceAuto::isSet(std::string propName) const {
+CreateTransmissionWorkspaceAuto::isSet(const std::string &propName) const {
   auto algProperty = this->getPointerToProperty(propName);
   if (algProperty->isDefault()) {
     return boost::optional<T>();
diff --git a/Framework/Algorithms/src/DetectorDiagnostic.cpp b/Framework/Algorithms/src/DetectorDiagnostic.cpp
index e46cd0743ce..816779e650d 100644
--- a/Framework/Algorithms/src/DetectorDiagnostic.cpp
+++ b/Framework/Algorithms/src/DetectorDiagnostic.cpp
@@ -376,8 +376,8 @@ void DetectorDiagnostic::exec() {
  * @param inputWS : the workspace to mask
  * @param maskWS : the workspace containing the masking information
  */
-void DetectorDiagnostic::applyMask(API::MatrixWorkspace_sptr inputWS,
-                                   API::MatrixWorkspace_sptr maskWS) {
+void DetectorDiagnostic::applyMask(const API::MatrixWorkspace_sptr &inputWS,
+                                   const API::MatrixWorkspace_sptr &maskWS) {
   IAlgorithm_sptr maskAlg =
       createChildAlgorithm("MaskDetectors"); // should set progress bar
   maskAlg->setProperty("Workspace", inputWS);
@@ -394,7 +394,7 @@ void DetectorDiagnostic::applyMask(API::MatrixWorkspace_sptr inputWS,
  * @return : the resulting mask from the checks
  */
 API::MatrixWorkspace_sptr
-DetectorDiagnostic::doDetVanTest(API::MatrixWorkspace_sptr inputWS,
+DetectorDiagnostic::doDetVanTest(const API::MatrixWorkspace_sptr &inputWS,
                                  int &nFails) {
   MatrixWorkspace_sptr localMask;
 
@@ -483,7 +483,7 @@ DetectorDiagnostic::DetectorDiagnostic()
  * @returns A workspace containing the integrated counts
  */
 MatrixWorkspace_sptr DetectorDiagnostic::integrateSpectra(
-    MatrixWorkspace_sptr inputWS, const int indexMin, const int indexMax,
+    const MatrixWorkspace_sptr &inputWS, const int indexMin, const int indexMax,
     const double lower, const double upper, const bool outputWorkspace2D) {
   g_log.debug() << "Integrating input spectra.\n";
   // If the input spectra only has one bin, assume it has been integrated
@@ -525,8 +525,8 @@ MatrixWorkspace_sptr DetectorDiagnostic::integrateSpectra(
  * @param inputWS The workspace to initialize from. The instrument is copied
  *from this.
  */
-DataObjects::MaskWorkspace_sptr
-DetectorDiagnostic::generateEmptyMask(API::MatrixWorkspace_const_sptr inputWS) {
+DataObjects::MaskWorkspace_sptr DetectorDiagnostic::generateEmptyMask(
+    const API::MatrixWorkspace_const_sptr &inputWS) {
   // Create a new workspace for the results, copy from the input to ensure that
   // we copy over the instrument and current masking
   auto maskWS =
@@ -547,7 +547,7 @@ DetectorDiagnostic::makeInstrumentMap(const API::MatrixWorkspace &countsWS) {
  *
  */
 std::vector<std::vector<size_t>>
-DetectorDiagnostic::makeMap(API::MatrixWorkspace_sptr countsWS) {
+DetectorDiagnostic::makeMap(const API::MatrixWorkspace_sptr &countsWS) {
   std::multimap<Mantid::Geometry::ComponentID, size_t> mymap;
 
   Geometry::Instrument_const_sptr instrument = countsWS->getInstrument();
diff --git a/Framework/Algorithms/src/DetectorEfficiencyVariation.cpp b/Framework/Algorithms/src/DetectorEfficiencyVariation.cpp
index 6192db26833..cba50b3442b 100644
--- a/Framework/Algorithms/src/DetectorEfficiencyVariation.cpp
+++ b/Framework/Algorithms/src/DetectorEfficiencyVariation.cpp
@@ -187,8 +187,8 @@ void DetectorEfficiencyVariation::retrieveProperties(
  * @return number of detectors for which tests failed
  */
 int DetectorEfficiencyVariation::doDetectorTests(
-    API::MatrixWorkspace_const_sptr counts1,
-    API::MatrixWorkspace_const_sptr counts2, const double average,
+    const API::MatrixWorkspace_const_sptr &counts1,
+    const API::MatrixWorkspace_const_sptr &counts2, const double average,
     double variation) {
   // DIAG in libISIS did this.  A variation of less than 1 doesn't make sense in
   // this algorithm
diff --git a/Framework/Algorithms/src/DiffractionEventCalibrateDetectors.cpp b/Framework/Algorithms/src/DiffractionEventCalibrateDetectors.cpp
index be8054b8933..de4557eec62 100644
--- a/Framework/Algorithms/src/DiffractionEventCalibrateDetectors.cpp
+++ b/Framework/Algorithms/src/DiffractionEventCalibrateDetectors.cpp
@@ -84,7 +84,7 @@ static double gsl_costFunction(const gsl_vector *v, void *params) {
 
 void DiffractionEventCalibrateDetectors::movedetector(
     double x, double y, double z, double rotx, double roty, double rotz,
-    std::string detname, EventWorkspace_sptr inputW) {
+    const std::string &detname, const EventWorkspace_sptr &inputW) {
 
   IAlgorithm_sptr alg1 = createChildAlgorithm("MoveInstrumentComponent");
   alg1->setProperty<EventWorkspace_sptr>("Workspace", inputW);
@@ -145,8 +145,9 @@ void DiffractionEventCalibrateDetectors::movedetector(
 
 double DiffractionEventCalibrateDetectors::intensity(
     double x, double y, double z, double rotx, double roty, double rotz,
-    std::string detname, std::string inname, std::string outname,
-    std::string peakOpt, std::string rb_param, std::string groupWSName) {
+    const std::string &detname, const std::string &inname,
+    const std::string &outname, const std::string &peakOpt,
+    const std::string &rb_param, const std::string &groupWSName) {
 
   EventWorkspace_sptr inputW = boost::dynamic_pointer_cast<EventWorkspace>(
       AnalysisDataService::Instance().retrieve(inname));
diff --git a/Framework/Algorithms/src/DiffractionFocussing.cpp b/Framework/Algorithms/src/DiffractionFocussing.cpp
index 7afe73b2de8..94c575cc38c 100644
--- a/Framework/Algorithms/src/DiffractionFocussing.cpp
+++ b/Framework/Algorithms/src/DiffractionFocussing.cpp
@@ -241,7 +241,7 @@ void DiffractionFocussing::calculateRebinParams(
  * @throws FileError if can't read the file
  */
 std::multimap<int64_t, int64_t>
-DiffractionFocussing::readGroupingFile(std::string groupingFileName) {
+DiffractionFocussing::readGroupingFile(const std::string &groupingFileName) {
   std::ifstream grFile(groupingFileName.c_str());
   if (!grFile) {
     g_log.error() << "Unable to open grouping file " << groupingFileName
diff --git a/Framework/Algorithms/src/EQSANSTofStructure.cpp b/Framework/Algorithms/src/EQSANSTofStructure.cpp
index 4f03cdac926..b7c89f3708e 100644
--- a/Framework/Algorithms/src/EQSANSTofStructure.cpp
+++ b/Framework/Algorithms/src/EQSANSTofStructure.cpp
@@ -118,7 +118,7 @@ void EQSANSTofStructure::exec() {
 }
 
 void EQSANSTofStructure::execEvent(
-    Mantid::DataObjects::EventWorkspace_sptr inputWS, double threshold,
+    const Mantid::DataObjects::EventWorkspace_sptr &inputWS, double threshold,
     double frame_offset, double tof_frame_width, double tmp_frame_width,
     bool frame_skipping) {
   const size_t numHists = inputWS->getNumberHistograms();
@@ -190,8 +190,9 @@ void EQSANSTofStructure::execEvent(
   PARALLEL_CHECK_INTERUPT_REGION
 }
 
-double EQSANSTofStructure::getTofOffset(EventWorkspace_const_sptr inputWS,
-                                        bool frame_skipping) {
+double
+EQSANSTofStructure::getTofOffset(const EventWorkspace_const_sptr &inputWS,
+                                 bool frame_skipping) {
   //# Storage for chopper information read from the logs
   double chopper_set_phase[4] = {0, 0, 0, 0};
   double chopper_speed[4] = {0, 0, 0, 0};
diff --git a/Framework/Algorithms/src/ExportTimeSeriesLog.cpp b/Framework/Algorithms/src/ExportTimeSeriesLog.cpp
index 7efca9a462b..8b373182922 100644
--- a/Framework/Algorithms/src/ExportTimeSeriesLog.cpp
+++ b/Framework/Algorithms/src/ExportTimeSeriesLog.cpp
@@ -131,7 +131,7 @@ void ExportTimeSeriesLog::exec() {
  * @param cal_first_deriv :: flag to calcualte the first derivative
  */
 void ExportTimeSeriesLog::exportLog(const std::string &logname,
-                                    const std::string timeunit,
+                                    const std::string &timeunit,
                                     const double &starttime,
                                     const double &stoptime,
                                     const bool exportepoch, bool outputeventws,
diff --git a/Framework/Algorithms/src/ExtractMaskToTable.cpp b/Framework/Algorithms/src/ExtractMaskToTable.cpp
index 112ea04cd6b..d3fbe14f280 100644
--- a/Framework/Algorithms/src/ExtractMaskToTable.cpp
+++ b/Framework/Algorithms/src/ExtractMaskToTable.cpp
@@ -124,7 +124,7 @@ void ExtractMaskToTable::exec() {
  * @returns :: vector of detector IDs that are masked
  */
 std::vector<detid_t> ExtractMaskToTable::parseMaskTable(
-    DataObjects::TableWorkspace_sptr masktablews) {
+    const DataObjects::TableWorkspace_sptr &masktablews) {
   // Output vector
   std::vector<detid_t> maskeddetectorids;
 
@@ -174,7 +174,7 @@ std::vector<detid_t> ExtractMaskToTable::parseMaskTable(
  * @returns :: vector genrated from input string containing the list
  */
 std::vector<detid_t>
-ExtractMaskToTable::parseStringToVector(std::string liststr) {
+ExtractMaskToTable::parseStringToVector(const std::string &liststr) {
   std::vector<detid_t> detidvec;
 
   // Use ArrayProperty to parse the list
@@ -264,7 +264,7 @@ std::vector<detid_t> ExtractMaskToTable::extractMaskFromMaskWorkspace() {
  * @param targetWS :: table workspace to which the content is copied;
  */
 void ExtractMaskToTable::copyTableWorkspaceContent(
-    TableWorkspace_sptr sourceWS, TableWorkspace_sptr targetWS) {
+    const TableWorkspace_sptr &sourceWS, const TableWorkspace_sptr &targetWS) {
   // Compare the column names.  They must be exactly the same
   vector<string> sourcecolnames = sourceWS->getColumnNames();
   vector<string> targetcolnames = targetWS->getColumnNames();
@@ -310,7 +310,7 @@ void ExtractMaskToTable::copyTableWorkspaceContent(
  * @param xmax :: maximum x
  * @param prevmaskedids :: vector of previous masked detector IDs
  */
-void ExtractMaskToTable::addToTableWorkspace(TableWorkspace_sptr outws,
+void ExtractMaskToTable::addToTableWorkspace(const TableWorkspace_sptr &outws,
                                              vector<detid_t> maskeddetids,
                                              double xmin, double xmax,
                                              vector<detid_t> prevmaskedids) {
diff --git a/Framework/Algorithms/src/FindPeaks.cpp b/Framework/Algorithms/src/FindPeaks.cpp
index 726c8055ad6..f3e74145050 100644
--- a/Framework/Algorithms/src/FindPeaks.cpp
+++ b/Framework/Algorithms/src/FindPeaks.cpp
@@ -1508,8 +1508,8 @@ void FindPeaks::createFunctions() {
  */
 double
 FindPeaks::callFitPeak(const MatrixWorkspace_sptr &dataws, int wsindex,
-                       const API::IPeakFunction_sptr peakfunction,
-                       const API::IBackgroundFunction_sptr backgroundfunction,
+                       const API::IPeakFunction_sptr &peakfunction,
+                       const API::IBackgroundFunction_sptr &backgroundfunction,
                        const std::vector<double> &vec_fitwindow,
                        const std::vector<double> &vec_peakrange,
                        int minGuessFWHM, int maxGuessFWHM, int guessedFWHMStep,
diff --git a/Framework/Algorithms/src/FitPeak.cpp b/Framework/Algorithms/src/FitPeak.cpp
index 7710091f923..98a8764daf5 100644
--- a/Framework/Algorithms/src/FitPeak.cpp
+++ b/Framework/Algorithms/src/FitPeak.cpp
@@ -7,7 +7,8 @@
 //----------------------------------------------------------------------
 // Includes
 //----------------------------------------------------------------------
-#include "MantidAlgorithms/FitPeak.h"
+#include <utility>
+
 #include "MantidAPI/CompositeFunction.h"
 #include "MantidAPI/CostFunctionFactory.h"
 #include "MantidAPI/FuncMinimizerFactory.h"
@@ -17,6 +18,7 @@
 #include "MantidAPI/MultiDomainFunction.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidAPI/WorkspaceProperty.h"
+#include "MantidAlgorithms/FitPeak.h"
 #include "MantidDataObjects/TableWorkspace.h"
 #include "MantidDataObjects/Workspace2D.h"
 #include "MantidDataObjects/WorkspaceCreation.h"
@@ -62,7 +64,7 @@ FitOneSinglePeak::FitOneSinglePeak()
 //----------------------------------------------------------------------------------------------
 /** Set workspaces
  */
-void FitOneSinglePeak::setWorskpace(API::MatrixWorkspace_sptr dataws,
+void FitOneSinglePeak::setWorskpace(const API::MatrixWorkspace_sptr &dataws,
                                     size_t wsindex) {
   if (dataws) {
     m_dataWS = dataws;
@@ -80,8 +82,8 @@ void FitOneSinglePeak::setWorskpace(API::MatrixWorkspace_sptr dataws,
 //----------------------------------------------------------------------------------------------
 /** Set peaks
  */
-void FitOneSinglePeak::setFunctions(IPeakFunction_sptr peakfunc,
-                                    IBackgroundFunction_sptr bkgdfunc) {
+void FitOneSinglePeak::setFunctions(const IPeakFunction_sptr &peakfunc,
+                                    const IBackgroundFunction_sptr &bkgdfunc) {
   if (peakfunc)
     m_peakFunc = peakfunc;
 
@@ -129,8 +131,8 @@ void FitOneSinglePeak::setPeakRange(double xpeakleft, double xpeakright) {
  * @param costfunction :: string of the name of the cost function
  */
 void FitOneSinglePeak::setFittingMethod(std::string minimizer,
-                                        std::string costfunction) {
-  m_minimizer = minimizer;
+                                        const std::string &costfunction) {
+  m_minimizer = std::move(minimizer);
   if (costfunction == "Chi-Square") {
     m_costFunction = "Least squares";
   } else if (costfunction == "Rwp") {
@@ -387,8 +389,9 @@ API::MatrixWorkspace_sptr FitOneSinglePeak::genFitWindowWS() {
 /** Estimate the peak height from a set of data containing pure peaks
  */
 double FitOneSinglePeak::estimatePeakHeight(
-    API::IPeakFunction_const_sptr peakfunc, MatrixWorkspace_sptr dataws,
-    size_t wsindex, size_t ixmin, size_t ixmax) {
+    const API::IPeakFunction_const_sptr &peakfunc,
+    const MatrixWorkspace_sptr &dataws, size_t wsindex, size_t ixmin,
+    size_t ixmax) {
   // Get current peak height: from current peak centre (previously setup)
   double peakcentre = peakfunc->centre();
   vector<double> svvec(1, peakcentre);
@@ -424,7 +427,8 @@ double FitOneSinglePeak::estimatePeakHeight(
 /** Make a pure peak WS in the fit window region from m_background_function
  * @param purePeakWS :: workspace containing pure peak (w/ background removed)
  */
-void FitOneSinglePeak::removeBackground(MatrixWorkspace_sptr purePeakWS) {
+void FitOneSinglePeak::removeBackground(
+    const MatrixWorkspace_sptr &purePeakWS) {
   // Calculate background
   // FIXME - This can be costly to use FunctionDomain and FunctionValue
   auto &vecX = purePeakWS->x(0);
@@ -449,10 +453,10 @@ void FitOneSinglePeak::removeBackground(MatrixWorkspace_sptr purePeakWS) {
  * some fit with unphysical result.
  * @return :: chi-square/Rwp
  */
-double FitOneSinglePeak::fitPeakFunction(API::IPeakFunction_sptr peakfunc,
-                                         MatrixWorkspace_sptr dataws,
-                                         size_t wsindex, double startx,
-                                         double endx) {
+double
+FitOneSinglePeak::fitPeakFunction(const API::IPeakFunction_sptr &peakfunc,
+                                  const MatrixWorkspace_sptr &dataws,
+                                  size_t wsindex, double startx, double endx) {
   // Check validity and debug output
   if (!peakfunc)
     throw std::runtime_error(
@@ -461,7 +465,8 @@ double FitOneSinglePeak::fitPeakFunction(API::IPeakFunction_sptr peakfunc,
   m_sstream << "Function (to fit): " << peakfunc->asString() << "  From "
             << startx << "  to " << endx << ".\n";
 
-  double goodness = fitFunctionSD(peakfunc, dataws, wsindex, startx, endx);
+  double goodness =
+      fitFunctionSD(peakfunc, std::move(dataws), wsindex, startx, endx);
 
   return goodness;
 }
@@ -574,7 +579,7 @@ void FitOneSinglePeak::highBkgdFit() {
  * @returns :: map to store function parameter's names and value
  */
 std::map<std::string, double>
-FitOneSinglePeak::backup(IFunction_const_sptr func) {
+FitOneSinglePeak::backup(const IFunction_const_sptr &func) {
   std::map<std::string, double> funcparammap;
 
   // Set up
@@ -614,7 +619,7 @@ FitOneSinglePeak::storeFunctionError(const IFunction_const_sptr &func) {
 /** Restore the parameters value to a function from a string/double map
  */
 void FitOneSinglePeak::pop(const std::map<std::string, double> &funcparammap,
-                           API::IFunction_sptr func) {
+                           const API::IFunction_sptr &func) {
   std::map<std::string, double>::const_iterator miter;
   for (miter = funcparammap.begin(); miter != funcparammap.end(); ++miter) {
     string parname = miter->first;
@@ -633,8 +638,8 @@ void FitOneSinglePeak::pop(const std::map<std::string, double> &funcparammap,
  * @param xmax
  * @return
  */
-double FitOneSinglePeak::calChiSquareSD(IFunction_sptr fitfunc,
-                                        MatrixWorkspace_sptr dataws,
+double FitOneSinglePeak::calChiSquareSD(const IFunction_sptr &fitfunc,
+                                        const MatrixWorkspace_sptr &dataws,
                                         size_t wsindex, double xmin,
                                         double xmax) {
   // Set up sub algorithm fit
@@ -675,7 +680,7 @@ double FitOneSinglePeak::calChiSquareSD(IFunction_sptr fitfunc,
  * return DBL_MAX
  */
 double FitOneSinglePeak::fitFunctionSD(IFunction_sptr fitfunc,
-                                       MatrixWorkspace_sptr dataws,
+                                       const MatrixWorkspace_sptr &dataws,
                                        size_t wsindex, double xmin,
                                        double xmax) {
   // Set up sub algorithm fit
@@ -733,8 +738,8 @@ double FitOneSinglePeak::fitFunctionSD(IFunction_sptr fitfunc,
  * @param vec_xmin :: minimin values of domains
  * @param vec_xmax :: maximim values of domains
  */
-double FitOneSinglePeak::fitFunctionMD(IFunction_sptr fitfunc,
-                                       MatrixWorkspace_sptr dataws,
+double FitOneSinglePeak::fitFunctionMD(const IFunction_sptr &fitfunc,
+                                       const MatrixWorkspace_sptr &dataws,
                                        size_t wsindex, vector<double> vec_xmin,
                                        vector<double> vec_xmax) {
   // Validate
@@ -823,8 +828,9 @@ double FitOneSinglePeak::fitFunctionMD(IFunction_sptr fitfunc,
  * @return :: Rwp/chi2
  */
 double FitOneSinglePeak::fitCompositeFunction(
-    API::IPeakFunction_sptr peakfunc, API::IBackgroundFunction_sptr bkgdfunc,
-    API::MatrixWorkspace_sptr dataws, size_t wsindex, double startx,
+    const API::IPeakFunction_sptr &peakfunc,
+    const API::IBackgroundFunction_sptr &bkgdfunc,
+    const API::MatrixWorkspace_sptr &dataws, size_t wsindex, double startx,
     double endx) {
   // Construct composit function
   boost::shared_ptr<CompositeFunction> compfunc =
@@ -883,7 +889,7 @@ double FitOneSinglePeak::fitCompositeFunction(
 /** Check the fitted peak value to see whether it is valid
  * @return :: Rwp/chi2
  */
-double FitOneSinglePeak::checkFittedPeak(IPeakFunction_sptr peakfunc,
+double FitOneSinglePeak::checkFittedPeak(const IPeakFunction_sptr &peakfunc,
                                          double costfuncvalue,
                                          std::string &errorreason) {
   if (costfuncvalue < DBL_MAX) {
@@ -1234,7 +1240,7 @@ void FitPeak::exec() {
 /** Add function's parameter names after peak function name
  */
 std::vector<std::string>
-FitPeak::addFunctionParameterNames(std::vector<std::string> funcnames) {
+FitPeak::addFunctionParameterNames(const std::vector<std::string> &funcnames) {
   vector<string> vec_funcparnames;
 
   for (auto &funcname : funcnames) {
@@ -1599,9 +1605,11 @@ size_t getIndex(const HistogramX &vecx, double x) {
 //----------------------------------------------------------------------------------------------
 /** Generate table workspace
  */
-TableWorkspace_sptr FitPeak::genOutputTableWS(
-    IPeakFunction_sptr peakfunc, map<string, double> peakerrormap,
-    IBackgroundFunction_sptr bkgdfunc, map<string, double> bkgderrormap) {
+TableWorkspace_sptr
+FitPeak::genOutputTableWS(const IPeakFunction_sptr &peakfunc,
+                          map<string, double> peakerrormap,
+                          const IBackgroundFunction_sptr &bkgdfunc,
+                          map<string, double> bkgderrormap) {
   // Empty table
   TableWorkspace_sptr outtablews = boost::make_shared<TableWorkspace>();
   outtablews->addColumn("str", "Name");
diff --git a/Framework/Algorithms/src/FitPeaks.cpp b/Framework/Algorithms/src/FitPeaks.cpp
index 3db4f98a3d2..c1d1fce0154 100644
--- a/Framework/Algorithms/src/FitPeaks.cpp
+++ b/Framework/Algorithms/src/FitPeaks.cpp
@@ -34,6 +34,7 @@
 #include "boost/algorithm/string.hpp"
 #include "boost/algorithm/string/trim.hpp"
 #include <limits>
+#include <utility>
 
 using namespace Mantid;
 using namespace Mantid::API;
@@ -148,7 +149,7 @@ double PeakFitResult::getCost(size_t ipeak) const { return m_costs[ipeak]; }
 /// set the peak fitting record/parameter for one peak
 void PeakFitResult::setRecord(size_t ipeak, const double cost,
                               const double peak_position,
-                              const FitFunction fit_functions) {
+                              const FitFunction &fit_functions) {
   // check input
   if (ipeak >= m_costs.size())
     throw std::runtime_error("Peak index is out of range.");
@@ -1026,7 +1027,7 @@ double numberCounts(const Histogram &histogram, const double xmin,
  */
 void FitPeaks::fitSpectrumPeaks(
     size_t wi, const std::vector<double> &expected_peak_centers,
-    boost::shared_ptr<FitPeaksAlgorithm::PeakFitResult> fit_result) {
+    const boost::shared_ptr<FitPeaksAlgorithm::PeakFitResult> &fit_result) {
   if (numberCounts(m_inputMatrixWS->histogram(wi)) <= m_minPeakHeight) {
     for (size_t i = 0; i < fit_result->getNumberPeaks(); ++i)
       fit_result->setBadRecord(i, -1.);
@@ -1131,7 +1132,8 @@ void FitPeaks::fitSpectrumPeaks(
  * @return :: flag whether the peak width shall be observed
  */
 bool FitPeaks::decideToEstimatePeakParams(
-    const bool firstPeakInSpectrum, API::IPeakFunction_sptr peak_function) {
+    const bool firstPeakInSpectrum,
+    const API::IPeakFunction_sptr &peak_function) {
   // should observe the peak width if the user didn't supply all of the peak
   // function parameters
   bool observe_peak_shape(m_initParamIndexes.size() !=
@@ -1173,8 +1175,8 @@ bool FitPeaks::decideToEstimatePeakParams(
 void FitPeaks::processSinglePeakFitResult(
     size_t wsindex, size_t peakindex, const double cost,
     const std::vector<double> &expected_peak_positions,
-    FitPeaksAlgorithm::FitFunction fitfunction,
-    boost::shared_ptr<FitPeaksAlgorithm::PeakFitResult> fit_result) {
+    const FitPeaksAlgorithm::FitFunction &fitfunction,
+    const boost::shared_ptr<FitPeaksAlgorithm::PeakFitResult> &fit_result) {
   // determine peak position tolerance
   double postol(DBL_MAX);
   bool case23(false);
@@ -1403,9 +1405,9 @@ vector<double> calculateMomentsAboutMean(const Histogram &histogram,
  * First, algorithm FindPeakBackground will be tried;
  * If it fails, then a linear background estimator will be called.
  */
-void FitPeaks::estimateBackground(const Histogram &histogram,
-                                  const std::pair<double, double> &peak_window,
-                                  API::IBackgroundFunction_sptr bkgd_function) {
+void FitPeaks::estimateBackground(
+    const Histogram &histogram, const std::pair<double, double> &peak_window,
+    const API::IBackgroundFunction_sptr &bkgd_function) {
   if (peak_window.first >= peak_window.second)
     throw std::runtime_error("Invalid peak window");
 
@@ -1440,8 +1442,9 @@ void FitPeaks::estimateBackground(const Histogram &histogram,
  */
 int FitPeaks::estimatePeakParameters(
     const Histogram &histogram, const std::pair<double, double> &peak_window,
-    API::IPeakFunction_sptr peakfunction,
-    API::IBackgroundFunction_sptr bkgdfunction, bool observe_peak_width) {
+    const API::IPeakFunction_sptr &peakfunction,
+    const API::IBackgroundFunction_sptr &bkgdfunction,
+    bool observe_peak_width) {
 
   // get the range of start and stop to construct a function domain
   const auto &vector_x = histogram.points();
@@ -1608,7 +1611,7 @@ double FitPeaks::observePeakWidth(const Histogram &histogram,
 bool FitPeaks::fitBackground(const size_t &ws_index,
                              const std::pair<double, double> &fit_window,
                              const double &expected_peak_pos,
-                             API::IBackgroundFunction_sptr bkgd_func) {
+                             const API::IBackgroundFunction_sptr &bkgd_func) {
 
   // find out how to fit background
   const auto &points = m_inputMatrixWS->histogram(ws_index).points();
@@ -1656,12 +1659,13 @@ bool FitPeaks::fitBackground(const size_t &ws_index,
 //----------------------------------------------------------------------------------------------
 /** Fit an individual peak
  */
-double FitPeaks::fitIndividualPeak(size_t wi, API::IAlgorithm_sptr fitter,
-                                   const double expected_peak_center,
-                                   const std::pair<double, double> &fitwindow,
-                                   const bool observe_peak_params,
-                                   API::IPeakFunction_sptr peakfunction,
-                                   API::IBackgroundFunction_sptr bkgdfunc) {
+double
+FitPeaks::fitIndividualPeak(size_t wi, const API::IAlgorithm_sptr &fitter,
+                            const double expected_peak_center,
+                            const std::pair<double, double> &fitwindow,
+                            const bool observe_peak_params,
+                            const API::IPeakFunction_sptr &peakfunction,
+                            const API::IBackgroundFunction_sptr &bkgdfunc) {
   double cost(DBL_MAX);
 
   // confirm that there is something to fit
@@ -1690,14 +1694,12 @@ double FitPeaks::fitIndividualPeak(size_t wi, API::IAlgorithm_sptr fitter,
  * This is the core fitting algorithm to deal with the simplest situation
  * @exception :: Fit.isExecuted is false (cannot be executed)
  */
-double FitPeaks::fitFunctionSD(IAlgorithm_sptr fit,
-                               API::IPeakFunction_sptr peak_function,
-                               API::IBackgroundFunction_sptr bkgd_function,
-                               API::MatrixWorkspace_sptr dataws, size_t wsindex,
-                               double xmin, double xmax,
-                               const double &expected_peak_center,
-                               bool observe_peak_shape,
-                               bool estimate_background) {
+double FitPeaks::fitFunctionSD(
+    const IAlgorithm_sptr &fit, const API::IPeakFunction_sptr &peak_function,
+    const API::IBackgroundFunction_sptr &bkgd_function,
+    const API::MatrixWorkspace_sptr &dataws, size_t wsindex, double xmin,
+    double xmax, const double &expected_peak_center, bool observe_peak_shape,
+    bool estimate_background) {
   std::stringstream errorid;
   errorid << "(WorkspaceIndex=" << wsindex
           << " PeakCentre=" << expected_peak_center << ")";
@@ -1784,8 +1786,8 @@ double FitPeaks::fitFunctionSD(IAlgorithm_sptr fit,
 
 //----------------------------------------------------------------------------------------------
 double FitPeaks::fitFunctionMD(API::IFunction_sptr fit_function,
-                               API::MatrixWorkspace_sptr dataws, size_t wsindex,
-                               std::vector<double> &vec_xmin,
+                               const API::MatrixWorkspace_sptr &dataws,
+                               size_t wsindex, std::vector<double> &vec_xmin,
                                std::vector<double> &vec_xmax) {
   // Validate
   if (vec_xmin.size() != vec_xmax.size())
@@ -1854,10 +1856,10 @@ double FitPeaks::fitFunctionMD(API::IFunction_sptr fit_function,
 //----------------------------------------------------------------------------------------------
 /// Fit peak with high background
 double FitPeaks::fitFunctionHighBackground(
-    IAlgorithm_sptr fit, const std::pair<double, double> &fit_window,
+    const IAlgorithm_sptr &fit, const std::pair<double, double> &fit_window,
     const size_t &ws_index, const double &expected_peak_center,
-    bool observe_peak_shape, API::IPeakFunction_sptr peakfunction,
-    API::IBackgroundFunction_sptr bkgdfunc) {
+    bool observe_peak_shape, const API::IPeakFunction_sptr &peakfunction,
+    const API::IBackgroundFunction_sptr &bkgdfunc) {
   // high background to reduce
   API::IBackgroundFunction_sptr high_bkgd_function(nullptr);
   if (m_linearBackgroundFunction)
@@ -1954,7 +1956,7 @@ void FitPeaks::generateOutputPeakPositionWS() {
  * @param with_chi2:: flag to append chi^2 to the table
  */
 void FitPeaks::setupParameterTableWorkspace(
-    API::ITableWorkspace_sptr table_ws,
+    const API::ITableWorkspace_sptr &table_ws,
     const std::vector<std::string> &param_names, bool with_chi2) {
 
   // add columns
@@ -2063,7 +2065,7 @@ void FitPeaks::processOutputs(
   // optional
   if (m_fittedPeakWS && m_fittedParamTable) {
     g_log.debug("about to calcualte fitted peaks");
-    calculateFittedPeaks(fit_result_vec);
+    calculateFittedPeaks(std::move(fit_result_vec));
     setProperty(PropertyNames::OUTPUT_WKSP_MODEL, m_fittedPeakWS);
   }
 }
@@ -2215,9 +2217,9 @@ void FitPeaks::getRangeData(size_t iws,
  * @param vec_x :: vector of X valye
  * @param vec_y :: (input/output) vector Y to be reduced by background function
  */
-void FitPeaks::reduceByBackground(API::IBackgroundFunction_sptr bkgd_func,
-                                  const std::vector<double> &vec_x,
-                                  std::vector<double> &vec_y) {
+void FitPeaks::reduceByBackground(
+    const API::IBackgroundFunction_sptr &bkgd_func,
+    const std::vector<double> &vec_x, std::vector<double> &vec_y) {
   // calculate the background
   FunctionDomain1DVector vectorx(vec_x.begin(), vec_x.end());
   FunctionValues vector_bkgd(vectorx);
@@ -2278,7 +2280,7 @@ void FitPeaks::estimateLinearBackground(const Histogram &histogram,
  */
 void FitPeaks::writeFitResult(
     size_t wi, const std::vector<double> &expected_positions,
-    boost::shared_ptr<FitPeaksAlgorithm::PeakFitResult> fit_result) {
+    const boost::shared_ptr<FitPeaksAlgorithm::PeakFitResult> &fit_result) {
   // convert to
   size_t out_wi = wi - m_startWorkspaceIndex;
   if (out_wi >= m_outputPeakPositionWorkspace->getNumberHistograms()) {
@@ -2395,7 +2397,7 @@ void FitPeaks::writeFitResult(
 
 //----------------------------------------------------------------------------------------------
 std::string FitPeaks::getPeakHeightParameterName(
-    API::IPeakFunction_const_sptr peak_function) {
+    const API::IPeakFunction_const_sptr &peak_function) {
   std::string height_name("");
 
   std::vector<std::string> peak_parameters = peak_function->getParameterNames();
diff --git a/Framework/Algorithms/src/GenerateEventsFilter.cpp b/Framework/Algorithms/src/GenerateEventsFilter.cpp
index 653f4cfb2c8..d0be0289a76 100644
--- a/Framework/Algorithms/src/GenerateEventsFilter.cpp
+++ b/Framework/Algorithms/src/GenerateEventsFilter.cpp
@@ -18,6 +18,7 @@
 #include "MantidKernel/VisibleWhenProperty.h"
 
 #include <boost/math/special_functions/round.hpp>
+#include <utility>
 
 using namespace Mantid;
 using namespace Mantid::Kernel;
@@ -500,7 +501,7 @@ void GenerateEventsFilter::setFilterByTimeOnly() {
 /** Generate filters by log values.
  * @param logname :: name of the log to filter with
  */
-void GenerateEventsFilter::setFilterByLogValue(std::string logname) {
+void GenerateEventsFilter::setFilterByLogValue(const std::string &logname) {
   // Obtain reference of sample log to filter with
   m_dblLog = dynamic_cast<TimeSeriesProperty<double> *>(
       m_dataWS->run().getProperty(logname));
@@ -962,7 +963,7 @@ bool GenerateEventsFilter::identifyLogEntry(
  * @param stopTime :: Stop time.
  */
 void GenerateEventsFilter::makeMultipleFiltersByValues(
-    map<size_t, int> indexwsindexmap, vector<double> logvalueranges,
+    map<size_t, int> indexwsindexmap, const vector<double> &logvalueranges,
     bool centre, bool filterIncrease, bool filterDecrease,
     DateAndTime startTime, DateAndTime stopTime) {
   g_log.notice("Starting method 'makeMultipleFiltersByValues'. ");
@@ -994,8 +995,9 @@ void GenerateEventsFilter::makeMultipleFiltersByValues(
   auto iend = static_cast<int>(logsize - 1);
 
   makeMultipleFiltersByValuesPartialLog(
-      istart, iend, m_vecSplitterTime, m_vecSplitterGroup, indexwsindexmap,
-      logvalueranges, tol, filterIncrease, filterDecrease, startTime, stopTime);
+      istart, iend, m_vecSplitterTime, m_vecSplitterGroup,
+      std::move(indexwsindexmap), logvalueranges, tol, filterIncrease,
+      filterDecrease, startTime, stopTime);
 
   progress(1.0);
 }
@@ -1018,9 +1020,9 @@ void GenerateEventsFilter::makeMultipleFiltersByValues(
  * @param stopTime :: Stop time.
  */
 void GenerateEventsFilter::makeMultipleFiltersByValuesParallel(
-    map<size_t, int> indexwsindexmap, vector<double> logvalueranges,
-    bool centre, bool filterIncrease, bool filterDecrease,
-    DateAndTime startTime, DateAndTime stopTime) {
+    const map<size_t, int> &indexwsindexmap,
+    const vector<double> &logvalueranges, bool centre, bool filterIncrease,
+    bool filterDecrease, DateAndTime startTime, DateAndTime stopTime) {
   // Return if the log is empty.
   int logsize = m_dblLog->size();
   if (logsize == 0) {
@@ -1178,7 +1180,7 @@ void GenerateEventsFilter::makeMultipleFiltersByValuesParallel(
 void GenerateEventsFilter::makeMultipleFiltersByValuesPartialLog(
     int istart, int iend, std::vector<Types::Core::DateAndTime> &vecSplitTime,
     std::vector<int> &vecSplitGroup, map<size_t, int> indexwsindexmap,
-    const vector<double> &logvalueranges, time_duration tol,
+    const vector<double> &logvalueranges, const time_duration &tol,
     bool filterIncrease, bool filterDecrease, DateAndTime startTime,
     DateAndTime stopTime) {
   // Check
@@ -1662,7 +1664,7 @@ int GenerateEventsFilter::determineChangingDirection(int startindex) {
  */
 void GenerateEventsFilter::addNewTimeFilterSplitter(
     Types::Core::DateAndTime starttime, Types::Core::DateAndTime stoptime,
-    int wsindex, string info) {
+    int wsindex, const string &info) {
   if (m_forFastLog) {
     // For MatrixWorkspace splitter
     // Start of splitter
diff --git a/Framework/Algorithms/src/GeneratePeaks.cpp b/Framework/Algorithms/src/GeneratePeaks.cpp
index 5cdb134dad8..d694db8a4a7 100644
--- a/Framework/Algorithms/src/GeneratePeaks.cpp
+++ b/Framework/Algorithms/src/GeneratePeaks.cpp
@@ -429,7 +429,7 @@ void GeneratePeaks::generatePeaks(
     const std::map<specnum_t,
                    std::vector<std::pair<double, API::IFunction_sptr>>>
         &functionmap,
-    API::MatrixWorkspace_sptr dataWS) {
+    const API::MatrixWorkspace_sptr &dataWS) {
   // Calcualte function
   std::map<specnum_t,
            std::vector<std::pair<double, API::IFunction_sptr>>>::const_iterator
@@ -627,7 +627,7 @@ void GeneratePeaks::processTableColumnNames() {
  * Algorithm supports multiple peaks in multiple spectra
  */
 void GeneratePeaks::getSpectraSet(
-    DataObjects::TableWorkspace_const_sptr peakParmsWS) {
+    const DataObjects::TableWorkspace_const_sptr &peakParmsWS) {
   size_t numpeaks = peakParmsWS->rowCount();
   API::Column_const_sptr col = peakParmsWS->getColumn("spectrum");
 
@@ -652,7 +652,7 @@ void GeneratePeaks::getSpectraSet(
 /** Get the IPeakFunction part in the input function
  */
 API::IPeakFunction_sptr
-GeneratePeaks::getPeakFunction(API::IFunction_sptr infunction) {
+GeneratePeaks::getPeakFunction(const API::IFunction_sptr &infunction) {
   // Not a composite function
   API::CompositeFunction_sptr compfunc =
       boost::dynamic_pointer_cast<API::CompositeFunction>(infunction);
@@ -678,8 +678,8 @@ GeneratePeaks::getPeakFunction(API::IFunction_sptr infunction) {
 //----------------------------------------------------------------------------------------------
 /** Find out whether a function has a certain parameter
  */
-bool GeneratePeaks::hasParameter(API::IFunction_sptr function,
-                                 std::string paramname) {
+bool GeneratePeaks::hasParameter(const API::IFunction_sptr &function,
+                                 const std::string &paramname) {
   std::vector<std::string> parnames = function->getParameterNames();
   std::vector<std::string>::iterator piter;
   piter = std::find(parnames.begin(), parnames.end(), paramname);
@@ -793,8 +793,8 @@ GeneratePeaks::createDataWorkspace(std::vector<double> binparameters) {
 
 /** Add function's parameter names after peak function name
  */
-std::vector<std::string>
-GeneratePeaks::addFunctionParameterNames(std::vector<std::string> funcnames) {
+std::vector<std::string> GeneratePeaks::addFunctionParameterNames(
+    const std::vector<std::string> &funcnames) {
   std::vector<std::string> vec_funcparnames;
 
   for (auto &funcname : funcnames) {
diff --git a/Framework/Algorithms/src/GetDetOffsetsMultiPeaks.cpp b/Framework/Algorithms/src/GetDetOffsetsMultiPeaks.cpp
index 6dfb4ce07d7..75a9b6a0e22 100644
--- a/Framework/Algorithms/src/GetDetOffsetsMultiPeaks.cpp
+++ b/Framework/Algorithms/src/GetDetOffsetsMultiPeaks.cpp
@@ -399,7 +399,7 @@ void GetDetOffsetsMultiPeaks::processProperties() {
  *  @throw Exception::RuntimeError If ... ...
  */
 void GetDetOffsetsMultiPeaks::importFitWindowTableWorkspace(
-    TableWorkspace_sptr windowtablews) {
+    const TableWorkspace_sptr &windowtablews) {
   // Check number of columns matches number of peaks
   size_t numcols = windowtablews->columnCount();
   size_t numpeaks = m_peakPositions.size();
@@ -831,7 +831,7 @@ void deletePeaks(std::vector<size_t> &banned, std::vector<double> &peakPosToFit,
  * @return The number of peaks in range
  */
 int GetDetOffsetsMultiPeaks::fitSpectra(
-    const int64_t wi, MatrixWorkspace_sptr inputW,
+    const int64_t wi, const MatrixWorkspace_sptr &inputW,
     const std::vector<double> &peakPositions,
     const std::vector<double> &fitWindows, size_t &nparams, double &minD,
     double &maxD, std::vector<double> &peakPosToFit,
@@ -1178,7 +1178,7 @@ void GetDetOffsetsMultiPeaks::createInformationWorkspaces() {
  * (thread-safe)
  */
 void GetDetOffsetsMultiPeaks::addInfoToReportWS(
-    int wi, FitPeakOffsetResult offsetresult,
+    int wi, const FitPeakOffsetResult &offsetresult,
     const std::vector<double> &tofitpeakpositions,
     const std::vector<double> &fittedpeakpositions) {
   // Offset calculation status
diff --git a/Framework/Algorithms/src/GetEi.cpp b/Framework/Algorithms/src/GetEi.cpp
index 4887378a718..0484e539f03 100644
--- a/Framework/Algorithms/src/GetEi.cpp
+++ b/Framework/Algorithms/src/GetEi.cpp
@@ -163,9 +163,9 @@ void GetEi::exec() {
  * passed to this function second
  *  @throw NotFoundError if no detector is found for the detector ID given
  */
-void GetEi::getGeometry(API::MatrixWorkspace_const_sptr WS, specnum_t mon0Spec,
-                        specnum_t mon1Spec, double &monitor0Dist,
-                        double &monitor1Dist) const {
+void GetEi::getGeometry(const API::MatrixWorkspace_const_sptr &WS,
+                        specnum_t mon0Spec, specnum_t mon1Spec,
+                        double &monitor0Dist, double &monitor1Dist) const {
   const IComponent_const_sptr source = WS->getInstrument()->getSource();
 
   // retrieve a pointer to the first detector and get its distance
@@ -220,7 +220,7 @@ void GetEi::getGeometry(API::MatrixWorkspace_const_sptr WS, specnum_t mon0Spec,
  * in the workspace
  */
 std::vector<size_t> GetEi::getMonitorWsIndexs(
-    API::MatrixWorkspace_const_sptr WS, specnum_t specNum1,
+    const API::MatrixWorkspace_const_sptr &WS, specnum_t specNum1,
     specnum_t specNum2) const { // getting spectra numbers from detector IDs is
                                 // hard because the map works the other way,
   // getting index numbers from spectra numbers has
@@ -285,7 +285,7 @@ double GetEi::timeToFly(double s, double E_KE) const {
  *  @throw out_of_range if the peak runs off the edge of the histogram
  *  @throw runtime_error a Child Algorithm just falls over
  */
-double GetEi::getPeakCentre(API::MatrixWorkspace_const_sptr WS,
+double GetEi::getPeakCentre(const API::MatrixWorkspace_const_sptr &WS,
                             const size_t monitIn, const double peakTime) {
   const auto &timesArray = WS->x(monitIn);
   // we search for the peak only inside some window because there are often more
diff --git a/Framework/Algorithms/src/GetEi2.cpp b/Framework/Algorithms/src/GetEi2.cpp
index 794f6078f7f..205a6222d5e 100644
--- a/Framework/Algorithms/src/GetEi2.cpp
+++ b/Framework/Algorithms/src/GetEi2.cpp
@@ -24,6 +24,7 @@
 #include <boost/lexical_cast.hpp>
 #include <cmath>
 #include <sstream>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -395,7 +396,7 @@ GetEi2::extractSpectrum(size_t ws_index, const double start, const double end) {
  * @returns The width of the peak at half height
  */
 double GetEi2::calculatePeakWidthAtHalfHeight(
-    API::MatrixWorkspace_sptr data_ws, const double prominence,
+    const API::MatrixWorkspace_sptr &data_ws, const double prominence,
     std::vector<double> &peak_x, std::vector<double> &peak_y,
     std::vector<double> &peak_e) const {
   // Use WS->points() to create a temporary vector of bin_centre values to work
@@ -622,11 +623,11 @@ double GetEi2::calculatePeakWidthAtHalfHeight(
  * considered a "real" peak
  *  @return The calculated first moment
  */
-double GetEi2::calculateFirstMoment(API::MatrixWorkspace_sptr monitor_ws,
+double GetEi2::calculateFirstMoment(const API::MatrixWorkspace_sptr &monitor_ws,
                                     const double prominence) {
   std::vector<double> peak_x, peak_y, peak_e;
-  calculatePeakWidthAtHalfHeight(monitor_ws, prominence, peak_x, peak_y,
-                                 peak_e);
+  calculatePeakWidthAtHalfHeight(std::move(monitor_ws), prominence, peak_x,
+                                 peak_y, peak_e);
 
   // Area
   double area(0.0), dummy(0.0);
@@ -649,9 +650,9 @@ double GetEi2::calculateFirstMoment(API::MatrixWorkspace_sptr monitor_ws,
  * @param end :: The maximum value for the new bin range
  * @returns The rebinned workspace
 */
-API::MatrixWorkspace_sptr GetEi2::rebin(API::MatrixWorkspace_sptr monitor_ws,
-                                        const double first, const double width,
-                                        const double end) {
+API::MatrixWorkspace_sptr
+GetEi2::rebin(const API::MatrixWorkspace_sptr &monitor_ws, const double first,
+              const double width, const double end) {
   IAlgorithm_sptr childAlg = createChildAlgorithm("Rebin");
   childAlg->setProperty("InputWorkspace", monitor_ws);
   std::ostringstream binParams;
diff --git a/Framework/Algorithms/src/GetQsInQENSData.cpp b/Framework/Algorithms/src/GetQsInQENSData.cpp
index 090cf53942b..1d70e67da63 100644
--- a/Framework/Algorithms/src/GetQsInQENSData.cpp
+++ b/Framework/Algorithms/src/GetQsInQENSData.cpp
@@ -88,7 +88,7 @@ void GetQsInQENSData::exec() {
  * @return          The extracted Q-values as a vector.
  */
 MantidVec GetQsInQENSData::extractQValues(
-    const Mantid::API::MatrixWorkspace_sptr workspace) {
+    const Mantid::API::MatrixWorkspace_sptr &workspace) {
   size_t numSpectra = workspace->getNumberHistograms();
   Axis *qAxis;
 
diff --git a/Framework/Algorithms/src/GetTimeSeriesLogInformation.cpp b/Framework/Algorithms/src/GetTimeSeriesLogInformation.cpp
index 25e22a3ce72..531e7937168 100644
--- a/Framework/Algorithms/src/GetTimeSeriesLogInformation.cpp
+++ b/Framework/Algorithms/src/GetTimeSeriesLogInformation.cpp
@@ -299,7 +299,7 @@ TableWorkspace_sptr GetTimeSeriesLogInformation::generateStatisticTable() {
  *
  *  This algorithm should be reconsidered how to work with it.
  */
-void GetTimeSeriesLogInformation::exportErrorLog(MatrixWorkspace_sptr ws,
+void GetTimeSeriesLogInformation::exportErrorLog(const MatrixWorkspace_sptr &ws,
                                                  vector<DateAndTime> abstimevec,
                                                  double dts) {
   std::string outputdir = getProperty("OutputDirectory");
diff --git a/Framework/Algorithms/src/He3TubeEfficiency.cpp b/Framework/Algorithms/src/He3TubeEfficiency.cpp
index 8303b71d23f..2c71546a9c3 100644
--- a/Framework/Algorithms/src/He3TubeEfficiency.cpp
+++ b/Framework/Algorithms/src/He3TubeEfficiency.cpp
@@ -381,9 +381,9 @@ void He3TubeEfficiency::logErrors() const {
  * @param idet :: the current detector
  * @return the value of the detector property
  */
-double He3TubeEfficiency::getParameter(std::string wsPropName,
+double He3TubeEfficiency::getParameter(const std::string &wsPropName,
                                        std::size_t currentIndex,
-                                       std::string detPropName,
+                                       const std::string &detPropName,
                                        const Geometry::IDetector &idet) {
   std::vector<double> wsProp = this->getProperty(wsPropName);
 
diff --git a/Framework/Algorithms/src/IQTransform.cpp b/Framework/Algorithms/src/IQTransform.cpp
index a3418b84c13..4f289f16ee2 100644
--- a/Framework/Algorithms/src/IQTransform.cpp
+++ b/Framework/Algorithms/src/IQTransform.cpp
@@ -7,12 +7,14 @@
 //----------------------------------------------------------------------
 // Includes
 //----------------------------------------------------------------------
-#include "MantidAlgorithms/IQTransform.h"
+#include <utility>
+
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/IncreasingAxisValidator.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/RawCountValidator.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
+#include "MantidAlgorithms/IQTransform.h"
 #include "MantidDataObjects/TableWorkspace.h"
 #include "MantidDataObjects/Workspace2D.h"
 #include "MantidDataObjects/WorkspaceCreation.h"
@@ -157,11 +159,11 @@ void IQTransform::exec() {
  *  @param background The workspace containing the background values
  */
 API::MatrixWorkspace_sptr
-IQTransform::subtractBackgroundWS(API::MatrixWorkspace_sptr ws,
-                                  API::MatrixWorkspace_sptr background) {
+IQTransform::subtractBackgroundWS(const API::MatrixWorkspace_sptr &ws,
+                                  const API::MatrixWorkspace_sptr &background) {
   g_log.debug() << "Subtracting the workspace " << background->getName()
                 << " from the input workspace.\n";
-  return ws - background;
+  return std::move(ws) - background;
 }
 
 /** @name Available transformation functions */
@@ -172,7 +174,7 @@ IQTransform::subtractBackgroundWS(API::MatrixWorkspace_sptr ws,
  *  @throw std::range_error if an attempt is made to take log of a negative
  * number
  */
-void IQTransform::guinierSpheres(API::MatrixWorkspace_sptr ws) {
+void IQTransform::guinierSpheres(const API::MatrixWorkspace_sptr &ws) {
   auto &X = ws->mutableX(0);
   auto &Y = ws->mutableY(0);
   auto &E = ws->mutableE(0);
@@ -192,7 +194,7 @@ void IQTransform::guinierSpheres(API::MatrixWorkspace_sptr ws) {
  *  @throw std::range_error if an attempt is made to take log of a negative
  * number
  */
-void IQTransform::guinierRods(API::MatrixWorkspace_sptr ws) {
+void IQTransform::guinierRods(const API::MatrixWorkspace_sptr &ws) {
   auto &X = ws->mutableX(0);
   auto &Y = ws->mutableY(0);
   auto &E = ws->mutableE(0);
@@ -215,7 +217,7 @@ void IQTransform::guinierRods(API::MatrixWorkspace_sptr ws) {
  *  @throw std::range_error if an attempt is made to take log of a negative
  * number
  */
-void IQTransform::guinierSheets(API::MatrixWorkspace_sptr ws) {
+void IQTransform::guinierSheets(const API::MatrixWorkspace_sptr &ws) {
   auto &X = ws->mutableX(0);
   auto &Y = ws->mutableY(0);
   auto &E = ws->mutableE(0);
@@ -237,7 +239,7 @@ void IQTransform::guinierSheets(API::MatrixWorkspace_sptr ws) {
  *  The output is set to zero for negative input Y values
  *  @param ws The workspace to be transformed
  */
-void IQTransform::zimm(API::MatrixWorkspace_sptr ws) {
+void IQTransform::zimm(const API::MatrixWorkspace_sptr &ws) {
   auto &X = ws->mutableX(0);
   auto &Y = ws->mutableY(0);
   auto &E = ws->mutableE(0);
@@ -261,7 +263,7 @@ void IQTransform::zimm(API::MatrixWorkspace_sptr ws) {
  *  The output is set to zero for negative input Y values
  *  @param ws The workspace to be transformed
  */
-void IQTransform::debyeBueche(API::MatrixWorkspace_sptr ws) {
+void IQTransform::debyeBueche(const API::MatrixWorkspace_sptr &ws) {
   auto &X = ws->mutableX(0);
   auto &Y = ws->mutableY(0);
   auto &E = ws->mutableE(0);
@@ -284,7 +286,7 @@ void IQTransform::debyeBueche(API::MatrixWorkspace_sptr ws) {
 /** Performs the Holtzer transformation: IQ v Q
  *  @param ws The workspace to be transformed
  */
-void IQTransform::holtzer(API::MatrixWorkspace_sptr ws) {
+void IQTransform::holtzer(const API::MatrixWorkspace_sptr &ws) {
   auto &X = ws->mutableX(0);
   auto &Y = ws->mutableY(0);
   auto &E = ws->mutableE(0);
@@ -299,7 +301,7 @@ void IQTransform::holtzer(API::MatrixWorkspace_sptr ws) {
 /** Performs the Kratky transformation: IQ^2 v Q
  *  @param ws The workspace to be transformed
  */
-void IQTransform::kratky(API::MatrixWorkspace_sptr ws) {
+void IQTransform::kratky(const API::MatrixWorkspace_sptr &ws) {
   auto &X = ws->mutableX(0);
   auto &Y = ws->mutableY(0);
   auto &E = ws->mutableE(0);
@@ -317,7 +319,7 @@ void IQTransform::kratky(API::MatrixWorkspace_sptr ws) {
 /** Performs the Porod transformation: IQ^4 v Q
  *  @param ws The workspace to be transformed
  */
-void IQTransform::porod(API::MatrixWorkspace_sptr ws) {
+void IQTransform::porod(const API::MatrixWorkspace_sptr &ws) {
   auto &X = ws->mutableX(0);
   auto &Y = ws->mutableY(0);
   auto &E = ws->mutableE(0);
@@ -337,7 +339,7 @@ void IQTransform::porod(API::MatrixWorkspace_sptr ws) {
  *  @throw std::range_error if an attempt is made to take log of a negative
  * number
  */
-void IQTransform::logLog(API::MatrixWorkspace_sptr ws) {
+void IQTransform::logLog(const API::MatrixWorkspace_sptr &ws) {
   auto &X = ws->mutableX(0);
   auto &Y = ws->mutableY(0);
   auto &E = ws->mutableE(0);
@@ -360,7 +362,7 @@ void IQTransform::logLog(API::MatrixWorkspace_sptr ws) {
  *  @throw std::range_error if an attempt is made to take log of a negative
  * number
  */
-void IQTransform::general(API::MatrixWorkspace_sptr ws) {
+void IQTransform::general(const API::MatrixWorkspace_sptr &ws) {
   auto &X = ws->mutableX(0);
   auto &Y = ws->mutableY(0);
   auto &E = ws->mutableE(0);
diff --git a/Framework/Algorithms/src/IdentifyNoisyDetectors.cpp b/Framework/Algorithms/src/IdentifyNoisyDetectors.cpp
index 68ff265fb3f..a60e373cc39 100644
--- a/Framework/Algorithms/src/IdentifyNoisyDetectors.cpp
+++ b/Framework/Algorithms/src/IdentifyNoisyDetectors.cpp
@@ -149,8 +149,8 @@ void IdentifyNoisyDetectors::exec() {
  * @param values :: stddeviations of each spectra (I think)
  */
 void IdentifyNoisyDetectors::getStdDev(API::Progress &progress,
-                                       MatrixWorkspace_sptr valid,
-                                       MatrixWorkspace_sptr values) {
+                                       const MatrixWorkspace_sptr &valid,
+                                       const MatrixWorkspace_sptr &values) {
   const auto nhist = static_cast<int>(valid->getNumberHistograms());
   int count = 0;
   double mean = 0.0;
diff --git a/Framework/Algorithms/src/IntegrateByComponent.cpp b/Framework/Algorithms/src/IntegrateByComponent.cpp
index 23676f58d09..f0da9938dff 100644
--- a/Framework/Algorithms/src/IntegrateByComponent.cpp
+++ b/Framework/Algorithms/src/IntegrateByComponent.cpp
@@ -158,8 +158,8 @@ void IntegrateByComponent::exec() {
  * @return  vector of vectors, containing each spectrum that belongs to each
  * group
  */
-std::vector<std::vector<size_t>>
-IntegrateByComponent::makeInstrumentMap(API::MatrixWorkspace_sptr countsWS) {
+std::vector<std::vector<size_t>> IntegrateByComponent::makeInstrumentMap(
+    const API::MatrixWorkspace_sptr &countsWS) {
   std::vector<std::vector<size_t>> mymap;
   std::vector<size_t> single;
 
@@ -178,7 +178,8 @@ IntegrateByComponent::makeInstrumentMap(API::MatrixWorkspace_sptr countsWS) {
  * group
  */
 std::vector<std::vector<size_t>>
-IntegrateByComponent::makeMap(API::MatrixWorkspace_sptr countsWS, int parents) {
+IntegrateByComponent::makeMap(const API::MatrixWorkspace_sptr &countsWS,
+                              int parents) {
   std::unordered_multimap<Mantid::Geometry::ComponentID, size_t> mymap;
 
   if (parents == 0) // this should not happen in this file, but if one reuses
diff --git a/Framework/Algorithms/src/Integration.cpp b/Framework/Algorithms/src/Integration.cpp
index 2dcdd112138..0db822108e6 100644
--- a/Framework/Algorithms/src/Integration.cpp
+++ b/Framework/Algorithms/src/Integration.cpp
@@ -349,9 +349,9 @@ void Integration::exec() {
 /**
  * Uses rebin to reduce event workspaces to a single bin histogram
  */
-API::MatrixWorkspace_sptr
-Integration::rangeFilterEventWorkspace(API::MatrixWorkspace_sptr workspace,
-                                       double minRange, double maxRange) {
+API::MatrixWorkspace_sptr Integration::rangeFilterEventWorkspace(
+    const API::MatrixWorkspace_sptr &workspace, double minRange,
+    double maxRange) {
   bool childLog = g_log.is(Logger::Priority::PRIO_DEBUG);
   auto childAlg = createChildAlgorithm("Rebin", 0, 0.5, childLog);
   childAlg->setProperty("InputWorkspace", workspace);
diff --git a/Framework/Algorithms/src/InterpolatingRebin.cpp b/Framework/Algorithms/src/InterpolatingRebin.cpp
index 83d372c4125..05466d4790c 100644
--- a/Framework/Algorithms/src/InterpolatingRebin.cpp
+++ b/Framework/Algorithms/src/InterpolatingRebin.cpp
@@ -144,9 +144,9 @@ void InterpolatingRebin::exec() {
  * the histograms must corrospond with the number of x-values in XValues_new
  */
 void InterpolatingRebin::outputYandEValues(
-    API::MatrixWorkspace_const_sptr inputW,
+    const API::MatrixWorkspace_const_sptr &inputW,
     const HistogramData::BinEdges &XValues_new,
-    API::MatrixWorkspace_sptr outputW) {
+    const API::MatrixWorkspace_sptr &outputW) {
   g_log.debug()
       << "Preparing to calculate y-values using splines and estimate errors\n";
 
diff --git a/Framework/Algorithms/src/MaskBinsFromTable.cpp b/Framework/Algorithms/src/MaskBinsFromTable.cpp
index 6ad76da2d7f..e951b48c5bf 100644
--- a/Framework/Algorithms/src/MaskBinsFromTable.cpp
+++ b/Framework/Algorithms/src/MaskBinsFromTable.cpp
@@ -68,7 +68,7 @@ void MaskBinsFromTable::exec() {
 /** Call MaskBins
  * @param dataws :: MatrixWorkspace to mask bins for
  */
-void MaskBinsFromTable::maskBins(API::MatrixWorkspace_sptr dataws) {
+void MaskBinsFromTable::maskBins(const API::MatrixWorkspace_sptr &dataws) {
   bool firstloop = true;
   API::MatrixWorkspace_sptr outputws;
 
@@ -134,7 +134,8 @@ void MaskBinsFromTable::maskBins(API::MatrixWorkspace_sptr dataws) {
  * @param dataws :: MatrixWorkspace to mask
  */
 void MaskBinsFromTable::processMaskBinWorkspace(
-    TableWorkspace_sptr masktblws, API::MatrixWorkspace_sptr dataws) {
+    const TableWorkspace_sptr &masktblws,
+    const API::MatrixWorkspace_sptr &dataws) {
   // Check input
   if (!masktblws)
     throw std::invalid_argument("Input workspace is not a table workspace.");
@@ -213,8 +214,8 @@ void MaskBinsFromTable::processMaskBinWorkspace(
  * @return :: list of spectra/workspace index IDs in string format
  */
 std::string
-MaskBinsFromTable::convertToSpectraList(API::MatrixWorkspace_sptr dataws,
-                                        std::string detidliststr) {
+MaskBinsFromTable::convertToSpectraList(const API::MatrixWorkspace_sptr &dataws,
+                                        const std::string &detidliststr) {
   // Use array property to get a list of detectors
   vector<int> detidvec;
   ArrayProperty<int> parser("detids", detidliststr);
diff --git a/Framework/Algorithms/src/MaxEnt.cpp b/Framework/Algorithms/src/MaxEnt.cpp
index 4807fa4ecb7..bfbf9512790 100644
--- a/Framework/Algorithms/src/MaxEnt.cpp
+++ b/Framework/Algorithms/src/MaxEnt.cpp
@@ -826,7 +826,7 @@ std::vector<double> MaxEnt::applyDistancePenalty(
 std::vector<double>
 MaxEnt::updateImage(const std::vector<double> &image,
                     const std::vector<double> &delta,
-                    const std::vector<std::vector<double>> dirs) {
+                    const std::vector<std::vector<double>> &dirs) {
 
   if (image.empty() || dirs.empty() || (delta.size() != dirs.size())) {
     throw std::runtime_error("Cannot calculate new image");
diff --git a/Framework/Algorithms/src/MaxEnt/MaxentCalculator.cpp b/Framework/Algorithms/src/MaxEnt/MaxentCalculator.cpp
index 412b37d2bb3..4b9603e8f2b 100644
--- a/Framework/Algorithms/src/MaxEnt/MaxentCalculator.cpp
+++ b/Framework/Algorithms/src/MaxEnt/MaxentCalculator.cpp
@@ -6,6 +6,7 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "MantidAlgorithms/MaxEnt/MaxentCalculator.h"
 #include <cmath>
+#include <utility>
 
 namespace Mantid {
 namespace Algorithms {
@@ -21,7 +22,7 @@ MaxentCalculator::MaxentCalculator(MaxentEntropy_sptr entropy,
                                    MaxentTransform_sptr transform)
     : m_data(), m_errors(), m_image(), m_dataCalc(), m_background(1.0),
       m_angle(-1.), m_chisq(-1.), m_directionsIm(), m_coeffs(),
-      m_entropy(entropy), m_transform(transform) {}
+      m_entropy(std::move(entropy)), m_transform(std::move(transform)) {}
 
 /**
  * Calculates the gradient of chi-square using the experimental data, calculated
diff --git a/Framework/Algorithms/src/MaxEnt/MaxentTransformFourier.cpp b/Framework/Algorithms/src/MaxEnt/MaxentTransformFourier.cpp
index 560af008dbe..ed0aabea554 100644
--- a/Framework/Algorithms/src/MaxEnt/MaxentTransformFourier.cpp
+++ b/Framework/Algorithms/src/MaxEnt/MaxentTransformFourier.cpp
@@ -6,6 +6,8 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "MantidAlgorithms/MaxEnt/MaxentTransformFourier.h"
 #include <boost/shared_array.hpp>
+#include <utility>
+
 #include <gsl/gsl_fft_complex.h>
 
 namespace Mantid {
@@ -14,7 +16,7 @@ namespace Algorithms {
 /** Constructor */
 MaxentTransformFourier::MaxentTransformFourier(MaxentSpace_sptr dataSpace,
                                                MaxentSpace_sptr imageSpace)
-    : m_dataSpace(dataSpace), m_imageSpace(imageSpace) {}
+    : m_dataSpace(std::move(dataSpace)), m_imageSpace(std::move(imageSpace)) {}
 
 /**
  * Transforms a 1D signal from image space to data space, performing an
diff --git a/Framework/Algorithms/src/MaxEnt/MaxentTransformMultiFourier.cpp b/Framework/Algorithms/src/MaxEnt/MaxentTransformMultiFourier.cpp
index fe3a9aabcac..7b9e4f392cf 100644
--- a/Framework/Algorithms/src/MaxEnt/MaxentTransformMultiFourier.cpp
+++ b/Framework/Algorithms/src/MaxEnt/MaxentTransformMultiFourier.cpp
@@ -7,15 +7,17 @@
 #include "MantidAlgorithms/MaxEnt/MaxentTransformMultiFourier.h"
 #include <gsl/gsl_fft_complex.h>
 
+#include <utility>
+
 namespace Mantid {
 namespace Algorithms {
 
 /** Constructor */
 MaxentTransformMultiFourier::MaxentTransformMultiFourier(
-    MaxentSpaceComplex_sptr dataSpace, MaxentSpace_sptr imageSpace,
+    const MaxentSpaceComplex_sptr &dataSpace, MaxentSpace_sptr imageSpace,
     size_t numSpec)
-    : MaxentTransformFourier(dataSpace, imageSpace), m_numSpec(numSpec),
-      m_linearAdjustments(), m_constAdjustments() {}
+    : MaxentTransformFourier(dataSpace, std::move(imageSpace)),
+      m_numSpec(numSpec), m_linearAdjustments(), m_constAdjustments() {}
 
 /**
  * Transforms a 1D signal from image space to data space, performing an
diff --git a/Framework/Algorithms/src/MedianDetectorTest.cpp b/Framework/Algorithms/src/MedianDetectorTest.cpp
index c86b91516d2..e385cbf6f9e 100644
--- a/Framework/Algorithms/src/MedianDetectorTest.cpp
+++ b/Framework/Algorithms/src/MedianDetectorTest.cpp
@@ -238,7 +238,8 @@ API::MatrixWorkspace_sptr MedianDetectorTest::getSolidAngles(int firstSpec,
  * @returns The number failed.
  */
 int MedianDetectorTest::maskOutliers(
-    const std::vector<double> medianvec, API::MatrixWorkspace_sptr countsWS,
+    const std::vector<double> &medianvec,
+    const API::MatrixWorkspace_sptr &countsWS,
     std::vector<std::vector<size_t>> indexmap) {
 
   // Fractions of the median
@@ -300,10 +301,10 @@ int MedianDetectorTest::maskOutliers(
  * skipped.
  */
 int MedianDetectorTest::doDetectorTests(
-    const API::MatrixWorkspace_sptr countsWS,
-    const std::vector<double> medianvec,
+    const API::MatrixWorkspace_sptr &countsWS,
+    const std::vector<double> &medianvec,
     std::vector<std::vector<size_t>> indexmap,
-    API::MatrixWorkspace_sptr maskWS) {
+    const API::MatrixWorkspace_sptr &maskWS) {
   g_log.debug("Applying the criteria to find failing detectors");
 
   // A spectra can't fail if the statistics show its value is consistent with
diff --git a/Framework/Algorithms/src/Minus.cpp b/Framework/Algorithms/src/Minus.cpp
index 08319d1e2e8..12999ca5449 100644
--- a/Framework/Algorithms/src/Minus.cpp
+++ b/Framework/Algorithms/src/Minus.cpp
@@ -137,8 +137,8 @@ void Minus::checkRequirements() {
  *  @return workspace unit compatibility flag
  */
 bool Minus::checkUnitCompatibility(
-    const API::MatrixWorkspace_const_sptr lhs,
-    const API::MatrixWorkspace_const_sptr rhs) const {
+    const API::MatrixWorkspace_const_sptr &lhs,
+    const API::MatrixWorkspace_const_sptr &rhs) const {
   if (lhs->size() > 1 && rhs->size() > 1) {
     if (lhs->YUnit() != rhs->YUnit()) {
       g_log.error("The two workspaces are not compatible because they have "
diff --git a/Framework/Algorithms/src/NormaliseByCurrent.cpp b/Framework/Algorithms/src/NormaliseByCurrent.cpp
index b563a973009..fce8815e6c6 100644
--- a/Framework/Algorithms/src/NormaliseByCurrent.cpp
+++ b/Framework/Algorithms/src/NormaliseByCurrent.cpp
@@ -45,7 +45,7 @@ void NormaliseByCurrent::init() {
  * workspace logs or if the values are invalid (0)
  */
 double NormaliseByCurrent::extractCharge(
-    boost::shared_ptr<Mantid::API::MatrixWorkspace> inputWS,
+    const boost::shared_ptr<Mantid::API::MatrixWorkspace> &inputWS,
     const bool integratePCharge) const {
   // Get the good proton charge and check it's valid
   double charge(-1.0);
diff --git a/Framework/Algorithms/src/NormaliseByDetector.cpp b/Framework/Algorithms/src/NormaliseByDetector.cpp
index db0469b3fb0..a118ba7e13e 100644
--- a/Framework/Algorithms/src/NormaliseByDetector.cpp
+++ b/Framework/Algorithms/src/NormaliseByDetector.cpp
@@ -73,7 +73,7 @@ void NormaliseByDetector::init() {
 }
 
 const Geometry::FitParameter NormaliseByDetector::tryParseFunctionParameter(
-    Geometry::Parameter_sptr parameter, const Geometry::IDetector &det) {
+    const Geometry::Parameter_sptr &parameter, const Geometry::IDetector &det) {
   if (parameter == nullptr) {
     std::stringstream stream;
     stream << det.getName()
@@ -99,10 +99,9 @@ normalisation routine.
 use.
 @param prog: progress reporting object.
 */
-void NormaliseByDetector::processHistogram(size_t wsIndex,
-                                           MatrixWorkspace_const_sptr inWS,
-                                           MatrixWorkspace_sptr denominatorWS,
-                                           Progress &prog) {
+void NormaliseByDetector::processHistogram(
+    size_t wsIndex, const MatrixWorkspace_const_sptr &inWS,
+    const MatrixWorkspace_sptr &denominatorWS, Progress &prog) {
   const auto &paramMap = inWS->constInstrumentParameters();
   const auto &spectrumInfo = inWS->spectrumInfo();
   const auto &det = spectrumInfo.detector(wsIndex);
@@ -164,7 +163,7 @@ sequentially.
 use.
 */
 MatrixWorkspace_sptr
-NormaliseByDetector::processHistograms(MatrixWorkspace_sptr inWS) {
+NormaliseByDetector::processHistograms(const MatrixWorkspace_sptr &inWS) {
   const size_t nHistograms = inWS->getNumberHistograms();
   const auto progress_items = static_cast<size_t>(double(nHistograms) * 1.2);
   Progress prog(this, 0.0, 1.0, progress_items);
diff --git a/Framework/Algorithms/src/NormaliseToMonitor.cpp b/Framework/Algorithms/src/NormaliseToMonitor.cpp
index 5be68fb0999..bad96c37993 100644
--- a/Framework/Algorithms/src/NormaliseToMonitor.cpp
+++ b/Framework/Algorithms/src/NormaliseToMonitor.cpp
@@ -102,7 +102,7 @@ void MonIDPropChanger::applyChanges(const IPropertyManager *algo,
 // read the monitors list from the workspace and try to do it once for any
 // particular ws;
 bool MonIDPropChanger::monitorIdReader(
-    MatrixWorkspace_const_sptr inputWS) const {
+    const MatrixWorkspace_const_sptr &inputWS) const {
   // no workspace
   if (!inputWS)
     return false;
diff --git a/Framework/Algorithms/src/PDCalibration.cpp b/Framework/Algorithms/src/PDCalibration.cpp
index 3edaa4e0f41..e0ea9546981 100644
--- a/Framework/Algorithms/src/PDCalibration.cpp
+++ b/Framework/Algorithms/src/PDCalibration.cpp
@@ -70,7 +70,7 @@ const auto isNonZero = [](const double value) { return value != 0.; };
 /// private inner class
 class PDCalibration::FittedPeaks {
 public:
-  FittedPeaks(API::MatrixWorkspace_const_sptr wksp,
+  FittedPeaks(const API::MatrixWorkspace_const_sptr &wksp,
               const std::size_t wkspIndex) {
     this->wkspIndex = wkspIndex;
 
@@ -108,7 +108,7 @@ public:
 
   void setPositions(const std::vector<double> &peaksInD,
                     const std::vector<double> &peaksInDWindows,
-                    std::function<double(double)> toTof) {
+                    const std::function<double(double)> &toTof) {
     // clear out old values
     inDPos.clear();
     inTofPos.clear();
@@ -307,7 +307,7 @@ std::map<std::string, std::string> PDCalibration::validateInputs() {
 
 namespace {
 
-bool hasDasIDs(API::ITableWorkspace_const_sptr table) {
+bool hasDasIDs(const API::ITableWorkspace_const_sptr &table) {
   const auto columnNames = table->getColumnNames();
   return (std::find(columnNames.begin(), columnNames.end(),
                     std::string("dasid")) != columnNames.end());
@@ -939,7 +939,7 @@ vector<double> PDCalibration::getTOFminmax(const double difc, const double difa,
 
   return tofminmax;
 }
-MatrixWorkspace_sptr PDCalibration::load(const std::string filename) {
+MatrixWorkspace_sptr PDCalibration::load(const std::string &filename) {
   // TODO this assumes that all files are event-based
   const double maxChunkSize = getProperty("MaxChunkSize");
   const double filterBadPulses = getProperty("FilterBadPulses");
@@ -1186,7 +1186,8 @@ PDCalibration::sortTableWorkspace(API::ITableWorkspace_sptr &table) {
 /// NEW: convert peak positions in dSpacing to peak centers workspace
 std::pair<API::MatrixWorkspace_sptr, API::MatrixWorkspace_sptr>
 PDCalibration::createTOFPeakCenterFitWindowWorkspaces(
-    API::MatrixWorkspace_sptr dataws, const double peakWindowMaxInDSpacing) {
+    const API::MatrixWorkspace_sptr &dataws,
+    const double peakWindowMaxInDSpacing) {
 
   // calculate from peaks in dpsacing to peak fit window in dspacing
   const auto windowsInDSpacing =
diff --git a/Framework/Algorithms/src/PaddingAndApodization.cpp b/Framework/Algorithms/src/PaddingAndApodization.cpp
index 9aaad011702..c4222210c4b 100644
--- a/Framework/Algorithms/src/PaddingAndApodization.cpp
+++ b/Framework/Algorithms/src/PaddingAndApodization.cpp
@@ -144,7 +144,7 @@ using fptr = double (*)(const double, const double);
  * @param method :: [input] The name of the chosen function
  * @returns :: pointer to the function
  */
-fptr PaddingAndApodization::getApodizationFunction(const std::string method) {
+fptr PaddingAndApodization::getApodizationFunction(const std::string &method) {
   if (method == "None") {
     return ApodizationFunctions::none;
   } else if (method == "Lorentz") {
diff --git a/Framework/Algorithms/src/ParallaxCorrection.cpp b/Framework/Algorithms/src/ParallaxCorrection.cpp
index 040288fdf75..7d93a5df9d6 100644
--- a/Framework/Algorithms/src/ParallaxCorrection.cpp
+++ b/Framework/Algorithms/src/ParallaxCorrection.cpp
@@ -104,10 +104,9 @@ void ParallaxCorrection::init() {
  * @param parallax : the correction formula for the bank
  * @param direction : the tube direction in the bank
  */
-void ParallaxCorrection::performCorrection(API::MatrixWorkspace_sptr outWS,
-                                           const std::vector<size_t> &indices,
-                                           const std::string &parallax,
-                                           const std::string &direction) {
+void ParallaxCorrection::performCorrection(
+    const API::MatrixWorkspace_sptr &outWS, const std::vector<size_t> &indices,
+    const std::string &parallax, const std::string &direction) {
   double t;
   mu::Parser muParser;
   muParser.DefineVar("t", &t);
diff --git a/Framework/Algorithms/src/PerformIndexOperations.cpp b/Framework/Algorithms/src/PerformIndexOperations.cpp
index 13f8589c3e9..9ba817654d2 100644
--- a/Framework/Algorithms/src/PerformIndexOperations.cpp
+++ b/Framework/Algorithms/src/PerformIndexOperations.cpp
@@ -10,6 +10,7 @@
 #include "MantidKernel/Strings.h"
 #include <boost/algorithm/string.hpp>
 #include <boost/regex.hpp>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -31,7 +32,7 @@ public:
     if (!this->isValid()) {
       return toAppend;
     } else {
-      MatrixWorkspace_sptr current = this->execute(inputWS);
+      MatrixWorkspace_sptr current = this->execute(std::move(inputWS));
       Mantid::API::AlgorithmManagerImpl &factory =
           Mantid::API::AlgorithmManager::Instance();
       auto conjoinWorkspaceAlg = factory.create("ConjoinWorkspaces");
diff --git a/Framework/Algorithms/src/Plus.cpp b/Framework/Algorithms/src/Plus.cpp
index b23ee7b1397..94d98002c26 100644
--- a/Framework/Algorithms/src/Plus.cpp
+++ b/Framework/Algorithms/src/Plus.cpp
@@ -145,8 +145,8 @@ void Plus::checkRequirements() {
  *  @return workspace unit compatibility flag
  */
 bool Plus::checkUnitCompatibility(
-    const API::MatrixWorkspace_const_sptr lhs,
-    const API::MatrixWorkspace_const_sptr rhs) const {
+    const API::MatrixWorkspace_const_sptr &lhs,
+    const API::MatrixWorkspace_const_sptr &rhs) const {
   if (lhs->size() > 1 && rhs->size() > 1) {
     if (lhs->YUnit() != rhs->YUnit()) {
       g_log.error("The two workspaces are not compatible because they have "
diff --git a/Framework/Algorithms/src/PolarizationCorrectionFredrikze.cpp b/Framework/Algorithms/src/PolarizationCorrectionFredrikze.cpp
index ae19aba0968..12e68df35d1 100644
--- a/Framework/Algorithms/src/PolarizationCorrectionFredrikze.cpp
+++ b/Framework/Algorithms/src/PolarizationCorrectionFredrikze.cpp
@@ -206,7 +206,7 @@ void PolarizationCorrectionFredrikze::init() {
 }
 
 WorkspaceGroup_sptr
-PolarizationCorrectionFredrikze::execPA(WorkspaceGroup_sptr inWS) {
+PolarizationCorrectionFredrikze::execPA(const WorkspaceGroup_sptr &inWS) {
 
   size_t itemIndex = 0;
   MatrixWorkspace_sptr Ipp =
@@ -276,7 +276,7 @@ PolarizationCorrectionFredrikze::execPA(WorkspaceGroup_sptr inWS) {
 }
 
 WorkspaceGroup_sptr
-PolarizationCorrectionFredrikze::execPNR(WorkspaceGroup_sptr inWS) {
+PolarizationCorrectionFredrikze::execPNR(const WorkspaceGroup_sptr &inWS) {
   size_t itemIndex = 0;
   MatrixWorkspace_sptr Ip =
       boost::dynamic_pointer_cast<MatrixWorkspace>(inWS->getItem(itemIndex++));
diff --git a/Framework/Algorithms/src/PolarizationCorrectionWildes.cpp b/Framework/Algorithms/src/PolarizationCorrectionWildes.cpp
index 4d7d409f427..328054b3448 100644
--- a/Framework/Algorithms/src/PolarizationCorrectionWildes.cpp
+++ b/Framework/Algorithms/src/PolarizationCorrectionWildes.cpp
@@ -374,8 +374,8 @@ double twoInputsErrorEstimate10(const double i00, const double e00,
   return std::sqrt(e10_I00 + e10_I11 + e10_F1 + e10_F2 + e10_P1 + e10_P2);
 }
 
-Mantid::API::MatrixWorkspace_sptr
-createWorkspaceWithHistory(Mantid::API::MatrixWorkspace_const_sptr inputWS) {
+Mantid::API::MatrixWorkspace_sptr createWorkspaceWithHistory(
+    const Mantid::API::MatrixWorkspace_const_sptr &inputWS) {
   Mantid::API::MatrixWorkspace_sptr outputWS =
       Mantid::DataObjects::create<Mantid::DataObjects::Workspace2D>(*inputWS);
   outputWS->history().addHistory(inputWS->getHistory());
diff --git a/Framework/Algorithms/src/PolarizationEfficiencyCor.cpp b/Framework/Algorithms/src/PolarizationEfficiencyCor.cpp
index 17af8f92b77..fb26c987fcb 100644
--- a/Framework/Algorithms/src/PolarizationEfficiencyCor.cpp
+++ b/Framework/Algorithms/src/PolarizationEfficiencyCor.cpp
@@ -309,8 +309,8 @@ MatrixWorkspace_sptr PolarizationEfficiencyCor::convertToHistogram(
 //----------------------------------------------------------------------------------------------
 /// Convert the efficiencies to histogram
 MatrixWorkspace_sptr
-PolarizationEfficiencyCor::interpolate(MatrixWorkspace_sptr efficiencies,
-                                       MatrixWorkspace_sptr inWS) {
+PolarizationEfficiencyCor::interpolate(const MatrixWorkspace_sptr &efficiencies,
+                                       const MatrixWorkspace_sptr &inWS) {
 
   efficiencies->setDistribution(true);
   auto alg = createChildAlgorithm("RebinToWorkspace");
diff --git a/Framework/Algorithms/src/Q1D2.cpp b/Framework/Algorithms/src/Q1D2.cpp
index 2689b26c7d9..8a098818986 100644
--- a/Framework/Algorithms/src/Q1D2.cpp
+++ b/Framework/Algorithms/src/Q1D2.cpp
@@ -4,7 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidAlgorithms/Q1D2.h"
+#include <utility>
+
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/CommonBinsValidator.h"
 #include "MantidAPI/HistogramValidator.h"
@@ -14,6 +15,7 @@
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 #include "MantidAlgorithms/GravitySANSHelper.h"
+#include "MantidAlgorithms/Q1D2.h"
 #include "MantidAlgorithms/Qhelper.h"
 #include "MantidDataObjects/Histogram1D.h"
 #include "MantidDataObjects/Workspace2D.h"
@@ -409,12 +411,13 @@ Q1D2::setUpOutputWorkspace(const std::vector<double> &binParams) const {
  */
 void Q1D2::calculateNormalization(
     const size_t wavStart, const size_t wsIndex,
-    API::MatrixWorkspace_const_sptr pixelAdj,
-    API::MatrixWorkspace_const_sptr wavePixelAdj, double const *const binNorms,
-    double const *const binNormEs, HistogramData::HistogramY::iterator norm,
+    const API::MatrixWorkspace_const_sptr &pixelAdj,
+    const API::MatrixWorkspace_const_sptr &wavePixelAdj,
+    double const *const binNorms, double const *const binNormEs,
+    HistogramData::HistogramY::iterator norm,
     HistogramData::HistogramY::iterator normETo2) const {
   double detectorAdj, detAdjErr;
-  pixelWeight(pixelAdj, wsIndex, detectorAdj, detAdjErr);
+  pixelWeight(std::move(pixelAdj), wsIndex, detectorAdj, detAdjErr);
   // use that the normalization array ends at the start of the error array
   for (auto n = norm, e = normETo2; n != normETo2; ++n, ++e) {
     *n = detectorAdj;
@@ -444,7 +447,7 @@ void Q1D2::calculateNormalization(
  *  @param[out] error the error on the weight, only non-zero if pixelAdj
  *  @throw LogicError if the solid angle is tiny or negative
  */
-void Q1D2::pixelWeight(API::MatrixWorkspace_const_sptr pixelAdj,
+void Q1D2::pixelWeight(const API::MatrixWorkspace_const_sptr &pixelAdj,
                        const size_t wsIndex, double &weight,
                        double &error) const {
   const auto &detectorInfo = m_dataWS->detectorInfo();
diff --git a/Framework/Algorithms/src/Q1DWeighted.cpp b/Framework/Algorithms/src/Q1DWeighted.cpp
index a01bcbade67..84c54c709cd 100644
--- a/Framework/Algorithms/src/Q1DWeighted.cpp
+++ b/Framework/Algorithms/src/Q1DWeighted.cpp
@@ -105,7 +105,7 @@ void Q1DWeighted::exec() {
  * initializes the user inputs
  * @param inputWS : input workspace
  */
-void Q1DWeighted::bootstrap(MatrixWorkspace_const_sptr inputWS) {
+void Q1DWeighted::bootstrap(const MatrixWorkspace_const_sptr &inputWS) {
   // Get pixel size and pixel sub-division
   m_pixelSizeX = getProperty("PixelSizeX");
   m_pixelSizeY = getProperty("PixelSizeY");
@@ -167,7 +167,7 @@ void Q1DWeighted::bootstrap(MatrixWorkspace_const_sptr inputWS) {
  * Performs the azimuthal averaging for each wavelength bin
  * @param inputWS : the input workspace
  */
-void Q1DWeighted::calculate(MatrixWorkspace_const_sptr inputWS) {
+void Q1DWeighted::calculate(const MatrixWorkspace_const_sptr &inputWS) {
   // Set up the progress
   Progress progress(this, 0.0, 1.0, m_nSpec * m_nLambda);
 
@@ -313,7 +313,7 @@ void Q1DWeighted::calculate(MatrixWorkspace_const_sptr inputWS) {
  * performs final averaging and sets the output workspaces
  * @param inputWS : the input workspace
  */
-void Q1DWeighted::finalize(MatrixWorkspace_const_sptr inputWS) {
+void Q1DWeighted::finalize(const MatrixWorkspace_const_sptr &inputWS) {
   MatrixWorkspace_sptr outputWS =
       createOutputWorkspace(inputWS, m_nQ, m_qBinEdges);
   setProperty("OutputWorkspace", outputWS);
@@ -383,7 +383,7 @@ void Q1DWeighted::finalize(MatrixWorkspace_const_sptr inputWS) {
  * @return output I(Q) workspace
  */
 MatrixWorkspace_sptr
-Q1DWeighted::createOutputWorkspace(MatrixWorkspace_const_sptr parent,
+Q1DWeighted::createOutputWorkspace(const MatrixWorkspace_const_sptr &parent,
                                    const size_t nBins,
                                    const std::vector<double> &binEdges) {
 
diff --git a/Framework/Algorithms/src/Qhelper.cpp b/Framework/Algorithms/src/Qhelper.cpp
index 00a6d9d05cc..d827741972e 100644
--- a/Framework/Algorithms/src/Qhelper.cpp
+++ b/Framework/Algorithms/src/Qhelper.cpp
@@ -4,9 +4,11 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidAlgorithms/Qhelper.h"
+#include <utility>
+
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/SpectrumInfo.h"
+#include "MantidAlgorithms/Qhelper.h"
 
 namespace Mantid {
 namespace Algorithms {
@@ -25,13 +27,13 @@ using namespace Geometry;
   @param qResolution: the QResolution workspace
   @throw invalid_argument if the workspaces are not mututially compatible
 */
-void Qhelper::examineInput(API::MatrixWorkspace_const_sptr dataWS,
-                           API::MatrixWorkspace_const_sptr binAdj,
-                           API::MatrixWorkspace_const_sptr detectAdj,
-                           API::MatrixWorkspace_const_sptr qResolution) {
+void Qhelper::examineInput(const API::MatrixWorkspace_const_sptr &dataWS,
+                           const API::MatrixWorkspace_const_sptr &binAdj,
+                           const API::MatrixWorkspace_const_sptr &detectAdj,
+                           const API::MatrixWorkspace_const_sptr &qResolution) {
 
   // Check the compatibility of dataWS, binAdj and detectAdj
-  examineInput(dataWS, binAdj, detectAdj);
+  examineInput(dataWS, std::move(binAdj), std::move(detectAdj));
 
   // Check the compatibility of the QResolution workspace
   if (qResolution) {
@@ -64,9 +66,9 @@ void Qhelper::examineInput(API::MatrixWorkspace_const_sptr dataWS,
   one bin
   @throw invalid_argument if the workspaces are not mututially compatible
 */
-void Qhelper::examineInput(API::MatrixWorkspace_const_sptr dataWS,
-                           API::MatrixWorkspace_const_sptr binAdj,
-                           API::MatrixWorkspace_const_sptr detectAdj) {
+void Qhelper::examineInput(const API::MatrixWorkspace_const_sptr &dataWS,
+                           const API::MatrixWorkspace_const_sptr &binAdj,
+                           const API::MatrixWorkspace_const_sptr &detectAdj) {
   if (dataWS->getNumberHistograms() < 1) {
     throw std::invalid_argument(
         "Empty data workspace passed, can not continue");
@@ -152,7 +154,7 @@ void Qhelper::examineInput(API::MatrixWorkspace_const_sptr dataWS,
  *  @param wsInd spectrum that is being analysed
  *  @return index number of the first bin to include in the calculation
  */
-size_t Qhelper::waveLengthCutOff(API::MatrixWorkspace_const_sptr dataWS,
+size_t Qhelper::waveLengthCutOff(const API::MatrixWorkspace_const_sptr &dataWS,
                                  const SpectrumInfo &spectrumInfo,
                                  const double RCut, const double WCut,
                                  const size_t wsInd) const {
@@ -188,8 +190,8 @@ sumOfCounts/sumOfNormFactors equals the
 *  @param sumOfNormFactors sum of normalisation factors
 */
 void Qhelper::outputParts(API::Algorithm *alg,
-                          API::MatrixWorkspace_sptr sumOfCounts,
-                          API::MatrixWorkspace_sptr sumOfNormFactors) {
+                          const API::MatrixWorkspace_sptr &sumOfCounts,
+                          const API::MatrixWorkspace_sptr &sumOfNormFactors) {
   std::string baseName = alg->getPropertyValue("OutputWorkspace");
 
   alg->declareProperty(
diff --git a/Framework/Algorithms/src/Qxy.cpp b/Framework/Algorithms/src/Qxy.cpp
index 91cf49b61f8..72923aa7c0d 100644
--- a/Framework/Algorithms/src/Qxy.cpp
+++ b/Framework/Algorithms/src/Qxy.cpp
@@ -402,8 +402,8 @@ double Qxy::getQminFromWs(const API::MatrixWorkspace &inputWorkspace) {
  * Qx.
  *  @return A pointer to the newly-created workspace
  */
-API::MatrixWorkspace_sptr
-Qxy::setUpOutputWorkspace(API::MatrixWorkspace_const_sptr inputWorkspace) {
+API::MatrixWorkspace_sptr Qxy::setUpOutputWorkspace(
+    const API::MatrixWorkspace_const_sptr &inputWorkspace) {
   const double max = getProperty("MaxQxy");
   const double delta = getProperty("DeltaQ");
   const bool log_binning = getProperty("IQxQyLogBinning");
diff --git a/Framework/Algorithms/src/RadiusSum.cpp b/Framework/Algorithms/src/RadiusSum.cpp
index 3000143742d..1eb1c907f72 100644
--- a/Framework/Algorithms/src/RadiusSum.cpp
+++ b/Framework/Algorithms/src/RadiusSum.cpp
@@ -272,7 +272,7 @@ void RadiusSum::inputValidationSanityCheck() {
  * @return True if it is an instrument related workspace.
  */
 bool RadiusSum::inputWorkspaceHasInstrumentAssociated(
-    API::MatrixWorkspace_sptr inWS) {
+    const API::MatrixWorkspace_sptr &inWS) {
   return inWS->getAxis(1)->isSpectra();
 }
 
@@ -302,7 +302,7 @@ std::vector<double> RadiusSum::getBoundariesOfInputWorkspace() {
  *Xmin, Xmax, Ymin, Ymax
  */
 std::vector<double>
-RadiusSum::getBoundariesOfNumericImage(API::MatrixWorkspace_sptr inWS) {
+RadiusSum::getBoundariesOfNumericImage(const API::MatrixWorkspace_sptr &inWS) {
 
   // horizontal axis
 
@@ -359,7 +359,7 @@ RadiusSum::getBoundariesOfNumericImage(API::MatrixWorkspace_sptr inWS) {
  *Xmin, Xmax, Ymin, Ymax, Zmin, Zmax
  */
 std::vector<double>
-RadiusSum::getBoundariesOfInstrument(API::MatrixWorkspace_sptr inWS) {
+RadiusSum::getBoundariesOfInstrument(const API::MatrixWorkspace_sptr &inWS) {
 
   // This function is implemented based in the following assumption:
   //   - The workspace is composed by spectrum with associated spectrum No which
@@ -521,7 +521,8 @@ void RadiusSum::numBinsIsReasonable() {
                     << '\n';
 }
 
-double RadiusSum::getMinBinSizeForInstrument(API::MatrixWorkspace_sptr inWS) {
+double
+RadiusSum::getMinBinSizeForInstrument(const API::MatrixWorkspace_sptr &inWS) {
   // Assumption made: the detectors are placed one after the other, so the
   // minimum
   // reasonalbe size for the bin is the width of one detector.
@@ -538,7 +539,8 @@ double RadiusSum::getMinBinSizeForInstrument(API::MatrixWorkspace_sptr inWS) {
   throw std::invalid_argument("Did not find any non monitor detector position");
 }
 
-double RadiusSum::getMinBinSizeForNumericImage(API::MatrixWorkspace_sptr inWS) {
+double
+RadiusSum::getMinBinSizeForNumericImage(const API::MatrixWorkspace_sptr &inWS) {
   // The pixel dimensions:
   //  - width: image width/ number of pixels in one row
   //  - height: image height/ number of pixels in one column
diff --git a/Framework/Algorithms/src/Rebin.cpp b/Framework/Algorithms/src/Rebin.cpp
index 5e8993c4a93..7343535d6f4 100644
--- a/Framework/Algorithms/src/Rebin.cpp
+++ b/Framework/Algorithms/src/Rebin.cpp
@@ -309,8 +309,9 @@ void Rebin::exec() {
  *  @param outputWS :: The output workspace
  *  @param hist ::    The index of the current histogram
  */
-void Rebin::propagateMasks(API::MatrixWorkspace_const_sptr inputWS,
-                           API::MatrixWorkspace_sptr outputWS, int hist) {
+void Rebin::propagateMasks(const API::MatrixWorkspace_const_sptr &inputWS,
+                           const API::MatrixWorkspace_sptr &outputWS,
+                           int hist) {
   // Not too happy with the efficiency of this way of doing it, but it's a lot
   // simpler to use the
   // existing rebin algorithm to distribute the weights than to re-implement it
diff --git a/Framework/Algorithms/src/ReflectometryBackgroundSubtraction.cpp b/Framework/Algorithms/src/ReflectometryBackgroundSubtraction.cpp
index 28e19f92abc..76639056586 100644
--- a/Framework/Algorithms/src/ReflectometryBackgroundSubtraction.cpp
+++ b/Framework/Algorithms/src/ReflectometryBackgroundSubtraction.cpp
@@ -50,7 +50,8 @@ const std::string ReflectometryBackgroundSubtraction::summary() const {
  * background
  */
 void ReflectometryBackgroundSubtraction::calculateAverageSpectrumBackground(
-    MatrixWorkspace_sptr inputWS, const std::vector<specnum_t> &spectraList) {
+    const MatrixWorkspace_sptr &inputWS,
+    const std::vector<specnum_t> &spectraList) {
 
   auto alg = this->createChildAlgorithm("GroupDetectors");
   alg->setProperty("InputWorkspace", inputWS);
@@ -156,7 +157,7 @@ void ReflectometryBackgroundSubtraction::calculatePolynomialBackground(
  * @param indexList :: the ranges of the background region
  */
 void ReflectometryBackgroundSubtraction::calculatePixelBackground(
-    MatrixWorkspace_sptr inputWS, const std::vector<double> &indexList) {
+    const MatrixWorkspace_sptr &inputWS, const std::vector<double> &indexList) {
 
   const std::vector<int> backgroundRange{static_cast<int>(indexList.front()),
                                          static_cast<int>(indexList.back())};
diff --git a/Framework/Algorithms/src/ReflectometryBeamStatistics.cpp b/Framework/Algorithms/src/ReflectometryBeamStatistics.cpp
index 38ddb2048d4..5ccc81e765e 100644
--- a/Framework/Algorithms/src/ReflectometryBeamStatistics.cpp
+++ b/Framework/Algorithms/src/ReflectometryBeamStatistics.cpp
@@ -66,8 +66,8 @@ const std::string
  * @return the slit gap, in meters
  */
 double ReflectometryBeamStatistics::slitSeparation(
-    Geometry::Instrument_const_sptr instrument, const std::string &slit1Name,
-    const std::string &slit2Name) {
+    const Geometry::Instrument_const_sptr &instrument,
+    const std::string &slit1Name, const std::string &slit2Name) {
   auto slit1 = instrument->getComponentByName(slit1Name);
   auto slit2 = instrument->getComponentByName(slit2Name);
   return (slit1->getPos() - slit2->getPos()).norm();
diff --git a/Framework/Algorithms/src/ReflectometryReductionOne2.cpp b/Framework/Algorithms/src/ReflectometryReductionOne2.cpp
index 9f887d7e93c..b78e1286933 100644
--- a/Framework/Algorithms/src/ReflectometryReductionOne2.cpp
+++ b/Framework/Algorithms/src/ReflectometryReductionOne2.cpp
@@ -25,6 +25,7 @@
 #include "MantidKernel/UnitFactory.h"
 
 #include <algorithm>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -344,7 +345,7 @@ std::string ReflectometryReductionOne2::createDebugWorkspaceName(
  * and is incremented after the workspace is output
  */
 void ReflectometryReductionOne2::outputDebugWorkspace(
-    MatrixWorkspace_sptr ws, const std::string &wsName,
+    const MatrixWorkspace_sptr &ws, const std::string &wsName,
     const std::string &wsSuffix, const bool debug, int &step) {
   // Nothing to do if debug is not enabled
   if (debug) {
@@ -503,7 +504,7 @@ MatrixWorkspace_sptr ReflectometryReductionOne2::backgroundSubtraction(
  * @return : corrected workspace
  */
 MatrixWorkspace_sptr ReflectometryReductionOne2::transOrAlgCorrection(
-    MatrixWorkspace_sptr detectorWS, const bool detectorWSReduced) {
+    const MatrixWorkspace_sptr &detectorWS, const bool detectorWSReduced) {
 
   MatrixWorkspace_sptr normalized;
   MatrixWorkspace_sptr transRun = getProperty("FirstTransmissionRun");
@@ -526,7 +527,7 @@ MatrixWorkspace_sptr ReflectometryReductionOne2::transOrAlgCorrection(
  * @return :: the input workspace normalized by transmission
  */
 MatrixWorkspace_sptr ReflectometryReductionOne2::transmissionCorrection(
-    MatrixWorkspace_sptr detectorWS, const bool detectorWSReduced) {
+    const MatrixWorkspace_sptr &detectorWS, const bool detectorWSReduced) {
 
   MatrixWorkspace_sptr transmissionWS = getProperty("FirstTransmissionRun");
   auto transmissionWSName = transmissionWS->getName();
@@ -615,7 +616,7 @@ MatrixWorkspace_sptr ReflectometryReductionOne2::transmissionCorrection(
  * @return : corrected workspace
  */
 MatrixWorkspace_sptr ReflectometryReductionOne2::algorithmicCorrection(
-    MatrixWorkspace_sptr detectorWS) {
+    const MatrixWorkspace_sptr &detectorWS) {
 
   const std::string corrAlgName = getProperty("CorrectionAlgorithm");
 
@@ -643,7 +644,7 @@ MatrixWorkspace_sptr ReflectometryReductionOne2::algorithmicCorrection(
  * @return : output workspace in Q
  */
 MatrixWorkspace_sptr
-ReflectometryReductionOne2::convertToQ(MatrixWorkspace_sptr inputWS) {
+ReflectometryReductionOne2::convertToQ(const MatrixWorkspace_sptr &inputWS) {
   bool const moreThanOneDetector = inputWS->getDetector(0)->nDets() > 1;
   bool const shouldCorrectAngle =
       !(*getProperty("ThetaIn")).isDefault() && !summingInQ();
@@ -807,7 +808,7 @@ size_t ReflectometryReductionOne2::twoThetaRDetectorIdx(
 }
 
 void ReflectometryReductionOne2::findWavelengthMinMax(
-    MatrixWorkspace_sptr inputWS) {
+    const MatrixWorkspace_sptr &inputWS) {
 
   // Get the max/min wavelength of region of interest
   const double lambdaMin = getProperty("WavelengthMin");
@@ -879,8 +880,8 @@ size_t ReflectometryReductionOne2::findIvsLamRangeMaxDetector(
 }
 
 double ReflectometryReductionOne2::findIvsLamRangeMin(
-    MatrixWorkspace_sptr detectorWS, const std::vector<size_t> &detectors,
-    const double lambda) {
+    const MatrixWorkspace_sptr &detectorWS,
+    const std::vector<size_t> &detectors, const double lambda) {
   double projectedMin = 0.0;
 
   const size_t spIdx = findIvsLamRangeMinDetector(detectors);
@@ -898,8 +899,8 @@ double ReflectometryReductionOne2::findIvsLamRangeMin(
 }
 
 double ReflectometryReductionOne2::findIvsLamRangeMax(
-    MatrixWorkspace_sptr detectorWS, const std::vector<size_t> &detectors,
-    const double lambda) {
+    const MatrixWorkspace_sptr &detectorWS,
+    const std::vector<size_t> &detectors, const double lambda) {
   double projectedMax = 0.0;
 
   const size_t spIdx = findIvsLamRangeMaxDetector(detectors);
@@ -928,9 +929,9 @@ double ReflectometryReductionOne2::findIvsLamRangeMax(
  * @param projectedMax [out] : the end of the resulting projected range
  */
 void ReflectometryReductionOne2::findIvsLamRange(
-    MatrixWorkspace_sptr detectorWS, const std::vector<size_t> &detectors,
-    const double lambdaMin, const double lambdaMax, double &projectedMin,
-    double &projectedMax) {
+    const MatrixWorkspace_sptr &detectorWS,
+    const std::vector<size_t> &detectors, const double lambdaMin,
+    const double lambdaMax, double &projectedMin, double &projectedMax) {
 
   // Get the new max and min X values of the projected (virtual) lambda range
   projectedMin = findIvsLamRangeMin(detectorWS, detectors, lambdaMin);
@@ -952,8 +953,8 @@ void ReflectometryReductionOne2::findIvsLamRange(
  *
  * @return : a 1D workspace where y values are all zero
  */
-MatrixWorkspace_sptr
-ReflectometryReductionOne2::constructIvsLamWS(MatrixWorkspace_sptr detectorWS) {
+MatrixWorkspace_sptr ReflectometryReductionOne2::constructIvsLamWS(
+    const MatrixWorkspace_sptr &detectorWS) {
 
   // There is one output spectrum for each detector group
   const size_t numGroups = detectorGroups().size();
@@ -1001,7 +1002,7 @@ ReflectometryReductionOne2::constructIvsLamWS(MatrixWorkspace_sptr detectorWS) {
  * @return :: the output workspace in wavelength
  */
 MatrixWorkspace_sptr
-ReflectometryReductionOne2::sumInQ(MatrixWorkspace_sptr detectorWS) {
+ReflectometryReductionOne2::sumInQ(const MatrixWorkspace_sptr &detectorWS) {
 
   // Construct the output array in virtual lambda
   MatrixWorkspace_sptr IvsLam = constructIvsLamWS(detectorWS);
@@ -1078,7 +1079,7 @@ void ReflectometryReductionOne2::sumInQProcessValue(
     const int inputIdx, const double twoTheta, const double bTwoTheta,
     const HistogramX &inputX, const HistogramY &inputY,
     const HistogramE &inputE, const std::vector<size_t> &detectors,
-    const size_t outSpecIdx, MatrixWorkspace_sptr IvsLam,
+    const size_t outSpecIdx, const MatrixWorkspace_sptr &IvsLam,
     std::vector<double> &outputE) {
 
   // Check whether there are any counts (if not, nothing to share)
@@ -1097,7 +1098,7 @@ void ReflectometryReductionOne2::sumInQProcessValue(
                           lambdaVMin, lambdaVMax);
   // Share the input counts into the output array
   sumInQShareCounts(inputCounts, inputE[inputIdx], bLambda, lambdaVMin,
-                    lambdaVMax, outSpecIdx, IvsLam, outputE);
+                    lambdaVMax, outSpecIdx, std::move(IvsLam), outputE);
 }
 
 /**
@@ -1118,7 +1119,7 @@ void ReflectometryReductionOne2::sumInQProcessValue(
 void ReflectometryReductionOne2::sumInQShareCounts(
     const double inputCounts, const double inputErr, const double bLambda,
     const double lambdaMin, const double lambdaMax, const size_t outSpecIdx,
-    MatrixWorkspace_sptr IvsLam, std::vector<double> &outputE) {
+    const MatrixWorkspace_sptr &IvsLam, std::vector<double> &outputE) {
   // Check that we have histogram data
   const auto &outputX = IvsLam->dataX(outSpecIdx);
   auto &outputY = IvsLam->dataY(outSpecIdx);
@@ -1239,7 +1240,8 @@ Check whether the spectra for the given workspaces are the same.
 exception. Otherwise a warning is generated.
 */
 void ReflectometryReductionOne2::verifySpectrumMaps(
-    MatrixWorkspace_const_sptr ws1, MatrixWorkspace_const_sptr ws2) {
+    const MatrixWorkspace_const_sptr &ws1,
+    const MatrixWorkspace_const_sptr &ws2) {
 
   bool mismatch = false;
   // Check that the number of histograms is the same
diff --git a/Framework/Algorithms/src/ReflectometryReductionOneAuto2.cpp b/Framework/Algorithms/src/ReflectometryReductionOneAuto2.cpp
index 2ee23048c2b..d9bfc3dae5c 100644
--- a/Framework/Algorithms/src/ReflectometryReductionOneAuto2.cpp
+++ b/Framework/Algorithms/src/ReflectometryReductionOneAuto2.cpp
@@ -172,7 +172,7 @@ ReflectometryReductionOneAuto2::validateInputs() {
 }
 
 std::string ReflectometryReductionOneAuto2::getRunNumberForWorkspaceGroup(
-    WorkspaceGroup_const_sptr group) {
+    const WorkspaceGroup_const_sptr &group) {
   // Return the run number for the first child workspace
   if (!group)
     throw std::runtime_error("Invalid workspace group type");
@@ -495,8 +495,8 @@ void ReflectometryReductionOneAuto2::exec() {
  * @param inputWS :: the input workspace
  * @return :: the names of the detectors of interest
  */
-std::vector<std::string>
-ReflectometryReductionOneAuto2::getDetectorNames(MatrixWorkspace_sptr inputWS) {
+std::vector<std::string> ReflectometryReductionOneAuto2::getDetectorNames(
+    const MatrixWorkspace_sptr &inputWS) {
 
   std::vector<std::string> wsIndices;
   boost::split(wsIndices, m_processingInstructionsWorkspaceIndex,
@@ -572,8 +572,8 @@ MatrixWorkspace_sptr ReflectometryReductionOneAuto2::correctDetectorPositions(
  * @param inputWS :: the input workspace
  * @return :: the angle of the detector (only the first detector is considered)
  */
-double
-ReflectometryReductionOneAuto2::calculateTheta(MatrixWorkspace_sptr inputWS) {
+double ReflectometryReductionOneAuto2::calculateTheta(
+    const MatrixWorkspace_sptr &inputWS) {
 
   const auto detectorsOfInterest = getDetectorNames(inputWS);
 
@@ -600,7 +600,7 @@ ReflectometryReductionOneAuto2::calculateTheta(MatrixWorkspace_sptr inputWS) {
  * @param instrument :: The instrument attached to the workspace
  */
 void ReflectometryReductionOneAuto2::populateAlgorithmicCorrectionProperties(
-    IAlgorithm_sptr alg, Instrument_const_sptr instrument) {
+    const IAlgorithm_sptr &alg, const Instrument_const_sptr &instrument) {
 
   // With algorithmic corrections, monitors should not be integrated, see below
 
@@ -664,7 +664,7 @@ void ReflectometryReductionOneAuto2::populateAlgorithmicCorrectionProperties(
 }
 
 auto ReflectometryReductionOneAuto2::getRebinParams(
-    MatrixWorkspace_sptr inputWS, const double theta) -> RebinParams {
+    const MatrixWorkspace_sptr &inputWS, const double theta) -> RebinParams {
   bool qMinIsDefault = true, qMaxIsDefault = true;
   auto const qMin = getPropertyOrDefault("MomentumTransferMin",
                                          inputWS->x(0).front(), qMinIsDefault);
@@ -681,7 +681,7 @@ auto ReflectometryReductionOneAuto2::getRebinParams(
  * @return :: the rebin step in Q, or none if it could not be found
  */
 boost::optional<double>
-ReflectometryReductionOneAuto2::getQStep(MatrixWorkspace_sptr inputWS,
+ReflectometryReductionOneAuto2::getQStep(const MatrixWorkspace_sptr &inputWS,
                                          const double theta) {
   Property *qStepProp = getProperty("MomentumTransferStep");
   double qstep;
@@ -718,9 +718,8 @@ ReflectometryReductionOneAuto2::getQStep(MatrixWorkspace_sptr inputWS,
  * and max)
  * @return :: the output workspace
  */
-MatrixWorkspace_sptr
-ReflectometryReductionOneAuto2::rebinAndScale(MatrixWorkspace_sptr inputWS,
-                                              RebinParams const &params) {
+MatrixWorkspace_sptr ReflectometryReductionOneAuto2::rebinAndScale(
+    const MatrixWorkspace_sptr &inputWS, RebinParams const &params) {
   // Rebin
   IAlgorithm_sptr algRebin = createChildAlgorithm("Rebin");
   algRebin->initialize();
@@ -747,7 +746,7 @@ ReflectometryReductionOneAuto2::rebinAndScale(MatrixWorkspace_sptr inputWS,
 }
 
 MatrixWorkspace_sptr
-ReflectometryReductionOneAuto2::cropQ(MatrixWorkspace_sptr inputWS,
+ReflectometryReductionOneAuto2::cropQ(const MatrixWorkspace_sptr &inputWS,
                                       RebinParams const &params) {
   IAlgorithm_sptr algCrop = createChildAlgorithm("CropWorkspace");
   algCrop->initialize();
diff --git a/Framework/Algorithms/src/ReflectometryReductionOneAuto3.cpp b/Framework/Algorithms/src/ReflectometryReductionOneAuto3.cpp
index c4c447f983d..365b8b41fa1 100644
--- a/Framework/Algorithms/src/ReflectometryReductionOneAuto3.cpp
+++ b/Framework/Algorithms/src/ReflectometryReductionOneAuto3.cpp
@@ -163,7 +163,7 @@ ReflectometryReductionOneAuto3::validateInputs() {
 }
 
 std::string ReflectometryReductionOneAuto3::getRunNumberForWorkspaceGroup(
-    WorkspaceGroup_const_sptr group) {
+    const WorkspaceGroup_const_sptr &group) {
   // Return the run number for the first child workspace
   if (!group)
     throw std::runtime_error("Invalid workspace group type");
@@ -471,8 +471,8 @@ void ReflectometryReductionOneAuto3::exec() {
  * @param inputWS :: the input workspace
  * @return :: the names of the detectors of interest
  */
-std::vector<std::string>
-ReflectometryReductionOneAuto3::getDetectorNames(MatrixWorkspace_sptr inputWS) {
+std::vector<std::string> ReflectometryReductionOneAuto3::getDetectorNames(
+    const MatrixWorkspace_sptr &inputWS) {
   std::vector<std::string> wsIndices;
   boost::split(wsIndices, m_processingInstructionsWorkspaceIndex,
                boost::is_any_of(":,-+"));
@@ -546,8 +546,8 @@ MatrixWorkspace_sptr ReflectometryReductionOneAuto3::correctDetectorPositions(
  * @param inputWS :: the input workspace
  * @return :: the angle of the detector (only the first detector is considered)
  */
-double
-ReflectometryReductionOneAuto3::calculateTheta(MatrixWorkspace_sptr inputWS) {
+double ReflectometryReductionOneAuto3::calculateTheta(
+    const MatrixWorkspace_sptr &inputWS) {
   const auto detectorsOfInterest = getDetectorNames(inputWS);
 
   // Detectors of interest may be empty. This happens for instance when we input
@@ -573,7 +573,7 @@ ReflectometryReductionOneAuto3::calculateTheta(MatrixWorkspace_sptr inputWS) {
  * @param instrument :: The instrument attached to the workspace
  */
 void ReflectometryReductionOneAuto3::populateAlgorithmicCorrectionProperties(
-    IAlgorithm_sptr alg, Instrument_const_sptr instrument) {
+    const IAlgorithm_sptr &alg, const Instrument_const_sptr &instrument) {
 
   // With algorithmic corrections, monitors should not be integrated, see below
   const std::string correctionAlgorithm = getProperty("CorrectionAlgorithm");
@@ -635,7 +635,7 @@ void ReflectometryReductionOneAuto3::populateAlgorithmicCorrectionProperties(
 }
 
 auto ReflectometryReductionOneAuto3::getRebinParams(
-    MatrixWorkspace_sptr inputWS, const double theta) -> RebinParams {
+    const MatrixWorkspace_sptr &inputWS, const double theta) -> RebinParams {
   bool qMinIsDefault = true, qMaxIsDefault = true;
   auto const qMin = getPropertyOrDefault("MomentumTransferMin",
                                          inputWS->x(0).front(), qMinIsDefault);
@@ -652,7 +652,7 @@ auto ReflectometryReductionOneAuto3::getRebinParams(
  * @return :: the rebin step in Q, or none if it could not be found
  */
 boost::optional<double>
-ReflectometryReductionOneAuto3::getQStep(MatrixWorkspace_sptr inputWS,
+ReflectometryReductionOneAuto3::getQStep(const MatrixWorkspace_sptr &inputWS,
                                          const double theta) {
   Property *qStepProp = getProperty("MomentumTransferStep");
   double qstep;
@@ -690,7 +690,7 @@ ReflectometryReductionOneAuto3::getQStep(MatrixWorkspace_sptr inputWS,
  * @return :: the output workspace
  */
 MatrixWorkspace_sptr
-ReflectometryReductionOneAuto3::rebin(MatrixWorkspace_sptr inputWS,
+ReflectometryReductionOneAuto3::rebin(const MatrixWorkspace_sptr &inputWS,
                                       const RebinParams &params) {
   IAlgorithm_sptr algRebin = createChildAlgorithm("Rebin");
   algRebin->initialize();
diff --git a/Framework/Algorithms/src/ReflectometryWorkflowBase.cpp b/Framework/Algorithms/src/ReflectometryWorkflowBase.cpp
index 5712e3db691..7753d5f99c8 100644
--- a/Framework/Algorithms/src/ReflectometryWorkflowBase.cpp
+++ b/Framework/Algorithms/src/ReflectometryWorkflowBase.cpp
@@ -4,9 +4,11 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidAlgorithms/ReflectometryWorkflowBase.h"
+#include <utility>
+
 #include "MantidAPI/BoostOptionalToAlgorithmProperty.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
+#include "MantidAlgorithms/ReflectometryWorkflowBase.h"
 #include "MantidKernel/ArrayProperty.h"
 #include "MantidKernel/BoundedValidator.h"
 #include "MantidKernel/CompositeValidator.h"
@@ -196,12 +198,12 @@ ReflectometryWorkflowBase::OptionalMinMax
 ReflectometryWorkflowBase::getOptionalMinMax(
     Mantid::API::Algorithm *const alg, const std::string &minProperty,
     const std::string &maxProperty,
-    Mantid::Geometry::Instrument_const_sptr inst, std::string minIdfName,
-    std::string maxIdfName) const {
-  const auto min = checkForOptionalInstrumentDefault<double>(alg, minProperty,
-                                                             inst, minIdfName);
-  const auto max = checkForOptionalInstrumentDefault<double>(alg, maxProperty,
-                                                             inst, maxIdfName);
+    const Mantid::Geometry::Instrument_const_sptr &inst,
+    const std::string &minIdfName, const std::string &maxIdfName) const {
+  const auto min = checkForOptionalInstrumentDefault<double>(
+      alg, minProperty, inst, std::move(minIdfName));
+  const auto max = checkForOptionalInstrumentDefault<double>(
+      alg, maxProperty, inst, std::move(maxIdfName));
   if (min.is_initialized() && max.is_initialized()) {
     MinMax result = getMinMax(minProperty, maxProperty);
     return OptionalMinMax(result);
@@ -361,7 +363,7 @@ void ReflectometryWorkflowBase::getTransmissionRunInfo(
  * @return The cropped and corrected monitor workspace.
  */
 MatrixWorkspace_sptr ReflectometryWorkflowBase::toLamMonitor(
-    const MatrixWorkspace_sptr &toConvert, const OptionalInteger monitorIndex,
+    const MatrixWorkspace_sptr &toConvert, const OptionalInteger &monitorIndex,
     const OptionalMinMax &backgroundMinMax) {
   // Convert Units.
   auto convertUnitsAlg = this->createChildAlgorithm("ConvertUnits");
@@ -473,9 +475,9 @@ ReflectometryWorkflowBase::makeUnityWorkspace(const HistogramX &x) {
  * @return Tuple of detector and monitor workspaces
  */
 ReflectometryWorkflowBase::DetectorMonitorWorkspacePair
-ReflectometryWorkflowBase::toLam(MatrixWorkspace_sptr toConvert,
+ReflectometryWorkflowBase::toLam(const MatrixWorkspace_sptr &toConvert,
                                  const std::string &processingCommands,
-                                 const OptionalInteger monitorIndex,
+                                 const OptionalInteger &monitorIndex,
                                  const MinMax &wavelengthMinMax,
                                  const OptionalMinMax &backgroundMinMax) {
   // Detector Workspace Processing
diff --git a/Framework/Algorithms/src/ReflectometryWorkflowBase2.cpp b/Framework/Algorithms/src/ReflectometryWorkflowBase2.cpp
index a789763307e..5336598c542 100644
--- a/Framework/Algorithms/src/ReflectometryWorkflowBase2.cpp
+++ b/Framework/Algorithms/src/ReflectometryWorkflowBase2.cpp
@@ -4,12 +4,14 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidAlgorithms/ReflectometryWorkflowBase2.h"
+#include <utility>
+
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/BoostOptionalToAlgorithmProperty.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
+#include "MantidAlgorithms/ReflectometryWorkflowBase2.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidIndexing/IndexInfo.h"
 #include "MantidKernel/ArrayProperty.h"
@@ -40,16 +42,15 @@ int convertStringNumToInt(const std::string &string) {
 }
 
 std::string convertToWorkspaceIndex(const std::string &spectrumNumber,
-                                    MatrixWorkspace_const_sptr ws) {
+                                    const MatrixWorkspace_const_sptr &ws) {
   auto specNum = convertStringNumToInt(spectrumNumber);
   std::string wsIdx = std::to_string(
       ws->getIndexFromSpectrumNumber(static_cast<Mantid::specnum_t>(specNum)));
   return wsIdx;
 }
 
-std::string
-convertProcessingInstructionsToWorkspaceIndices(const std::string &instructions,
-                                                MatrixWorkspace_const_sptr ws) {
+std::string convertProcessingInstructionsToWorkspaceIndices(
+    const std::string &instructions, const MatrixWorkspace_const_sptr &ws) {
   std::string converted = "";
   std::string currentNumber = "";
   std::string ignoreThese = "-,:+";
@@ -79,7 +80,7 @@ convertProcessingInstructionsToWorkspaceIndices(const std::string &instructions,
  */
 std::vector<size_t>
 getProcessingInstructionsAsIndices(std::string const &instructions,
-                                   MatrixWorkspace_sptr workspace) {
+                                   const MatrixWorkspace_sptr &workspace) {
   auto instructionsInWSIndex =
       convertProcessingInstructionsToWorkspaceIndices(instructions, workspace);
   auto groups =
@@ -517,8 +518,8 @@ ReflectometryWorkflowBase2::validateWavelengthRanges() const {
  * @param inputWS :: the workspace to convert
  * @return :: the workspace in wavelength
  */
-MatrixWorkspace_sptr
-ReflectometryWorkflowBase2::convertToWavelength(MatrixWorkspace_sptr inputWS) {
+MatrixWorkspace_sptr ReflectometryWorkflowBase2::convertToWavelength(
+    const MatrixWorkspace_sptr &inputWS) {
 
   auto convertUnitsAlg = createChildAlgorithm("ConvertUnits");
   convertUnitsAlg->initialize();
@@ -541,8 +542,8 @@ ReflectometryWorkflowBase2::convertToWavelength(MatrixWorkspace_sptr inputWS) {
  * @return :: the cropped workspace
  */
 MatrixWorkspace_sptr ReflectometryWorkflowBase2::cropWavelength(
-    MatrixWorkspace_sptr inputWS, const bool useArgs, const double argMin,
-    const double argMax) {
+    const MatrixWorkspace_sptr &inputWS, const bool useArgs,
+    const double argMin, const double argMax) {
 
   double wavelengthMin = 0.0;
   double wavelengthMax = 0.0;
@@ -584,7 +585,7 @@ MatrixWorkspace_sptr ReflectometryWorkflowBase2::cropWavelength(
 MatrixWorkspace_sptr
 ReflectometryWorkflowBase2::makeDetectorWS(MatrixWorkspace_sptr inputWS,
                                            const bool convert, const bool sum) {
-  auto detectorWS = inputWS;
+  auto detectorWS = std::move(inputWS);
 
   if (sum) {
     // Use GroupDetectors to extract and sum the detectors of interest
@@ -635,7 +636,7 @@ ReflectometryWorkflowBase2::makeDetectorWS(MatrixWorkspace_sptr inputWS,
  * @return :: the monitor workspace in wavelength
  */
 MatrixWorkspace_sptr
-ReflectometryWorkflowBase2::makeMonitorWS(MatrixWorkspace_sptr inputWS,
+ReflectometryWorkflowBase2::makeMonitorWS(const MatrixWorkspace_sptr &inputWS,
                                           const bool integratedMonitors) {
 
   // Extract the monitor workspace
@@ -697,7 +698,8 @@ ReflectometryWorkflowBase2::makeMonitorWS(MatrixWorkspace_sptr inputWS,
  * @return :: the rebinned detector workspace
  */
 MatrixWorkspace_sptr ReflectometryWorkflowBase2::rebinDetectorsToMonitors(
-    MatrixWorkspace_sptr detectorWS, MatrixWorkspace_sptr monitorWS) {
+    const MatrixWorkspace_sptr &detectorWS,
+    const MatrixWorkspace_sptr &monitorWS) {
 
   auto rebin = createChildAlgorithm("RebinToWorkspace");
   rebin->initialize();
@@ -715,7 +717,7 @@ MatrixWorkspace_sptr ReflectometryWorkflowBase2::rebinDetectorsToMonitors(
  * @param instrument :: the instrument attached to the workspace
  */
 void ReflectometryWorkflowBase2::populateMonitorProperties(
-    IAlgorithm_sptr alg, Instrument_const_sptr instrument) {
+    const IAlgorithm_sptr &alg, const Instrument_const_sptr &instrument) {
 
   const auto startOverlap = checkForOptionalInstrumentDefault<double>(
       this, "StartOverlap", instrument, "TransRunStartOverlap");
@@ -769,7 +771,8 @@ void ReflectometryWorkflowBase2::populateMonitorProperties(
  * @return :: processing instructions as a string
  */
 std::string ReflectometryWorkflowBase2::findProcessingInstructions(
-    Instrument_const_sptr instrument, MatrixWorkspace_sptr inputWS) const {
+    const Instrument_const_sptr &instrument,
+    const MatrixWorkspace_sptr &inputWS) const {
 
   const std::string analysisMode = getProperty("AnalysisMode");
 
@@ -815,7 +818,7 @@ std::string ReflectometryWorkflowBase2::findProcessingInstructions(
  * @return Boolean, whether or not any transmission runs were found
  */
 bool ReflectometryWorkflowBase2::populateTransmissionProperties(
-    IAlgorithm_sptr alg) const {
+    const IAlgorithm_sptr &alg) const {
 
   bool transRunsExist = false;
 
@@ -845,9 +848,8 @@ bool ReflectometryWorkflowBase2::populateTransmissionProperties(
  * @return :: the value of theta found from the logs
  * @throw :: NotFoundError if the log value was not found
  */
-double
-ReflectometryWorkflowBase2::getThetaFromLogs(MatrixWorkspace_sptr inputWs,
-                                             const std::string &logName) {
+double ReflectometryWorkflowBase2::getThetaFromLogs(
+    const MatrixWorkspace_sptr &inputWs, const std::string &logName) {
   double theta = -1.;
   const Mantid::API::Run &run = inputWs->run();
   Property *logData = run.getLogData(logName);
@@ -884,7 +886,7 @@ ReflectometryWorkflowBase2::getRunNumber(MatrixWorkspace const &ws) const {
 std::string
 ReflectometryWorkflowBase2::convertProcessingInstructionsToSpectrumNumbers(
     const std::string &instructions,
-    Mantid::API::MatrixWorkspace_const_sptr ws) const {
+    const Mantid::API::MatrixWorkspace_const_sptr &ws) const {
   std::string converted = "";
   std::string currentNumber = "";
   std::string ignoreThese = "-,:+";
@@ -905,7 +907,7 @@ ReflectometryWorkflowBase2::convertProcessingInstructionsToSpectrumNumbers(
 }
 std::string ReflectometryWorkflowBase2::convertToSpectrumNumber(
     const std::string &workspaceIndex,
-    Mantid::API::MatrixWorkspace_const_sptr ws) const {
+    const Mantid::API::MatrixWorkspace_const_sptr &ws) const {
   auto wsIndx = convertStringNumToInt(workspaceIndex);
   std::string specId = std::to_string(
       static_cast<int32_t>(ws->indexInfo().spectrumNumber(wsIndx)));
@@ -913,7 +915,8 @@ std::string ReflectometryWorkflowBase2::convertToSpectrumNumber(
 }
 
 void ReflectometryWorkflowBase2::convertProcessingInstructions(
-    Instrument_const_sptr instrument, MatrixWorkspace_sptr inputWS) {
+    const Instrument_const_sptr &instrument,
+    const MatrixWorkspace_sptr &inputWS) {
   m_processingInstructions = getPropertyValue("ProcessingInstructions");
   if (!getPointerToProperty("ProcessingInstructions")->isDefault()) {
     m_processingInstructionsWorkspaceIndex =
@@ -921,14 +924,14 @@ void ReflectometryWorkflowBase2::convertProcessingInstructions(
             m_processingInstructions, inputWS);
   } else {
     m_processingInstructionsWorkspaceIndex =
-        findProcessingInstructions(instrument, inputWS);
+        findProcessingInstructions(std::move(instrument), inputWS);
     m_processingInstructions = convertProcessingInstructionsToSpectrumNumbers(
         m_processingInstructionsWorkspaceIndex, inputWS);
   }
 }
 
 void ReflectometryWorkflowBase2::convertProcessingInstructions(
-    MatrixWorkspace_sptr inputWS) {
+    const MatrixWorkspace_sptr &inputWS) {
   m_processingInstructions = getPropertyValue("ProcessingInstructions");
   m_processingInstructionsWorkspaceIndex =
       convertProcessingInstructionsToWorkspaceIndices(m_processingInstructions,
@@ -938,7 +941,7 @@ void ReflectometryWorkflowBase2::convertProcessingInstructions(
 // Create an on-the-fly property to set an output workspace from a child
 // algorithm, if the child has that output value set
 void ReflectometryWorkflowBase2::setWorkspacePropertyFromChild(
-    Algorithm_sptr alg, std::string const &propertyName) {
+    const Algorithm_sptr &alg, std::string const &propertyName) {
   if (alg->isDefault(propertyName))
     return;
 
diff --git a/Framework/Algorithms/src/RemovePromptPulse.cpp b/Framework/Algorithms/src/RemovePromptPulse.cpp
index 07e0a8bed95..412802216b0 100644
--- a/Framework/Algorithms/src/RemovePromptPulse.cpp
+++ b/Framework/Algorithms/src/RemovePromptPulse.cpp
@@ -68,7 +68,8 @@ double getMedian(const API::Run &run, const std::string &name) {
   return stats.median;
 }
 
-void getTofRange(MatrixWorkspace_const_sptr wksp, double &tmin, double &tmax) {
+void getTofRange(const MatrixWorkspace_const_sptr &wksp, double &tmin,
+                 double &tmax) {
   DataObjects::EventWorkspace_const_sptr eventWksp =
       boost::dynamic_pointer_cast<const DataObjects::EventWorkspace>(wksp);
   if (eventWksp == nullptr) {
diff --git a/Framework/Algorithms/src/ResampleX.cpp b/Framework/Algorithms/src/ResampleX.cpp
index ddd7344106f..4a686c0ec29 100644
--- a/Framework/Algorithms/src/ResampleX.cpp
+++ b/Framework/Algorithms/src/ResampleX.cpp
@@ -117,8 +117,8 @@ map<string, string> ResampleX::validateInputs() {
  *everything
  * went according to plan.
  */
-string determineXMinMax(MatrixWorkspace_sptr inputWS, vector<double> &xmins,
-                        vector<double> &xmaxs) {
+string determineXMinMax(const MatrixWorkspace_sptr &inputWS,
+                        vector<double> &xmins, vector<double> &xmaxs) {
   const size_t numSpectra = inputWS->getNumberHistograms();
 
   // pad out the ranges by copying the first value to the rest that are needed
diff --git a/Framework/Algorithms/src/ResetNegatives.cpp b/Framework/Algorithms/src/ResetNegatives.cpp
index 430b9dc3870..88f4fedbe3d 100644
--- a/Framework/Algorithms/src/ResetNegatives.cpp
+++ b/Framework/Algorithms/src/ResetNegatives.cpp
@@ -141,8 +141,9 @@ inline double fixZero(const double value) {
  * @param wksp The workspace to modify.
  * @param prog The progress.
  */
-void ResetNegatives::pushMinimum(MatrixWorkspace_const_sptr minWS,
-                                 MatrixWorkspace_sptr wksp, Progress &prog) {
+void ResetNegatives::pushMinimum(const MatrixWorkspace_const_sptr &minWS,
+                                 const MatrixWorkspace_sptr &wksp,
+                                 Progress &prog) {
   int64_t nHist = minWS->getNumberHistograms();
   PARALLEL_FOR_IF(Kernel::threadSafe(*wksp, *minWS))
   for (int64_t i = 0; i < nHist; i++) {
@@ -171,9 +172,9 @@ void ResetNegatives::pushMinimum(MatrixWorkspace_const_sptr minWS,
  * @param wksp The workspace to modify.
  * @param prog The progress.
  */
-void ResetNegatives::changeNegatives(MatrixWorkspace_const_sptr minWS,
+void ResetNegatives::changeNegatives(const MatrixWorkspace_const_sptr &minWS,
                                      const double spectrumNegativeValues,
-                                     MatrixWorkspace_sptr wksp,
+                                     const MatrixWorkspace_sptr &wksp,
                                      Progress &prog) {
   int64_t nHist = wksp->getNumberHistograms();
   PARALLEL_FOR_IF(Kernel::threadSafe(*minWS, *wksp))
diff --git a/Framework/Algorithms/src/RingProfile.cpp b/Framework/Algorithms/src/RingProfile.cpp
index 83f078ed350..e7647dc7c82 100644
--- a/Framework/Algorithms/src/RingProfile.cpp
+++ b/Framework/Algorithms/src/RingProfile.cpp
@@ -215,7 +215,7 @@ void RingProfile::exec() {
  * @param inputWS: the input workspace
  */
 void RingProfile::checkInputsForSpectraWorkspace(
-    const API::MatrixWorkspace_sptr inputWS) {
+    const API::MatrixWorkspace_sptr &inputWS) {
   try {
     // finding the limits of the instrument
     const auto &spectrumInfo = inputWS->spectrumInfo();
@@ -325,7 +325,7 @@ void RingProfile::checkInputsForSpectraWorkspace(
  * @param inputWS: pointer to the input workspace
  */
 void RingProfile::checkInputsForNumericWorkspace(
-    const API::MatrixWorkspace_sptr inputWS) {
+    const API::MatrixWorkspace_sptr &inputWS) {
   g_log.notice() << "CheckingInputs For Numeric Workspace\n";
 
   // The Axis0 is defined by the values of readX inside the spectra of the
@@ -396,7 +396,8 @@ void RingProfile::checkInputsForNumericWorkspace(
  *integration values
  */
 void RingProfile::processInstrumentRingProfile(
-    const API::MatrixWorkspace_sptr inputWS, std::vector<double> &output_bins) {
+    const API::MatrixWorkspace_sptr &inputWS,
+    std::vector<double> &output_bins) {
 
   const auto &spectrumInfo = inputWS->spectrumInfo();
   for (int i = 0; i < static_cast<int>(inputWS->getNumberHistograms()); i++) {
@@ -485,7 +486,8 @@ int RingProfile::getBinForPixel(const Kernel::V3D &position) {
  *integration values
  */
 void RingProfile::processNumericImageRingProfile(
-    const API::MatrixWorkspace_sptr inputWS, std::vector<double> &output_bins) {
+    const API::MatrixWorkspace_sptr &inputWS,
+    std::vector<double> &output_bins) {
   // allocate the bin positions vector
   std::vector<int> bin_n(inputWS->dataY(0).size(), -1);
 
@@ -538,7 +540,7 @@ void RingProfile::processNumericImageRingProfile(
  * @param bins_pos: bin positions (for each column inside the spectrum, the
  *correspondent bin_pos)
  */
-void RingProfile::getBinForPixel(const API::MatrixWorkspace_sptr ws,
+void RingProfile::getBinForPixel(const API::MatrixWorkspace_sptr &ws,
                                  int spectrum_index,
                                  std::vector<int> &bins_pos) {
 
diff --git a/Framework/Algorithms/src/RunCombinationHelpers/RunCombinationHelper.cpp b/Framework/Algorithms/src/RunCombinationHelpers/RunCombinationHelper.cpp
index 493c2497f99..6bc22fdb658 100644
--- a/Framework/Algorithms/src/RunCombinationHelpers/RunCombinationHelper.cpp
+++ b/Framework/Algorithms/src/RunCombinationHelpers/RunCombinationHelper.cpp
@@ -59,7 +59,8 @@ RunCombinationHelper::unWrapGroups(const std::vector<std::string> &inputs) {
  * to later check the compatibility of the others with the reference
  * @param ref : the reference workspace
  */
-void RunCombinationHelper::setReferenceProperties(MatrixWorkspace_sptr ref) {
+void RunCombinationHelper::setReferenceProperties(
+    const MatrixWorkspace_sptr &ref) {
   m_numberSpectra = ref->getNumberHistograms();
   m_numberDetectors = ref->detectorInfo().size();
   m_xUnit = ref->getAxis(0)->unit()->unitID();
@@ -82,7 +83,7 @@ void RunCombinationHelper::setReferenceProperties(MatrixWorkspace_sptr ref) {
  * @return : empty if compatible, error message otherwises
  */
 std::string
-RunCombinationHelper::checkCompatibility(MatrixWorkspace_sptr ws,
+RunCombinationHelper::checkCompatibility(const MatrixWorkspace_sptr &ws,
                                          bool checkNumberHistograms) {
   std::string errors;
   if (ws->getNumberHistograms() != m_numberSpectra && checkNumberHistograms)
diff --git a/Framework/Algorithms/src/RunCombinationHelpers/SampleLogsBehaviour.cpp b/Framework/Algorithms/src/RunCombinationHelpers/SampleLogsBehaviour.cpp
index 4115dbbff73..03a6bf84974 100644
--- a/Framework/Algorithms/src/RunCombinationHelpers/SampleLogsBehaviour.cpp
+++ b/Framework/Algorithms/src/RunCombinationHelpers/SampleLogsBehaviour.cpp
@@ -91,7 +91,7 @@ const std::string SampleLogsBehaviour::SUM_DOC =
  * @param parName the parameter names which specify the sample log sames to
  * merge given be the IPF
  */
-SampleLogsBehaviour::SampleLogsBehaviour(MatrixWorkspace_sptr ws,
+SampleLogsBehaviour::SampleLogsBehaviour(const MatrixWorkspace_sptr &ws,
                                          Logger &logger,
                                          const SampleLogNames &logEntries,
                                          const ParameterName &parName)
@@ -416,8 +416,8 @@ bool SampleLogsBehaviour::setNumericValue(const std::string &item,
  * @param addeeWS the workspace being merged
  * @param outWS the workspace the others are merged into
  */
-void SampleLogsBehaviour::mergeSampleLogs(MatrixWorkspace_sptr addeeWS,
-                                          MatrixWorkspace_sptr outWS) {
+void SampleLogsBehaviour::mergeSampleLogs(const MatrixWorkspace_sptr &addeeWS,
+                                          const MatrixWorkspace_sptr &outWS) {
   for (const auto &item : m_logMap) {
     const std::string &logName = item.first.first;
 
@@ -625,7 +625,8 @@ bool SampleLogsBehaviour::stringPropertiesMatch(
  *
  * @param outWS the merged workspace
  */
-void SampleLogsBehaviour::setUpdatedSampleLogs(MatrixWorkspace_sptr outWS) {
+void SampleLogsBehaviour::setUpdatedSampleLogs(
+    const MatrixWorkspace_sptr &outWS) {
   for (auto &item : m_logMap) {
     std::string propertyToReset = item.first.first;
 
@@ -647,7 +648,7 @@ void SampleLogsBehaviour::setUpdatedSampleLogs(MatrixWorkspace_sptr outWS) {
  * @param addeeWS the workspace being merged
  */
 void SampleLogsBehaviour::removeSampleLogsFromWorkspace(
-    MatrixWorkspace_sptr addeeWS) {
+    const MatrixWorkspace_sptr &addeeWS) {
   for (const auto &prop : m_addeeLogMap) {
     const auto &propName = prop->name();
     addeeWS->mutableRun().removeProperty(propName);
@@ -663,7 +664,7 @@ void SampleLogsBehaviour::removeSampleLogsFromWorkspace(
  * @param addeeWS the workspace being merged
  */
 void SampleLogsBehaviour::readdSampleLogToWorkspace(
-    MatrixWorkspace_sptr addeeWS) {
+    const MatrixWorkspace_sptr &addeeWS) {
   for (const auto &item : m_addeeLogMap) {
     auto property = std::unique_ptr<Kernel::Property>(item->clone());
     addeeWS->mutableRun().addProperty(std::move(property));
@@ -676,7 +677,7 @@ void SampleLogsBehaviour::readdSampleLogToWorkspace(
  *
  * @param ws the merged workspace to reset the sample logs for
  */
-void SampleLogsBehaviour::resetSampleLogs(MatrixWorkspace_sptr ws) {
+void SampleLogsBehaviour::resetSampleLogs(const MatrixWorkspace_sptr &ws) {
   for (auto const &item : m_logMap) {
     std::string const &propertyToReset = item.first.first;
 
diff --git a/Framework/Algorithms/src/SANSCollimationLengthEstimator.cpp b/Framework/Algorithms/src/SANSCollimationLengthEstimator.cpp
index 370940870bc..fdf2f1b0444 100644
--- a/Framework/Algorithms/src/SANSCollimationLengthEstimator.cpp
+++ b/Framework/Algorithms/src/SANSCollimationLengthEstimator.cpp
@@ -22,7 +22,7 @@ Mantid::Kernel::Logger g_log("SANSCollimationLengthEstimator");
  * @param val: a value as a string
  * @returns true if it is convertible else false
  */
-bool checkForDouble(std::string val) {
+bool checkForDouble(const std::string &val) {
   auto isDouble = false;
   try {
     boost::lexical_cast<double>(val);
@@ -45,7 +45,7 @@ using namespace API;
  * @returns the collimation length
  */
 double SANSCollimationLengthEstimator::provideCollimationLength(
-    Mantid::API::MatrixWorkspace_sptr workspace) {
+    const Mantid::API::MatrixWorkspace_sptr &workspace) {
   // If the instrument does not have a correction specified then set the length
   // to 4
   const double defaultLColim = 4.0;
@@ -104,7 +104,7 @@ double SANSCollimationLengthEstimator::provideCollimationLength(
  * length
  */
 double SANSCollimationLengthEstimator::getCollimationLengthWithGuides(
-    MatrixWorkspace_sptr inOutWS, const double L1,
+    const MatrixWorkspace_sptr &inOutWS, const double L1,
     const double collimationLengthCorrection) const {
   auto lCollim = L1 - collimationLengthCorrection;
 
diff --git a/Framework/Algorithms/src/SampleCorrections/MCAbsorptionStrategy.cpp b/Framework/Algorithms/src/SampleCorrections/MCAbsorptionStrategy.cpp
index 068b0e8ceb3..41b007239b4 100644
--- a/Framework/Algorithms/src/SampleCorrections/MCAbsorptionStrategy.cpp
+++ b/Framework/Algorithms/src/SampleCorrections/MCAbsorptionStrategy.cpp
@@ -64,7 +64,7 @@ MCAbsorptionStrategy::MCAbsorptionStrategy(
  */
 void MCAbsorptionStrategy::calculate(
     Kernel::PseudoRandomNumberGenerator &rng, const Kernel::V3D &finalPos,
-    Mantid::HistogramData::Points lambdas, double lambdaFixed,
+    const Mantid::HistogramData::Points &lambdas, double lambdaFixed,
     Mantid::API::ISpectrum &attenuationFactorsSpectrum) {
   const auto scatterBounds = m_scatterVol.getBoundingBox();
   const auto nbins = static_cast<int>(lambdas.size());
diff --git a/Framework/Algorithms/src/SmoothNeighbours.cpp b/Framework/Algorithms/src/SmoothNeighbours.cpp
index 68b04181ff4..8689b4a5237 100644
--- a/Framework/Algorithms/src/SmoothNeighbours.cpp
+++ b/Framework/Algorithms/src/SmoothNeighbours.cpp
@@ -685,7 +685,7 @@ void SmoothNeighbours::setupNewInstrument(MatrixWorkspace &outws) const {
 //--------------------------------------------------------------------------------------------
 /** Spread the average over all the pixels
  */
-void SmoothNeighbours::spreadPixels(MatrixWorkspace_sptr outws) {
+void SmoothNeighbours::spreadPixels(const MatrixWorkspace_sptr &outws) {
   // Get some stuff from the input workspace
   const size_t numberOfSpectra = inWS->getNumberHistograms();
 
diff --git a/Framework/Algorithms/src/SofQWPolygon.cpp b/Framework/Algorithms/src/SofQWPolygon.cpp
index f0825ef817d..2cbaed6f628 100644
--- a/Framework/Algorithms/src/SofQWPolygon.cpp
+++ b/Framework/Algorithms/src/SofQWPolygon.cpp
@@ -146,7 +146,8 @@ void SofQWPolygon::exec() {
  * Init variables caches
  * @param workspace :: Workspace pointer
  */
-void SofQWPolygon::initCachedValues(API::MatrixWorkspace_const_sptr workspace) {
+void SofQWPolygon::initCachedValues(
+    const API::MatrixWorkspace_const_sptr &workspace) {
   m_EmodeProperties.initCachedValues(*workspace, this);
   // Index theta cache
   initThetaCache(*workspace);
diff --git a/Framework/Algorithms/src/SortXAxis.cpp b/Framework/Algorithms/src/SortXAxis.cpp
index 9838aba48e1..e20d1ac5deb 100644
--- a/Framework/Algorithms/src/SortXAxis.cpp
+++ b/Framework/Algorithms/src/SortXAxis.cpp
@@ -118,7 +118,7 @@ void sortByXValue(std::vector<std::size_t> &workspaceIndicies,
 }
 
 void SortXAxis::sortIndicesByX(
-    std::vector<std::size_t> &workspaceIndicies, std::string order,
+    std::vector<std::size_t> &workspaceIndicies, const std::string &order,
     const Mantid::API::MatrixWorkspace &inputWorkspace, unsigned int specNum) {
   if (order == "Ascending") {
     sortByXValue(workspaceIndicies, inputWorkspace, specNum,
diff --git a/Framework/Algorithms/src/SpecularReflectionAlgorithm.cpp b/Framework/Algorithms/src/SpecularReflectionAlgorithm.cpp
index b8ccafe4186..843e097cba6 100644
--- a/Framework/Algorithms/src/SpecularReflectionAlgorithm.cpp
+++ b/Framework/Algorithms/src/SpecularReflectionAlgorithm.cpp
@@ -123,7 +123,7 @@ void SpecularReflectionAlgorithm::initCommonProperties() {
  */
 Mantid::Geometry::IComponent_const_sptr
 SpecularReflectionAlgorithm::getSurfaceSampleComponent(
-    Mantid::Geometry::Instrument_const_sptr inst) const {
+    const Mantid::Geometry::Instrument_const_sptr &inst) const {
   std::string sampleComponent = "some-surface-holder";
   if (!isPropertyDefault("SampleComponentName")) {
     sampleComponent = this->getPropertyValue("SampleComponentName");
@@ -148,7 +148,7 @@ SpecularReflectionAlgorithm::getSurfaceSampleComponent(
  */
 boost::shared_ptr<const Mantid::Geometry::IComponent>
 SpecularReflectionAlgorithm::getDetectorComponent(
-    MatrixWorkspace_sptr workspace, const bool isPointDetector) const {
+    const MatrixWorkspace_sptr &workspace, const bool isPointDetector) const {
   boost::shared_ptr<const IComponent> searchResult;
   if (!isPropertyDefault("SpectrumNumbersOfDetectors")) {
     const std::vector<int> spectrumNumbers =
diff --git a/Framework/Algorithms/src/SpecularReflectionPositionCorrect.cpp b/Framework/Algorithms/src/SpecularReflectionPositionCorrect.cpp
index 8af2c852b46..5d0e8659351 100644
--- a/Framework/Algorithms/src/SpecularReflectionPositionCorrect.cpp
+++ b/Framework/Algorithms/src/SpecularReflectionPositionCorrect.cpp
@@ -138,8 +138,8 @@ void SpecularReflectionPositionCorrect::exec() {
  * @param detectorPosition: Actual detector or detector group position.
  */
 void SpecularReflectionPositionCorrect::moveDetectors(
-    API::MatrixWorkspace_sptr toCorrect, IComponent_const_sptr detector,
-    IComponent_const_sptr sample, const double &upOffset,
+    const API::MatrixWorkspace_sptr &toCorrect, IComponent_const_sptr detector,
+    const IComponent_const_sptr &sample, const double &upOffset,
     const double &acrossOffset, const V3D &detectorPosition) {
   auto instrument = toCorrect->getInstrument();
   const V3D samplePosition = sample->getPos();
@@ -203,8 +203,9 @@ void SpecularReflectionPositionCorrect::moveDetectors(
  * @param detector : Pointer to a given detector
  */
 void SpecularReflectionPositionCorrect::correctPosition(
-    API::MatrixWorkspace_sptr toCorrect, const double &twoThetaInDeg,
-    IComponent_const_sptr sample, IComponent_const_sptr detector) {
+    const API::MatrixWorkspace_sptr &toCorrect, const double &twoThetaInDeg,
+    const IComponent_const_sptr &sample,
+    const IComponent_const_sptr &detector) {
 
   auto instrument = toCorrect->getInstrument();
 
diff --git a/Framework/Algorithms/src/Stitch1D.cpp b/Framework/Algorithms/src/Stitch1D.cpp
index b0de3825d0b..fc882cff796 100644
--- a/Framework/Algorithms/src/Stitch1D.cpp
+++ b/Framework/Algorithms/src/Stitch1D.cpp
@@ -644,7 +644,7 @@ void Stitch1D::exec() {
 /** Put special values back.
  * @param ws : MatrixWorkspace to resinsert special values into.
  */
-void Stitch1D::reinsertSpecialValues(MatrixWorkspace_sptr ws) {
+void Stitch1D::reinsertSpecialValues(const MatrixWorkspace_sptr &ws) {
   auto histogramCount = static_cast<int>(ws->getNumberHistograms());
   PARALLEL_FOR_IF(Kernel::threadSafe(*ws))
   for (int i = 0; i < histogramCount; ++i) {
diff --git a/Framework/Algorithms/src/StripPeaks.cpp b/Framework/Algorithms/src/StripPeaks.cpp
index 18b48d1042e..cc52ce60bd9 100644
--- a/Framework/Algorithms/src/StripPeaks.cpp
+++ b/Framework/Algorithms/src/StripPeaks.cpp
@@ -107,7 +107,8 @@ void StripPeaks::exec() {
  *  @param WS :: The workspace to search
  *  @return list of found peaks
  */
-API::ITableWorkspace_sptr StripPeaks::findPeaks(API::MatrixWorkspace_sptr WS) {
+API::ITableWorkspace_sptr
+StripPeaks::findPeaks(const API::MatrixWorkspace_sptr &WS) {
   g_log.debug("Calling FindPeaks as a Child Algorithm");
 
   // Read from properties
@@ -172,8 +173,8 @@ API::ITableWorkspace_sptr StripPeaks::findPeaks(API::MatrixWorkspace_sptr WS) {
  *  @return A workspace containing the peak-subtracted data
  */
 API::MatrixWorkspace_sptr
-StripPeaks::removePeaks(API::MatrixWorkspace_const_sptr input,
-                        API::ITableWorkspace_sptr peakslist) {
+StripPeaks::removePeaks(const API::MatrixWorkspace_const_sptr &input,
+                        const API::ITableWorkspace_sptr &peakslist) {
   g_log.debug("Subtracting peaks");
   // Create an output workspace - same size as input one
   MatrixWorkspace_sptr outputWS = WorkspaceFactory::Instance().create(input);
diff --git a/Framework/Algorithms/src/SumEventsByLogValue.cpp b/Framework/Algorithms/src/SumEventsByLogValue.cpp
index de12e5beec5..a6f0eb8f8ad 100644
--- a/Framework/Algorithms/src/SumEventsByLogValue.cpp
+++ b/Framework/Algorithms/src/SumEventsByLogValue.cpp
@@ -302,9 +302,9 @@ void SumEventsByLogValue::filterEventList(
  *  @param minVal          The minimum value of the log
  *  @param maxVal          The maximum value of the log
  */
-void SumEventsByLogValue::addMonitorCounts(ITableWorkspace_sptr outputWorkspace,
-                                           const TimeSeriesProperty<int> *log,
-                                           const int minVal, const int maxVal) {
+void SumEventsByLogValue::addMonitorCounts(
+    const ITableWorkspace_sptr &outputWorkspace,
+    const TimeSeriesProperty<int> *log, const int minVal, const int maxVal) {
   DataObjects::EventWorkspace_const_sptr monitorWorkspace =
       getProperty("MonitorWorkspace");
   // If no monitor workspace was given, there's nothing to do
diff --git a/Framework/Algorithms/src/SumSpectra.cpp b/Framework/Algorithms/src/SumSpectra.cpp
index c08a7a0891a..4b0e1b3edfb 100644
--- a/Framework/Algorithms/src/SumSpectra.cpp
+++ b/Framework/Algorithms/src/SumSpectra.cpp
@@ -324,7 +324,7 @@ void SumSpectra::determineIndices(const size_t numberOfSpectra) {
  * @return The minimum spectrum No for all the spectra being summed.
  */
 specnum_t
-SumSpectra::getOutputSpecNo(MatrixWorkspace_const_sptr localworkspace) {
+SumSpectra::getOutputSpecNo(const MatrixWorkspace_const_sptr &localworkspace) {
   // initial value - any included spectrum will do
   specnum_t specId =
       localworkspace->getSpectrum(*(m_indices.begin())).getSpectrumNo();
@@ -435,7 +435,7 @@ bool useSpectrum(const SpectrumInfo &spectrumInfo, const size_t wsIndex,
  * @param numZeros The number of zero bins in histogram workspace or empty
  * spectra for event workspace.
  */
-void SumSpectra::doSimpleSum(MatrixWorkspace_sptr outputWorkspace,
+void SumSpectra::doSimpleSum(const MatrixWorkspace_sptr &outputWorkspace,
                              Progress &progress, size_t &numSpectra,
                              size_t &numMasked, size_t &numZeros) {
   // Clean workspace of any NANs or Inf values
@@ -510,7 +510,7 @@ void SumSpectra::doSimpleSum(MatrixWorkspace_sptr outputWorkspace,
  * @param numZeros The number of zero bins in histogram workspace or empty
  * spectra for event workspace.
  */
-void SumSpectra::doFractionalSum(MatrixWorkspace_sptr outputWorkspace,
+void SumSpectra::doFractionalSum(const MatrixWorkspace_sptr &outputWorkspace,
                                  Progress &progress, size_t &numSpectra,
                                  size_t &numMasked, size_t &numZeros) {
   // First, we need to clean the input workspace for nan's and inf's in order
@@ -608,7 +608,7 @@ void SumSpectra::doFractionalSum(MatrixWorkspace_sptr outputWorkspace,
  * @param numZeros The number of zero bins in histogram workspace or empty
  * spectra for event workspace.
  */
-void SumSpectra::execEvent(MatrixWorkspace_sptr outputWorkspace,
+void SumSpectra::execEvent(const MatrixWorkspace_sptr &outputWorkspace,
                            Progress &progress, size_t &numSpectra,
                            size_t &numMasked, size_t &numZeros) {
   MatrixWorkspace_const_sptr localworkspace = getProperty("InputWorkspace");
diff --git a/Framework/Algorithms/src/TOFSANSResolutionByPixel.cpp b/Framework/Algorithms/src/TOFSANSResolutionByPixel.cpp
index 92327c6020d..a5862b2866b 100644
--- a/Framework/Algorithms/src/TOFSANSResolutionByPixel.cpp
+++ b/Framework/Algorithms/src/TOFSANSResolutionByPixel.cpp
@@ -209,7 +209,7 @@ void TOFSANSResolutionByPixel::exec() {
  * @returns a copy of the input workspace
  */
 MatrixWorkspace_sptr TOFSANSResolutionByPixel::setupOutputWorkspace(
-    MatrixWorkspace_sptr inputWorkspace) {
+    const MatrixWorkspace_sptr &inputWorkspace) {
   IAlgorithm_sptr duplicate = createChildAlgorithm("CloneWorkspace");
   duplicate->initialize();
   duplicate->setProperty<Workspace_sptr>("InputWorkspace", inputWorkspace);
@@ -224,7 +224,7 @@ MatrixWorkspace_sptr TOFSANSResolutionByPixel::setupOutputWorkspace(
  * @returns the moderator workspace wiht the correct wavelength binning
  */
 MatrixWorkspace_sptr TOFSANSResolutionByPixel::getModeratorWorkspace(
-    Mantid::API::MatrixWorkspace_sptr inputWorkspace) {
+    const Mantid::API::MatrixWorkspace_sptr &inputWorkspace) {
 
   MatrixWorkspace_sptr sigmaModerator = getProperty("SigmaModerator");
   IAlgorithm_sptr rebinned = createChildAlgorithm("RebinToWorkspace");
@@ -242,7 +242,7 @@ MatrixWorkspace_sptr TOFSANSResolutionByPixel::getModeratorWorkspace(
  * @param inWS: the input workspace
  */
 void TOFSANSResolutionByPixel::checkInput(
-    Mantid::API::MatrixWorkspace_sptr inWS) {
+    const Mantid::API::MatrixWorkspace_sptr &inWS) {
   // Make sure that input workspace has an instrument as we rely heavily on
   // thisa
   auto inst = inWS->getInstrument();
diff --git a/Framework/Algorithms/src/TimeAtSampleStrategyDirect.cpp b/Framework/Algorithms/src/TimeAtSampleStrategyDirect.cpp
index 028f495e81e..e40755b92c3 100644
--- a/Framework/Algorithms/src/TimeAtSampleStrategyDirect.cpp
+++ b/Framework/Algorithms/src/TimeAtSampleStrategyDirect.cpp
@@ -27,7 +27,7 @@ namespace Algorithms {
 /** Constructor
  */
 TimeAtSampleStrategyDirect::TimeAtSampleStrategyDirect(
-    MatrixWorkspace_const_sptr ws, double ei)
+    const MatrixWorkspace_const_sptr &ws, double ei)
     : m_constShift(0) {
 
   // A constant among all spectra
diff --git a/Framework/Algorithms/src/TimeAtSampleStrategyElastic.cpp b/Framework/Algorithms/src/TimeAtSampleStrategyElastic.cpp
index 46ecee6753c..d8ba32fbada 100644
--- a/Framework/Algorithms/src/TimeAtSampleStrategyElastic.cpp
+++ b/Framework/Algorithms/src/TimeAtSampleStrategyElastic.cpp
@@ -4,9 +4,11 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidAlgorithms/TimeAtSampleStrategyElastic.h"
+#include <utility>
+
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/SpectrumInfo.h"
+#include "MantidAlgorithms/TimeAtSampleStrategyElastic.h"
 #include "MantidGeometry/IComponent.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidGeometry/Instrument/ReferenceFrame.h"
@@ -22,7 +24,7 @@ namespace Algorithms {
  */
 TimeAtSampleStrategyElastic::TimeAtSampleStrategyElastic(
     Mantid::API::MatrixWorkspace_const_sptr ws)
-    : m_ws(ws), m_spectrumInfo(m_ws->spectrumInfo()),
+    : m_ws(std::move(ws)), m_spectrumInfo(m_ws->spectrumInfo()),
       m_beamDir(
           m_ws->getInstrument()->getReferenceFrame()->vecPointingAlongBeam()) {}
 
diff --git a/Framework/Algorithms/src/TimeAtSampleStrategyIndirect.cpp b/Framework/Algorithms/src/TimeAtSampleStrategyIndirect.cpp
index e173a5e3568..1084de35630 100644
--- a/Framework/Algorithms/src/TimeAtSampleStrategyIndirect.cpp
+++ b/Framework/Algorithms/src/TimeAtSampleStrategyIndirect.cpp
@@ -18,6 +18,7 @@
 #include <boost/shared_ptr.hpp>
 #include <cmath>
 #include <sstream>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::Geometry;
@@ -30,7 +31,7 @@ namespace Algorithms {
  */
 TimeAtSampleStrategyIndirect::TimeAtSampleStrategyIndirect(
     MatrixWorkspace_const_sptr ws)
-    : m_ws(ws), m_spectrumInfo(m_ws->spectrumInfo()) {}
+    : m_ws(std::move(ws)), m_spectrumInfo(m_ws->spectrumInfo()) {}
 
 Correction
 TimeAtSampleStrategyIndirect::calculate(const size_t &workspace_index) const {
diff --git a/Framework/Algorithms/src/Transpose.cpp b/Framework/Algorithms/src/Transpose.cpp
index edf886f726a..ac7f1807bb9 100644
--- a/Framework/Algorithms/src/Transpose.cpp
+++ b/Framework/Algorithms/src/Transpose.cpp
@@ -98,7 +98,7 @@ void Transpose::exec() {
  * @return A pointer to the output workspace.
  */
 API::MatrixWorkspace_sptr Transpose::createOutputWorkspace(
-    API::MatrixWorkspace_const_sptr inputWorkspace) {
+    const API::MatrixWorkspace_const_sptr &inputWorkspace) {
   Mantid::API::Axis *yAxis = getVerticalAxis(inputWorkspace);
   const size_t oldNhist = inputWorkspace->getNumberHistograms();
   const auto &inX = inputWorkspace->x(0);
@@ -138,8 +138,8 @@ API::MatrixWorkspace_sptr Transpose::createOutputWorkspace(
  * @param workspace :: A pointer to a workspace
  * @return An axis pointer for the vertical axis of the input workspace
  */
-API::Axis *
-Transpose::getVerticalAxis(API::MatrixWorkspace_const_sptr workspace) const {
+API::Axis *Transpose::getVerticalAxis(
+    const API::MatrixWorkspace_const_sptr &workspace) const {
   API::Axis *yAxis;
   try {
     yAxis = workspace->getAxis(1);
diff --git a/Framework/Algorithms/src/WienerSmooth.cpp b/Framework/Algorithms/src/WienerSmooth.cpp
index 3b28573c869..a2c56911f3b 100644
--- a/Framework/Algorithms/src/WienerSmooth.cpp
+++ b/Framework/Algorithms/src/WienerSmooth.cpp
@@ -420,7 +420,8 @@ WienerSmooth::getStartEnd(const Mantid::HistogramData::HistogramX &X,
  * @return :: Workspace with the copied spectrum.
  */
 API::MatrixWorkspace_sptr
-WienerSmooth::copyInput(API::MatrixWorkspace_sptr inputWS, size_t wsIndex) {
+WienerSmooth::copyInput(const API::MatrixWorkspace_sptr &inputWS,
+                        size_t wsIndex) {
   auto alg = createChildAlgorithm("ExtractSingleSpectrum");
   alg->initialize();
   alg->setProperty("InputWorkspace", inputWS);
diff --git a/Framework/Algorithms/src/WorkflowAlgorithmRunner.cpp b/Framework/Algorithms/src/WorkflowAlgorithmRunner.cpp
index 5cad33ea450..4262dd66ef9 100644
--- a/Framework/Algorithms/src/WorkflowAlgorithmRunner.cpp
+++ b/Framework/Algorithms/src/WorkflowAlgorithmRunner.cpp
@@ -59,7 +59,8 @@ std::string tidyWorkspaceName(const std::string &s) {
  * @throw std::runtime_error in case of errorneous entries in `table`
  */
 template <typename MAP>
-void cleanPropertyTable(ITableWorkspace_sptr table, const MAP &ioMapping) {
+void cleanPropertyTable(const ITableWorkspace_sptr &table,
+                        const MAP &ioMapping) {
   // Some output columns may be processed several times, but this should
   // not be a serious performance hit.
   for (const auto &ioPair : ioMapping) {
diff --git a/Framework/Algorithms/src/XDataConverter.cpp b/Framework/Algorithms/src/XDataConverter.cpp
index 54aacafa83c..b656ca879a0 100644
--- a/Framework/Algorithms/src/XDataConverter.cpp
+++ b/Framework/Algorithms/src/XDataConverter.cpp
@@ -90,7 +90,7 @@ void XDataConverter::exec() {
 }
 
 std::size_t
-XDataConverter::getNewYSize(const API::MatrixWorkspace_sptr inputWS) {
+XDataConverter::getNewYSize(const API::MatrixWorkspace_sptr &inputWS) {
   // this is the old behavior of MatrixWorkspace::blocksize()
   return inputWS->y(0).size();
 }
@@ -101,8 +101,8 @@ XDataConverter::getNewYSize(const API::MatrixWorkspace_sptr inputWS) {
  * @param inputWS :: The input workspace
  * @param index :: The index
  */
-void XDataConverter::setXData(API::MatrixWorkspace_sptr outputWS,
-                              const API::MatrixWorkspace_sptr inputWS,
+void XDataConverter::setXData(const API::MatrixWorkspace_sptr &outputWS,
+                              const API::MatrixWorkspace_sptr &inputWS,
                               const int index) {
   if (m_sharedX) {
     PARALLEL_CRITICAL(XDataConverter_para) {
diff --git a/Framework/Algorithms/test/AddNoteTest.h b/Framework/Algorithms/test/AddNoteTest.h
index 547493876e9..57338460fd0 100644
--- a/Framework/Algorithms/test/AddNoteTest.h
+++ b/Framework/Algorithms/test/AddNoteTest.h
@@ -88,9 +88,9 @@ public:
   }
 
 private:
-  void executeAlgorithm(Mantid::API::MatrixWorkspace_sptr testWS,
+  void executeAlgorithm(const Mantid::API::MatrixWorkspace_sptr &testWS,
                         const std::string &logName, const std::string &logTime,
-                        const std::string logValue,
+                        const std::string &logValue,
                         const UpdateType update = Update) {
 
     Mantid::Algorithms::AddNote alg;
@@ -110,11 +110,11 @@ private:
   }
 
   template <typename T>
-  void checkLogWithEntryExists(Mantid::API::MatrixWorkspace_sptr testWS,
+  void checkLogWithEntryExists(const Mantid::API::MatrixWorkspace_sptr &testWS,
                                const std::string &logName,
                                const std::string &logStartTime,
                                const int &logEndTime,
-                               const std::string logValue,
+                               const std::string &logValue,
                                const size_t position) {
     using Mantid::Kernel::TimeSeriesProperty;
     using Mantid::Types::Core::DateAndTime;
diff --git a/Framework/Algorithms/test/AddSampleLogTest.h b/Framework/Algorithms/test/AddSampleLogTest.h
index f929806e824..45d9bec83ff 100644
--- a/Framework/Algorithms/test/AddSampleLogTest.h
+++ b/Framework/Algorithms/test/AddSampleLogTest.h
@@ -170,11 +170,12 @@ public:
   }
 
   template <typename T>
-  void
-  ExecuteAlgorithm(MatrixWorkspace_sptr testWS, std::string LogName,
-                   std::string LogType, std::string LogText, T expectedValue,
-                   bool fails = false, std::string LogUnit = "",
-                   std::string NumberType = "AutoDetect", bool throws = false) {
+  void ExecuteAlgorithm(const MatrixWorkspace_sptr &testWS,
+                        const std::string &LogName, const std::string &LogType,
+                        const std::string &LogText, T expectedValue,
+                        bool fails = false, const std::string &LogUnit = "",
+                        const std::string &NumberType = "AutoDetect",
+                        bool throws = false) {
     // add the workspace to the ADS
     AnalysisDataService::Instance().addOrReplace("AddSampleLogTest_Temporary",
                                                  testWS);
diff --git a/Framework/Algorithms/test/AddTimeSeriesLogTest.h b/Framework/Algorithms/test/AddTimeSeriesLogTest.h
index 8811ed1163c..7a7fb480e88 100644
--- a/Framework/Algorithms/test/AddTimeSeriesLogTest.h
+++ b/Framework/Algorithms/test/AddTimeSeriesLogTest.h
@@ -134,7 +134,7 @@ public:
   }
 
 private:
-  void executeAlgorithm(Mantid::API::MatrixWorkspace_sptr testWS,
+  void executeAlgorithm(const Mantid::API::MatrixWorkspace_sptr &testWS,
                         const std::string &logName, const std::string &logTime,
                         const double logValue, const LogType type = Double,
                         const UpdateType update = Update) {
@@ -157,7 +157,7 @@ private:
   }
 
   template <typename T>
-  void checkLogWithEntryExists(Mantid::API::MatrixWorkspace_sptr testWS,
+  void checkLogWithEntryExists(const Mantid::API::MatrixWorkspace_sptr &testWS,
                                const std::string &logName,
                                const std::string &logTime, const T logValue,
                                const size_t position) {
diff --git a/Framework/Algorithms/test/AppendSpectraTest.h b/Framework/Algorithms/test/AppendSpectraTest.h
index 1e584609848..261eb100c1f 100644
--- a/Framework/Algorithms/test/AppendSpectraTest.h
+++ b/Framework/Algorithms/test/AppendSpectraTest.h
@@ -432,9 +432,9 @@ private:
   }
   /** Creates a 2D workspace with 5 histograms
    */
-  void createWorkspaceWithAxisAndLabel(const std::string outputName,
+  void createWorkspaceWithAxisAndLabel(const std::string &outputName,
                                        const std::string &axisType,
-                                       const std::string axisValue) {
+                                       const std::string &axisValue) {
     int nspec = 5;
     std::vector<std::string> YVals;
     std::vector<double> dataX;
diff --git a/Framework/Algorithms/test/ApplyFloodWorkspaceTest.h b/Framework/Algorithms/test/ApplyFloodWorkspaceTest.h
index aa6663deaab..513fa13adac 100644
--- a/Framework/Algorithms/test/ApplyFloodWorkspaceTest.h
+++ b/Framework/Algorithms/test/ApplyFloodWorkspaceTest.h
@@ -65,9 +65,9 @@ public:
   }
 
 private:
-  MatrixWorkspace_sptr
-  createFloodWorkspace(Mantid::Geometry::Instrument_const_sptr instrument,
-                       std::string const &xUnit = "TOF") {
+  MatrixWorkspace_sptr createFloodWorkspace(
+      const Mantid::Geometry::Instrument_const_sptr &instrument,
+      std::string const &xUnit = "TOF") {
     MatrixWorkspace_sptr flood = create2DWorkspace(4, 1);
     flood->mutableY(0)[0] = 0.7;
     flood->mutableY(1)[0] = 1.0;
diff --git a/Framework/Algorithms/test/Bin2DPowderDiffractionTest.h b/Framework/Algorithms/test/Bin2DPowderDiffractionTest.h
index bcfff101bca..d3e34e2f6d2 100644
--- a/Framework/Algorithms/test/Bin2DPowderDiffractionTest.h
+++ b/Framework/Algorithms/test/Bin2DPowderDiffractionTest.h
@@ -284,7 +284,7 @@ private:
   }
 
   // creates test file with bins description
-  void createBinFile(std::string fname) {
+  void createBinFile(const std::string &fname) {
     std::ofstream binfile;
     binfile.open(fname);
     binfile << "#dp_min #dp_max\n";
diff --git a/Framework/Algorithms/test/BinaryOperationTest.h b/Framework/Algorithms/test/BinaryOperationTest.h
index b7fc31ca521..fb694bd5b81 100644
--- a/Framework/Algorithms/test/BinaryOperationTest.h
+++ b/Framework/Algorithms/test/BinaryOperationTest.h
@@ -7,6 +7,8 @@
 #pragma once
 
 #include <cmath>
+#include <utility>
+
 #include <cxxtest/TestSuite.h>
 
 #include "MantidAPI/AnalysisDataService.h"
@@ -42,8 +44,8 @@ public:
   /// is provided.
   const std::string summary() const override { return "Summary of this test."; }
 
-  std::string checkSizeCompatibility(const MatrixWorkspace_const_sptr ws1,
-                                     const MatrixWorkspace_const_sptr ws2) {
+  std::string checkSizeCompatibility(const MatrixWorkspace_const_sptr &ws1,
+                                     const MatrixWorkspace_const_sptr &ws2) {
     m_lhs = ws1;
     m_rhs = ws2;
     m_lhsBlocksize = ws1->blocksize();
@@ -297,9 +299,11 @@ public:
                                     std::vector<std::vector<int>> rhs,
                                     bool expect_throw = false) {
     EventWorkspace_sptr lhsWS =
-        WorkspaceCreationHelper::createGroupedEventWorkspace(lhs, 50, 1.0);
+        WorkspaceCreationHelper::createGroupedEventWorkspace(std::move(lhs), 50,
+                                                             1.0);
     EventWorkspace_sptr rhsWS =
-        WorkspaceCreationHelper::createGroupedEventWorkspace(rhs, 50, 1.0);
+        WorkspaceCreationHelper::createGroupedEventWorkspace(std::move(rhs), 50,
+                                                             1.0);
     BinaryOperation::BinaryOperationTable_sptr table;
     Mantid::Kernel::Timer timer1;
     if (expect_throw) {
diff --git a/Framework/Algorithms/test/CalculateDIFCTest.h b/Framework/Algorithms/test/CalculateDIFCTest.h
index 8e15a35d9c4..509a4925d65 100644
--- a/Framework/Algorithms/test/CalculateDIFCTest.h
+++ b/Framework/Algorithms/test/CalculateDIFCTest.h
@@ -39,8 +39,8 @@ public:
     TS_ASSERT(alg.isInitialized())
   }
 
-  void runTest(Workspace2D_sptr inputWS, OffsetsWorkspace_sptr offsetsWS,
-               std::string &outWSName) {
+  void runTest(const Workspace2D_sptr &inputWS,
+               const OffsetsWorkspace_sptr &offsetsWS, std::string &outWSName) {
 
     CalculateDIFC alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
diff --git a/Framework/Algorithms/test/CalculateFlatBackgroundTest.h b/Framework/Algorithms/test/CalculateFlatBackgroundTest.h
index 8fb91e7509e..4ef353d997b 100644
--- a/Framework/Algorithms/test/CalculateFlatBackgroundTest.h
+++ b/Framework/Algorithms/test/CalculateFlatBackgroundTest.h
@@ -839,7 +839,8 @@ private:
   }
 
   void compareSubtractedAndBackgroundWorkspaces(
-      MatrixWorkspace_sptr originalWS, const std::string &subtractedWSName,
+      const MatrixWorkspace_sptr &originalWS,
+      const std::string &subtractedWSName,
       const std::string &backgroundWSName) {
     const std::string minusWSName("minused");
     MatrixWorkspace_sptr backgroundWS =
diff --git a/Framework/Algorithms/test/CalculateIqtTest.h b/Framework/Algorithms/test/CalculateIqtTest.h
index 132ac4c142c..c0eb3d2d8f9 100644
--- a/Framework/Algorithms/test/CalculateIqtTest.h
+++ b/Framework/Algorithms/test/CalculateIqtTest.h
@@ -54,8 +54,8 @@ Mantid::API::MatrixWorkspace_sptr setUpResolutionWorkspace() {
   return createWorkspace->getProperty("OutputWorkspace");
 }
 
-IAlgorithm_sptr calculateIqtAlgorithm(MatrixWorkspace_sptr sample,
-                                      MatrixWorkspace_sptr resolution,
+IAlgorithm_sptr calculateIqtAlgorithm(const MatrixWorkspace_sptr &sample,
+                                      const MatrixWorkspace_sptr &resolution,
                                       const double EnergyMin = -0.5,
                                       const double EnergyMax = 0.5,
                                       const double EnergyWidth = 0.1,
diff --git a/Framework/Algorithms/test/ChainedOperatorTest.h b/Framework/Algorithms/test/ChainedOperatorTest.h
index 4e51d242ecd..36ecc1c4749 100644
--- a/Framework/Algorithms/test/ChainedOperatorTest.h
+++ b/Framework/Algorithms/test/ChainedOperatorTest.h
@@ -70,8 +70,8 @@ public:
     performTest(work_in1, work_in2);
   }
 
-  void performTest(MatrixWorkspace_sptr work_in1,
-                   MatrixWorkspace_sptr work_in2) {
+  void performTest(const MatrixWorkspace_sptr &work_in1,
+                   const MatrixWorkspace_sptr &work_in2) {
     ComplexOpTest alg;
 
     std::string wsNameIn1 = "testChainedOperator_in21";
@@ -98,9 +98,9 @@ public:
   }
 
 private:
-  void checkData(const MatrixWorkspace_sptr work_in1,
-                 const MatrixWorkspace_sptr work_in2,
-                 const MatrixWorkspace_sptr work_out1) {
+  void checkData(const MatrixWorkspace_sptr &work_in1,
+                 const MatrixWorkspace_sptr &work_in2,
+                 const MatrixWorkspace_sptr &work_out1) {
     size_t ws2LoopCount = 0;
     if (work_in2->size() > 0) {
       ws2LoopCount = work_in1->size() / work_in2->size();
@@ -112,9 +112,9 @@ private:
     }
   }
 
-  void checkDataItem(const MatrixWorkspace_sptr work_in1,
-                     const MatrixWorkspace_sptr work_in2,
-                     const MatrixWorkspace_sptr work_out1, size_t i,
+  void checkDataItem(const MatrixWorkspace_sptr &work_in1,
+                     const MatrixWorkspace_sptr &work_in2,
+                     const MatrixWorkspace_sptr &work_out1, size_t i,
                      size_t ws2Index) {
     double sig1 =
         work_in1->readY(i / work_in1->blocksize())[i % work_in1->blocksize()];
diff --git a/Framework/Algorithms/test/ChangeLogTimeTest.h b/Framework/Algorithms/test/ChangeLogTimeTest.h
index b923e8da0f2..e7007c0f304 100644
--- a/Framework/Algorithms/test/ChangeLogTimeTest.h
+++ b/Framework/Algorithms/test/ChangeLogTimeTest.h
@@ -52,7 +52,7 @@ private:
    * @param in_name Name of the input workspace.
    * @param out_name Name of the output workspace.
    */
-  void verify(const std::string in_name, const std::string out_name) {
+  void verify(const std::string &in_name, const std::string &out_name) {
     DateAndTime start(start_str);
 
     // create a workspace to mess with
diff --git a/Framework/Algorithms/test/ChangePulsetime2Test.h b/Framework/Algorithms/test/ChangePulsetime2Test.h
index 383501bfa2a..5e39d09bfcf 100644
--- a/Framework/Algorithms/test/ChangePulsetime2Test.h
+++ b/Framework/Algorithms/test/ChangePulsetime2Test.h
@@ -22,8 +22,9 @@ using Mantid::Types::Core::DateAndTime;
 
 namespace {
 EventWorkspace_sptr
-execute_change_of_pulse_times(EventWorkspace_sptr in_ws, std::string timeOffset,
-                              std::string workspaceIndexList) {
+execute_change_of_pulse_times(const EventWorkspace_sptr &in_ws,
+                              const std::string &timeOffset,
+                              const std::string &workspaceIndexList) {
   // Create and run the algorithm
   ChangePulsetime2 alg;
   alg.initialize();
@@ -53,8 +54,8 @@ public:
     TS_ASSERT(alg.isInitialized())
   }
 
-  void do_test(std::string in_ws_name, std::string out_ws_name,
-               std::string WorkspaceIndexList) {
+  void do_test(const std::string &in_ws_name, const std::string &out_ws_name,
+               const std::string &WorkspaceIndexList) {
     ChangePulsetime2 alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
diff --git a/Framework/Algorithms/test/ChangePulsetimeTest.h b/Framework/Algorithms/test/ChangePulsetimeTest.h
index 6ecb5b9e5a4..22500e9fc34 100644
--- a/Framework/Algorithms/test/ChangePulsetimeTest.h
+++ b/Framework/Algorithms/test/ChangePulsetimeTest.h
@@ -21,8 +21,9 @@ using Mantid::Types::Core::DateAndTime;
 
 namespace {
 EventWorkspace_sptr
-execute_change_of_pulse_times(EventWorkspace_sptr in_ws, std::string timeOffset,
-                              std::string workspaceIndexList) {
+execute_change_of_pulse_times(const EventWorkspace_sptr &in_ws,
+                              const std::string &timeOffset,
+                              const std::string &workspaceIndexList) {
   // Create and run the algorithm
   ChangePulsetime alg;
   alg.initialize();
@@ -51,8 +52,8 @@ public:
     TS_ASSERT(alg.isInitialized())
   }
 
-  void do_test(std::string in_ws_name, std::string out_ws_name,
-               std::string WorkspaceIndexList) {
+  void do_test(const std::string &in_ws_name, const std::string &out_ws_name,
+               const std::string &WorkspaceIndexList) {
     ChangePulsetime alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
diff --git a/Framework/Algorithms/test/ChangeTimeZeroTest.h b/Framework/Algorithms/test/ChangeTimeZeroTest.h
index 81e7d68a053..8c69978f19e 100644
--- a/Framework/Algorithms/test/ChangeTimeZeroTest.h
+++ b/Framework/Algorithms/test/ChangeTimeZeroTest.h
@@ -9,6 +9,8 @@
 #include "MantidKernel/Timer.h"
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/ScopedWorkspace.h"
 #include "MantidAPI/WorkspaceGroup.h"
@@ -36,8 +38,8 @@ DateAndTime stringPropertyTime("2010-01-01T00:10:00");
 enum LogType { STANDARD, NOPROTONCHARGE };
 
 template <typename T>
-void addTimeSeriesLogToWorkspace(Mantid::API::MatrixWorkspace_sptr ws,
-                                 std::string id, DateAndTime startTime,
+void addTimeSeriesLogToWorkspace(const Mantid::API::MatrixWorkspace_sptr &ws,
+                                 const std::string &id, DateAndTime startTime,
                                  T defaultValue, int length) {
   auto timeSeries = new TimeSeriesProperty<T>(id);
   timeSeries->setUnits("mm");
@@ -48,15 +50,15 @@ void addTimeSeriesLogToWorkspace(Mantid::API::MatrixWorkspace_sptr ws,
 }
 
 template <typename T>
-void addProperyWithValueToWorkspace(Mantid::API::MatrixWorkspace_sptr ws,
-                                    std::string id, T value) {
+void addProperyWithValueToWorkspace(const Mantid::API::MatrixWorkspace_sptr &ws,
+                                    const std::string &id, T value) {
   auto propWithVal = new PropertyWithValue<T>(id, value);
   propWithVal->setUnits("mm");
   ws->mutableRun().addProperty(propWithVal, true);
 }
 
 // Provide the logs for matrix workspaces
-void provideLogs(LogType logType, Mantid::API::MatrixWorkspace_sptr ws,
+void provideLogs(LogType logType, const Mantid::API::MatrixWorkspace_sptr &ws,
                  DateAndTime startTime, int length) {
   switch (logType) {
   case (STANDARD):
@@ -96,7 +98,7 @@ void provideLogs(LogType logType, Mantid::API::MatrixWorkspace_sptr ws,
 
 // Provides a 2D workspace with a log
 Mantid::API::MatrixWorkspace_sptr provideWorkspace2D(LogType logType,
-                                                     std::string wsName,
+                                                     const std::string &wsName,
                                                      DateAndTime startTime,
                                                      int length) {
   Workspace2D_sptr ws(new Workspace2D);
@@ -140,9 +142,9 @@ provideEventWorkspace(LogType logType, DateAndTime startTime, int length) {
   return provideEventWorkspaceCustom(logType, startTime, length, 100, 100, 100);
 }
 
-MatrixWorkspace_sptr execute_change_time(MatrixWorkspace_sptr in_ws,
+MatrixWorkspace_sptr execute_change_time(const MatrixWorkspace_sptr &in_ws,
                                          double relativeTimeOffset,
-                                         std::string absolutTimeOffset) {
+                                         const std::string &absolutTimeOffset) {
   // Create and run the algorithm
   ChangeTimeZero alg;
   alg.initialize();
@@ -441,8 +443,9 @@ private:
   int m_length;
 
   // act and assert
-  void act_and_assert(double relativeTimeShift, std::string absoluteTimeShift,
-                      MatrixWorkspace_sptr in_ws,
+  void act_and_assert(double relativeTimeShift,
+                      const std::string &absoluteTimeShift,
+                      const MatrixWorkspace_sptr &in_ws,
                       bool inputEqualsOutputWorkspace) {
     // Create a duplicate workspace
     EventWorkspace_sptr duplicate_ws;
@@ -484,8 +487,8 @@ private:
   }
 
   // perform the verification
-  void do_test_shift(MatrixWorkspace_sptr ws, const double timeShift,
-                     MatrixWorkspace_sptr duplicate) const {
+  void do_test_shift(const MatrixWorkspace_sptr &ws, const double timeShift,
+                     const MatrixWorkspace_sptr &duplicate) const {
     // Check the logs
     TS_ASSERT(ws);
 
@@ -501,7 +504,7 @@ private:
 
     // Check the neutrons
     if (auto outWs = boost::dynamic_pointer_cast<EventWorkspace>(ws)) {
-      do_check_workspace(outWs, timeShift, duplicate);
+      do_check_workspace(outWs, timeShift, std::move(duplicate));
     }
   }
 
@@ -536,8 +539,8 @@ private:
   }
   // Check contents of an event workspace. We compare the time stamps to the
   // time stamps of the duplicate workspace
-  void do_check_workspace(EventWorkspace_sptr ws, double timeShift,
-                          MatrixWorkspace_sptr duplicate) const {
+  void do_check_workspace(const EventWorkspace_sptr &ws, double timeShift,
+                          const MatrixWorkspace_sptr &duplicate) const {
     // Get the duplicate input workspace for comparison reasons
     auto duplicateWs = boost::dynamic_pointer_cast<EventWorkspace>(duplicate);
 
@@ -562,7 +565,7 @@ private:
 
   // Create comparison workspace
   EventWorkspace_sptr
-  createComparisonWorkspace(EventWorkspace_sptr inputWorkspace) {
+  createComparisonWorkspace(const EventWorkspace_sptr &inputWorkspace) {
     CloneWorkspace alg;
     alg.setChild(true);
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
diff --git a/Framework/Algorithms/test/CheckWorkspacesMatchTest.h b/Framework/Algorithms/test/CheckWorkspacesMatchTest.h
index 716105ed1a8..87630794e63 100644
--- a/Framework/Algorithms/test/CheckWorkspacesMatchTest.h
+++ b/Framework/Algorithms/test/CheckWorkspacesMatchTest.h
@@ -1140,7 +1140,7 @@ private:
     TS_ASSERT_EQUALS(matcher.getPropertyValue("Result"), expectedResult);
   }
 
-  void cleanupGroup(const WorkspaceGroup_sptr group) {
+  void cleanupGroup(const WorkspaceGroup_sptr &group) {
     // group->deepRemoveAll();
     const std::string name = group->getName();
     Mantid::API::AnalysisDataService::Instance().deepRemoveGroup(name);
diff --git a/Framework/Algorithms/test/ClearCacheTest.h b/Framework/Algorithms/test/ClearCacheTest.h
index 73069ee0a44..d6f1a2a7a2a 100644
--- a/Framework/Algorithms/test/ClearCacheTest.h
+++ b/Framework/Algorithms/test/ClearCacheTest.h
@@ -49,7 +49,7 @@ public:
     createDirectory(GeomPath);
   }
 
-  void createDirectory(Poco::Path path) {
+  void createDirectory(const Poco::Path &path) {
     Poco::File file(path);
     if (file.createDirectory()) {
       m_directoriesToRemove.emplace_back(file);
diff --git a/Framework/Algorithms/test/ClearInstrumentParametersTest.h b/Framework/Algorithms/test/ClearInstrumentParametersTest.h
index cd866bdc40a..2e8d40202a5 100644
--- a/Framework/Algorithms/test/ClearInstrumentParametersTest.h
+++ b/Framework/Algorithms/test/ClearInstrumentParametersTest.h
@@ -47,21 +47,23 @@ public:
     TS_ASSERT_EQUALS(oldPos, m_ws->detectorInfo().position(0));
   }
 
-  void setParam(std::string cName, std::string pName, std::string value) {
+  void setParam(const std::string &cName, const std::string &pName,
+                const std::string &value) {
     Instrument_const_sptr inst = m_ws->getInstrument();
     ParameterMap &paramMap = m_ws->instrumentParameters();
     boost::shared_ptr<const IComponent> comp = inst->getComponentByName(cName);
     paramMap.addString(comp->getComponentID(), pName, value);
   }
 
-  void setParam(std::string cName, std::string pName, double value) {
+  void setParam(const std::string &cName, const std::string &pName,
+                double value) {
     Instrument_const_sptr inst = m_ws->getInstrument();
     ParameterMap &paramMap = m_ws->instrumentParameters();
     boost::shared_ptr<const IComponent> comp = inst->getComponentByName(cName);
     paramMap.addDouble(comp->getComponentID(), pName, value);
   }
 
-  void checkEmpty(std::string cName, std::string pName) {
+  void checkEmpty(const std::string &cName, const std::string &pName) {
     Instrument_const_sptr inst = m_ws->getInstrument();
     ParameterMap &paramMap = m_ws->instrumentParameters();
     boost::shared_ptr<const IComponent> comp = inst->getComponentByName(cName);
diff --git a/Framework/Algorithms/test/CommutativeBinaryOperationTest.h b/Framework/Algorithms/test/CommutativeBinaryOperationTest.h
index 24eb4aaa6ff..a7c834710b1 100644
--- a/Framework/Algorithms/test/CommutativeBinaryOperationTest.h
+++ b/Framework/Algorithms/test/CommutativeBinaryOperationTest.h
@@ -33,8 +33,8 @@ public:
     return "Commutative binary operation helper.";
   }
 
-  std::string checkSizeCompatibility(const MatrixWorkspace_const_sptr ws1,
-                                     const MatrixWorkspace_const_sptr ws2) {
+  std::string checkSizeCompatibility(const MatrixWorkspace_const_sptr &ws1,
+                                     const MatrixWorkspace_const_sptr &ws2) {
     m_lhs = ws1;
     m_rhs = ws2;
     m_lhsBlocksize = ws1->blocksize();
diff --git a/Framework/Algorithms/test/CompareWorkspacesTest.h b/Framework/Algorithms/test/CompareWorkspacesTest.h
index fe15a2ed1e0..a2d907d86fa 100644
--- a/Framework/Algorithms/test/CompareWorkspacesTest.h
+++ b/Framework/Algorithms/test/CompareWorkspacesTest.h
@@ -1351,7 +1351,7 @@ private:
     }
   }
 
-  void cleanupGroup(const WorkspaceGroup_sptr group) {
+  void cleanupGroup(const WorkspaceGroup_sptr &group) {
     // group->deepRemoveAll();
     const std::string name = group->getName();
     Mantid::API::AnalysisDataService::Instance().deepRemoveGroup(name);
diff --git a/Framework/Algorithms/test/ConjoinWorkspacesTest.h b/Framework/Algorithms/test/ConjoinWorkspacesTest.h
index 27d90dde12a..2485feebb72 100644
--- a/Framework/Algorithms/test/ConjoinWorkspacesTest.h
+++ b/Framework/Algorithms/test/ConjoinWorkspacesTest.h
@@ -37,7 +37,7 @@ public:
       : ws1Name("ConjoinWorkspacesTest_grp1"),
         ws2Name("ConjoinWorkspacesTest_grp2") {}
 
-  MatrixWorkspace_sptr getWSFromADS(std::string wsName) {
+  MatrixWorkspace_sptr getWSFromADS(const std::string &wsName) {
     auto out = boost::dynamic_pointer_cast<MatrixWorkspace>(
         AnalysisDataService::Instance().retrieve(wsName));
     TS_ASSERT(out);
diff --git a/Framework/Algorithms/test/ConvertAxesToRealSpaceTest.h b/Framework/Algorithms/test/ConvertAxesToRealSpaceTest.h
index 3fad5cfc7c8..56ae17def05 100644
--- a/Framework/Algorithms/test/ConvertAxesToRealSpaceTest.h
+++ b/Framework/Algorithms/test/ConvertAxesToRealSpaceTest.h
@@ -55,10 +55,10 @@ public:
     do_algorithm_run(baseWSName, "phi", "signed2theta", 100, 200);
   }
 
-  MatrixWorkspace_sptr do_algorithm_run(std::string baseWSName,
-                                        std::string verticalAxis,
-                                        std::string horizontalAxis, int nHBins,
-                                        int nVBins) {
+  MatrixWorkspace_sptr do_algorithm_run(const std::string &baseWSName,
+                                        const std::string &verticalAxis,
+                                        const std::string &horizontalAxis,
+                                        int nHBins, int nVBins) {
     std::string inWSName(baseWSName + "_InputWS");
     std::string outWSName(baseWSName + "_OutputWS");
 
diff --git a/Framework/Algorithms/test/ConvertAxisByFormulaTest.h b/Framework/Algorithms/test/ConvertAxisByFormulaTest.h
index df3e41b59ca..6b55ecffeb1 100644
--- a/Framework/Algorithms/test/ConvertAxisByFormulaTest.h
+++ b/Framework/Algorithms/test/ConvertAxisByFormulaTest.h
@@ -197,8 +197,9 @@ public:
     cleanupWorkspaces(std::vector<std::string>{inputWs});
   }
 
-  bool runConvertAxisByFormula(std::string testName, std::string formula,
-                               std::string axis, std::string &inputWs,
+  bool runConvertAxisByFormula(const std::string &testName,
+                               const std::string &formula,
+                               const std::string &axis, std::string &inputWs,
                                std::string &resultWs) {
     Mantid::Algorithms::ConvertAxisByFormula alg;
     alg.initialize();
diff --git a/Framework/Algorithms/test/ConvertSpectrumAxis2Test.h b/Framework/Algorithms/test/ConvertSpectrumAxis2Test.h
index 595e8c4b8f5..78f9b1605ab 100644
--- a/Framework/Algorithms/test/ConvertSpectrumAxis2Test.h
+++ b/Framework/Algorithms/test/ConvertSpectrumAxis2Test.h
@@ -23,8 +23,8 @@ using namespace Mantid::HistogramData::detail;
 
 class ConvertSpectrumAxis2Test : public CxxTest::TestSuite {
 private:
-  void do_algorithm_run(std::string target, std::string inputWS,
-                        std::string outputWS, bool startYNegative = true,
+  void do_algorithm_run(const std::string &target, const std::string &inputWS,
+                        const std::string &outputWS, bool startYNegative = true,
                         bool isHistogram = true) {
     auto testWS = WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(
         3, 1, false, startYNegative, isHistogram);
@@ -45,7 +45,7 @@ private:
   }
 
   void check_output_values_for_signed_theta_conversion(
-      std::string outputWSSignedTheta) {
+      const std::string &outputWSSignedTheta) {
     MatrixWorkspace_const_sptr outputSignedTheta;
     TS_ASSERT_THROWS_NOTHING(
         outputSignedTheta =
@@ -69,8 +69,9 @@ private:
     TS_ASSERT_DELTA((*thetaAxis)(2), 1.1458, 0.0001);
   }
 
-  void check_output_values_for_theta_conversion(std::string inputWSTheta,
-                                                std::string outputWSTheta) {
+  void
+  check_output_values_for_theta_conversion(const std::string &inputWSTheta,
+                                           const std::string &outputWSTheta) {
     MatrixWorkspace_const_sptr input, output;
     TS_ASSERT_THROWS_NOTHING(
         input = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
@@ -101,8 +102,8 @@ private:
                      const Mantid::Kernel::Exception::IndexError &);
   }
 
-  void clean_up_workspaces(const std::string inputWS,
-                           const std::string outputWS) {
+  void clean_up_workspaces(const std::string &inputWS,
+                           const std::string &outputWS) {
     AnalysisDataService::Instance().remove(inputWS);
     AnalysisDataService::Instance().remove(outputWS);
   }
diff --git a/Framework/Algorithms/test/ConvertSpectrumAxisTest.h b/Framework/Algorithms/test/ConvertSpectrumAxisTest.h
index 46c3ebe3539..fcab91851b1 100644
--- a/Framework/Algorithms/test/ConvertSpectrumAxisTest.h
+++ b/Framework/Algorithms/test/ConvertSpectrumAxisTest.h
@@ -19,8 +19,8 @@ using namespace Mantid::HistogramData::detail;
 
 class ConvertSpectrumAxisTest : public CxxTest::TestSuite {
 private:
-  void do_algorithm_run(std::string target, std::string inputWS,
-                        std::string outputWS) {
+  void do_algorithm_run(const std::string &target, const std::string &inputWS,
+                        const std::string &outputWS) {
     Mantid::Algorithms::ConvertSpectrumAxis conv;
     conv.initialize();
 
diff --git a/Framework/Algorithms/test/ConvertToConstantL2Test.h b/Framework/Algorithms/test/ConvertToConstantL2Test.h
index e224874b82f..49376861318 100644
--- a/Framework/Algorithms/test/ConvertToConstantL2Test.h
+++ b/Framework/Algorithms/test/ConvertToConstantL2Test.h
@@ -58,7 +58,7 @@ public:
     do_test_move(inputWS);
   }
 
-  void do_test_move(MatrixWorkspace_sptr inputWS) {
+  void do_test_move(const MatrixWorkspace_sptr &inputWS) {
     // BEFORE - check the L2 values differ
     const auto &spectrumInfoInput = inputWS->spectrumInfo();
     for (size_t i = 0; i < inputWS->getNumberHistograms(); i++) {
@@ -169,7 +169,7 @@ private:
     return inputWS;
   }
 
-  void addSampleLogs(MatrixWorkspace_sptr inputWS) {
+  void addSampleLogs(const MatrixWorkspace_sptr &inputWS) {
     inputWS->mutableRun().addProperty(
         "wavelength", boost::lexical_cast<std::string>(m_wavelength));
 
diff --git a/Framework/Algorithms/test/ConvertToHistogramTest.h b/Framework/Algorithms/test/ConvertToHistogramTest.h
index d6696e74329..a693111185b 100644
--- a/Framework/Algorithms/test/ConvertToHistogramTest.h
+++ b/Framework/Algorithms/test/ConvertToHistogramTest.h
@@ -110,7 +110,7 @@ public:
   }
 
 private:
-  MatrixWorkspace_sptr runAlgorithm(Workspace2D_sptr inputWS) {
+  MatrixWorkspace_sptr runAlgorithm(const Workspace2D_sptr &inputWS) {
     IAlgorithm_sptr alg(new ConvertToHistogram());
     alg->initialize();
     alg->setRethrows(true);
diff --git a/Framework/Algorithms/test/ConvertToPointDataTest.h b/Framework/Algorithms/test/ConvertToPointDataTest.h
index 6fe2a97daca..10b4868b4d2 100644
--- a/Framework/Algorithms/test/ConvertToPointDataTest.h
+++ b/Framework/Algorithms/test/ConvertToPointDataTest.h
@@ -171,7 +171,7 @@ public:
   }
 
 private:
-  MatrixWorkspace_sptr runAlgorithm(Workspace2D_sptr inputWS) {
+  MatrixWorkspace_sptr runAlgorithm(const Workspace2D_sptr &inputWS) {
     IAlgorithm_sptr alg(new ConvertToPointData());
     alg->initialize();
     alg->setRethrows(true);
diff --git a/Framework/Algorithms/test/ConvertUnitsTest.h b/Framework/Algorithms/test/ConvertUnitsTest.h
index c8fbf020f81..ca345e3cb59 100644
--- a/Framework/Algorithms/test/ConvertUnitsTest.h
+++ b/Framework/Algorithms/test/ConvertUnitsTest.h
@@ -713,7 +713,7 @@ public:
    * sorting flips the direction
    */
   void do_testExecEvent_RemainsSorted(EventSortType sortType,
-                                      std::string targetUnit) {
+                                      const std::string &targetUnit) {
     EventWorkspace_sptr ws =
         WorkspaceCreationHelper::createEventWorkspaceWithFullInstrument(1, 10,
                                                                         false);
diff --git a/Framework/Algorithms/test/CopyDataRangeTest.h b/Framework/Algorithms/test/CopyDataRangeTest.h
index b0dbf373b55..da41285003b 100644
--- a/Framework/Algorithms/test/CopyDataRangeTest.h
+++ b/Framework/Algorithms/test/CopyDataRangeTest.h
@@ -37,8 +37,8 @@ MatrixWorkspace_sptr getADSMatrixWorkspace(std::string const &workspaceName) {
       workspaceName);
 }
 
-IAlgorithm_sptr setUpAlgorithm(MatrixWorkspace_sptr inputWorkspace,
-                               MatrixWorkspace_sptr destWorkspace,
+IAlgorithm_sptr setUpAlgorithm(const MatrixWorkspace_sptr &inputWorkspace,
+                               const MatrixWorkspace_sptr &destWorkspace,
                                int const &specMin, int const &specMax,
                                double const &xMin, double const &xMax,
                                int const &yInsertionIndex,
@@ -68,7 +68,7 @@ IAlgorithm_sptr setUpAlgorithm(std::string const &inputName,
                         xMax, yInsertionIndex, xInsertionIndex, outputName);
 }
 
-void populateSpectrum(MatrixWorkspace_sptr workspace,
+void populateSpectrum(const MatrixWorkspace_sptr &workspace,
                       std::size_t const &spectrum,
                       std::vector<double> const &yData,
                       std::vector<double> const &xData,
@@ -78,7 +78,7 @@ void populateSpectrum(MatrixWorkspace_sptr workspace,
   workspace->mutableE(spectrum) = HistogramE(eData);
 }
 
-void populateWorkspace(MatrixWorkspace_sptr workspace,
+void populateWorkspace(const MatrixWorkspace_sptr &workspace,
                        std::vector<double> const &yData,
                        std::vector<double> const &xData,
                        std::vector<double> const &eData) {
@@ -94,7 +94,7 @@ constructHistogramData(Mantid::MantidVec::const_iterator fromIterator,
   return histogram;
 }
 
-void populateOutputWorkspace(MatrixWorkspace_sptr workspace,
+void populateOutputWorkspace(const MatrixWorkspace_sptr &workspace,
                              std::vector<double> const &yData,
                              std::vector<double> const &eData) {
   std::vector<double> const xData = {2.1, 2.2, 2.3, 2.4, 2.5, 2.6};
@@ -111,8 +111,8 @@ void populateOutputWorkspace(MatrixWorkspace_sptr workspace,
   }
 }
 
-ITableWorkspace_sptr compareWorkspaces(MatrixWorkspace_sptr workspace1,
-                                       MatrixWorkspace_sptr workspace2,
+ITableWorkspace_sptr compareWorkspaces(const MatrixWorkspace_sptr &workspace1,
+                                       const MatrixWorkspace_sptr &workspace2,
                                        double tolerance = 0.000001) {
   auto compareAlg = AlgorithmManager::Instance().create("CompareWorkspaces");
   compareAlg->setProperty("Workspace1", workspace1);
diff --git a/Framework/Algorithms/test/CopyLogsTest.h b/Framework/Algorithms/test/CopyLogsTest.h
index 0f2292f8ea6..c67a5903e17 100644
--- a/Framework/Algorithms/test/CopyLogsTest.h
+++ b/Framework/Algorithms/test/CopyLogsTest.h
@@ -136,7 +136,7 @@ public:
   }
 
   // Run the Copy Logs algorithm
-  void runAlg(MatrixWorkspace_sptr in, MatrixWorkspace_sptr out,
+  void runAlg(const MatrixWorkspace_sptr &in, const MatrixWorkspace_sptr &out,
               const std::string &mode) {
     CopyLogs alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
@@ -149,14 +149,14 @@ public:
   }
 
   // Add a string sample log to the workspace
-  void addSampleLog(MatrixWorkspace_sptr ws, const std::string &name,
+  void addSampleLog(const MatrixWorkspace_sptr &ws, const std::string &name,
                     const std::string &value) {
     Run &run = ws->mutableRun();
     run.addLogData(new PropertyWithValue<std::string>(name, value));
   }
 
   // Add a double sample log to the workspace
-  void addSampleLog(MatrixWorkspace_sptr ws, const std::string &name,
+  void addSampleLog(const MatrixWorkspace_sptr &ws, const std::string &name,
                     const double value) {
     Run &run = ws->mutableRun();
     run.addLogData(new PropertyWithValue<double>(name, value));
diff --git a/Framework/Algorithms/test/CorrectTOFAxisTest.h b/Framework/Algorithms/test/CorrectTOFAxisTest.h
index 23ccaedf78d..6f376bda675 100644
--- a/Framework/Algorithms/test/CorrectTOFAxisTest.h
+++ b/Framework/Algorithms/test/CorrectTOFAxisTest.h
@@ -323,7 +323,7 @@ public:
   }
 
 private:
-  static void addSampleLogs(MatrixWorkspace_sptr ws, const double TOF) {
+  static void addSampleLogs(const MatrixWorkspace_sptr &ws, const double TOF) {
     const double length = flightLengthIN4(ws);
     const double Ei = incidentEnergy(TOF, length);
     ws->mutableRun().addProperty("EI", Ei);
@@ -331,8 +331,8 @@ private:
     ws->mutableRun().addProperty("wavelength", lambda);
   }
 
-  static void assertTOFShift(MatrixWorkspace_sptr shiftedWs,
-                             MatrixWorkspace_sptr ws, const double ei,
+  static void assertTOFShift(const MatrixWorkspace_sptr &shiftedWs,
+                             const MatrixWorkspace_sptr &ws, const double ei,
                              const double wavelength, const double shift) {
     TS_ASSERT(shiftedWs);
     TS_ASSERT_EQUALS(shiftedWs->run().getPropertyAsSingleValue("EI"), ei);
@@ -412,7 +412,7 @@ private:
     }
   }
 
-  static double flightLengthIN4(MatrixWorkspace_const_sptr ws) {
+  static double flightLengthIN4(const MatrixWorkspace_const_sptr &ws) {
     const double l1 = ws->spectrumInfo().l1();
     const double l2 = ws->spectrumInfo().l2(1);
     return l1 + l2;
diff --git a/Framework/Algorithms/test/CorrectToFileTest.h b/Framework/Algorithms/test/CorrectToFileTest.h
index 6d052370c9b..532a0c8fdeb 100644
--- a/Framework/Algorithms/test/CorrectToFileTest.h
+++ b/Framework/Algorithms/test/CorrectToFileTest.h
@@ -142,7 +142,7 @@ public:
     AnalysisDataService::Instance().remove(data->getName());
   }
 
-  MatrixWorkspace_sptr executeAlgorithm(MatrixWorkspace_sptr testInput,
+  MatrixWorkspace_sptr executeAlgorithm(const MatrixWorkspace_sptr &testInput,
                                         const std::string &unit,
                                         const std::string &operation,
                                         bool newWksp = true) {
diff --git a/Framework/Algorithms/test/CreateGroupingWorkspaceTest.h b/Framework/Algorithms/test/CreateGroupingWorkspaceTest.h
index 0dc96dc50c0..79cd24af8cb 100644
--- a/Framework/Algorithms/test/CreateGroupingWorkspaceTest.h
+++ b/Framework/Algorithms/test/CreateGroupingWorkspaceTest.h
@@ -25,7 +25,7 @@ public:
     TS_ASSERT(alg.isInitialized())
   }
 
-  void doTest(std::string outWSName) {
+  void doTest(const std::string &outWSName) {
     // Retrieve the workspace from data service.
     GroupingWorkspace_sptr ws;
     TS_ASSERT_THROWS_NOTHING(
diff --git a/Framework/Algorithms/test/CreateLogPropertyTableTest.h b/Framework/Algorithms/test/CreateLogPropertyTableTest.h
index 269b7bea7fd..5f3639ce2f1 100644
--- a/Framework/Algorithms/test/CreateLogPropertyTableTest.h
+++ b/Framework/Algorithms/test/CreateLogPropertyTableTest.h
@@ -110,7 +110,7 @@ public:
 
 private:
   void createSampleWorkspace(
-      std::string wsName = "__CreateLogPropertyTable__TestWorkspace",
+      const std::string &wsName = "__CreateLogPropertyTable__TestWorkspace",
       int runNumber = 12345, int64_t runStart = 3000000000) {
     using namespace WorkspaceCreationHelper;
 
diff --git a/Framework/Algorithms/test/CreateSampleWorkspaceTest.h b/Framework/Algorithms/test/CreateSampleWorkspaceTest.h
index 73fcede99c0..3e0e5f37ba4 100644
--- a/Framework/Algorithms/test/CreateSampleWorkspaceTest.h
+++ b/Framework/Algorithms/test/CreateSampleWorkspaceTest.h
@@ -46,9 +46,10 @@ public:
   }
 
   MatrixWorkspace_sptr createSampleWorkspace(
-      std::string outWSName, std::string wsType = "", std::string function = "",
-      std::string userFunction = "", int numBanks = 2, int bankPixelWidth = 10,
-      int numEvents = 1000, bool isRandom = false, std::string xUnit = "TOF",
+      const std::string &outWSName, const std::string &wsType = "",
+      const std::string &function = "", const std::string &userFunction = "",
+      int numBanks = 2, int bankPixelWidth = 10, int numEvents = 1000,
+      bool isRandom = false, const std::string &xUnit = "TOF",
       double xMin = 0.0, double xMax = 20000.0, double binWidth = 200.0,
       int numScanPoints = 1) {
 
diff --git a/Framework/Algorithms/test/CreateTransmissionWorkspace2Test.h b/Framework/Algorithms/test/CreateTransmissionWorkspace2Test.h
index bde02a3160f..cda64d11d6f 100644
--- a/Framework/Algorithms/test/CreateTransmissionWorkspace2Test.h
+++ b/Framework/Algorithms/test/CreateTransmissionWorkspace2Test.h
@@ -617,7 +617,7 @@ private:
     }
   }
 
-  void check_lambda_workspace(MatrixWorkspace_sptr ws) {
+  void check_lambda_workspace(const MatrixWorkspace_sptr &ws) {
     TS_ASSERT(ws);
     if (!ws)
       return;
diff --git a/Framework/Algorithms/test/CreateUserDefinedBackgroundTest.h b/Framework/Algorithms/test/CreateUserDefinedBackgroundTest.h
index e5f4c4b2f2f..aa502c2dd86 100644
--- a/Framework/Algorithms/test/CreateUserDefinedBackgroundTest.h
+++ b/Framework/Algorithms/test/CreateUserDefinedBackgroundTest.h
@@ -330,8 +330,8 @@ private:
   }
 
   /// Compare workspaces
-  bool workspacesEqual(const MatrixWorkspace_sptr lhs,
-                       const MatrixWorkspace_sptr rhs, double tolerance,
+  bool workspacesEqual(const MatrixWorkspace_sptr &lhs,
+                       const MatrixWorkspace_sptr &rhs, double tolerance,
                        bool relativeError = false) {
     auto alg = Mantid::API::AlgorithmFactory::Instance().create(
         "CompareWorkspaces", 1);
diff --git a/Framework/Algorithms/test/CropToComponentTest.h b/Framework/Algorithms/test/CropToComponentTest.h
index 731380ea725..1a6ae411b1f 100644
--- a/Framework/Algorithms/test/CropToComponentTest.h
+++ b/Framework/Algorithms/test/CropToComponentTest.h
@@ -242,7 +242,7 @@ private:
         numberOfBanks, numbersOfPixelPerBank, 2);
   }
 
-  void doAsssert(Mantid::API::MatrixWorkspace_sptr workspace,
+  void doAsssert(const Mantid::API::MatrixWorkspace_sptr &workspace,
                  std::vector<Mantid::detid_t> &expectedIDs,
                  size_t expectedNumberOfHistograms) {
     // Assert
diff --git a/Framework/Algorithms/test/CropWorkspaceTest.h b/Framework/Algorithms/test/CropWorkspaceTest.h
index 3fa04b60590..f5ab1f14d02 100644
--- a/Framework/Algorithms/test/CropWorkspaceTest.h
+++ b/Framework/Algorithms/test/CropWorkspaceTest.h
@@ -103,7 +103,7 @@ public:
     TS_ASSERT(!crop.isExecuted());
   }
 
-  void makeFakeEventWorkspace(std::string wsName) {
+  void makeFakeEventWorkspace(const std::string &wsName) {
     // Make an event workspace with 2 events in each bin.
     EventWorkspace_sptr test_in =
         WorkspaceCreationHelper::createEventWorkspace(36, 50, 50, 0.0, 2., 2);
diff --git a/Framework/Algorithms/test/CrossCorrelateTest.h b/Framework/Algorithms/test/CrossCorrelateTest.h
index 4904a2f1f60..8b60401adff 100644
--- a/Framework/Algorithms/test/CrossCorrelateTest.h
+++ b/Framework/Algorithms/test/CrossCorrelateTest.h
@@ -161,7 +161,7 @@ private:
 
   // Run the algorithm and do some basic checks. Returns the output workspace.
   MatrixWorkspace_const_sptr
-  runAlgorithm(CrossCorrelate &alg, const MatrixWorkspace_const_sptr inWS) {
+  runAlgorithm(CrossCorrelate &alg, const MatrixWorkspace_const_sptr &inWS) {
     // run the algorithm
     TS_ASSERT_THROWS_NOTHING(alg.execute());
     TS_ASSERT(alg.isExecuted());
diff --git a/Framework/Algorithms/test/CylinderAbsorptionTest.h b/Framework/Algorithms/test/CylinderAbsorptionTest.h
index 0950fb20829..ec2b9109b2c 100644
--- a/Framework/Algorithms/test/CylinderAbsorptionTest.h
+++ b/Framework/Algorithms/test/CylinderAbsorptionTest.h
@@ -305,9 +305,9 @@ private:
   void configureAbsCommon(Mantid::Algorithms::CylinderAbsorption &alg,
                           MatrixWorkspace_sptr &inputWS,
                           const std::string &outputWSname,
-                          std::string numberOfSlices = "2",
-                          std::string numberOfAnnuli = "2",
-                          std::string cylinderAxis = "0,1,0") {
+                          const std::string &numberOfSlices = "2",
+                          const std::string &numberOfAnnuli = "2",
+                          const std::string &cylinderAxis = "0,1,0") {
     if (!alg.isInitialized())
       alg.initialize();
 
diff --git a/Framework/Algorithms/test/DeleteWorkspacesTest.h b/Framework/Algorithms/test/DeleteWorkspacesTest.h
index 70fc055b60a..99d0d42a593 100644
--- a/Framework/Algorithms/test/DeleteWorkspacesTest.h
+++ b/Framework/Algorithms/test/DeleteWorkspacesTest.h
@@ -118,7 +118,7 @@ public:
     TS_ASSERT_EQUALS(dataStore.size(), storeSizeAtStart);
   }
 
-  void createAndStoreWorkspace(std::string name, int ylength = 10) {
+  void createAndStoreWorkspace(const std::string &name, int ylength = 10) {
     using namespace Mantid::API;
     using namespace Mantid::DataObjects;
 
diff --git a/Framework/Algorithms/test/EditInstrumentGeometryTest.h b/Framework/Algorithms/test/EditInstrumentGeometryTest.h
index 0ec97221114..25b3d79ee97 100644
--- a/Framework/Algorithms/test/EditInstrumentGeometryTest.h
+++ b/Framework/Algorithms/test/EditInstrumentGeometryTest.h
@@ -158,7 +158,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Check detector parameter
    */
-  void checkDetectorParameters(API::MatrixWorkspace_sptr workspace,
+  void checkDetectorParameters(const API::MatrixWorkspace_sptr &workspace,
                                size_t wsindex, double realr, double realtth,
                                double realphi) {
 
@@ -175,8 +175,8 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Check detector parameter
    */
-  void checkDetectorID(API::MatrixWorkspace_sptr workspace, size_t wsindex,
-                       detid_t detid) {
+  void checkDetectorID(const API::MatrixWorkspace_sptr &workspace,
+                       size_t wsindex, detid_t detid) {
 
     const auto &spectrumInfo = workspace->spectrumInfo();
     TS_ASSERT_EQUALS(spectrumInfo.hasUniqueDetector(wsindex), true);
diff --git a/Framework/Algorithms/test/ElasticWindowTest.h b/Framework/Algorithms/test/ElasticWindowTest.h
index e00979fc42d..65328ac0a40 100644
--- a/Framework/Algorithms/test/ElasticWindowTest.h
+++ b/Framework/Algorithms/test/ElasticWindowTest.h
@@ -201,7 +201,7 @@ private:
    *
    * @param ws Workspace to test
    */
-  void verifyQworkspace(MatrixWorkspace_sptr ws) {
+  void verifyQworkspace(const MatrixWorkspace_sptr &ws) {
     std::string unitID = ws->getAxis(0)->unit()->unitID();
     TS_ASSERT_EQUALS(unitID, "MomentumTransfer");
   }
@@ -211,7 +211,7 @@ private:
    *
    * @param ws Workspace to test
    */
-  void verifyQ2workspace(MatrixWorkspace_sptr ws) {
+  void verifyQ2workspace(const MatrixWorkspace_sptr &ws) {
     std::string unitID = ws->getAxis(0)->unit()->unitID();
     TS_ASSERT_EQUALS(unitID, "QSquared");
   }
diff --git a/Framework/Algorithms/test/ExponentialTest.h b/Framework/Algorithms/test/ExponentialTest.h
index 9a682293ff8..28eec221b85 100644
--- a/Framework/Algorithms/test/ExponentialTest.h
+++ b/Framework/Algorithms/test/ExponentialTest.h
@@ -98,8 +98,8 @@ public:
 
 private:
   // loopOrientation 0=Horizontal, 1=Vertical
-  void checkData(MatrixWorkspace_sptr work_in1,
-                 MatrixWorkspace_sptr work_out1) {
+  void checkData(const MatrixWorkspace_sptr &work_in1,
+                 const MatrixWorkspace_sptr &work_out1) {
 
     for (size_t i = 0; i < work_out1->size(); i++) {
       double sig1 =
@@ -123,7 +123,7 @@ private:
     }
   }
   // loopOrientation 0=Horizontal, 1=Vertical
-  void setError(MatrixWorkspace_sptr work_in1) {
+  void setError(const MatrixWorkspace_sptr &work_in1) {
 
     for (size_t i = 0; i < work_in1->size(); i++) {
       double sig1 =
diff --git a/Framework/Algorithms/test/ExtractMaskTest.h b/Framework/Algorithms/test/ExtractMaskTest.h
index 638cd418e87..33bf6460081 100644
--- a/Framework/Algorithms/test/ExtractMaskTest.h
+++ b/Framework/Algorithms/test/ExtractMaskTest.h
@@ -163,8 +163,8 @@ private:
     return detectorList;
   }
 
-  void doTest(MatrixWorkspace_const_sptr inputWS,
-              MaskWorkspace_const_sptr outputWS) {
+  void doTest(const MatrixWorkspace_const_sptr &inputWS,
+              const MaskWorkspace_const_sptr &outputWS) {
     TS_ASSERT_EQUALS(outputWS->blocksize(), 1);
     size_t nOutputHists(outputWS->getNumberHistograms());
     TS_ASSERT_EQUALS(nOutputHists, inputWS->getNumberHistograms());
diff --git a/Framework/Algorithms/test/ExtractSingleSpectrumTest.h b/Framework/Algorithms/test/ExtractSingleSpectrumTest.h
index 70c11883dcc..467ff4a4f59 100644
--- a/Framework/Algorithms/test/ExtractSingleSpectrumTest.h
+++ b/Framework/Algorithms/test/ExtractSingleSpectrumTest.h
@@ -88,7 +88,7 @@ public:
   }
 
 private:
-  MatrixWorkspace_sptr runAlgorithm(MatrixWorkspace_sptr inputWS,
+  MatrixWorkspace_sptr runAlgorithm(const MatrixWorkspace_sptr &inputWS,
                                     const int index) {
     ExtractSingleSpectrum extractor;
     extractor.initialize();
@@ -106,8 +106,8 @@ private:
     return extractor.getProperty("OutputWorkspace");
   }
 
-  void do_Spectrum_Tests(MatrixWorkspace_sptr outputWS, const specnum_t specID,
-                         const detid_t detID) {
+  void do_Spectrum_Tests(const MatrixWorkspace_sptr &outputWS,
+                         const specnum_t specID, const detid_t detID) {
     TS_ASSERT_EQUALS(outputWS->getNumberHistograms(), 1);
     TS_ASSERT_THROWS_NOTHING(outputWS->getSpectrum(0));
     const auto &spectrum = outputWS->getSpectrum(0);
diff --git a/Framework/Algorithms/test/ExtractSpectraTest.h b/Framework/Algorithms/test/ExtractSpectraTest.h
index daf981ab6c9..25c661dcaea 100644
--- a/Framework/Algorithms/test/ExtractSpectraTest.h
+++ b/Framework/Algorithms/test/ExtractSpectraTest.h
@@ -544,7 +544,7 @@ private:
   }
 
   MatrixWorkspace_sptr
-  createInputWithDetectors(std::string workspaceType) const {
+  createInputWithDetectors(const std::string &workspaceType) const {
     MatrixWorkspace_sptr ws;
 
     // Set the type of underlying workspace
diff --git a/Framework/Algorithms/test/ExtractUnmaskedSpectraTest.h b/Framework/Algorithms/test/ExtractUnmaskedSpectraTest.h
index 74486994886..769c8d1fef7 100644
--- a/Framework/Algorithms/test/ExtractUnmaskedSpectraTest.h
+++ b/Framework/Algorithms/test/ExtractUnmaskedSpectraTest.h
@@ -133,7 +133,7 @@ private:
   }
 
   Mantid::API::MatrixWorkspace_sptr
-  createMask(Mantid::API::MatrixWorkspace_sptr inputWS) {
+  createMask(const Mantid::API::MatrixWorkspace_sptr &inputWS) {
     auto maskWS = Mantid::DataObjects::MaskWorkspace_sptr(
         new Mantid::DataObjects::MaskWorkspace(inputWS));
     size_t n = inputWS->getNumberHistograms();
@@ -146,8 +146,8 @@ private:
   }
 
   Mantid::API::MatrixWorkspace_sptr
-  runAlgorithm(Mantid::API::MatrixWorkspace_sptr inputWS,
-               Mantid::API::MatrixWorkspace_sptr maskedWS =
+  runAlgorithm(const Mantid::API::MatrixWorkspace_sptr &inputWS,
+               const Mantid::API::MatrixWorkspace_sptr &maskedWS =
                    Mantid::API::MatrixWorkspace_sptr()) {
     ExtractUnmaskedSpectra alg;
     alg.setChild(true);
diff --git a/Framework/Algorithms/test/FFTSmooth2Test.h b/Framework/Algorithms/test/FFTSmooth2Test.h
index 8f3ad38eead..a0a85cac670 100644
--- a/Framework/Algorithms/test/FFTSmooth2Test.h
+++ b/Framework/Algorithms/test/FFTSmooth2Test.h
@@ -169,8 +169,9 @@ public:
   }
 
   //-------------------------------------------------------------------------------------------------
-  void performTest(bool event, std::string filter, std::string params,
-                   bool AllSpectra, int WorkspaceIndex, bool inPlace = false) {
+  void performTest(bool event, const std::string &filter,
+                   const std::string &params, bool AllSpectra,
+                   int WorkspaceIndex, bool inPlace = false) {
     MatrixWorkspace_sptr ws1, out;
     int numPixels = 10;
     int numBins = 20;
diff --git a/Framework/Algorithms/test/FFTTest.h b/Framework/Algorithms/test/FFTTest.h
index a439134be66..904716b6be1 100644
--- a/Framework/Algorithms/test/FFTTest.h
+++ b/Framework/Algorithms/test/FFTTest.h
@@ -717,7 +717,7 @@ public:
   }
 
 private:
-  MatrixWorkspace_sptr doRebin(MatrixWorkspace_sptr inputWS,
+  MatrixWorkspace_sptr doRebin(const MatrixWorkspace_sptr &inputWS,
                                const std::string &params) {
     auto rebin = FrameworkManager::Instance().createAlgorithm("Rebin");
     rebin->initialize();
@@ -729,8 +729,8 @@ private:
     return rebin->getProperty("OutputWorkspace");
   }
 
-  MatrixWorkspace_sptr doFFT(MatrixWorkspace_sptr inputWS, const bool complex,
-                             const bool phaseShift) {
+  MatrixWorkspace_sptr doFFT(const MatrixWorkspace_sptr &inputWS,
+                             const bool complex, const bool phaseShift) {
     auto fft = FrameworkManager::Instance().createAlgorithm("FFT");
     fft->initialize();
     fft->setChild(true);
@@ -747,7 +747,7 @@ private:
     return fft->getProperty("OutputWorkspace");
   }
 
-  void doPhaseTest(MatrixWorkspace_sptr inputWS, bool complex) {
+  void doPhaseTest(const MatrixWorkspace_sptr &inputWS, bool complex) {
     // Offset the input workspace
     const auto offsetWS = offsetWorkspace(inputWS);
 
@@ -803,7 +803,7 @@ private:
     return ws;
   }
 
-  MatrixWorkspace_sptr offsetWorkspace(MatrixWorkspace_sptr workspace) {
+  MatrixWorkspace_sptr offsetWorkspace(const MatrixWorkspace_sptr &workspace) {
     auto scaleX = FrameworkManager::Instance().createAlgorithm("ScaleX");
     scaleX->initialize();
     scaleX->setChild(true);
@@ -936,7 +936,7 @@ private:
     return create->getProperty("OutputWorkspace");
   }
 
-  MatrixWorkspace_sptr doCrop(MatrixWorkspace_sptr inputWS, double lower,
+  MatrixWorkspace_sptr doCrop(const MatrixWorkspace_sptr &inputWS, double lower,
                               double higher) {
     auto crop = FrameworkManager::Instance().createAlgorithm("CropWorkspace");
     crop->initialize();
diff --git a/Framework/Algorithms/test/FilterByLogValueTest.h b/Framework/Algorithms/test/FilterByLogValueTest.h
index 19b20c56e69..25b241d1021 100644
--- a/Framework/Algorithms/test/FilterByLogValueTest.h
+++ b/Framework/Algorithms/test/FilterByLogValueTest.h
@@ -174,7 +174,7 @@ public:
    * @param do_in_place
    * @param PulseFilter :: PulseFilter parameter
    */
-  void do_test_fake(std::string log_name, double min, double max,
+  void do_test_fake(const std::string &log_name, double min, double max,
                     int seconds_kept, bool add_proton_charge = true,
                     bool do_in_place = false, bool PulseFilter = false) {
     EventWorkspace_sptr ew = createInputWS(add_proton_charge);
diff --git a/Framework/Algorithms/test/FilterEventsTest.h b/Framework/Algorithms/test/FilterEventsTest.h
index 62120ef7325..b657f88b3d5 100644
--- a/Framework/Algorithms/test/FilterEventsTest.h
+++ b/Framework/Algorithms/test/FilterEventsTest.h
@@ -1753,7 +1753,8 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Create the time correction table
    */
-  TableWorkspace_sptr createTimeCorrectionTable(MatrixWorkspace_sptr inpws) {
+  TableWorkspace_sptr
+  createTimeCorrectionTable(const MatrixWorkspace_sptr &inpws) {
     // 1. Generate an empty table
     auto corrtable = boost::make_shared<TableWorkspace>();
     corrtable->addColumn("int", "DetectorID");
diff --git a/Framework/Algorithms/test/FindEPPTest.h b/Framework/Algorithms/test/FindEPPTest.h
index 3f9ef8197a2..a84315c99f4 100644
--- a/Framework/Algorithms/test/FindEPPTest.h
+++ b/Framework/Algorithms/test/FindEPPTest.h
@@ -223,7 +223,7 @@ public:
   }
 
 private:
-  void _check_table(ITableWorkspace_sptr ws, size_t nSpectra) {
+  void _check_table(const ITableWorkspace_sptr &ws, size_t nSpectra) {
     TS_ASSERT_EQUALS(ws->rowCount(), nSpectra);
     TS_ASSERT_EQUALS(ws->columnCount(), 9);
     TS_ASSERT_EQUALS(ws->getColumnNames(), m_columnNames);
diff --git a/Framework/Algorithms/test/FindPeaksTest.h b/Framework/Algorithms/test/FindPeaksTest.h
index 104ea75cf06..eef5f327f10 100644
--- a/Framework/Algorithms/test/FindPeaksTest.h
+++ b/Framework/Algorithms/test/FindPeaksTest.h
@@ -190,7 +190,7 @@ public:
   /** Parse a row in output parameter tableworkspace to a string/double
    * parameter name/value map
    */
-  void getParameterMap(TableWorkspace_sptr tablews, size_t rowindex,
+  void getParameterMap(const TableWorkspace_sptr &tablews, size_t rowindex,
                        map<string, double> &parammap) {
     parammap.clear();
 
diff --git a/Framework/Algorithms/test/FixGSASInstrumentFileTest.h b/Framework/Algorithms/test/FixGSASInstrumentFileTest.h
index 7ff6c56f089..7d5a650d5d2 100644
--- a/Framework/Algorithms/test/FixGSASInstrumentFileTest.h
+++ b/Framework/Algorithms/test/FixGSASInstrumentFileTest.h
@@ -67,7 +67,7 @@ public:
     file.remove();
   }
 
-  void createFaultFile(std::string prmfilename) {
+  void createFaultFile(const std::string &prmfilename) {
     ofstream ofile;
     ofile.open(prmfilename.c_str(), ios::out);
     ofile << "            "
diff --git a/Framework/Algorithms/test/GenerateEventsFilterTest.h b/Framework/Algorithms/test/GenerateEventsFilterTest.h
index bd5c7d8a22c..8c6cdc750d8 100644
--- a/Framework/Algorithms/test/GenerateEventsFilterTest.h
+++ b/Framework/Algorithms/test/GenerateEventsFilterTest.h
@@ -1145,7 +1145,7 @@ public:
    * SplittingInterval objects
    */
   size_t convertMatrixSplitterToSplitters(
-      API::MatrixWorkspace_const_sptr matrixws,
+      const API::MatrixWorkspace_const_sptr &matrixws,
       std::vector<Kernel::SplittingInterval> &splitters) {
     splitters.clear();
     size_t numsplitters = 0;
diff --git a/Framework/Algorithms/test/GetDetOffsetsMultiPeaksTest.h b/Framework/Algorithms/test/GetDetOffsetsMultiPeaksTest.h
index 6adbaedc2a7..97c55f0ee41 100644
--- a/Framework/Algorithms/test/GetDetOffsetsMultiPeaksTest.h
+++ b/Framework/Algorithms/test/GetDetOffsetsMultiPeaksTest.h
@@ -430,7 +430,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Generate noisy data in a workspace
    */
-  void generateNoisyData(MatrixWorkspace_sptr WS) {
+  void generateNoisyData(const MatrixWorkspace_sptr &WS) {
 
     auto &Y = WS->mutableY(0);
     Y.assign(Y.size(), static_cast<double>(rand() % 5));
diff --git a/Framework/Algorithms/test/GetEiMonDet3Test.h b/Framework/Algorithms/test/GetEiMonDet3Test.h
index c5cf0ac1f5c..111ea70a6a4 100644
--- a/Framework/Algorithms/test/GetEiMonDet3Test.h
+++ b/Framework/Algorithms/test/GetEiMonDet3Test.h
@@ -8,6 +8,8 @@
 
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAlgorithms/ExtractSpectra2.h"
@@ -157,7 +159,7 @@ public:
   }
 
 private:
-  static void attachInstrument(MatrixWorkspace_sptr targetWs) {
+  static void attachInstrument(const MatrixWorkspace_sptr &targetWs) {
     // The reference frame used by createInstrumentForWorkspaceWithDistances
     // is left handed with y pointing up, x along beam.
 
@@ -170,8 +172,8 @@ private:
     detectorRs.emplace_back(-MONITOR_DISTANCE, 0., 0.);
     // Add more detectors --- these should be treated as the real ones.
     detectorRs.emplace_back(0., 0., DETECTOR_DISTANCE);
-    createInstrumentForWorkspaceWithDistances(targetWs, sampleR, sourceR,
-                                              detectorRs);
+    createInstrumentForWorkspaceWithDistances(std::move(targetWs), sampleR,
+                                              sourceR, detectorRs);
   }
 
   static MatrixWorkspace_sptr
@@ -215,7 +217,8 @@ private:
   }
 
   // Mininum setup for GetEiMonDet3.
-  static void setupSimple(MatrixWorkspace_sptr ws, GetEiMonDet3 &algorithm) {
+  static void setupSimple(const MatrixWorkspace_sptr &ws,
+                          GetEiMonDet3 &algorithm) {
     algorithm.setRethrows(true);
     TS_ASSERT_THROWS_NOTHING(algorithm.initialize())
     TS_ASSERT(algorithm.isInitialized())
diff --git a/Framework/Algorithms/test/He3TubeEfficiencyTest.h b/Framework/Algorithms/test/He3TubeEfficiencyTest.h
index 8488bb39b1e..6db24d8af3f 100644
--- a/Framework/Algorithms/test/He3TubeEfficiencyTest.h
+++ b/Framework/Algorithms/test/He3TubeEfficiencyTest.h
@@ -30,7 +30,7 @@ using Mantid::HistogramData::Counts;
 using Mantid::HistogramData::CountStandardDeviations;
 
 namespace He3TubeEffeciencyHelper {
-void createWorkspace2DInADS(const std::string inputWS) {
+void createWorkspace2DInADS(const std::string &inputWS) {
   const int nspecs(4);
   const int nbins(5);
 
@@ -58,7 +58,7 @@ void createWorkspace2DInADS(const std::string inputWS) {
   loader.execute();
 }
 
-void createEventWorkspaceInADS(const std::string inputEvWS) {
+void createEventWorkspaceInADS(const std::string &inputEvWS) {
   EventWorkspace_sptr event =
       WorkspaceCreationHelper::createEventWorkspace(4, 5, 5, 0, 0.9, 3, 0);
   event->getAxis(0)->unit() = UnitFactory::Instance().create("Wavelength");
diff --git a/Framework/Algorithms/test/IndirectFitDataCreationHelperTest.h b/Framework/Algorithms/test/IndirectFitDataCreationHelperTest.h
index a3037f1d0ce..d4fc9f31559 100644
--- a/Framework/Algorithms/test/IndirectFitDataCreationHelperTest.h
+++ b/Framework/Algorithms/test/IndirectFitDataCreationHelperTest.h
@@ -24,7 +24,7 @@ std::vector<std::string> getTextAxisLabels() {
 std::vector<double> getNumericAxisLabels() { return {2.2, 3.3, 4.4}; }
 
 void storeWorkspaceInADS(std::string const &workspaceName,
-                         MatrixWorkspace_sptr workspace) {
+                         const MatrixWorkspace_sptr &workspace) {
   SetUpADSWithWorkspace ads(workspaceName, workspace);
 }
 
diff --git a/Framework/Algorithms/test/IntegrateByComponentTest.h b/Framework/Algorithms/test/IntegrateByComponentTest.h
index 83f579d6e56..efb8aa33fce 100644
--- a/Framework/Algorithms/test/IntegrateByComponentTest.h
+++ b/Framework/Algorithms/test/IntegrateByComponentTest.h
@@ -240,7 +240,7 @@ public:
   }
 
 private:
-  void ABCtestWorkspace(std::string inputWSname, bool mask) {
+  void ABCtestWorkspace(const std::string &inputWSname, bool mask) {
     int nSpectra(12);
     Workspace2D_sptr ws2D =
         WorkspaceCreationHelper::create2DWorkspaceWhereYIsWorkspaceIndex(
diff --git a/Framework/Algorithms/test/IntegrationTest.h b/Framework/Algorithms/test/IntegrationTest.h
index 9fa007b15c7..e99316d0e09 100644
--- a/Framework/Algorithms/test/IntegrationTest.h
+++ b/Framework/Algorithms/test/IntegrationTest.h
@@ -166,7 +166,7 @@ public:
     assertRangeWithPartialBins(input);
   }
 
-  void doTestEvent(std::string inName, std::string outName,
+  void doTestEvent(const std::string &inName, const std::string &outName,
                    int StartWorkspaceIndex, int EndWorkspaceIndex) {
     int numPixels = 100;
     int numBins = 50;
@@ -229,8 +229,8 @@ public:
     doTestEvent("inWS", "inWS", 10, 29);
   }
 
-  void doTestRebinned(const std::string RangeLower,
-                      const std::string RangeUpper,
+  void doTestRebinned(const std::string &RangeLower,
+                      const std::string &RangeUpper,
                       const int StartWorkspaceIndex,
                       const int EndWorkspaceIndex,
                       const bool IncludePartialBins, const int expectedNumHists,
@@ -290,7 +290,7 @@ public:
     doTestRebinned("-1.5", "1.75", 0, 3, true, 4, truth);
   }
 
-  void makeRealBinBoundariesWorkspace(const std::string inWsName) {
+  void makeRealBinBoundariesWorkspace(const std::string &inWsName) {
     const unsigned int lenX = 11, lenY = 10, lenE = lenY;
 
     Workspace_sptr wsAsWs =
@@ -326,9 +326,9 @@ public:
     AnalysisDataService::Instance().add(inWsName, ws);
   }
 
-  void doTestRealBinBoundaries(const std::string inWsName,
-                               const std::string rangeLower,
-                               const std::string rangeUpper,
+  void doTestRealBinBoundaries(const std::string &inWsName,
+                               const std::string &rangeLower,
+                               const std::string &rangeUpper,
                                const double expectedVal,
                                const bool checkRanges = false,
                                const bool IncPartialBins = false) {
@@ -707,7 +707,7 @@ public:
   }
 
   template <typename F>
-  void wsBoundsTest(std::string workspace, int startIndex, int endIndex,
+  void wsBoundsTest(const std::string &workspace, int startIndex, int endIndex,
                     F boundsAssert) {
     MatrixWorkspace_sptr input;
     TS_ASSERT_THROWS_NOTHING(
@@ -732,8 +732,9 @@ public:
   }
 
   void testStartWsIndexOutOfBounds() {
-    auto boundsAssert = [](MatrixWorkspace_sptr, MatrixWorkspace_sptr output,
-                           int, int endIndex) {
+    auto boundsAssert = [](const MatrixWorkspace_sptr &,
+                           const MatrixWorkspace_sptr &output, int,
+                           int endIndex) {
       TS_ASSERT_EQUALS(output->getNumberHistograms(), endIndex + 1);
     };
 
@@ -741,8 +742,9 @@ public:
   }
 
   void testStartWSIndexGreaterThanEnd() {
-    auto boundsAssert = [](MatrixWorkspace_sptr input,
-                           MatrixWorkspace_sptr output, int startIndex, int) {
+    auto boundsAssert = [](const MatrixWorkspace_sptr &input,
+                           const MatrixWorkspace_sptr &output, int startIndex,
+                           int) {
       TS_ASSERT_EQUALS(output->getNumberHistograms(),
                        input->getNumberHistograms() - startIndex);
     };
@@ -751,8 +753,8 @@ public:
   }
 
   void testStartWSIndexEqualsEnd() {
-    auto boundsAssert = [](MatrixWorkspace_sptr, MatrixWorkspace_sptr output,
-                           int, int) {
+    auto boundsAssert = [](const MatrixWorkspace_sptr &,
+                           const MatrixWorkspace_sptr &output, int, int) {
       TS_ASSERT_EQUALS(output->getNumberHistograms(), 1);
     };
 
@@ -780,7 +782,7 @@ public:
   }
 
 private:
-  void assertRangeWithPartialBins(Workspace_sptr input) {
+  void assertRangeWithPartialBins(const Workspace_sptr &input) {
     Integration alg;
     alg.setRethrows(false);
     TS_ASSERT_THROWS_NOTHING(alg.initialize());
diff --git a/Framework/Algorithms/test/LineProfileTest.h b/Framework/Algorithms/test/LineProfileTest.h
index 1ceace8fe27..ec4e372c533 100644
--- a/Framework/Algorithms/test/LineProfileTest.h
+++ b/Framework/Algorithms/test/LineProfileTest.h
@@ -584,9 +584,9 @@ public:
   }
 
 private:
-  MatrixWorkspace_sptr profileOverTwoSpectra(MatrixWorkspace_sptr inputWS,
-                                             const int start, const int end,
-                                             const std::string &mode) {
+  MatrixWorkspace_sptr
+  profileOverTwoSpectra(const MatrixWorkspace_sptr &inputWS, const int start,
+                        const int end, const std::string &mode) {
     LineProfile alg;
     // Don't put output in ADS by default
     alg.setChild(true);
diff --git a/Framework/Algorithms/test/MCInteractionVolumeTest.h b/Framework/Algorithms/test/MCInteractionVolumeTest.h
index cb97ba7658a..199fa0f9c27 100644
--- a/Framework/Algorithms/test/MCInteractionVolumeTest.h
+++ b/Framework/Algorithms/test/MCInteractionVolumeTest.h
@@ -358,7 +358,8 @@ private:
   Mantid::Kernel::Logger g_log{"MCInteractionVolumeTest"};
 
   void TestGeneratedTracks(const V3D startPos, const V3D endPos,
-                           const Track beforeScatter, const Track afterScatter,
+                           const Track &beforeScatter,
+                           const Track &afterScatter,
                            const Mantid::Geometry::IObject &shape) {
     // check the generated tracks share the same start point (the scatter point)
     TS_ASSERT_EQUALS(beforeScatter.startPoint(), afterScatter.startPoint());
diff --git a/Framework/Algorithms/test/MagFormFactorCorrectionTest.h b/Framework/Algorithms/test/MagFormFactorCorrectionTest.h
index 8f2cdb2d61f..2ec64fbbb6c 100644
--- a/Framework/Algorithms/test/MagFormFactorCorrectionTest.h
+++ b/Framework/Algorithms/test/MagFormFactorCorrectionTest.h
@@ -91,7 +91,7 @@ private:
   std::string formFactorWSname;
 
   // Creates a fake workspace
-  void createWorkspaceMag(bool isHistogram, std::string wsname) {
+  void createWorkspaceMag(bool isHistogram, const std::string &wsname) {
     const int nspecs(10);
     const int nbins(50);
     const double invfourPiSqr = 1. / (16. * M_PI * M_PI);
@@ -116,8 +116,9 @@ private:
   }
 
   // Checks that all the workspaces are consistent (in = out*ff)
-  double checkWorkspaces(MatrixWorkspace_sptr in, MatrixWorkspace_sptr out,
-                         MatrixWorkspace_sptr ff) {
+  double checkWorkspaces(const MatrixWorkspace_sptr &in,
+                         const MatrixWorkspace_sptr &out,
+                         const MatrixWorkspace_sptr &ff) {
     const int64_t nbins = in->blocksize();
     const int64_t nspecs = in->getNumberHistograms();
     double df2 = 0., df;
diff --git a/Framework/Algorithms/test/MergeLogsTest.h b/Framework/Algorithms/test/MergeLogsTest.h
index 535868d98a4..624b44238ef 100644
--- a/Framework/Algorithms/test/MergeLogsTest.h
+++ b/Framework/Algorithms/test/MergeLogsTest.h
@@ -116,7 +116,7 @@ public:
     return log;
   }
 
-  void testLogValues(MatrixWorkspace_sptr ws, const std::string &name,
+  void testLogValues(const MatrixWorkspace_sptr &ws, const std::string &name,
                      const int msize, double value) {
     TimeSeriesProperty<double> *log =
         ws->run().getTimeSeriesProperty<double>(name);
@@ -131,7 +131,7 @@ public:
   }
 
   // msize1 < msize2!
-  void testLogValues(MatrixWorkspace_sptr ws, const std::string &name,
+  void testLogValues(const MatrixWorkspace_sptr &ws, const std::string &name,
                      const int msize1, const int msize2, const double v1,
                      const double v2) {
     TimeSeriesProperty<double> *log =
diff --git a/Framework/Algorithms/test/MergeRunsTest.h b/Framework/Algorithms/test/MergeRunsTest.h
index a5e92fe227b..3e696152726 100644
--- a/Framework/Algorithms/test/MergeRunsTest.h
+++ b/Framework/Algorithms/test/MergeRunsTest.h
@@ -40,8 +40,8 @@ private:
   MergeRuns merge;
 
   /// Helper method to add an 'nperiods' log value to each workspace in a group.
-  void add_periods_logs(WorkspaceGroup_sptr ws, bool calculateNPeriods = true,
-                        int nperiods = -1) {
+  void add_periods_logs(const WorkspaceGroup_sptr &ws,
+                        bool calculateNPeriods = true, int nperiods = -1) {
     if (calculateNPeriods) {
       nperiods = static_cast<int>(ws->size());
     }
@@ -268,7 +268,7 @@ private:
     return c;
   }
 
-  void do_test_treat_as_non_period_groups(WorkspaceGroup_sptr input) {
+  void do_test_treat_as_non_period_groups(const WorkspaceGroup_sptr &input) {
     MatrixWorkspace_sptr sampleInputWorkspace =
         boost::dynamic_pointer_cast<MatrixWorkspace>(input->getItem(0));
     const double uniformSignal = sampleInputWorkspace->y(0)[0];
@@ -320,7 +320,7 @@ public:
         "in6", WorkspaceCreationHelper::create2DWorkspaceBinned(3, 3, 2., 2.));
   }
 
-  void checkOutput(std::string wsname) {
+  void checkOutput(const std::string &wsname) {
     EventWorkspace_sptr output;
     TimeSeriesProperty<double> *log;
     int log1, log2, logTot;
@@ -874,7 +874,8 @@ public:
     AnalysisDataService::Instance().remove("outer");
   }
 
-  void do_test_validation_throws(WorkspaceGroup_sptr a, WorkspaceGroup_sptr b) {
+  void do_test_validation_throws(const WorkspaceGroup_sptr &a,
+                                 const WorkspaceGroup_sptr &b) {
     MergeRuns alg;
     alg.setRethrows(true);
     alg.initialize();
@@ -911,7 +912,7 @@ public:
     do_test_validation_throws(aCorrupted, a);
   }
 
-  void do_test_with_multiperiod_data(WorkspaceGroup_sptr input) {
+  void do_test_with_multiperiod_data(const WorkspaceGroup_sptr &input) {
     // Extract some internal information from the nested workspaces in order to
     // run test asserts later.
     const size_t expectedNumHistograms =
@@ -1356,8 +1357,8 @@ public:
                             3);
   }
 
-  void do_test_merge_two_workspaces_then_third(std::string mergeType,
-                                               std::string result) {
+  void do_test_merge_two_workspaces_then_third(const std::string &mergeType,
+                                               const std::string &result) {
     auto ws = create_group_workspace_with_sample_logs<double>(
         mergeType, "prop1", 1.0, 2.0, 3.0, 4.0);
 
@@ -1391,8 +1392,8 @@ public:
                                             "1, 2, 5");
   }
 
-  void do_test_merging_two_workspaces_both_already_merged(std::string mergeType,
-                                                          std::string result) {
+  void do_test_merging_two_workspaces_both_already_merged(
+      const std::string &mergeType, const std::string &result) {
     auto ws = create_group_workspace_with_sample_logs<double>(
         mergeType, "prop1", 1.0, 2.0, 3.0, 4.0);
 
diff --git a/Framework/Algorithms/test/ModeratorTzeroLinearTest.h b/Framework/Algorithms/test/ModeratorTzeroLinearTest.h
index 011ea38cf3b..5c07a2aba50 100644
--- a/Framework/Algorithms/test/ModeratorTzeroLinearTest.h
+++ b/Framework/Algorithms/test/ModeratorTzeroLinearTest.h
@@ -26,7 +26,7 @@ using Mantid::HistogramData::LinearGenerator;
 using Mantid::Types::Event::TofEvent;
 
 namespace {
-void addToInstrument(MatrixWorkspace_sptr testWS,
+void addToInstrument(const MatrixWorkspace_sptr &testWS,
                      const bool &add_deltaE_mode = false,
                      const bool &add_t0_formula = false) {
   const double evalue(2.082); // energy corresponding to the first order Bragg
diff --git a/Framework/Algorithms/test/MonteCarloAbsorptionTest.h b/Framework/Algorithms/test/MonteCarloAbsorptionTest.h
index e9dde8bff9b..2754ce99000 100644
--- a/Framework/Algorithms/test/MonteCarloAbsorptionTest.h
+++ b/Framework/Algorithms/test/MonteCarloAbsorptionTest.h
@@ -40,7 +40,7 @@ struct TestWorkspaceDescriptor {
   double beamHeight;
 };
 
-void addSample(Mantid::API::MatrixWorkspace_sptr ws,
+void addSample(const Mantid::API::MatrixWorkspace_sptr &ws,
                const Environment environment, double beamWidth = 0.,
                double beamHeight = 0.) {
   using namespace Mantid::API;
@@ -403,7 +403,7 @@ private:
   }
 
   Mantid::API::MatrixWorkspace_const_sptr
-  getOutputWorkspace(Mantid::API::IAlgorithm_sptr alg) {
+  getOutputWorkspace(const Mantid::API::IAlgorithm_sptr &alg) {
     using Mantid::API::MatrixWorkspace_sptr;
     MatrixWorkspace_sptr output = alg->getProperty("OutputWorkspace");
     TS_ASSERT(output);
@@ -412,8 +412,9 @@ private:
     return output;
   }
 
-  void verifyDimensions(TestWorkspaceDescriptor wsProps,
-                        Mantid::API::MatrixWorkspace_const_sptr outputWS) {
+  void
+  verifyDimensions(TestWorkspaceDescriptor wsProps,
+                   const Mantid::API::MatrixWorkspace_const_sptr &outputWS) {
     TS_ASSERT_EQUALS(wsProps.nspectra, outputWS->getNumberHistograms());
     TS_ASSERT_EQUALS(wsProps.nbins, outputWS->blocksize());
   }
diff --git a/Framework/Algorithms/test/NormaliseByCurrentTest.h b/Framework/Algorithms/test/NormaliseByCurrentTest.h
index 766db44fb1b..6b3ca7a6290 100644
--- a/Framework/Algorithms/test/NormaliseByCurrentTest.h
+++ b/Framework/Algorithms/test/NormaliseByCurrentTest.h
@@ -9,6 +9,8 @@
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/WorkspaceGroup.h"
@@ -25,9 +27,10 @@ using namespace Mantid::Algorithms;
 using namespace Mantid::DataObjects;
 
 namespace {
-MatrixWorkspace_const_sptr doTest(MatrixWorkspace_sptr inWS,
-                                  std::string wsNameOut, double expectedY,
-                                  double expectedE, bool calcPcharge = false,
+MatrixWorkspace_const_sptr doTest(const MatrixWorkspace_sptr &inWS,
+                                  const std::string &wsNameOut,
+                                  double expectedY, double expectedE,
+                                  bool calcPcharge = false,
                                   bool performance = false) {
   NormaliseByCurrent norm1;
   if (!norm1.isInitialized())
@@ -87,7 +90,8 @@ MatrixWorkspace_const_sptr doTest(MatrixWorkspace_sptr inWS,
   return output;
 }
 
-MatrixWorkspace_const_sptr doTest(std::string wsNameIn, std::string wsNameOut,
+MatrixWorkspace_const_sptr doTest(const std::string &wsNameIn,
+                                  const std::string &wsNameOut,
                                   const double pCharge, double expectedY,
                                   double expectedE, bool performance = false) {
   MatrixWorkspace_sptr inWS =
@@ -99,13 +103,14 @@ MatrixWorkspace_const_sptr doTest(std::string wsNameIn, std::string wsNameOut,
       Mantid::Kernel::UnitFactory::Instance().create("TOF");
   inWS->setYUnit("Counts");
 
-  return doTest(inWS, wsNameOut, expectedY, expectedE, true, performance);
+  return doTest(inWS, std::move(wsNameOut), expectedY, expectedE, true,
+                performance);
 }
 
 /// Helper method to add necessary log values to simulate multi-period data.
 /// The algorithm uses these logs to determien how to normalise by the
 /// current.
-void addMultiPeriodLogsTo(MatrixWorkspace_sptr ws, int period,
+void addMultiPeriodLogsTo(const MatrixWorkspace_sptr &ws, int period,
                           const std::string &protonCharges) {
   ArrayProperty<double> *chargeProp =
       new ArrayProperty<double>("proton_charge_by_period", protonCharges);
@@ -119,7 +124,8 @@ void addMultiPeriodLogsTo(MatrixWorkspace_sptr ws, int period,
   ws->mutableRun().addLogData(currentPeriodProp);
 }
 
-void addPChargeLogTo(MatrixWorkspace_sptr ws, const double pChargeAccum) {
+void addPChargeLogTo(const MatrixWorkspace_sptr &ws,
+                     const double pChargeAccum) {
   auto pchargeLog =
       std::make_unique<Kernel::TimeSeriesProperty<double>>("proton_charge");
 
diff --git a/Framework/Algorithms/test/NormaliseByDetectorTest.h b/Framework/Algorithms/test/NormaliseByDetectorTest.h
index feb1b287d04..8aa3652fe16 100644
--- a/Framework/Algorithms/test/NormaliseByDetectorTest.h
+++ b/Framework/Algorithms/test/NormaliseByDetectorTest.h
@@ -28,8 +28,8 @@ using ScopedFileHelper::ScopedFile;
 Helper function. Runs LoadParameterAlg, to get an instrument parameter
 definition from a file onto a workspace.
 */
-void apply_instrument_parameter_file_to_workspace(MatrixWorkspace_sptr ws,
-                                                  const ScopedFile &file) {
+void apply_instrument_parameter_file_to_workspace(
+    const MatrixWorkspace_sptr &ws, const ScopedFile &file) {
   // Load the Instrument Parameter file over the existing test workspace +
   // instrument.
   using DataHandling::LoadParameterFile;
@@ -46,7 +46,7 @@ Helper method for running the algorithm and simply verifying that it runs
 without exception producing an output workspace..
 */
 MatrixWorkspace_sptr
-do_test_doesnt_throw_on_execution(MatrixWorkspace_sptr inputWS,
+do_test_doesnt_throw_on_execution(const MatrixWorkspace_sptr &inputWS,
                                   bool parallel = true) {
   NormaliseByDetector alg(parallel);
   alg.setRethrows(true);
@@ -102,7 +102,7 @@ private:
    The fit function is set at the instrument level.
   */
   MatrixWorkspace_sptr create_workspace_with_fitting_functions(
-      const std::string result_unit = "Wavelength") {
+      const std::string &result_unit = "Wavelength") {
     // Create a default workspace with no-fitting functions.
     MatrixWorkspace_sptr ws = create_workspace_with_no_fitting_functions();
     const std::string instrumentName = ws->getInstrument()->getName();
@@ -228,7 +228,8 @@ private:
  */
   MatrixWorkspace_sptr
   create_workspace_with_incomplete_detector_level_only_fit_functions(
-      MatrixWorkspace_sptr original = boost::shared_ptr<MatrixWorkspace>()) {
+      const MatrixWorkspace_sptr &original =
+          boost::shared_ptr<MatrixWorkspace>()) {
     MatrixWorkspace_sptr ws = original;
     if (original == nullptr) {
       // Create a default workspace with no-fitting functions.
@@ -274,9 +275,8 @@ private:
   Helper method for running the algorithm and testing for invalid argument on
   execution.
   */
-  void
-  do_test_throws_invalid_argument_on_execution(MatrixWorkspace_sptr inputWS,
-                                               bool parallel = false) {
+  void do_test_throws_invalid_argument_on_execution(
+      const MatrixWorkspace_sptr &inputWS, bool parallel = false) {
     NormaliseByDetector alg(parallel);
     alg.setRethrows(true);
     alg.initialize();
@@ -651,7 +651,7 @@ public:
 
 private:
   /// Helper method to run common sanity checks.
-  void do_basic_checks(MatrixWorkspace_sptr normalisedWS) {
+  void do_basic_checks(const MatrixWorkspace_sptr &normalisedWS) {
     TS_ASSERT(normalisedWS != nullptr);
     TS_ASSERT(ws->getNumberHistograms() == normalisedWS->getNumberHistograms());
     TS_ASSERT(ws->x(0).size() == normalisedWS->x(0).size());
diff --git a/Framework/Algorithms/test/PDDetermineCharacterizationsTest.h b/Framework/Algorithms/test/PDDetermineCharacterizationsTest.h
index 0f2fea3fef9..f79748f75c1 100644
--- a/Framework/Algorithms/test/PDDetermineCharacterizationsTest.h
+++ b/Framework/Algorithms/test/PDDetermineCharacterizationsTest.h
@@ -82,8 +82,8 @@ public:
     }
   }
 
-  void addRow(ITableWorkspace_sptr wksp, const double freq, const double wl,
-              const int bank, const std::string &van,
+  void addRow(const ITableWorkspace_sptr &wksp, const double freq,
+              const double wl, const int bank, const std::string &van,
               const std::string &van_back, const std::string &can,
               const std::string &empty_env, const std::string &empty_inst,
               const std::string &dmin, const std::string &dmax,
@@ -209,8 +209,8 @@ public:
     return expectedInfo;
   }
 
-  void compareResult(PropertyManager_sptr expected,
-                     PropertyManager_sptr observed) {
+  void compareResult(const PropertyManager_sptr &expected,
+                     const PropertyManager_sptr &observed) {
     TS_ASSERT_EQUALS(expected->propertyCount(), observed->propertyCount());
 
     const std::vector<Property *> &expectedProps = expected->getProperties();
diff --git a/Framework/Algorithms/test/PDFFourierTransformTest.h b/Framework/Algorithms/test/PDFFourierTransformTest.h
index ecf820a0069..8b39d78f748 100644
--- a/Framework/Algorithms/test/PDFFourierTransformTest.h
+++ b/Framework/Algorithms/test/PDFFourierTransformTest.h
@@ -32,7 +32,7 @@ namespace {
  */
 Mantid::API::MatrixWorkspace_sptr createWS(size_t n, double dx,
                                            const std::string &name,
-                                           const std::string unitlabel,
+                                           const std::string &unitlabel,
                                            const bool withBadValues = false) {
 
   Mantid::API::FrameworkManager::Instance();
diff --git a/Framework/Algorithms/test/ParallaxCorrectionTest.h b/Framework/Algorithms/test/ParallaxCorrectionTest.h
index b6cdeb9e46e..36b63cf846c 100644
--- a/Framework/Algorithms/test/ParallaxCorrectionTest.h
+++ b/Framework/Algorithms/test/ParallaxCorrectionTest.h
@@ -27,7 +27,7 @@ using Mantid::Geometry::DetectorInfo;
 using Mantid::Kernel::V3D;
 
 namespace {
-bool compare(MatrixWorkspace_sptr w1, MatrixWorkspace_sptr w2) {
+bool compare(const MatrixWorkspace_sptr &w1, const MatrixWorkspace_sptr &w2) {
   CompareWorkspaces comparator;
   comparator.initialize();
   comparator.setChild(true);
diff --git a/Framework/Algorithms/test/PerformIndexOperationsTest.h b/Framework/Algorithms/test/PerformIndexOperationsTest.h
index 1502a093f78..0a0a0299272 100644
--- a/Framework/Algorithms/test/PerformIndexOperationsTest.h
+++ b/Framework/Algorithms/test/PerformIndexOperationsTest.h
@@ -16,7 +16,7 @@ using Mantid::Algorithms::PerformIndexOperations;
 using namespace Mantid::API;
 
 MatrixWorkspace_const_sptr
-doExecute(MatrixWorkspace_sptr inWS,
+doExecute(const MatrixWorkspace_sptr &inWS,
           const std::string &processingInstructions) {
   // Name of the output workspace.
   std::string outWSName("PerformIndexOperationsTest_OutputWS");
diff --git a/Framework/Algorithms/test/PoissonErrorsTest.h b/Framework/Algorithms/test/PoissonErrorsTest.h
index 4967c3533d8..1651bc0bdef 100644
--- a/Framework/Algorithms/test/PoissonErrorsTest.h
+++ b/Framework/Algorithms/test/PoissonErrorsTest.h
@@ -7,6 +7,8 @@
 #pragma once
 
 #include <cmath>
+#include <utility>
+
 #include <cxxtest/TestSuite.h>
 
 #include "MantidAPI/AnalysisDataService.h"
@@ -238,15 +240,18 @@ public:
   }
 
 private:
-  void checkData(MatrixWorkspace_sptr work_in1, MatrixWorkspace_sptr work_in2,
-                 MatrixWorkspace_sptr work_out1) {
+  void checkData(const MatrixWorkspace_sptr &work_in1,
+                 const MatrixWorkspace_sptr &work_in2,
+                 const MatrixWorkspace_sptr &work_out1) {
     // default to a horizontal loop orientation
-    checkData(work_in1, work_in2, work_out1, 0);
+    checkData(std::move(work_in1), std::move(work_in2), std::move(work_out1),
+              0);
   }
 
   // loopOrientation 0=Horizontal, 1=Vertical
-  void checkData(MatrixWorkspace_sptr work_in1, MatrixWorkspace_sptr work_in2,
-                 MatrixWorkspace_sptr work_out1, int loopOrientation) {
+  void checkData(const MatrixWorkspace_sptr &work_in1,
+                 const MatrixWorkspace_sptr &work_in2,
+                 const MatrixWorkspace_sptr &work_out1, int loopOrientation) {
     size_t ws2LoopCount = 0;
     if (work_in2->size() > 0) {
       ws2LoopCount = work_in1->size() / work_in2->size();
@@ -267,9 +272,9 @@ private:
     }
   }
 
-  void checkDataItem(MatrixWorkspace_sptr work_in1,
-                     MatrixWorkspace_sptr work_in2,
-                     MatrixWorkspace_sptr work_out1, size_t i,
+  void checkDataItem(const MatrixWorkspace_sptr &work_in1,
+                     const MatrixWorkspace_sptr &work_in2,
+                     const MatrixWorkspace_sptr &work_out1, size_t i,
                      size_t ws2Index) {
     // printf("I=%d\tws2Index=%d\n",i,ws2Index);
     double sig1 =
diff --git a/Framework/Algorithms/test/PolarizationCorrectionFredrikzeTest.h b/Framework/Algorithms/test/PolarizationCorrectionFredrikzeTest.h
index 4af539c20c9..b558ac16662 100644
--- a/Framework/Algorithms/test/PolarizationCorrectionFredrikzeTest.h
+++ b/Framework/Algorithms/test/PolarizationCorrectionFredrikzeTest.h
@@ -79,7 +79,7 @@ public:
     return group;
   }
 
-  MatrixWorkspace_sptr makeEfficiencies(Workspace_sptr inWS,
+  MatrixWorkspace_sptr makeEfficiencies(const Workspace_sptr &inWS,
                                         const std::string &rho,
                                         const std::string &pp,
                                         const std::string &alpha = "",
@@ -214,7 +214,8 @@ public:
     }
   }
 
-  void setInstrument(Workspace_sptr ws, const std::string &instrument_name) {
+  void setInstrument(const Workspace_sptr &ws,
+                     const std::string &instrument_name) {
     auto alg = AlgorithmManager::Instance().createUnmanaged("LoadInstrument");
     AnalysisDataService::Instance().addOrReplace("dummy", ws);
     alg->initialize();
diff --git a/Framework/Algorithms/test/Rebin2DTest.h b/Framework/Algorithms/test/Rebin2DTest.h
index 3d458558e08..3326dbccec4 100644
--- a/Framework/Algorithms/test/Rebin2DTest.h
+++ b/Framework/Algorithms/test/Rebin2DTest.h
@@ -76,7 +76,7 @@ MatrixWorkspace_sptr makeInputWS(const bool distribution,
   return ws;
 }
 
-MatrixWorkspace_sptr runAlgorithm(MatrixWorkspace_sptr inputWS,
+MatrixWorkspace_sptr runAlgorithm(const MatrixWorkspace_sptr &inputWS,
                                   const std::string &axis1Params,
                                   const std::string &axis2Params,
                                   const bool UseFractionalArea = false) {
@@ -273,9 +273,9 @@ public:
   }
 
 private:
-  void checkData(MatrixWorkspace_const_sptr outputWS, const size_t nxvalues,
-                 const size_t nhist, const bool dist, const bool onAxis1,
-                 const bool small_bins = false) {
+  void checkData(const MatrixWorkspace_const_sptr &outputWS,
+                 const size_t nxvalues, const size_t nhist, const bool dist,
+                 const bool onAxis1, const bool small_bins = false) {
     TS_ASSERT_EQUALS(outputWS->getNumberHistograms(), nhist);
     TS_ASSERT_EQUALS(outputWS->isDistribution(), dist);
     // Axis sizes
diff --git a/Framework/Algorithms/test/ReflectometryMomentumTransferTest.h b/Framework/Algorithms/test/ReflectometryMomentumTransferTest.h
index f3e8e41787b..d4c076943fb 100644
--- a/Framework/Algorithms/test/ReflectometryMomentumTransferTest.h
+++ b/Framework/Algorithms/test/ReflectometryMomentumTransferTest.h
@@ -283,7 +283,7 @@ private:
     TS_ASSERT(!alg->isExecuted())
   }
 
-  static API::Algorithm_sptr make_alg(API::MatrixWorkspace_sptr inputWS,
+  static API::Algorithm_sptr make_alg(const API::MatrixWorkspace_sptr &inputWS,
                                       const std::string &sumType,
                                       const std::vector<int> &foreground) {
     auto alg = boost::make_shared<Algorithms::ReflectometryMomentumTransfer>();
diff --git a/Framework/Algorithms/test/ReflectometryReductionOne2Test.h b/Framework/Algorithms/test/ReflectometryReductionOne2Test.h
index 382dec5feae..e0d381d6536 100644
--- a/Framework/Algorithms/test/ReflectometryReductionOne2Test.h
+++ b/Framework/Algorithms/test/ReflectometryReductionOne2Test.h
@@ -964,7 +964,7 @@ private:
                                             const double wavelengthMin,
                                             const double wavelengthMax,
                                             const std::string &procInstr,
-                                            MatrixWorkspace_sptr transWS,
+                                            const MatrixWorkspace_sptr &transWS,
                                             const bool multiple_runs) {
     setupAlgorithm(alg, wavelengthMin, wavelengthMax, procInstr);
     alg.setProperty("FirstTransmissionRun", transWS);
@@ -981,7 +981,7 @@ private:
                                        const double wavelengthMin,
                                        const double wavelengthMax,
                                        const std::string &procInstr,
-                                       MatrixWorkspace_sptr inputWS,
+                                       const MatrixWorkspace_sptr &inputWS,
                                        const bool integrate) {
     setupAlgorithm(alg, wavelengthMin, wavelengthMax, procInstr);
     alg.setProperty("InputWorkspace", inputWS);
@@ -997,8 +997,9 @@ private:
     }
   }
 
-  void setupAlgorithmForBackgroundSubtraction(ReflectometryReductionOne2 &alg,
-                                              MatrixWorkspace_sptr inputWS) {
+  void
+  setupAlgorithmForBackgroundSubtraction(ReflectometryReductionOne2 &alg,
+                                         const MatrixWorkspace_sptr &inputWS) {
     setupAlgorithm(alg, 0, 5, "3");
     alg.setChild(false); // required to get history
     alg.setProperty("InputWorkspace", inputWS);
@@ -1105,7 +1106,7 @@ private:
     return ws;
   }
 
-  void checkWorkspaceHistory(MatrixWorkspace_sptr ws,
+  void checkWorkspaceHistory(const MatrixWorkspace_sptr &ws,
                              std::vector<std::string> const &expected,
                              bool const unroll = true) {
     auto wsHistory = ws->getHistory();
@@ -1116,19 +1117,20 @@ private:
       auto childHistories = lastAlgHistory->getChildHistories();
       std::transform(childHistories.cbegin(), childHistories.cend(),
                      std::back_inserter(algNames),
-                     [](AlgorithmHistory_const_sptr childAlg) {
+                     [](const AlgorithmHistory_const_sptr &childAlg) {
                        return childAlg->name();
                      });
     } else if (!unroll) {
-      std::transform(algHistories.cbegin(), algHistories.cend(),
-                     std::back_inserter(algNames),
-                     [](AlgorithmHistory_sptr alg) { return alg->name(); });
+      std::transform(
+          algHistories.cbegin(), algHistories.cend(),
+          std::back_inserter(algNames),
+          [](const AlgorithmHistory_sptr &alg) { return alg->name(); });
     }
     TS_ASSERT_EQUALS(algNames, expected);
   }
 
   void checkHistoryAlgorithmProperties(
-      MatrixWorkspace_sptr ws, size_t toplevelIdx, size_t childIdx,
+      const MatrixWorkspace_sptr &ws, size_t toplevelIdx, size_t childIdx,
       std::map<std::string, std::string> const &expected) {
     auto parentHist = ws->getHistory().getAlgorithmHistory(toplevelIdx);
     auto childHistories = parentHist->getChildHistories();
diff --git a/Framework/Algorithms/test/ReflectometryReductionOneAuto2Test.h b/Framework/Algorithms/test/ReflectometryReductionOneAuto2Test.h
index 7c41d3fbc7b..38595e0e82e 100644
--- a/Framework/Algorithms/test/ReflectometryReductionOneAuto2Test.h
+++ b/Framework/Algorithms/test/ReflectometryReductionOneAuto2Test.h
@@ -1680,9 +1680,8 @@ public:
   }
 
 private:
-  MatrixWorkspace_sptr
-  createFloodWorkspace(Mantid::Geometry::Instrument_const_sptr instrument,
-                       size_t n = 4) {
+  MatrixWorkspace_sptr createFloodWorkspace(
+      const Mantid::Geometry::Instrument_const_sptr &instrument, size_t n = 4) {
     size_t detid = 1;
     auto flood = create2DWorkspace(int(n), 1);
     if (n == 4) {
diff --git a/Framework/Algorithms/test/ReflectometryReductionOneAuto3Test.h b/Framework/Algorithms/test/ReflectometryReductionOneAuto3Test.h
index 23b0201f6bf..2041bcb2bf2 100644
--- a/Framework/Algorithms/test/ReflectometryReductionOneAuto3Test.h
+++ b/Framework/Algorithms/test/ReflectometryReductionOneAuto3Test.h
@@ -1594,9 +1594,8 @@ public:
   }
 
 private:
-  MatrixWorkspace_sptr
-  createFloodWorkspace(Mantid::Geometry::Instrument_const_sptr instrument,
-                       size_t n = 4) {
+  MatrixWorkspace_sptr createFloodWorkspace(
+      const Mantid::Geometry::Instrument_const_sptr &instrument, size_t n = 4) {
     size_t detid = 1;
     auto flood = create2DWorkspace(int(n), 1);
     if (n == 4) {
diff --git a/Framework/Algorithms/test/ReflectometrySumInQTest.h b/Framework/Algorithms/test/ReflectometrySumInQTest.h
index 0dd4fdcb4d0..08f40af6047 100644
--- a/Framework/Algorithms/test/ReflectometrySumInQTest.h
+++ b/Framework/Algorithms/test/ReflectometrySumInQTest.h
@@ -29,7 +29,7 @@ public:
   static void destroySuite(ReflectometrySumInQTest *suite) { delete suite; }
 
   static Mantid::API::MatrixWorkspace_sptr
-  convertToWavelength(Mantid::API::MatrixWorkspace_sptr ws) {
+  convertToWavelength(const Mantid::API::MatrixWorkspace_sptr &ws) {
     using namespace Mantid;
     auto toWavelength =
         API::AlgorithmManager::Instance().createUnmanaged("ConvertUnits");
@@ -44,7 +44,7 @@ public:
   }
 
   static Mantid::API::MatrixWorkspace_sptr
-  detectorsOnly(Mantid::API::MatrixWorkspace_sptr ws) {
+  detectorsOnly(const Mantid::API::MatrixWorkspace_sptr &ws) {
     using namespace Mantid;
     auto &specturmInfo = ws->spectrumInfo();
     std::vector<size_t> detectorIndices;
diff --git a/Framework/Algorithms/test/RemoveLowResTOFTest.h b/Framework/Algorithms/test/RemoveLowResTOFTest.h
index 5e7b3aab3fd..d332578bed3 100644
--- a/Framework/Algorithms/test/RemoveLowResTOFTest.h
+++ b/Framework/Algorithms/test/RemoveLowResTOFTest.h
@@ -31,7 +31,7 @@ private:
   int NUMPIXELS;
   int NUMBINS;
 
-  void makeFakeEventWorkspace(std::string wsName) {
+  void makeFakeEventWorkspace(const std::string &wsName) {
     // Make an event workspace with 2 events in each bin.
     EventWorkspace_sptr test_in = WorkspaceCreationHelper::createEventWorkspace(
         NUMPIXELS, NUMBINS, NUMBINS, 0.0, BIN_DELTA, 2);
diff --git a/Framework/Algorithms/test/RemoveMaskedSpectraTest.h b/Framework/Algorithms/test/RemoveMaskedSpectraTest.h
index 9bda9c5894a..8d182e7a87a 100644
--- a/Framework/Algorithms/test/RemoveMaskedSpectraTest.h
+++ b/Framework/Algorithms/test/RemoveMaskedSpectraTest.h
@@ -106,7 +106,7 @@ private:
     return space;
   }
 
-  void maskWorkspace(MatrixWorkspace_sptr ws) {
+  void maskWorkspace(const MatrixWorkspace_sptr &ws) {
     std::vector<int> spectra(3);
     spectra[0] = 1;
     spectra[1] = 3;
@@ -119,8 +119,8 @@ private:
   }
 
   MatrixWorkspace_sptr
-  runAlgorithm(MatrixWorkspace_sptr inputWS,
-               MatrixWorkspace_sptr maskedWS = MatrixWorkspace_sptr()) {
+  runAlgorithm(const MatrixWorkspace_sptr &inputWS,
+               const MatrixWorkspace_sptr &maskedWS = MatrixWorkspace_sptr()) {
     // Name of the output workspace.
     std::string outWSName("RemoveMaskedSpectraTest_OutputWS");
 
diff --git a/Framework/Algorithms/test/RemovePromptPulseTest.h b/Framework/Algorithms/test/RemovePromptPulseTest.h
index 83f907853a6..e21a5651c8c 100644
--- a/Framework/Algorithms/test/RemovePromptPulseTest.h
+++ b/Framework/Algorithms/test/RemovePromptPulseTest.h
@@ -32,7 +32,7 @@ private:
   std::string inWSName;
   std::string outWSName;
 
-  void makeFakeEventWorkspace(std::string wsName) {
+  void makeFakeEventWorkspace(const std::string &wsName) {
     // Make an event workspace with 2 events in each bin.
     EventWorkspace_sptr test_in = WorkspaceCreationHelper::createEventWorkspace(
         NUMPIXELS, NUMBINS, NUMEVENTS, 1000., BIN_DELTA, 2);
diff --git a/Framework/Algorithms/test/RemoveWorkspaceHistoryTest.h b/Framework/Algorithms/test/RemoveWorkspaceHistoryTest.h
index 7ca2bdcfd94..81ff558e5e3 100644
--- a/Framework/Algorithms/test/RemoveWorkspaceHistoryTest.h
+++ b/Framework/Algorithms/test/RemoveWorkspaceHistoryTest.h
@@ -64,7 +64,7 @@ private:
     }
   };
 
-  void createWorkspace(std::string wsName) {
+  void createWorkspace(const std::string &wsName) {
     // create a fake workspace for testing
     boost::shared_ptr<WorkspaceTester> input =
         boost::make_shared<WorkspaceTester>();
diff --git a/Framework/Algorithms/test/ReplaceSpecialValuesTest.h b/Framework/Algorithms/test/ReplaceSpecialValuesTest.h
index 322e88fbf98..ff1ef4fe38d 100644
--- a/Framework/Algorithms/test/ReplaceSpecialValuesTest.h
+++ b/Framework/Algorithms/test/ReplaceSpecialValuesTest.h
@@ -247,8 +247,9 @@ public:
     AnalysisDataService::Instance().remove("InputWS");
   }
 
-  void checkValues(MatrixWorkspace_sptr inputWS, MatrixWorkspace_sptr result,
-                   bool naNCheck, bool infCheck) {
+  void checkValues(const MatrixWorkspace_sptr &inputWS,
+                   const MatrixWorkspace_sptr &result, bool naNCheck,
+                   bool infCheck) {
 
     for (size_t i = 0; i < result->getNumberHistograms(); ++i) {
       for (int j = 1; j < 5; ++j) {
diff --git a/Framework/Algorithms/test/RingProfileTest.h b/Framework/Algorithms/test/RingProfileTest.h
index 725ed7fbb38..5eef8b18169 100644
--- a/Framework/Algorithms/test/RingProfileTest.h
+++ b/Framework/Algorithms/test/RingProfileTest.h
@@ -148,8 +148,9 @@ public:
     return goodWS;
   }
 
-  void configure_ring_profile(RingProfile &alg, MatrixWorkspace_sptr inws,
-                              std::vector<double> centre, int num_bins,
+  void configure_ring_profile(RingProfile &alg,
+                              const MatrixWorkspace_sptr &inws,
+                              const std::vector<double> &centre, int num_bins,
                               double start_angle = 0, double min_radius = 0,
                               double max_radius = 1000, bool anticlock = true) {
     TS_ASSERT_THROWS_NOTHING(alg.initialize());
diff --git a/Framework/Algorithms/test/RunCombinationHelperTest.h b/Framework/Algorithms/test/RunCombinationHelperTest.h
index f969377a6ea..e2319d0eefe 100644
--- a/Framework/Algorithms/test/RunCombinationHelperTest.h
+++ b/Framework/Algorithms/test/RunCombinationHelperTest.h
@@ -187,7 +187,7 @@ public:
   }
 
 private:
-  void setUnits(MatrixWorkspace_sptr ws) {
+  void setUnits(const MatrixWorkspace_sptr &ws) {
     ws->getAxis(0)->unit() = UnitFactory::Instance().create("TOF");
     ws->getAxis(1)->unit() = UnitFactory::Instance().create("Momentum");
     ws->setYUnit("Counts");
diff --git a/Framework/Algorithms/test/SANSCollimationLengthEstimatorTest.h b/Framework/Algorithms/test/SANSCollimationLengthEstimatorTest.h
index a950bb69a85..8ee9edd6fa8 100644
--- a/Framework/Algorithms/test/SANSCollimationLengthEstimatorTest.h
+++ b/Framework/Algorithms/test/SANSCollimationLengthEstimatorTest.h
@@ -9,6 +9,8 @@
 #include "MantidAlgorithms/SANSCollimationLengthEstimator.h"
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "MantidGeometry/Instrument.h"
 #include "MantidGeometry/Instrument/Detector.h"
 #include "MantidGeometry/Objects/CSGObject.h"
@@ -71,8 +73,8 @@ createTestInstrument(const Mantid::detid_t id,
  * Set the instrument parameters
  */
 void setInstrumentParametersForTOFSANS(
-    const Mantid::API::MatrixWorkspace_sptr ws, std::string methodType = "",
-    double collimationLengthCorrection = 20,
+    const Mantid::API::MatrixWorkspace_sptr &ws,
+    const std::string &methodType = "", double collimationLengthCorrection = 20,
     double collimationLengthIncrement = 2, double guideCutoff = 130,
     double numberOfGuides = 5) {
   auto &pmap = ws->instrumentParameters();
@@ -106,8 +108,8 @@ void setInstrumentParametersForTOFSANS(
 /*
  * Add a timer series sample log
  */
-void addSampleLog(Mantid::API::MatrixWorkspace_sptr workspace,
-                  std::string sampleLogName, double value,
+void addSampleLog(const Mantid::API::MatrixWorkspace_sptr &workspace,
+                  const std::string &sampleLogName, double value,
                   unsigned int length) {
   auto timeSeries =
       new Mantid::Kernel::TimeSeriesProperty<double>(sampleLogName);
@@ -124,7 +126,7 @@ void addSampleLog(Mantid::API::MatrixWorkspace_sptr workspace,
  */
 Mantid::API::MatrixWorkspace_sptr createTestWorkspace(
     const size_t nhist, const double x0, const double x1, const double dx,
-    std::string methodType = "", double collimationLengthCorrection = 20,
+    const std::string &methodType = "", double collimationLengthCorrection = 20,
     double collimationLengthIncrement = 2, double guideCutoff = 130,
     double numberOfGuides = 5, V3D sourcePosition = V3D(0.0, 0.0, -25.0),
     V3D samplePosition = V3D(0.0, 0.0, 0.0),
@@ -142,8 +144,8 @@ Mantid::API::MatrixWorkspace_sptr createTestWorkspace(
 
   // Set the instrument parameters
   setInstrumentParametersForTOFSANS(
-      ws2d, methodType, collimationLengthCorrection, collimationLengthIncrement,
-      guideCutoff, numberOfGuides);
+      ws2d, std::move(methodType), collimationLengthCorrection,
+      collimationLengthIncrement, guideCutoff, numberOfGuides);
 
   // Add sample log details
   if (!guideLogDetails.empty()) {
diff --git a/Framework/Algorithms/test/SampleLogsBehaviourTest.h b/Framework/Algorithms/test/SampleLogsBehaviourTest.h
index 6feaafde477..3cc82415ad8 100644
--- a/Framework/Algorithms/test/SampleLogsBehaviourTest.h
+++ b/Framework/Algorithms/test/SampleLogsBehaviourTest.h
@@ -221,7 +221,7 @@ public:
     return ws;
   }
 
-  void testLogUnits(MatrixWorkspace_sptr ws) {
+  void testLogUnits(const MatrixWorkspace_sptr &ws) {
     // All units must not have changed:
     TS_ASSERT_EQUALS(ws->getLog("A")->units(), "A_unit")
     TS_ASSERT_EQUALS(ws->getLog("B")->units(), "B_unit")
diff --git a/Framework/Algorithms/test/ScaleTest.h b/Framework/Algorithms/test/ScaleTest.h
index 08df28cbaef..973f48ebc64 100644
--- a/Framework/Algorithms/test/ScaleTest.h
+++ b/Framework/Algorithms/test/ScaleTest.h
@@ -127,7 +127,7 @@ private:
     }
   }
 
-  void doTestScaleWithDx(std::string type, bool outIsIn = false) {
+  void doTestScaleWithDx(const std::string &type, bool outIsIn = false) {
     // Arrange
     const double xValue = 1.222;
     const double value = 5;
diff --git a/Framework/Algorithms/test/SetInstrumentParameterTest.h b/Framework/Algorithms/test/SetInstrumentParameterTest.h
index b718fba691a..7da3ec3c0c4 100644
--- a/Framework/Algorithms/test/SetInstrumentParameterTest.h
+++ b/Framework/Algorithms/test/SetInstrumentParameterTest.h
@@ -173,10 +173,10 @@ public:
   }
 
   MatrixWorkspace_sptr
-  ExecuteAlgorithm(MatrixWorkspace_sptr testWS, std::string cmptName,
-                   std::string detList, std::string paramName,
-                   std::string paramValue, std::string paramType = "",
-                   bool fails = false) {
+  ExecuteAlgorithm(MatrixWorkspace_sptr testWS, const std::string &cmptName,
+                   const std::string &detList, const std::string &paramName,
+                   const std::string &paramValue,
+                   const std::string &paramType = "", bool fails = false) {
     // add the workspace to the ADS
     AnalysisDataService::Instance().addOrReplace(
         "SetInstrumentParameter_Temporary", testWS);
diff --git a/Framework/Algorithms/test/ShiftLogTimeTest.h b/Framework/Algorithms/test/ShiftLogTimeTest.h
index b827da4744f..64a2111fe9b 100644
--- a/Framework/Algorithms/test/ShiftLogTimeTest.h
+++ b/Framework/Algorithms/test/ShiftLogTimeTest.h
@@ -61,7 +61,7 @@ private:
    * @param in_name Name of the input workspace.
    * @param out_name Name of the output workspace.
    */
-  void verify(const std::string in_name, const std::string out_name,
+  void verify(const std::string &in_name, const std::string &out_name,
               const int shift) {
     DateAndTime start(start_str);
 
diff --git a/Framework/Algorithms/test/SmoothNeighboursTest.h b/Framework/Algorithms/test/SmoothNeighboursTest.h
index 317f8eb0442..39ede25745d 100644
--- a/Framework/Algorithms/test/SmoothNeighboursTest.h
+++ b/Framework/Algorithms/test/SmoothNeighboursTest.h
@@ -21,7 +21,7 @@ using namespace Mantid::Algorithms;
 class SmoothNeighboursTest : public CxxTest::TestSuite {
 
 public:
-  void doTestWithNumberOfNeighbours(std::string WeightedSum = "Flat") {
+  void doTestWithNumberOfNeighbours(const std::string &WeightedSum = "Flat") {
     MatrixWorkspace_sptr inWS =
         WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(100, 10);
 
@@ -75,7 +75,7 @@ public:
   }
 
   void do_test_non_uniform(EventType type, double *expectedY,
-                           std::string WeightedSum = "Parabolic",
+                           const std::string &WeightedSum = "Parabolic",
                            bool PreserveEvents = true, double Radius = 0.001,
                            bool ConvertTo2D = false,
                            int numberOfNeighbours = 8) {
@@ -158,7 +158,7 @@ public:
   }
 
   void do_test_rectangular(EventType type, double *expectedY,
-                           std::string WeightedSum = "Parabolic",
+                           const std::string &WeightedSum = "Parabolic",
                            bool PreserveEvents = true,
                            bool ConvertTo2D = false) {
     // Pixels will be spaced 0.008 apart.
diff --git a/Framework/Algorithms/test/SofQCommonTest.h b/Framework/Algorithms/test/SofQCommonTest.h
index 46ee0e873b8..d2aae616191 100644
--- a/Framework/Algorithms/test/SofQCommonTest.h
+++ b/Framework/Algorithms/test/SofQCommonTest.h
@@ -257,7 +257,7 @@ private:
     return std::sqrt(ki * ki + kf * kf - 2. * ki * kf * std::cos(twoTheta));
   }
 
-  static void setEFixed(Mantid::API::MatrixWorkspace_sptr ws,
+  static void setEFixed(const Mantid::API::MatrixWorkspace_sptr &ws,
                         const std::string &component, const double eFixed) {
     using namespace Mantid;
     auto alg = API::AlgorithmManager::Instance().createUnmanaged(
diff --git a/Framework/Algorithms/test/SofQWNormalisedPolygonTest.h b/Framework/Algorithms/test/SofQWNormalisedPolygonTest.h
index eaa457965e3..9e9ca636f28 100644
--- a/Framework/Algorithms/test/SofQWNormalisedPolygonTest.h
+++ b/Framework/Algorithms/test/SofQWNormalisedPolygonTest.h
@@ -364,9 +364,10 @@ public:
    * @param twoThetaRanges input table workspace
    * @return the algorithm object
    */
-  IAlgorithm_sptr setUpAlg(
-      Mantid::API::MatrixWorkspace_sptr const inputWS,
-      boost::shared_ptr<Mantid::DataObjects::TableWorkspace> twoThetaRanges) {
+  IAlgorithm_sptr
+  setUpAlg(Mantid::API::MatrixWorkspace_sptr const &inputWS,
+           const boost::shared_ptr<Mantid::DataObjects::TableWorkspace>
+               &twoThetaRanges) {
     const std::vector<double> qBinParams{0.023};
     IAlgorithm_sptr alg =
         AlgorithmManager::Instance().create("SofQWNormalisedPolygon");
@@ -384,7 +385,7 @@ public:
    * @return A pointer to the table workspace
    */
   boost::shared_ptr<Mantid::DataObjects::TableWorkspace>
-  createTableWorkspace(const std::vector<std::string> dataTypes,
+  createTableWorkspace(const std::vector<std::string> &dataTypes,
                        const int rowCount) {
     auto twoThetaRanges = boost::make_shared<TableWorkspace>();
     std::vector<std::string> names = {"Detector ID", "Max two theta",
diff --git a/Framework/Algorithms/test/SpecularReflectionAlgorithmTest.h b/Framework/Algorithms/test/SpecularReflectionAlgorithmTest.h
index 740e27ac27c..45e7009a10f 100644
--- a/Framework/Algorithms/test/SpecularReflectionAlgorithmTest.h
+++ b/Framework/Algorithms/test/SpecularReflectionAlgorithmTest.h
@@ -68,7 +68,8 @@ protected:
   }
 
   VerticalHorizontalOffsetType determine_vertical_and_horizontal_offsets(
-      MatrixWorkspace_sptr ws, std::string detectorName = "point-detector") {
+      const MatrixWorkspace_sptr &ws,
+      const std::string &detectorName = "point-detector") {
     auto instrument = ws->getInstrument();
     const V3D pointDetector =
         instrument->getComponentByName(detectorName)->getPos();
diff --git a/Framework/Algorithms/test/SpecularReflectionPositionCorrectTest.h b/Framework/Algorithms/test/SpecularReflectionPositionCorrectTest.h
index d2d7c5edc44..3f91a26dd6d 100644
--- a/Framework/Algorithms/test/SpecularReflectionPositionCorrectTest.h
+++ b/Framework/Algorithms/test/SpecularReflectionPositionCorrectTest.h
@@ -15,6 +15,7 @@
 #include "MantidKernel/V3D.h"
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 #include <cmath>
+#include <utility>
 
 using Mantid::Algorithms::SpecularReflectionPositionCorrect;
 using namespace Mantid::API;
@@ -181,9 +182,9 @@ public:
                      sampleToDetectorBeamOffset, 1e-6);
   }
 
-  void
-  do_test_correct_point_detector_position(std::string detectorFindProperty = "",
-                                          std::string stringValue = "") {
+  void do_test_correct_point_detector_position(
+      const std::string &detectorFindProperty = "",
+      const std::string &stringValue = "") {
     MatrixWorkspace_sptr toConvert = pointDetectorWS;
 
     const double thetaInDegrees = 10.0; // Desired theta in degrees.
@@ -240,8 +241,8 @@ public:
   }
 
   double do_test_correct_line_detector_position(
-      std::vector<int> specNumbers, double thetaInDegrees,
-      std::string detectorName = "lineardetector",
+      const std::vector<int> &specNumbers, double thetaInDegrees,
+      const std::string &detectorName = "lineardetector",
       bool strictSpectrumCheck = true) {
     auto toConvert = this->linearDetectorWS;
 
@@ -258,7 +259,7 @@ public:
 
     VerticalHorizontalOffsetType offsetTupleCorrected =
         determine_vertical_and_horizontal_offsets(
-            corrected, detectorName); // Positions after correction
+            corrected, std::move(detectorName)); // Positions after correction
     const double sampleToDetectorVerticalOffsetCorrected =
         offsetTupleCorrected.get<0>();
 
diff --git a/Framework/Algorithms/test/Stitch1DManyTest.h b/Framework/Algorithms/test/Stitch1DManyTest.h
index 5b0252dabdc..bacff25f116 100644
--- a/Framework/Algorithms/test/Stitch1DManyTest.h
+++ b/Framework/Algorithms/test/Stitch1DManyTest.h
@@ -45,7 +45,7 @@ private:
    * @param outWSName :: output workspace name used if running CreateWorkspace
    */
   void createUniformWorkspace(double xstart, double deltax, double value1,
-                              double value2, std::string outWSName,
+                              double value2, const std::string &outWSName,
                               bool runAlg = false) {
 
     const int nbins = 10;
@@ -108,7 +108,8 @@ private:
    * @param inputWSNames :: input workspaces names
    * @param outputWSName :: output workspace name
    */
-  void doGroupWorkspaces(std::string inputWSNames, std::string outWSName) {
+  void doGroupWorkspaces(const std::string &inputWSNames,
+                         const std::string &outWSName) {
     GroupWorkspaces gw;
     gw.initialize();
     gw.setProperty("InputWorkspaces", inputWSNames);
@@ -123,7 +124,7 @@ private:
    * @param inputWS :: the input workspace
    * @return vector of names of algorithm histories
    */
-  std::vector<std::string> getHistory(MatrixWorkspace_sptr inputWS) {
+  std::vector<std::string> getHistory(const MatrixWorkspace_sptr &inputWS) {
     std::vector<std::string> histNames;
     auto histories = inputWS->history().getAlgorithmHistories();
     for (auto &hist : histories) {
diff --git a/Framework/Algorithms/test/SumOverlappingTubesTest.h b/Framework/Algorithms/test/SumOverlappingTubesTest.h
index f64ce4b7562..191555ab6fa 100644
--- a/Framework/Algorithms/test/SumOverlappingTubesTest.h
+++ b/Framework/Algorithms/test/SumOverlappingTubesTest.h
@@ -34,8 +34,8 @@ using namespace Mantid::Types::Core;
 
 namespace {
 MatrixWorkspace_sptr createTestScanningWS(size_t nTubes, size_t nPixelsPerTube,
-                                          std::vector<double> rotations,
-                                          std::string name = "testWS") {
+                                          const std::vector<double> &rotations,
+                                          const std::string &name = "testWS") {
   const auto instrument = ComponentCreationHelper::createInstrumentWithPSDTubes(
       nTubes, nPixelsPerTube, true);
   size_t nTimeIndexes = rotations.size();
@@ -131,7 +131,7 @@ public:
       TS_ASSERT_DELTA(yAxis->getValue(i), 0.003 * double(i), 1e-6)
   }
 
-  void verifySpectraHaveSameCounts(MatrixWorkspace_sptr outWS,
+  void verifySpectraHaveSameCounts(const MatrixWorkspace_sptr &outWS,
                                    double expectedCounts = 2.0,
                                    double expectedErrors = sqrt(2.0),
                                    bool checkErrors = true) {
@@ -143,7 +143,7 @@ public:
       }
   }
 
-  void verifySpectraCountsForScan(MatrixWorkspace_sptr outWS) {
+  void verifySpectraCountsForScan(const MatrixWorkspace_sptr &outWS) {
     size_t bin = 0;
     for (size_t j = 0; j < N_PIXELS_PER_TUBE; ++j) {
       TS_ASSERT_DELTA(outWS->getSpectrum(j).y()[bin], 2.0, 1e-6)
diff --git a/Framework/Algorithms/test/SumSpectraTest.h b/Framework/Algorithms/test/SumSpectraTest.h
index 1e8066de1e9..ebbbb6cffb6 100644
--- a/Framework/Algorithms/test/SumSpectraTest.h
+++ b/Framework/Algorithms/test/SumSpectraTest.h
@@ -277,8 +277,8 @@ public:
                      const std::runtime_error &);
   }
 
-  void dotestExecEvent(std::string inName, std::string outName,
-                       std::string indices_list) {
+  void dotestExecEvent(const std::string &inName, const std::string &outName,
+                       const std::string &indices_list) {
     int numPixels = 100;
     int numBins = 20;
     int numEvents = 20;
diff --git a/Framework/Algorithms/test/TOFSANSResolutionByPixelTest.h b/Framework/Algorithms/test/TOFSANSResolutionByPixelTest.h
index 5c5c039c30c..38dee468156 100644
--- a/Framework/Algorithms/test/TOFSANSResolutionByPixelTest.h
+++ b/Framework/Algorithms/test/TOFSANSResolutionByPixelTest.h
@@ -22,6 +22,7 @@
 
 #include "boost/shared_ptr.hpp"
 #include <stdexcept>
+#include <utility>
 
 using namespace Mantid::Algorithms;
 using Mantid::Kernel::V3D;
@@ -82,8 +83,8 @@ createTestInstrument(const Mantid::detid_t id,
  * Set the instrument parameters
  */
 void setInstrumentParametersForTOFSANS(
-    const Mantid::API::MatrixWorkspace_sptr ws, std::string methodType = "",
-    double collimationLengthCorrection = 20,
+    const Mantid::API::MatrixWorkspace_sptr &ws,
+    const std::string &methodType = "", double collimationLengthCorrection = 20,
     double collimationLengthIncrement = 2, double guideCutoff = 130,
     double numberOfGuides = 5) {
   auto &pmap = ws->instrumentParameters();
@@ -117,8 +118,8 @@ void setInstrumentParametersForTOFSANS(
 /*
  * Add a timer series sample log
  */
-void addSampleLog(Mantid::API::MatrixWorkspace_sptr workspace,
-                  std::string sampleLogName, double value,
+void addSampleLog(const Mantid::API::MatrixWorkspace_sptr &workspace,
+                  const std::string &sampleLogName, double value,
                   unsigned int length) {
   auto timeSeries =
       new Mantid::Kernel::TimeSeriesProperty<double>(sampleLogName);
@@ -135,7 +136,7 @@ void addSampleLog(Mantid::API::MatrixWorkspace_sptr workspace,
  */
 Mantid::API::MatrixWorkspace_sptr createTestWorkspace(
     const size_t nhist, const double x0, const double x1, const double dx,
-    std::string methodType = "", bool isModerator = false,
+    const std::string &methodType = "", bool isModerator = false,
     double collimationLengthCorrection = 20,
     double collimationLengthIncrement = 2, double guideCutoff = 130,
     double numberOfGuides = 5, V3D sourcePosition = V3D(0.0, 0.0, -25.0),
@@ -163,8 +164,8 @@ Mantid::API::MatrixWorkspace_sptr createTestWorkspace(
 
   // Set the instrument parameters
   setInstrumentParametersForTOFSANS(
-      ws2d, methodType, collimationLengthCorrection, collimationLengthIncrement,
-      guideCutoff, numberOfGuides);
+      ws2d, std::move(methodType), collimationLengthCorrection,
+      collimationLengthIncrement, guideCutoff, numberOfGuides);
 
   // Add sample log details
   if (!guideLogDetails.empty()) {
diff --git a/Framework/Algorithms/test/UnwrapMonitorTest.h b/Framework/Algorithms/test/UnwrapMonitorTest.h
index 009a150a6b0..dd1193aae0d 100644
--- a/Framework/Algorithms/test/UnwrapMonitorTest.h
+++ b/Framework/Algorithms/test/UnwrapMonitorTest.h
@@ -175,7 +175,7 @@ private:
 
   // Run the algorithm and do some basic checks. Returns the output workspace.
   MatrixWorkspace_const_sptr
-  runAlgorithm(UnwrapMonitor &algo, const MatrixWorkspace_const_sptr inWS) {
+  runAlgorithm(UnwrapMonitor &algo, const MatrixWorkspace_const_sptr &inWS) {
     // run the algorithm
     TS_ASSERT(algo.execute());
     TS_ASSERT(algo.isExecuted());
diff --git a/Framework/Algorithms/test/UnwrapSNSTest.h b/Framework/Algorithms/test/UnwrapSNSTest.h
index 9afb0ca1ecf..15838fe963c 100644
--- a/Framework/Algorithms/test/UnwrapSNSTest.h
+++ b/Framework/Algorithms/test/UnwrapSNSTest.h
@@ -29,7 +29,7 @@ private:
   int NUMPIXELS;
   int NUMBINS;
 
-  void makeFakeEventWorkspace(std::string wsName) {
+  void makeFakeEventWorkspace(const std::string &wsName) {
     // Make an event workspace with 2 events in each bin.
     EventWorkspace_sptr test_in = WorkspaceCreationHelper::createEventWorkspace(
         NUMPIXELS, NUMBINS, NUMBINS, 0.0, BIN_DELTA, 2);
diff --git a/Framework/Algorithms/test/VesuvioL1ThetaResolutionTest.h b/Framework/Algorithms/test/VesuvioL1ThetaResolutionTest.h
index f0c1650de4a..df7d1c9d903 100644
--- a/Framework/Algorithms/test/VesuvioL1ThetaResolutionTest.h
+++ b/Framework/Algorithms/test/VesuvioL1ThetaResolutionTest.h
@@ -159,7 +159,7 @@ public:
   }
 
 private:
-  void validateFullResolutionWorkspace(MatrixWorkspace_sptr ws) {
+  void validateFullResolutionWorkspace(const MatrixWorkspace_sptr &ws) {
     NumericAxis *xAxis = dynamic_cast<NumericAxis *>(ws->getAxis(0));
     TS_ASSERT(xAxis);
     if (xAxis) {
@@ -177,7 +177,7 @@ private:
     }
   }
 
-  void validateFullDistributionWorkspace(MatrixWorkspace_sptr ws,
+  void validateFullDistributionWorkspace(const MatrixWorkspace_sptr &ws,
                                          const std::string &label) {
     NumericAxis *xAxis = dynamic_cast<NumericAxis *>(ws->getAxis(0));
     TS_ASSERT(xAxis);
diff --git a/Framework/Algorithms/test/WienerSmoothTest.h b/Framework/Algorithms/test/WienerSmoothTest.h
index ceea1b67bf7..621d07e59b0 100644
--- a/Framework/Algorithms/test/WienerSmoothTest.h
+++ b/Framework/Algorithms/test/WienerSmoothTest.h
@@ -580,7 +580,7 @@ private:
     }
   }
 
-  MatrixWorkspace_sptr runWienerSmooth(MatrixWorkspace_sptr inputWS,
+  MatrixWorkspace_sptr runWienerSmooth(const MatrixWorkspace_sptr &inputWS,
                                        const std::vector<int> &wsIndexList) {
     // Name of the output workspace.
     std::string outWSName("WienerSmoothTest_OutputWS");
diff --git a/Framework/Algorithms/test/WorkspaceGroupTest.h b/Framework/Algorithms/test/WorkspaceGroupTest.h
index 6842062876a..f37adda4f3e 100644
--- a/Framework/Algorithms/test/WorkspaceGroupTest.h
+++ b/Framework/Algorithms/test/WorkspaceGroupTest.h
@@ -19,6 +19,7 @@
 
 #include <Poco/File.h>
 #include <fstream>
+#include <utility>
 
 using namespace Mantid::API;
 using namespace Mantid::Kernel;
@@ -30,15 +31,18 @@ using Mantid::HistogramData::CountStandardDeviations;
 
 class WorkspaceGroupTest : public CxxTest::TestSuite {
 private:
-  void checkData(MatrixWorkspace_sptr work_in1, MatrixWorkspace_sptr work_in2,
-                 MatrixWorkspace_sptr work_out1) {
+  void checkData(const MatrixWorkspace_sptr &work_in1,
+                 const MatrixWorkspace_sptr &work_in2,
+                 const MatrixWorkspace_sptr &work_out1) {
     // default to a horizontal loop orientation
-    checkData(work_in1, work_in2, work_out1, 0);
+    checkData(std::move(work_in1), std::move(work_in2), std::move(work_out1),
+              0);
   }
 
   // loopOrientation 0=Horizontal, 1=Vertical
-  void checkData(MatrixWorkspace_sptr work_in1, MatrixWorkspace_sptr work_in2,
-                 MatrixWorkspace_sptr work_out1, int loopOrientation) {
+  void checkData(const MatrixWorkspace_sptr &work_in1,
+                 const MatrixWorkspace_sptr &work_in2,
+                 const MatrixWorkspace_sptr &work_out1, int loopOrientation) {
     if (!work_in1 || !work_in2 || !work_out1) {
       TSM_ASSERT("One or more empty workspace pointers.", 0);
       return;
@@ -63,9 +67,9 @@ private:
     }
   }
 
-  void checkDataItem(MatrixWorkspace_sptr work_in1,
-                     MatrixWorkspace_sptr work_in2,
-                     MatrixWorkspace_sptr work_out1, size_t i,
+  void checkDataItem(const MatrixWorkspace_sptr &work_in1,
+                     const MatrixWorkspace_sptr &work_in2,
+                     const MatrixWorkspace_sptr &work_out1, size_t i,
                      size_t ws2Index) {
     double sig1 =
         work_in1->dataY(i / work_in1->blocksize())[i % work_in1->blocksize()];
diff --git a/Framework/Crystal/inc/MantidCrystal/AnvredCorrection.h b/Framework/Crystal/inc/MantidCrystal/AnvredCorrection.h
index c886831e0ab..a2bf815d0dd 100644
--- a/Framework/Crystal/inc/MantidCrystal/AnvredCorrection.h
+++ b/Framework/Crystal/inc/MantidCrystal/AnvredCorrection.h
@@ -112,11 +112,11 @@ private:
   void BuildLamdaWeights();
   double absor_sphere(double &twoth, double &wl);
   void scale_init(const Geometry::IDetector &det,
-                  Geometry::Instrument_const_sptr inst, double &L2,
+                  const Geometry::Instrument_const_sptr &inst, double &L2,
                   double &depth, double &pathlength, std::string &bankName);
   void scale_exec(std::string &bankName, double &lambda, double &depth,
-                  Geometry::Instrument_const_sptr inst, double &pathlength,
-                  double &value);
+                  const Geometry::Instrument_const_sptr &inst,
+                  double &pathlength, double &value);
 
   double m_smu;                       ///< linear scattering coefficient in 1/cm
   double m_amu;                       ///< linear absoprtion coefficient in 1/cm
diff --git a/Framework/Crystal/inc/MantidCrystal/CentroidPeaks.h b/Framework/Crystal/inc/MantidCrystal/CentroidPeaks.h
index 8aef4a4dbb9..87438879009 100644
--- a/Framework/Crystal/inc/MantidCrystal/CentroidPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/CentroidPeaks.h
@@ -45,7 +45,7 @@ private:
   void exec() override;
   void integrate();
   void integrateEvent();
-  int findPixelID(std::string bankName, int col, int row);
+  int findPixelID(const std::string &bankName, int col, int row);
   void removeEdgePeaks(Mantid::DataObjects::PeaksWorkspace &peakWS);
   void sizeBanks(const std::string &bankName, int &nCols, int &nRows);
   Geometry::Instrument_const_sptr inst;
diff --git a/Framework/Crystal/inc/MantidCrystal/ConnectedComponentLabeling.h b/Framework/Crystal/inc/MantidCrystal/ConnectedComponentLabeling.h
index 4a8becae3d7..f1eca3a25e3 100644
--- a/Framework/Crystal/inc/MantidCrystal/ConnectedComponentLabeling.h
+++ b/Framework/Crystal/inc/MantidCrystal/ConnectedComponentLabeling.h
@@ -49,8 +49,9 @@ class MANTID_CRYSTAL_DLL ConnectedComponentLabeling {
 
 public:
   /// Constructor
-  ConnectedComponentLabeling(const size_t &startId = 1,
-                             const boost::optional<int> nThreads = boost::none);
+  ConnectedComponentLabeling(
+      const size_t &startId = 1,
+      const boost::optional<int> &nThreads = boost::none);
 
   /// Getter for the start label id
   size_t getStartLabelId() const;
@@ -79,7 +80,7 @@ private:
 
   /// Calculate the disjoint element tree across the image.
   ConnectedComponentMappingTypes::ClusterMap
-  calculateDisjointTree(Mantid::API::IMDHistoWorkspace_sptr ws,
+  calculateDisjointTree(const Mantid::API::IMDHistoWorkspace_sptr &ws,
                         BackgroundStrategy *const baseStrategy,
                         Mantid::API::Progress &progress) const;
 
diff --git a/Framework/Crystal/inc/MantidCrystal/FindSXPeaks.h b/Framework/Crystal/inc/MantidCrystal/FindSXPeaks.h
index 632130b4b92..9fe6c3a4ba0 100644
--- a/Framework/Crystal/inc/MantidCrystal/FindSXPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/FindSXPeaks.h
@@ -96,7 +96,7 @@ private:
 
   /// Check what x units this workspace has
   FindSXPeaksHelper::XAxisUnit getWorkspaceXAxisUnit(
-      Mantid::API::MatrixWorkspace_const_sptr workspace) const;
+      const Mantid::API::MatrixWorkspace_const_sptr &workspace) const;
 
   /// The value in X to start the search from
   double m_MinRange;
diff --git a/Framework/Crystal/inc/MantidCrystal/IntegratePeakTimeSlices.h b/Framework/Crystal/inc/MantidCrystal/IntegratePeakTimeSlices.h
index 59da17f824f..4d12afaf429 100644
--- a/Framework/Crystal/inc/MantidCrystal/IntegratePeakTimeSlices.h
+++ b/Framework/Crystal/inc/MantidCrystal/IntegratePeakTimeSlices.h
@@ -271,14 +271,14 @@ private:
 
   void SetUpData(API::MatrixWorkspace_sptr &Data,
                  API::MatrixWorkspace_const_sptr const &inpWkSpace,
-                 boost::shared_ptr<Geometry::IComponent> comp,
+                 const boost::shared_ptr<Geometry::IComponent> &comp,
                  const int chanMin, const int chanMax, double CentX,
                  double CentY, Kernel::V3D &CentNghbr,
 
                  double &neighborRadius, // from CentDet
                  double Radius, std::string &spec_idList);
 
-  bool getNeighborPixIDs(boost::shared_ptr<Geometry::IComponent> comp,
+  bool getNeighborPixIDs(const boost::shared_ptr<Geometry::IComponent> &comp,
                          Kernel::V3D &Center, double &Radius, int *&ArryofID);
 
   int CalculateTimeChannelSpan(Geometry::IPeak const &peak, const double dQ,
diff --git a/Framework/Crystal/inc/MantidCrystal/LoadIsawPeaks.h b/Framework/Crystal/inc/MantidCrystal/LoadIsawPeaks.h
index c76fdde2394..a98c1ce1e65 100644
--- a/Framework/Crystal/inc/MantidCrystal/LoadIsawPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/LoadIsawPeaks.h
@@ -61,16 +61,16 @@ private:
   void exec() override;
 
   /// Reads first line of peaks file and returns first word of next line
-  std::string readHeader(Mantid::DataObjects::PeaksWorkspace_sptr outWS,
+  std::string readHeader(const Mantid::DataObjects::PeaksWorkspace_sptr &outWS,
                          std::ifstream &in, double &T0);
 
   /// Read a single peak from peaks file
-  DataObjects::Peak readPeak(DataObjects::PeaksWorkspace_sptr outWS,
+  DataObjects::Peak readPeak(const DataObjects::PeaksWorkspace_sptr &outWS,
                              std::string &lastStr, std::ifstream &in,
                              int &seqNum, std::string bankName, double qSign);
 
-  int findPixelID(Geometry::Instrument_const_sptr inst, std::string bankName,
-                  int col, int row);
+  int findPixelID(const Geometry::Instrument_const_sptr &inst,
+                  const std::string &bankName, int col, int row);
 
   /// Read the header of a peak block section, returns first word of next line
   std::string readPeakBlockHeader(std::string lastStr, std::ifstream &in,
@@ -78,20 +78,20 @@ private:
                                   double &phi, double &omega, double &monCount);
 
   /// Append peaks from given file to given workspace
-  void appendFile(Mantid::DataObjects::PeaksWorkspace_sptr outWS,
-                  std::string filename);
+  void appendFile(const Mantid::DataObjects::PeaksWorkspace_sptr &outWS,
+                  const std::string &filename);
 
   /// Compare number of peaks in given file to given workspace
   /// Throws std::length_error on mismatch
-  void checkNumberPeaks(Mantid::DataObjects::PeaksWorkspace_sptr outWS,
-                        std::string filename);
+  void checkNumberPeaks(const Mantid::DataObjects::PeaksWorkspace_sptr &outWS,
+                        const std::string &filename);
 
   /// Local cache of bank IComponents used in file
   std::map<std::string, boost::shared_ptr<const Geometry::IComponent>> m_banks;
 
   /// Retrieve cached bank (or load and cache for next time)
   boost::shared_ptr<const Geometry::IComponent> getCachedBankByName(
-      std::string bankname,
+      const std::string &bankname,
       const boost::shared_ptr<const Geometry::Instrument> &inst);
 };
 
diff --git a/Framework/Crystal/inc/MantidCrystal/MaskPeaksWorkspace.h b/Framework/Crystal/inc/MantidCrystal/MaskPeaksWorkspace.h
index 5528d979322..74a48aa5d57 100644
--- a/Framework/Crystal/inc/MantidCrystal/MaskPeaksWorkspace.h
+++ b/Framework/Crystal/inc/MantidCrystal/MaskPeaksWorkspace.h
@@ -48,11 +48,11 @@ private:
   void init() override;
   void exec() override;
   std::size_t getWkspIndex(const detid2index_map &pixel_to_wi,
-                           Geometry::IComponent_const_sptr comp, const int x,
-                           const int y);
+                           const Geometry::IComponent_const_sptr &comp,
+                           const int x, const int y);
   void getTofRange(double &tofMin, double &tofMax, const double tofPeak,
                    const HistogramData::HistogramX &tof);
-  int findPixelID(std::string bankName, int col, int row);
+  int findPixelID(const std::string &bankName, int col, int row);
 
   /// Read in all the input parameters
   void retrieveProperties();
diff --git a/Framework/Crystal/inc/MantidCrystal/PeakHKLErrors.h b/Framework/Crystal/inc/MantidCrystal/PeakHKLErrors.h
index 04a1acf4381..2bdf5f3d662 100644
--- a/Framework/Crystal/inc/MantidCrystal/PeakHKLErrors.h
+++ b/Framework/Crystal/inc/MantidCrystal/PeakHKLErrors.h
@@ -67,13 +67,15 @@ public:
    * @return The new peak with the new instrument( adjusted with the
    *parameters) and time adjusted.
    */
-  static DataObjects::Peak createNewPeak(const Geometry::IPeak &peak_old,
-                                         Geometry::Instrument_sptr instrNew,
-                                         double T0, double L0);
+  static DataObjects::Peak
+  createNewPeak(const Geometry::IPeak &peak_old,
+                const Geometry::Instrument_sptr &instrNew, double T0,
+                double L0);
 
-  static void cLone(boost::shared_ptr<Geometry::ParameterMap> &pmap,
-                    boost::shared_ptr<const Geometry::IComponent> component,
-                    boost::shared_ptr<const Geometry::ParameterMap> &pmapSv);
+  static void
+  cLone(boost::shared_ptr<Geometry::ParameterMap> &pmap,
+        const boost::shared_ptr<const Geometry::IComponent> &component,
+        boost::shared_ptr<const Geometry::ParameterMap> &pmapSv);
 
   void getRun2MatMap(DataObjects::PeaksWorkspace_sptr &Peaks,
                      const std::string &OptRuns,
@@ -87,7 +89,7 @@ public:
                                                            char axis);
 
   boost::shared_ptr<Geometry::Instrument>
-  getNewInstrument(DataObjects::PeaksWorkspace_sptr Peaks) const;
+  getNewInstrument(const DataObjects::PeaksWorkspace_sptr &Peaks) const;
 
   std::vector<std::string> getAttributeNames() const override {
     return {"OptRuns", "PeakWorkspaceName"};
diff --git a/Framework/Crystal/inc/MantidCrystal/PeakIntegration.h b/Framework/Crystal/inc/MantidCrystal/PeakIntegration.h
index 23a6d3a115a..23df95e6d24 100644
--- a/Framework/Crystal/inc/MantidCrystal/PeakIntegration.h
+++ b/Framework/Crystal/inc/MantidCrystal/PeakIntegration.h
@@ -48,8 +48,9 @@ private:
   void fitSpectra(const int s, double TOFPeakd, double &I, double &sigI);
   /// Read in all the input parameters
   void retrieveProperties();
-  int fitneighbours(int ipeak, std::string det_name, int x0, int y0, int idet,
-                    double qspan, DataObjects::PeaksWorkspace_sptr &Peaks,
+  int fitneighbours(int ipeak, const std::string &det_name, int x0, int y0,
+                    int idet, double qspan,
+                    DataObjects::PeaksWorkspace_sptr &Peaks,
                     const detid2index_map &pixel_to_wi);
 
   bool m_IC = false; ///< Ikeida Carpenter fit of TOF
diff --git a/Framework/Crystal/inc/MantidCrystal/SCDCalibratePanels.h b/Framework/Crystal/inc/MantidCrystal/SCDCalibratePanels.h
index f9d21ad88a2..b02fd282c71 100644
--- a/Framework/Crystal/inc/MantidCrystal/SCDCalibratePanels.h
+++ b/Framework/Crystal/inc/MantidCrystal/SCDCalibratePanels.h
@@ -48,19 +48,20 @@ public:
 private:
   void saveIsawDetCal(boost::shared_ptr<Geometry::Instrument> &instrument,
                       boost::container::flat_set<std::string> &AllBankName,
-                      double T0, std::string filename);
+                      double T0, const std::string &filename);
 
   /// Function to calculate U
-  void findU(DataObjects::PeaksWorkspace_sptr peaksWs);
+  void findU(const DataObjects::PeaksWorkspace_sptr &peaksWs);
   /// save workspaces
-  void saveNexus(std::string outputFile, API::MatrixWorkspace_sptr outputWS);
+  void saveNexus(const std::string &outputFile,
+                 const API::MatrixWorkspace_sptr &outputWS);
   /// Function to optimize L1
-  void findL1(int nPeaks, DataObjects::PeaksWorkspace_sptr peaksWs);
+  void findL1(int nPeaks, const DataObjects::PeaksWorkspace_sptr &peaksWs);
   /// Function to optimize L2
   void findL2(boost::container::flat_set<std::string> MyBankNames,
-              DataObjects::PeaksWorkspace_sptr peaksWs);
+              const DataObjects::PeaksWorkspace_sptr &peaksWs);
   /// Function to optimize T0
-  void findT0(int nPeaks, DataObjects::PeaksWorkspace_sptr peaksWs);
+  void findT0(int nPeaks, const DataObjects::PeaksWorkspace_sptr &peaksWs);
 
   void exec() override;
 
diff --git a/Framework/Crystal/inc/MantidCrystal/SCDPanelErrors.h b/Framework/Crystal/inc/MantidCrystal/SCDPanelErrors.h
index cba356c8588..2419d33d087 100644
--- a/Framework/Crystal/inc/MantidCrystal/SCDPanelErrors.h
+++ b/Framework/Crystal/inc/MantidCrystal/SCDPanelErrors.h
@@ -44,7 +44,8 @@ public:
   /// Move detectors with parameters
   void moveDetector(double x, double y, double z, double rotx, double roty,
                     double rotz, double scalex, double scaley,
-                    std::string detname, API::Workspace_sptr inputW) const;
+                    std::string detname,
+                    const API::Workspace_sptr &inputW) const;
 
 private:
   /// Call the appropriate load function
diff --git a/Framework/Crystal/inc/MantidCrystal/SaveHKL.h b/Framework/Crystal/inc/MantidCrystal/SaveHKL.h
index 411eeeda179..cd708f0c4e0 100644
--- a/Framework/Crystal/inc/MantidCrystal/SaveHKL.h
+++ b/Framework/Crystal/inc/MantidCrystal/SaveHKL.h
@@ -49,7 +49,7 @@ private:
   double spectrumCalc(double TOF, int iSpec,
                       std::vector<std::vector<double>> time,
                       std::vector<std::vector<double>> spectra, size_t id);
-  void sizeBanks(std::string bankName, int &nCols, int &nRows);
+  void sizeBanks(const std::string &bankName, int &nCols, int &nRows);
 
   DataObjects::PeaksWorkspace_sptr m_ws;
   double m_smu = 0.0; // in 1/cm
diff --git a/Framework/Crystal/inc/MantidCrystal/SaveIsawPeaks.h b/Framework/Crystal/inc/MantidCrystal/SaveIsawPeaks.h
index d3c853b43cd..9e0bad59d5d 100644
--- a/Framework/Crystal/inc/MantidCrystal/SaveIsawPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/SaveIsawPeaks.h
@@ -48,10 +48,10 @@ private:
   /// Run the algorithm
   void exec() override;
   /// find position for rectangular and non-rectangular
-  Kernel::V3D findPixelPos(std::string bankName, int col, int row);
-  void sizeBanks(std::string bankName, int &NCOLS, int &NROWS, double &xsize,
-                 double &ysize);
-  bool bankMasked(Geometry::IComponent_const_sptr parent,
+  Kernel::V3D findPixelPos(const std::string &bankName, int col, int row);
+  void sizeBanks(const std::string &bankName, int &NCOLS, int &NROWS,
+                 double &xsize, double &ysize);
+  bool bankMasked(const Geometry::IComponent_const_sptr &parent,
                   const Geometry::DetectorInfo &detectorInfo);
   void writeOffsets(std::ofstream &out, double qSign,
                     std::vector<double> offset);
diff --git a/Framework/Crystal/inc/MantidCrystal/SaveLauenorm.h b/Framework/Crystal/inc/MantidCrystal/SaveLauenorm.h
index 9d2885ae95f..b84323bcaa1 100644
--- a/Framework/Crystal/inc/MantidCrystal/SaveLauenorm.h
+++ b/Framework/Crystal/inc/MantidCrystal/SaveLauenorm.h
@@ -44,7 +44,7 @@ private:
   void exec() override;
 
   DataObjects::PeaksWorkspace_sptr ws;
-  void sizeBanks(std::string bankName, int &nCols, int &nRows);
+  void sizeBanks(const std::string &bankName, int &nCols, int &nRows);
 
   const std::vector<std::string> m_typeList{
       "TRICLINIC", "MONOCLINIC",   "ORTHORHOMBIC", "TETRAGONAL",
diff --git a/Framework/Crystal/inc/MantidCrystal/SetSpecialCoordinates.h b/Framework/Crystal/inc/MantidCrystal/SetSpecialCoordinates.h
index 43799f83cb3..274a92a1757 100644
--- a/Framework/Crystal/inc/MantidCrystal/SetSpecialCoordinates.h
+++ b/Framework/Crystal/inc/MantidCrystal/SetSpecialCoordinates.h
@@ -48,13 +48,13 @@ private:
   static const std::string QSampleOption();
   static const std::string HKLOption();
   bool writeCoordinatesToMDEventWorkspace(
-      Mantid::API::Workspace_sptr inWS,
+      const Mantid::API::Workspace_sptr &inWS,
       Mantid::Kernel::SpecialCoordinateSystem coordinateSystem);
   bool writeCoordinatesToMDHistoWorkspace(
-      Mantid::API::Workspace_sptr inWS,
+      const Mantid::API::Workspace_sptr &inWS,
       Mantid::Kernel::SpecialCoordinateSystem coordinateSystem);
   bool writeCoordinatesToPeaksWorkspace(
-      Mantid::API::Workspace_sptr inWS,
+      const Mantid::API::Workspace_sptr &inWS,
       Mantid::Kernel::SpecialCoordinateSystem coordinateSystem);
 };
 
diff --git a/Framework/Crystal/inc/MantidCrystal/SortHKL.h b/Framework/Crystal/inc/MantidCrystal/SortHKL.h
index 1a60a9a270e..afd51cc4fb2 100644
--- a/Framework/Crystal/inc/MantidCrystal/SortHKL.h
+++ b/Framework/Crystal/inc/MantidCrystal/SortHKL.h
@@ -78,7 +78,8 @@ private:
   DataObjects::PeaksWorkspace_sptr getOutputPeaksWorkspace(
       const DataObjects::PeaksWorkspace_sptr &inputPeaksWorkspace) const;
 
-  void sortOutputPeaksByHKL(API::IPeaksWorkspace_sptr outputPeaksWorkspace);
+  void
+  sortOutputPeaksByHKL(const API::IPeaksWorkspace_sptr &outputPeaksWorkspace);
 
   /// Point Groups possible
   std::vector<Mantid::Geometry::PointGroup_sptr> m_pointGroups;
diff --git a/Framework/Crystal/inc/MantidCrystal/StatisticsOfPeaksWorkspace.h b/Framework/Crystal/inc/MantidCrystal/StatisticsOfPeaksWorkspace.h
index 8d2d3667c09..061d0bd973e 100644
--- a/Framework/Crystal/inc/MantidCrystal/StatisticsOfPeaksWorkspace.h
+++ b/Framework/Crystal/inc/MantidCrystal/StatisticsOfPeaksWorkspace.h
@@ -49,7 +49,8 @@ private:
   /// Run the algorithm
   void exec() override;
   /// Runs SortHKL on workspace
-  void doSortHKL(Mantid::API::Workspace_sptr ws, std::string runName);
+  void doSortHKL(const Mantid::API::Workspace_sptr &ws,
+                 const std::string &runName);
 
   DataObjects::PeaksWorkspace_sptr ws;
 };
diff --git a/Framework/Crystal/src/AnvredCorrection.cpp b/Framework/Crystal/src/AnvredCorrection.cpp
index 6b788c91761..56bfbe9f063 100644
--- a/Framework/Crystal/src/AnvredCorrection.cpp
+++ b/Framework/Crystal/src/AnvredCorrection.cpp
@@ -522,7 +522,7 @@ void AnvredCorrection::BuildLamdaWeights() {
 }
 
 void AnvredCorrection::scale_init(const IDetector &det,
-                                  Instrument_const_sptr inst, double &L2,
+                                  const Instrument_const_sptr &inst, double &L2,
                                   double &depth, double &pathlength,
                                   std::string &bankName) {
   bankName = det.getParent()->getParent()->getName();
@@ -542,7 +542,8 @@ void AnvredCorrection::scale_init(const IDetector &det,
 }
 
 void AnvredCorrection::scale_exec(std::string &bankName, double &lambda,
-                                  double &depth, Instrument_const_sptr inst,
+                                  double &depth,
+                                  const Instrument_const_sptr &inst,
                                   double &pathlength, double &value) {
   // correct for the slant path throught the scintillator glass
   double mu = (9.614 * lambda) + 0.266; // mu for GS20 glass
diff --git a/Framework/Crystal/src/CentroidPeaks.cpp b/Framework/Crystal/src/CentroidPeaks.cpp
index 29c1b15f547..a6dad7263f3 100644
--- a/Framework/Crystal/src/CentroidPeaks.cpp
+++ b/Framework/Crystal/src/CentroidPeaks.cpp
@@ -323,7 +323,7 @@ void CentroidPeaks::exec() {
   }
 }
 
-int CentroidPeaks::findPixelID(std::string bankName, int col, int row) {
+int CentroidPeaks::findPixelID(const std::string &bankName, int col, int row) {
   boost::shared_ptr<const IComponent> parent =
       inst->getComponentByName(bankName);
   if (parent->type() == "RectangularDetector") {
diff --git a/Framework/Crystal/src/ConnectedComponentLabeling.cpp b/Framework/Crystal/src/ConnectedComponentLabeling.cpp
index 46894fbf7fc..04ed2e230a7 100644
--- a/Framework/Crystal/src/ConnectedComponentLabeling.cpp
+++ b/Framework/Crystal/src/ConnectedComponentLabeling.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidCrystal/ConnectedComponentLabeling.h"
 
 #include "MantidAPI/FrameworkManager.h"
@@ -226,7 +228,7 @@ void memoryCheck(size_t nPoints) {
  * @param nThreads : Optional argument of number of threads to use.
  */
 ConnectedComponentLabeling::ConnectedComponentLabeling(
-    const size_t &startId, const boost::optional<int> nThreads)
+    const size_t &startId, const boost::optional<int> &nThreads)
     : m_startId(startId), m_nThreads(nThreads) {
   if (m_nThreads.is_initialized() && m_nThreads.get() < 0) {
     throw std::invalid_argument(
@@ -278,7 +280,7 @@ int ConnectedComponentLabeling::getNThreads() const {
  * @return : Map of label ids to clusters.
  */
 ClusterMap ConnectedComponentLabeling::calculateDisjointTree(
-    IMDHistoWorkspace_sptr ws, BackgroundStrategy *const baseStrategy,
+    const IMDHistoWorkspace_sptr &ws, BackgroundStrategy *const baseStrategy,
     Progress &progress) const {
   std::map<size_t, boost::shared_ptr<ICluster>> clusterMap;
   VecElements neighbourElements(ws->getNPoints());
@@ -407,7 +409,8 @@ boost::shared_ptr<Mantid::API::IMDHistoWorkspace>
 ConnectedComponentLabeling::execute(IMDHistoWorkspace_sptr ws,
                                     BackgroundStrategy *const strategy,
                                     Progress &progress) const {
-  ClusterTuple result = executeAndFetchClusters(ws, strategy, progress);
+  ClusterTuple result =
+      executeAndFetchClusters(std::move(ws), strategy, progress);
   IMDHistoWorkspace_sptr outWS =
       result.get<0>(); // Get the workspace, but discard cluster objects.
   return outWS;
diff --git a/Framework/Crystal/src/FindClusterFaces.cpp b/Framework/Crystal/src/FindClusterFaces.cpp
index 9ee0817ae63..97fddf346f6 100644
--- a/Framework/Crystal/src/FindClusterFaces.cpp
+++ b/Framework/Crystal/src/FindClusterFaces.cpp
@@ -43,7 +43,7 @@ using OptionalLabelPeakIndexMap = boost::optional<LabelMap>;
  */
 OptionalLabelPeakIndexMap
 createOptionalLabelFilter(size_t dimensionality, int emptyLabelId,
-                          IPeaksWorkspace_sptr filterWorkspace,
+                          const IPeaksWorkspace_sptr &filterWorkspace,
                           IMDHistoWorkspace_sptr &clusterImage) {
   OptionalLabelPeakIndexMap optionalAllowedLabels;
 
diff --git a/Framework/Crystal/src/FindSXPeaks.cpp b/Framework/Crystal/src/FindSXPeaks.cpp
index 301be49ce74..c478ebbd9d5 100644
--- a/Framework/Crystal/src/FindSXPeaks.cpp
+++ b/Framework/Crystal/src/FindSXPeaks.cpp
@@ -369,8 +369,8 @@ void FindSXPeaks::reducePeakList(const peakvector &pcv, Progress &progress) {
  * @param workspace :: the workspace to check x-axis units on
  * @return enum of type XAxisUnit with the value of TOF or DSPACING
  */
-XAxisUnit
-FindSXPeaks::getWorkspaceXAxisUnit(MatrixWorkspace_const_sptr workspace) const {
+XAxisUnit FindSXPeaks::getWorkspaceXAxisUnit(
+    const MatrixWorkspace_const_sptr &workspace) const {
   const auto xAxis = workspace->getAxis(0);
   const auto unitID = xAxis->unit()->unitID();
 
diff --git a/Framework/Crystal/src/IntegratePeakTimeSlices.cpp b/Framework/Crystal/src/IntegratePeakTimeSlices.cpp
index a210b733ff1..e9d2bb3c35c 100644
--- a/Framework/Crystal/src/IntegratePeakTimeSlices.cpp
+++ b/Framework/Crystal/src/IntegratePeakTimeSlices.cpp
@@ -26,6 +26,7 @@
 #include "MantidHistogramData/BinEdges.h"
 
 #include <boost/math/special_functions/round.hpp>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -657,7 +658,7 @@ void IntegratePeakTimeSlices::exec() {
  * the center may be included.
  */
 bool IntegratePeakTimeSlices::getNeighborPixIDs(
-    boost::shared_ptr<Geometry::IComponent> comp, Kernel::V3D &Center,
+    const boost::shared_ptr<Geometry::IComponent> &comp, Kernel::V3D &Center,
     double &Radius, int *&ArryofID) {
 
   int N = ArryofID[1];
@@ -1417,7 +1418,7 @@ void DataModeHandler::setHeightHalfWidthInfo(
  */
 void IntegratePeakTimeSlices::SetUpData(
     MatrixWorkspace_sptr &Data, MatrixWorkspace_const_sptr const &inpWkSpace,
-    boost::shared_ptr<Geometry::IComponent> comp, const int chanMin,
+    const boost::shared_ptr<Geometry::IComponent> &comp, const int chanMin,
     const int chanMax, double CentX, double CentY, Kernel::V3D &CentNghbr,
     double &neighborRadius, // from CentDetspec
     double Radius, string &spec_idList) {
@@ -1468,7 +1469,7 @@ void IntegratePeakTimeSlices::SetUpData(
     m_NeighborIDs[1] = 2;
     neighborRadius = NeighborhoodRadiusDivPeakRadius * NewRadius;
     CentNghbr = CentPos;
-    getNeighborPixIDs(comp, CentPos, neighborRadius, m_NeighborIDs);
+    getNeighborPixIDs(std::move(comp), CentPos, neighborRadius, m_NeighborIDs);
 
   } else // big enough neighborhood so
     neighborRadius -= DD;
@@ -2526,7 +2527,8 @@ int IntegratePeakTimeSlices::UpdateOutputWS(
       m_AttributeValues->StatBaseVals(INCol) - 1;
   TabWS->getRef<double>(std::string("TotIntensityError"), TableRow) =
       SQRT(m_AttributeValues->StatBaseVals(IVariance));
-  TabWS->getRef<string>(std::string("SpecIDs"), TableRow) = spec_idList;
+  TabWS->getRef<string>(std::string("SpecIDs"), TableRow) =
+      std::move(spec_idList);
 
   return newRowIndex;
 }
diff --git a/Framework/Crystal/src/LoadIsawPeaks.cpp b/Framework/Crystal/src/LoadIsawPeaks.cpp
index 4efad112094..a5dfeb4278d 100644
--- a/Framework/Crystal/src/LoadIsawPeaks.cpp
+++ b/Framework/Crystal/src/LoadIsawPeaks.cpp
@@ -21,6 +21,7 @@
 #include "MantidKernel/Strings.h"
 #include "MantidKernel/Unit.h"
 #include <boost/algorithm/string/trim.hpp>
+#include <utility>
 
 using Mantid::Kernel::Strings::getWord;
 using Mantid::Kernel::Strings::readToEndOfLine;
@@ -124,7 +125,7 @@ void LoadIsawPeaks::exec() {
  * @param T0 :: Time offset
  * @return the first word on the next line
  */
-std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS,
+std::string LoadIsawPeaks::readHeader(const PeaksWorkspace_sptr &outWS,
                                       std::ifstream &in, double &T0) {
   std::string tag;
   std::string r = getWord(in, false);
@@ -260,7 +261,7 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS,
  * @param qSign :: For inelastic this is 1; for crystallography this is -1
  * @return the Peak the Peak object created
  */
-DataObjects::Peak LoadIsawPeaks::readPeak(PeaksWorkspace_sptr outWS,
+DataObjects::Peak LoadIsawPeaks::readPeak(const PeaksWorkspace_sptr &outWS,
                                           std::string &lastStr,
                                           std::ifstream &in, int &seqNum,
                                           std::string bankName, double qSign) {
@@ -339,8 +340,8 @@ DataObjects::Peak LoadIsawPeaks::readPeak(PeaksWorkspace_sptr outWS,
   if (!inst)
     throw std::runtime_error("No instrument in PeaksWorkspace!");
 
-  int pixelID =
-      findPixelID(inst, bankName, static_cast<int>(col), static_cast<int>(row));
+  int pixelID = findPixelID(inst, std::move(bankName), static_cast<int>(col),
+                            static_cast<int>(row));
 
   // Create the peak object
   Peak peak(outWS->getInstrument(), pixelID, wl);
@@ -356,10 +357,10 @@ DataObjects::Peak LoadIsawPeaks::readPeak(PeaksWorkspace_sptr outWS,
 }
 
 //----------------------------------------------------------------------------------------------
-int LoadIsawPeaks::findPixelID(Instrument_const_sptr inst, std::string bankName,
-                               int col, int row) {
+int LoadIsawPeaks::findPixelID(const Instrument_const_sptr &inst,
+                               const std::string &bankName, int col, int row) {
   boost::shared_ptr<const IComponent> parent =
-      getCachedBankByName(bankName, inst);
+      getCachedBankByName(std::move(bankName), inst);
 
   if (!parent)
     return -1; // peak not in any detector.
@@ -404,7 +405,7 @@ std::string LoadIsawPeaks::readPeakBlockHeader(std::string lastStr,
                                                int &detName, double &chi,
                                                double &phi, double &omega,
                                                double &monCount) {
-  std::string s = lastStr;
+  std::string s = std::move(lastStr);
 
   if (s.length() < 1 && in.good()) // blank line
   {
@@ -445,8 +446,8 @@ std::string LoadIsawPeaks::readPeakBlockHeader(std::string lastStr,
  * @param outWS :: the workspace in which to place the information
  * @param filename :: path to the .peaks file
  */
-void LoadIsawPeaks::appendFile(PeaksWorkspace_sptr outWS,
-                               std::string filename) {
+void LoadIsawPeaks::appendFile(const PeaksWorkspace_sptr &outWS,
+                               const std::string &filename) {
   // HKL's are flipped by -1 because of the internal Q convention
   // unless Crystallography convention
   double qSign = -1.0;
@@ -564,8 +565,8 @@ void LoadIsawPeaks::appendFile(PeaksWorkspace_sptr outWS,
  * @param outWS :: the workspace in which to place the information
  * @param filename :: path to the .peaks file
  */
-void LoadIsawPeaks::checkNumberPeaks(PeaksWorkspace_sptr outWS,
-                                     std::string filename) {
+void LoadIsawPeaks::checkNumberPeaks(const PeaksWorkspace_sptr &outWS,
+                                     const std::string &filename) {
 
   // Open the file
   std::ifstream in(filename.c_str());
@@ -601,7 +602,7 @@ void LoadIsawPeaks::checkNumberPeaks(PeaksWorkspace_sptr outWS,
  *found)
  */
 boost::shared_ptr<const IComponent> LoadIsawPeaks::getCachedBankByName(
-    std::string bankname,
+    const std::string &bankname,
     const boost::shared_ptr<const Geometry::Instrument> &inst) {
   if (m_banks.count(bankname) == 0)
     m_banks[bankname] = inst->getComponentByName(bankname);
diff --git a/Framework/Crystal/src/MaskPeaksWorkspace.cpp b/Framework/Crystal/src/MaskPeaksWorkspace.cpp
index 36bec054374..676c6abeb36 100644
--- a/Framework/Crystal/src/MaskPeaksWorkspace.cpp
+++ b/Framework/Crystal/src/MaskPeaksWorkspace.cpp
@@ -200,9 +200,10 @@ void MaskPeaksWorkspace::retrieveProperties() {
   }
 }
 
-size_t MaskPeaksWorkspace::getWkspIndex(const detid2index_map &pixel_to_wi,
-                                        Geometry::IComponent_const_sptr comp,
-                                        const int x, const int y) {
+size_t
+MaskPeaksWorkspace::getWkspIndex(const detid2index_map &pixel_to_wi,
+                                 const Geometry::IComponent_const_sptr &comp,
+                                 const int x, const int y) {
   Geometry::RectangularDetector_const_sptr det =
       boost::dynamic_pointer_cast<const Geometry::RectangularDetector>(comp);
   if (det) {
@@ -270,7 +271,8 @@ void MaskPeaksWorkspace::getTofRange(double &tofMin, double &tofMax,
     tofMax = tofPeak + m_tofMax;
   }
 }
-int MaskPeaksWorkspace::findPixelID(std::string bankName, int col, int row) {
+int MaskPeaksWorkspace::findPixelID(const std::string &bankName, int col,
+                                    int row) {
   Geometry::Instrument_const_sptr Iptr = m_inputW->getInstrument();
   boost::shared_ptr<const IComponent> parent =
       Iptr->getComponentByName(bankName);
diff --git a/Framework/Crystal/src/PeakBackground.cpp b/Framework/Crystal/src/PeakBackground.cpp
index 7d5ad73b744..e1415c17a77 100644
--- a/Framework/Crystal/src/PeakBackground.cpp
+++ b/Framework/Crystal/src/PeakBackground.cpp
@@ -4,8 +4,10 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidCrystal/PeakBackground.h"
+#include <utility>
+
 #include "MantidAPI/IPeaksWorkspace.h"
+#include "MantidCrystal/PeakBackground.h"
 #include "MantidGeometry/Crystal/IPeak.h"
 
 using namespace Mantid::API;
@@ -24,7 +26,7 @@ PeakBackground::PeakBackground(IPeaksWorkspace_const_sptr peaksWS,
                                const Mantid::API::MDNormalization normalisation,
                                const SpecialCoordinateSystem coordinates)
     : HardThresholdBackground(thresholdSignal, normalisation),
-      m_peaksWS(peaksWS), m_radiusEstimate(radiusEstimate),
+      m_peaksWS(std::move(peaksWS)), m_radiusEstimate(radiusEstimate),
       m_mdCoordinates(coordinates) {
 
   if (m_mdCoordinates == QLab) {
diff --git a/Framework/Crystal/src/PeakHKLErrors.cpp b/Framework/Crystal/src/PeakHKLErrors.cpp
index 2a6807dfdd0..8d4e7eebca1 100644
--- a/Framework/Crystal/src/PeakHKLErrors.cpp
+++ b/Framework/Crystal/src/PeakHKLErrors.cpp
@@ -117,7 +117,7 @@ void PeakHKLErrors::setUpOptRuns() {
  */
 void PeakHKLErrors::cLone(
     boost::shared_ptr<Geometry::ParameterMap> &pmap,
-    boost::shared_ptr<const Geometry::IComponent> component,
+    const boost::shared_ptr<const Geometry::IComponent> &component,
     boost::shared_ptr<const Geometry::ParameterMap> &pmapSv) {
   if (!component)
     return;
@@ -187,7 +187,7 @@ void PeakHKLErrors::cLone(
  * NOTE: All the peaks in the PeaksWorkspace must use the same instrument.
  */
 boost::shared_ptr<Geometry::Instrument>
-PeakHKLErrors::getNewInstrument(PeaksWorkspace_sptr Peaks) const {
+PeakHKLErrors::getNewInstrument(const PeaksWorkspace_sptr &Peaks) const {
   Geometry::Instrument_const_sptr instSave = Peaks->getPeak(0).getInstrument();
   auto pmap = boost::make_shared<Geometry::ParameterMap>();
 
@@ -643,8 +643,8 @@ void PeakHKLErrors::functionDeriv1D(Jacobian *out, const double *xValues,
 }
 
 Peak PeakHKLErrors::createNewPeak(const Geometry::IPeak &peak_old,
-                                  Geometry::Instrument_sptr instrNew, double T0,
-                                  double L0) {
+                                  const Geometry::Instrument_sptr &instrNew,
+                                  double T0, double L0) {
   Geometry::Instrument_const_sptr inst = peak_old.getInstrument();
   if (inst->getComponentID() != instrNew->getComponentID()) {
     g_log.error("All peaks must have the same instrument");
diff --git a/Framework/Crystal/src/PeakIntegration.cpp b/Framework/Crystal/src/PeakIntegration.cpp
index cae56ddc0de..da992cb6dbf 100644
--- a/Framework/Crystal/src/PeakIntegration.cpp
+++ b/Framework/Crystal/src/PeakIntegration.cpp
@@ -301,8 +301,8 @@ void PeakIntegration::retrieveProperties() {
   }
 }
 
-int PeakIntegration::fitneighbours(int ipeak, std::string det_name, int x0,
-                                   int y0, int idet, double qspan,
+int PeakIntegration::fitneighbours(int ipeak, const std::string &det_name,
+                                   int x0, int y0, int idet, double qspan,
                                    PeaksWorkspace_sptr &Peaks,
                                    const detid2index_map &pixel_to_wi) {
   UNUSED_ARG(ipeak);
diff --git a/Framework/Crystal/src/SCDCalibratePanels.cpp b/Framework/Crystal/src/SCDCalibratePanels.cpp
index 7eefa117a69..72bdeb27f5b 100644
--- a/Framework/Crystal/src/SCDCalibratePanels.cpp
+++ b/Framework/Crystal/src/SCDCalibratePanels.cpp
@@ -280,16 +280,16 @@ void SCDCalibratePanels::exec() {
   saveNexus(tofFilename, TofWksp);
 }
 
-void SCDCalibratePanels::saveNexus(std::string outputFile,
-                                   MatrixWorkspace_sptr outputWS) {
+void SCDCalibratePanels::saveNexus(const std::string &outputFile,
+                                   const MatrixWorkspace_sptr &outputWS) {
   IAlgorithm_sptr save = this->createChildAlgorithm("SaveNexus");
   save->setProperty("InputWorkspace", outputWS);
   save->setProperty("FileName", outputFile);
   save->execute();
 }
 
-void SCDCalibratePanels::findL1(int nPeaks,
-                                DataObjects::PeaksWorkspace_sptr peaksWs) {
+void SCDCalibratePanels::findL1(
+    int nPeaks, const DataObjects::PeaksWorkspace_sptr &peaksWs) {
   MatrixWorkspace_sptr L1WS = boost::dynamic_pointer_cast<MatrixWorkspace>(
       API::WorkspaceFactory::Instance().create("Workspace2D", 1, 3 * nPeaks,
                                                3 * nPeaks));
@@ -329,8 +329,8 @@ void SCDCalibratePanels::findL1(int nPeaks,
                  << fitL1Status << " Chi2overDoF " << chisqL1 << "\n";
 }
 
-void SCDCalibratePanels::findT0(int nPeaks,
-                                DataObjects::PeaksWorkspace_sptr peaksWs) {
+void SCDCalibratePanels::findT0(
+    int nPeaks, const DataObjects::PeaksWorkspace_sptr &peaksWs) {
   MatrixWorkspace_sptr T0WS = boost::dynamic_pointer_cast<MatrixWorkspace>(
       API::WorkspaceFactory::Instance().create("Workspace2D", 1, 3 * nPeaks,
                                                3 * nPeaks));
@@ -385,7 +385,8 @@ void SCDCalibratePanels::findT0(int nPeaks,
   }
 }
 
-void SCDCalibratePanels::findU(DataObjects::PeaksWorkspace_sptr peaksWs) {
+void SCDCalibratePanels::findU(
+    const DataObjects::PeaksWorkspace_sptr &peaksWs) {
   IAlgorithm_sptr ub_alg;
   try {
     ub_alg = createChildAlgorithm("CalculateUMatrix", -1, -1, false);
@@ -442,7 +443,7 @@ void SCDCalibratePanels::findU(DataObjects::PeaksWorkspace_sptr peaksWs) {
 void SCDCalibratePanels::saveIsawDetCal(
     boost::shared_ptr<Instrument> &instrument,
     boost::container::flat_set<string> &AllBankName, double T0,
-    string filename) {
+    const string &filename) {
   // having a filename triggers doing the work
   if (filename.empty())
     return;
@@ -633,8 +634,9 @@ void SCDCalibratePanels::saveXmlFile(
   oss3.flush();
   oss3.close();
 }
-void SCDCalibratePanels::findL2(boost::container::flat_set<string> MyBankNames,
-                                DataObjects::PeaksWorkspace_sptr peaksWs) {
+void SCDCalibratePanels::findL2(
+    boost::container::flat_set<string> MyBankNames,
+    const DataObjects::PeaksWorkspace_sptr &peaksWs) {
   bool changeSize = getProperty("ChangePanelSize");
   Geometry::Instrument_const_sptr inst = peaksWs->getInstrument();
 
diff --git a/Framework/Crystal/src/SCDPanelErrors.cpp b/Framework/Crystal/src/SCDPanelErrors.cpp
index 7c53a3b8699..e22beeaeede 100644
--- a/Framework/Crystal/src/SCDPanelErrors.cpp
+++ b/Framework/Crystal/src/SCDPanelErrors.cpp
@@ -23,6 +23,7 @@
 #include <cmath>
 #include <fstream>
 #include <sstream>
+#include <utility>
 
 namespace Mantid {
 namespace Crystal {
@@ -74,7 +75,7 @@ SCDPanelErrors::SCDPanelErrors() : m_setupFinished(false) {
 void SCDPanelErrors::moveDetector(double x, double y, double z, double rotx,
                                   double roty, double rotz, double scalex,
                                   double scaley, std::string detname,
-                                  Workspace_sptr inputW) const {
+                                  const Workspace_sptr &inputW) const {
   if (detname.compare("none") == 0.0)
     return;
   // CORELLI has sixteenpack under bank
@@ -340,7 +341,7 @@ void SCDPanelErrors::loadWorkspace(const std::string &wsName) const {
  * @param ws :: The workspace to load from
  */
 void SCDPanelErrors::loadWorkspace(boost::shared_ptr<API::Workspace> ws) const {
-  m_workspace = ws;
+  m_workspace = std::move(ws);
   m_setupFinished = false;
 }
 
diff --git a/Framework/Crystal/src/SaveHKL.cpp b/Framework/Crystal/src/SaveHKL.cpp
index 03a11e22ca4..c031b73732e 100644
--- a/Framework/Crystal/src/SaveHKL.cpp
+++ b/Framework/Crystal/src/SaveHKL.cpp
@@ -747,7 +747,7 @@ double SaveHKL::spectrumCalc(double TOF, int iSpec,
 
   return spect;
 }
-void SaveHKL::sizeBanks(std::string bankName, int &nCols, int &nRows) {
+void SaveHKL::sizeBanks(const std::string &bankName, int &nCols, int &nRows) {
   if (bankName == "None")
     return;
   boost::shared_ptr<const IComponent> parent =
diff --git a/Framework/Crystal/src/SaveIsawPeaks.cpp b/Framework/Crystal/src/SaveIsawPeaks.cpp
index 83d817599b9..82685646a58 100644
--- a/Framework/Crystal/src/SaveIsawPeaks.cpp
+++ b/Framework/Crystal/src/SaveIsawPeaks.cpp
@@ -460,7 +460,7 @@ void SaveIsawPeaks::exec() {
   out.close();
 }
 
-bool SaveIsawPeaks::bankMasked(IComponent_const_sptr parent,
+bool SaveIsawPeaks::bankMasked(const IComponent_const_sptr &parent,
                                const Geometry::DetectorInfo &detectorInfo) {
   std::vector<Geometry::IComponent_const_sptr> children;
   auto asmb =
@@ -493,7 +493,7 @@ bool SaveIsawPeaks::bankMasked(IComponent_const_sptr parent,
   return true;
 }
 
-V3D SaveIsawPeaks::findPixelPos(std::string bankName, int col, int row) {
+V3D SaveIsawPeaks::findPixelPos(const std::string &bankName, int col, int row) {
   auto parent = inst->getComponentByName(bankName);
   if (parent->type() == "RectangularDetector") {
     const auto RDet =
@@ -523,8 +523,8 @@ V3D SaveIsawPeaks::findPixelPos(std::string bankName, int col, int row) {
     return first->getPos();
   }
 }
-void SaveIsawPeaks::sizeBanks(std::string bankName, int &NCOLS, int &NROWS,
-                              double &xsize, double &ysize) {
+void SaveIsawPeaks::sizeBanks(const std::string &bankName, int &NCOLS,
+                              int &NROWS, double &xsize, double &ysize) {
   if (bankName == "None")
     return;
   const auto parent = inst->getComponentByName(bankName);
diff --git a/Framework/Crystal/src/SaveLauenorm.cpp b/Framework/Crystal/src/SaveLauenorm.cpp
index 0512f5fb3bf..1c930b37b47 100644
--- a/Framework/Crystal/src/SaveLauenorm.cpp
+++ b/Framework/Crystal/src/SaveLauenorm.cpp
@@ -499,7 +499,8 @@ void SaveLauenorm::exec() {
   out.flush();
   out.close();
 }
-void SaveLauenorm::sizeBanks(std::string bankName, int &nCols, int &nRows) {
+void SaveLauenorm::sizeBanks(const std::string &bankName, int &nCols,
+                             int &nRows) {
   if (bankName == "None")
     return;
   boost::shared_ptr<const IComponent> parent =
diff --git a/Framework/Crystal/src/SetSpecialCoordinates.cpp b/Framework/Crystal/src/SetSpecialCoordinates.cpp
index 5139e8b13ce..8d661d43fec 100644
--- a/Framework/Crystal/src/SetSpecialCoordinates.cpp
+++ b/Framework/Crystal/src/SetSpecialCoordinates.cpp
@@ -93,7 +93,7 @@ void SetSpecialCoordinates::init() {
 }
 
 bool SetSpecialCoordinates::writeCoordinatesToMDEventWorkspace(
-    Workspace_sptr inWS, SpecialCoordinateSystem /*unused*/) {
+    const Workspace_sptr &inWS, SpecialCoordinateSystem /*unused*/) {
   bool written = false;
   if (boost::dynamic_pointer_cast<IMDEventWorkspace>(inWS)) {
     g_log.warning("SetSpecialCoordinates: This algorithm cannot set the "
@@ -105,7 +105,7 @@ bool SetSpecialCoordinates::writeCoordinatesToMDEventWorkspace(
 }
 
 bool SetSpecialCoordinates::writeCoordinatesToMDHistoWorkspace(
-    Workspace_sptr inWS, SpecialCoordinateSystem /*unused*/) {
+    const Workspace_sptr &inWS, SpecialCoordinateSystem /*unused*/) {
   bool written = false;
   if (boost::dynamic_pointer_cast<IMDHistoWorkspace>(inWS)) {
     g_log.warning("SetSpecialCoordinates: This algorithm cannot set the "
@@ -117,7 +117,7 @@ bool SetSpecialCoordinates::writeCoordinatesToMDHistoWorkspace(
 }
 
 bool SetSpecialCoordinates::writeCoordinatesToPeaksWorkspace(
-    Workspace_sptr inWS, SpecialCoordinateSystem coordinateSystem) {
+    const Workspace_sptr &inWS, SpecialCoordinateSystem coordinateSystem) {
   bool written = false;
   if (auto peaksWS = boost::dynamic_pointer_cast<IPeaksWorkspace>(inWS)) {
     peaksWS->setCoordinateSystem(coordinateSystem);
diff --git a/Framework/Crystal/src/SortHKL.cpp b/Framework/Crystal/src/SortHKL.cpp
index ead61efa5e6..c5d7122c42b 100644
--- a/Framework/Crystal/src/SortHKL.cpp
+++ b/Framework/Crystal/src/SortHKL.cpp
@@ -412,7 +412,8 @@ PeaksWorkspace_sptr SortHKL::getOutputPeaksWorkspace(
 }
 
 /// Sorts the peaks in the workspace by H, K and L.
-void SortHKL::sortOutputPeaksByHKL(IPeaksWorkspace_sptr outputPeaksWorkspace) {
+void SortHKL::sortOutputPeaksByHKL(
+    const IPeaksWorkspace_sptr &outputPeaksWorkspace) {
   // Sort by HKL
   std::vector<std::pair<std::string, bool>> criteria{
       {"H", true}, {"K", true}, {"L", true}};
diff --git a/Framework/Crystal/src/StatisticsOfPeaksWorkspace.cpp b/Framework/Crystal/src/StatisticsOfPeaksWorkspace.cpp
index c5f46c9a5e9..a93bf28a13e 100644
--- a/Framework/Crystal/src/StatisticsOfPeaksWorkspace.cpp
+++ b/Framework/Crystal/src/StatisticsOfPeaksWorkspace.cpp
@@ -198,8 +198,8 @@ void StatisticsOfPeaksWorkspace::exec() {
  * @param ws :: any PeaksWorkspace
  * @param runName :: string to put in statistics table
  */
-void StatisticsOfPeaksWorkspace::doSortHKL(Mantid::API::Workspace_sptr ws,
-                                           std::string runName) {
+void StatisticsOfPeaksWorkspace::doSortHKL(
+    const Mantid::API::Workspace_sptr &ws, const std::string &runName) {
   std::string pointGroup = getPropertyValue("PointGroup");
   std::string latticeCentering = getPropertyValue("LatticeCentering");
   std::string wkspName = getPropertyValue("OutputWorkspace");
diff --git a/Framework/Crystal/test/AnvredCorrectionTest.h b/Framework/Crystal/test/AnvredCorrectionTest.h
index 399979d1d87..ea03f23516a 100644
--- a/Framework/Crystal/test/AnvredCorrectionTest.h
+++ b/Framework/Crystal/test/AnvredCorrectionTest.h
@@ -69,7 +69,7 @@ EventWorkspace_sptr createDiffractionEventWorkspace(int numBanks = 1,
   return retVal;
 }
 
-void do_test_events(MatrixWorkspace_sptr workspace, bool ev,
+void do_test_events(const MatrixWorkspace_sptr &workspace, bool ev,
                     bool performance = false) {
 
   workspace->getAxis(0)->setUnit("Wavelength");
diff --git a/Framework/Crystal/test/CalculateUMatrixTest.h b/Framework/Crystal/test/CalculateUMatrixTest.h
index 94648dd3234..49ac4859da9 100644
--- a/Framework/Crystal/test/CalculateUMatrixTest.h
+++ b/Framework/Crystal/test/CalculateUMatrixTest.h
@@ -181,7 +181,7 @@ private:
     return atan2(-QYUB(H, K, L), -QXUB(H, K, L));
   }
 
-  void generatePeaks(std::string WSName) {
+  void generatePeaks(const std::string &WSName) {
     setupUB();
 
     double Hpeaks[9] = {0, 1, 1, 0, -1, -1, 1, -3, -2};
diff --git a/Framework/Crystal/test/ClusterIntegrationBaseTest.h b/Framework/Crystal/test/ClusterIntegrationBaseTest.h
index bb3d0b04dbc..51331a53e63 100644
--- a/Framework/Crystal/test/ClusterIntegrationBaseTest.h
+++ b/Framework/Crystal/test/ClusterIntegrationBaseTest.h
@@ -50,9 +50,9 @@ protected:
   }
 
   // Add a fake peak to an MDEventWorkspace
-  void add_fake_md_peak(IMDEventWorkspace_sptr mdws, const size_t &nEvents,
-                        const double &h, const double &k, const double &l,
-                        const double &radius) {
+  void add_fake_md_peak(const IMDEventWorkspace_sptr &mdws,
+                        const size_t &nEvents, const double &h, const double &k,
+                        const double &l, const double &radius) {
     auto fakeMDEventDataAlg =
         AlgorithmManager::Instance().createUnmanaged("FakeMDEventData");
     fakeMDEventDataAlg->setChild(true);
diff --git a/Framework/Crystal/test/FilterPeaksTest.h b/Framework/Crystal/test/FilterPeaksTest.h
index b20b55387dc..40bcf59a5d2 100644
--- a/Framework/Crystal/test/FilterPeaksTest.h
+++ b/Framework/Crystal/test/FilterPeaksTest.h
@@ -39,7 +39,7 @@ private:
   /*
    * Helper method to run the algorithm and return the output workspace.
    */
-  IPeaksWorkspace_sptr runAlgorithm(PeaksWorkspace_sptr inWS,
+  IPeaksWorkspace_sptr runAlgorithm(const PeaksWorkspace_sptr &inWS,
                                     const std::string &filterVariable,
                                     const double filterValue,
                                     const std::string &filterOperator) {
diff --git a/Framework/Crystal/test/FindClusterFacesTest.h b/Framework/Crystal/test/FindClusterFacesTest.h
index cd84d02fe7f..86ca859c712 100644
--- a/Framework/Crystal/test/FindClusterFacesTest.h
+++ b/Framework/Crystal/test/FindClusterFacesTest.h
@@ -26,7 +26,7 @@ using Mantid::Crystal::FindClusterFaces;
 
 namespace {
 // Helper function to create a peaks workspace.
-IPeaksWorkspace_sptr create_peaks_WS(Instrument_sptr inst) {
+IPeaksWorkspace_sptr create_peaks_WS(const Instrument_sptr &inst) {
   PeaksWorkspace *pPeaksWS = new PeaksWorkspace();
   pPeaksWS->setCoordinateSystem(Mantid::Kernel::HKL);
   IPeaksWorkspace_sptr peakWS(pPeaksWS);
diff --git a/Framework/Crystal/test/FindSXPeaksTest.h b/Framework/Crystal/test/FindSXPeaksTest.h
index 6c50a2ac648..727ecad6df1 100644
--- a/Framework/Crystal/test/FindSXPeaksTest.h
+++ b/Framework/Crystal/test/FindSXPeaksTest.h
@@ -24,7 +24,7 @@ using namespace Mantid::Crystal;
 using namespace Mantid::DataObjects;
 
 // Helper method to overwrite spectra.
-void overWriteSpectraY(size_t histo, Workspace2D_sptr workspace,
+void overWriteSpectraY(size_t histo, const Workspace2D_sptr &workspace,
                        const std::vector<double> &Yvalues) {
 
   workspace->dataY(histo) = Yvalues;
@@ -32,7 +32,7 @@ void overWriteSpectraY(size_t histo, Workspace2D_sptr workspace,
 
 // Helper method to make what will be recognised as a single peak.
 void makeOnePeak(size_t histo, double peak_intensity, size_t at_bin,
-                 Workspace2D_sptr workspace) {
+                 const Workspace2D_sptr &workspace) {
   size_t nBins = workspace->y(0).size();
   std::vector<double> peaksInY(nBins);
 
@@ -53,7 +53,8 @@ void makeOnePeak(size_t histo, double peak_intensity, size_t at_bin,
  * @param startIndex :: the workspace index to start searching from
  * @param endIndex :: the workspace index to stop searching from
  */
-std::unique_ptr<FindSXPeaks> createFindSXPeaks(Workspace2D_sptr workspace) {
+std::unique_ptr<FindSXPeaks>
+createFindSXPeaks(const Workspace2D_sptr &workspace) {
   auto alg = std::make_unique<FindSXPeaks>();
   alg->setRethrows(true);
   alg->initialize();
diff --git a/Framework/Crystal/test/IndexPeaksTest.h b/Framework/Crystal/test/IndexPeaksTest.h
index c6a798a9627..296e2194246 100644
--- a/Framework/Crystal/test/IndexPeaksTest.h
+++ b/Framework/Crystal/test/IndexPeaksTest.h
@@ -112,7 +112,7 @@ PeaksWorkspace_sptr createTestPeaksWorkspaceWithSatellites(
 }
 
 std::unique_ptr<IndexPeaks>
-indexPeaks(PeaksWorkspace_sptr peaksWS,
+indexPeaks(const PeaksWorkspace_sptr &peaksWS,
            const std::unordered_map<std::string, std::string> &arguments) {
   auto alg = std::make_unique<IndexPeaks>();
   alg->setChild(true);
diff --git a/Framework/Crystal/test/IndexSXPeaksTest.h b/Framework/Crystal/test/IndexSXPeaksTest.h
index d4b1d78460f..4adba996f35 100644
--- a/Framework/Crystal/test/IndexSXPeaksTest.h
+++ b/Framework/Crystal/test/IndexSXPeaksTest.h
@@ -56,9 +56,9 @@ public:
     AnalysisDataService::Instance().remove("master_peaks");
   }
 
-  void doTest(int nPixels, std::string peakIndexes, double a, double b,
+  void doTest(int nPixels, const std::string &peakIndexes, double a, double b,
               double c, double alpha, double beta, double gamma,
-              std::string searchExtents = "-20,20,-20,20,-20,20",
+              const std::string &searchExtents = "-20,20,-20,20,-20,20",
               double dTolerance = 0.01) {
 
     // Take a copy of the original peaks workspace.
diff --git a/Framework/Crystal/test/IntegratePeakTimeSlicesTest.h b/Framework/Crystal/test/IntegratePeakTimeSlicesTest.h
index 9b9e0ed4551..9cb2a3db131 100644
--- a/Framework/Crystal/test/IntegratePeakTimeSlicesTest.h
+++ b/Framework/Crystal/test/IntegratePeakTimeSlicesTest.h
@@ -238,7 +238,7 @@ private:
   /**
    *   Calculates Q
    */
-  double calcQ(RectangularDetector_const_sptr bankP,
+  double calcQ(const RectangularDetector_const_sptr &bankP,
                const DetectorInfo &detectorInfo, int row, int col,
                double time) {
     boost::shared_ptr<Detector> detP = bankP->getAtXY(col, row);
diff --git a/Framework/Crystal/test/PeakClusterProjectionTest.h b/Framework/Crystal/test/PeakClusterProjectionTest.h
index 2ed35dfa0d4..ee5af061ef4 100644
--- a/Framework/Crystal/test/PeakClusterProjectionTest.h
+++ b/Framework/Crystal/test/PeakClusterProjectionTest.h
@@ -32,7 +32,7 @@ class PeakClusterProjectionTest : public CxxTest::TestSuite {
 
 private:
   // Helper function to create a peaks workspace.
-  IPeaksWorkspace_sptr create_peaks_WS(Instrument_sptr inst) const {
+  IPeaksWorkspace_sptr create_peaks_WS(const Instrument_sptr &inst) const {
     PeaksWorkspace *pPeaksWS = new PeaksWorkspace();
     pPeaksWS->setCoordinateSystem(Mantid::Kernel::HKL);
     IPeaksWorkspace_sptr peakWS(pPeaksWS);
diff --git a/Framework/Crystal/test/PeakIntensityVsRadiusTest.h b/Framework/Crystal/test/PeakIntensityVsRadiusTest.h
index 2c6884af5fd..493af63e323 100644
--- a/Framework/Crystal/test/PeakIntensityVsRadiusTest.h
+++ b/Framework/Crystal/test/PeakIntensityVsRadiusTest.h
@@ -210,12 +210,12 @@ public:
     assertFlatAfter1(ws);
   }
 
-  void assertFlatAfter1(MatrixWorkspace_sptr ws) {
+  void assertFlatAfter1(const MatrixWorkspace_sptr &ws) {
     TSM_ASSERT_DELTA("After 1.0, the signal is flat", ws->y(0)[12], 1000, 1e-6);
     TSM_ASSERT_DELTA("After 1.0, the signal is flat", ws->y(0)[15], 1000, 1e-6)
   }
 
-  void assertFirstFourYValuesCloseToZero(MatrixWorkspace_sptr ws) {
+  void assertFirstFourYValuesCloseToZero(const MatrixWorkspace_sptr &ws) {
     TS_ASSERT_DELTA(ws->y(0)[0], 0, 10);
     TS_ASSERT_DELTA(ws->y(0)[1], 0, 10);
     TS_ASSERT_DELTA(ws->y(0)[2], 0, 10);
diff --git a/Framework/Crystal/test/PeaksInRegionTest.h b/Framework/Crystal/test/PeaksInRegionTest.h
index 70f472cbe40..2e5510a1f62 100644
--- a/Framework/Crystal/test/PeaksInRegionTest.h
+++ b/Framework/Crystal/test/PeaksInRegionTest.h
@@ -31,7 +31,7 @@ private:
   Helper function. Creates a peaksworkspace with a single peak
   */
   PeakWorkspaceWithExtents
-  createPeaksWorkspace(const std::string coordFrame, double xMinFromPeak,
+  createPeaksWorkspace(const std::string &coordFrame, double xMinFromPeak,
                        double xMaxFromPeak, double yMinFromPeak,
                        double yMaxFromPeak, double zMinFromPeak,
                        double zMaxFromPeak) {
@@ -267,7 +267,7 @@ public:
                                       -0.5); // outside zmax
   }
 
-  void do_test_bounds_check_extents(const std::string coordFrame,
+  void do_test_bounds_check_extents(const std::string &coordFrame,
                                     double xMinFromPeak, double xMaxFromPeak,
                                     double yMinFromPeak, double yMaxFromPeak,
                                     double zMinFromPeak, double zMaxFromPeak,
diff --git a/Framework/Crystal/test/PeaksOnSurfaceTest.h b/Framework/Crystal/test/PeaksOnSurfaceTest.h
index 1231b76c911..884e15f42c3 100644
--- a/Framework/Crystal/test/PeaksOnSurfaceTest.h
+++ b/Framework/Crystal/test/PeaksOnSurfaceTest.h
@@ -27,7 +27,7 @@ private:
 Helper function. Creates a peaksworkspace with a single peak
 */
   PeaksWorkspace_sptr
-  createPeaksWorkspace(const std::string coordFrame,
+  createPeaksWorkspace(const std::string &coordFrame,
                        const Mantid::Kernel::V3D &peakPosition) {
     PeaksWorkspace_sptr ws = WorkspaceCreationHelper::createPeaksWorkspace(1);
     auto detectorIds = ws->getInstrument()->getDetectorIDs();
diff --git a/Framework/Crystal/test/PredictPeaksTest.h b/Framework/Crystal/test/PredictPeaksTest.h
index 49527be7c59..9935199443f 100644
--- a/Framework/Crystal/test/PredictPeaksTest.h
+++ b/Framework/Crystal/test/PredictPeaksTest.h
@@ -20,6 +20,8 @@
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 using namespace Mantid;
 using namespace Mantid::Crystal;
 using namespace Mantid::API;
@@ -37,8 +39,8 @@ public:
   }
 
   /** Make a HKL peaks workspace */
-  PeaksWorkspace_sptr getHKLpw(Instrument_sptr inst, std::vector<V3D> hkls,
-                               detid_t detid) {
+  PeaksWorkspace_sptr getHKLpw(const Instrument_sptr &inst,
+                               const std::vector<V3D> &hkls, detid_t detid) {
     PeaksWorkspace_sptr hklPW;
     if (hkls.size() > 0) {
       hklPW = PeaksWorkspace_sptr(new PeaksWorkspace());
@@ -51,9 +53,9 @@ public:
     return hklPW;
   }
 
-  void do_test_exec(std::string reflectionCondition, size_t expectedNumber,
-                    std::vector<V3D> hkls, int convention = 1,
-                    bool useExtendedDetectorSpace = false,
+  void do_test_exec(const std::string &reflectionCondition,
+                    size_t expectedNumber, const std::vector<V3D> &hkls,
+                    int convention = 1, bool useExtendedDetectorSpace = false,
                     bool addExtendedDetectorDefinition = false, int edge = 0) {
     // Name of the output workspace.
     std::string outWSName("PredictPeaksTest_OutputWS");
@@ -78,7 +80,7 @@ public:
     WorkspaceCreationHelper::setOrientedLattice(inWS, 12.0, 12.0, 12.0);
     WorkspaceCreationHelper::setGoniometer(inWS, 0., 0., 0.);
 
-    PeaksWorkspace_sptr hklPW = getHKLpw(inst, hkls, 10000);
+    PeaksWorkspace_sptr hklPW = getHKLpw(inst, std::move(hkls), 10000);
 
     PredictPeaks alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
diff --git a/Framework/Crystal/test/SetGoniometerTest.h b/Framework/Crystal/test/SetGoniometerTest.h
index 7646f706be0..1fd24eeefb7 100644
--- a/Framework/Crystal/test/SetGoniometerTest.h
+++ b/Framework/Crystal/test/SetGoniometerTest.h
@@ -193,7 +193,7 @@ public:
    * @param axis0 :: string to pass
    * @param numExpected :: how many axes should be created (0 or 1)
    */
-  void do_test_param(std::string axis0, size_t numExpected = 0) {
+  void do_test_param(const std::string &axis0, size_t numExpected = 0) {
     Workspace2D_sptr ws = WorkspaceCreationHelper::create2DWorkspace(10, 10);
     AnalysisDataService::Instance().addOrReplace("SetGoniometerTest_ws", ws);
     FrameworkManager::Instance().exec(
diff --git a/Framework/Crystal/test/SortPeaksWorkspaceTest.h b/Framework/Crystal/test/SortPeaksWorkspaceTest.h
index 5f31efbb3ae..3dac4e70097 100644
--- a/Framework/Crystal/test/SortPeaksWorkspaceTest.h
+++ b/Framework/Crystal/test/SortPeaksWorkspaceTest.h
@@ -25,7 +25,8 @@ private:
    * @param inWS : Input workspace to sort
    * @param columnName : Column name to sort by
    */
-  void doExecute(IPeaksWorkspace_sptr inWS, const std::string &columnName,
+  void doExecute(const IPeaksWorkspace_sptr &inWS,
+                 const std::string &columnName,
                  const bool sortAscending = true) {
     std::string outWSName("SortPeaksWorkspaceTest_OutputWS");
 
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/FitPowderDiffPeaks.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/FitPowderDiffPeaks.h
index 382b647c796..d20969b16a4 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/FitPowderDiffPeaks.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/FitPowderDiffPeaks.h
@@ -72,7 +72,7 @@ private:
   void processInputProperties();
 
   /// Generate peaks from input table workspace
-  void genPeaksFromTable(DataObjects::TableWorkspace_sptr peakparamws);
+  void genPeaksFromTable(const DataObjects::TableWorkspace_sptr &peakparamws);
 
   /// Generate a peak
   Functions::BackToBackExponential_sptr
@@ -86,11 +86,11 @@ private:
 
   /// Import instrument parameters from (input) table workspace
   void importInstrumentParameterFromTable(
-      DataObjects::TableWorkspace_sptr parameterWS);
+      const DataObjects::TableWorkspace_sptr &parameterWS);
 
   /// Import Bragg peak table workspace
   void
-  parseBraggPeakTable(DataObjects::TableWorkspace_sptr peakws,
+  parseBraggPeakTable(const DataObjects::TableWorkspace_sptr &peakws,
                       std::vector<std::map<std::string, double>> &parammaps,
                       std::vector<std::map<std::string, int>> &hklmaps);
 
@@ -108,27 +108,26 @@ private:
   //---------------------------------------------------------------------------
 
   /// Fit single peak in robust mode (no hint)
-  bool
-  fitSinglePeakRobust(Functions::BackToBackExponential_sptr peak,
-                      Functions::BackgroundFunction_sptr backgroundfunction,
-                      double peakleftbound, double peakrightbound,
-                      std::map<std::string, double> rightpeakparammap,
-                      double &finalchi2);
+  bool fitSinglePeakRobust(
+      const Functions::BackToBackExponential_sptr &peak,
+      const Functions::BackgroundFunction_sptr &backgroundfunction,
+      double peakleftbound, double peakrightbound,
+      const std::map<std::string, double> &rightpeakparammap,
+      double &finalchi2);
 
   /// Fit signle peak by Monte Carlo/simulated annealing
-  bool
-  fitSinglePeakSimulatedAnnealing(Functions::BackToBackExponential_sptr peak,
-                                  std::vector<std::string> paramtodomc);
+  bool fitSinglePeakSimulatedAnnealing(
+      const Functions::BackToBackExponential_sptr &peak,
+      const std::vector<std::string> &paramtodomc);
 
   /// Fit peak with confidence of the centre
   bool fitSinglePeakConfidentX(Functions::BackToBackExponential_sptr peak);
 
   /// Fit peak with trustful peak parameters
-  bool
-  fitSinglePeakConfident(Functions::BackToBackExponential_sptr peak,
-                         Functions::BackgroundFunction_sptr backgroundfunction,
-                         double leftbound, double rightbound, double &chi2,
-                         bool &annhilatedpeak);
+  bool fitSinglePeakConfident(
+      const Functions::BackToBackExponential_sptr &peak,
+      const Functions::BackgroundFunction_sptr &backgroundfunction,
+      double leftbound, double rightbound, double &chi2, bool &annhilatedpeak);
 
   /// Fit peak with confident parameters
   bool fitSinglePeakConfidentY(DataObjects::Workspace2D_sptr dataws,
@@ -136,33 +135,32 @@ private:
                                double dampingfactor);
 
   /// Fit peaks with confidence in fwhm and etc.
-  bool
-  fitOverlappedPeaks(std::vector<Functions::BackToBackExponential_sptr> peaks,
-                     Functions::BackgroundFunction_sptr backgroundfunction,
-                     double gfwhm);
+  bool fitOverlappedPeaks(
+      std::vector<Functions::BackToBackExponential_sptr> peaks,
+      const Functions::BackgroundFunction_sptr &backgroundfunction,
+      double gfwhm);
 
   /// Fit multiple (overlapped) peaks
   bool doFitMultiplePeaks(
-      DataObjects::Workspace2D_sptr dataws, size_t wsindex,
-      API::CompositeFunction_sptr peaksfunc,
+      const DataObjects::Workspace2D_sptr &dataws, size_t wsindex,
+      const API::CompositeFunction_sptr &peaksfunc,
       std::vector<Functions::BackToBackExponential_sptr> peakfuncs,
       std::vector<bool> &vecfitgood, std::vector<double> &vecchi2s);
 
   /// Use Le Bail method to estimate and set the peak heights
   void estimatePeakHeightsLeBail(
-      DataObjects::Workspace2D_sptr dataws, size_t wsindex,
+      const DataObjects::Workspace2D_sptr &dataws, size_t wsindex,
       std::vector<Functions::BackToBackExponential_sptr> peaks);
 
   /// Set constraints on a group of overlapped peaks for fitting
   void setOverlappedPeaksConstraints(
-      std::vector<Functions::BackToBackExponential_sptr> peaks);
+      const std::vector<Functions::BackToBackExponential_sptr> &peaks);
 
   /// Fit 1 peak by 1 minimizer of 1 call of minimzer (simple version)
-  bool doFit1PeakSimple(DataObjects::Workspace2D_sptr dataws,
-                        size_t workspaceindex,
-                        Functions::BackToBackExponential_sptr peakfunction,
-                        std::string minimzername, size_t maxiteration,
-                        double &chi2);
+  bool doFit1PeakSimple(
+      const DataObjects::Workspace2D_sptr &dataws, size_t workspaceindex,
+      const Functions::BackToBackExponential_sptr &peakfunction,
+      const std::string &minimzername, size_t maxiteration, double &chi2);
 
   /// Fit 1 peak and background
   // bool doFit1PeakBackgroundSimple(DataObjects::Workspace2D_sptr dataws,
@@ -172,33 +170,32 @@ private:
   // string minimzername, size_t maxiteration, double &chi2);
 
   /// Fit single peak with background to raw data
-  bool
-  doFit1PeakBackground(DataObjects::Workspace2D_sptr dataws, size_t wsindex,
-                       Functions::BackToBackExponential_sptr peak,
-                       Functions::BackgroundFunction_sptr backgroundfunction,
-                       double &chi2);
+  bool doFit1PeakBackground(
+      const DataObjects::Workspace2D_sptr &dataws, size_t wsindex,
+      const Functions::BackToBackExponential_sptr &peak,
+      const Functions::BackgroundFunction_sptr &backgroundfunction,
+      double &chi2);
 
   /// Fit 1 peak by using a sequential of minimizer
-  bool doFit1PeakSequential(DataObjects::Workspace2D_sptr dataws,
-                            size_t workspaceindex,
-                            Functions::BackToBackExponential_sptr peakfunction,
-                            std::vector<std::string> minimzernames,
-                            std::vector<size_t> maxiterations,
-                            std::vector<double> dampfactors, double &chi2);
+  bool doFit1PeakSequential(
+      const DataObjects::Workspace2D_sptr &dataws, size_t workspaceindex,
+      const Functions::BackToBackExponential_sptr &peakfunction,
+      std::vector<std::string> minimzernames, std::vector<size_t> maxiterations,
+      const std::vector<double> &dampfactors, double &chi2);
 
   /// Fit N overlapped peaks in a simple manner
   bool doFitNPeaksSimple(
-      DataObjects::Workspace2D_sptr dataws, size_t wsindex,
-      API::CompositeFunction_sptr peaksfunc,
-      std::vector<Functions::BackToBackExponential_sptr> peakfuncs,
-      std::string minimizername, size_t maxiteration, double &chi2);
+      const DataObjects::Workspace2D_sptr &dataws, size_t wsindex,
+      const API::CompositeFunction_sptr &peaksfunc,
+      const std::vector<Functions::BackToBackExponential_sptr> &peakfuncs,
+      const std::string &minimizername, size_t maxiteration, double &chi2);
 
   /// Store the function's parameter values to a map
-  void storeFunctionParameters(API::IFunction_sptr function,
+  void storeFunctionParameters(const API::IFunction_sptr &function,
                                std::map<std::string, double> &parammaps);
 
   /// Restore the function's parameter values from a map
-  void restoreFunctionParameters(API::IFunction_sptr function,
+  void restoreFunctionParameters(const API::IFunction_sptr &function,
                                  std::map<std::string, double> parammap);
 
   /// Calculate the range to fit peak/peaks group
@@ -225,7 +222,8 @@ private:
   void cropWorkspace(double tofmin, double tofmax);
 
   /// Parse Fit() output parameter workspace
-  std::string parseFitParameterWorkspace(API::ITableWorkspace_sptr paramws);
+  std::string
+  parseFitParameterWorkspace(const API::ITableWorkspace_sptr &paramws);
 
   /// Build a partial workspace from source
   // DataObjects::Workspace2D_sptr
@@ -240,8 +238,8 @@ private:
                                double &chi2);
 
   /// Observe peak range with hint from right peak's properties
-  void observePeakRange(Functions::BackToBackExponential_sptr thispeak,
-                        Functions::BackToBackExponential_sptr rightpeak,
+  void observePeakRange(const Functions::BackToBackExponential_sptr &thispeak,
+                        const Functions::BackToBackExponential_sptr &rightpeak,
                         double refpeakshift, double &peakleftbound,
                         double &peakrightbound);
 
@@ -268,12 +266,12 @@ private:
                 bool calchi2);
 
   std::pair<bool, double>
-  doFitPeak(DataObjects::Workspace2D_sptr dataws,
-            Functions::BackToBackExponential_sptr peakfunction,
+  doFitPeak(const DataObjects::Workspace2D_sptr &dataws,
+            const Functions::BackToBackExponential_sptr &peakfunction,
             double guessedfwhm);
 
   /// Fit background-removed peak by Gaussian
-  bool doFitGaussianPeak(DataObjects::Workspace2D_sptr dataws,
+  bool doFitGaussianPeak(const DataObjects::Workspace2D_sptr &dataws,
                          size_t workspaceindex, double in_center,
                          double leftfwhm, double rightfwhm, double &center,
                          double &sigma, double &height);
@@ -288,28 +286,28 @@ private:
                            Functions::BackgroundFunction_sptr background);
 
   /// Parse the fitting result
-  std::string parseFitResult(API::IAlgorithm_sptr fitalg, double &chi2,
+  std::string parseFitResult(const API::IAlgorithm_sptr &fitalg, double &chi2,
                              bool &fitsuccess);
 
   /// Calculate a Bragg peak's centre in TOF from its Miller indices
   double calculatePeakCentreTOF(int h, int k, int l);
 
   /// Get parameter value from m_instrumentParameters
-  double getParameter(std::string parname);
+  double getParameter(const std::string &parname);
 
   /// Fit peaks in the same group (i.e., single peak or overlapped peaks)
   void fitPeaksGroup(std::vector<size_t> peakindexes);
 
   /// Build partial workspace for fitting
   DataObjects::Workspace2D_sptr
-  buildPartialWorkspace(API::MatrixWorkspace_sptr sourcews,
+  buildPartialWorkspace(const API::MatrixWorkspace_sptr &sourcews,
                         size_t workspaceindex, double leftbound,
                         double rightbound);
 
   /// Plot a single peak to output vector
-  void plotFunction(API::IFunction_sptr peakfunction,
-                    Functions::BackgroundFunction_sptr background,
-                    API::FunctionDomain1DVector domain);
+  void plotFunction(const API::IFunction_sptr &peakfunction,
+                    const Functions::BackgroundFunction_sptr &background,
+                    const API::FunctionDomain1DVector &domain);
 
   //-----------------------------------------------------------------------------------------------
 
@@ -411,25 +409,25 @@ inline double linearInterpolateY(double x0, double xf, double y0, double yf,
 }
 
 /// Estimate background for a pattern in a coarse mode
-void estimateBackgroundCoarse(DataObjects::Workspace2D_sptr dataws,
-                              Functions::BackgroundFunction_sptr background,
-                              size_t wsindexraw, size_t wsindexbkgd,
-                              size_t wsindexpeak);
+void estimateBackgroundCoarse(
+    const DataObjects::Workspace2D_sptr &dataws,
+    const Functions::BackgroundFunction_sptr &background, size_t wsindexraw,
+    size_t wsindexbkgd, size_t wsindexpeak);
 
 /// Estimate peak parameters;
-bool observePeakParameters(DataObjects::Workspace2D_sptr dataws, size_t wsindex,
-                           double &centre, double &height, double &fwhm,
-                           std::string &errmsg);
+bool observePeakParameters(const DataObjects::Workspace2D_sptr &dataws,
+                           size_t wsindex, double &centre, double &height,
+                           double &fwhm, std::string &errmsg);
 
 /// Find maximum value
 size_t findMaxValue(const std::vector<double> &Y);
 
 /// Find maximum value
-size_t findMaxValue(API::MatrixWorkspace_sptr dataws, size_t wsindex,
+size_t findMaxValue(const API::MatrixWorkspace_sptr &dataws, size_t wsindex,
                     double leftbound, double rightbound);
 
 /// Get function parameter name, value and etc information in string
-std::string getFunctionInfo(API::IFunction_sptr function);
+std::string getFunctionInfo(const API::IFunction_sptr &function);
 
 } // namespace Algorithms
 } // namespace CurveFitting
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFit.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFit.h
index a0c846385db..8b44d19e3aa 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFit.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFit.h
@@ -103,8 +103,8 @@ private:
   void createLeBailFunction();
 
   /// Crop the workspace for better usage
-  API::MatrixWorkspace_sptr cropWorkspace(API::MatrixWorkspace_sptr inpws,
-                                          size_t wsindex);
+  API::MatrixWorkspace_sptr
+  cropWorkspace(const API::MatrixWorkspace_sptr &inpws, size_t wsindex);
 
   /// Process and calculate input background
   void processInputBackground();
@@ -123,10 +123,10 @@ private:
   void parseBraggPeaksParametersTable();
 
   /// Parse content in a table workspace to vector for background parameters
-  void
-  parseBackgroundTableWorkspace(DataObjects::TableWorkspace_sptr bkgdparamws,
-                                std::vector<std::string> &bkgdparnames,
-                                std::vector<double> &bkgdorderparams);
+  void parseBackgroundTableWorkspace(
+      const DataObjects::TableWorkspace_sptr &bkgdparamws,
+      std::vector<std::string> &bkgdparnames,
+      std::vector<double> &bkgdorderparams);
 
   /// Create and set up output table workspace for peaks
   void exportBraggPeakParameterToTable();
@@ -153,12 +153,12 @@ private:
   /// Set up Monte Carlo random walk strategy
   void setupBuiltInRandomWalkStrategy();
 
-  void
-  setupRandomWalkStrategyFromTable(DataObjects::TableWorkspace_sptr tablews);
+  void setupRandomWalkStrategyFromTable(
+      const DataObjects::TableWorkspace_sptr &tablews);
 
   /// Add parameter (to a vector of string/name) for MC random walk
   void addParameterToMCMinimize(std::vector<std::string> &parnamesforMC,
-                                std::string parname);
+                                const std::string &parname);
 
   /// Calculate diffraction pattern in Le Bail algorithm for MC Random walk
   bool calculateDiffractionPattern(
@@ -171,7 +171,8 @@ private:
   bool acceptOrDeny(Kernel::Rfactor currR, Kernel::Rfactor newR);
 
   /// Propose new parameters
-  bool proposeNewValues(std::vector<std::string> mcgroup, Kernel::Rfactor r,
+  bool proposeNewValues(const std::vector<std::string> &mcgroup,
+                        Kernel::Rfactor r,
                         std::map<std::string, Parameter> &curparammap,
                         std::map<std::string, Parameter> &newparammap,
                         bool prevBetterRwp);
@@ -308,7 +309,7 @@ private:
 /// Write a set of (XY) data to a column file
 void writeRfactorsToFile(std::vector<double> vecX,
                          std::vector<Kernel::Rfactor> vecR,
-                         std::string filename);
+                         const std::string &filename);
 
 } // namespace Algorithms
 } // namespace CurveFitting
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFunction.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFunction.h
index b4a9afb2820..754025d1c0d 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFunction.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFunction.h
@@ -34,7 +34,7 @@ it is rewritten.
 class MANTID_CURVEFITTING_DLL LeBailFunction {
 public:
   /// Constructor
-  LeBailFunction(std::string peaktype);
+  LeBailFunction(const std::string &peaktype);
 
   /// Destructor
   virtual ~LeBailFunction();
@@ -43,14 +43,14 @@ public:
   void setProfileParameterValues(std::map<std::string, double> parammap);
 
   /// Set up a parameter to fit but tied among all peaks
-  void setFitProfileParameter(std::string paramname, double minvalue,
+  void setFitProfileParameter(const std::string &paramname, double minvalue,
                               double maxvalue);
 
   /// Function
-  void setPeakHeights(std::vector<double> inheights);
+  void setPeakHeights(const std::vector<double> &inheights);
 
   /// Check whether a parameter is a profile parameter
-  bool hasProfileParameter(std::string paramname);
+  bool hasProfileParameter(const std::string &paramname);
 
   /// Check whether the newly set parameters are correct, i.e., all peaks are
   /// physical
@@ -63,7 +63,7 @@ public:
   void addPeaks(std::vector<std::vector<int>> peakhkls);
 
   /// Add background function
-  void addBackgroundFunction(std::string backgroundtype,
+  void addBackgroundFunction(const std::string &backgroundtype,
                              const unsigned int &order,
                              const std::vector<std::string> &vecparnames,
                              const std::vector<double> &vecparvalues,
@@ -91,13 +91,14 @@ public:
   void calPeaksParameters();
 
   /// Get peak parameters (calculated)
-  double getPeakParameter(size_t index, std::string parname) const;
+  double getPeakParameter(size_t index, const std::string &parname) const;
 
   /// Get peak parameters (calculated)
-  double getPeakParameter(std::vector<int> hkl, std::string parname) const;
+  double getPeakParameter(std::vector<int> hkl,
+                          const std::string &parname) const;
 
   /// Set up a parameter to be fixed
-  void fixPeakParameter(std::string paramname, double paramvalue);
+  void fixPeakParameter(const std::string &paramname, double paramvalue);
 
   /// Fix all background parameters
   void fixBackgroundParameters();
@@ -116,13 +117,13 @@ public:
 
 private:
   /// Set peak parameters
-  void setPeakParameters(API::IPowderDiffPeakFunction_sptr peak,
-                         std::map<std::string, double> parammap,
+  void setPeakParameters(const API::IPowderDiffPeakFunction_sptr &peak,
+                         const std::map<std::string, double> &parammap,
                          double peakheight, bool setpeakheight);
 
   /// Retrieve peak's parameter.  may be native or calculated
-  double getPeakParameterValue(API::IPowderDiffPeakFunction_sptr peak,
-                               std::string parname) const;
+  double getPeakParameterValue(const API::IPowderDiffPeakFunction_sptr &peak,
+                               const std::string &parname) const;
 
   /// Calculate all peaks' parameter value
   void calculatePeakParameterValues() const;
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PlotPeakByLogValue.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PlotPeakByLogValue.h
index 37df79315c5..6e6e97f2d6b 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PlotPeakByLogValue.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PlotPeakByLogValue.h
@@ -64,7 +64,8 @@ private:
   void exec() override;
 
   /// Set any WorkspaceIndex attributes in the fitting function
-  void setWorkspaceIndexAttribute(API::IFunction_sptr fun, int wsIndex) const;
+  void setWorkspaceIndexAttribute(const API::IFunction_sptr &fun,
+                                  int wsIndex) const;
 
   boost::shared_ptr<Algorithm> runSingleFit(bool createFitOutput,
                                             bool outputCompositeMembers,
@@ -72,7 +73,8 @@ private:
                                             const API::IFunction_sptr &ifun,
                                             const InputSpectraToFit &data);
 
-  double calculateLogValue(std::string logName, const InputSpectraToFit &data);
+  double calculateLogValue(const std::string &logName,
+                           const InputSpectraToFit &data);
 
   API::ITableWorkspace_sptr
   createResultsTable(const std::string &logName,
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PlotPeakByLogValueHelper.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PlotPeakByLogValueHelper.h
index 68fbe159876..f83cabaeb31 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PlotPeakByLogValueHelper.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/PlotPeakByLogValueHelper.h
@@ -42,7 +42,7 @@ getWorkspace(const std::string &name, int period);
 
 /// Create a list of input workspace names
 MANTID_CURVEFITTING_DLL std::vector<InputSpectraToFit>
-makeNames(std::string inputList, int default_wi, int default_spec);
+makeNames(const std::string &inputList, int default_wi, int default_spec);
 
 enum SpecialIndex {
   NOT_SET = -1,
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/QENSFitSequential.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/QENSFitSequential.h
index dc0a910b53f..32f8dfa3c1c 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/QENSFitSequential.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/QENSFitSequential.h
@@ -46,8 +46,8 @@ private:
   API::ITableWorkspace_sptr performFit(const std::string &input,
                                        const std::string &output);
   void deleteTemporaryWorkspaces(const std::string &outputBaseName);
-  void addAdditionalLogs(API::WorkspaceGroup_sptr resultWorkspace);
-  void addAdditionalLogs(API::Workspace_sptr result);
+  void addAdditionalLogs(const API::WorkspaceGroup_sptr &resultWorkspace);
+  void addAdditionalLogs(const API::Workspace_sptr &result);
 
   virtual bool throwIfElasticQConversionFails() const;
   virtual bool isFitParameter(const std::string &parameterName) const;
@@ -57,9 +57,9 @@ private:
       const std::vector<API::MatrixWorkspace_sptr> &workspaces) const;
   std::vector<std::size_t> getDatasetGrouping(
       const std::vector<API::MatrixWorkspace_sptr> &workspaces) const;
-  API::WorkspaceGroup_sptr
-  processIndirectFitParameters(API::ITableWorkspace_sptr parameterWorkspace,
-                               const std::vector<std::size_t> &grouping);
+  API::WorkspaceGroup_sptr processIndirectFitParameters(
+      const API::ITableWorkspace_sptr &parameterWorkspace,
+      const std::vector<std::size_t> &grouping);
 
   std::vector<API::MatrixWorkspace_sptr> convertInputToElasticQ(
       const std::vector<API::MatrixWorkspace_sptr> &workspaces) const;
@@ -77,20 +77,20 @@ private:
                             std::vector<std::string> const &spectra,
                             std::string const &outputBaseName,
                             std::string const &endOfSuffix);
-  void copyLogs(API::WorkspaceGroup_sptr resultWorkspaces,
+  void copyLogs(const API::WorkspaceGroup_sptr &resultWorkspaces,
                 std::vector<API::MatrixWorkspace_sptr> const &workspaces);
-  void copyLogs(API::Workspace_sptr resultWorkspace,
+  void copyLogs(const API::Workspace_sptr &resultWorkspace,
                 std::vector<API::MatrixWorkspace_sptr> const &workspaces);
-  void copyLogs(API::MatrixWorkspace_sptr resultWorkspace,
-                API::WorkspaceGroup_sptr resultGroup);
-  void copyLogs(API::MatrixWorkspace_sptr resultWorkspace,
-                API::Workspace_sptr resultGroup);
-  void extractMembers(API::WorkspaceGroup_sptr resultGroupWs,
+  void copyLogs(const API::MatrixWorkspace_sptr &resultWorkspace,
+                const API::WorkspaceGroup_sptr &resultGroup);
+  void copyLogs(const API::MatrixWorkspace_sptr &resultWorkspace,
+                const API::Workspace_sptr &resultGroup);
+  void extractMembers(const API::WorkspaceGroup_sptr &resultGroupWs,
                       const std::vector<API::MatrixWorkspace_sptr> &workspaces,
                       const std::string &outputWsName);
 
   API::IAlgorithm_sptr
-  extractMembersAlgorithm(API::WorkspaceGroup_sptr resultGroupWs,
+  extractMembersAlgorithm(const API::WorkspaceGroup_sptr &resultGroupWs,
                           const std::string &outputWsName) const;
 
   std::string getTemporaryName() const;
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/QENSFitSimultaneous.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/QENSFitSimultaneous.h
index 67075de0d74..d6af7bbfa52 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/QENSFitSimultaneous.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/QENSFitSimultaneous.h
@@ -47,27 +47,27 @@ private:
   std::pair<API::ITableWorkspace_sptr, API::Workspace_sptr>
   performFit(const std::vector<API::MatrixWorkspace_sptr> &workspaces,
              const std::string &output);
-  API::WorkspaceGroup_sptr
-  processIndirectFitParameters(API::ITableWorkspace_sptr parameterWorkspace,
-                               const std::vector<std::size_t> &grouping);
-  void copyLogs(API::WorkspaceGroup_sptr resultWorkspace,
+  API::WorkspaceGroup_sptr processIndirectFitParameters(
+      const API::ITableWorkspace_sptr &parameterWorkspace,
+      const std::vector<std::size_t> &grouping);
+  void copyLogs(const API::WorkspaceGroup_sptr &resultWorkspace,
                 const std::vector<API::MatrixWorkspace_sptr> &workspaces);
-  void copyLogs(API::MatrixWorkspace_sptr resultWorkspace,
-                API::WorkspaceGroup_sptr resultGroup);
-  void extractMembers(API::WorkspaceGroup_sptr resultGroupWs,
+  void copyLogs(const API::MatrixWorkspace_sptr &resultWorkspace,
+                const API::WorkspaceGroup_sptr &resultGroup);
+  void extractMembers(const API::WorkspaceGroup_sptr &resultGroupWs,
                       const std::vector<API::MatrixWorkspace_sptr> &workspaces,
                       const std::string &outputWsName);
-  void addAdditionalLogs(API::WorkspaceGroup_sptr group);
-  void addAdditionalLogs(API::Workspace_sptr result);
+  void addAdditionalLogs(const API::WorkspaceGroup_sptr &group);
+  void addAdditionalLogs(const API::Workspace_sptr &result);
 
   API::IAlgorithm_sptr
-  extractMembersAlgorithm(API::WorkspaceGroup_sptr resultGroupWs,
+  extractMembersAlgorithm(const API::WorkspaceGroup_sptr &resultGroupWs,
                           const std::string &outputWsName) const;
 
   std::string getOutputBaseName() const;
   std::vector<std::string> getWorkspaceNames() const;
   std::vector<std::string> getWorkspaceIndices() const;
-  void renameWorkspaces(API::WorkspaceGroup_sptr outputGroup,
+  void renameWorkspaces(const API::WorkspaceGroup_sptr &outputGroup,
                         std::vector<std::string> const &spectra,
                         std::string const &outputBaseName,
                         std::string const &endOfSuffix,
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/QENSFitUtilities.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/QENSFitUtilities.h
index 33e82228722..4972f7be065 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/QENSFitUtilities.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/QENSFitUtilities.h
@@ -16,7 +16,7 @@ namespace API {
 
 void renameWorkspacesInQENSFit(
     Algorithm *qensFit, IAlgorithm_sptr renameAlgorithm,
-    WorkspaceGroup_sptr outputGroup, std::string const &outputBaseName,
+    const WorkspaceGroup_sptr &outputGroup, std::string const &outputBaseName,
     std::string const &groupSuffix,
     std::function<std::string(std::size_t)> const &getNameSuffix);
 
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters.h
index c30d735b846..7afd36cdd81 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters.h
@@ -67,20 +67,22 @@ private:
 
   //----------------  Processing Input ---------------------
   /// Import instrument parameter from table (workspace)
-  void importParametersFromTable(DataObjects::TableWorkspace_sptr parameterWS,
-                                 std::map<std::string, double> &parameters);
+  void
+  importParametersFromTable(const DataObjects::TableWorkspace_sptr &parameterWS,
+                            std::map<std::string, double> &parameters);
 
   /// Import the Monte Carlo related parameters from table
   void importMonteCarloParametersFromTable(
-      DataObjects::TableWorkspace_sptr tablews,
-      std::vector<std::string> parameternames, std::vector<double> &stepsizes,
-      std::vector<double> &lowerbounds, std::vector<double> &upperbounds);
+      const DataObjects::TableWorkspace_sptr &tablews,
+      const std::vector<std::string> &parameternames,
+      std::vector<double> &stepsizes, std::vector<double> &lowerbounds,
+      std::vector<double> &upperbounds);
 
   /// Generate (output) workspace of peak centers
   void genPeakCentersWorkspace(bool montecarlo, size_t numbestfit);
 
   /// Generate peaks from table (workspace)
-  void genPeaksFromTable(DataObjects::TableWorkspace_sptr peakparamws);
+  void genPeaksFromTable(const DataObjects::TableWorkspace_sptr &peakparamws);
 
   //---------------  Processing Output ------------------
   /// Generate (output) table worksspace for instrument parameters
@@ -94,12 +96,12 @@ private:
   void fitInstrumentParameters();
 
   /// Calculate function's statistic
-  double calculateFunctionStatistic(API::IFunction_sptr func,
-                                    API::MatrixWorkspace_sptr dataws,
+  double calculateFunctionStatistic(const API::IFunction_sptr &func,
+                                    const API::MatrixWorkspace_sptr &dataws,
                                     size_t workspaceindex);
 
   /// Fit function to data
-  bool fitFunction(API::IFunction_sptr func, double &gslchi2);
+  bool fitFunction(const API::IFunction_sptr &func, double &gslchi2);
 
   /// Parse Fit() output parameter workspace
   std::string parseFitParameterWorkspace(API::ITableWorkspace_sptr paramws);
@@ -108,9 +110,8 @@ private:
   std::string parseFitResult(API::IAlgorithm_sptr fitalg, double &chi2);
 
   /// Set up and run a monte carlo simulation to refine the peak parameters
-  void
-  refineInstrumentParametersMC(DataObjects::TableWorkspace_sptr parameterWS,
-                               bool fit2 = false);
+  void refineInstrumentParametersMC(
+      const DataObjects::TableWorkspace_sptr &parameterWS, bool fit2 = false);
 
   /// Core Monte Carlo random walk on parameter-space
   void doParameterSpaceRandomWalk(std::vector<std::string> parnames,
@@ -124,8 +125,8 @@ private:
   void getD2TOFFuncParamNames(std::vector<std::string> &parnames);
 
   /// Calculate the value and chi2
-  double calculateD2TOFFunction(API::IFunction_sptr func,
-                                API::FunctionDomain1DVector domain,
+  double calculateD2TOFFunction(const API::IFunction_sptr &func,
+                                const API::FunctionDomain1DVector &domain,
                                 API::FunctionValues &values,
                                 const Mantid::HistogramData::HistogramY &rawY,
                                 const Mantid::HistogramData::HistogramE &rawE);
@@ -135,7 +136,7 @@ private:
 
   /// Calculate value n for thermal neutron peak profile
   void
-  calculateThermalNeutronSpecial(API::IFunction_sptr m_Function,
+  calculateThermalNeutronSpecial(const API::IFunction_sptr &m_Function,
                                  const Mantid::HistogramData::HistogramX &xVals,
                                  std::vector<double> &vec_n);
 
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters3.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters3.h
index 22fc3367b2e..bab383a92ad 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters3.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/RefinePowderInstrumentParameters3.h
@@ -68,11 +68,11 @@ private:
 
   /// Add parameter (to a vector of string/name) for MC random walk
   void addParameterToMCMinimize(std::vector<std::string> &parnamesforMC,
-                                std::string parname,
+                                const std::string &parname,
                                 std::map<std::string, Parameter> parammap);
 
   /// Propose new parameters
-  void proposeNewValues(std::vector<std::string> mcgroup,
+  void proposeNewValues(const std::vector<std::string> &mcgroup,
                         std::map<std::string, Parameter> &curparammap,
                         std::map<std::string, Parameter> &newparammap,
                         double currchisq);
@@ -88,23 +88,23 @@ private:
   // maxnumresults);
 
   /// Implement parameter values, calculate function and its chi square.
-  double calculateFunction(std::map<std::string, Parameter> parammap,
+  double calculateFunction(const std::map<std::string, Parameter> &parammap,
                            std::vector<double> &vecY);
 
   /// Calculate Chi^2 of the a function with all parameters are fixed
-  double calculateFunctionError(API::IFunction_sptr function,
-                                DataObjects::Workspace2D_sptr dataws,
+  double calculateFunctionError(const API::IFunction_sptr &function,
+                                const DataObjects::Workspace2D_sptr &dataws,
                                 int wsindex);
 
   /// Fit function by non MC minimzer(s)
-  double fitFunction(API::IFunction_sptr function,
-                     DataObjects::Workspace2D_sptr dataws, int wsindex,
+  double fitFunction(const API::IFunction_sptr &function,
+                     const DataObjects::Workspace2D_sptr &dataws, int wsindex,
                      bool powerfit);
 
   /// Fit function (single step)
-  bool doFitFunction(API::IFunction_sptr function,
-                     DataObjects::Workspace2D_sptr dataws, int wsindex,
-                     std::string minimizer, int numiters, double &chi2,
+  bool doFitFunction(const API::IFunction_sptr &function,
+                     const DataObjects::Workspace2D_sptr &dataws, int wsindex,
+                     const std::string &minimizer, int numiters, double &chi2,
                      std::string &fitstatus);
 
   /// Process input properties
@@ -114,11 +114,11 @@ private:
   void parseTableWorkspaces();
 
   /// Parse table workspace to a map of Parameters
-  void parseTableWorkspace(DataObjects::TableWorkspace_sptr tablews,
+  void parseTableWorkspace(const DataObjects::TableWorkspace_sptr &tablews,
                            std::map<std::string, Parameter> &parammap);
 
   /// Set parameter values to function from Parameter map
-  void setFunctionParameterValues(API::IFunction_sptr function,
+  void setFunctionParameterValues(const API::IFunction_sptr &function,
                                   std::map<std::string, Parameter> params);
 
   /// Update parameter values to Parameter map from fuction map
@@ -127,13 +127,13 @@ private:
 
   /// Set parameter fitting setup (boundary, fix or unfix) to function from
   /// Parameter map
-  void setFunctionParameterFitSetups(API::IFunction_sptr function,
+  void setFunctionParameterFitSetups(const API::IFunction_sptr &function,
                                      std::map<std::string, Parameter> params);
 
   /// Construct output
   DataObjects::Workspace2D_sptr
-  genOutputWorkspace(API::FunctionDomain1DVector domain,
-                     API::FunctionValues rawvalues);
+  genOutputWorkspace(const API::FunctionDomain1DVector &domain,
+                     const API::FunctionValues &rawvalues);
 
   /// Construct an output TableWorkspace for refined peak profile parameters
   DataObjects::TableWorkspace_sptr
@@ -143,7 +143,7 @@ private:
   /// Add a parameter to parameter map.  If this parametere does exist, then
   /// replace the value of it
   void addOrReplace(std::map<std::string, Parameter> &parameters,
-                    std::string parname, double parvalue);
+                    const std::string &parname, double parvalue);
 
   //--------  Variables ------------------------------------------------------
   /// Data workspace containg peak positions
@@ -189,17 +189,19 @@ void convertToDict(std::vector<std::string> strvec,
                    std::map<std::string, size_t> &lookupdict);
 
 /// Get the index from lookup dictionary (map)
-int getStringIndex(std::map<std::string, size_t> lookupdict, std::string key);
+int getStringIndex(std::map<std::string, size_t> lookupdict,
+                   const std::string &key);
 
 /// Store function parameter values to a map
 void storeFunctionParameterValue(
-    API::IFunction_sptr function,
+    const API::IFunction_sptr &function,
     std::map<std::string, std::pair<double, double>> &parvaluemap);
 
 /// Restore function parameter values to a map
 void restoreFunctionParameterValue(
     std::map<std::string, std::pair<double, double>> parvaluemap,
-    API::IFunction_sptr function, std::map<std::string, Parameter> &parammap);
+    const API::IFunction_sptr &function,
+    std::map<std::string, Parameter> &parammap);
 
 /// Copy parameters from source to target
 void duplicateParameters(std::map<std::string, Parameter> source,
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/SplineBackground.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/SplineBackground.h
index dd85faa45c4..f88a7ee49f1 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/SplineBackground.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/SplineBackground.h
@@ -67,8 +67,8 @@ private:
 
   /// Gets the values from the fitted GSL, and creates a clone of input
   /// workspace with new values
-  API::MatrixWorkspace_sptr saveSplineOutput(const API::MatrixWorkspace_sptr ws,
-                                             const size_t spec);
+  API::MatrixWorkspace_sptr
+  saveSplineOutput(const API::MatrixWorkspace_sptr &ws, const size_t spec);
 
   /// Sets up the splines for later fitting
   void setupSpline(double xMin, double xMax, int numBins, int ncoeff);
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/SplineInterpolation.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/SplineInterpolation.h
index f083aef2a5e..74f9b500099 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/SplineInterpolation.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/SplineInterpolation.h
@@ -50,8 +50,8 @@ private:
   /// setup an output workspace using meta data from inws and taking a number of
   /// spectra
   API::MatrixWorkspace_sptr
-  setupOutputWorkspace(API::MatrixWorkspace_sptr mws,
-                       API::MatrixWorkspace_sptr iws) const;
+  setupOutputWorkspace(const API::MatrixWorkspace_sptr &mws,
+                       const API::MatrixWorkspace_sptr &iws) const;
 
   /// convert a binned workspace to point data using ConvertToPointData
   API::MatrixWorkspace_sptr
@@ -59,28 +59,32 @@ private:
 
   /// set the points that define the spline used for interpolation of a
   /// workspace
-  void setInterpolationPoints(API::MatrixWorkspace_const_sptr inputWorkspace,
-                              const size_t row) const;
+  void
+  setInterpolationPoints(const API::MatrixWorkspace_const_sptr &inputWorkspace,
+                         const size_t row) const;
 
   /// Calculate the interpolation of the input workspace against the spline and
   /// store it in outputWorkspace
-  void calculateSpline(API::MatrixWorkspace_const_sptr inputWorkspace,
-                       API::MatrixWorkspace_sptr outputWorkspace,
+  void calculateSpline(const API::MatrixWorkspace_const_sptr &inputWorkspace,
+                       const API::MatrixWorkspace_sptr &outputWorkspace,
                        const size_t row) const;
 
   /// Calculate the derivatives of the input workspace from the spline.
-  void calculateDerivatives(API::MatrixWorkspace_const_sptr inputWorkspace,
-                            API::MatrixWorkspace_sptr outputWorkspace,
-                            const size_t order) const;
+  void
+  calculateDerivatives(const API::MatrixWorkspace_const_sptr &inputWorkspace,
+                       const API::MatrixWorkspace_sptr &outputWorkspace,
+                       const size_t order) const;
 
   /// Find the the interpolation range
   std::pair<size_t, size_t>
-  findInterpolationRange(API::MatrixWorkspace_const_sptr iwspt,
-                         API::MatrixWorkspace_sptr mwspt, const size_t row);
+  findInterpolationRange(const API::MatrixWorkspace_const_sptr &iwspt,
+                         const API::MatrixWorkspace_sptr &mwspt,
+                         const size_t row);
 
   /// Extrapolates flat for the points outside the x-range
-  void extrapolateFlat(API::MatrixWorkspace_sptr ows,
-                       API::MatrixWorkspace_const_sptr iwspt, const size_t row,
+  void extrapolateFlat(const API::MatrixWorkspace_sptr &ows,
+                       const API::MatrixWorkspace_const_sptr &iwspt,
+                       const size_t row,
                        const std::pair<size_t, size_t> &indices,
                        const bool doDerivs,
                        std::vector<API::MatrixWorkspace_sptr> &derivs) const;
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/SplineSmoothing.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/SplineSmoothing.h
index 044afc59ba7..122244214cc 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/SplineSmoothing.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/SplineSmoothing.h
@@ -87,7 +87,8 @@ private:
                               const double *ysmooth) const;
 
   /// Use an existing fit function to tidy smoothing
-  void performAdditionalFitting(API::MatrixWorkspace_sptr ws, const int row);
+  void performAdditionalFitting(const API::MatrixWorkspace_sptr &ws,
+                                const int row);
 
   /// Converts histogram data to point data later processing
   /// convert a binned workspace to point data. Uses mean of the bins as point
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Constraints/BoundaryConstraint.h b/Framework/CurveFitting/inc/MantidCurveFitting/Constraints/BoundaryConstraint.h
index 06e2bdf7401..5a83c4b628e 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Constraints/BoundaryConstraint.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Constraints/BoundaryConstraint.h
@@ -35,12 +35,12 @@ public:
   BoundaryConstraint(const std::string &paramName);
 
   /// Constructor with boundary arguments
-  BoundaryConstraint(API::IFunction *fun, const std::string paramName,
+  BoundaryConstraint(API::IFunction *fun, const std::string &paramName,
                      const double lowerBound, const double upperBound,
                      bool isDefault = false);
 
   /// Constructor with lower boundary argument
-  BoundaryConstraint(API::IFunction *fun, const std::string paramName,
+  BoundaryConstraint(API::IFunction *fun, const std::string &paramName,
                      const double lowerBound, bool isDefault = false);
 
   /// Initialize the constraint from an expression
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/CostFunctions/CostFuncRwp.h b/Framework/CurveFitting/inc/MantidCurveFitting/CostFunctions/CostFuncRwp.h
index 4b63b8d74e3..044d739a2ee 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/CostFunctions/CostFuncRwp.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/CostFunctions/CostFuncRwp.h
@@ -65,12 +65,12 @@ private:
   getFitWeights(API::FunctionValues_sptr values) const override;
 
   /// Get weight (1/sigma)
-  double getWeight(API::FunctionValues_sptr values, size_t i,
+  double getWeight(const API::FunctionValues_sptr &values, size_t i,
                    double sqrtW = 1.0) const;
 
   /// Calcualte sqrt(W). Final cost function = sum_i [ (obs_i - cal_i) / (sigma
   /// * sqrt(W))]**2
-  double calSqrtW(API::FunctionValues_sptr values) const;
+  double calSqrtW(const API::FunctionValues_sptr &values) const;
 
   friend class CurveFitting::SeqDomain;
   friend class CurveFitting::ParDomain;
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/ChebfunBase.h b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/ChebfunBase.h
index 7e0abc27ffd..29f6560aeef 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/ChebfunBase.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/ChebfunBase.h
@@ -149,7 +149,7 @@ private:
   void calcIntegrationWeights() const;
 
   /// Calculate function values at odd-valued indices of the base x-points
-  std::vector<double> fitOdd(ChebfunFunctionType f,
+  std::vector<double> fitOdd(const ChebfunFunctionType &f,
                              std::vector<double> &p) const;
   /// Calculate function values at odd-valued indices of the base x-points
   std::vector<double> fitOdd(const API::IFunction &f,
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/IkedaCarpenterPV.h b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/IkedaCarpenterPV.h
index fa533e4bd75..4074de02293 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/IkedaCarpenterPV.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/IkedaCarpenterPV.h
@@ -72,7 +72,7 @@ private:
                             double &eta) const;
 
   /// constrain all parameters to be non-negative
-  void lowerConstraint0(std::string paramName);
+  void lowerConstraint0(const std::string &paramName);
 };
 
 } // namespace Functions
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/PawleyFunction.h b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/PawleyFunction.h
index bfa8e696ab8..04a22d80889 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/PawleyFunction.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/PawleyFunction.h
@@ -134,7 +134,7 @@ public:
   PawleyParameterFunction_sptr getPawleyParameterFunction() const;
 
 protected:
-  void setPeakPositions(std::string centreName, double zeroShift,
+  void setPeakPositions(const std::string &centreName, double zeroShift,
                         const Geometry::UnitCell &cell) const;
 
   size_t calculateFunctionValues(const API::IPeakFunction_sptr &peak,
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/ProcessBackground.h b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/ProcessBackground.h
index 84387d058d4..e6c9144c240 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/ProcessBackground.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/ProcessBackground.h
@@ -22,17 +22,18 @@ namespace Functions {
 
 class RemovePeaks {
 public:
-  void setup(DataObjects::TableWorkspace_sptr peaktablews);
+  void setup(const DataObjects::TableWorkspace_sptr &peaktablews);
 
   DataObjects::Workspace2D_sptr
-  removePeaks(API::MatrixWorkspace_const_sptr dataws, int wsindex,
+  removePeaks(const API::MatrixWorkspace_const_sptr &dataws, int wsindex,
               double numfwhm);
 
 private:
   /// Parse peak centre and FWHM from a table workspace
-  void parsePeakTableWorkspace(DataObjects::TableWorkspace_sptr peaktablews,
-                               std::vector<double> &vec_peakcentre,
-                               std::vector<double> &vec_peakfwhm);
+  void
+  parsePeakTableWorkspace(const DataObjects::TableWorkspace_sptr &peaktablews,
+                          std::vector<double> &vec_peakcentre,
+                          std::vector<double> &vec_peakfwhm);
 
   /// Exclude peak regions
   size_t excludePeaks(std::vector<double> v_inX, std::vector<bool> &v_useX,
@@ -83,15 +84,15 @@ private:
 
   /// Select background points automatically
   DataObjects::Workspace2D_sptr
-  autoBackgroundSelection(DataObjects::Workspace2D_sptr bkgdWS);
+  autoBackgroundSelection(const DataObjects::Workspace2D_sptr &bkgdWS);
 
   /// Create a background function from input properties
   BackgroundFunction_sptr
-  createBackgroundFunction(const std::string backgroundtype);
+  createBackgroundFunction(const std::string &backgroundtype);
 
   /// Filter non-background data points out and create a background workspace
   DataObjects::Workspace2D_sptr
-  filterForBackground(BackgroundFunction_sptr bkgdfunction);
+  filterForBackground(const BackgroundFunction_sptr &bkgdfunction);
 
   DataObjects::Workspace2D_const_sptr m_dataWS;
   DataObjects::Workspace2D_sptr m_outputWS;
@@ -119,7 +120,7 @@ private:
   /// Add a certain region from a reference workspace
   void addRegion();
 
-  void fitBackgroundFunction(std::string bkgdfunctiontype);
+  void fitBackgroundFunction(const std::string &bkgdfunctiontype);
 };
 
 } // namespace Functions
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/SimpleChebfun.h b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/SimpleChebfun.h
index 5f7a4a5a543..b8888d9eac2 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/SimpleChebfun.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/SimpleChebfun.h
@@ -25,7 +25,7 @@ public:
   /// Constructor.
   SimpleChebfun(size_t n, const API::IFunction &fun, double start, double end);
   /// Constructor.
-  SimpleChebfun(ChebfunFunctionType fun, double start, double end,
+  SimpleChebfun(const ChebfunFunctionType &fun, double start, double end,
                 double accuracy = 0.0, size_t badSize = 10);
   /// Constructor.
   SimpleChebfun(const API::IFunction &fun, double start, double end,
@@ -67,11 +67,11 @@ public:
   /// Integrate the function on its interval
   double integrate() const;
   /// Add a C++ function to the function
-  SimpleChebfun &operator+=(ChebfunFunctionType fun);
+  SimpleChebfun &operator+=(const ChebfunFunctionType &fun);
 
 private:
   /// Constructor
-  SimpleChebfun(ChebfunBase_sptr base);
+  SimpleChebfun(const ChebfunBase_sptr &base);
   /// Underlying base that does actual job.
   ChebfunBase_sptr m_base;
   /// Function values at the chebfun x-points.
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/ThermalNeutronDtoTOFFunction.h b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/ThermalNeutronDtoTOFFunction.h
index 2b92d63f49a..f9a3e219759 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/ThermalNeutronDtoTOFFunction.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/ThermalNeutronDtoTOFFunction.h
@@ -40,7 +40,7 @@ public:
 
   /// Calculate function values
   void function1D(std::vector<double> &out,
-                  const std::vector<double> xValues) const;
+                  const std::vector<double> &xValues) const;
 
 protected:
   /// overwrite IFunction base class method, which declare function parameters
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/GSLFunctions.h b/Framework/CurveFitting/inc/MantidCurveFitting/GSLFunctions.h
index 7729f450edc..25c64ab8418 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/GSLFunctions.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/GSLFunctions.h
@@ -27,7 +27,7 @@ Various GSL specific functions used GSL specific minimizers
 /// Structure to contain least squares data and used by GSL
 struct GSL_FitData {
   /// Constructor
-  GSL_FitData(boost::shared_ptr<CostFunctions::CostFuncLeastSquares> cf);
+  GSL_FitData(const boost::shared_ptr<CostFunctions::CostFuncLeastSquares> &cf);
   /// Destructor
   ~GSL_FitData();
   /// number of points to be fitted (size of X, Y and sqrtWeightData arrays)
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/IMWDomainCreator.h b/Framework/CurveFitting/inc/MantidCurveFitting/IMWDomainCreator.h
index 52bc6422ba7..fb1fca9f1d1 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/IMWDomainCreator.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/IMWDomainCreator.h
@@ -15,6 +15,7 @@
 
 #include <boost/weak_ptr.hpp>
 #include <list>
+#include <utility>
 
 namespace Mantid {
 namespace API {
@@ -53,7 +54,7 @@ public:
   /// Set the workspace
   /// @param ws :: workspace to set.
   void setWorkspace(boost::shared_ptr<API::MatrixWorkspace> ws) {
-    m_matrixWorkspace = ws;
+    m_matrixWorkspace = std::move(ws);
   }
   /// Set the workspace index
   /// @param wi :: workspace index to set.
@@ -92,7 +93,7 @@ protected:
       const API::IFunction_sptr &function,
       boost::shared_ptr<API::MatrixWorkspace> &ws, const size_t wsIndex,
       const boost::shared_ptr<API::FunctionDomain> &domain,
-      boost::shared_ptr<API::FunctionValues> resultValues) const;
+      const boost::shared_ptr<API::FunctionValues> &resultValues) const;
 
   /// Store workspace property name
   std::string m_workspacePropertyName;
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/SeqDomain.h b/Framework/CurveFitting/inc/MantidCurveFitting/SeqDomain.h
index 8fe95df9b20..7fcffd15485 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/SeqDomain.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/SeqDomain.h
@@ -38,7 +38,7 @@ public:
   virtual void getDomainAndValues(size_t i, API::FunctionDomain_sptr &domain,
                                   API::FunctionValues_sptr &values) const;
   /// Add new domain creator
-  void addCreator(API::IDomainCreator_sptr creator);
+  void addCreator(const API::IDomainCreator_sptr &creator);
   /// Calculate the value of an additive cost function
   virtual void
   additiveCostFunctionVal(const CostFunctions::CostFuncFitting &costFunction);
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/SeqDomainSpectrumCreator.h b/Framework/CurveFitting/inc/MantidCurveFitting/SeqDomainSpectrumCreator.h
index 419c8b1f2d2..4a2d4bcc73c 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/SeqDomainSpectrumCreator.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/SeqDomainSpectrumCreator.h
@@ -49,7 +49,7 @@ public:
 
 protected:
   void setParametersFromPropertyManager();
-  void setMatrixWorkspace(API::MatrixWorkspace_sptr matrixWorkspace);
+  void setMatrixWorkspace(const API::MatrixWorkspace_sptr &matrixWorkspace);
 
   bool histogramIsUsable(size_t i) const;
 
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/TableWorkspaceDomainCreator.h b/Framework/CurveFitting/inc/MantidCurveFitting/TableWorkspaceDomainCreator.h
index b656b1ece05..3cb41d15326 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/TableWorkspaceDomainCreator.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/TableWorkspaceDomainCreator.h
@@ -16,6 +16,7 @@
 
 #include <boost/weak_ptr.hpp>
 #include <list>
+#include <utility>
 
 namespace Mantid {
 namespace API {
@@ -55,7 +56,9 @@ public:
 
   /// Set the workspace
   /// @param ws :: workspace to set.
-  void setWorkspace(API::ITableWorkspace_sptr ws) { m_tableWorkspace = ws; }
+  void setWorkspace(API::ITableWorkspace_sptr ws) {
+    m_tableWorkspace = std::move(ws);
+  }
   /// Set the startX and endX
   /// @param startX :: Start of the domain
   /// @param endX :: End of the domain
@@ -88,7 +91,7 @@ private:
   /// Set all parameters
   void setParameters() const;
   /// Set the names of the X, Y and Error columns
-  void setXYEColumnNames(API::ITableWorkspace_sptr ws) const;
+  void setXYEColumnNames(const API::ITableWorkspace_sptr &ws) const;
   /// Creates the blank output workspace of the correct size
   boost::shared_ptr<API::MatrixWorkspace>
   createEmptyResultWS(const size_t nhistograms, const size_t nyvalues);
@@ -109,9 +112,9 @@ private:
       const API::IFunction_sptr &function,
       boost::shared_ptr<API::MatrixWorkspace> &ws, const size_t wsIndex,
       const boost::shared_ptr<API::FunctionDomain> &domain,
-      boost::shared_ptr<API::FunctionValues> resultValues) const;
+      const boost::shared_ptr<API::FunctionValues> &resultValues) const;
   /// Check workspace is in the correct form
-  void setAndValidateWorkspace(API::Workspace_sptr ws) const;
+  void setAndValidateWorkspace(const API::Workspace_sptr &ws) const;
 
   /// Store workspace property name
   std::string m_workspacePropertyName;
diff --git a/Framework/CurveFitting/src/Algorithms/ConvolutionFit.cpp b/Framework/CurveFitting/src/Algorithms/ConvolutionFit.cpp
index 922def0043a..0467eb66c25 100644
--- a/Framework/CurveFitting/src/Algorithms/ConvolutionFit.cpp
+++ b/Framework/CurveFitting/src/Algorithms/ConvolutionFit.cpp
@@ -27,16 +27,17 @@
 
 #include <algorithm>
 #include <cmath>
+#include <utility>
 
 namespace {
 using namespace Mantid::API;
 using namespace Mantid::Kernel;
 using Mantid::MantidVec;
 
-std::size_t numberOfFunctions(IFunction_sptr function,
+std::size_t numberOfFunctions(const IFunction_sptr &function,
                               const std::string &functionName);
 
-std::size_t numberOfFunctions(CompositeFunction_sptr composite,
+std::size_t numberOfFunctions(const CompositeFunction_sptr &composite,
                               const std::string &functionName) {
   std::size_t count = 0;
   for (auto i = 0u; i < composite->nFunctions(); ++i)
@@ -44,7 +45,7 @@ std::size_t numberOfFunctions(CompositeFunction_sptr composite,
   return count;
 }
 
-std::size_t numberOfFunctions(IFunction_sptr function,
+std::size_t numberOfFunctions(const IFunction_sptr &function,
                               const std::string &functionName) {
   const auto composite =
       boost::dynamic_pointer_cast<CompositeFunction>(function);
@@ -53,9 +54,10 @@ std::size_t numberOfFunctions(IFunction_sptr function,
   return function->name() == functionName ? 1 : 0;
 }
 
-bool containsFunction(IFunction_sptr function, const std::string &functionName);
+bool containsFunction(const IFunction_sptr &function,
+                      const std::string &functionName);
 
-bool containsFunction(CompositeFunction_sptr composite,
+bool containsFunction(const CompositeFunction_sptr &composite,
                       const std::string &functionName) {
   for (auto i = 0u; i < composite->nFunctions(); ++i) {
     if (containsFunction(composite->getFunction(i), functionName))
@@ -64,7 +66,7 @@ bool containsFunction(CompositeFunction_sptr composite,
   return false;
 }
 
-bool containsFunction(IFunction_sptr function,
+bool containsFunction(const IFunction_sptr &function,
                       const std::string &functionName) {
   const auto composite =
       boost::dynamic_pointer_cast<CompositeFunction>(function);
@@ -125,7 +127,7 @@ std::vector<T, Ts...> squareRootVector(const std::vector<T, Ts...> &vec) {
 
 IFunction_sptr extractFirstBackground(IFunction_sptr function);
 
-IFunction_sptr extractFirstBackground(CompositeFunction_sptr composite) {
+IFunction_sptr extractFirstBackground(const CompositeFunction_sptr &composite) {
   for (auto i = 0u; i < composite->nFunctions(); ++i) {
     auto background = extractFirstBackground(composite->getFunction(i));
     if (background)
@@ -145,7 +147,7 @@ IFunction_sptr extractFirstBackground(IFunction_sptr function) {
 }
 
 std::string extractBackgroundType(IFunction_sptr function) {
-  auto background = extractFirstBackground(function);
+  auto background = extractFirstBackground(std::move(function));
   if (!background)
     return "None";
 
@@ -164,7 +166,7 @@ std::string extractBackgroundType(IFunction_sptr function) {
 
 std::vector<std::size_t>
 searchForFitParameters(const std::string &suffix,
-                       ITableWorkspace_sptr tableWorkspace) {
+                       const ITableWorkspace_sptr &tableWorkspace) {
   auto indices = std::vector<std::size_t>();
 
   for (auto i = 0u; i < tableWorkspace->columnCount(); ++i) {
diff --git a/Framework/CurveFitting/src/Algorithms/EstimatePeakErrors.cpp b/Framework/CurveFitting/src/Algorithms/EstimatePeakErrors.cpp
index bcb3d9f203c..6a877355610 100644
--- a/Framework/CurveFitting/src/Algorithms/EstimatePeakErrors.cpp
+++ b/Framework/CurveFitting/src/Algorithms/EstimatePeakErrors.cpp
@@ -91,7 +91,7 @@ GSLMatrix makeJacobian(IPeakFunction &peak, double &centre, double &height,
 /// @param covariance :: The covariance matrix for the parameters of the peak.
 /// @param prefix :: A prefix for the parameter names.
 void calculatePeakValues(IPeakFunction &peak, ITableWorkspace &results,
-                         const GSLMatrix covariance,
+                         const GSLMatrix &covariance,
                          const std::string &prefix) {
   double centre, height, fwhm, intensity;
   GSLMatrix J = makeJacobian(peak, centre, height, fwhm, intensity);
diff --git a/Framework/CurveFitting/src/Algorithms/FitPowderDiffPeaks.cpp b/Framework/CurveFitting/src/Algorithms/FitPowderDiffPeaks.cpp
index 16f1357a3fe..06bd9665443 100644
--- a/Framework/CurveFitting/src/Algorithms/FitPowderDiffPeaks.cpp
+++ b/Framework/CurveFitting/src/Algorithms/FitPowderDiffPeaks.cpp
@@ -36,6 +36,8 @@
 #include <fstream>
 
 #include <cmath>
+#include <utility>
+
 #include <gsl/gsl_sf_erf.h>
 
 /// Factor on FWHM for fitting a peak
@@ -520,11 +522,10 @@ void FitPowderDiffPeaks::fitPeaksRobust() {
 /** Observe peak range with hint from right peak's properties
  * Assumption: the background is reasonably flat within peak range
  */
-void FitPowderDiffPeaks::observePeakRange(BackToBackExponential_sptr thispeak,
-                                          BackToBackExponential_sptr rightpeak,
-                                          double refpeakshift,
-                                          double &peakleftbound,
-                                          double &peakrightbound) {
+void FitPowderDiffPeaks::observePeakRange(
+    const BackToBackExponential_sptr &thispeak,
+    const BackToBackExponential_sptr &rightpeak, double refpeakshift,
+    double &peakleftbound, double &peakrightbound) {
   double predictcentre = thispeak->centre();
   double rightfwhm = rightpeak->fwhm();
 
@@ -607,9 +608,10 @@ void FitPowderDiffPeaks::observePeakRange(BackToBackExponential_sptr thispeak,
  * Return: chi2 ... all the other parameter should be just in peak
  */
 bool FitPowderDiffPeaks::fitSinglePeakRobust(
-    BackToBackExponential_sptr peak, BackgroundFunction_sptr backgroundfunction,
-    double peakleftbound, double peakrightbound,
-    map<string, double> rightpeakparammap, double &finalchi2) {
+    const BackToBackExponential_sptr &peak,
+    const BackgroundFunction_sptr &backgroundfunction, double peakleftbound,
+    double peakrightbound, const map<string, double> &rightpeakparammap,
+    double &finalchi2) {
   // 1. Build partial workspace
   Workspace2D_sptr peakws =
       buildPartialWorkspace(m_dataWS, m_wsIndex, peakleftbound, peakrightbound);
@@ -836,8 +838,9 @@ bool FitPowderDiffPeaks::fitSinglePeakRobust(
  * Note 1: in a limited range (4*FWHM)
  */
 bool FitPowderDiffPeaks::doFit1PeakBackground(
-    Workspace2D_sptr dataws, size_t wsindex, BackToBackExponential_sptr peak,
-    BackgroundFunction_sptr backgroundfunction, double &chi2) {
+    const Workspace2D_sptr &dataws, size_t wsindex,
+    const BackToBackExponential_sptr &peak,
+    const BackgroundFunction_sptr &backgroundfunction, double &chi2) {
   // 0. Set fit parameters
   string minimzername("Levenberg-MarquardtMD");
   double startx = peak->centre() - 3.0 * peak->fwhm();
@@ -904,7 +907,7 @@ bool FitPowderDiffPeaks::doFit1PeakBackground(
 /** Fit signle peak by Monte Carlo/simulated annealing
  */
 bool FitPowderDiffPeaks::fitSinglePeakSimulatedAnnealing(
-    BackToBackExponential_sptr peak, vector<string> paramtodomc) {
+    const BackToBackExponential_sptr &peak, const vector<string> &paramtodomc) {
   UNUSED_ARG(peak);
   UNUSED_ARG(paramtodomc);
   throw runtime_error("To Be Implemented Soon!");
@@ -1218,8 +1221,9 @@ void FitPowderDiffPeaks::fitPeaksWithGoodStartingValues() {
  * @param annhilatedpeak :: (output) annhilatedpeak
  */
 bool FitPowderDiffPeaks::fitSinglePeakConfident(
-    BackToBackExponential_sptr peak, BackgroundFunction_sptr backgroundfunction,
-    double leftbound, double rightbound, double &chi2, bool &annhilatedpeak) {
+    const BackToBackExponential_sptr &peak,
+    const BackgroundFunction_sptr &backgroundfunction, double leftbound,
+    double rightbound, double &chi2, bool &annhilatedpeak) {
   // 1. Build the partial workspace
   // a) Determine boundary if necessary
   if (leftbound < 0 || leftbound >= peak->centre())
@@ -1518,8 +1522,8 @@ void FitPowderDiffPeaks::calculatePeakFitBoundary(size_t ileftpeak,
  *negative, then no constraint
  */
 std::pair<bool, double>
-FitPowderDiffPeaks::doFitPeak(Workspace2D_sptr dataws,
-                              BackToBackExponential_sptr peakfunction,
+FitPowderDiffPeaks::doFitPeak(const Workspace2D_sptr &dataws,
+                              const BackToBackExponential_sptr &peakfunction,
                               double guessedfwhm) {
   // 1. Set up boundary
   if (guessedfwhm > 0) {
@@ -1624,7 +1628,7 @@ FitPowderDiffPeaks::doFitPeak(Workspace2D_sptr dataws,
 /** Store the function's parameter values to a map
  */
 void FitPowderDiffPeaks::storeFunctionParameters(
-    IFunction_sptr function, std::map<string, double> &parammaps) {
+    const IFunction_sptr &function, std::map<string, double> &parammaps) {
   vector<string> paramnames = function->getParameterNames();
   parammaps.clear();
   for (auto &paramname : paramnames)
@@ -1635,7 +1639,7 @@ void FitPowderDiffPeaks::storeFunctionParameters(
 /** Restore the function's parameter values from a map
  */
 void FitPowderDiffPeaks::restoreFunctionParameters(
-    IFunction_sptr function, map<string, double> parammap) {
+    const IFunction_sptr &function, map<string, double> parammap) {
   vector<string> paramnames = function->getParameterNames();
   for (auto &parname : paramnames) {
     auto miter = parammap.find(parname);
@@ -1658,8 +1662,8 @@ void FitPowderDiffPeaks::restoreFunctionParameters(
  * 2. chi2
  */
 bool FitPowderDiffPeaks::doFit1PeakSimple(
-    Workspace2D_sptr dataws, size_t workspaceindex,
-    BackToBackExponential_sptr peakfunction, string minimzername,
+    const Workspace2D_sptr &dataws, size_t workspaceindex,
+    const BackToBackExponential_sptr &peakfunction, const string &minimzername,
     size_t maxiteration, double &chi2) {
   stringstream dbss;
   dbss << peakfunction->asString() << '\n';
@@ -1728,9 +1732,10 @@ bool FitPowderDiffPeaks::doFit1PeakSimple(
  * @param chi2 :: The chi squared value (output)
  */
 bool FitPowderDiffPeaks::doFit1PeakSequential(
-    Workspace2D_sptr dataws, size_t workspaceindex,
-    BackToBackExponential_sptr peakfunction, vector<string> minimzernames,
-    vector<size_t> maxiterations, vector<double> dampfactors, double &chi2) {
+    const Workspace2D_sptr &dataws, size_t workspaceindex,
+    const BackToBackExponential_sptr &peakfunction,
+    vector<string> minimzernames, vector<size_t> maxiterations,
+    const vector<double> &dampfactors, double &chi2) {
   // 1. Check
   if (minimzernames.size() != maxiterations.size() &&
       minimzernames.size() != dampfactors.size()) {
@@ -1789,11 +1794,10 @@ bool FitPowderDiffPeaks::doFit1PeakSequential(
 //----------------------------------------------------------------------------
 /** Fit background-removed peak by Gaussian
  */
-bool FitPowderDiffPeaks::doFitGaussianPeak(DataObjects::Workspace2D_sptr dataws,
-                                           size_t workspaceindex,
-                                           double in_center, double leftfwhm,
-                                           double rightfwhm, double &center,
-                                           double &sigma, double &height) {
+bool FitPowderDiffPeaks::doFitGaussianPeak(
+    const DataObjects::Workspace2D_sptr &dataws, size_t workspaceindex,
+    double in_center, double leftfwhm, double rightfwhm, double &center,
+    double &sigma, double &height) {
   // 1. Estimate
   const auto &X = dataws->x(workspaceindex);
   const auto &Y = dataws->y(workspaceindex);
@@ -1873,7 +1877,7 @@ bool FitPowderDiffPeaks::doFitGaussianPeak(DataObjects::Workspace2D_sptr dataws,
  */
 bool FitPowderDiffPeaks::fitOverlappedPeaks(
     vector<BackToBackExponential_sptr> peaks,
-    BackgroundFunction_sptr backgroundfunction, double gfwhm) {
+    const BackgroundFunction_sptr &backgroundfunction, double gfwhm) {
   // 1. Sort peak if necessary
   vector<pair<double, BackToBackExponential_sptr>> tofpeakpairs(peaks.size());
   for (size_t i = 0; i < peaks.size(); ++i)
@@ -1951,7 +1955,8 @@ bool FitPowderDiffPeaks::fitOverlappedPeaks(
 /** Fit multiple (overlapped) peaks
  */
 bool FitPowderDiffPeaks::doFitMultiplePeaks(
-    Workspace2D_sptr dataws, size_t wsindex, CompositeFunction_sptr peaksfunc,
+    const Workspace2D_sptr &dataws, size_t wsindex,
+    const CompositeFunction_sptr &peaksfunc,
     vector<BackToBackExponential_sptr> peakfuncs, vector<bool> &vecfitgood,
     vector<double> &vecchi2s) {
   // 0. Pre-debug output
@@ -2062,7 +2067,7 @@ bool FitPowderDiffPeaks::doFitMultiplePeaks(
  * @param peaks :: A vector of instances of BackToBackExponential function
  */
 void FitPowderDiffPeaks::estimatePeakHeightsLeBail(
-    Workspace2D_sptr dataws, size_t wsindex,
+    const Workspace2D_sptr &dataws, size_t wsindex,
     vector<BackToBackExponential_sptr> peaks) {
   // 1. Build data structures
   FunctionDomain1DVector domain(dataws->x(wsindex).rawData());
@@ -2110,7 +2115,7 @@ void FitPowderDiffPeaks::estimatePeakHeightsLeBail(
 /** Set constraints on a group of overlapped peaks for fitting
  */
 void FitPowderDiffPeaks::setOverlappedPeaksConstraints(
-    vector<BackToBackExponential_sptr> peaks) {
+    const vector<BackToBackExponential_sptr> &peaks) {
   for (const auto &thispeak : peaks) {
     // 1. Set constraint on X.
     double fwhm = thispeak->fwhm();
@@ -2128,9 +2133,10 @@ void FitPowderDiffPeaks::setOverlappedPeaksConstraints(
 /** Fit N overlapped peaks in a simple manner
  */
 bool FitPowderDiffPeaks::doFitNPeaksSimple(
-    Workspace2D_sptr dataws, size_t wsindex, CompositeFunction_sptr peaksfunc,
-    vector<BackToBackExponential_sptr> peakfuncs, string minimizername,
-    size_t maxiteration, double &chi2) {
+    const Workspace2D_sptr &dataws, size_t wsindex,
+    const CompositeFunction_sptr &peaksfunc,
+    const vector<BackToBackExponential_sptr> &peakfuncs,
+    const string &minimizername, size_t maxiteration, double &chi2) {
   // 1. Debug output
   stringstream dbss0;
   dbss0 << "Starting Value: ";
@@ -2190,8 +2196,9 @@ bool FitPowderDiffPeaks::doFitNPeaksSimple(
 //----------------------------------------------------------------------------------------------
 /** Parse fit result
  */
-std::string FitPowderDiffPeaks::parseFitResult(API::IAlgorithm_sptr fitalg,
-                                               double &chi2, bool &fitsuccess) {
+std::string
+FitPowderDiffPeaks::parseFitResult(const API::IAlgorithm_sptr &fitalg,
+                                   double &chi2, bool &fitsuccess) {
   stringstream rss;
 
   chi2 = fitalg->getProperty("OutputChi2overDoF");
@@ -2209,7 +2216,7 @@ std::string FitPowderDiffPeaks::parseFitResult(API::IAlgorithm_sptr fitalg,
 /** Parse parameter workspace returned from Fit()
  */
 std::string FitPowderDiffPeaks::parseFitParameterWorkspace(
-    API::ITableWorkspace_sptr paramws) {
+    const API::ITableWorkspace_sptr &paramws) {
   // 1. Check
   if (!paramws) {
     g_log.warning() << "Input table workspace is NULL.  \n";
@@ -2239,7 +2246,7 @@ std::string FitPowderDiffPeaks::parseFitParameterWorkspace(
  * the diffrotometer geometry parameters
  */
 void FitPowderDiffPeaks::importInstrumentParameterFromTable(
-    DataObjects::TableWorkspace_sptr parameterWS) {
+    const DataObjects::TableWorkspace_sptr &parameterWS) {
   // 1. Check column orders
   std::vector<std::string> colnames = parameterWS->getColumnNames();
   if (colnames.size() < 2) {
@@ -2284,7 +2291,7 @@ void FitPowderDiffPeaks::importInstrumentParameterFromTable(
 /** Import Bragg peak table workspace
  */
 void FitPowderDiffPeaks::parseBraggPeakTable(
-    TableWorkspace_sptr peakws, vector<map<string, double>> &parammaps,
+    const TableWorkspace_sptr &peakws, vector<map<string, double>> &parammaps,
     vector<map<string, int>> &hklmaps) {
   // 1. Get columns' types and names
   vector<string> paramnames = peakws->getColumnNames();
@@ -2584,7 +2591,8 @@ FitPowderDiffPeaks::genPeakParametersWorkspace() {
  * Each peak within requirement will put into both (1) m_peaks and (2)
  * m_peaksmap
  */
-void FitPowderDiffPeaks::genPeaksFromTable(TableWorkspace_sptr peakparamws) {
+void FitPowderDiffPeaks::genPeaksFromTable(
+    const TableWorkspace_sptr &peakparamws) {
   // Check and clear input and output
   if (!peakparamws) {
     stringstream errss;
@@ -2729,7 +2737,7 @@ FitPowderDiffPeaks::genPeak(map<string, int> hklmap,
   newpeakptr->initialize();
 
   // Check miller index (HKL) is a valid value in a miller indexes pool (hklmap)
-  good = getHKLFromMap(hklmap, hkl);
+  good = getHKLFromMap(std::move(hklmap), hkl);
   if (!good) {
     // Ignore and return
     return newpeakptr;
@@ -2909,9 +2917,9 @@ FitPowderDiffPeaks::genPeak(map<string, int> hklmap,
  * @param peakfunction: function to plot
  * @param background:   background of the peak
  */
-void FitPowderDiffPeaks::plotFunction(IFunction_sptr peakfunction,
-                                      BackgroundFunction_sptr background,
-                                      FunctionDomain1DVector domain) {
+void FitPowderDiffPeaks::plotFunction(const IFunction_sptr &peakfunction,
+                                      const BackgroundFunction_sptr &background,
+                                      const FunctionDomain1DVector &domain) {
   // 1. Determine range
   const auto &vecX = m_dataWS->x(m_wsIndex);
   double x0 = domain[0];
@@ -3010,7 +3018,7 @@ void FitPowderDiffPeaks::cropWorkspace(double tofmin, double tofmax) {
  * Exception: throw runtime error if there is no such parameter
  * @param parname:  parameter name to get from m_instrumentParameters
  */
-double FitPowderDiffPeaks::getParameter(string parname) {
+double FitPowderDiffPeaks::getParameter(const string &parname) {
   map<string, double>::iterator mapiter;
   mapiter = m_instrumentParmaeters.find(parname);
 
@@ -3033,10 +3041,9 @@ double FitPowderDiffPeaks::getParameter(string parname) {
  * @param leftbound:  lower boundary of the source data
  * @param rightbound: upper boundary of the source data
  */
-Workspace2D_sptr
-FitPowderDiffPeaks::buildPartialWorkspace(API::MatrixWorkspace_sptr sourcews,
-                                          size_t workspaceindex,
-                                          double leftbound, double rightbound) {
+Workspace2D_sptr FitPowderDiffPeaks::buildPartialWorkspace(
+    const API::MatrixWorkspace_sptr &sourcews, size_t workspaceindex,
+    double leftbound, double rightbound) {
   // 1. Check
   const auto &X = sourcews->x(workspaceindex);
   const auto &Y = sourcews->y(workspaceindex);
@@ -3093,7 +3100,7 @@ FitPowderDiffPeaks::buildPartialWorkspace(API::MatrixWorkspace_sptr sourcews,
 /** Get function parameter values information and returned as a string
  * @param function:  function to have information written out
  */
-string getFunctionInfo(IFunction_sptr function) {
+string getFunctionInfo(const IFunction_sptr &function) {
   stringstream outss;
   vector<string> parnames = function->getParameterNames();
   size_t numpars = parnames.size();
@@ -3117,8 +3124,8 @@ string getFunctionInfo(IFunction_sptr function) {
  * @param wsindexpeak: workspace index of spectrum holding pure peak data (with
  * background removed)
  */
-void estimateBackgroundCoarse(DataObjects::Workspace2D_sptr dataws,
-                              BackgroundFunction_sptr background,
+void estimateBackgroundCoarse(const DataObjects::Workspace2D_sptr &dataws,
+                              const BackgroundFunction_sptr &background,
                               size_t wsindexraw, size_t wsindexbkgd,
                               size_t wsindexpeak) {
   // 1. Get prepared
@@ -3192,7 +3199,7 @@ void estimateBackgroundCoarse(DataObjects::Workspace2D_sptr dataws,
  * @param fwhm :: (output) peak FWHM
  * @param errmsg :: (output) error message
  */
-bool observePeakParameters(Workspace2D_sptr dataws, size_t wsindex,
+bool observePeakParameters(const Workspace2D_sptr &dataws, size_t wsindex,
                            double &centre, double &height, double &fwhm,
                            string &errmsg) {
   // 1. Get the value of the Max Height
@@ -3306,7 +3313,7 @@ size_t findMaxValue(const std::vector<double> &Y) {
  * @param rightbound :: upper constraint for check
  * @return the index of the maximum value
  */
-size_t findMaxValue(MatrixWorkspace_sptr dataws, size_t wsindex,
+size_t findMaxValue(const MatrixWorkspace_sptr &dataws, size_t wsindex,
                     double leftbound, double rightbound) {
   const auto &X = dataws->x(wsindex);
   const auto &Y = dataws->y(wsindex);
diff --git a/Framework/CurveFitting/src/Algorithms/IqtFit.cpp b/Framework/CurveFitting/src/Algorithms/IqtFit.cpp
index a07141bd11e..698f4868b3f 100644
--- a/Framework/CurveFitting/src/Algorithms/IqtFit.cpp
+++ b/Framework/CurveFitting/src/Algorithms/IqtFit.cpp
@@ -17,7 +17,7 @@ using namespace Mantid::API;
 namespace {
 Mantid::Kernel::Logger g_log("IqtFit");
 
-MatrixWorkspace_sptr cropWorkspace(MatrixWorkspace_sptr workspace,
+MatrixWorkspace_sptr cropWorkspace(const MatrixWorkspace_sptr &workspace,
                                    double startX, double endX) {
   auto cropper = AlgorithmManager::Instance().create("CropWorkspace");
   cropper->setLogging(false);
@@ -30,7 +30,7 @@ MatrixWorkspace_sptr cropWorkspace(MatrixWorkspace_sptr workspace,
   return cropper->getProperty("OutputWorkspace");
 }
 
-MatrixWorkspace_sptr convertToHistogram(MatrixWorkspace_sptr workspace) {
+MatrixWorkspace_sptr convertToHistogram(const MatrixWorkspace_sptr &workspace) {
   auto converter = AlgorithmManager::Instance().create("ConvertToHistogram");
   converter->setLogging(false);
   converter->setAlwaysStoreInADS(false);
@@ -43,8 +43,8 @@ MatrixWorkspace_sptr convertToHistogram(MatrixWorkspace_sptr workspace) {
 struct HistogramConverter {
   explicit HistogramConverter() : m_converted() {}
 
-  MatrixWorkspace_sptr operator()(MatrixWorkspace_sptr workspace, double startX,
-                                  double endX) const {
+  MatrixWorkspace_sptr operator()(const MatrixWorkspace_sptr &workspace,
+                                  double startX, double endX) const {
     auto it = m_converted.find(workspace.get());
     if (it != m_converted.end())
       return it->second;
diff --git a/Framework/CurveFitting/src/Algorithms/LeBailFit.cpp b/Framework/CurveFitting/src/Algorithms/LeBailFit.cpp
index e793fecd3a4..38b2f5b3f91 100644
--- a/Framework/CurveFitting/src/Algorithms/LeBailFit.cpp
+++ b/Framework/CurveFitting/src/Algorithms/LeBailFit.cpp
@@ -763,7 +763,8 @@ void LeBailFit::createLeBailFunction() {
  * @param wsindex: workspace index of the data to fit against
  */
 API::MatrixWorkspace_sptr
-LeBailFit::cropWorkspace(API::MatrixWorkspace_sptr inpws, size_t wsindex) {
+LeBailFit::cropWorkspace(const API::MatrixWorkspace_sptr &inpws,
+                         size_t wsindex) {
   // Process input property 'FitRegion' for range of data to fit/calculate
   std::vector<double> fitrange = this->getProperty("FitRegion");
 
@@ -1143,9 +1144,9 @@ void LeBailFit::parseBraggPeaksParametersTable() {
 /** Parse table workspace (from Fit()) containing background parameters to a
  * vector
  */
-void LeBailFit::parseBackgroundTableWorkspace(TableWorkspace_sptr bkgdparamws,
-                                              vector<string> &bkgdparnames,
-                                              vector<double> &bkgdorderparams) {
+void LeBailFit::parseBackgroundTableWorkspace(
+    const TableWorkspace_sptr &bkgdparamws, vector<string> &bkgdparnames,
+    vector<double> &bkgdorderparams) {
   g_log.debug() << "DB1105A Parsing background TableWorkspace.\n";
 
   // Clear (output) map
@@ -1746,7 +1747,7 @@ void LeBailFit::doMarkovChain(
  * @param tablews :: TableWorkspace containing the Monte Carlo setup
  */
 void LeBailFit::setupRandomWalkStrategyFromTable(
-    DataObjects::TableWorkspace_sptr tablews) {
+    const DataObjects::TableWorkspace_sptr &tablews) {
   g_log.information("Set up random walk strategy from table.");
 
   // Scan the table
@@ -1941,7 +1942,7 @@ void LeBailFit::setupBuiltInRandomWalkStrategy() {
  *list
  */
 void LeBailFit::addParameterToMCMinimize(vector<string> &parnamesforMC,
-                                         string parname) {
+                                         const string &parname) {
   map<string, Parameter>::iterator pariter;
   pariter = m_funcParameters.find(parname);
   if (pariter == m_funcParameters.end()) {
@@ -2094,7 +2095,7 @@ bool LeBailFit::calculateDiffractionPattern(const HistogramX &vecX,
  *proposed new values in
  *         this group
  */
-bool LeBailFit::proposeNewValues(vector<string> mcgroup, Rfactor r,
+bool LeBailFit::proposeNewValues(const vector<string> &mcgroup, Rfactor r,
                                  map<string, Parameter> &curparammap,
                                  map<string, Parameter> &newparammap,
                                  bool prevBetterRwp) {
@@ -2414,7 +2415,7 @@ LeBailFit::convertToDoubleMap(std::map<std::string, Parameter> &inmap) {
 /** Write a set of (XY) data to a column file
  */
 void writeRfactorsToFile(vector<double> vecX, vector<Rfactor> vecR,
-                         string filename) {
+                         const string &filename) {
   ofstream ofile;
   ofile.open(filename.c_str());
 
diff --git a/Framework/CurveFitting/src/Algorithms/LeBailFunction.cpp b/Framework/CurveFitting/src/Algorithms/LeBailFunction.cpp
index 8f87924d8e5..8488fa54907 100644
--- a/Framework/CurveFitting/src/Algorithms/LeBailFunction.cpp
+++ b/Framework/CurveFitting/src/Algorithms/LeBailFunction.cpp
@@ -14,6 +14,7 @@
 #include "MantidKernel/System.h"
 
 #include <sstream>
+#include <utility>
 
 #include <gsl/gsl_sf_erf.h>
 
@@ -42,7 +43,7 @@ Kernel::Logger g_log("LeBailFunction");
 //----------------------------------------------------------------------------------------------
 /** Constructor
  */
-LeBailFunction::LeBailFunction(std::string peaktype) {
+LeBailFunction::LeBailFunction(const std::string &peaktype) {
   // Set initial values to some class variables
   CompositeFunction_sptr m_function(new CompositeFunction());
   m_compsiteFunction = m_function;
@@ -169,7 +170,7 @@ HistogramY LeBailFunction::calPeak(size_t ipk,
 /** Check whether a parameter is a profile parameter
  * @param paramname :: parameter name to check with
  */
-bool LeBailFunction::hasProfileParameter(std::string paramname) {
+bool LeBailFunction::hasProfileParameter(const std::string &paramname) {
   auto fiter = lower_bound(m_orderedProfileParameterNames.cbegin(),
                            m_orderedProfileParameterNames.cend(), paramname);
 
@@ -619,8 +620,8 @@ bool LeBailFunction::calculateGroupPeakIntensities(
  * @param peakheight: height of the peak
  * @param setpeakheight:  boolean as the option to set peak height or not.
  */
-void LeBailFunction::setPeakParameters(IPowderDiffPeakFunction_sptr peak,
-                                       map<string, double> parammap,
+void LeBailFunction::setPeakParameters(const IPowderDiffPeakFunction_sptr &peak,
+                                       const map<string, double> &parammap,
                                        double peakheight, bool setpeakheight) {
   UNUSED_ARG(peak);
   UNUSED_ARG(parammap);
@@ -855,7 +856,7 @@ void LeBailFunction::groupPeaks(
  * @param endx :: background's EndX.  Used by Chebyshev
  */
 void LeBailFunction::addBackgroundFunction(
-    string backgroundtype, const unsigned int &order,
+    const string &backgroundtype, const unsigned int &order,
     const std::vector<std::string> &vecparnames,
     const std::vector<double> &vecparvalues, double startx, double endx) {
   // Check
@@ -911,8 +912,8 @@ void LeBailFunction::addBackgroundFunction(
  * @param minvalue :: lower boundary
  * @param maxvalue :: upper boundary
  */
-void LeBailFunction::setFitProfileParameter(string paramname, double minvalue,
-                                            double maxvalue) {
+void LeBailFunction::setFitProfileParameter(const string &paramname,
+                                            double minvalue, double maxvalue) {
   // Make ties in composition function
   for (size_t ipk = 1; ipk < m_numPeaks; ++ipk) {
     stringstream ss1, ss2;
@@ -939,7 +940,8 @@ void LeBailFunction::setFitProfileParameter(string paramname, double minvalue,
  * @param paramname :: name of parameter
  * @param paramvalue :: value of parameter to be fixed to
  */
-void LeBailFunction::fixPeakParameter(string paramname, double paramvalue) {
+void LeBailFunction::fixPeakParameter(const string &paramname,
+                                      double paramvalue) {
   for (size_t ipk = 0; ipk < m_numPeaks; ++ipk) {
     stringstream ss1, ss2;
     ss1 << "f" << ipk << "." << paramname;
@@ -987,7 +989,7 @@ void LeBailFunction::setFixPeakHeights() {
 /** Reset all peaks' height
  * @param inheights :: list of peak heights corresponding to each peak
  */
-void LeBailFunction::setPeakHeights(std::vector<double> inheights) {
+void LeBailFunction::setPeakHeights(const std::vector<double> &inheights) {
   UNUSED_ARG(inheights);
   throw runtime_error("It is not implemented properly.");
   /*
@@ -1026,7 +1028,7 @@ IPowderDiffPeakFunction_sptr LeBailFunction::getPeak(size_t peakindex) {
 /** Get value of one specific peak's parameter
  */
 double LeBailFunction::getPeakParameter(std::vector<int> hkl,
-                                        std::string parname) const {
+                                        const std::string &parname) const {
   // Search peak in map
   map<vector<int>, IPowderDiffPeakFunction_sptr>::const_iterator fiter;
   fiter = m_mapHKLPeak.find(hkl);
@@ -1040,7 +1042,7 @@ double LeBailFunction::getPeakParameter(std::vector<int> hkl,
 
   IPowderDiffPeakFunction_sptr peak = fiter->second;
 
-  double parvalue = getPeakParameterValue(peak, parname);
+  double parvalue = getPeakParameterValue(peak, std::move(parname));
 
   return parvalue;
 }
@@ -1049,7 +1051,7 @@ double LeBailFunction::getPeakParameter(std::vector<int> hkl,
 /** Get value of one specific peak's parameter
  */
 double LeBailFunction::getPeakParameter(size_t index,
-                                        std::string parname) const {
+                                        const std::string &parname) const {
   if (index >= m_numPeaks) {
     stringstream errss;
     errss << "getPeakParameter() tries to reach a peak with index " << index
@@ -1060,7 +1062,7 @@ double LeBailFunction::getPeakParameter(size_t index,
   }
 
   IPowderDiffPeakFunction_sptr peak = m_vecPeaks[index];
-  double value = getPeakParameterValue(peak, parname);
+  double value = getPeakParameterValue(peak, std::move(parname));
 
   return value;
 }
@@ -1070,9 +1072,9 @@ double LeBailFunction::getPeakParameter(size_t index,
  * @param peak :: shared pointer to peak function
  * @param parname :: name of the peak parameter
  */
-double
-LeBailFunction::getPeakParameterValue(API::IPowderDiffPeakFunction_sptr peak,
-                                      std::string parname) const {
+double LeBailFunction::getPeakParameterValue(
+    const API::IPowderDiffPeakFunction_sptr &peak,
+    const std::string &parname) const {
   // Locate the category of the parameter name
   auto vsiter = lower_bound(m_orderedProfileParameterNames.cbegin(),
                             m_orderedProfileParameterNames.cend(), parname);
diff --git a/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValue.cpp b/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValue.cpp
index 844d1b3418a..d051738dae1 100644
--- a/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValue.cpp
+++ b/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValue.cpp
@@ -431,7 +431,7 @@ boost::shared_ptr<Algorithm> PlotPeakByLogValue::runSingleFit(
   return fit;
 }
 
-double PlotPeakByLogValue::calculateLogValue(std::string logName,
+double PlotPeakByLogValue::calculateLogValue(const std::string &logName,
                                              const InputSpectraToFit &data) {
   double logValue = 0;
   if (logName.empty() || logName == "axis-1") {
@@ -457,7 +457,7 @@ double PlotPeakByLogValue::calculateLogValue(std::string logName,
   return logValue;
 }
 
-void PlotPeakByLogValue::setWorkspaceIndexAttribute(IFunction_sptr fun,
+void PlotPeakByLogValue::setWorkspaceIndexAttribute(const IFunction_sptr &fun,
                                                     int wsIndex) const {
   const std::string attName = "WorkspaceIndex";
   if (fun->hasAttribute(attName)) {
diff --git a/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValueHelper.cpp b/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValueHelper.cpp
index d6c2bfa8721..3e92ea95565 100644
--- a/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValueHelper.cpp
+++ b/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValueHelper.cpp
@@ -85,8 +85,8 @@ void addMatrixworkspace(
     const boost::optional<API::Workspace_sptr> &workspaceOptional,
     const boost::shared_ptr<API::MatrixWorkspace> &wsMatrix);
 /// Create a list of input workspace names
-std::vector<InputSpectraToFit> makeNames(std::string inputList, int default_wi,
-                                         int default_spec) {
+std::vector<InputSpectraToFit> makeNames(const std::string &inputList,
+                                         int default_wi, int default_spec) {
   std::vector<InputSpectraToFit> nameList;
 
   double start = 0;
diff --git a/Framework/CurveFitting/src/Algorithms/QENSFitSequential.cpp b/Framework/CurveFitting/src/Algorithms/QENSFitSequential.cpp
index dee0ebc28b1..2e901f05f84 100644
--- a/Framework/CurveFitting/src/Algorithms/QENSFitSequential.cpp
+++ b/Framework/CurveFitting/src/Algorithms/QENSFitSequential.cpp
@@ -24,6 +24,7 @@
 #include <sstream>
 #include <stdexcept>
 #include <unordered_map>
+#include <utility>
 
 namespace {
 using namespace Mantid::API;
@@ -39,8 +40,9 @@ MatrixWorkspace_sptr getADSMatrixWorkspace(const std::string &workspaceName) {
       workspaceName);
 }
 
-MatrixWorkspace_sptr convertSpectrumAxis(MatrixWorkspace_sptr inputWorkspace,
-                                         const std::string &outputName) {
+MatrixWorkspace_sptr
+convertSpectrumAxis(const MatrixWorkspace_sptr &inputWorkspace,
+                    const std::string &outputName) {
   auto convSpec = AlgorithmManager::Instance().create("ConvertSpectrumAxis");
   convSpec->setLogging(false);
   convSpec->setProperty("InputWorkspace", inputWorkspace);
@@ -53,16 +55,16 @@ MatrixWorkspace_sptr convertSpectrumAxis(MatrixWorkspace_sptr inputWorkspace,
   return getADSMatrixWorkspace(outputName);
 }
 
-MatrixWorkspace_sptr cloneWorkspace(MatrixWorkspace_sptr inputWorkspace,
+MatrixWorkspace_sptr cloneWorkspace(const MatrixWorkspace_sptr &inputWorkspace,
                                     const std::string &outputName) {
   Workspace_sptr workspace = inputWorkspace->clone();
   AnalysisDataService::Instance().addOrReplace(outputName, workspace);
   return boost::dynamic_pointer_cast<MatrixWorkspace>(workspace);
 }
 
-MatrixWorkspace_sptr convertToElasticQ(MatrixWorkspace_sptr inputWorkspace,
-                                       const std::string &outputName,
-                                       bool doThrow) {
+MatrixWorkspace_sptr
+convertToElasticQ(const MatrixWorkspace_sptr &inputWorkspace,
+                  const std::string &outputName, bool doThrow) {
   auto axis = inputWorkspace->getAxis(1);
   if (axis->isSpectra())
     return convertSpectrumAxis(inputWorkspace, outputName);
@@ -80,8 +82,8 @@ struct ElasticQAppender {
   explicit ElasticQAppender(std::vector<MatrixWorkspace_sptr> &elasticInput)
       : m_elasticInput(elasticInput), m_converted() {}
 
-  void operator()(MatrixWorkspace_sptr workspace, const std::string &outputBase,
-                  bool doThrow) {
+  void operator()(const MatrixWorkspace_sptr &workspace,
+                  const std::string &outputBase, bool doThrow) {
     auto it = m_converted.find(workspace.get());
     if (it != m_converted.end())
       m_elasticInput.emplace_back(it->second);
@@ -111,13 +113,13 @@ convertToElasticQ(const std::vector<MatrixWorkspace_sptr> &workspaces,
   return elasticInput;
 }
 
-void extractFunctionNames(CompositeFunction_sptr composite,
+void extractFunctionNames(const CompositeFunction_sptr &composite,
                           std::vector<std::string> &names) {
   for (auto i = 0u; i < composite->nFunctions(); ++i)
     names.emplace_back(composite->getFunction(i)->name());
 }
 
-void extractFunctionNames(IFunction_sptr function,
+void extractFunctionNames(const IFunction_sptr &function,
                           std::vector<std::string> &names) {
   auto composite = boost::dynamic_pointer_cast<CompositeFunction>(function);
   if (composite)
@@ -126,16 +128,16 @@ void extractFunctionNames(IFunction_sptr function,
     names.emplace_back(function->name());
 }
 
-void extractConvolvedNames(IFunction_sptr function,
+void extractConvolvedNames(const IFunction_sptr &function,
                            std::vector<std::string> &names);
 
-void extractConvolvedNames(CompositeFunction_sptr composite,
+void extractConvolvedNames(const CompositeFunction_sptr &composite,
                            std::vector<std::string> &names) {
   for (auto i = 0u; i < composite->nFunctions(); ++i)
     extractConvolvedNames(composite->getFunction(i), names);
 }
 
-void extractConvolvedNames(IFunction_sptr function,
+void extractConvolvedNames(const IFunction_sptr &function,
                            std::vector<std::string> &names) {
   auto composite = boost::dynamic_pointer_cast<CompositeFunction>(function);
   if (composite) {
@@ -147,8 +149,8 @@ void extractConvolvedNames(IFunction_sptr function,
   }
 }
 
-std::string constructInputString(MatrixWorkspace_sptr workspace, int specMin,
-                                 int specMax) {
+std::string constructInputString(const MatrixWorkspace_sptr &workspace,
+                                 int specMin, int specMax) {
   std::ostringstream input;
   for (auto i = specMin; i < specMax + 1; ++i)
     input << workspace->getName() << ",i" << std::to_string(i) << ";";
@@ -204,14 +206,16 @@ replaceWorkspaces(const std::string &input,
   return newInput.str();
 }
 
-void renameWorkspace(IAlgorithm_sptr renamer, Workspace_sptr workspace,
+void renameWorkspace(const IAlgorithm_sptr &renamer,
+                     const Workspace_sptr &workspace,
                      const std::string &newName) {
   renamer->setProperty("InputWorkspace", workspace);
   renamer->setProperty("OutputWorkspace", newName);
   renamer->executeAsChildAlg();
 }
 
-void deleteTemporaries(IAlgorithm_sptr deleter, const std::string &base) {
+void deleteTemporaries(const IAlgorithm_sptr &deleter,
+                       const std::string &base) {
   auto name = base + std::to_string(1);
   std::size_t i = 2;
 
@@ -234,8 +238,8 @@ bool containsMultipleData(const std::vector<MatrixWorkspace_sptr> &workspaces) {
 }
 
 template <typename F, typename Renamer>
-void renameWorkspacesWith(WorkspaceGroup_sptr groupWorkspace, F const &getName,
-                          Renamer const &renamer) {
+void renameWorkspacesWith(const WorkspaceGroup_sptr &groupWorkspace,
+                          F const &getName, Renamer const &renamer) {
   std::unordered_map<std::string, std::size_t> nameCount;
   for (auto i = 0u; i < groupWorkspace->size(); ++i) {
     const auto name = getName(i);
@@ -252,7 +256,7 @@ void renameWorkspacesWith(WorkspaceGroup_sptr groupWorkspace, F const &getName,
 
 template <typename F>
 void renameWorkspacesInQENSFit(Algorithm *qensFit,
-                               IAlgorithm_sptr renameAlgorithm,
+                               const IAlgorithm_sptr &renameAlgorithm,
                                WorkspaceGroup_sptr outputGroup,
                                std::string const &outputBaseName,
                                std::string const &groupSuffix,
@@ -264,8 +268,8 @@ void renameWorkspacesInQENSFit(Algorithm *qensFit,
     return outputBaseName + "_" + getNameSuffix(i);
   };
 
-  auto renamer = [&](Workspace_sptr workspace, const std::string &name) {
-    renameWorkspace(renameAlgorithm, workspace, name);
+  auto renamer = [&](const Workspace_sptr &workspace, const std::string &name) {
+    renameWorkspace(renameAlgorithm, std::move(workspace), name);
     renamerProg.report("Renamed workspace in group.");
   };
   renameWorkspacesWith(outputGroup, getName, renamer);
@@ -595,12 +599,14 @@ QENSFitSequential::getAdditionalLogNumbers() const {
   return logs;
 }
 
-void QENSFitSequential::addAdditionalLogs(WorkspaceGroup_sptr resultWorkspace) {
+void QENSFitSequential::addAdditionalLogs(
+    const WorkspaceGroup_sptr &resultWorkspace) {
   for (const auto &workspace : *resultWorkspace)
     addAdditionalLogs(workspace);
 }
 
-void QENSFitSequential::addAdditionalLogs(Workspace_sptr resultWorkspace) {
+void QENSFitSequential::addAdditionalLogs(
+    const Workspace_sptr &resultWorkspace) {
   auto logAdder = createChildAlgorithm("AddSampleLog", -1.0, -1.0, false);
   logAdder->setProperty("Workspace", resultWorkspace);
 
@@ -679,7 +685,7 @@ std::vector<std::size_t> QENSFitSequential::getDatasetGrouping(
 }
 
 WorkspaceGroup_sptr QENSFitSequential::processIndirectFitParameters(
-    ITableWorkspace_sptr parameterWorkspace,
+    const ITableWorkspace_sptr &parameterWorkspace,
     const std::vector<std::size_t> &grouping) {
   std::string const columnX = getProperty("LogName");
   std::string const xAxisUnit = getProperty("ResultXAxisUnit");
@@ -709,8 +715,9 @@ void QENSFitSequential::renameWorkspaces(
         inputWorkspaceNames[i] + "_" + spectra[i] + endOfSuffix;
     return workspaceName;
   };
-  return renameWorkspacesInQENSFit(this, rename, outputGroup, outputBaseName,
-                                   endOfSuffix + "s", getNameSuffix);
+  return renameWorkspacesInQENSFit(this, rename, std::move(outputGroup),
+                                   outputBaseName, endOfSuffix + "s",
+                                   getNameSuffix);
 }
 
 void QENSFitSequential::renameWorkspaces(
@@ -718,8 +725,9 @@ void QENSFitSequential::renameWorkspaces(
     std::string const &outputBaseName, std::string const &endOfSuffix) {
   auto rename = createChildAlgorithm("RenameWorkspace", -1.0, -1.0, false);
   auto getNameSuffix = [&](std::size_t i) { return spectra[i] + endOfSuffix; };
-  return renameWorkspacesInQENSFit(this, rename, outputGroup, outputBaseName,
-                                   endOfSuffix + "s", getNameSuffix);
+  return renameWorkspacesInQENSFit(this, rename, std::move(outputGroup),
+                                   outputBaseName, endOfSuffix + "s",
+                                   getNameSuffix);
 }
 
 void QENSFitSequential::renameGroupWorkspace(
@@ -794,28 +802,31 @@ std::vector<MatrixWorkspace_sptr> QENSFitSequential::convertInputToElasticQ(
 }
 
 void QENSFitSequential::extractMembers(
-    WorkspaceGroup_sptr resultGroupWs,
+    const WorkspaceGroup_sptr &resultGroupWs,
     const std::vector<API::MatrixWorkspace_sptr> &workspaces,
     const std::string &outputWsName) {
   std::vector<std::string> workspaceNames;
-  std::transform(
-      workspaces.begin(), workspaces.end(), std::back_inserter(workspaceNames),
-      [](API::MatrixWorkspace_sptr workspace) { return workspace->getName(); });
+  std::transform(workspaces.begin(), workspaces.end(),
+                 std::back_inserter(workspaceNames),
+                 [](const API::MatrixWorkspace_sptr &workspace) {
+                   return workspace->getName();
+                 });
 
-  auto extractAlgorithm = extractMembersAlgorithm(resultGroupWs, outputWsName);
+  auto extractAlgorithm =
+      extractMembersAlgorithm(std::move(resultGroupWs), outputWsName);
   extractAlgorithm->setProperty("InputWorkspaces", workspaceNames);
   extractAlgorithm->execute();
 }
 
 void QENSFitSequential::copyLogs(
-    WorkspaceGroup_sptr resultWorkspaces,
+    const WorkspaceGroup_sptr &resultWorkspaces,
     std::vector<MatrixWorkspace_sptr> const &workspaces) {
   for (auto const &resultWorkspace : *resultWorkspaces)
     copyLogs(resultWorkspace, workspaces);
 }
 
 void QENSFitSequential::copyLogs(
-    Workspace_sptr resultWorkspace,
+    const Workspace_sptr &resultWorkspace,
     std::vector<MatrixWorkspace_sptr> const &workspaces) {
   auto logCopier = createChildAlgorithm("CopyLogs", -1.0, -1.0, false);
   logCopier->setProperty("OutputWorkspace", resultWorkspace->getName());
@@ -826,14 +837,14 @@ void QENSFitSequential::copyLogs(
   }
 }
 
-void QENSFitSequential::copyLogs(MatrixWorkspace_sptr resultWorkspace,
-                                 WorkspaceGroup_sptr resultGroup) {
+void QENSFitSequential::copyLogs(const MatrixWorkspace_sptr &resultWorkspace,
+                                 const WorkspaceGroup_sptr &resultGroup) {
   for (auto const &workspace : *resultGroup)
     copyLogs(resultWorkspace, workspace);
 }
 
-void QENSFitSequential::copyLogs(MatrixWorkspace_sptr resultWorkspace,
-                                 Workspace_sptr resultGroup) {
+void QENSFitSequential::copyLogs(const MatrixWorkspace_sptr &resultWorkspace,
+                                 const Workspace_sptr &resultGroup) {
   auto logCopier = createChildAlgorithm("CopyLogs", -1.0, -1.0, false);
   logCopier->setProperty("InputWorkspace", resultWorkspace);
   logCopier->setProperty("OutputWorkspace", resultGroup->getName());
@@ -841,7 +852,8 @@ void QENSFitSequential::copyLogs(MatrixWorkspace_sptr resultWorkspace,
 }
 
 IAlgorithm_sptr QENSFitSequential::extractMembersAlgorithm(
-    WorkspaceGroup_sptr resultGroupWs, const std::string &outputWsName) const {
+    const WorkspaceGroup_sptr &resultGroupWs,
+    const std::string &outputWsName) const {
   const bool convolved = getProperty("ConvolveMembers");
   std::vector<std::string> convolvedMembers;
   IFunction_sptr function = getProperty("Function");
diff --git a/Framework/CurveFitting/src/Algorithms/QENSFitSimultaneous.cpp b/Framework/CurveFitting/src/Algorithms/QENSFitSimultaneous.cpp
index bf2d04b5dcc..fd6aed132d2 100644
--- a/Framework/CurveFitting/src/Algorithms/QENSFitSimultaneous.cpp
+++ b/Framework/CurveFitting/src/Algorithms/QENSFitSimultaneous.cpp
@@ -24,19 +24,20 @@
 #include "MantidKernel/UnitFactory.h"
 
 #include <boost/algorithm/string/join.hpp>
+#include <utility>
 
 namespace {
 Mantid::Kernel::Logger g_log("QENSFit");
 
 using namespace Mantid::API;
 
-void extractFunctionNames(CompositeFunction_sptr composite,
+void extractFunctionNames(const CompositeFunction_sptr &composite,
                           std::vector<std::string> &names) {
   for (auto i = 0u; i < composite->nFunctions(); ++i)
     names.emplace_back(composite->getFunction(i)->name());
 }
 
-void extractFunctionNames(IFunction_sptr function,
+void extractFunctionNames(const IFunction_sptr &function,
                           std::vector<std::string> &names) {
   auto composite = boost::dynamic_pointer_cast<CompositeFunction>(function);
   if (composite)
@@ -45,16 +46,16 @@ void extractFunctionNames(IFunction_sptr function,
     names.emplace_back(function->name());
 }
 
-void extractConvolvedNames(IFunction_sptr function,
+void extractConvolvedNames(const IFunction_sptr &function,
                            std::vector<std::string> &names);
 
-void extractConvolvedNames(CompositeFunction_sptr composite,
+void extractConvolvedNames(const CompositeFunction_sptr &composite,
                            std::vector<std::string> &names) {
   for (auto i = 0u; i < composite->nFunctions(); ++i)
     extractConvolvedNames(composite->getFunction(i), names);
 }
 
-void extractConvolvedNames(IFunction_sptr function,
+void extractConvolvedNames(const IFunction_sptr &function,
                            std::vector<std::string> &names) {
   auto composite = boost::dynamic_pointer_cast<CompositeFunction>(function);
   if (composite) {
@@ -66,7 +67,8 @@ void extractConvolvedNames(IFunction_sptr function,
   }
 }
 
-MatrixWorkspace_sptr convertSpectrumAxis(MatrixWorkspace_sptr inputWorkspace) {
+MatrixWorkspace_sptr
+convertSpectrumAxis(const MatrixWorkspace_sptr &inputWorkspace) {
   auto convSpec = AlgorithmManager::Instance().create("ConvertSpectrumAxis");
   convSpec->setLogging(false);
   convSpec->setChild(true);
@@ -78,8 +80,8 @@ MatrixWorkspace_sptr convertSpectrumAxis(MatrixWorkspace_sptr inputWorkspace) {
   return convSpec->getProperty("OutputWorkspace");
 }
 
-MatrixWorkspace_sptr convertToElasticQ(MatrixWorkspace_sptr inputWorkspace,
-                                       bool doThrow) {
+MatrixWorkspace_sptr
+convertToElasticQ(const MatrixWorkspace_sptr &inputWorkspace, bool doThrow) {
   auto axis = inputWorkspace->getAxis(1);
   if (axis->isSpectra())
     return convertSpectrumAxis(inputWorkspace);
@@ -97,7 +99,7 @@ struct ElasticQAppender {
   explicit ElasticQAppender(std::vector<MatrixWorkspace_sptr> &elasticInput)
       : m_elasticInput(elasticInput), m_converted() {}
 
-  void operator()(MatrixWorkspace_sptr workspace, bool doThrow) {
+  void operator()(const MatrixWorkspace_sptr &workspace, bool doThrow) {
     auto it = m_converted.find(workspace.get());
     if (it != m_converted.end())
       m_elasticInput.emplace_back(it->second);
@@ -130,7 +132,7 @@ std::string shortParameterName(const std::string &longName) {
 }
 
 void setMultiDataProperties(const IAlgorithm &qensFit, IAlgorithm &fit,
-                            MatrixWorkspace_sptr workspace,
+                            const MatrixWorkspace_sptr &workspace,
                             const std::string &suffix) {
   fit.setProperty("InputWorkspace" + suffix, workspace);
 
@@ -163,7 +165,7 @@ IFunction_sptr convertToSingleDomain(IFunction_sptr function) {
   return function;
 }
 
-WorkspaceGroup_sptr makeGroup(Workspace_sptr workspace) {
+WorkspaceGroup_sptr makeGroup(const Workspace_sptr &workspace) {
   auto group = boost::dynamic_pointer_cast<WorkspaceGroup>(workspace);
   if (group)
     return group;
@@ -172,7 +174,7 @@ WorkspaceGroup_sptr makeGroup(Workspace_sptr workspace) {
   return group;
 }
 
-ITableWorkspace_sptr transposeFitTable(ITableWorkspace_sptr table,
+ITableWorkspace_sptr transposeFitTable(const ITableWorkspace_sptr &table,
                                        const IFunction &function,
                                        const std::string &yAxisType) {
   auto transposed = WorkspaceFactory::Instance().createTable();
@@ -496,7 +498,7 @@ QENSFitSimultaneous::performFit(
 }
 
 WorkspaceGroup_sptr QENSFitSimultaneous::processIndirectFitParameters(
-    ITableWorkspace_sptr parameterWorkspace,
+    const ITableWorkspace_sptr &parameterWorkspace,
     const std::vector<std::size_t> &grouping) {
   std::string const xAxisUnit = getProperty("ResultXAxisUnit");
   auto pifp =
@@ -511,7 +513,7 @@ WorkspaceGroup_sptr QENSFitSimultaneous::processIndirectFitParameters(
 }
 
 void QENSFitSimultaneous::copyLogs(
-    WorkspaceGroup_sptr resultWorkspace,
+    const WorkspaceGroup_sptr &resultWorkspace,
     const std::vector<MatrixWorkspace_sptr> &workspaces) {
   auto logCopier = createChildAlgorithm("CopyLogs", -1.0, -1.0, false);
   for (auto &&result : *resultWorkspace) {
@@ -525,8 +527,8 @@ void QENSFitSimultaneous::copyLogs(
   }
 }
 
-void QENSFitSimultaneous::copyLogs(MatrixWorkspace_sptr resultWorkspace,
-                                   WorkspaceGroup_sptr resultGroup) {
+void QENSFitSimultaneous::copyLogs(const MatrixWorkspace_sptr &resultWorkspace,
+                                   const WorkspaceGroup_sptr &resultGroup) {
   auto logCopier = createChildAlgorithm("CopyLogs", -1.0, -1.0, false);
   logCopier->setProperty("InputWorkspace", resultWorkspace);
 
@@ -539,7 +541,7 @@ void QENSFitSimultaneous::copyLogs(MatrixWorkspace_sptr resultWorkspace,
 }
 
 void QENSFitSimultaneous::extractMembers(
-    WorkspaceGroup_sptr resultGroupWs,
+    const WorkspaceGroup_sptr &resultGroupWs,
     const std::vector<MatrixWorkspace_sptr> &workspaces,
     const std::string &outputWsName) {
   std::vector<std::string> workspaceNames;
@@ -549,7 +551,8 @@ void QENSFitSimultaneous::extractMembers(
     workspaceNames.emplace_back(name);
   }
 
-  auto extractAlgorithm = extractMembersAlgorithm(resultGroupWs, outputWsName);
+  auto extractAlgorithm =
+      extractMembersAlgorithm(std::move(resultGroupWs), outputWsName);
   extractAlgorithm->setProperty("InputWorkspaces", workspaceNames);
   extractAlgorithm->execute();
 
@@ -557,12 +560,14 @@ void QENSFitSimultaneous::extractMembers(
     AnalysisDataService::Instance().remove(workspaceName);
 }
 
-void QENSFitSimultaneous::addAdditionalLogs(API::WorkspaceGroup_sptr group) {
+void QENSFitSimultaneous::addAdditionalLogs(
+    const API::WorkspaceGroup_sptr &group) {
   for (auto &&workspace : *group)
     addAdditionalLogs(workspace);
 }
 
-void QENSFitSimultaneous::addAdditionalLogs(Workspace_sptr resultWorkspace) {
+void QENSFitSimultaneous::addAdditionalLogs(
+    const Workspace_sptr &resultWorkspace) {
   auto logAdder = createChildAlgorithm("AddSampleLog", -1.0, -1.0, false);
   logAdder->setProperty("Workspace", resultWorkspace);
 
@@ -585,7 +590,8 @@ void QENSFitSimultaneous::addAdditionalLogs(Workspace_sptr resultWorkspace) {
 }
 
 IAlgorithm_sptr QENSFitSimultaneous::extractMembersAlgorithm(
-    WorkspaceGroup_sptr resultGroupWs, const std::string &outputWsName) const {
+    const WorkspaceGroup_sptr &resultGroupWs,
+    const std::string &outputWsName) const {
   const bool convolved = getProperty("ConvolveMembers");
   std::vector<std::string> convolvedMembers;
   IFunction_sptr function = getProperty("Function");
@@ -697,7 +703,7 @@ ITableWorkspace_sptr QENSFitSimultaneous::processParameterTable(
 }
 
 void QENSFitSimultaneous::renameWorkspaces(
-    API::WorkspaceGroup_sptr outputGroup,
+    const API::WorkspaceGroup_sptr &outputGroup,
     std::vector<std::string> const &spectra, std::string const &outputBaseName,
     std::string const &endOfSuffix,
     std::vector<std::string> const &inputWorkspaceNames) {
@@ -707,8 +713,9 @@ void QENSFitSimultaneous::renameWorkspaces(
         inputWorkspaceNames[i] + "_" + spectra[i] + endOfSuffix;
     return workspaceName;
   };
-  return renameWorkspacesInQENSFit(this, rename, outputGroup, outputBaseName,
-                                   endOfSuffix + "s", getNameSuffix);
+  return renameWorkspacesInQENSFit(this, rename, std::move(outputGroup),
+                                   outputBaseName, endOfSuffix + "s",
+                                   getNameSuffix);
 }
 
 } // namespace Algorithms
diff --git a/Framework/CurveFitting/src/Algorithms/QENSFitUtilities.cpp b/Framework/CurveFitting/src/Algorithms/QENSFitUtilities.cpp
index 171b3c5c71a..cee9bf1ef72 100644
--- a/Framework/CurveFitting/src/Algorithms/QENSFitUtilities.cpp
+++ b/Framework/CurveFitting/src/Algorithms/QENSFitUtilities.cpp
@@ -6,11 +6,13 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "MantidCurveFitting/Algorithms/QENSFitUtilities.h"
 #include <unordered_map>
+#include <utility>
+
 namespace Mantid {
 namespace API {
 
 void renameWorkspacesWith(
-    WorkspaceGroup_sptr groupWorkspace,
+    const WorkspaceGroup_sptr &groupWorkspace,
     std::function<std::string(std::size_t)> const &getName,
     std::function<void(Workspace_sptr, const std::string &)> const &renamer) {
   std::unordered_map<std::string, std::size_t> nameCount;
@@ -27,7 +29,8 @@ void renameWorkspacesWith(
   }
 }
 
-void renameWorkspace(IAlgorithm_sptr renamer, Workspace_sptr workspace,
+void renameWorkspace(const IAlgorithm_sptr &renamer,
+                     const Workspace_sptr &workspace,
                      const std::string &newName) {
   renamer->setProperty("InputWorkspace", workspace);
   renamer->setProperty("OutputWorkspace", newName);
@@ -43,7 +46,7 @@ bool containsMultipleData(const std::vector<MatrixWorkspace_sptr> &workspaces) {
 
 void renameWorkspacesInQENSFit(
     Algorithm *qensFit, IAlgorithm_sptr renameAlgorithm,
-    WorkspaceGroup_sptr outputGroup, std::string const &outputBaseName,
+    const WorkspaceGroup_sptr &outputGroup, std::string const &outputBaseName,
     std::string const &,
     std::function<std::string(std::size_t)> const &getNameSuffix) {
   Progress renamerProg(qensFit, 0.98, 1.0, outputGroup->size() + 1);
@@ -54,8 +57,8 @@ void renameWorkspacesInQENSFit(
     return name;
   };
 
-  auto renamer = [&](Workspace_sptr workspace, const std::string &name) {
-    renameWorkspace(renameAlgorithm, workspace, name);
+  auto renamer = [&](const Workspace_sptr &workspace, const std::string &name) {
+    renameWorkspace(renameAlgorithm, std::move(workspace), name);
     renamerProg.report("Renamed workspace in group.");
   };
   renameWorkspacesWith(outputGroup, getName, renamer);
diff --git a/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters.cpp b/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters.cpp
index 6fde7cc57b5..4672c0352d7 100644
--- a/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters.cpp
+++ b/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters.cpp
@@ -34,6 +34,7 @@
 
 #include <fstream>
 #include <iomanip>
+#include <utility>
 
 #include <gsl/gsl_sf_erf.h>
 
@@ -383,7 +384,7 @@ void RefinePowderInstrumentParameters::fitInstrumentParameters() {
 
 /** Fit function to data
  */
-bool RefinePowderInstrumentParameters::fitFunction(IFunction_sptr func,
+bool RefinePowderInstrumentParameters::fitFunction(const IFunction_sptr &func,
                                                    double &gslchi2) {
   API::IAlgorithm_sptr fitalg = createChildAlgorithm("Fit", 0.0, 0.2, true);
   fitalg->initialize();
@@ -417,7 +418,8 @@ bool RefinePowderInstrumentParameters::fitFunction(IFunction_sptr func,
 /** Calculate function's statistic
  */
 double RefinePowderInstrumentParameters::calculateFunctionStatistic(
-    IFunction_sptr func, MatrixWorkspace_sptr dataws, size_t workspaceindex) {
+    const IFunction_sptr &func, const MatrixWorkspace_sptr &dataws,
+    size_t workspaceindex) {
   // 1. Fix all parameters of the function
   vector<string> funcparameters = func->getParameterNames();
   size_t numparams = funcparameters.size();
@@ -456,14 +458,15 @@ double RefinePowderInstrumentParameters::calculateFunctionStatistic(
 /** Refine instrument parameters by Monte Carlo method
  */
 void RefinePowderInstrumentParameters::refineInstrumentParametersMC(
-    TableWorkspace_sptr parameterWS, bool fit2) {
+    const TableWorkspace_sptr &parameterWS, bool fit2) {
   // 1. Get function's parameter names
   getD2TOFFuncParamNames(m_PeakFunctionParameterNames);
 
   // 2. Parse parameter (table) workspace
   vector<double> stepsizes, lowerbounds, upperbounds;
-  importMonteCarloParametersFromTable(parameterWS, m_PeakFunctionParameterNames,
-                                      stepsizes, lowerbounds, upperbounds);
+  importMonteCarloParametersFromTable(std::move(parameterWS),
+                                      m_PeakFunctionParameterNames, stepsizes,
+                                      lowerbounds, upperbounds);
 
   stringstream dbss;
   for (size_t i = 0; i < m_PeakFunctionParameterNames.size(); ++i) {
@@ -779,7 +782,7 @@ void RefinePowderInstrumentParameters::getD2TOFFuncParamNames(
 /** Calculate the function
  */
 double RefinePowderInstrumentParameters::calculateD2TOFFunction(
-    API::IFunction_sptr func, API::FunctionDomain1DVector domain,
+    const API::IFunction_sptr &func, const API::FunctionDomain1DVector &domain,
     API::FunctionValues &values, const Mantid::HistogramData::HistogramY &rawY,
     const Mantid::HistogramData::HistogramE &rawE) {
   // 1. Check validity
@@ -814,7 +817,7 @@ double RefinePowderInstrumentParameters::calculateD2TOFFunction(
  * m_Peaks are stored in a map.  (HKL) is the key
  */
 void RefinePowderInstrumentParameters::genPeaksFromTable(
-    DataObjects::TableWorkspace_sptr peakparamws) {
+    const DataObjects::TableWorkspace_sptr &peakparamws) {
   // 1. Check and clear input and output
   if (!peakparamws) {
     g_log.error() << "Input tableworkspace for peak parameters is invalid!\n";
@@ -902,7 +905,7 @@ void RefinePowderInstrumentParameters::genPeaksFromTable(
  * the diffrotometer geometry parameters
  */
 void RefinePowderInstrumentParameters::importParametersFromTable(
-    DataObjects::TableWorkspace_sptr parameterWS,
+    const DataObjects::TableWorkspace_sptr &parameterWS,
     std::map<std::string, double> &parameters) {
   // 1. Check column orders
   std::vector<std::string> colnames = parameterWS->getColumnNames();
@@ -945,7 +948,7 @@ void RefinePowderInstrumentParameters::importParametersFromTable(
  * Arguments
  */
 void RefinePowderInstrumentParameters::importMonteCarloParametersFromTable(
-    TableWorkspace_sptr tablews, vector<string> parameternames,
+    const TableWorkspace_sptr &tablews, const vector<string> &parameternames,
     vector<double> &stepsizes, vector<double> &lowerbounds,
     vector<double> &upperbounds) {
   // 1. Get column information
@@ -1054,7 +1057,8 @@ hkl, double lattice)
 /** Calculate value n for thermal neutron peak profile
  */
 void RefinePowderInstrumentParameters::calculateThermalNeutronSpecial(
-    IFunction_sptr m_Function, const HistogramX &xVals, vector<double> &vec_n) {
+    const IFunction_sptr &m_Function, const HistogramX &xVals,
+    vector<double> &vec_n) {
   if (m_Function->name() != "ThermalNeutronDtoTOFFunction") {
     g_log.warning() << "Function (" << m_Function->name()
                     << " is not ThermalNeutronDtoTOFFunction.  And it is not "
diff --git a/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters3.cpp b/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters3.cpp
index e29bf935259..06e64a0c280 100644
--- a/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters3.cpp
+++ b/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters3.cpp
@@ -13,6 +13,7 @@
 #include "MantidKernel/ListValidator.h"
 
 #include <iomanip>
+#include <utility>
 
 using namespace Mantid::API;
 using namespace Mantid::CurveFitting;
@@ -231,7 +232,7 @@ void RefinePowderInstrumentParameters3::parseTableWorkspaces() {
 /** Parse table workspace to a map of Parameters
  */
 void RefinePowderInstrumentParameters3::parseTableWorkspace(
-    TableWorkspace_sptr tablews, map<string, Parameter> &parammap) {
+    const TableWorkspace_sptr &tablews, map<string, Parameter> &parammap) {
   // 1. Process Table column names
   std::vector<std::string> colnames = tablews->getColumnNames();
   map<string, size_t> colnamedict;
@@ -505,7 +506,7 @@ double RefinePowderInstrumentParameters3::doSimulatedAnnealing(
  * @param newparammap: parameters map containing new/proposed value
  */
 void RefinePowderInstrumentParameters3::proposeNewValues(
-    vector<string> mcgroup, map<string, Parameter> &curparammap,
+    const vector<string> &mcgroup, map<string, Parameter> &curparammap,
     map<string, Parameter> &newparammap, double currchisq) {
   for (const auto &paramname : mcgroup) {
     // random number between -1 and 1
@@ -652,7 +653,7 @@ void RefinePowderInstrumentParameters3::bookKeepMCResult(
   // 2. Record for the best parameters
   if (bestparammap.empty()) {
     // No record yet
-    duplicateParameters(parammap, bestparammap);
+    duplicateParameters(std::move(parammap), bestparammap);
   } else if (recordparameter) {
     // Replace the record
   }
@@ -752,7 +753,7 @@ void RefinePowderInstrumentParameters3::setupRandomWalkStrategy(
  * @param parammap :: parammap
  */
 void RefinePowderInstrumentParameters3::addParameterToMCMinimize(
-    vector<string> &parnamesforMC, string parname,
+    vector<string> &parnamesforMC, const string &parname,
     map<string, Parameter> parammap) {
   map<string, Parameter>::iterator pariter;
   pariter = parammap.find(parname);
@@ -776,7 +777,7 @@ void RefinePowderInstrumentParameters3::addParameterToMCMinimize(
  * Return: chi^2
  */
 double RefinePowderInstrumentParameters3::calculateFunction(
-    map<string, Parameter> parammap, vector<double> &vecY) {
+    const map<string, Parameter> &parammap, vector<double> &vecY) {
   // 1. Implement parameter values to m_positionFunc
   if (!parammap.empty())
     setFunctionParameterValues(m_positionFunc, parammap);
@@ -823,7 +824,8 @@ double calculateFunctionChiSquare(const vector<double> &modelY,
 /** Calculate Chi^2 of the a function with all parameters are fixed
  */
 double RefinePowderInstrumentParameters3::calculateFunctionError(
-    IFunction_sptr function, Workspace2D_sptr dataws, int wsindex) {
+    const IFunction_sptr &function, const Workspace2D_sptr &dataws,
+    int wsindex) {
   // 1. Record the fitting information
   vector<string> parnames = function->getParameterNames();
   vector<bool> vecFix(parnames.size(), false);
@@ -839,8 +841,8 @@ double RefinePowderInstrumentParameters3::calculateFunctionError(
   double chi2;
   string fitstatus;
   const std::string minimizer = "Levenberg-MarquardtMD";
-  bool fitOK =
-      doFitFunction(function, dataws, wsindex, minimizer, 0, chi2, fitstatus);
+  bool fitOK = doFitFunction(function, std::move(dataws), wsindex, minimizer, 0,
+                             chi2, fitstatus);
 
   if (!fitOK) {
     g_log.warning() << "Fit by " << minimizer
@@ -868,10 +870,10 @@ double RefinePowderInstrumentParameters3::calculateFunctionError(
  * Return: double chi2 of the final (best) solution.  If fitting fails, chi2
  *wil be maximum double
  */
-double RefinePowderInstrumentParameters3::fitFunction(IFunction_sptr function,
-                                                      Workspace2D_sptr dataws,
-                                                      int wsindex,
-                                                      bool powerfit) {
+double
+RefinePowderInstrumentParameters3::fitFunction(const IFunction_sptr &function,
+                                               const Workspace2D_sptr &dataws,
+                                               int wsindex, bool powerfit) {
   // 1. Store original
   map<string, pair<double, double>> start_paramvaluemap, paramvaluemap1,
       paramvaluemap2, paramvaluemap3;
@@ -972,8 +974,8 @@ double RefinePowderInstrumentParameters3::fitFunction(IFunction_sptr function,
  * Minimizer: "Levenberg-MarquardtMD"/"Simplex"
  */
 bool RefinePowderInstrumentParameters3::doFitFunction(
-    IFunction_sptr function, Workspace2D_sptr dataws, int wsindex,
-    string minimizer, int numiters, double &chi2, string &fitstatus) {
+    const IFunction_sptr &function, const Workspace2D_sptr &dataws, int wsindex,
+    const string &minimizer, int numiters, double &chi2, string &fitstatus) {
   // 0. Debug output
   stringstream outss;
   outss << "Fit function: " << m_positionFunc->asString()
@@ -1074,7 +1076,8 @@ TableWorkspace_sptr RefinePowderInstrumentParameters3::genOutputProfileTable(
  * @param parvalue:    double, parameter value
  */
 void RefinePowderInstrumentParameters3::addOrReplace(
-    map<string, Parameter> &parameters, string parname, double parvalue) {
+    map<string, Parameter> &parameters, const string &parname,
+    double parvalue) {
   auto pariter = parameters.find(parname);
   if (pariter != parameters.end()) {
     parameters[parname].curvalue = parvalue;
@@ -1090,7 +1093,7 @@ void RefinePowderInstrumentParameters3::addOrReplace(
 /** Construct output
  */
 Workspace2D_sptr RefinePowderInstrumentParameters3::genOutputWorkspace(
-    FunctionDomain1DVector domain, FunctionValues rawvalues) {
+    const FunctionDomain1DVector &domain, const FunctionValues &rawvalues) {
   // 1. Create and set up output workspace
   size_t lenx = m_dataWS->x(m_wsIndex).size();
   size_t leny = m_dataWS->y(m_wsIndex).size();
@@ -1138,7 +1141,7 @@ Workspace2D_sptr RefinePowderInstrumentParameters3::genOutputWorkspace(
 /** Set parameter values to function from Parameter map
  */
 void RefinePowderInstrumentParameters3::setFunctionParameterValues(
-    IFunction_sptr function, map<string, Parameter> params) {
+    const IFunction_sptr &function, map<string, Parameter> params) {
   // 1. Prepare
   vector<string> funparamnames = function->getParameterNames();
 
@@ -1210,7 +1213,7 @@ Parameter>& params)
  * Parameter map
  */
 void RefinePowderInstrumentParameters3::setFunctionParameterFitSetups(
-    IFunction_sptr function, map<string, Parameter> params) {
+    const IFunction_sptr &function, map<string, Parameter> params) {
   // 1. Prepare
   vector<string> funparamnames = m_positionFunc->getParameterNames();
 
@@ -1315,7 +1318,7 @@ void convertToDict(vector<string> strvec, map<string, size_t> &lookupdict) {
 //----------------------------------------------------------------------------------------------
 /** Get the index from lookup dictionary (map)
  */
-int getStringIndex(map<string, size_t> lookupdict, string key) {
+int getStringIndex(map<string, size_t> lookupdict, const string &key) {
   map<string, size_t>::iterator fiter;
   fiter = lookupdict.find(key);
 
@@ -1336,7 +1339,8 @@ int getStringIndex(map<string, size_t> lookupdict, string key) {
 /** Store function parameter values to a map
  */
 void storeFunctionParameterValue(
-    IFunction_sptr function, map<string, pair<double, double>> &parvaluemap) {
+    const IFunction_sptr &function,
+    map<string, pair<double, double>> &parvaluemap) {
   parvaluemap.clear();
 
   vector<string> parnames = function->getParameterNames();
@@ -1354,8 +1358,8 @@ void storeFunctionParameterValue(
  * and a (string, Parameter) map
  */
 void restoreFunctionParameterValue(
-    map<string, pair<double, double>> parvaluemap, IFunction_sptr function,
-    map<string, Parameter> &parammap) {
+    map<string, pair<double, double>> parvaluemap,
+    const IFunction_sptr &function, map<string, Parameter> &parammap) {
   vector<string> parnames = function->getParameterNames();
 
   for (auto &parname : parnames) {
diff --git a/Framework/CurveFitting/src/Algorithms/SplineBackground.cpp b/Framework/CurveFitting/src/Algorithms/SplineBackground.cpp
index d638847df53..df09ed43a17 100644
--- a/Framework/CurveFitting/src/Algorithms/SplineBackground.cpp
+++ b/Framework/CurveFitting/src/Algorithms/SplineBackground.cpp
@@ -247,7 +247,7 @@ void SplineBackground::freeBSplinePointers() {
  * @return:: A shared pointer to the output workspace
  */
 MatrixWorkspace_sptr
-SplineBackground::saveSplineOutput(const API::MatrixWorkspace_sptr ws,
+SplineBackground::saveSplineOutput(const API::MatrixWorkspace_sptr &ws,
                                    const size_t spec) {
   const auto &xInputVals = ws->x(spec);
   const auto &yInputVals = ws->y(spec);
diff --git a/Framework/CurveFitting/src/Algorithms/SplineInterpolation.cpp b/Framework/CurveFitting/src/Algorithms/SplineInterpolation.cpp
index 00b4d7cb584..99c4f26e976 100644
--- a/Framework/CurveFitting/src/Algorithms/SplineInterpolation.cpp
+++ b/Framework/CurveFitting/src/Algorithms/SplineInterpolation.cpp
@@ -258,9 +258,9 @@ void SplineInterpolation::exec() {
  * @param iws :: The input workspace to interpolate
  * @return The pointer to the newly created workspace
  */
-API::MatrixWorkspace_sptr
-SplineInterpolation::setupOutputWorkspace(API::MatrixWorkspace_sptr mws,
-                                          API::MatrixWorkspace_sptr iws) const {
+API::MatrixWorkspace_sptr SplineInterpolation::setupOutputWorkspace(
+    const API::MatrixWorkspace_sptr &mws,
+    const API::MatrixWorkspace_sptr &iws) const {
   const size_t numSpec = iws->getNumberHistograms();
   MatrixWorkspace_sptr outputWorkspace =
       WorkspaceFactory::Instance().create(mws, numSpec);
@@ -300,7 +300,7 @@ SplineInterpolation::convertBinnedData(MatrixWorkspace_sptr workspace) {
  * @param row :: The row of spectra to use
  */
 void SplineInterpolation::setInterpolationPoints(
-    MatrixWorkspace_const_sptr inputWorkspace, const size_t row) const {
+    const MatrixWorkspace_const_sptr &inputWorkspace, const size_t row) const {
   const auto &xIn = inputWorkspace->x(row);
   const auto &yIn = inputWorkspace->y(row);
   const size_t size = xIn.size();
@@ -321,8 +321,9 @@ void SplineInterpolation::setInterpolationPoints(
  * @param order :: The order of derivatives to calculate
  */
 void SplineInterpolation::calculateDerivatives(
-    API::MatrixWorkspace_const_sptr inputWorkspace,
-    API::MatrixWorkspace_sptr outputWorkspace, const size_t order) const {
+    const API::MatrixWorkspace_const_sptr &inputWorkspace,
+    const API::MatrixWorkspace_sptr &outputWorkspace,
+    const size_t order) const {
   // get x and y parameters from workspaces
   const size_t nData = inputWorkspace->y(0).size();
   const double *xValues = &(inputWorkspace->x(0)[0]);
@@ -339,8 +340,8 @@ void SplineInterpolation::calculateDerivatives(
  * @param row :: The row of spectra to use
  */
 void SplineInterpolation::calculateSpline(
-    MatrixWorkspace_const_sptr inputWorkspace,
-    MatrixWorkspace_sptr outputWorkspace, const size_t row) const {
+    const MatrixWorkspace_const_sptr &inputWorkspace,
+    const MatrixWorkspace_sptr &outputWorkspace, const size_t row) const {
   // setup input parameters
   const size_t nData = inputWorkspace->y(0).size();
   const double *xValues = &(inputWorkspace->x(0)[0]);
@@ -360,7 +361,7 @@ void SplineInterpolation::calculateSpline(
  * @param derivs : the vector of derivative workspaces
  */
 void SplineInterpolation::extrapolateFlat(
-    MatrixWorkspace_sptr ows, MatrixWorkspace_const_sptr iwspt,
+    const MatrixWorkspace_sptr &ows, const MatrixWorkspace_const_sptr &iwspt,
     const size_t row, const std::pair<size_t, size_t> &indices,
     const bool doDerivs, std::vector<MatrixWorkspace_sptr> &derivs) const {
 
@@ -393,10 +394,9 @@ void SplineInterpolation::extrapolateFlat(
  * @param row : the workspace index
  * @return : pair of indices for representing the interpolation range
  */
-std::pair<size_t, size_t>
-SplineInterpolation::findInterpolationRange(MatrixWorkspace_const_sptr iwspt,
-                                            MatrixWorkspace_sptr mwspt,
-                                            const size_t row) {
+std::pair<size_t, size_t> SplineInterpolation::findInterpolationRange(
+    const MatrixWorkspace_const_sptr &iwspt, const MatrixWorkspace_sptr &mwspt,
+    const size_t row) {
 
   auto xAxisIn = iwspt->x(row).rawData();
   std::sort(xAxisIn.begin(), xAxisIn.end());
diff --git a/Framework/CurveFitting/src/Algorithms/SplineSmoothing.cpp b/Framework/CurveFitting/src/Algorithms/SplineSmoothing.cpp
index dff88dc8f29..d906ded7b5e 100644
--- a/Framework/CurveFitting/src/Algorithms/SplineSmoothing.cpp
+++ b/Framework/CurveFitting/src/Algorithms/SplineSmoothing.cpp
@@ -158,7 +158,7 @@ void SplineSmoothing::calculateSpectrumDerivatives(const int index,
  * @param ws :: The input workspace
  * @param row :: The row of spectra to use
  */
-void SplineSmoothing::performAdditionalFitting(MatrixWorkspace_sptr ws,
+void SplineSmoothing::performAdditionalFitting(const MatrixWorkspace_sptr &ws,
                                                const int row) {
   // perform additional fitting of the points
   auto fit = createChildAlgorithm("Fit");
diff --git a/Framework/CurveFitting/src/Constraints/BoundaryConstraint.cpp b/Framework/CurveFitting/src/Constraints/BoundaryConstraint.cpp
index 348dd6e25cb..12b3c9ac613 100644
--- a/Framework/CurveFitting/src/Constraints/BoundaryConstraint.cpp
+++ b/Framework/CurveFitting/src/Constraints/BoundaryConstraint.cpp
@@ -51,7 +51,7 @@ BoundaryConstraint::BoundaryConstraint(const std::string &paramName)
  *  a tie or a constraint.
  */
 BoundaryConstraint::BoundaryConstraint(API::IFunction *fun,
-                                       const std::string paramName,
+                                       const std::string &paramName,
                                        const double lowerBound,
                                        const double upperBound, bool isDefault)
     : m_penaltyFactor(getDefaultPenaltyFactor()), m_hasLowerBound(true),
@@ -61,7 +61,7 @@ BoundaryConstraint::BoundaryConstraint(API::IFunction *fun,
 }
 
 BoundaryConstraint::BoundaryConstraint(API::IFunction *fun,
-                                       const std::string paramName,
+                                       const std::string &paramName,
                                        const double lowerBound, bool isDefault)
     : m_penaltyFactor(getDefaultPenaltyFactor()), m_hasLowerBound(true),
       m_hasUpperBound(false), m_lowerBound(lowerBound), m_upperBound(-DBL_MAX) {
diff --git a/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp b/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp
index 07c6a543b7b..6beaae12042 100644
--- a/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp
+++ b/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp
@@ -15,6 +15,7 @@
 
 #include <gsl/gsl_multifit_nlin.h>
 #include <limits>
+#include <utility>
 
 namespace Mantid {
 namespace CurveFitting {
@@ -81,9 +82,9 @@ size_t CostFuncFitting::nParams() const {
 void CostFuncFitting::setFittingFunction(API::IFunction_sptr function,
                                          API::FunctionDomain_sptr domain,
                                          API::FunctionValues_sptr values) {
-  m_function = function;
-  m_domain = domain;
-  m_values = values;
+  m_function = std::move(function);
+  m_domain = std::move(domain);
+  m_values = std::move(values);
   reset();
 }
 
diff --git a/Framework/CurveFitting/src/CostFunctions/CostFuncRwp.cpp b/Framework/CurveFitting/src/CostFunctions/CostFuncRwp.cpp
index 6c090507483..ab616ca25b9 100644
--- a/Framework/CurveFitting/src/CostFunctions/CostFuncRwp.cpp
+++ b/Framework/CurveFitting/src/CostFunctions/CostFuncRwp.cpp
@@ -47,7 +47,7 @@ CostFuncRwp::getFitWeights(API::FunctionValues_sptr values) const {
 //----------------------------------------------------------------------------------------------
 /** Get weight of data point i(1/sigma)
  */
-double CostFuncRwp::getWeight(API::FunctionValues_sptr values, size_t i,
+double CostFuncRwp::getWeight(const API::FunctionValues_sptr &values, size_t i,
                               double sqrtW) const {
   return (values->getFitWeight(i) / sqrtW);
 }
@@ -55,7 +55,7 @@ double CostFuncRwp::getWeight(API::FunctionValues_sptr values, size_t i,
 //----------------------------------------------------------------------------------------------
 /** Get square root of normalization weight (W)
  */
-double CostFuncRwp::calSqrtW(API::FunctionValues_sptr values) const {
+double CostFuncRwp::calSqrtW(const API::FunctionValues_sptr &values) const {
   double weight = 0.0;
 
   // FIXME : This might give a wrong answer in case of multiple-domain
diff --git a/Framework/CurveFitting/src/FunctionDomain1DSpectrumCreator.cpp b/Framework/CurveFitting/src/FunctionDomain1DSpectrumCreator.cpp
index 2db929f6914..8be493174ac 100644
--- a/Framework/CurveFitting/src/FunctionDomain1DSpectrumCreator.cpp
+++ b/Framework/CurveFitting/src/FunctionDomain1DSpectrumCreator.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidCurveFitting/FunctionDomain1DSpectrumCreator.h"
 #include "MantidHistogramData/BinEdges.h"
 #include "MantidHistogramData/Points.h"
@@ -29,7 +31,7 @@ FunctionDomain1DSpectrumCreator::FunctionDomain1DSpectrumCreator()
  */
 void FunctionDomain1DSpectrumCreator::setMatrixWorkspace(
     MatrixWorkspace_sptr matrixWorkspace) {
-  m_matrixWorkspace = matrixWorkspace;
+  m_matrixWorkspace = std::move(matrixWorkspace);
 }
 
 /**
diff --git a/Framework/CurveFitting/src/Functions/ChebfunBase.cpp b/Framework/CurveFitting/src/Functions/ChebfunBase.cpp
index 4b538ddad9e..989655b8989 100644
--- a/Framework/CurveFitting/src/Functions/ChebfunBase.cpp
+++ b/Framework/CurveFitting/src/Functions/ChebfunBase.cpp
@@ -22,6 +22,7 @@
 #include <limits>
 #include <numeric>
 #include <sstream>
+#include <utility>
 
 namespace Mantid {
 namespace CurveFitting {
@@ -465,7 +466,7 @@ ChebfunBase_sptr ChebfunBase::bestFit(double start, double end,
                                       std::vector<double> &p,
                                       std::vector<double> &a, double maxA,
                                       double tolerance, size_t maxSize) {
-  return bestFitTempl(start, end, f, p, a, maxA, tolerance, maxSize);
+  return bestFitTempl(start, end, std::move(f), p, a, maxA, tolerance, maxSize);
 }
 
 /// Template specialization for IFunction
@@ -603,7 +604,7 @@ std::vector<double> ChebfunBase::calcP(const std::vector<double> &a) const {
  */
 std::vector<double> ChebfunBase::fit(ChebfunFunctionType f) const {
   std::vector<double> res(size());
-  std::transform(m_x.begin(), m_x.end(), res.begin(), f);
+  std::transform(m_x.begin(), m_x.end(), res.begin(), std::move(f));
   return res;
 }
 
@@ -626,7 +627,7 @@ std::vector<double> ChebfunBase::fit(const API::IFunction &f) const {
  * @param f :: Function to calculate.
  * @param p :: Values of function f at the even-valued indices of m_x.
  */
-std::vector<double> ChebfunBase::fitOdd(ChebfunFunctionType f,
+std::vector<double> ChebfunBase::fitOdd(const ChebfunFunctionType &f,
                                         std::vector<double> &p) const {
   assert(size() == p.size() * 2 - 1);
   assert(size() % 2 == 1);
diff --git a/Framework/CurveFitting/src/Functions/CrystalFieldFunction.cpp b/Framework/CurveFitting/src/Functions/CrystalFieldFunction.cpp
index e4692b5c892..f1177591bae 100644
--- a/Framework/CurveFitting/src/Functions/CrystalFieldFunction.cpp
+++ b/Framework/CurveFitting/src/Functions/CrystalFieldFunction.cpp
@@ -26,6 +26,7 @@
 #include <boost/optional.hpp>
 #include <boost/regex.hpp>
 #include <limits>
+#include <utility>
 
 namespace Mantid {
 namespace CurveFitting {
@@ -122,7 +123,7 @@ void CrystalFieldFunction::function(const FunctionDomain &domain,
 /// Set the source function
 /// @param source :: New source function.
 void CrystalFieldFunction::setSource(IFunction_sptr source) const {
-  m_source = source;
+  m_source = std::move(source);
 }
 
 size_t CrystalFieldFunction::getNumberDomains() const {
diff --git a/Framework/CurveFitting/src/Functions/CrystalFieldMagnetisation.cpp b/Framework/CurveFitting/src/Functions/CrystalFieldMagnetisation.cpp
index a5d7c242700..6989124844d 100644
--- a/Framework/CurveFitting/src/Functions/CrystalFieldMagnetisation.cpp
+++ b/Framework/CurveFitting/src/Functions/CrystalFieldMagnetisation.cpp
@@ -28,7 +28,7 @@ namespace {
 // Does the actual calculation of the magnetisation
 void calculate(double *out, const double *xValues, const size_t nData,
                const ComplexFortranMatrix &ham, const int nre,
-               const DoubleFortranVector Hmag, const double T,
+               const DoubleFortranVector &Hmag, const double T,
                const double convfact, const bool iscgs) {
   const double beta = 1 / (PhysicalConstants::BoltzmannConstant * T);
   // x-data is the applied field magnitude. We need to recalculate
diff --git a/Framework/CurveFitting/src/Functions/CrystalFieldMoment.cpp b/Framework/CurveFitting/src/Functions/CrystalFieldMoment.cpp
index f18a27668c3..808f0725dc6 100644
--- a/Framework/CurveFitting/src/Functions/CrystalFieldMoment.cpp
+++ b/Framework/CurveFitting/src/Functions/CrystalFieldMoment.cpp
@@ -28,7 +28,7 @@ namespace {
 // Does the actual calculation of the magnetic moment
 void calculate(double *out, const double *xValues, const size_t nData,
                const ComplexFortranMatrix &ham, const int nre,
-               const DoubleFortranVector Hdir, const double Hmag,
+               const DoubleFortranVector &Hdir, const double Hmag,
                const double convfact) {
   const double k_B = PhysicalConstants::BoltzmannConstant;
   DoubleFortranVector en;
diff --git a/Framework/CurveFitting/src/Functions/IkedaCarpenterPV.cpp b/Framework/CurveFitting/src/Functions/IkedaCarpenterPV.cpp
index e6a0bd71e1c..21e693426a7 100644
--- a/Framework/CurveFitting/src/Functions/IkedaCarpenterPV.cpp
+++ b/Framework/CurveFitting/src/Functions/IkedaCarpenterPV.cpp
@@ -128,7 +128,7 @@ void IkedaCarpenterPV::init() {
   this->lowerConstraint0("X0");
 }
 
-void IkedaCarpenterPV::lowerConstraint0(std::string paramName) {
+void IkedaCarpenterPV::lowerConstraint0(const std::string &paramName) {
   auto mixingConstraint =
       std::make_unique<BoundaryConstraint>(this, paramName, 0.0, true);
   mixingConstraint->setPenaltyFactor(1e9);
diff --git a/Framework/CurveFitting/src/Functions/PawleyFunction.cpp b/Framework/CurveFitting/src/Functions/PawleyFunction.cpp
index be54a4e856f..1e86a37b92d 100644
--- a/Framework/CurveFitting/src/Functions/PawleyFunction.cpp
+++ b/Framework/CurveFitting/src/Functions/PawleyFunction.cpp
@@ -405,7 +405,8 @@ double PawleyFunction::getTransformedCenter(double d) const {
   return d;
 }
 
-void PawleyFunction::setPeakPositions(std::string centreName, double zeroShift,
+void PawleyFunction::setPeakPositions(const std::string &centreName,
+                                      double zeroShift,
                                       const UnitCell &cell) const {
   for (size_t i = 0; i < m_hkls.size(); ++i) {
     double centre = getTransformedCenter(cell.d(m_hkls[i]));
diff --git a/Framework/CurveFitting/src/Functions/ProcessBackground.cpp b/Framework/CurveFitting/src/Functions/ProcessBackground.cpp
index bbced88b361..cf4d6c44294 100644
--- a/Framework/CurveFitting/src/Functions/ProcessBackground.cpp
+++ b/Framework/CurveFitting/src/Functions/ProcessBackground.cpp
@@ -22,6 +22,7 @@
 #include <boost/algorithm/string.hpp>
 #include <boost/algorithm/string/predicate.hpp>
 #include <boost/algorithm/string/split.hpp>
+#include <utility>
 
 using namespace Mantid;
 
@@ -583,7 +584,7 @@ void ProcessBackground::selectFromGivenFunction() {
 /** Select background automatically
  */
 DataObjects::Workspace2D_sptr
-ProcessBackground::autoBackgroundSelection(Workspace2D_sptr bkgdWS) {
+ProcessBackground::autoBackgroundSelection(const Workspace2D_sptr &bkgdWS) {
   // Get background type and create bakground function
   BackgroundFunction_sptr bkgdfunction = createBackgroundFunction(m_bkgdType);
 
@@ -649,7 +650,7 @@ ProcessBackground::autoBackgroundSelection(Workspace2D_sptr bkgdWS) {
 /** Create a background function from input properties
  */
 BackgroundFunction_sptr
-ProcessBackground::createBackgroundFunction(const string backgroundtype) {
+ProcessBackground::createBackgroundFunction(const string &backgroundtype) {
   Functions::BackgroundFunction_sptr bkgdfunction;
 
   if (backgroundtype == "Polynomial") {
@@ -679,8 +680,8 @@ ProcessBackground::createBackgroundFunction(const string backgroundtype) {
 //----------------------------------------------------------------------------------------------
 /** Filter non-background data points out and create a background workspace
  */
-Workspace2D_sptr
-ProcessBackground::filterForBackground(BackgroundFunction_sptr bkgdfunction) {
+Workspace2D_sptr ProcessBackground::filterForBackground(
+    const BackgroundFunction_sptr &bkgdfunction) {
   double posnoisetolerance = getProperty("NoiseTolerance");
   double negnoisetolerance = getProperty("NegativeNoiseTolerance");
   if (isEmpty(negnoisetolerance))
@@ -751,7 +752,8 @@ ProcessBackground::filterForBackground(BackgroundFunction_sptr bkgdfunction) {
 //----------------------------------------------------------------------------------------------
 /** Fit background function
  */
-void ProcessBackground::fitBackgroundFunction(std::string bkgdfunctiontype) {
+void ProcessBackground::fitBackgroundFunction(
+    const std::string &bkgdfunctiontype) {
   // Get background type and create bakground function
   BackgroundFunction_sptr bkgdfunction =
       createBackgroundFunction(bkgdfunctiontype);
@@ -884,9 +886,10 @@ void ProcessBackground::removePeaks() {
 //----------------------------------------------------------------------------------------------
 /** Set up: parse peak workspace to vectors
  */
-void RemovePeaks::setup(TableWorkspace_sptr peaktablews) {
+void RemovePeaks::setup(const TableWorkspace_sptr &peaktablews) {
   // Parse table workspace
-  parsePeakTableWorkspace(peaktablews, m_vecPeakCentre, m_vecPeakFWHM);
+  parsePeakTableWorkspace(std::move(peaktablews), m_vecPeakCentre,
+                          m_vecPeakFWHM);
 
   // Check
   if (m_vecPeakCentre.size() != m_vecPeakFWHM.size())
@@ -900,8 +903,8 @@ void RemovePeaks::setup(TableWorkspace_sptr peaktablews) {
 /** Remove peaks from a input workspace
  */
 Workspace2D_sptr
-RemovePeaks::removePeaks(API::MatrixWorkspace_const_sptr dataws, int wsindex,
-                         double numfwhm) {
+RemovePeaks::removePeaks(const API::MatrixWorkspace_const_sptr &dataws,
+                         int wsindex, double numfwhm) {
   // Check
   if (m_vecPeakCentre.empty())
     throw runtime_error("RemovePeaks has not been setup yet. ");
@@ -956,9 +959,9 @@ RemovePeaks::removePeaks(API::MatrixWorkspace_const_sptr dataws, int wsindex,
 //----------------------------------------------------------------------------------------------
 /** Parse table workspace
  */
-void RemovePeaks::parsePeakTableWorkspace(TableWorkspace_sptr peaktablews,
-                                          vector<double> &vec_peakcentre,
-                                          vector<double> &vec_peakfwhm) {
+void RemovePeaks::parsePeakTableWorkspace(
+    const TableWorkspace_sptr &peaktablews, vector<double> &vec_peakcentre,
+    vector<double> &vec_peakfwhm) {
   // Get peak table workspace information
   vector<string> colnames = peaktablews->getColumnNames();
   int index_centre = -1;
diff --git a/Framework/CurveFitting/src/Functions/SimpleChebfun.cpp b/Framework/CurveFitting/src/Functions/SimpleChebfun.cpp
index aad46b07eaa..bb5562a1a12 100644
--- a/Framework/CurveFitting/src/Functions/SimpleChebfun.cpp
+++ b/Framework/CurveFitting/src/Functions/SimpleChebfun.cpp
@@ -8,6 +8,7 @@
 #include "MantidAPI/IFunction.h"
 
 #include <boost/make_shared.hpp>
+#include <utility>
 
 namespace Mantid {
 namespace CurveFitting {
@@ -27,7 +28,7 @@ SimpleChebfun::SimpleChebfun(size_t n, ChebfunFunctionType fun, double start,
                              double end)
     : m_badFit(false) {
   m_base = boost::make_shared<ChebfunBase>(n, start, end);
-  m_P = m_base->fit(fun);
+  m_P = m_base->fit(std::move(fun));
 }
 
 SimpleChebfun::SimpleChebfun(size_t n, const API::IFunction &fun, double start,
@@ -49,8 +50,8 @@ SimpleChebfun::SimpleChebfun(size_t n, const API::IFunction &fun, double start,
 /// @param accuracy :: The accuracy of the approximation.
 /// @param badSize :: If automatic approxiamtion fails the base will have this
 /// size.
-SimpleChebfun::SimpleChebfun(ChebfunFunctionType fun, double start, double end,
-                             double accuracy, size_t badSize)
+SimpleChebfun::SimpleChebfun(const ChebfunFunctionType &fun, double start,
+                             double end, double accuracy, size_t badSize)
     : m_badFit(false) {
   m_base = ChebfunBase::bestFitAnyTolerance<ChebfunFunctionType>(
       start, end, fun, m_P, m_A, accuracy);
@@ -84,7 +85,7 @@ SimpleChebfun::SimpleChebfun(const std::vector<double> &x,
 }
 
 /// Construct an empty SimpleChebfun with shared base.
-SimpleChebfun::SimpleChebfun(ChebfunBase_sptr base) : m_badFit(false) {
+SimpleChebfun::SimpleChebfun(const ChebfunBase_sptr &base) : m_badFit(false) {
   assert(base);
   m_base = base;
   m_P.resize(base->size());
@@ -169,7 +170,7 @@ double SimpleChebfun::integrate() const { return m_base->integrate(m_P); }
 
 /// Add a C++ function to the function
 /// @param fun :: A function to add.
-SimpleChebfun &SimpleChebfun::operator+=(ChebfunFunctionType fun) {
+SimpleChebfun &SimpleChebfun::operator+=(const ChebfunFunctionType &fun) {
   auto &x = xPoints();
   for (size_t i = 0; i < x.size(); ++i) {
     m_P[i] += fun(x[i]);
diff --git a/Framework/CurveFitting/src/Functions/TabulatedFunction.cpp b/Framework/CurveFitting/src/Functions/TabulatedFunction.cpp
index a6a0ad67d47..f4f3d938c5c 100644
--- a/Framework/CurveFitting/src/Functions/TabulatedFunction.cpp
+++ b/Framework/CurveFitting/src/Functions/TabulatedFunction.cpp
@@ -18,6 +18,7 @@
 #include <cmath>
 #include <fstream>
 #include <sstream>
+#include <utility>
 
 namespace Mantid {
 namespace CurveFitting {
@@ -315,7 +316,7 @@ void TabulatedFunction::loadWorkspace(const std::string &wsName) const {
  */
 void TabulatedFunction::loadWorkspace(
     boost::shared_ptr<API::MatrixWorkspace> ws) const {
-  m_workspace = ws;
+  m_workspace = std::move(ws);
   m_setupFinished = false;
 }
 
diff --git a/Framework/CurveFitting/src/Functions/ThermalNeutronDtoTOFFunction.cpp b/Framework/CurveFitting/src/Functions/ThermalNeutronDtoTOFFunction.cpp
index 43e30a119cd..89be09148de 100644
--- a/Framework/CurveFitting/src/Functions/ThermalNeutronDtoTOFFunction.cpp
+++ b/Framework/CurveFitting/src/Functions/ThermalNeutronDtoTOFFunction.cpp
@@ -67,7 +67,7 @@ void ThermalNeutronDtoTOFFunction::function1D(double *out,
  * xValues containing the d-space value of peaks centres
  */
 void ThermalNeutronDtoTOFFunction::function1D(
-    vector<double> &out, const vector<double> xValues) const {
+    vector<double> &out, const vector<double> &xValues) const {
   double dtt1 = getParameter(0);
   double dtt1t = getParameter(1);
   double dtt2t = getParameter(2);
diff --git a/Framework/CurveFitting/src/GSLFunctions.cpp b/Framework/CurveFitting/src/GSLFunctions.cpp
index 9600b1f0df2..cfa30cce795 100644
--- a/Framework/CurveFitting/src/GSLFunctions.cpp
+++ b/Framework/CurveFitting/src/GSLFunctions.cpp
@@ -163,7 +163,7 @@ int gsl_fdf(const gsl_vector *x, void *params, gsl_vector *f, gsl_matrix *J) {
  * @param cf :: ICostFunction
  */
 GSL_FitData::GSL_FitData(
-    boost::shared_ptr<CostFunctions::CostFuncLeastSquares> cf)
+    const boost::shared_ptr<CostFunctions::CostFuncLeastSquares> &cf)
     : function(cf->getFittingFunction()), costFunction(cf) {
   gsl_set_error_handler_off();
   // number of active parameters
diff --git a/Framework/CurveFitting/src/IMWDomainCreator.cpp b/Framework/CurveFitting/src/IMWDomainCreator.cpp
index 710fcddc429..6cbb4304fe0 100644
--- a/Framework/CurveFitting/src/IMWDomainCreator.cpp
+++ b/Framework/CurveFitting/src/IMWDomainCreator.cpp
@@ -409,7 +409,7 @@ void IMWDomainCreator::addFunctionValuesToWS(
     const API::IFunction_sptr &function,
     boost::shared_ptr<API::MatrixWorkspace> &ws, const size_t wsIndex,
     const boost::shared_ptr<API::FunctionDomain> &domain,
-    boost::shared_ptr<API::FunctionValues> resultValues) const {
+    const boost::shared_ptr<API::FunctionValues> &resultValues) const {
   const size_t nData = resultValues->size();
   resultValues->zeroCalculated();
 
diff --git a/Framework/CurveFitting/src/SeqDomain.cpp b/Framework/CurveFitting/src/SeqDomain.cpp
index f7a48a563f7..e5539de7cb2 100644
--- a/Framework/CurveFitting/src/SeqDomain.cpp
+++ b/Framework/CurveFitting/src/SeqDomain.cpp
@@ -50,7 +50,7 @@ void SeqDomain::getDomainAndValues(size_t i, API::FunctionDomain_sptr &domain,
  * Add new domain creator
  * @param creator :: A shared pointer to a new creator.
  */
-void SeqDomain::addCreator(API::IDomainCreator_sptr creator) {
+void SeqDomain::addCreator(const API::IDomainCreator_sptr &creator) {
   m_creators.emplace_back(creator);
   m_domain.emplace_back(API::FunctionDomain_sptr());
   m_values.emplace_back(API::FunctionValues_sptr());
diff --git a/Framework/CurveFitting/src/SeqDomainSpectrumCreator.cpp b/Framework/CurveFitting/src/SeqDomainSpectrumCreator.cpp
index ba7674dd923..e93e0e1bd1a 100644
--- a/Framework/CurveFitting/src/SeqDomainSpectrumCreator.cpp
+++ b/Framework/CurveFitting/src/SeqDomainSpectrumCreator.cpp
@@ -208,7 +208,7 @@ void SeqDomainSpectrumCreator::setParametersFromPropertyManager() {
 
 /// Sets the MatrixWorkspace the created domain is based on.
 void SeqDomainSpectrumCreator::setMatrixWorkspace(
-    MatrixWorkspace_sptr matrixWorkspace) {
+    const MatrixWorkspace_sptr &matrixWorkspace) {
   if (!matrixWorkspace) {
     throw std::invalid_argument(
         "InputWorkspace must be a valid MatrixWorkspace.");
diff --git a/Framework/CurveFitting/src/TableWorkspaceDomainCreator.cpp b/Framework/CurveFitting/src/TableWorkspaceDomainCreator.cpp
index ee80a475e4a..d419d2f76fb 100644
--- a/Framework/CurveFitting/src/TableWorkspaceDomainCreator.cpp
+++ b/Framework/CurveFitting/src/TableWorkspaceDomainCreator.cpp
@@ -461,7 +461,7 @@ void TableWorkspaceDomainCreator::addFunctionValuesToWS(
     const API::IFunction_sptr &function,
     boost::shared_ptr<API::MatrixWorkspace> &ws, const size_t wsIndex,
     const boost::shared_ptr<API::FunctionDomain> &domain,
-    boost::shared_ptr<API::FunctionValues> resultValues) const {
+    const boost::shared_ptr<API::FunctionValues> &resultValues) const {
   const size_t nData = resultValues->size();
   resultValues->zeroCalculated();
 
@@ -726,7 +726,7 @@ void TableWorkspaceDomainCreator::setParameters() const {
  */
 
 void TableWorkspaceDomainCreator::setXYEColumnNames(
-    API::ITableWorkspace_sptr ws) const {
+    const API::ITableWorkspace_sptr &ws) const {
 
   auto columnNames = ws->getColumnNames();
 
@@ -782,7 +782,7 @@ void TableWorkspaceDomainCreator::setXYEColumnNames(
  * entries.
  */
 void TableWorkspaceDomainCreator::setAndValidateWorkspace(
-    API::Workspace_sptr ws) const {
+    const API::Workspace_sptr &ws) const {
   auto tableWorkspace = boost::dynamic_pointer_cast<API::ITableWorkspace>(ws);
   if (!tableWorkspace) {
     throw std::invalid_argument("InputWorkspace must be a TableWorkspace.");
diff --git a/Framework/CurveFitting/test/Algorithms/ConvolutionFitSequentialTest.h b/Framework/CurveFitting/test/Algorithms/ConvolutionFitSequentialTest.h
index 1ca7b820ddf..eab6d230eaa 100644
--- a/Framework/CurveFitting/test/Algorithms/ConvolutionFitSequentialTest.h
+++ b/Framework/CurveFitting/test/Algorithms/ConvolutionFitSequentialTest.h
@@ -328,8 +328,9 @@ public:
     return AnalysisDataService::Instance().retrieveWS<T>(name);
   }
 
-  MatrixWorkspace_sptr getMatrixWorkspace(WorkspaceGroup_const_sptr group,
-                                          std::size_t index) {
+  MatrixWorkspace_sptr
+  getMatrixWorkspace(const WorkspaceGroup_const_sptr &group,
+                     std::size_t index) {
     return boost::dynamic_pointer_cast<MatrixWorkspace>(group->getItem(index));
   }
 
diff --git a/Framework/CurveFitting/test/Algorithms/FitPowderDiffPeaksTest.h b/Framework/CurveFitting/test/Algorithms/FitPowderDiffPeaksTest.h
index dc71f9854a7..5272a2ec933 100644
--- a/Framework/CurveFitting/test/Algorithms/FitPowderDiffPeaksTest.h
+++ b/Framework/CurveFitting/test/Algorithms/FitPowderDiffPeaksTest.h
@@ -32,7 +32,8 @@ namespace {
 //----------------------------------------------------------------------------------------------
 /** Import data from a column data file by calling LoadAscii
  */
-void importDataFromColumnFile(string filename, string datawsname) {
+void importDataFromColumnFile(const string &filename,
+                              const string &datawsname) {
   // 1. Call LoadAscii
   DataHandling::LoadAscii2 loader;
   loader.initialize();
@@ -96,7 +97,7 @@ API::MatrixWorkspace_sptr createInputDataWorkspace(int option) {
 //----------------------------------------------------------------------------------------------
 /** Create the Bragg peak parameters table for LaB6, PG3, Bank1
  */
-void createLaB6PG3Bank1BraggPeaksTable(TableWorkspace_sptr tablews) {
+void createLaB6PG3Bank1BraggPeaksTable(const TableWorkspace_sptr &tablews) {
   TableRow newrow0 = tablews->appendRow();
   newrow0 << 6 << 3 << 1 << .6129000 << 13962.47 << 0.20687 << 0.10063
           << 62.64174 << 0.00000;
@@ -266,7 +267,7 @@ DataObjects::TableWorkspace_sptr createReflectionWorkspace(int option) {
 //----------------------------------------------------------------------------------------------
 /** Add rows for input table workspace for PG3 bank1
  */
-void createPG3Bank1ParameterTable(TableWorkspace_sptr tablews) {
+void createPG3Bank1ParameterTable(const TableWorkspace_sptr &tablews) {
   TableRow newrow0 = tablews->appendRow();
   newrow0 << "Alph0" << 2.708;
   TableRow newrow1 = tablews->appendRow();
diff --git a/Framework/CurveFitting/test/Algorithms/FitTestHelpers.h b/Framework/CurveFitting/test/Algorithms/FitTestHelpers.h
index 50624ce827d..e1c8c657f7e 100644
--- a/Framework/CurveFitting/test/Algorithms/FitTestHelpers.h
+++ b/Framework/CurveFitting/test/Algorithms/FitTestHelpers.h
@@ -26,8 +26,8 @@ static API::MatrixWorkspace_sptr generateSmoothCurveWorkspace();
 /// Run fit on a (single spectrum) matrix workspace, using the given type
 /// of function and minimizer option
 static Mantid::API::IAlgorithm_sptr
-runFitAlgorithm(MatrixWorkspace_sptr dataToFit, CurveBenchmarks ctype,
-                const std::string minimizer = "Levenberg-MarquardtMD") {
+runFitAlgorithm(const MatrixWorkspace_sptr &dataToFit, CurveBenchmarks ctype,
+                const std::string &minimizer = "Levenberg-MarquardtMD") {
 
   auto fit = AlgorithmManager::Instance().create("Fit");
   fit->initialize();
diff --git a/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h b/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h
index b9ce6ac8ca8..c409cc7084e 100644
--- a/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h
+++ b/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h
@@ -427,7 +427,8 @@ API::MatrixWorkspace_sptr generateArgSiPeak220() {
 //----------------------------------------------------------------------------------------------
 /** Import data from a column data file
  */
-void importDataFromColumnFile(std::string filename, std::string wsname) {
+void importDataFromColumnFile(const std::string &filename,
+                              const std::string &wsname) {
   DataHandling::LoadAscii2 load;
   load.initialize();
 
@@ -1295,7 +1296,7 @@ public:
    * Parse parameter table workspace to 2 map
    */
   void
-  parseParameterTableWorkspace(DataObjects::TableWorkspace_sptr paramws,
+  parseParameterTableWorkspace(const DataObjects::TableWorkspace_sptr &paramws,
                                std::map<std::string, double> &paramvalues,
                                std::map<std::string, char> &paramfitstatus) {
 
diff --git a/Framework/CurveFitting/test/Algorithms/LeBailFunctionTest.h b/Framework/CurveFitting/test/Algorithms/LeBailFunctionTest.h
index 2529fbea830..cecfffc5b4b 100644
--- a/Framework/CurveFitting/test/Algorithms/LeBailFunctionTest.h
+++ b/Framework/CurveFitting/test/Algorithms/LeBailFunctionTest.h
@@ -428,7 +428,8 @@ public:
     return ws;
   }
 
-  void importDataFromColumnFile(std::string filename, std::vector<double> &vecX,
+  void importDataFromColumnFile(const std::string &filename,
+                                std::vector<double> &vecX,
                                 std::vector<double> &vecY,
                                 std::vector<double> &vecE) {
     std::ifstream ins;
diff --git a/Framework/CurveFitting/test/Algorithms/PlotPeakByLogValueTest.h b/Framework/CurveFitting/test/Algorithms/PlotPeakByLogValueTest.h
index 97aada54a13..df033698c0b 100644
--- a/Framework/CurveFitting/test/Algorithms/PlotPeakByLogValueTest.h
+++ b/Framework/CurveFitting/test/Algorithms/PlotPeakByLogValueTest.h
@@ -29,6 +29,7 @@
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 #include <algorithm>
 #include <sstream>
+#include <utility>
 
 using namespace Mantid;
 using namespace Mantid::API;
@@ -67,9 +68,9 @@ DECLARE_FUNCTION(PLOTPEAKBYLOGVALUETEST_Fun)
 
 class PropertyNameIs {
 public:
-  PropertyNameIs(std::string name) : m_name(name){};
+  PropertyNameIs(std::string name) : m_name(std::move(name)){};
 
-  bool operator()(Mantid::Kernel::PropertyHistory_sptr p) {
+  bool operator()(const Mantid::Kernel::PropertyHistory_sptr &p) {
     return p->name() == m_name;
   }
 
diff --git a/Framework/CurveFitting/test/Algorithms/QENSFitSequentialTest.h b/Framework/CurveFitting/test/Algorithms/QENSFitSequentialTest.h
index ab36a4758d4..b2361e2145b 100644
--- a/Framework/CurveFitting/test/Algorithms/QENSFitSequentialTest.h
+++ b/Framework/CurveFitting/test/Algorithms/QENSFitSequentialTest.h
@@ -79,8 +79,8 @@ public:
   }
 
 private:
-  std::string runConvolutionFit(MatrixWorkspace_sptr inputWorkspace,
-                                MatrixWorkspace_sptr resolution) {
+  std::string runConvolutionFit(const MatrixWorkspace_sptr &inputWorkspace,
+                                const MatrixWorkspace_sptr &resolution) {
     QENSFitSequential alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize());
 
@@ -207,7 +207,7 @@ private:
     return resolution;
   }
 
-  void addBinsAndCountsToWorkspace(Workspace2D_sptr workspace,
+  void addBinsAndCountsToWorkspace(const Workspace2D_sptr &workspace,
                                    std::size_t totalBinEdges,
                                    std::size_t totalCounts, double binValue,
                                    double countValue) const {
diff --git a/Framework/CurveFitting/test/Algorithms/QENSFitSimultaneousTest.h b/Framework/CurveFitting/test/Algorithms/QENSFitSimultaneousTest.h
index 1974772d73f..bb53acfbbe5 100644
--- a/Framework/CurveFitting/test/Algorithms/QENSFitSimultaneousTest.h
+++ b/Framework/CurveFitting/test/Algorithms/QENSFitSimultaneousTest.h
@@ -8,6 +8,8 @@
 
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/FunctionFactory.h"
@@ -84,8 +86,8 @@ public:
   }
 
 private:
-  std::string runConvolutionFit(MatrixWorkspace_sptr inputWorkspace,
-                                MatrixWorkspace_sptr resolution) {
+  std::string runConvolutionFit(const MatrixWorkspace_sptr &inputWorkspace,
+                                const MatrixWorkspace_sptr &resolution) {
     QENSFitSimultaneous alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize());
 
@@ -107,12 +109,12 @@ private:
 
   std::string runMultiDatasetFit(
       const std::vector<Mantid::API::MatrixWorkspace_sptr> &workspaces,
-      IFunction_sptr function) {
+      const IFunction_sptr &function) {
     QENSFitSimultaneous alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize());
 
-    alg.setProperty("Function",
-                    createMultiDomainFunction(function, workspaces.size()));
+    alg.setProperty("Function", createMultiDomainFunction(std::move(function),
+                                                          workspaces.size()));
     setMultipleInput(alg, workspaces, 0.0, 10.0);
     alg.setProperty("ConvolveMembers", true);
     alg.setProperty("Minimizer", "Levenberg-Marquardt");
@@ -197,7 +199,7 @@ private:
     return resolution;
   }
 
-  void addBinsAndCountsToWorkspace(Workspace2D_sptr workspace,
+  void addBinsAndCountsToWorkspace(const Workspace2D_sptr &workspace,
                                    std::size_t totalBinEdges,
                                    std::size_t totalCounts, double binValue,
                                    double countValue) const {
@@ -232,7 +234,7 @@ private:
     }
   }
 
-  IFunction_sptr createMultiDomainFunction(IFunction_sptr function,
+  IFunction_sptr createMultiDomainFunction(const IFunction_sptr &function,
                                            std::size_t numberOfDomains) {
     auto multiDomainFunction = boost::make_shared<MultiDomainFunction>();
 
diff --git a/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParameters3Test.h b/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParameters3Test.h
index cb863647b2f..c7f8debc5a0 100644
--- a/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParameters3Test.h
+++ b/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParameters3Test.h
@@ -117,7 +117,7 @@ TableWorkspace_sptr generateInstrumentProfileTableBank1() {
 //----------------------------------------------------------------------------------------------
 /** Parse Table Workspace to a map of string, double pair
  */
-void parseParameterTableWorkspace(TableWorkspace_sptr paramws,
+void parseParameterTableWorkspace(const TableWorkspace_sptr &paramws,
                                   map<string, double> &paramvalues) {
   for (size_t irow = 0; irow < paramws->rowCount(); ++irow) {
     Mantid::API::TableRow row = paramws->getRow(irow);
diff --git a/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParametersTest.h b/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParametersTest.h
index fdfffc3524e..e77dff704c4 100644
--- a/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParametersTest.h
+++ b/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParametersTest.h
@@ -327,7 +327,7 @@ public:
    * BETA, ...
    */
   void
-  importPeakParametersFile(std::string filename,
+  importPeakParametersFile(const std::string &filename,
                            std::vector<std::vector<int>> &hkls,
                            std::vector<std::vector<double>> &peakparameters) {
     // 1. Open file
@@ -441,7 +441,7 @@ public:
    * Input:  a text based file
    * Output: a map for (parameter name, parameter value)
    */
-  void importInstrumentTxtFile(std::string filename,
+  void importInstrumentTxtFile(const std::string &filename,
                                std::map<std::string, double> &parameters,
                                std::map<string, vector<double>> &parametermcs) {
     // 1. Open file
@@ -488,9 +488,9 @@ public:
   }
 
   /// =================  Check Output ================ ///
-  void
-  parseParameterTableWorkspace(Mantid::DataObjects::TableWorkspace_sptr paramws,
-                               std::map<std::string, double> &paramvalues) {
+  void parseParameterTableWorkspace(
+      const Mantid::DataObjects::TableWorkspace_sptr &paramws,
+      std::map<std::string, double> &paramvalues) {
 
     for (size_t irow = 0; irow < paramws->rowCount(); ++irow) {
       Mantid::API::TableRow row = paramws->getRow(irow);
diff --git a/Framework/CurveFitting/test/FitMWTest.h b/Framework/CurveFitting/test/FitMWTest.h
index b4c0ff6af9e..17aff569670 100644
--- a/Framework/CurveFitting/test/FitMWTest.h
+++ b/Framework/CurveFitting/test/FitMWTest.h
@@ -63,7 +63,7 @@ API::MatrixWorkspace_sptr createTestWorkspace(const bool histogram,
   return ws2;
 }
 
-void doTestExecPointData(API::MatrixWorkspace_sptr ws2,
+void doTestExecPointData(const API::MatrixWorkspace_sptr &ws2,
                          bool performance = false) {
   API::IFunction_sptr fun(new ExpDecay);
   fun->setParameter("Height", 1.);
@@ -169,7 +169,7 @@ void doTestExecPointData(API::MatrixWorkspace_sptr ws2,
     TS_ASSERT_DELTA(fun->getParameter("Lifetime"), 1.0, 1e-4);
   }
 }
-void doTestExecHistogramData(API::MatrixWorkspace_sptr ws2,
+void doTestExecHistogramData(const API::MatrixWorkspace_sptr &ws2,
                              bool performance = false) {
   API::IFunction_sptr fun(new ExpDecay);
   fun->setParameter("Height", 1.);
diff --git a/Framework/CurveFitting/test/FuncMinimizers/FABADAMinimizerTest.h b/Framework/CurveFitting/test/FuncMinimizers/FABADAMinimizerTest.h
index 34b24d12fd5..75543a266a9 100644
--- a/Framework/CurveFitting/test/FuncMinimizers/FABADAMinimizerTest.h
+++ b/Framework/CurveFitting/test/FuncMinimizers/FABADAMinimizerTest.h
@@ -46,7 +46,7 @@ MatrixWorkspace_sptr createTestWorkspace(size_t NVectors = 2,
   return ws2;
 }
 
-void doTestExpDecay(MatrixWorkspace_sptr ws2) {
+void doTestExpDecay(const MatrixWorkspace_sptr &ws2) {
 
   Mantid::API::IFunction_sptr fun(new ExpDecay);
   fun->setParameter("Height", 8.);
diff --git a/Framework/CurveFitting/test/FuncMinimizers/LevenbergMarquardtMDTest.h b/Framework/CurveFitting/test/FuncMinimizers/LevenbergMarquardtMDTest.h
index feef3b422ef..32e6baf1132 100644
--- a/Framework/CurveFitting/test/FuncMinimizers/LevenbergMarquardtMDTest.h
+++ b/Framework/CurveFitting/test/FuncMinimizers/LevenbergMarquardtMDTest.h
@@ -468,7 +468,8 @@ public:
   }
 
 private:
-  double fitBSpline(boost::shared_ptr<IFunction> bsp, std::string func) {
+  double fitBSpline(const boost::shared_ptr<IFunction> &bsp,
+                    const std::string &func) {
     const double startx = bsp->getAttribute("StartX").asDouble();
     const double endx = bsp->getAttribute("EndX").asDouble();
 
diff --git a/Framework/CurveFitting/test/Functions/ChebfunBaseTest.h b/Framework/CurveFitting/test/Functions/ChebfunBaseTest.h
index ec23cc49c22..5552bf2677d 100644
--- a/Framework/CurveFitting/test/Functions/ChebfunBaseTest.h
+++ b/Framework/CurveFitting/test/Functions/ChebfunBaseTest.h
@@ -10,6 +10,7 @@
 
 #include "MantidCurveFitting/Functions/ChebfunBase.h"
 #include <cmath>
+#include <utility>
 
 using namespace Mantid;
 using namespace Mantid::API;
@@ -115,8 +116,8 @@ public:
   void test_roots_SinCos() { do_test_roots(SinCos, -M_PI, M_PI, 2, 1e-5); }
 
 private:
-  void do_test_eval(std::function<double(double)> fun, double start, double end,
-                    size_t n) {
+  void do_test_eval(const std::function<double(double)> &fun, double start,
+                    double end, size_t n) {
     ChebfunBase base(n, start, end);
     auto p = base.fit(fun);
     auto x = base.linspace(2 * n);
@@ -132,7 +133,7 @@ private:
     x.assign(xarr, xarr + narr);
 
     ChebfunBase base(n, start, end);
-    auto p = base.fit(fun);
+    auto p = base.fit(std::move(fun));
     auto y = base.evalVector(x, p);
     TS_ASSERT_EQUALS(y.size(), x.size());
     for (size_t i = 0; i < x.size(); ++i) {
@@ -147,7 +148,7 @@ private:
     }
   }
 
-  void do_test_bestFit(std::function<double(double)> fun, double start,
+  void do_test_bestFit(const std::function<double(double)> &fun, double start,
                        double end, size_t expected_n) {
     std::vector<double> p, a;
     auto base = ChebfunBase::bestFit(start, end, fun, p, a);
@@ -161,14 +162,15 @@ private:
   void do_test_integrate(std::function<double(double)> fun, double start,
                          double end, double expected_integral) {
     std::vector<double> p, a;
-    auto base = ChebfunBase::bestFit(start, end, fun, p, a);
+    auto base = ChebfunBase::bestFit(start, end, std::move(fun), p, a);
     TS_ASSERT_DELTA(base->integrate(p), expected_integral, 1e-14);
   }
 
   void do_test_derivative(std::function<double(double)> fun, double start,
-                          double end, std::function<double(double)> deriv) {
+                          double end,
+                          const std::function<double(double)> &deriv) {
     std::vector<double> p, a, dp, da;
-    auto base = ChebfunBase::bestFit(start, end, fun, p, a);
+    auto base = ChebfunBase::bestFit(start, end, std::move(fun), p, a);
     base->derivative(a, da);
     dp = base->calcP(da);
     auto x = base->linspace(2 * base->size());
@@ -181,7 +183,7 @@ private:
   void do_test_roots(std::function<double(double)> fun, double start,
                      double end, size_t n_roots, double tol = 1e-13) {
     std::vector<double> p, a;
-    auto base = ChebfunBase::bestFit(start, end, fun, p, a);
+    auto base = ChebfunBase::bestFit(start, end, std::move(fun), p, a);
     auto roots = base->roots(a);
     TS_ASSERT_EQUALS(n_roots, roots.size());
     for (double root : roots) {
diff --git a/Framework/CurveFitting/test/Functions/ProcessBackgroundTest.h b/Framework/CurveFitting/test/Functions/ProcessBackgroundTest.h
index 3811aa907ad..9c5dc429d06 100644
--- a/Framework/CurveFitting/test/Functions/ProcessBackgroundTest.h
+++ b/Framework/CurveFitting/test/Functions/ProcessBackgroundTest.h
@@ -17,6 +17,7 @@
 #include "MantidKernel/MersenneTwister.h"
 
 #include <fstream>
+#include <utility>
 
 using Mantid::CurveFitting::Functions::ProcessBackground;
 using namespace Mantid;
@@ -26,7 +27,8 @@ using namespace Mantid::DataObjects;
 using namespace HistogramData;
 
 namespace {
-Workspace2D_sptr createInputWS(std::string name, size_t sizex, size_t sizey) {
+Workspace2D_sptr createInputWS(const std::string &name, size_t sizex,
+                               size_t sizey) {
   Workspace2D_sptr inputWS = boost::dynamic_pointer_cast<Workspace2D>(
       WorkspaceFactory::Instance().create("Workspace2D", 1, sizex, sizey));
   AnalysisDataService::Instance().addOrReplace(name, inputWS);
@@ -294,9 +296,9 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Read column file to create a workspace2D
    */
-  Workspace2D_sptr createWorkspace2D(std::string filename) {
+  Workspace2D_sptr createWorkspace2D(const std::string &filename) {
     // 1. Read data
-    auto data = importDataFromColumnFile(filename);
+    auto data = importDataFromColumnFile(std::move(filename));
 
     // 2. Create workspace
     size_t datasize = data.x().size();
@@ -314,7 +316,7 @@ public:
 
   /** Import data from a column data file
    */
-  Histogram importDataFromColumnFile(std::string filename) {
+  Histogram importDataFromColumnFile(const std::string &filename) {
     // 1. Open file
     std::ifstream ins;
     ins.open(filename.c_str());
diff --git a/Framework/CurveFitting/test/Functions/SimpleChebfunTest.h b/Framework/CurveFitting/test/Functions/SimpleChebfunTest.h
index 6faf11ee57f..fec05d704cb 100644
--- a/Framework/CurveFitting/test/Functions/SimpleChebfunTest.h
+++ b/Framework/CurveFitting/test/Functions/SimpleChebfunTest.h
@@ -221,8 +221,8 @@ public:
 
 private:
   void do_test_values(const SimpleChebfun &cheb,
-                      std::function<double(double)> fun, double accur1 = 1e-14,
-                      double accur2 = 1e-14) {
+                      const std::function<double(double)> &fun,
+                      double accur1 = 1e-14, double accur2 = 1e-14) {
     TS_ASSERT(cheb.size() > 0);
     TS_ASSERT(cheb.width() > 0.0);
     if (cheb.isGood()) {
diff --git a/Framework/CurveFitting/test/HistogramDomainCreatorTest.h b/Framework/CurveFitting/test/HistogramDomainCreatorTest.h
index 75853f8cee7..a09450e0550 100644
--- a/Framework/CurveFitting/test/HistogramDomainCreatorTest.h
+++ b/Framework/CurveFitting/test/HistogramDomainCreatorTest.h
@@ -463,8 +463,9 @@ private:
     return ws2;
   }
 
-  MatrixWorkspace_sptr createFitWorkspace(const size_t ny,
-                                          std::function<double(double)> fun) {
+  MatrixWorkspace_sptr
+  createFitWorkspace(const size_t ny,
+                     const std::function<double(double)> &fun) {
     MatrixWorkspace_sptr ws(new WorkspaceTester);
     size_t nx = ny + 1;
     double x0 = -1.0;
diff --git a/Framework/CurveFitting/test/MultiDomainCreatorTest.h b/Framework/CurveFitting/test/MultiDomainCreatorTest.h
index ef6499accc9..146991f53f4 100644
--- a/Framework/CurveFitting/test/MultiDomainCreatorTest.h
+++ b/Framework/CurveFitting/test/MultiDomainCreatorTest.h
@@ -302,7 +302,7 @@ public:
   }
 
 private:
-  void doTestOutputSpectrum(MatrixWorkspace_sptr ws, size_t index) {
+  void doTestOutputSpectrum(const MatrixWorkspace_sptr &ws, size_t index) {
     TS_ASSERT(ws);
     TS_ASSERT_EQUALS(ws->getNumberHistograms(), 3);
     auto &data = ws->readY(0);
diff --git a/Framework/CurveFitting/test/TableWorkspaceDomainCreatorTest.h b/Framework/CurveFitting/test/TableWorkspaceDomainCreatorTest.h
index 5cecdb61ba4..743bac005d5 100644
--- a/Framework/CurveFitting/test/TableWorkspaceDomainCreatorTest.h
+++ b/Framework/CurveFitting/test/TableWorkspaceDomainCreatorTest.h
@@ -770,8 +770,8 @@ private:
   }
 
   boost::shared_ptr<Fit>
-  setupBasicFitPropertiesAlgorithm(API::IFunction_sptr fun,
-                                   API::Workspace_sptr ws,
+  setupBasicFitPropertiesAlgorithm(const API::IFunction_sptr &fun,
+                                   const API::Workspace_sptr &ws,
                                    bool createOutput = true) {
     auto fit = boost::make_shared<Fit>();
     fit->initialize();
diff --git a/Framework/DataHandling/inc/MantidDataHandling/AppendGeometryToSNSNexus.h b/Framework/DataHandling/inc/MantidDataHandling/AppendGeometryToSNSNexus.h
index 918e89694bb..971696c0753 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/AppendGeometryToSNSNexus.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/AppendGeometryToSNSNexus.h
@@ -49,12 +49,12 @@ private:
 
   /// Run LoadInstrument as a Child Algorithm
   bool runLoadInstrument(const std::string &idf_filename,
-                         API::MatrixWorkspace_sptr localWorkspace,
+                         const API::MatrixWorkspace_sptr &localWorkspace,
                          Algorithm *alg);
 
   /// Load logs from the NeXus file
   static bool runLoadNexusLogs(const std::string &nexusFileName,
-                               API::MatrixWorkspace_sptr localWorkspace,
+                               const API::MatrixWorkspace_sptr &localWorkspace,
                                Algorithm *alg);
 
   /// Are we going to make a copy of the NeXus file to operate on ?
diff --git a/Framework/DataHandling/inc/MantidDataHandling/BankPulseTimes.h b/Framework/DataHandling/inc/MantidDataHandling/BankPulseTimes.h
index 8cdc32656f8..5edb30b89eb 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/BankPulseTimes.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/BankPulseTimes.h
@@ -32,7 +32,7 @@ public:
   ~BankPulseTimes();
 
   /// Equals
-  bool equals(size_t otherNumPulse, std::string otherStartTime);
+  bool equals(size_t otherNumPulse, const std::string &otherStartTime);
 
   /// String describing the start time
   std::string startTime;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/CreateSimulationWorkspace.h b/Framework/DataHandling/inc/MantidDataHandling/CreateSimulationWorkspace.h
index c8129c6e205..e8d09ae0300 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/CreateSimulationWorkspace.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/CreateSimulationWorkspace.h
@@ -54,7 +54,7 @@ private:
   /// Apply any instrument adjustments from the file
   void adjustInstrument(const std::string &filename);
   /// Set start date for dummy workspace
-  void setStartDate(API::MatrixWorkspace_sptr workspace);
+  void setStartDate(const API::MatrixWorkspace_sptr &workspace);
 
   /// Pointer to a progress object
   boost::shared_ptr<API::Progress> m_progress;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/DataBlockComposite.h b/Framework/DataHandling/inc/MantidDataHandling/DataBlockComposite.h
index 41a791773fe..307d7b84caf 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/DataBlockComposite.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/DataBlockComposite.h
@@ -33,7 +33,7 @@ public:
   bool operator==(const DataBlockComposite &other) const;
 
   // DataBlockComposite only mehtods
-  void addDataBlock(DataBlock dataBlock);
+  void addDataBlock(const DataBlock &dataBlock);
   std::vector<DataBlock> getDataBlocks();
   DataBlockComposite operator+(const DataBlockComposite &other);
   void removeSpectra(DataBlockComposite &toRemove);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/DetermineChunking.h b/Framework/DataHandling/inc/MantidDataHandling/DetermineChunking.h
index 8dd99ed92b0..5df1afc8758 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/DetermineChunking.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/DetermineChunking.h
@@ -57,7 +57,7 @@ public:
 private:
   void init() override;
   void exec() override;
-  std::string setTopEntryName(std::string filename);
+  std::string setTopEntryName(const std::string &filename);
   FileType getFileType(const std::string &filename);
 };
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/EventWorkspaceCollection.h b/Framework/DataHandling/inc/MantidDataHandling/EventWorkspaceCollection.h
index 6b0d8bebceb..7e2dcfc33bb 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/EventWorkspaceCollection.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/EventWorkspaceCollection.h
@@ -59,7 +59,7 @@ public:
   void setThickness(const float flag);
   void setHeight(const float flag);
   void setWidth(const float flag);
-  void setSpectrumNumbersFromUniqueSpectra(const std::set<int> uniqueSpectra);
+  void setSpectrumNumbersFromUniqueSpectra(const std::set<int> &uniqueSpectra);
   void setSpectrumNumberForAllPeriods(const size_t spectrumNumber,
                                       const specnum_t specid);
   void setDetectorIdsForAllPeriods(const size_t spectrumNumber,
@@ -88,8 +88,9 @@ public:
   void
   setMonitorWorkspace(const boost::shared_ptr<API::MatrixWorkspace> &monitorWS);
   void updateSpectraUsing(const API::SpectrumDetectorMapping &map);
-  void setTitle(std::string title);
-  void applyFilter(boost::function<void(API::MatrixWorkspace_sptr)> func);
+  void setTitle(const std::string &title);
+  void
+  applyFilter(const boost::function<void(API::MatrixWorkspace_sptr)> &func);
   virtual bool threadSafe() const;
 };
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/FilterEventsByLogValuePreNexus.h b/Framework/DataHandling/inc/MantidDataHandling/FilterEventsByLogValuePreNexus.h
index e40324effba..9a6d5d706a6 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/FilterEventsByLogValuePreNexus.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/FilterEventsByLogValuePreNexus.h
@@ -122,7 +122,7 @@ private:
   void readPulseidFile(const std::string &filename, const bool throwError);
 
   void runLoadInstrument(const std::string &eventfilename,
-                         API::MatrixWorkspace_sptr localWorkspace);
+                         const API::MatrixWorkspace_sptr &localWorkspace);
 
   void procEvents(DataObjects::EventWorkspace_sptr &workspace);
 
@@ -133,15 +133,15 @@ private:
 
   void setProtonCharge(DataObjects::EventWorkspace_sptr &workspace);
 
-  void addToWorkspaceLog(std::string logtitle, size_t mindex);
+  void addToWorkspaceLog(const std::string &logtitle, size_t mindex);
 
   void processEventLogs();
 
   /// Pad out empty pixel
-  size_t padOutEmptyPixels(DataObjects::EventWorkspace_sptr eventws);
+  size_t padOutEmptyPixels(const DataObjects::EventWorkspace_sptr &eventws);
 
   /// Set up spectrum/detector ID map inside a workspace
-  void setupPixelSpectrumMap(DataObjects::EventWorkspace_sptr eventws);
+  void setupPixelSpectrumMap(const DataObjects::EventWorkspace_sptr &eventws);
 
   ///
   void filterEvents();
diff --git a/Framework/DataHandling/inc/MantidDataHandling/GroupDetectors2.h b/Framework/DataHandling/inc/MantidDataHandling/GroupDetectors2.h
index 91f15dbf33c..fc590b50ef0 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/GroupDetectors2.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/GroupDetectors2.h
@@ -151,23 +151,23 @@ private:
   void execEvent();
 
   /// read in the input parameters and see what findout what will be to grouped
-  void getGroups(API::MatrixWorkspace_const_sptr workspace,
+  void getGroups(const API::MatrixWorkspace_const_sptr &workspace,
                  std::vector<int64_t> &unUsedSpec);
   /// gets the list of spectra _index_ _numbers_ from a file of _spectra_
   /// _numbers_
   void processFile(const std::string &fname,
-                   API::MatrixWorkspace_const_sptr workspace,
+                   const API::MatrixWorkspace_const_sptr &workspace,
                    std::vector<int64_t> &unUsedSpec);
   /// gets groupings from XML file
   void processXMLFile(const std::string &fname,
-                      API::MatrixWorkspace_const_sptr workspace,
+                      const API::MatrixWorkspace_const_sptr &workspace,
                       std::vector<int64_t> &unUsedSpec);
-  void
-  processGroupingWorkspace(DataObjects::GroupingWorkspace_const_sptr groupWS,
-                           API::MatrixWorkspace_const_sptr workspace,
-                           std::vector<int64_t> &unUsedSpec);
-  void processMatrixWorkspace(API::MatrixWorkspace_const_sptr groupWS,
-                              API::MatrixWorkspace_const_sptr workspace,
+  void processGroupingWorkspace(
+      const DataObjects::GroupingWorkspace_const_sptr &groupWS,
+      const API::MatrixWorkspace_const_sptr &workspace,
+      std::vector<int64_t> &unUsedSpec);
+  void processMatrixWorkspace(const API::MatrixWorkspace_const_sptr &groupWS,
+                              const API::MatrixWorkspace_const_sptr &workspace,
                               std::vector<int64_t> &unUsedSpec);
   /// used while reading the file turns the string into an integer number (if
   /// possible), white space and # comments ignored
@@ -193,14 +193,15 @@ private:
 
   /// Copy the and combine the histograms that the user requested from the input
   /// into the output workspace
-  size_t formGroups(API::MatrixWorkspace_const_sptr inputWS,
-                    API::MatrixWorkspace_sptr outputWS, const double prog4Copy,
-                    const bool keepAll, const std::set<int64_t> &unGroupedSet,
+  size_t formGroups(const API::MatrixWorkspace_const_sptr &inputWS,
+                    const API::MatrixWorkspace_sptr &outputWS,
+                    const double prog4Copy, const bool keepAll,
+                    const std::set<int64_t> &unGroupedSet,
                     Indexing::IndexInfo &indexInfo);
   /// Copy the and combine the event lists that the user requested from the
   /// input into the output workspace
-  size_t formGroupsEvent(DataObjects::EventWorkspace_const_sptr inputWS,
-                         DataObjects::EventWorkspace_sptr outputWS,
+  size_t formGroupsEvent(const DataObjects::EventWorkspace_const_sptr &inputWS,
+                         const DataObjects::EventWorkspace_sptr &outputWS,
                          const double prog4Copy);
 
   /// Copy the ungrouped spectra from the input workspace to the output
diff --git a/Framework/DataHandling/inc/MantidDataHandling/JoinISISPolarizationEfficiencies.h b/Framework/DataHandling/inc/MantidDataHandling/JoinISISPolarizationEfficiencies.h
index b3b794ea2c9..61d2de494c1 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/JoinISISPolarizationEfficiencies.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/JoinISISPolarizationEfficiencies.h
@@ -33,10 +33,10 @@ private:
   std::vector<API::MatrixWorkspace_sptr> interpolateWorkspaces(
       std::vector<API::MatrixWorkspace_sptr> const &workspaces);
   API::MatrixWorkspace_sptr
-  interpolatePointDataWorkspace(API::MatrixWorkspace_sptr ws,
+  interpolatePointDataWorkspace(const API::MatrixWorkspace_sptr &ws,
                                 size_t const maxSize);
   API::MatrixWorkspace_sptr
-  interpolateHistogramWorkspace(API::MatrixWorkspace_sptr ws,
+  interpolateHistogramWorkspace(const API::MatrixWorkspace_sptr &ws,
                                 size_t const maxSize);
 };
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/Load.h b/Framework/DataHandling/inc/MantidDataHandling/Load.h
index dc91b538d0f..2fa6eb936de 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/Load.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/Load.h
@@ -88,7 +88,8 @@ private:
   API::Workspace_sptr loadFileToWs(const std::string &fileName,
                                    const std::string &wsName);
   /// Plus two workspaces together, "in place".
-  API::Workspace_sptr plusWs(API::Workspace_sptr ws1, API::Workspace_sptr ws2);
+  API::Workspace_sptr plusWs(API::Workspace_sptr ws1,
+                             const API::Workspace_sptr &ws2);
   /// Manually group workspaces.
   API::WorkspaceGroup_sptr
   groupWsList(const std::vector<API::Workspace_sptr> &wsList);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadAsciiStl.h b/Framework/DataHandling/inc/MantidDataHandling/LoadAsciiStl.h
index 4e24a8d4f84..d955e90fec6 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadAsciiStl.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadAsciiStl.h
@@ -7,6 +7,8 @@
 #pragma once
 #include "MantidDataHandling/LoadStl.h"
 #include <iosfwd>
+#include <utility>
+
 namespace Mantid {
 
 namespace Kernel {
@@ -21,12 +23,12 @@ namespace DataHandling {
 class DLLExport LoadAsciiStl : public LoadStl {
 public:
   LoadAsciiStl(std::string filename, ScaleUnits scaleType)
-      : LoadStl(filename, scaleType) {}
+      : LoadStl(std::move(filename), scaleType) {}
   LoadAsciiStl(std::string filename, ScaleUnits scaleType,
                ReadMaterial::MaterialParameters params)
-      : LoadStl(filename, scaleType, params) {}
+      : LoadStl(std::move(filename), scaleType, std::move(params)) {}
   std::unique_ptr<Geometry::MeshObject> readStl() override;
-  static bool isAsciiSTL(std::string filename);
+  static bool isAsciiSTL(const std::string &filename);
 
 private:
   int m_lineNumber = 0;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadBinaryStl.h b/Framework/DataHandling/inc/MantidDataHandling/LoadBinaryStl.h
index 802951c614d..c69730cd169 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadBinaryStl.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadBinaryStl.h
@@ -5,6 +5,10 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #pragma once
+#include <utility>
+
+#include <utility>
+
 #include "MantidDataHandling/LoadStl.h"
 
 namespace Mantid {
@@ -24,12 +28,13 @@ public:
   static constexpr uint32_t TRIANGLE_COUNT_DATA_SIZE = 4;
   static constexpr uint32_t VECTOR_DATA_SIZE = 12;
   LoadBinaryStl(std::string filename, ScaleUnits scaleType)
-      : LoadStl(filename, scaleType) {}
+      : LoadStl(std::move(std::move(filename)), scaleType) {}
   LoadBinaryStl(std::string filename, ScaleUnits scaleType,
                 ReadMaterial::MaterialParameters params)
-      : LoadStl(filename, scaleType, params) {}
+      : LoadStl(std::move(std::move(filename)), scaleType,
+                std::move(std::move(params))) {}
   std::unique_ptr<Geometry::MeshObject> readStl() override;
-  static bool isBinarySTL(std::string filename);
+  static bool isBinarySTL(const std::string &filename);
 
 private:
   void readTriangle(Kernel::BinaryStreamReader, uint32_t &vertexCount);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadCalFile.h b/Framework/DataHandling/inc/MantidDataHandling/LoadCalFile.h
index 318a41a6995..cec536b2ac4 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadCalFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadCalFile.h
@@ -53,10 +53,11 @@ public:
   getInstrument3Ways(API::Algorithm *alg);
   static bool instrumentIsSpecified(API::Algorithm *alg);
 
-  static void readCalFile(const std::string &calFileName,
-                          Mantid::DataObjects::GroupingWorkspace_sptr groupWS,
-                          Mantid::DataObjects::OffsetsWorkspace_sptr offsetsWS,
-                          Mantid::DataObjects::MaskWorkspace_sptr maskWS);
+  static void
+  readCalFile(const std::string &calFileName,
+              const Mantid::DataObjects::GroupingWorkspace_sptr &groupWS,
+              const Mantid::DataObjects::OffsetsWorkspace_sptr &offsetsWS,
+              const Mantid::DataObjects::MaskWorkspace_sptr &maskWS);
 
 protected:
   Parallel::ExecutionMode getParallelExecutionMode(
@@ -70,7 +71,7 @@ private:
   void exec() override;
 
   /// Checks if a detector ID is for a monitor on a given instrument
-  static bool idIsMonitor(Mantid::Geometry::Instrument_const_sptr inst,
+  static bool idIsMonitor(const Mantid::Geometry::Instrument_const_sptr &inst,
                           int detID);
 };
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadCanSAS1D.h b/Framework/DataHandling/inc/MantidDataHandling/LoadCanSAS1D.h
index 885a8014233..398a393a94f 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadCanSAS1D.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadCanSAS1D.h
@@ -76,18 +76,19 @@ protected:
              const std::string &name) const;
   /// Appends the new data workspace creating a workspace group if there was
   /// existing data
-  void appendDataToOutput(API::MatrixWorkspace_sptr newWork,
+  void appendDataToOutput(const API::MatrixWorkspace_sptr &newWork,
                           const std::string &newWorkName,
-                          API::WorkspaceGroup_sptr container);
+                          const API::WorkspaceGroup_sptr &container);
   /// Run LoadInstrument Child Algorithm
   void runLoadInstrument(const std::string &inst_name,
-                         API::MatrixWorkspace_sptr localWorkspace);
+                         const API::MatrixWorkspace_sptr &localWorkspace);
   /// Loads data into the run log
   void createLogs(const Poco::XML::Element *const sasEntry,
-                  API::MatrixWorkspace_sptr wSpace) const;
+                  const API::MatrixWorkspace_sptr &wSpace) const;
   /// Loads the information about hhe sample
-  void createSampleInformation(const Poco::XML::Element *const sasEntry,
-                               Mantid::API::MatrixWorkspace_sptr wSpace) const;
+  void createSampleInformation(
+      const Poco::XML::Element *const sasEntry,
+      const Mantid::API::MatrixWorkspace_sptr &wSpace) const;
 };
 } // namespace DataHandling
 } // namespace Mantid
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadDaveGrp.h b/Framework/DataHandling/inc/MantidDataHandling/LoadDaveGrp.h
index 802b74dd776..ca091548c58 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadDaveGrp.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadDaveGrp.h
@@ -102,7 +102,7 @@ private:
    *
    * @param workspace handle to the workspace to to load data into
    */
-  void getData(API::MatrixWorkspace_sptr workspace);
+  void getData(const API::MatrixWorkspace_sptr &workspace);
 
   /**
    * Function to setup the workspace ready for data to be loaded into it
@@ -118,7 +118,7 @@ private:
    * @param xAxis the x axis data
    * @param yAxis the y axis data
    */
-  void setWorkspaceAxes(API::MatrixWorkspace_sptr workspace,
+  void setWorkspaceAxes(const API::MatrixWorkspace_sptr &workspace,
                         const std::vector<double> &xAxis,
                         const std::vector<double> &yAxis) const;
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorsGroupingFile.h b/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorsGroupingFile.h
index bfc0bf2d362..66ba3fca07f 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorsGroupingFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadDetectorsGroupingFile.h
@@ -107,7 +107,7 @@ class DLLExport LoadGroupXMLFile {
 public:
   LoadGroupXMLFile();
 
-  void loadXMLFile(std::string xmlfilename);
+  void loadXMLFile(const std::string &xmlfilename);
   void setDefaultStartingGroupID(int startgroupid) {
     m_startGroupID = startgroupid;
   }
@@ -167,7 +167,7 @@ private:
   void parseXML();
   /// Get attribute value from an XML node
   static std::string getAttributeValueByName(Poco::XML::Node *pNode,
-                                             std::string attributename,
+                                             const std::string &attributename,
                                              bool &found);
 };
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadDspacemap.h b/Framework/DataHandling/inc/MantidDataHandling/LoadDspacemap.h
index d835ca613f0..fe0f2ea3614 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadDspacemap.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadDspacemap.h
@@ -48,12 +48,12 @@ private:
                             std::map<detid_t, double> &vulcan);
 
   void CalculateOffsetsFromDSpacemapFile(
-      const std::string DFileName,
-      Mantid::DataObjects::OffsetsWorkspace_sptr offsetsWS);
+      const std::string &DFileName,
+      const Mantid::DataObjects::OffsetsWorkspace_sptr &offsetsWS);
 
   void CalculateOffsetsFromVulcanFactors(
       std::map<detid_t, double> &vulcan,
-      Mantid::DataObjects::OffsetsWorkspace_sptr offsetsWS);
+      const Mantid::DataObjects::OffsetsWorkspace_sptr &offsetsWS);
 };
 
 } // namespace DataHandling
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h b/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h
index 8dbc0304175..3c2c8141cb8 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h
@@ -206,8 +206,8 @@ private:
   void createSpectraMapping(
       const std::string &nxsfile, const bool monitorsOnly,
       const std::vector<std::string> &bankNames = std::vector<std::string>());
-  void deleteBanks(EventWorkspaceCollection_sptr workspace,
-                   std::vector<std::string> bankNames);
+  void deleteBanks(const EventWorkspaceCollection_sptr &workspace,
+                   const std::vector<std::string> &bankNames);
   bool hasEventMonitors();
   void runLoadMonitors();
   /// Set the filters on TOF.
@@ -223,7 +223,7 @@ private:
   void setTopEntryName();
 
   /// to open the nexus file with specific exception handling/message
-  void safeOpenFile(const std::string fname);
+  void safeOpenFile(const std::string &fname);
 
   /// Was the instrument loaded?
   bool m_instrument_loaded_correctly;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexusIndexSetup.h b/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexusIndexSetup.h
index 60feb2504cb..a653534a18c 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexusIndexSetup.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexusIndexSetup.h
@@ -28,7 +28,7 @@ class MANTID_DATAHANDLING_DLL LoadEventNexusIndexSetup {
 public:
   LoadEventNexusIndexSetup(
       API::MatrixWorkspace_const_sptr instrumentWorkspace, const int32_t min,
-      const int32_t max, const std::vector<int32_t> range,
+      const int32_t max, const std::vector<int32_t> &range,
       const Parallel::Communicator &communicator = Parallel::Communicator());
 
   std::pair<int32_t, int32_t> eventIDLimits() const;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadEventPreNexus2.h b/Framework/DataHandling/inc/MantidDataHandling/LoadEventPreNexus2.h
index e6a43703b1a..cb2b3b406b9 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadEventPreNexus2.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadEventPreNexus2.h
@@ -188,7 +188,7 @@ private:
   void readPulseidFile(const std::string &filename, const bool throwError);
 
   void runLoadInstrument(const std::string &eventfilename,
-                         API::MatrixWorkspace_sptr localWorkspace);
+                         const API::MatrixWorkspace_sptr &localWorkspace);
 
   inline void fixPixelId(PixelType &pixel, uint32_t &period) const;
 
@@ -202,7 +202,7 @@ private:
 
   void setProtonCharge(DataObjects::EventWorkspace_sptr &workspace);
 
-  void addToWorkspaceLog(std::string logtitle, size_t mindex);
+  void addToWorkspaceLog(const std::string &logtitle, size_t mindex);
 
   void processImbedLogs();
 
@@ -212,7 +212,7 @@ private:
 
   API::MatrixWorkspace_sptr generateEventDistribtionWorkspace();
 
-  void createOutputWorkspace(const std::string event_filename);
+  void createOutputWorkspace(const std::string &event_filename);
 
   /// Processing the input properties for purpose of investigation
   void processInvestigationInputs();
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadFITS.h b/Framework/DataHandling/inc/MantidDataHandling/LoadFITS.h
index c4a46f6f1f8..c1720745222 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadFITS.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadFITS.h
@@ -91,15 +91,16 @@ private:
   DataObjects::Workspace2D_sptr makeWorkspace(
       const FITSInfo &fileInfo, size_t &newFileNumber,
       std::vector<char> &buffer, API::MantidImage &imageY,
-      API::MantidImage &imageE, const DataObjects::Workspace2D_sptr parent,
+      API::MantidImage &imageE, const DataObjects::Workspace2D_sptr &parent,
       bool loadAsRectImg = false, int binSize = 1, double noiseThresh = false);
 
-  void addAxesInfoAndLogs(DataObjects::Workspace2D_sptr ws, bool loadAsRectImg,
-                          const FITSInfo &fileInfo, int binSize, double cmpp);
+  void addAxesInfoAndLogs(const DataObjects::Workspace2D_sptr &ws,
+                          bool loadAsRectImg, const FITSInfo &fileInfo,
+                          int binSize, double cmpp);
 
   // Reads the data from a single FITS file into a workspace (directly, fast)
   void readDataToWorkspace(const FITSInfo &fileInfo, double cmpp,
-                           DataObjects::Workspace2D_sptr ws,
+                           const DataObjects::Workspace2D_sptr &ws,
                            std::vector<char> &buffer);
 
   // Reads the data from a single FITS file into image objects (Y and E) that
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadFullprofResolution.h b/Framework/DataHandling/inc/MantidDataHandling/LoadFullprofResolution.h
index 0719e71aeaa..0796c67a633 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadFullprofResolution.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadFullprofResolution.h
@@ -51,48 +51,48 @@ public:
                                  std::map<std::string, size_t> &parammap);
 
   /// Put parameters into a matrix workspace
-  static void putParametersIntoWorkspace(const API::Column_const_sptr,
-                                         API::MatrixWorkspace_sptr ws,
+  static void putParametersIntoWorkspace(const API::Column_const_sptr &,
+                                         const API::MatrixWorkspace_sptr &ws,
                                          int nProf,
                                          std::string &parameterXMLString);
 
   /// Add an Ikeda-Carpenter PV ALFBE parameter
-  static void addALFBEParameter(const API::Column_const_sptr,
+  static void addALFBEParameter(const API::Column_const_sptr &,
                                 Poco::XML::Document *mDoc,
                                 Poco::XML::Element *parent,
                                 const std::string &paramName);
 
   /// Add set of Ikeda-Carpenter PV Sigma parameters
-  static void addSigmaParameters(const API::Column_const_sptr,
+  static void addSigmaParameters(const API::Column_const_sptr &,
                                  Poco::XML::Document *mDoc,
                                  Poco::XML::Element *parent);
 
   /// Add set of Ikeda-Carpenter PV Gamma parameters
-  static void addGammaParameters(const API::Column_const_sptr,
+  static void addGammaParameters(const API::Column_const_sptr &,
                                  Poco::XML::Document *mDoc,
                                  Poco::XML::Element *parent);
 
   /// Add set of BackToBackExponential S parameters
-  static void addBBX_S_Parameters(const API::Column_const_sptr,
+  static void addBBX_S_Parameters(const API::Column_const_sptr &,
                                   Poco::XML::Document *mDoc,
                                   Poco::XML::Element *parent);
 
   /// Add set of BackToBackExponential A parameters
-  static void addBBX_A_Parameters(const API::Column_const_sptr,
+  static void addBBX_A_Parameters(const API::Column_const_sptr &,
                                   Poco::XML::Document *mDoc,
                                   Poco::XML::Element *parent);
 
   /// Add set of BackToBackExponential B parameters
-  static void addBBX_B_Parameters(const API::Column_const_sptr,
+  static void addBBX_B_Parameters(const API::Column_const_sptr &,
                                   Poco::XML::Document *mDoc,
                                   Poco::XML::Element *parent);
 
   /// Get value for XML eq attribute for parameter
-  static std::string getXMLEqValue(const API::Column_const_sptr,
+  static std::string getXMLEqValue(const API::Column_const_sptr &,
                                    const std::string &name);
 
   /// Get value for XML eq attribute for squared parameter
-  static std::string getXMLSquaredEqValue(const API::Column_const_sptr column,
+  static std::string getXMLSquaredEqValue(const API::Column_const_sptr &column,
                                           const std::string &name);
 
   // Translate a parameter name from as it appears in the table workspace to its
@@ -114,7 +114,7 @@ private:
   void exec() override;
 
   /// Load file to a vector of strings
-  void loadFile(std::string filename, std::vector<std::string> &lines);
+  void loadFile(const std::string &filename, std::vector<std::string> &lines);
 
   /// Get the NPROF number
   int getProfNumber(const std::vector<std::string> &lines);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadGSASInstrumentFile.h b/Framework/DataHandling/inc/MantidDataHandling/LoadGSASInstrumentFile.h
index bafa82c0063..da15be2dc47 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadGSASInstrumentFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadGSASInstrumentFile.h
@@ -49,7 +49,7 @@ private:
   void exec() override;
 
   /// Load file to a vector of strings
-  void loadFile(std::string filename, std::vector<std::string> &lines);
+  void loadFile(const std::string &filename, std::vector<std::string> &lines);
 
   /// Get Histogram type
   std::string getHistogramType(const std::vector<std::string> &lines);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadGSS.h b/Framework/DataHandling/inc/MantidDataHandling/LoadGSS.h
index 683863dc673..cefa59b10e4 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadGSS.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadGSS.h
@@ -63,7 +63,7 @@ private:
   double convertToDouble(std::string inputstring);
 
   /// Create an instrument geometry.
-  void createInstrumentGeometry(API::MatrixWorkspace_sptr workspace,
+  void createInstrumentGeometry(const API::MatrixWorkspace_sptr &workspace,
                                 const std::string &instrumentname,
                                 const double &primaryflightpath,
                                 const std::vector<int> &detectorids,
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadHelper.h b/Framework/DataHandling/inc/MantidDataHandling/LoadHelper.h
index 6d61d25ce67..e1d76e61361 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadHelper.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadHelper.h
@@ -35,18 +35,19 @@ public:
   static double calculateStandardError(double in) { return sqrt(in); }
   double calculateEnergy(double);
   double calculateTOF(double, double);
-  double getInstrumentProperty(const API::MatrixWorkspace_sptr &, std::string);
+  double getInstrumentProperty(const API::MatrixWorkspace_sptr &,
+                               const std::string &);
   void addNexusFieldsToWsRun(NXhandle nxfileID, API::Run &runDetails);
   void dumpNexusAttributes(NXhandle nxfileID, std::string &indentStr);
-  std::string dateTimeInIsoFormat(std::string);
+  std::string dateTimeInIsoFormat(const std::string &);
 
-  void moveComponent(API::MatrixWorkspace_sptr ws,
+  void moveComponent(const API::MatrixWorkspace_sptr &ws,
                      const std::string &componentName,
                      const Kernel::V3D &newPos);
-  void rotateComponent(API::MatrixWorkspace_sptr ws,
+  void rotateComponent(const API::MatrixWorkspace_sptr &ws,
                        const std::string &componentName,
                        const Kernel::Quat &rot);
-  Kernel::V3D getComponentPosition(API::MatrixWorkspace_sptr ws,
+  Kernel::V3D getComponentPosition(const API::MatrixWorkspace_sptr &ws,
                                    const std::string &componentName);
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadIDFFromNexus.h b/Framework/DataHandling/inc/MantidDataHandling/LoadIDFFromNexus.h
index 5da9cae6b1a..b1e0389853c 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadIDFFromNexus.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadIDFFromNexus.h
@@ -59,7 +59,7 @@ public:
   /// Load the parameters from Nexus file if possible, else from parameter file,
   /// into workspace
   void LoadParameters(::NeXus::File *nxfile,
-                      const API::MatrixWorkspace_sptr localWorkspace);
+                      const API::MatrixWorkspace_sptr &localWorkspace);
 
   /// Algorithm's version for identification overriding a virtual method
   int version() const override { return 1; }
@@ -77,7 +77,7 @@ private:
   /// Load Parameter File specified by full pathname into given workspace,
   /// return success
   bool loadParameterFile(const std::string &fullPathName,
-                         const API::MatrixWorkspace_sptr localWorkspace);
+                         const API::MatrixWorkspace_sptr &localWorkspace);
 };
 
 } // namespace DataHandling
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadILLDiffraction.h b/Framework/DataHandling/inc/MantidDataHandling/LoadILLDiffraction.h
index d1f7f145679..5e62681ceae 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadILLDiffraction.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadILLDiffraction.h
@@ -6,6 +6,8 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #pragma once
 
+#include <utility>
+
 #include "MantidAPI/IFileLoader.h"
 #include "MantidDataHandling/DllConfig.h"
 #include "MantidDataHandling/LoadHelper.h"
@@ -45,7 +47,8 @@ private:
     std::string unit;
 
     ScannedVariables(std::string n, std::string p, std::string u)
-        : axis(0), scanned(0), name(n), property(p), unit(u) {}
+        : axis(0), scanned(0), name(std::move(n)), property(std::move(p)),
+          unit(std::move(u)) {}
 
     void setAxis(int a) { axis = a; }
     void setScanned(int s) { scanned = s; }
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadILLIndirect2.h b/Framework/DataHandling/inc/MantidDataHandling/LoadILLIndirect2.h
index c495fe9c1e5..96171213880 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadILLIndirect2.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadILLIndirect2.h
@@ -44,7 +44,7 @@ private:
   void initWorkSpace();
   void setInstrumentName(const NeXus::NXEntry &firstEntry,
                          const std::string &instrumentNamePath);
-  void loadNexusEntriesIntoProperties(std::string nexusfilename);
+  void loadNexusEntriesIntoProperties(const std::string &nexusfilename);
   void loadDataIntoTheWorkSpace(NeXus::NXEntry &entry);
   void runLoadInstrument();
   void moveComponent(const std::string &, double);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadISISNexus2.h b/Framework/DataHandling/inc/MantidDataHandling/LoadISISNexus2.h
index 16f8fabe5d9..464d3ebe2a9 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadISISNexus2.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadISISNexus2.h
@@ -129,7 +129,7 @@ private:
   void createPeriodLogs(int64_t period,
                         DataObjects::Workspace2D_sptr &local_workspace);
   // Validate multi-period logs
-  void validateMultiPeriodLogs(Mantid::API::MatrixWorkspace_sptr);
+  void validateMultiPeriodLogs(const Mantid::API::MatrixWorkspace_sptr &);
 
   // build the list of spectra numbers to load and include in the spectra list
   void buildSpectraInd2SpectraNumMap(bool range_supplied, bool hasSpectraList,
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadInstrument.h b/Framework/DataHandling/inc/MantidDataHandling/LoadInstrument.h
index f806e3f60e3..af8bcd4fb77 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadInstrument.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadInstrument.h
@@ -82,12 +82,12 @@ private:
 
   /// Run the Child Algorithm LoadParameters
   void runLoadParameterFile(const boost::shared_ptr<API::MatrixWorkspace> &ws,
-                            std::string filename);
+                            const std::string &filename);
 
   /// Search directory for Parameter file, return full path name if found, else
   /// "".
-  std::string getFullPathParamIDF(std::string directoryName,
-                                  std::string filename);
+  std::string getFullPathParamIDF(const std::string &directoryName,
+                                  const std::string &filename);
 
   /// Mutex to avoid simultaneous access
   static std::recursive_mutex m_mutex;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadIsawDetCal.h b/Framework/DataHandling/inc/MantidDataHandling/LoadIsawDetCal.h
index c7ba4675acc..a9692c495fc 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadIsawDetCal.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadIsawDetCal.h
@@ -66,15 +66,15 @@ private:
 
   /// Set the center of the supplied detector name
   void center(const double x, const double y, const double z,
-              const std::string &detname, API::Workspace_sptr ws,
+              const std::string &detname, const API::Workspace_sptr &ws,
               Geometry::ComponentInfo &componentInfo);
 
-  Geometry::Instrument_sptr getCheckInst(API::Workspace_sptr ws);
+  Geometry::Instrument_sptr getCheckInst(const API::Workspace_sptr &ws);
   std::vector<std::string> getFilenames();
 
   void doRotation(Kernel::V3D rX, Kernel::V3D rY,
                   Geometry::ComponentInfo &componentInfo,
-                  boost::shared_ptr<const Geometry::IComponent> comp,
+                  const boost::shared_ptr<const Geometry::IComponent> &comp,
                   bool doWishCorrection = false);
   void applyScalings(
       API::Workspace_sptr &ws,
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadLog.h b/Framework/DataHandling/inc/MantidDataHandling/LoadLog.h
index 4649af305d4..34112bb1bc4 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadLog.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadLog.h
@@ -114,7 +114,7 @@ private:
 
   /// Create timeseries property from .log file and adds that to sample object
   void loadThreeColumnLogFile(std::ifstream &logFileStream,
-                              std::string logFileName, API::Run &run);
+                              const std::string &logFileName, API::Run &run);
 
   /// Loads two column log file data into local workspace
   void loadTwoColumnLogFile(std::ifstream &logFileStream,
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus.h b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus.h
index d945e813eab..b447ebc7abb 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus.h
@@ -75,7 +75,7 @@ public:
 protected:
   virtual void runLoadInstrumentFromNexus(DataObjects::Workspace2D_sptr) {}
   void checkOptionalProperties();
-  void runLoadInstrument(DataObjects::Workspace2D_sptr);
+  void runLoadInstrument(const DataObjects::Workspace2D_sptr &);
 
   /// The name and path of the input file
   std::string m_filename;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus1.h b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus1.h
index b6bd27025c9..a79a1ff9070 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus1.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus1.h
@@ -84,13 +84,13 @@ protected:
 private:
   void loadData(size_t hist, specnum_t &i, specnum_t specNo,
                 MuonNexusReader &nxload, const int64_t lengthIn,
-                DataObjects::Workspace2D_sptr localWorkspace);
+                const DataObjects::Workspace2D_sptr &localWorkspace);
   void runLoadMappingTable(DataObjects::Workspace2D_sptr);
-  void runLoadLog(DataObjects::Workspace2D_sptr);
-  void loadRunDetails(DataObjects::Workspace2D_sptr localWorkspace);
-  void addPeriodLog(DataObjects::Workspace2D_sptr localWorkspace,
+  void runLoadLog(const DataObjects::Workspace2D_sptr &);
+  void loadRunDetails(const DataObjects::Workspace2D_sptr &localWorkspace);
+  void addPeriodLog(const DataObjects::Workspace2D_sptr &localWorkspace,
                     int64_t period);
-  void addGoodFrames(DataObjects::Workspace2D_sptr localWorkspace,
+  void addGoodFrames(const DataObjects::Workspace2D_sptr &localWorkspace,
                      int64_t period, int nperiods);
 
   /// Loads dead time table for the detector
@@ -104,7 +104,7 @@ private:
   /// Loads detector grouping information
   API::Workspace_sptr
   loadDetectorGrouping(Mantid::NeXus::NXRoot &root,
-                       Mantid::Geometry::Instrument_const_sptr inst);
+                       const Mantid::Geometry::Instrument_const_sptr &inst);
 
   /// Creates Detector Grouping Table using all the data from the range
   DataObjects::TableWorkspace_sptr
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus2.h b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus2.h
index 027ca711809..0b43a3c127d 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus2.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus2.h
@@ -79,9 +79,9 @@ private:
   HistogramData::Histogram
   loadData(const Mantid::HistogramData::BinEdges &edges,
            const Mantid::NeXus::NXInt &counts, int period, int spec);
-  void loadLogs(API::MatrixWorkspace_sptr ws, Mantid::NeXus::NXEntry &entry,
-                int period);
-  void loadRunDetails(DataObjects::Workspace2D_sptr localWorkspace);
+  void loadLogs(const API::MatrixWorkspace_sptr &ws,
+                Mantid::NeXus::NXEntry &entry, int period);
+  void loadRunDetails(const DataObjects::Workspace2D_sptr &localWorkspace);
   std::map<int, std::set<int>>
   loadDetectorMapping(const Mantid::NeXus::NXInt &spectrumIndex);
 };
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadNexusLogs.h b/Framework/DataHandling/inc/MantidDataHandling/LoadNexusLogs.h
index 16888c9d70b..27d649c53b2 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadNexusLogs.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadNexusLogs.h
@@ -62,18 +62,22 @@ private:
   /// Load log data from a group
   void loadLogs(::NeXus::File &file, const std::string &entry_name,
                 const std::string &entry_class,
-                boost::shared_ptr<API::MatrixWorkspace> workspace) const;
+                const boost::shared_ptr<API::MatrixWorkspace> &workspace) const;
   /// Load an NXlog entry
-  void loadNXLog(::NeXus::File &file, const std::string &entry_name,
-                 const std::string &entry_class,
-                 boost::shared_ptr<API::MatrixWorkspace> workspace) const;
+  void
+  loadNXLog(::NeXus::File &file, const std::string &entry_name,
+            const std::string &entry_class,
+            const boost::shared_ptr<API::MatrixWorkspace> &workspace) const;
   /// Load an IXseblock entry
-  void loadSELog(::NeXus::File &file, const std::string &entry_name,
-                 boost::shared_ptr<API::MatrixWorkspace> workspace) const;
-  void loadVetoPulses(::NeXus::File &file,
-                      boost::shared_ptr<API::MatrixWorkspace> workspace) const;
-  void loadNPeriods(::NeXus::File &file,
-                    boost::shared_ptr<API::MatrixWorkspace> workspace) const;
+  void
+  loadSELog(::NeXus::File &file, const std::string &entry_name,
+            const boost::shared_ptr<API::MatrixWorkspace> &workspace) const;
+  void loadVetoPulses(
+      ::NeXus::File &file,
+      const boost::shared_ptr<API::MatrixWorkspace> &workspace) const;
+  void
+  loadNPeriods(::NeXus::File &file,
+               const boost::shared_ptr<API::MatrixWorkspace> &workspace) const;
 
   /// Progress reporting object
   boost::shared_ptr<API::Progress> m_progress;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadNexusMonitors2.h b/Framework/DataHandling/inc/MantidDataHandling/LoadNexusMonitors2.h
index 069b37ed9ca..f1ef867e401 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadNexusMonitors2.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadNexusMonitors2.h
@@ -82,8 +82,8 @@ private:
   void fixUDets(::NeXus::File &file);
 
   /// Load the logs
-  void runLoadLogs(const std::string filename,
-                   API::MatrixWorkspace_sptr localWorkspace);
+  void runLoadLogs(const std::string &filename,
+                   const API::MatrixWorkspace_sptr &localWorkspace);
 
   /// is it possible to open the file?
   bool canOpenAsNeXus(const std::string &fname);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadNexusProcessed.h b/Framework/DataHandling/inc/MantidDataHandling/LoadNexusProcessed.h
index 230499affc1..48b3d6ffa83 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadNexusProcessed.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadNexusProcessed.h
@@ -160,7 +160,7 @@ private:
 
   /// Read the bin masking information
   void readBinMasking(Mantid::NeXus::NXData &wksp_cls,
-                      API::MatrixWorkspace_sptr local_workspace);
+                      const API::MatrixWorkspace_sptr &local_workspace);
 
   /// Load a block of data into the workspace where it is assumed that the x
   /// bins have already been cached
@@ -169,7 +169,7 @@ private:
                  Mantid::NeXus::NXDataSetTyped<double> &farea, bool hasFArea,
                  Mantid::NeXus::NXDouble &xErrors, bool hasXErrors,
                  int blocksize, int nchannels, int &hist,
-                 API::MatrixWorkspace_sptr local_workspace);
+                 const API::MatrixWorkspace_sptr &local_workspace);
 
   /// Load a block of data into the workspace where it is assumed that the x
   /// bins have already been cached
@@ -178,7 +178,7 @@ private:
                  Mantid::NeXus::NXDataSetTyped<double> &farea, bool hasFArea,
                  Mantid::NeXus::NXDouble &xErrors, bool hasXErrors,
                  int blocksize, int nchannels, int &hist, int &wsIndex,
-                 API::MatrixWorkspace_sptr local_workspace);
+                 const API::MatrixWorkspace_sptr &local_workspace);
   /// Load a block of data into the workspace
   void loadBlock(Mantid::NeXus::NXDataSetTyped<double> &data,
                  Mantid::NeXus::NXDataSetTyped<double> &errors,
@@ -186,10 +186,10 @@ private:
                  Mantid::NeXus::NXDouble &xErrors, bool hasXErrors,
                  Mantid::NeXus::NXDouble &xbins, int blocksize, int nchannels,
                  int &hist, int &wsIndex,
-                 API::MatrixWorkspace_sptr local_workspace);
+                 const API::MatrixWorkspace_sptr &local_workspace);
 
   /// Load the data from a non-spectra axis (Numeric/Text) into the workspace
-  void loadNonSpectraAxis(API::MatrixWorkspace_sptr local_workspace,
+  void loadNonSpectraAxis(const API::MatrixWorkspace_sptr &local_workspace,
                           Mantid::NeXus::NXData &data);
 
   /// Validates the optional 'spectra to read' properties, if they have been set
@@ -232,8 +232,8 @@ private:
   std::unique_ptr<::NeXus::File> m_nexusFile;
 };
 /// to sort the algorithmhistory vector
-bool UDlesserExecCount(Mantid::NeXus::NXClassInfo elem1,
-                       Mantid::NeXus::NXClassInfo elem2);
+bool UDlesserExecCount(const Mantid::NeXus::NXClassInfo &elem1,
+                       const Mantid::NeXus::NXClassInfo &elem2);
 
 } // namespace DataHandling
 } // namespace Mantid
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadOff.h b/Framework/DataHandling/inc/MantidDataHandling/LoadOff.h
index a13fc65d749..eb30b111e84 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadOff.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadOff.h
@@ -25,7 +25,7 @@ Mantid::Kernel::Logger g_log("LoadOff");
 }
 class DLLExport LoadOff : public MeshFileIO {
 public:
-  LoadOff(std::string filename, ScaleUnits scaleType);
+  LoadOff(const std::string &filename, ScaleUnits scaleType);
   std::unique_ptr<Geometry::MeshObject> readOFFshape();
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadPDFgetNFile.h b/Framework/DataHandling/inc/MantidDataHandling/LoadPDFgetNFile.h
index 4d569896a9a..315da9cc9f6 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadPDFgetNFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadPDFgetNFile.h
@@ -46,7 +46,7 @@ private:
   int confidence(Kernel::FileDescriptor &descriptor) const override;
 
   /// Parse PDFgetN data file
-  void parseDataFile(std::string filename);
+  void parseDataFile(const std::string &filename);
 
   /// Check whether a string starts from a specified sub-string
   bool startsWith(const std::string &s, const std::string &header) const;
@@ -70,7 +70,7 @@ private:
   void generateDataWorkspace();
 
   /// Set X and Y axis unit and lebel
-  void setUnit(DataObjects::Workspace2D_sptr ws);
+  void setUnit(const DataObjects::Workspace2D_sptr &ws);
 
   void checkSameSize(const std::vector<size_t> &numptsvec, size_t numsets);
 };
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadPSIMuonBin.h b/Framework/DataHandling/inc/MantidDataHandling/LoadPSIMuonBin.h
index 113ec9642bf..05e96c92574 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadPSIMuonBin.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadPSIMuonBin.h
@@ -77,7 +77,8 @@ public:
 private:
   void init() override;
   void exec() override;
-  std::string getFormattedDateTime(std::string date, std::string time);
+  std::string getFormattedDateTime(const std::string &date,
+                                   const std::string &time);
   void assignOutputWorkspaceParticulars(
       DataObjects::Workspace2D_sptr &outputWorkspace);
   void readSingleVariables(Mantid::Kernel::BinaryStreamReader &streamReader);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadPreNexusMonitors.h b/Framework/DataHandling/inc/MantidDataHandling/LoadPreNexusMonitors.h
index 5684f3fd534..40e77ebfef2 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadPreNexusMonitors.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadPreNexusMonitors.h
@@ -55,7 +55,7 @@ private:
   bool instrument_loaded_correctly;
 
   void runLoadInstrument(const std::string &instrument,
-                         API::MatrixWorkspace_sptr localWorkspace);
+                         const API::MatrixWorkspace_sptr &localWorkspace);
 };
 
 } // namespace DataHandling
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h b/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h
index 79c99457f42..14fa413ddb7 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadRKH.h
@@ -74,7 +74,7 @@ private:
                              MantidVec &axis0Data);
   const std::string readUnit(const std::string &line);
   void readNumEntrys(const int nEntries, MantidVec &output);
-  void binCenter(const MantidVec oldBoundaries, MantidVec &toCenter) const;
+  void binCenter(const MantidVec &oldBoundaries, MantidVec &toCenter) const;
 
   // Remove lines from an input stream
   void skipLines(std::istream &strm, int nlines);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadRaw3.h b/Framework/DataHandling/inc/MantidDataHandling/LoadRaw3.h
index 71f95e5c32c..b8d7830f511 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadRaw3.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadRaw3.h
@@ -67,18 +67,18 @@ private:
   /// creates output workspace, monitors excluded from this workspace
   void excludeMonitors(FILE *file, const int &period,
                        const std::vector<specnum_t> &monitorList,
-                       DataObjects::Workspace2D_sptr ws_sptr);
+                       const DataObjects::Workspace2D_sptr &ws_sptr);
 
   /// creates output workspace whcih includes monitors
   void includeMonitors(FILE *file, const int64_t &period,
-                       DataObjects::Workspace2D_sptr ws_sptr);
+                       const DataObjects::Workspace2D_sptr &ws_sptr);
 
   /// creates two output workspaces none normal workspace and separate one for
   /// monitors
   void separateMonitors(FILE *file, const int64_t &period,
                         const std::vector<specnum_t> &monitorList,
-                        DataObjects::Workspace2D_sptr ws_sptr,
-                        DataObjects::Workspace2D_sptr mws_sptr);
+                        const DataObjects::Workspace2D_sptr &ws_sptr,
+                        const DataObjects::Workspace2D_sptr &mws_sptr);
 
   /// skip all spectra in a period
   void skipPeriod(FILE *file, const int64_t &period);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadRawHelper.h b/Framework/DataHandling/inc/MantidDataHandling/LoadRawHelper.h
index bb1d04fec7a..a58f0d23642 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadRawHelper.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadRawHelper.h
@@ -53,7 +53,7 @@ public:
   /// Opens Raw File
   FILE *openRawFile(const std::string &fileName);
   /// Read in run parameters Public so that LoadRaw2 can use it
-  void loadRunParameters(API::MatrixWorkspace_sptr localWorkspace,
+  void loadRunParameters(const API::MatrixWorkspace_sptr &localWorkspace,
                          ISISRAW *const = nullptr) const;
 
   /// Returns a confidence value that this algorithm can load a file
@@ -77,14 +77,15 @@ public:
                          API::WorkspaceGroup_sptr &mongrp_sptr,
                          const int64_t mwsSpecs, const int64_t nwsSpecs,
                          const int64_t numberOfPeriods, const int64_t lengthIn,
-                         std::string title, API::Algorithm *const pAlg);
+                         const std::string &title, API::Algorithm *const pAlg);
   /// creates  shared pointer to group workspace
   static API::WorkspaceGroup_sptr createGroupWorkspace();
 
   /// creates shared pointer to workspace from parent workspace
   static DataObjects::Workspace2D_sptr
-  createWorkspace(DataObjects::Workspace2D_sptr ws_sptr, int64_t nVectors = -1,
-                  int64_t xLengthIn = -1, int64_t yLengthIn = -1);
+  createWorkspace(const DataObjects::Workspace2D_sptr &ws_sptr,
+                  int64_t nVectors = -1, int64_t xLengthIn = -1,
+                  int64_t yLengthIn = -1);
 
   /// overloaded method to create shared pointer to workspace
   static DataObjects::Workspace2D_sptr
@@ -94,14 +95,14 @@ public:
   /// sets the workspace property
   static void setWorkspaceProperty(const std::string &propertyName,
                                    const std::string &title,
-                                   API::WorkspaceGroup_sptr grpws_sptr,
-                                   DataObjects::Workspace2D_sptr ws_sptr,
+                                   const API::WorkspaceGroup_sptr &grpws_sptr,
+                                   const DataObjects::Workspace2D_sptr &ws_sptr,
                                    int64_t numberOfPeriods, bool bMonitor,
                                    API::Algorithm *const pAlg);
 
   /// overloaded method to set the workspace property
-  static void setWorkspaceProperty(DataObjects::Workspace2D_sptr ws_sptr,
-                                   API::WorkspaceGroup_sptr grpws_sptr,
+  static void setWorkspaceProperty(const DataObjects::Workspace2D_sptr &ws_sptr,
+                                   const API::WorkspaceGroup_sptr &grpws_sptr,
                                    const int64_t period, bool bmonitors,
                                    API::Algorithm *const pAlg);
 
@@ -138,20 +139,20 @@ protected:
   getTimeChannels(const int64_t &regimes, const int64_t &lengthIn);
   /// loadinstrument Child Algorithm
   void runLoadInstrument(const std::string &fileName,
-                         DataObjects::Workspace2D_sptr, double, double);
+                         const DataObjects::Workspace2D_sptr &, double, double);
   /// loadinstrumentfromraw algorithm
   void runLoadInstrumentFromRaw(const std::string &fileName,
-                                DataObjects::Workspace2D_sptr);
+                                const DataObjects::Workspace2D_sptr &);
   /// loadinstrumentfromraw Child Algorithm
   void runLoadMappingTable(const std::string &fileName,
-                           DataObjects::Workspace2D_sptr);
+                           const DataObjects::Workspace2D_sptr &);
   /// load log algorithm
-  void runLoadLog(const std::string &fileName, DataObjects::Workspace2D_sptr,
-                  double, double);
+  void runLoadLog(const std::string &fileName,
+                  const DataObjects::Workspace2D_sptr &, double, double);
 
   /// Create the period specific logs
   void createPeriodLogs(int64_t period,
-                        DataObjects::Workspace2D_sptr local_workspace);
+                        const DataObjects::Workspace2D_sptr &local_workspace);
 
   /// gets the monitor spectrum list from the workspace
   std::vector<specnum_t>
@@ -159,7 +160,7 @@ protected:
 
   /// This method sets the raw file data to workspace vectors
   void setWorkspaceData(
-      DataObjects::Workspace2D_sptr newWorkspace,
+      const DataObjects::Workspace2D_sptr &newWorkspace,
       const std::vector<boost::shared_ptr<HistogramData::HistogramX>>
           &timeChannelsVec,
       int64_t wsIndex, specnum_t nspecNum, int64_t noTimeRegimes,
@@ -191,9 +192,10 @@ protected:
                                specnum_t &normalwsSpecs,
                                specnum_t &monitorwsSpecs);
   /// load the spectra
-  void loadSpectra(FILE *file, const int &period, const int &total_specs,
-                   DataObjects::Workspace2D_sptr ws_sptr,
-                   std::vector<boost::shared_ptr<HistogramData::HistogramX>>);
+  void loadSpectra(
+      FILE *file, const int &period, const int &total_specs,
+      const DataObjects::Workspace2D_sptr &ws_sptr,
+      const std::vector<boost::shared_ptr<HistogramData::HistogramX>> &);
 
   /// Has the spectrum_list property been set?
   bool m_list;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadSPE.h b/Framework/DataHandling/inc/MantidDataHandling/LoadSPE.h
index e0988a1b984..2625e5f3a2f 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadSPE.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadSPE.h
@@ -53,7 +53,7 @@ private:
   // Execution code
   void exec() override;
 
-  void readHistogram(FILE *speFile, API::MatrixWorkspace_sptr workspace,
+  void readHistogram(FILE *speFile, const API::MatrixWorkspace_sptr &workspace,
                      size_t index);
   void reportFormatError(const std::string &what);
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadSampleShape.h b/Framework/DataHandling/inc/MantidDataHandling/LoadSampleShape.h
index 3e6c44698d9..c14c313e1f7 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadSampleShape.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadSampleShape.h
@@ -51,7 +51,7 @@ private:
   void exec() override;
 };
 void DLLExport rotate(Geometry::MeshObject &sampleMesh,
-                      API::MatrixWorkspace_const_sptr inputWS);
+                      const API::MatrixWorkspace_const_sptr &inputWS);
 
 } // namespace DataHandling
 } // namespace Mantid
\ No newline at end of file
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadSassena.h b/Framework/DataHandling/inc/MantidDataHandling/LoadSassena.h
index a096ef48ae1..868bf2eaeec 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadSassena.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadSassena.h
@@ -62,26 +62,27 @@ public:
 
 protected:
   /// Add a workspace to the group and register in the analysis data service
-  void registerWorkspace(API::WorkspaceGroup_sptr gws, const std::string wsName,
-                         DataObjects::Workspace2D_sptr ws,
+  void registerWorkspace(const API::WorkspaceGroup_sptr &gws,
+                         const std::string &wsName,
+                         const DataObjects::Workspace2D_sptr &ws,
                          const std::string &description);
   /// Read info about one HDF5 dataset, log if error
-  herr_t dataSetInfo(const hid_t &h5file, const std::string setName,
+  herr_t dataSetInfo(const hid_t &h5file, const std::string &setName,
                      hsize_t *dims) const;
   /// Read dataset data to a buffer ot type double
-  herr_t dataSetDouble(const hid_t &h5file, const std::string setName,
+  herr_t dataSetDouble(const hid_t &h5file, const std::string &setName,
                        std::vector<double> &buf);
   /// Load qvectors dataset, calculate modulus of vectors
   HistogramData::Points loadQvectors(const hid_t &h5file,
-                                     API::WorkspaceGroup_sptr gws,
+                                     const API::WorkspaceGroup_sptr &gws,
                                      std::vector<int> &sorting_indexes);
   /// Load structure factor asa function of q-vector modulus
-  void loadFQ(const hid_t &h5file, API::WorkspaceGroup_sptr gws,
-              const std::string setName, const HistogramData::Points &qvmod,
+  void loadFQ(const hid_t &h5file, const API::WorkspaceGroup_sptr &gws,
+              const std::string &setName, const HistogramData::Points &qvmod,
               const std::vector<int> &sorting_indexes);
   /// Load time-dependent structure factor
-  void loadFQT(const hid_t &h5file, API::WorkspaceGroup_sptr gws,
-               const std::string setName, const HistogramData::Points &qvmod,
+  void loadFQT(const hid_t &h5file, const API::WorkspaceGroup_sptr &gws,
+               const std::string &setName, const HistogramData::Points &qvmod,
                const std::vector<int> &sorting_indexes);
 
 private:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadSpice2D.h b/Framework/DataHandling/inc/MantidDataHandling/LoadSpice2D.h
index d88b9cb7b75..44282d49fa1 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadSpice2D.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadSpice2D.h
@@ -93,7 +93,7 @@ private:
                       const std::string &fileName);
   /// Run LoadInstrument Child Algorithm
   void runLoadInstrument(const std::string &inst_name,
-                         DataObjects::Workspace2D_sptr localWorkspace);
+                         const DataObjects::Workspace2D_sptr &localWorkspace);
 
   void setInputPropertiesAsMemberProperties();
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadSpiceAscii.h b/Framework/DataHandling/inc/MantidDataHandling/LoadSpiceAscii.h
index 921e9c70de0..933ba795ff6 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadSpiceAscii.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadSpiceAscii.h
@@ -63,13 +63,13 @@ private:
                                 const std::string &timeformat);
 
   /// Set up run start time
-  void setupRunStartTime(API::MatrixWorkspace_sptr runinfows,
+  void setupRunStartTime(const API::MatrixWorkspace_sptr &runinfows,
                          const std::vector<std::string> &datetimeprop);
 
   /// Add property to workspace
   template <typename T>
-  void addProperty(API::MatrixWorkspace_sptr ws, const std::string &pname,
-                   T pvalue);
+  void addProperty(const API::MatrixWorkspace_sptr &ws,
+                   const std::string &pname, T pvalue);
 };
 
 } // namespace DataHandling
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadSpiceXML2DDet.h b/Framework/DataHandling/inc/MantidDataHandling/LoadSpiceXML2DDet.h
index d94532db83b..16779c56368 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadSpiceXML2DDet.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadSpiceXML2DDet.h
@@ -96,22 +96,25 @@ private:
 
   /// Set up sample logs from table workspace loaded where SPICE data file is
   /// loaded
-  void setupSampleLogFromSpiceTable(API::MatrixWorkspace_sptr matrixws,
-                                    API::ITableWorkspace_sptr spicetablews,
-                                    int ptnumber);
+  void
+  setupSampleLogFromSpiceTable(const API::MatrixWorkspace_sptr &matrixws,
+                               const API::ITableWorkspace_sptr &spicetablews,
+                               int ptnumber);
 
   /// Set up sample logs in the output workspace
-  bool setupSampleLogs(API::MatrixWorkspace_sptr outws);
+  bool setupSampleLogs(const API::MatrixWorkspace_sptr &outws);
 
   /// Load instrument
   void loadInstrument(API::MatrixWorkspace_sptr matrixws,
                       const std::string &idffilename);
 
   /// Get wavelength from workspace
-  bool getHB3AWavelength(API::MatrixWorkspace_sptr dataws, double &wavelength);
+  bool getHB3AWavelength(const API::MatrixWorkspace_sptr &dataws,
+                         double &wavelength);
 
   /// Set output workspace's X-axs as lab-frame Q space
-  void setXtoLabQ(API::MatrixWorkspace_sptr dataws, const double &wavelength);
+  void setXtoLabQ(const API::MatrixWorkspace_sptr &dataws,
+                  const double &wavelength);
 
   /// SPICE detector XML file
   std::string m_detXMLFileName;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadStl.h b/Framework/DataHandling/inc/MantidDataHandling/LoadStl.h
index 49241fa4bb8..70f438c3e3f 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadStl.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadStl.h
@@ -14,6 +14,10 @@
 #include <boost/functional/hash.hpp>
 #include <functional>
 #include <unordered_set>
+#include <utility>
+
+#include <utility>
+
 namespace {
 Mantid::Kernel::Logger g_logstl("LoadStl");
 }
@@ -45,11 +49,12 @@ struct V3DTrueComparator {
 class DLLExport LoadStl : public MeshFileIO {
 public:
   LoadStl(std::string filename, ScaleUnits scaleType)
-      : MeshFileIO(scaleType), m_filename(filename), m_setMaterial(false) {}
+      : MeshFileIO(scaleType), m_filename(std::move(std::move(filename))),
+        m_setMaterial(false) {}
   LoadStl(std::string filename, ScaleUnits scaleType,
           ReadMaterial::MaterialParameters params)
-      : MeshFileIO(scaleType), m_filename(filename), m_setMaterial(true),
-        m_params(params) {}
+      : MeshFileIO(scaleType), m_filename(std::move(std::move(filename))),
+        m_setMaterial(true), m_params(std::move(std::move(params))) {}
   virtual std::unique_ptr<Geometry::MeshObject> readStl() = 0;
   virtual ~LoadStl() = default;
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadStlFactory.h b/Framework/DataHandling/inc/MantidDataHandling/LoadStlFactory.h
index 07d00e4119f..5fa31d720d3 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadStlFactory.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadStlFactory.h
@@ -15,7 +15,7 @@ namespace DataHandling {
 
 class MANTID_DATAHANDLING_DLL LoadStlFactory {
 public:
-  static std::unique_ptr<LoadStl> createReader(std::string filename,
+  static std::unique_ptr<LoadStl> createReader(const std::string &filename,
                                                ScaleUnits scaleType) {
     std::unique_ptr<LoadStl> reader = nullptr;
     if (LoadBinaryStl::isBinarySTL(filename)) {
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadTBL.h b/Framework/DataHandling/inc/MantidDataHandling/LoadTBL.h
index f0735d097a4..b0b805b2b94 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadTBL.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadTBL.h
@@ -52,13 +52,13 @@ private:
   size_t getCells(std::string line, std::vector<std::string> &cols,
                   size_t expectedCommas, bool isOldTBL) const;
   /// count the number of commas in the line
-  size_t countCommas(std::string line) const;
+  size_t countCommas(const std::string &line) const;
   /// find all pairs of quotes in the line
-  size_t findQuotePairs(std::string line,
+  size_t findQuotePairs(const std::string &line,
                         std::vector<std::vector<size_t>> &quoteBounds) const;
   /// Parse more complex CSV, used when the data involves commas in the data and
   /// quoted values
-  void csvParse(std::string line, std::vector<std::string> &cols,
+  void csvParse(const std::string &line, std::vector<std::string> &cols,
                 std::vector<std::vector<size_t>> &quoteBounds,
                 size_t expectedCommas) const;
 };
diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadTOFRawNexus.h b/Framework/DataHandling/inc/MantidDataHandling/LoadTOFRawNexus.h
index e2275e1142d..2bced73be98 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/LoadTOFRawNexus.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/LoadTOFRawNexus.h
@@ -79,7 +79,8 @@ protected:
                       Mantid::NeXus::NXEntry &entry);
 
   void loadBank(const std::string &nexusfilename, const std::string &entry_name,
-                const std::string &bankName, API::MatrixWorkspace_sptr WS,
+                const std::string &bankName,
+                const API::MatrixWorkspace_sptr &WS,
                 const detid2index_map &id_to_wi);
 
   /// List of the absolute time of each pulse
diff --git a/Framework/DataHandling/inc/MantidDataHandling/MaskDetectors.h b/Framework/DataHandling/inc/MantidDataHandling/MaskDetectors.h
index 348d60b27da..bed7624a812 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/MaskDetectors.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/MaskDetectors.h
@@ -78,41 +78,42 @@ private:
 
   /// Choose how to mask given that we have a mask workspace
   void
-  handleMaskByMaskWorkspace(const DataObjects::MaskWorkspace_const_sptr maskWs,
-                            const API::MatrixWorkspace_const_sptr WS,
+  handleMaskByMaskWorkspace(const DataObjects::MaskWorkspace_const_sptr &maskWs,
+                            const API::MatrixWorkspace_const_sptr &WS,
                             std::vector<detid_t> &detectorList,
                             std::vector<size_t> &indexList,
                             const RangeInfo &rangeInfo);
 
   /// Choose how to mask given that we have a matrix workspace
-  void handleMaskByMatrixWorkspace(const API::MatrixWorkspace_const_sptr maskWs,
-                                   const API::MatrixWorkspace_const_sptr WS,
-                                   std::vector<detid_t> &detectorList,
-                                   std::vector<size_t> &indexList,
-                                   const RangeInfo &rangeInfo);
+  void
+  handleMaskByMatrixWorkspace(const API::MatrixWorkspace_const_sptr &maskWs,
+                              const API::MatrixWorkspace_const_sptr &WS,
+                              std::vector<detid_t> &detectorList,
+                              std::vector<size_t> &indexList,
+                              const RangeInfo &rangeInfo);
 
-  void execPeaks(DataObjects::PeaksWorkspace_sptr WS);
+  void execPeaks(const DataObjects::PeaksWorkspace_sptr &WS);
   void
   fillIndexListFromSpectra(std::vector<size_t> &indexList,
                            std::vector<Indexing::SpectrumNumber> spectraList,
-                           const API::MatrixWorkspace_sptr WS,
+                           const API::MatrixWorkspace_sptr &WS,
                            const RangeInfo &range_info);
   void appendToDetectorListFromComponentList(
       std::vector<detid_t> &detectorList,
       const std::vector<std::string> &componentList,
-      const API::MatrixWorkspace_const_sptr WS);
-  void
-  appendToIndexListFromWS(std::vector<size_t> &indexList,
-                          const API::MatrixWorkspace_const_sptr maskedWorkspace,
-                          const RangeInfo &range_info);
+      const API::MatrixWorkspace_const_sptr &WS);
+  void appendToIndexListFromWS(
+      std::vector<size_t> &indexList,
+      const API::MatrixWorkspace_const_sptr &maskedWorkspace,
+      const RangeInfo &range_info);
   void appendToDetectorListFromWS(
       std::vector<detid_t> &detectorList,
-      const API::MatrixWorkspace_const_sptr inputWs,
-      const API::MatrixWorkspace_const_sptr maskWs,
+      const API::MatrixWorkspace_const_sptr &inputWs,
+      const API::MatrixWorkspace_const_sptr &maskWs,
       const std::tuple<size_t, size_t, bool> &range_info);
   void appendToIndexListFromMaskWS(
       std::vector<size_t> &indexList,
-      const DataObjects::MaskWorkspace_const_sptr maskedWorkspace,
+      const DataObjects::MaskWorkspace_const_sptr &maskedWorkspace,
       const std::tuple<size_t, size_t, bool> &range_info);
   void
   extractMaskedWSDetIDs(std::vector<detid_t> &detectorList,
diff --git a/Framework/DataHandling/inc/MantidDataHandling/MaskDetectorsInShape.h b/Framework/DataHandling/inc/MantidDataHandling/MaskDetectorsInShape.h
index 3cfa902ea95..470d7a07065 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/MaskDetectorsInShape.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/MaskDetectorsInShape.h
@@ -58,11 +58,12 @@ private:
   void exec() override;
 
   // internal functions
-  std::vector<int> runFindDetectorsInShape(API::MatrixWorkspace_sptr workspace,
-                                           const std::string shapeXML,
-                                           const bool includeMonitors);
+  std::vector<int>
+  runFindDetectorsInShape(const API::MatrixWorkspace_sptr &workspace,
+                          const std::string &shapeXML,
+                          const bool includeMonitors);
   /// Calls MaskDetectors as a Child Algorithm
-  void runMaskDetectors(API::MatrixWorkspace_sptr workspace,
+  void runMaskDetectors(const API::MatrixWorkspace_sptr &workspace,
                         const std::vector<int> &detectorIds);
 };
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/MeshFileIO.h b/Framework/DataHandling/inc/MantidDataHandling/MeshFileIO.h
index cfaecf881b6..836cbfa262b 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/MeshFileIO.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/MeshFileIO.h
@@ -4,6 +4,10 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
+#include <utility>
+
 #include "MantidGeometry/Objects/MeshObject.h"
 #include "MantidKernel/Logger.h"
 #include "MantidKernel/Matrix.h"
@@ -32,7 +36,7 @@ public:
 
   boost::shared_ptr<Geometry::MeshObject>
   translate(boost::shared_ptr<Geometry::MeshObject> environmentMesh,
-            const std::vector<double> translationVector);
+            const std::vector<double> &translationVector);
 
   Kernel::V3D createScaledV3D(double xVal, double yVal, double zVal);
 
@@ -40,7 +44,8 @@ protected:
   MeshFileIO(ScaleUnits scaleType) : m_scaleType(scaleType) {}
   MeshFileIO(ScaleUnits scaleType, std::vector<uint32_t> triangles,
              std::vector<Kernel::V3D> vertices)
-      : m_scaleType(scaleType), m_triangle(triangles), m_vertices(vertices) {}
+      : m_scaleType(scaleType), m_triangle(std::move(std::move(triangles))),
+        m_vertices(std::move(std::move(vertices))) {}
   double scaleValue(double val) {
     switch (m_scaleType) {
     case ScaleUnits::centimetres:
diff --git a/Framework/DataHandling/inc/MantidDataHandling/PDLoadCharacterizations.h b/Framework/DataHandling/inc/MantidDataHandling/PDLoadCharacterizations.h
index 269124451da..0a56541102e 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/PDLoadCharacterizations.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/PDLoadCharacterizations.h
@@ -32,7 +32,7 @@ private:
   void init() override;
   void exec() override;
   std::vector<std::string> getFilenames();
-  int readFocusInfo(std::ifstream &file, const std::string filename);
+  int readFocusInfo(std::ifstream &file, const std::string &filename);
   void readCharInfo(std::ifstream &file, API::ITableWorkspace_sptr &wksp,
                     const std::string &filename, int linenum);
   void readVersion0(const std::string &filename,
diff --git a/Framework/DataHandling/inc/MantidDataHandling/ReadMaterial.h b/Framework/DataHandling/inc/MantidDataHandling/ReadMaterial.h
index 8333dba7bda..5b9e50cf67c 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/ReadMaterial.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/ReadMaterial.h
@@ -88,7 +88,7 @@ private:
    */
   Kernel::MaterialBuilder builder;
 
-  void setMaterial(const std::string chemicalSymbol, const int atomicNumber,
+  void setMaterial(const std::string &chemicalSymbol, const int atomicNumber,
                    const int massNumber);
 
   void
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SampleEnvironmentSpecParser.h b/Framework/DataHandling/inc/MantidDataHandling/SampleEnvironmentSpecParser.h
index c33a6590a50..78c8749ad34 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SampleEnvironmentSpecParser.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SampleEnvironmentSpecParser.h
@@ -55,10 +55,10 @@ private:
   boost::shared_ptr<Geometry::MeshObject>
   loadMeshFromSTL(Poco::XML::Element *stlfile) const;
   void LoadOptionalDoubleFromXML(Poco::XML::Element *componentElement,
-                                 std::string elementName,
+                                 const std::string &elementName,
                                  double &targetVariable) const;
   std::vector<double>
-  parseTranslationVector(std::string translationVectorStr) const;
+  parseTranslationVector(const std::string &translationVectorStr) const;
   // Members
   MaterialsIndex m_materials;
   std::string m_filepath;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveAscii2.h b/Framework/DataHandling/inc/MantidDataHandling/SaveAscii2.h
index 42390a7540b..f8200d93c8d 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveAscii2.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveAscii2.h
@@ -71,7 +71,7 @@ private:
   void init() override;
   /// Overwrites Algorithm method
   void exec() override;
-  void writeTableWorkspace(API::ITableWorkspace_const_sptr tws,
+  void writeTableWorkspace(const API::ITableWorkspace_const_sptr &tws,
                            const std::string &filename, bool appendToFile,
                            bool writeHeader, int prec, bool scientific,
                            const std::string &comment);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveCSV.h b/Framework/DataHandling/inc/MantidDataHandling/SaveCSV.h
index d5cc8447598..90f55bf118c 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveCSV.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveCSV.h
@@ -93,7 +93,7 @@ private:
 
   /// Saves out x errors
   void saveXerrors(std::ofstream &stream,
-                   const Mantid::DataObjects::Workspace2D_sptr workspace,
+                   const Mantid::DataObjects::Workspace2D_sptr &workspace,
                    const size_t numberOfHist);
 
   /// The name of the file used for storing the workspace
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveCalFile.h b/Framework/DataHandling/inc/MantidDataHandling/SaveCalFile.h
index 00a1032d55f..4517ae2f211 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveCalFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveCalFile.h
@@ -46,9 +46,9 @@ public:
   }
 
   void saveCalFile(const std::string &calFileName,
-                   Mantid::DataObjects::GroupingWorkspace_sptr groupWS,
-                   Mantid::DataObjects::OffsetsWorkspace_sptr offsetsWS,
-                   Mantid::DataObjects::MaskWorkspace_sptr maskWS);
+                   const Mantid::DataObjects::GroupingWorkspace_sptr &groupWS,
+                   const Mantid::DataObjects::OffsetsWorkspace_sptr &offsetsWS,
+                   const Mantid::DataObjects::MaskWorkspace_sptr &maskWS);
 
 private:
   /// Initialise the properties
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveDetectorsGrouping.h b/Framework/DataHandling/inc/MantidDataHandling/SaveDetectorsGrouping.h
index fc19656f86a..c074c823132 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveDetectorsGrouping.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveDetectorsGrouping.h
@@ -53,8 +53,8 @@ private:
       std::map<int, std::vector<detid_t>> &groupdetidrangemap);
 
   /// Print Grouping to XML file
-  void printToXML(std::map<int, std::vector<detid_t>> groupdetidrangemap,
-                  std::string xmlfilename);
+  void printToXML(const std::map<int, std::vector<detid_t>> &groupdetidrangemap,
+                  const std::string &xmlfilename);
 
   // GroupingWorkspace
   DataObjects::GroupingWorkspace_const_sptr mGroupWS;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveDiffCal.h b/Framework/DataHandling/inc/MantidDataHandling/SaveDiffCal.h
index 89bdadbcf61..31208c7163e 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveDiffCal.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveDiffCal.h
@@ -37,8 +37,9 @@ private:
 
   void writeDoubleFieldFromTable(H5::Group &group, const std::string &name);
   void writeIntFieldFromTable(H5::Group &group, const std::string &name);
-  void writeIntFieldFromSVWS(H5::Group &group, const std::string &name,
-                             DataObjects::SpecialWorkspace2D_const_sptr ws);
+  void
+  writeIntFieldFromSVWS(H5::Group &group, const std::string &name,
+                        const DataObjects::SpecialWorkspace2D_const_sptr &ws);
   void generateDetidToIndex();
   bool tableHasColumn(const std::string &ColumnName) const;
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveDiffFittingAscii.h b/Framework/DataHandling/inc/MantidDataHandling/SaveDiffFittingAscii.h
index ed595087a6c..3c21f96289b 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveDiffFittingAscii.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveDiffFittingAscii.h
@@ -57,7 +57,7 @@ private:
   std::map<std::string, std::string> validateInputs() override;
 
   /// Main exec routine, called for group or individual workspace processing.
-  void processAll(const std::vector<API::ITableWorkspace_sptr> input_ws);
+  void processAll(const std::vector<API::ITableWorkspace_sptr> &input_ws);
 
   std::vector<std::string> splitList(std::string strList);
 
@@ -67,8 +67,8 @@ private:
   void writeHeader(const std::vector<std::string> &columnHeadings,
                    std::ofstream &file);
 
-  void writeData(const API::ITableWorkspace_sptr workspace, std::ofstream &file,
-                 const size_t columnSize);
+  void writeData(const API::ITableWorkspace_sptr &workspace,
+                 std::ofstream &file, const size_t columnSize);
 
   void writeVal(const std::string &val, std::ofstream &file,
                 const bool endline);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveDspacemap.h b/Framework/DataHandling/inc/MantidDataHandling/SaveDspacemap.h
index 8a8bffd0901..37581742e89 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveDspacemap.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveDspacemap.h
@@ -39,9 +39,9 @@ private:
   /// Run the algorithm
   void exec() override;
 
-  void
-  CalculateDspaceFromCal(Mantid::DataObjects::OffsetsWorkspace_sptr offsetsWS,
-                         std::string DFileName);
+  void CalculateDspaceFromCal(
+      const Mantid::DataObjects::OffsetsWorkspace_sptr &offsetsWS,
+      const std::string &DFileName);
 };
 
 } // namespace DataHandling
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveFITS.h b/Framework/DataHandling/inc/MantidDataHandling/SaveFITS.h
index 9542b929f17..9c4afe889aa 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveFITS.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveFITS.h
@@ -36,20 +36,20 @@ private:
 
   std::map<std::string, std::string> validateInputs() override;
 
-  void saveFITSImage(const API::MatrixWorkspace_sptr img,
+  void saveFITSImage(const API::MatrixWorkspace_sptr &img,
                      const std::string &filename);
 
-  void writeFITSHeaderBlock(const API::MatrixWorkspace_sptr img,
+  void writeFITSHeaderBlock(const API::MatrixWorkspace_sptr &img,
                             std::ofstream &file);
 
-  void writeFITSImageMatrix(const API::MatrixWorkspace_sptr img,
+  void writeFITSImageMatrix(const API::MatrixWorkspace_sptr &img,
                             std::ofstream &file);
 
   void writeFITSHeaderEntry(const std::string &hdr, std::ofstream &file);
 
   std::string makeBitDepthHeader(size_t depth) const;
 
-  void writeFITSHeaderAxesSizes(const API::MatrixWorkspace_sptr img,
+  void writeFITSHeaderAxesSizes(const API::MatrixWorkspace_sptr &img,
                                 std::ofstream &file);
 
   void writePaddingFITSHeaders(size_t count, std::ofstream &file);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveFullprofResolution.h b/Framework/DataHandling/inc/MantidDataHandling/SaveFullprofResolution.h
index 5dd4317b12d..2ce04b6bce0 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveFullprofResolution.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveFullprofResolution.h
@@ -57,7 +57,7 @@ private:
   void parseTableWorkspace();
 
   /// Check wether a profile parameter map has the parameter
-  bool has_key(std::map<std::string, double> profmap, std::string key);
+  bool has_key(std::map<std::string, double> profmap, const std::string &key);
 
   /// Map containing the name of value of each parameter required by .irf file
   std::map<std::string, double> m_profileParamMap;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveGSASInstrumentFile.h b/Framework/DataHandling/inc/MantidDataHandling/SaveGSASInstrumentFile.h
index 0ac855d14a3..a0024f2f5b4 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveGSASInstrumentFile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveGSASInstrumentFile.h
@@ -66,7 +66,7 @@ private:
 
   /// Parse profile table workspace to a map
   void parseProfileTableWorkspace(
-      API::ITableWorkspace_sptr ws,
+      const API::ITableWorkspace_sptr &ws,
       std::map<unsigned int, std::map<std::string, double>> &profilemap);
 
   /// Convert to GSAS instrument file
@@ -113,7 +113,7 @@ private:
                            const std::string &paramname);
 
   /// Load fullprof resolution file.
-  void loadFullprofResolutionFile(std::string irffilename);
+  void loadFullprofResolutionFile(const std::string &irffilename);
 
   /// Calcualte d-space value.
   double calDspRange(double dtt1, double zero, double tof);
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveIsawDetCal.h b/Framework/DataHandling/inc/MantidDataHandling/SaveIsawDetCal.h
index e3a928646e4..2589c5a0b39 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveIsawDetCal.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveIsawDetCal.h
@@ -46,9 +46,9 @@ private:
   /// Run the algorithm
   void exec() override;
   /// find position for rectangular and non-rectangular
-  Kernel::V3D findPixelPos(std::string bankName, int col, int row);
-  void sizeBanks(std::string bankName, int &NCOLS, int &NROWS, double &xsize,
-                 double &ysize);
+  Kernel::V3D findPixelPos(const std::string &bankName, int col, int row);
+  void sizeBanks(const std::string &bankName, int &NCOLS, int &NROWS,
+                 double &xsize, double &ysize);
   Geometry::Instrument_const_sptr inst;
 };
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveNXTomo.h b/Framework/DataHandling/inc/MantidDataHandling/SaveNXTomo.h
index 8bef56681d2..7a681a780a2 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveNXTomo.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveNXTomo.h
@@ -87,16 +87,16 @@ private:
   ::NeXus::File setupFile();
 
   /// Writes a single workspace into the file
-  void writeSingleWorkspace(const DataObjects::Workspace2D_sptr workspace,
+  void writeSingleWorkspace(const DataObjects::Workspace2D_sptr &workspace,
                             ::NeXus::File &nxFile);
 
   /// Write various pieces of data from the workspace log with checks on the
   /// structure of the nexus file
-  void writeLogValues(const DataObjects::Workspace2D_sptr workspace,
+  void writeLogValues(const DataObjects::Workspace2D_sptr &workspace,
                       ::NeXus::File &nxFile, int thisFileInd);
-  void writeIntensityValue(const DataObjects::Workspace2D_sptr workspace,
+  void writeIntensityValue(const DataObjects::Workspace2D_sptr &workspace,
                            ::NeXus::File &nxFile, int thisFileInd);
-  void writeImageKeyValue(const DataObjects::Workspace2D_sptr workspace,
+  void writeImageKeyValue(const DataObjects::Workspace2D_sptr &workspace,
                           ::NeXus::File &nxFile, int thisFileInd);
 
   /// Main exec routine, called for group or individual workspace processing.
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveNexusProcessed.h b/Framework/DataHandling/inc/MantidDataHandling/SaveNexusProcessed.h
index 9f918dd374b..89c4f0f0f53 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveNexusProcessed.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveNexusProcessed.h
@@ -74,8 +74,9 @@ protected:
   void exec() override;
 
 private:
-  void getWSIndexList(std::vector<int> &indices,
-                      Mantid::API::MatrixWorkspace_const_sptr matrixWorkspace);
+  void getWSIndexList(
+      std::vector<int> &indices,
+      const Mantid::API::MatrixWorkspace_const_sptr &matrixWorkspace);
 
   template <class T>
   static void appendEventListData(const std::vector<T> &events, size_t offset,
@@ -88,7 +89,7 @@ private:
   void setOtherProperties(IAlgorithm *alg, const std::string &propertyName,
                           const std::string &propertyValue,
                           int perioidNum) override;
-  void doExec(Mantid::API::Workspace_sptr inputWorkspace,
+  void doExec(const Mantid::API::Workspace_sptr &inputWorkspace,
               boost::shared_ptr<Mantid::NeXus::NexusFileIO> &nexusFile,
               const bool keepFile = false,
               boost::optional<size_t> entryNumber = boost::optional<size_t>());
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SavePDFGui.h b/Framework/DataHandling/inc/MantidDataHandling/SavePDFGui.h
index 8450d6896e7..8c95297a31f 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SavePDFGui.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SavePDFGui.h
@@ -36,8 +36,9 @@ private:
   void init() override;
   void exec() override;
   void writeMetaData(std::ofstream &out,
-                     API::MatrixWorkspace_const_sptr inputWS);
-  void writeWSData(std::ofstream &out, API::MatrixWorkspace_const_sptr inputWS);
+                     const API::MatrixWorkspace_const_sptr &inputWS);
+  void writeWSData(std::ofstream &out,
+                   const API::MatrixWorkspace_const_sptr &inputWS);
 };
 
 } // namespace DataHandling
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveRMCProfile.h b/Framework/DataHandling/inc/MantidDataHandling/SaveRMCProfile.h
index eeb3cb7e721..c8c67ab28d4 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveRMCProfile.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveRMCProfile.h
@@ -36,8 +36,9 @@ private:
   void init() override;
   void exec() override;
   void writeMetaData(std::ofstream &out,
-                     API::MatrixWorkspace_const_sptr inputWS);
-  void writeWSData(std::ofstream &out, API::MatrixWorkspace_const_sptr inputWS);
+                     const API::MatrixWorkspace_const_sptr &inputWS);
+  void writeWSData(std::ofstream &out,
+                   const API::MatrixWorkspace_const_sptr &inputWS);
 };
 
 } // namespace DataHandling
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveReflectometryAscii.h b/Framework/DataHandling/inc/MantidDataHandling/SaveReflectometryAscii.h
index 3bc16d6fc80..f809ddceca5 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveReflectometryAscii.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveReflectometryAscii.h
@@ -49,22 +49,22 @@ private:
   /// Algorithm execution for WorkspaceGroups
   bool processGroups() override;
   /// Check file validity
-  void checkFile(const std::string filename);
+  void checkFile(const std::string &filename);
   /// Write the data
   void data();
   /// Print a double value to file
   void outputval(double val);
   /// Write a string value
-  bool writeString(bool write, std::string s);
+  bool writeString(bool write, const std::string &s);
   /// Print a string value to file
-  void outputval(std::string val);
+  void outputval(const std::string &val);
   /// Retrieve sample log value
   std::string sampleLogValue(const std::string &logName);
   /// Retrieve sample log unit
   std::string sampleLogUnit(const std::string &logName);
   /// Write one header line
-  void writeInfo(const std::string logName,
-                 const std::string logNameFixed = "");
+  void writeInfo(const std::string &logName,
+                 const std::string &logNameFixed = "");
   /// Write header
   void header();
   /// Determine the separator
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveSPE.h b/Framework/DataHandling/inc/MantidDataHandling/SaveSPE.h
index 52ff3ccbfa9..e755e6695aa 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveSPE.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveSPE.h
@@ -82,9 +82,9 @@ private:
 
   void writeSPEFile(FILE *outSPEFile,
                     const API::MatrixWorkspace_const_sptr &inputWS);
-  void writeHists(const API::MatrixWorkspace_const_sptr WS,
+  void writeHists(const API::MatrixWorkspace_const_sptr &WS,
                   FILE *const outFile);
-  void writeHist(const API::MatrixWorkspace_const_sptr WS, FILE *const outFile,
+  void writeHist(const API::MatrixWorkspace_const_sptr &WS, FILE *const outFile,
                  const int wsIn) const;
   void writeMaskFlags(FILE *const outFile) const;
   void writeBins(const std::vector<double> &Vs, FILE *const outFile) const;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveStl.h b/Framework/DataHandling/inc/MantidDataHandling/SaveStl.h
index bfcfd68fe13..5ef1d1bac01 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveStl.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveStl.h
@@ -6,6 +6,10 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #pragma once
 
+#include <utility>
+
+#include <utility>
+
 #include "MantidDataHandling/MeshFileIO.h"
 #include "MantidKernel/BinaryStreamWriter.h"
 #include "MantidKernel/Logger.h"
@@ -25,9 +29,10 @@ enum class ScaleUnits;
  */
 class DLLExport SaveStl : public MeshFileIO {
 public:
-  SaveStl(const std::string &filename, const std::vector<uint32_t> triangle,
+  SaveStl(const std::string &filename, const std::vector<uint32_t> &triangle,
           std::vector<Kernel::V3D> vertices, ScaleUnits scaleType)
-      : MeshFileIO(scaleType, triangle, vertices), m_filename(filename) {}
+      : MeshFileIO(scaleType, triangle, std::move(std::move(vertices))),
+        m_filename(filename) {}
 
   void writeStl();
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveTBL.h b/Framework/DataHandling/inc/MantidDataHandling/SaveTBL.h
index dd647e3b3ac..8e47983f277 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveTBL.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveTBL.h
@@ -53,7 +53,7 @@ private:
   /// the separator
   const char m_sep;
   // populates the map and vector containing grouping information
-  void findGroups(API::ITableWorkspace_sptr ws);
+  void findGroups(const API::ITableWorkspace_sptr &ws);
   /// Map the separator options to their string equivalents
   std::map<int, std::vector<size_t>> m_stichgroups;
   std::vector<size_t> m_nogroup;
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SaveToSNSHistogramNexus.h b/Framework/DataHandling/inc/MantidDataHandling/SaveToSNSHistogramNexus.h
index 95eac01ee17..4d581a2352b 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SaveToSNSHistogramNexus.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SaveToSNSHistogramNexus.h
@@ -95,12 +95,13 @@ private:
   int copy_file(const char *inFile, int nx_read_access, const char *outFile,
                 int nx_write_access);
 
-  int WriteOutDataOrErrors(Geometry::RectangularDetector_const_sptr det,
+  int WriteOutDataOrErrors(const Geometry::RectangularDetector_const_sptr &det,
                            int x_pixel_slab, const char *field_name,
                            const char *errors_field_name, bool doErrors,
-                           bool doBoth, int is_definition, std::string bank);
+                           bool doBoth, int is_definition,
+                           const std::string &bank);
 
-  int WriteDataGroup(std::string bank, int is_definition);
+  int WriteDataGroup(const std::string &bank, int is_definition);
 
   //
   //      // For iterating through the HDF file...
diff --git a/Framework/DataHandling/inc/MantidDataHandling/SetScalingPSD.h b/Framework/DataHandling/inc/MantidDataHandling/SetScalingPSD.h
index d177bea3bfe..55c7170d7b4 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/SetScalingPSD.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/SetScalingPSD.h
@@ -86,7 +86,8 @@ private:
                std::map<int, Kernel::V3D> &posMap,
                std::map<int, double> &scaleMap);
   /// read the positions of detectors defined in the raw file
-  void getDetPositionsFromRaw(std::string rawfile, std::vector<int> &detID,
+  void getDetPositionsFromRaw(const std::string &rawfile,
+                              std::vector<int> &detID,
                               std::vector<Kernel::V3D> &pos);
 };
 
diff --git a/Framework/DataHandling/inc/MantidDataHandling/XmlHandler.h b/Framework/DataHandling/inc/MantidDataHandling/XmlHandler.h
index b40b4c2f7dc..3042711456f 100644
--- a/Framework/DataHandling/inc/MantidDataHandling/XmlHandler.h
+++ b/Framework/DataHandling/inc/MantidDataHandling/XmlHandler.h
@@ -21,7 +21,7 @@ namespace DataHandling {
 class MANTID_DATAHANDLING_DLL XmlHandler {
 public:
   XmlHandler() = default;
-  XmlHandler(std::string);
+  XmlHandler(const std::string &);
 
   std::map<std::string, std::string>
   get_metadata(const std::vector<std::string> &tags_to_ignore);
diff --git a/Framework/DataHandling/src/AppendGeometryToSNSNexus.cpp b/Framework/DataHandling/src/AppendGeometryToSNSNexus.cpp
index 9a5ac5075e1..762cf3c6ecc 100644
--- a/Framework/DataHandling/src/AppendGeometryToSNSNexus.cpp
+++ b/Framework/DataHandling/src/AppendGeometryToSNSNexus.cpp
@@ -360,8 +360,8 @@ AppendGeometryToSNSNexus::getInstrumentName(const std::string &nxfilename) {
  */
 
 bool AppendGeometryToSNSNexus::runLoadInstrument(
-    const std::string &idf_filename, API::MatrixWorkspace_sptr localWorkspace,
-    Algorithm *alg) {
+    const std::string &idf_filename,
+    const API::MatrixWorkspace_sptr &localWorkspace, Algorithm *alg) {
   IAlgorithm_sptr loadInst = createChildAlgorithm("LoadInstrument", 0, 1, true);
 
   // Execute the Child Algorithm.
@@ -399,8 +399,8 @@ bool AppendGeometryToSNSNexus::runLoadInstrument(
  * @return true if successful.
  */
 bool AppendGeometryToSNSNexus::runLoadNexusLogs(
-    const std::string &nexusFileName, API::MatrixWorkspace_sptr localWorkspace,
-    Algorithm *alg) {
+    const std::string &nexusFileName,
+    const API::MatrixWorkspace_sptr &localWorkspace, Algorithm *alg) {
   IAlgorithm_sptr loadLogs =
       alg->createChildAlgorithm("LoadNexusLogs", 0, 1, true);
 
diff --git a/Framework/DataHandling/src/BankPulseTimes.cpp b/Framework/DataHandling/src/BankPulseTimes.cpp
index 0340ff8d403..02e4ed4436b 100644
--- a/Framework/DataHandling/src/BankPulseTimes.cpp
+++ b/Framework/DataHandling/src/BankPulseTimes.cpp
@@ -98,7 +98,8 @@ BankPulseTimes::~BankPulseTimes() { delete[] this->pulseTimes; }
  * @return true if the pulse times are the same and so don't need to be
  * reloaded.
  */
-bool BankPulseTimes::equals(size_t otherNumPulse, std::string otherStartTime) {
+bool BankPulseTimes::equals(size_t otherNumPulse,
+                            const std::string &otherStartTime) {
   return ((this->startTime == otherStartTime) &&
           (this->numPulses == otherNumPulse));
 }
diff --git a/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp b/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp
index 95001bd039d..aa449170b9d 100644
--- a/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp
+++ b/Framework/DataHandling/src/CreateChunkingFromInstrument.cpp
@@ -216,7 +216,7 @@ bool startsWith(const string &str, const string &prefix) {
  * @return The correct parent name. This is an empty string if the name
  * isn't found.
  */
-string parentName(IComponent_const_sptr comp, const string &prefix) {
+string parentName(const IComponent_const_sptr &comp, const string &prefix) {
   // handle the special case of the component has the name
   if (startsWith(comp->getName(), prefix))
     return comp->getName();
@@ -242,7 +242,8 @@ string parentName(IComponent_const_sptr comp, const string &prefix) {
  * @return The correct parent name. This is an empty string if the name
  * isn't found.
  */
-string parentName(IComponent_const_sptr comp, const vector<string> &names) {
+string parentName(const IComponent_const_sptr &comp,
+                  const vector<string> &names) {
   // handle the special case of the component has the name
   for (const auto &name : names)
     if (name == comp->getName())
diff --git a/Framework/DataHandling/src/CreateSimulationWorkspace.cpp b/Framework/DataHandling/src/CreateSimulationWorkspace.cpp
index d22473db939..e0866c6462a 100644
--- a/Framework/DataHandling/src/CreateSimulationWorkspace.cpp
+++ b/Framework/DataHandling/src/CreateSimulationWorkspace.cpp
@@ -38,7 +38,7 @@ struct StartAndEndTime {
   Mantid::Types::Core::DateAndTime endTime;
 };
 
-StartAndEndTime getStartAndEndTimesFromRawFile(std::string filename) {
+StartAndEndTime getStartAndEndTimesFromRawFile(const std::string &filename) {
   FILE *rawFile = fopen(filename.c_str(), "rb");
   if (!rawFile)
     throw std::runtime_error("Cannot open RAW file for reading: " + filename);
@@ -58,7 +58,7 @@ StartAndEndTime getStartAndEndTimesFromRawFile(std::string filename) {
 }
 
 StartAndEndTime getStartAndEndTimesFromNexusFile(
-    std::string filename,
+    const std::string &filename,
     const Mantid::Types::Core::DateAndTime &startTimeDefault,
     const Mantid::Types::Core::DateAndTime &endTimeDefault) {
   StartAndEndTime startAndEndTime;
@@ -411,7 +411,7 @@ void CreateSimulationWorkspace::adjustInstrument(const std::string &filename) {
  * @param workspace: dummy workspace
  */
 void CreateSimulationWorkspace::setStartDate(
-    API::MatrixWorkspace_sptr workspace) {
+    const API::MatrixWorkspace_sptr &workspace) {
   const std::string detTableFile = getProperty("DetectorTableFilename");
   auto hasDetTableFile = !detTableFile.empty();
   auto &run = workspace->mutableRun();
diff --git a/Framework/DataHandling/src/DataBlockComposite.cpp b/Framework/DataHandling/src/DataBlockComposite.cpp
index e8c7da11196..fe4c1e8bb4e 100644
--- a/Framework/DataHandling/src/DataBlockComposite.cpp
+++ b/Framework/DataHandling/src/DataBlockComposite.cpp
@@ -256,7 +256,7 @@ std::unique_ptr<DataBlockGenerator> DataBlockComposite::getGenerator() const {
   return std::make_unique<DataBlockGenerator>(intervals);
 }
 
-void DataBlockComposite::addDataBlock(DataBlock dataBlock) {
+void DataBlockComposite::addDataBlock(const DataBlock &dataBlock) {
   // Set the number of periods, number of spectra and number of channel
   m_numberOfPeriods = dataBlock.getNumberOfPeriods();
   m_numberOfChannels = dataBlock.getNumberOfChannels();
diff --git a/Framework/DataHandling/src/DetermineChunking.cpp b/Framework/DataHandling/src/DetermineChunking.cpp
index bb1455036aa..fe074a28eee 100644
--- a/Framework/DataHandling/src/DetermineChunking.cpp
+++ b/Framework/DataHandling/src/DetermineChunking.cpp
@@ -292,7 +292,7 @@ void DetermineChunking::exec() {
 }
 
 /// set the name of the top level NXentry m_top_entry_name
-std::string DetermineChunking::setTopEntryName(std::string filename) {
+std::string DetermineChunking::setTopEntryName(const std::string &filename) {
   std::string top_entry_name;
   using string_map_t = std::map<std::string, std::string>;
   try {
diff --git a/Framework/DataHandling/src/EventWorkspaceCollection.cpp b/Framework/DataHandling/src/EventWorkspaceCollection.cpp
index 860edfe1f73..459a890bd5b 100644
--- a/Framework/DataHandling/src/EventWorkspaceCollection.cpp
+++ b/Framework/DataHandling/src/EventWorkspaceCollection.cpp
@@ -162,7 +162,7 @@ EventWorkspaceCollection::getSpectrum(const size_t index) const {
   return m_WsVec[0]->getSpectrum(index);
 }
 void EventWorkspaceCollection::setSpectrumNumbersFromUniqueSpectra(
-    const std::set<int> uniqueSpectra) {
+    const std::set<int> &uniqueSpectra) {
   // For each workspace, update all the spectrum numbers
   for (auto &ws : m_WsVec) {
     size_t counter = 0;
@@ -279,14 +279,14 @@ void EventWorkspaceCollection::setWidth(const float flag) {
   }
 }
 
-void EventWorkspaceCollection::setTitle(std::string title) {
+void EventWorkspaceCollection::setTitle(const std::string &title) {
   for (auto &ws : m_WsVec) {
     ws->setTitle(title);
   }
 }
 
 void EventWorkspaceCollection::applyFilter(
-    boost::function<void(MatrixWorkspace_sptr)> func) {
+    const boost::function<void(MatrixWorkspace_sptr)> &func) {
   for (auto &ws : m_WsVec) {
     func(ws);
   }
diff --git a/Framework/DataHandling/src/FilterEventsByLogValuePreNexus.cpp b/Framework/DataHandling/src/FilterEventsByLogValuePreNexus.cpp
index 1ace0758f27..813d39664b6 100644
--- a/Framework/DataHandling/src/FilterEventsByLogValuePreNexus.cpp
+++ b/Framework/DataHandling/src/FilterEventsByLogValuePreNexus.cpp
@@ -671,8 +671,8 @@ void FilterEventsByLogValuePreNexus::processEventLogs() {
  * @param logtitle :: title of the log to be inserted to workspace
  * @param mindex ::  index of the the series in the wrong detectors map
  */
-void FilterEventsByLogValuePreNexus::addToWorkspaceLog(std::string logtitle,
-                                                       size_t mindex) {
+void FilterEventsByLogValuePreNexus::addToWorkspaceLog(
+    const std::string &logtitle, size_t mindex) {
   // Create TimeSeriesProperty
   auto property = new TimeSeriesProperty<double>(logtitle);
 
@@ -770,7 +770,8 @@ void FilterEventsByLogValuePreNexus::doStatToEventLog(size_t mindex) {
  *  geometry
  */
 void FilterEventsByLogValuePreNexus::runLoadInstrument(
-    const std::string &eventfilename, MatrixWorkspace_sptr localWorkspace) {
+    const std::string &eventfilename,
+    const MatrixWorkspace_sptr &localWorkspace) {
   // start by getting just the filename
   string instrument = Poco::Path(eventfilename).getFileName();
 
@@ -2118,7 +2119,7 @@ void FilterEventsByLogValuePreNexus::filterEventsLinear(
  * We want to pad out empty pixels: monitor
  */
 size_t FilterEventsByLogValuePreNexus::padOutEmptyPixels(
-    DataObjects::EventWorkspace_sptr eventws) {
+    const DataObjects::EventWorkspace_sptr &eventws) {
   const auto &detectorInfo = eventws->detectorInfo();
   const auto &detIDs = detectorInfo.detectorIDs();
 
@@ -2158,7 +2159,7 @@ size_t FilterEventsByLogValuePreNexus::padOutEmptyPixels(
  * pixel-spectrum map
  */
 void FilterEventsByLogValuePreNexus::setupPixelSpectrumMap(
-    DataObjects::EventWorkspace_sptr eventws) {
+    const DataObjects::EventWorkspace_sptr &eventws) {
   const auto &detectorInfo = eventws->detectorInfo();
   const auto &detIDs = detectorInfo.detectorIDs();
 
diff --git a/Framework/DataHandling/src/GroupDetectors2.cpp b/Framework/DataHandling/src/GroupDetectors2.cpp
index 366ab1ef5fe..573a4c4d4e0 100644
--- a/Framework/DataHandling/src/GroupDetectors2.cpp
+++ b/Framework/DataHandling/src/GroupDetectors2.cpp
@@ -311,8 +311,9 @@ void GroupDetectors2::execEvent() {
  *  @param workspace :: the user selected input workspace
  *  @param unUsedSpec :: spectra indexes that are not members of any group
  */
-void GroupDetectors2::getGroups(API::MatrixWorkspace_const_sptr workspace,
-                                std::vector<int64_t> &unUsedSpec) {
+void GroupDetectors2::getGroups(
+    const API::MatrixWorkspace_const_sptr &workspace,
+    std::vector<int64_t> &unUsedSpec) {
   // this is the map that we are going to fill
   m_GroupWsInds.clear();
 
@@ -454,9 +455,9 @@ void GroupDetectors2::getGroups(API::MatrixWorkspace_const_sptr workspace,
  * a group (so far)
  *  @throw FileError if there's any problem with the file or its format
  */
-void GroupDetectors2::processFile(const std::string &fname,
-                                  API::MatrixWorkspace_const_sptr workspace,
-                                  std::vector<int64_t> &unUsedSpec) {
+void GroupDetectors2::processFile(
+    const std::string &fname, const API::MatrixWorkspace_const_sptr &workspace,
+    std::vector<int64_t> &unUsedSpec) {
   // tring to open the file the user told us exists, skip down 20 lines to find
   // out what happens if we can read from it
   g_log.debug() << "Opening input file ... " << fname;
@@ -545,9 +546,9 @@ void GroupDetectors2::processFile(const std::string &fname,
  * a group (so far)
  *  @throw FileError if there's any problem with the file or its format
  */
-void GroupDetectors2::processXMLFile(const std::string &fname,
-                                     API::MatrixWorkspace_const_sptr workspace,
-                                     std::vector<int64_t> &unUsedSpec) {
+void GroupDetectors2::processXMLFile(
+    const std::string &fname, const API::MatrixWorkspace_const_sptr &workspace,
+    std::vector<int64_t> &unUsedSpec) {
   // 1. Get maps for spectrum No and detector ID
   spec2index_map specs2index;
   const SpectraAxis *axis =
@@ -630,8 +631,8 @@ void GroupDetectors2::processXMLFile(const std::string &fname,
  * in a group (so far)
  */
 void GroupDetectors2::processGroupingWorkspace(
-    GroupingWorkspace_const_sptr groupWS,
-    API::MatrixWorkspace_const_sptr workspace,
+    const GroupingWorkspace_const_sptr &groupWS,
+    const API::MatrixWorkspace_const_sptr &workspace,
     std::vector<int64_t> &unUsedSpec) {
   detid2index_map detIdToWiMap = workspace->getDetectorIDToWorkspaceIndexMap();
 
@@ -683,7 +684,8 @@ void GroupDetectors2::processGroupingWorkspace(
  * a group (so far)
  */
 void GroupDetectors2::processMatrixWorkspace(
-    MatrixWorkspace_const_sptr groupWS, MatrixWorkspace_const_sptr workspace,
+    const MatrixWorkspace_const_sptr &groupWS,
+    const MatrixWorkspace_const_sptr &workspace,
     std::vector<int64_t> &unUsedSpec) {
   detid2index_map detIdToWiMap = workspace->getDetectorIDToWorkspaceIndexMap();
 
@@ -933,11 +935,12 @@ double GroupDetectors2::fileReadProg(
  * indexing after grouping
  *  @return number of new grouped spectra
  */
-size_t GroupDetectors2::formGroups(API::MatrixWorkspace_const_sptr inputWS,
-                                   API::MatrixWorkspace_sptr outputWS,
-                                   const double prog4Copy, const bool keepAll,
-                                   const std::set<int64_t> &unGroupedSet,
-                                   Indexing::IndexInfo &indexInfo) {
+size_t
+GroupDetectors2::formGroups(const API::MatrixWorkspace_const_sptr &inputWS,
+                            const API::MatrixWorkspace_sptr &outputWS,
+                            const double prog4Copy, const bool keepAll,
+                            const std::set<int64_t> &unGroupedSet,
+                            Indexing::IndexInfo &indexInfo) {
   const std::string behaviourChoice = getProperty("Behaviour");
   const auto behaviour =
       behaviourChoice == "Sum" ? Behaviour::SUM : Behaviour::AVERAGE;
@@ -1056,10 +1059,9 @@ size_t GroupDetectors2::formGroups(API::MatrixWorkspace_const_sptr inputWS,
  * a single spectra
  *  @return number of new grouped spectra
  */
-size_t
-GroupDetectors2::formGroupsEvent(DataObjects::EventWorkspace_const_sptr inputWS,
-                                 DataObjects::EventWorkspace_sptr outputWS,
-                                 const double prog4Copy) {
+size_t GroupDetectors2::formGroupsEvent(
+    const DataObjects::EventWorkspace_const_sptr &inputWS,
+    const DataObjects::EventWorkspace_sptr &outputWS, const double prog4Copy) {
   if (inputWS->detectorInfo().isScanning())
     throw std::runtime_error("GroupDetectors does not currently support "
                              "EventWorkspaces with detector scans.");
diff --git a/Framework/DataHandling/src/JoinISISPolarizationEfficiencies.cpp b/Framework/DataHandling/src/JoinISISPolarizationEfficiencies.cpp
index 366841e5fe9..53b7b63f955 100644
--- a/Framework/DataHandling/src/JoinISISPolarizationEfficiencies.cpp
+++ b/Framework/DataHandling/src/JoinISISPolarizationEfficiencies.cpp
@@ -196,7 +196,7 @@ JoinISISPolarizationEfficiencies::interpolateWorkspaces(
 
 MatrixWorkspace_sptr
 JoinISISPolarizationEfficiencies::interpolatePointDataWorkspace(
-    MatrixWorkspace_sptr ws, size_t const maxSize) {
+    const MatrixWorkspace_sptr &ws, size_t const maxSize) {
   auto const &x = ws->x(0);
   auto const startX = x.front();
   auto const endX = x.back();
@@ -213,7 +213,7 @@ JoinISISPolarizationEfficiencies::interpolatePointDataWorkspace(
 
 MatrixWorkspace_sptr
 JoinISISPolarizationEfficiencies::interpolateHistogramWorkspace(
-    MatrixWorkspace_sptr ws, size_t const maxSize) {
+    const MatrixWorkspace_sptr &ws, size_t const maxSize) {
   ws->setDistribution(true);
   auto const &x = ws->x(0);
   auto const dX = (x.back() - x.front()) / double(maxSize);
diff --git a/Framework/DataHandling/src/Load.cpp b/Framework/DataHandling/src/Load.cpp
index 9f3aca7aed9..3dccfb9b1d7 100644
--- a/Framework/DataHandling/src/Load.cpp
+++ b/Framework/DataHandling/src/Load.cpp
@@ -54,7 +54,8 @@ bool isSingleFile(const std::vector<std::vector<std::string>> &fileNames) {
  * @returns a string containing a suggested ws name based on the given file
  *names.
  */
-std::string generateWsNameFromFileNames(std::vector<std::string> filenames) {
+std::string
+generateWsNameFromFileNames(const std::vector<std::string> &filenames) {
   std::string wsName;
 
   for (auto &filename : filenames) {
@@ -678,7 +679,8 @@ API::Workspace_sptr Load::loadFileToWs(const std::string &fileName,
  *
  * @returns a pointer to the result (the first workspace).
  */
-API::Workspace_sptr Load::plusWs(Workspace_sptr ws1, Workspace_sptr ws2) {
+API::Workspace_sptr Load::plusWs(Workspace_sptr ws1,
+                                 const Workspace_sptr &ws2) {
   WorkspaceGroup_sptr group1 = boost::dynamic_pointer_cast<WorkspaceGroup>(ws1);
   WorkspaceGroup_sptr group2 = boost::dynamic_pointer_cast<WorkspaceGroup>(ws2);
 
diff --git a/Framework/DataHandling/src/LoadAsciiStl.cpp b/Framework/DataHandling/src/LoadAsciiStl.cpp
index 5fe2fea8a01..6babcfa54c0 100644
--- a/Framework/DataHandling/src/LoadAsciiStl.cpp
+++ b/Framework/DataHandling/src/LoadAsciiStl.cpp
@@ -11,7 +11,7 @@
 namespace Mantid {
 namespace DataHandling {
 
-bool LoadAsciiStl::isAsciiSTL(std::string filename) {
+bool LoadAsciiStl::isAsciiSTL(const std::string &filename) {
   std::ifstream file(filename.c_str());
   if (!file) {
     // if the file cannot be read then it is not a valid asciiStl File
diff --git a/Framework/DataHandling/src/LoadBBY.cpp b/Framework/DataHandling/src/LoadBBY.cpp
index 3fe7461a573..1a35f3da47b 100644
--- a/Framework/DataHandling/src/LoadBBY.cpp
+++ b/Framework/DataHandling/src/LoadBBY.cpp
@@ -305,7 +305,7 @@ void LoadBBY::exec() {
                eventAssigner);
   }
 
-  auto getParam = [&allParams](std::string tag, double defValue) {
+  auto getParam = [&allParams](const std::string &tag, double defValue) {
     try {
       return std::stod(allParams[tag]);
     } catch (const std::invalid_argument &) {
diff --git a/Framework/DataHandling/src/LoadBinaryStl.cpp b/Framework/DataHandling/src/LoadBinaryStl.cpp
index 0b05cdd15ed..a43550ec716 100644
--- a/Framework/DataHandling/src/LoadBinaryStl.cpp
+++ b/Framework/DataHandling/src/LoadBinaryStl.cpp
@@ -24,7 +24,7 @@ uint32_t getNumberTriangles(Kernel::BinaryStreamReader streamReader,
 }
 } // namespace
 
-bool LoadBinaryStl::isBinarySTL(std::string filename) {
+bool LoadBinaryStl::isBinarySTL(const std::string &filename) {
   Poco::File stlFile = Poco::File(filename);
   if (!stlFile.exists()) {
     // if the file cannot be read then it is not a valid binary Stl File
diff --git a/Framework/DataHandling/src/LoadCalFile.cpp b/Framework/DataHandling/src/LoadCalFile.cpp
index c2ca3f78e03..3062ed3fa00 100644
--- a/Framework/DataHandling/src/LoadCalFile.cpp
+++ b/Framework/DataHandling/src/LoadCalFile.cpp
@@ -237,9 +237,9 @@ void LoadCalFile::exec() {
  *initialized to the right instrument.
  */
 void LoadCalFile::readCalFile(const std::string &calFileName,
-                              GroupingWorkspace_sptr groupWS,
-                              OffsetsWorkspace_sptr offsetsWS,
-                              MaskWorkspace_sptr maskWS) {
+                              const GroupingWorkspace_sptr &groupWS,
+                              const OffsetsWorkspace_sptr &offsetsWS,
+                              const MaskWorkspace_sptr &maskWS) {
   auto doGroup = bool(groupWS);
   auto doOffsets = bool(offsetsWS);
   auto doMask = bool(maskWS);
@@ -360,7 +360,7 @@ void LoadCalFile::readCalFile(const std::string &calFileName,
  * @param detID Detector ID to check
  * @return True if a monitor, false otherwise
  */
-bool LoadCalFile::idIsMonitor(Instrument_const_sptr inst, int detID) {
+bool LoadCalFile::idIsMonitor(const Instrument_const_sptr &inst, int detID) {
   auto monitorList = inst->getMonitors();
   auto it = std::find(monitorList.begin(), monitorList.end(), detID);
   return (it != monitorList.end());
diff --git a/Framework/DataHandling/src/LoadCanSAS1D.cpp b/Framework/DataHandling/src/LoadCanSAS1D.cpp
index 75c723269e5..49edd128199 100644
--- a/Framework/DataHandling/src/LoadCanSAS1D.cpp
+++ b/Framework/DataHandling/src/LoadCanSAS1D.cpp
@@ -297,9 +297,9 @@ void LoadCanSAS1D::check(const Poco::XML::Element *const toCheck,
  * @param[out] container the data will be added to this group
  * @throw ExistsError if a workspace with this name had already been added
  */
-void LoadCanSAS1D::appendDataToOutput(API::MatrixWorkspace_sptr newWork,
-                                      const std::string &newWorkName,
-                                      API::WorkspaceGroup_sptr container) {
+void LoadCanSAS1D::appendDataToOutput(
+    const API::MatrixWorkspace_sptr &newWork, const std::string &newWorkName,
+    const API::WorkspaceGroup_sptr &container) {
   // the name of the property, like the workspace name must be different for
   // each workspace. Add "_run" at the end to stop problems with names like
   // "outputworkspace"
@@ -317,8 +317,9 @@ void LoadCanSAS1D::appendDataToOutput(API::MatrixWorkspace_sptr newWork,
  * @param inst_name :: The name written in the Nexus file
  * @param localWorkspace :: The workspace to insert the instrument into
  */
-void LoadCanSAS1D::runLoadInstrument(const std::string &inst_name,
-                                     API::MatrixWorkspace_sptr localWorkspace) {
+void LoadCanSAS1D::runLoadInstrument(
+    const std::string &inst_name,
+    const API::MatrixWorkspace_sptr &localWorkspace) {
 
   API::IAlgorithm_sptr loadInst = createChildAlgorithm("LoadInstrument");
 
@@ -342,7 +343,7 @@ void LoadCanSAS1D::runLoadInstrument(const std::string &inst_name,
  *  @param[in] wSpace the log will be created in this workspace
  */
 void LoadCanSAS1D::createLogs(const Poco::XML::Element *const sasEntry,
-                              API::MatrixWorkspace_sptr wSpace) const {
+                              const API::MatrixWorkspace_sptr &wSpace) const {
   API::Run &run = wSpace->mutableRun();
   Element *runText = sasEntry->getChildElement("Run");
   check(runText, "Run");
@@ -369,7 +370,7 @@ void LoadCanSAS1D::createLogs(const Poco::XML::Element *const sasEntry,
 
 void LoadCanSAS1D::createSampleInformation(
     const Poco::XML::Element *const sasEntry,
-    Mantid::API::MatrixWorkspace_sptr wSpace) const {
+    const Mantid::API::MatrixWorkspace_sptr &wSpace) const {
   auto &sample = wSpace->mutableSample();
 
   // Get the thickness information
diff --git a/Framework/DataHandling/src/LoadDaveGrp.cpp b/Framework/DataHandling/src/LoadDaveGrp.cpp
index 6f62cd3e9e9..840a1fb136d 100644
--- a/Framework/DataHandling/src/LoadDaveGrp.cpp
+++ b/Framework/DataHandling/src/LoadDaveGrp.cpp
@@ -176,7 +176,7 @@ API::MatrixWorkspace_sptr LoadDaveGrp::setupWorkspace() const {
   return outputWorkspace;
 }
 
-void LoadDaveGrp::setWorkspaceAxes(API::MatrixWorkspace_sptr workspace,
+void LoadDaveGrp::setWorkspaceAxes(const API::MatrixWorkspace_sptr &workspace,
                                    const std::vector<double> &xAxis,
                                    const std::vector<double> &yAxis) const {
 
@@ -231,7 +231,7 @@ void LoadDaveGrp::getAxisValues(std::vector<double> &axis,
   }
 }
 
-void LoadDaveGrp::getData(API::MatrixWorkspace_sptr workspace) {
+void LoadDaveGrp::getData(const API::MatrixWorkspace_sptr &workspace) {
   double data_val = 0.0;
   double err_val = 0.0;
 
diff --git a/Framework/DataHandling/src/LoadDetectorsGroupingFile.cpp b/Framework/DataHandling/src/LoadDetectorsGroupingFile.cpp
index cf823778e64..b2ccf757b1c 100644
--- a/Framework/DataHandling/src/LoadDetectorsGroupingFile.cpp
+++ b/Framework/DataHandling/src/LoadDetectorsGroupingFile.cpp
@@ -409,7 +409,7 @@ LoadGroupXMLFile::LoadGroupXMLFile()
       m_pDoc(), m_groupComponentsMap(), m_groupDetectorsMap(),
       m_groupSpectraMap(), m_startGroupID(1), m_groupNamesMap() {}
 
-void LoadGroupXMLFile::loadXMLFile(std::string xmlfilename) {
+void LoadGroupXMLFile::loadXMLFile(const std::string &xmlfilename) {
 
   this->initializeXMLParser(xmlfilename);
   this->parseXML();
@@ -604,9 +604,8 @@ void LoadGroupXMLFile::parseXML() {
 /*
  * Get attribute's value by name from a Node
  */
-std::string LoadGroupXMLFile::getAttributeValueByName(Poco::XML::Node *pNode,
-                                                      std::string attributename,
-                                                      bool &found) {
+std::string LoadGroupXMLFile::getAttributeValueByName(
+    Poco::XML::Node *pNode, const std::string &attributename, bool &found) {
   // 1. Init
   Poco::AutoPtr<Poco::XML::NamedNodeMap> att = pNode->attributes();
   found = false;
diff --git a/Framework/DataHandling/src/LoadDiffCal.cpp b/Framework/DataHandling/src/LoadDiffCal.cpp
index ff6b617b3bb..a75167db988 100644
--- a/Framework/DataHandling/src/LoadDiffCal.cpp
+++ b/Framework/DataHandling/src/LoadDiffCal.cpp
@@ -132,7 +132,7 @@ bool endswith(const std::string &str, const std::string &ending) {
 }
 
 void setGroupWSProperty(API::Algorithm *alg, const std::string &prefix,
-                        GroupingWorkspace_sptr wksp) {
+                        const GroupingWorkspace_sptr &wksp) {
   alg->declareProperty(
       std::make_unique<WorkspaceProperty<DataObjects::GroupingWorkspace>>(
           "OutputGroupingWorkspace", prefix + "_group", Direction::Output),
@@ -141,7 +141,7 @@ void setGroupWSProperty(API::Algorithm *alg, const std::string &prefix,
 }
 
 void setMaskWSProperty(API::Algorithm *alg, const std::string &prefix,
-                       MaskWorkspace_sptr wksp) {
+                       const MaskWorkspace_sptr &wksp) {
   alg->declareProperty(
       std::make_unique<WorkspaceProperty<DataObjects::MaskWorkspace>>(
           "OutputMaskWorkspace", prefix + "_mask", Direction::Output),
@@ -150,7 +150,7 @@ void setMaskWSProperty(API::Algorithm *alg, const std::string &prefix,
 }
 
 void setCalWSProperty(API::Algorithm *alg, const std::string &prefix,
-                      ITableWorkspace_sptr wksp) {
+                      const ITableWorkspace_sptr &wksp) {
   alg->declareProperty(
       std::make_unique<WorkspaceProperty<ITableWorkspace>>(
           "OutputCalWorkspace", prefix + "_cal", Direction::Output),
diff --git a/Framework/DataHandling/src/LoadDspacemap.cpp b/Framework/DataHandling/src/LoadDspacemap.cpp
index ef2ed7bdf70..6a5e8ac1596 100644
--- a/Framework/DataHandling/src/LoadDspacemap.cpp
+++ b/Framework/DataHandling/src/LoadDspacemap.cpp
@@ -95,8 +95,8 @@ void LoadDspacemap::exec() {
  * @param offsetsWS :: OffsetsWorkspace to be filled.
  */
 void LoadDspacemap::CalculateOffsetsFromDSpacemapFile(
-    const std::string DFileName,
-    Mantid::DataObjects::OffsetsWorkspace_sptr offsetsWS) {
+    const std::string &DFileName,
+    const Mantid::DataObjects::OffsetsWorkspace_sptr &offsetsWS) {
   // Get a pointer to the instrument contained in the workspace
 
   const auto &detectorInfo = offsetsWS->detectorInfo();
@@ -150,7 +150,7 @@ const double CONSTANT = (PhysicalConstants::h * 1e10) /
  */
 void LoadDspacemap::CalculateOffsetsFromVulcanFactors(
     std::map<detid_t, double> &vulcan,
-    Mantid::DataObjects::OffsetsWorkspace_sptr offsetsWS) {
+    const Mantid::DataObjects::OffsetsWorkspace_sptr &offsetsWS) {
   // Get a pointer to the instrument contained in the workspace
   // At this point, instrument VULCAN has been created?
   Instrument_const_sptr instrument = offsetsWS->getInstrument();
diff --git a/Framework/DataHandling/src/LoadEMU.cpp b/Framework/DataHandling/src/LoadEMU.cpp
index 3389e0ab82c..99f65416e83 100644
--- a/Framework/DataHandling/src/LoadEMU.cpp
+++ b/Framework/DataHandling/src/LoadEMU.cpp
@@ -680,7 +680,7 @@ void LoadEMU<FD>::exec(const std::string &hdfFile,
 
   // lambda to simplify loading instrument parameters
   auto instr = m_localWorkspace->getInstrument();
-  auto iparam = [&instr](std::string tag) {
+  auto iparam = [&instr](const std::string &tag) {
     return instr->getNumberParameter(tag)[0];
   };
 
diff --git a/Framework/DataHandling/src/LoadEventNexus.cpp b/Framework/DataHandling/src/LoadEventNexus.cpp
index e19bcd8f634..61db8951657 100644
--- a/Framework/DataHandling/src/LoadEventNexus.cpp
+++ b/Framework/DataHandling/src/LoadEventNexus.cpp
@@ -1177,8 +1177,8 @@ bool LoadEventNexus::runLoadInstrument<EventWorkspaceCollection_sptr>(
  * @param workspace :: The workspace to contain the spectra mapping
  * @param bankNames :: Bank names that are in Nexus file
  */
-void LoadEventNexus::deleteBanks(EventWorkspaceCollection_sptr workspace,
-                                 std::vector<std::string> bankNames) {
+void LoadEventNexus::deleteBanks(const EventWorkspaceCollection_sptr &workspace,
+                                 const std::vector<std::string> &bankNames) {
   Instrument_sptr inst = boost::const_pointer_cast<Instrument>(
       workspace->getInstrument()->baseInstrument());
   // Build a list of Rectangular Detectors
@@ -1537,7 +1537,7 @@ void LoadEventNexus::loadSampleDataISIScompatibility(
  *
  * @param fname name of the nexus file to open
  */
-void LoadEventNexus::safeOpenFile(const std::string fname) {
+void LoadEventNexus::safeOpenFile(const std::string &fname) {
   try {
     m_file = std::make_unique<::NeXus::File>(m_filename, NXACC_READ);
   } catch (std::runtime_error &e) {
diff --git a/Framework/DataHandling/src/LoadEventNexusIndexSetup.cpp b/Framework/DataHandling/src/LoadEventNexusIndexSetup.cpp
index 0e7a6f4e212..6a3d3242027 100644
--- a/Framework/DataHandling/src/LoadEventNexusIndexSetup.cpp
+++ b/Framework/DataHandling/src/LoadEventNexusIndexSetup.cpp
@@ -4,8 +4,10 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidDataHandling/LoadEventNexusIndexSetup.h"
+#include <utility>
+
 #include "MantidAPI/SpectrumDetectorMapping.h"
+#include "MantidDataHandling/LoadEventNexusIndexSetup.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidGeometry/Instrument/ComponentInfo.h"
 #include "MantidGeometry/Instrument/DetectorInfo.h"
@@ -42,10 +44,10 @@ void setupConsistentSpectrumNumbers(IndexInfo &filtered,
 
 LoadEventNexusIndexSetup::LoadEventNexusIndexSetup(
     MatrixWorkspace_const_sptr instrumentWorkspace, const int32_t min,
-    const int32_t max, const std::vector<int32_t> range,
+    const int32_t max, const std::vector<int32_t> &range,
     const Parallel::Communicator &communicator)
-    : m_instrumentWorkspace(instrumentWorkspace), m_min(min), m_max(max),
-      m_range(range), m_communicator(communicator) {}
+    : m_instrumentWorkspace(std::move(instrumentWorkspace)), m_min(min),
+      m_max(max), m_range(range), m_communicator(communicator) {}
 
 std::pair<int32_t, int32_t> LoadEventNexusIndexSetup::eventIDLimits() const {
   return {m_min, m_max};
diff --git a/Framework/DataHandling/src/LoadEventPreNexus2.cpp b/Framework/DataHandling/src/LoadEventPreNexus2.cpp
index 04eaff0ec07..09bca136ffd 100644
--- a/Framework/DataHandling/src/LoadEventPreNexus2.cpp
+++ b/Framework/DataHandling/src/LoadEventPreNexus2.cpp
@@ -405,7 +405,7 @@ void LoadEventPreNexus2::exec() {
 /** Create and set up output Event Workspace
  */
 void LoadEventPreNexus2::createOutputWorkspace(
-    const std::string event_filename) {
+    const std::string &event_filename) {
   // Create the output workspace
   localWorkspace = EventWorkspace_sptr(new EventWorkspace());
 
@@ -570,7 +570,7 @@ void LoadEventPreNexus2::processImbedLogs() {
  * @param mindex :: index of the log in pulse time ...
  * - mindex:  index of the the series in the list
  */
-void LoadEventPreNexus2::addToWorkspaceLog(std::string logtitle,
+void LoadEventPreNexus2::addToWorkspaceLog(const std::string &logtitle,
                                            size_t mindex) {
   // Create TimeSeriesProperty
   auto property = new TimeSeriesProperty<double>(logtitle);
@@ -601,7 +601,8 @@ void LoadEventPreNexus2::addToWorkspaceLog(std::string logtitle,
  * geometry
  */
 void LoadEventPreNexus2::runLoadInstrument(
-    const std::string &eventfilename, MatrixWorkspace_sptr localWorkspace) {
+    const std::string &eventfilename,
+    const MatrixWorkspace_sptr &localWorkspace) {
   // start by getting just the filename
   string instrument = Poco::Path(eventfilename).getFileName();
 
diff --git a/Framework/DataHandling/src/LoadFITS.cpp b/Framework/DataHandling/src/LoadFITS.cpp
index deb8a6f3a81..57f2df40ce8 100644
--- a/Framework/DataHandling/src/LoadFITS.cpp
+++ b/Framework/DataHandling/src/LoadFITS.cpp
@@ -678,7 +678,7 @@ void LoadFITS::parseHeader(FITSInfo &headerInfo) {
 Workspace2D_sptr
 LoadFITS::makeWorkspace(const FITSInfo &fileInfo, size_t &newFileNumber,
                         std::vector<char> &buffer, MantidImage &imageY,
-                        MantidImage &imageE, const Workspace2D_sptr parent,
+                        MantidImage &imageE, const Workspace2D_sptr &parent,
                         bool loadAsRectImg, int binSize, double noiseThresh) {
   // Create workspace (taking into account already here if rebinning is
   // going to happen)
@@ -763,9 +763,9 @@ LoadFITS::makeWorkspace(const FITSInfo &fileInfo, size_t &newFileNumber,
  * @param cmpp centimeters per pixel (already taking into account
  * possible rebinning)
  */
-void LoadFITS::addAxesInfoAndLogs(Workspace2D_sptr ws, bool loadAsRectImg,
-                                  const FITSInfo &fileInfo, int binSize,
-                                  double cmpp) {
+void LoadFITS::addAxesInfoAndLogs(const Workspace2D_sptr &ws,
+                                  bool loadAsRectImg, const FITSInfo &fileInfo,
+                                  int binSize, double cmpp) {
   // add axes
   size_t width = fileInfo.axisPixelLengths[0] / binSize;
   size_t height = fileInfo.axisPixelLengths[1] / binSize;
@@ -848,7 +848,7 @@ void LoadFITS::addAxesInfoAndLogs(Workspace2D_sptr ws, bool loadAsRectImg,
  * @throws std::runtime_error if there are file input issues
  */
 void LoadFITS::readDataToWorkspace(const FITSInfo &fileInfo, double cmpp,
-                                   Workspace2D_sptr ws,
+                                   const Workspace2D_sptr &ws,
                                    std::vector<char> &buffer) {
   const size_t bytespp = (fileInfo.bitsPerPixel / 8);
   const size_t len = m_pixelCount * bytespp;
diff --git a/Framework/DataHandling/src/LoadFullprofResolution.cpp b/Framework/DataHandling/src/LoadFullprofResolution.cpp
index 5095dcb4e6b..08534107486 100644
--- a/Framework/DataHandling/src/LoadFullprofResolution.cpp
+++ b/Framework/DataHandling/src/LoadFullprofResolution.cpp
@@ -240,7 +240,8 @@ void LoadFullprofResolution::exec() {
  * @param filename :: string for name of the .irf file
  * @param lines :: vector of strings for each non-empty line in .irf file
  */
-void LoadFullprofResolution::loadFile(string filename, vector<string> &lines) {
+void LoadFullprofResolution::loadFile(const string &filename,
+                                      vector<string> &lines) {
   string line;
 
   // the variable of type ifstream:
@@ -773,8 +774,8 @@ void LoadFullprofResolution::createBankToWorkspaceMap(
  * stored
  */
 void LoadFullprofResolution::putParametersIntoWorkspace(
-    API::Column_const_sptr column, API::MatrixWorkspace_sptr ws, int nProf,
-    std::string &parameterXMLString) {
+    const API::Column_const_sptr &column, const API::MatrixWorkspace_sptr &ws,
+    int nProf, std::string &parameterXMLString) {
 
   // Get instrument name from matrix workspace
   std::string instrumentName = ws->getInstrument()->getName();
@@ -833,7 +834,7 @@ void LoadFullprofResolution::putParametersIntoWorkspace(
  *  paramName is the name of the parameter as it appears in the table workspace
  */
 void LoadFullprofResolution::addALFBEParameter(
-    const API::Column_const_sptr column, Poco::XML::Document *mDoc,
+    const API::Column_const_sptr &column, Poco::XML::Document *mDoc,
     Element *parent, const std::string &paramName) {
   AutoPtr<Element> parameterElem = mDoc->createElement("parameter");
   parameterElem->setAttribute("name", getXMLParameterName(paramName));
@@ -856,7 +857,7 @@ void LoadFullprofResolution::addALFBEParameter(
  * for the bank at the given column of the table workspace
  */
 void LoadFullprofResolution::addSigmaParameters(
-    const API::Column_const_sptr column, Poco::XML::Document *mDoc,
+    const API::Column_const_sptr &column, Poco::XML::Document *mDoc,
     Poco::XML::Element *parent) {
   AutoPtr<Element> parameterElem = mDoc->createElement("parameter");
   parameterElem->setAttribute("name", "IkedaCarpenterPV:SigmaSquared");
@@ -878,7 +879,7 @@ void LoadFullprofResolution::addSigmaParameters(
  * for the bank at the given column of the table workspace
  */
 void LoadFullprofResolution::addGammaParameters(
-    const API::Column_const_sptr column, Poco::XML::Document *mDoc,
+    const API::Column_const_sptr &column, Poco::XML::Document *mDoc,
     Poco::XML::Element *parent) {
   AutoPtr<Element> parameterElem = mDoc->createElement("parameter");
   parameterElem->setAttribute("name", "IkedaCarpenterPV:Gamma");
@@ -899,7 +900,7 @@ void LoadFullprofResolution::addGammaParameters(
  * for the bank at the given column of the table workspace
  */
 void LoadFullprofResolution::addBBX_S_Parameters(
-    const API::Column_const_sptr column, Poco::XML::Document *mDoc,
+    const API::Column_const_sptr &column, Poco::XML::Document *mDoc,
     Poco::XML::Element *parent) {
   AutoPtr<Element> parameterElem = mDoc->createElement("parameter");
   parameterElem->setAttribute("name", "BackToBackExponential:S");
@@ -923,7 +924,7 @@ void LoadFullprofResolution::addBBX_S_Parameters(
  * for the bank at the given column of the table workspace
  */
 void LoadFullprofResolution::addBBX_A_Parameters(
-    const API::Column_const_sptr column, Poco::XML::Document *mDoc,
+    const API::Column_const_sptr &column, Poco::XML::Document *mDoc,
     Poco::XML::Element *parent) {
   AutoPtr<Element> parameterElem = mDoc->createElement("parameter");
   parameterElem->setAttribute("name", "BackToBackExponential:A");
@@ -948,7 +949,7 @@ void LoadFullprofResolution::addBBX_A_Parameters(
  * for the bank at the given column of the table workspace
  */
 void LoadFullprofResolution::addBBX_B_Parameters(
-    const API::Column_const_sptr column, Poco::XML::Document *mDoc,
+    const API::Column_const_sptr &column, Poco::XML::Document *mDoc,
     Poco::XML::Element *parent) {
   AutoPtr<Element> parameterElem = mDoc->createElement("parameter");
   parameterElem->setAttribute("name", "BackToBackExponential:B");
@@ -992,7 +993,7 @@ LoadFullprofResolution::getXMLParameterName(const std::string &name) {
  * given the name of the parameter in the table workspace.
  */
 std::string
-LoadFullprofResolution::getXMLEqValue(const API::Column_const_sptr column,
+LoadFullprofResolution::getXMLEqValue(const API::Column_const_sptr &column,
                                       const std::string &name) {
   size_t paramNumber = LoadFullprofResolution::m_rowNumbers[name];
   // API::Column_const_sptr column = tablews->getColumn( columnIndex );
@@ -1006,7 +1007,7 @@ LoadFullprofResolution::getXMLEqValue(const API::Column_const_sptr column,
  * given the name of the parameter in the table workspace.
  */
 std::string LoadFullprofResolution::getXMLSquaredEqValue(
-    const API::Column_const_sptr column, const std::string &name) {
+    const API::Column_const_sptr &column, const std::string &name) {
   size_t paramNumber = LoadFullprofResolution::m_rowNumbers[name];
   // API::Column_const_sptr column = tablews->getColumn( columnIndex );
   double eqValue = column->cell<double>(paramNumber);
diff --git a/Framework/DataHandling/src/LoadGSASInstrumentFile.cpp b/Framework/DataHandling/src/LoadGSASInstrumentFile.cpp
index aadb1e848b5..c72b0bda3f2 100644
--- a/Framework/DataHandling/src/LoadGSASInstrumentFile.cpp
+++ b/Framework/DataHandling/src/LoadGSASInstrumentFile.cpp
@@ -214,7 +214,8 @@ void LoadGSASInstrumentFile::exec() {
  * @param filename :: string for name of the .prm file
  * @param lines :: vector of strings for each non-empty line in .prm file
  */
-void LoadGSASInstrumentFile::loadFile(string filename, vector<string> &lines) {
+void LoadGSASInstrumentFile::loadFile(const string &filename,
+                                      vector<string> &lines) {
   string line;
 
   // the variable of type ifstream:
diff --git a/Framework/DataHandling/src/LoadGSS.cpp b/Framework/DataHandling/src/LoadGSS.cpp
index 9f04a4b9a02..4456422c817 100644
--- a/Framework/DataHandling/src/LoadGSS.cpp
+++ b/Framework/DataHandling/src/LoadGSS.cpp
@@ -488,7 +488,7 @@ double LoadGSS::convertToDouble(std::string inputstring) {
 /** Create the instrument geometry with Instrument
  */
 void LoadGSS::createInstrumentGeometry(
-    MatrixWorkspace_sptr workspace, const std::string &instrumentname,
+    const MatrixWorkspace_sptr &workspace, const std::string &instrumentname,
     const double &primaryflightpath, const std::vector<int> &detectorids,
     const std::vector<double> &totalflightpaths,
     const std::vector<double> &twothetas) {
diff --git a/Framework/DataHandling/src/LoadHelper.cpp b/Framework/DataHandling/src/LoadHelper.cpp
index 0527c865d70..6461e0fa1ec 100644
--- a/Framework/DataHandling/src/LoadHelper.cpp
+++ b/Framework/DataHandling/src/LoadHelper.cpp
@@ -119,7 +119,7 @@ double LoadHelper::calculateTOF(double distance, double wavelength) {
  */
 double
 LoadHelper::getInstrumentProperty(const API::MatrixWorkspace_sptr &workspace,
-                                  std::string s) {
+                                  const std::string &s) {
   std::vector<std::string> prop =
       workspace->getInstrument()->getStringParameter(s);
   if (prop.empty()) {
@@ -509,7 +509,7 @@ void LoadHelper::dumpNexusAttributes(NXhandle nxfileID,
  *  @param dateToParse :: date as string
  *  @return date as required in Mantid
  */
-std::string LoadHelper::dateTimeInIsoFormat(std::string dateToParse) {
+std::string LoadHelper::dateTimeInIsoFormat(const std::string &dateToParse) {
   namespace bt = boost::posix_time;
   // parsing format
   const std::locale format = std::locale(
@@ -535,7 +535,7 @@ std::string LoadHelper::dateTimeInIsoFormat(std::string dateToParse) {
  * @param componentName The name of the component of the instrument
  * @param newPos New position of the component
  */
-void LoadHelper::moveComponent(API::MatrixWorkspace_sptr ws,
+void LoadHelper::moveComponent(const API::MatrixWorkspace_sptr &ws,
                                const std::string &componentName,
                                const V3D &newPos) {
   Geometry::IComponent_const_sptr component =
@@ -557,7 +557,7 @@ void LoadHelper::moveComponent(API::MatrixWorkspace_sptr ws,
  * @param rot Rotations defined by setting a quaternion from an angle in degrees
  * and an axis
  */
-void LoadHelper::rotateComponent(API::MatrixWorkspace_sptr ws,
+void LoadHelper::rotateComponent(const API::MatrixWorkspace_sptr &ws,
                                  const std::string &componentName,
                                  const Kernel::Quat &rot) {
   Geometry::IComponent_const_sptr component =
@@ -578,7 +578,7 @@ void LoadHelper::rotateComponent(API::MatrixWorkspace_sptr ws,
  * @param componentName The Name of the component of the instrument
  * @return The position of the component
  */
-V3D LoadHelper::getComponentPosition(API::MatrixWorkspace_sptr ws,
+V3D LoadHelper::getComponentPosition(const API::MatrixWorkspace_sptr &ws,
                                      const std::string &componentName) {
   Geometry::IComponent_const_sptr component =
       ws->getInstrument()->getComponentByName(componentName);
diff --git a/Framework/DataHandling/src/LoadIDFFromNexus.cpp b/Framework/DataHandling/src/LoadIDFFromNexus.cpp
index 5d52c316f66..e4110c86124 100644
--- a/Framework/DataHandling/src/LoadIDFFromNexus.cpp
+++ b/Framework/DataHandling/src/LoadIDFFromNexus.cpp
@@ -271,7 +271,7 @@ void LoadIDFFromNexus::readParameterCorrectionFile(
  *  @throw FileError Thrown if unable to parse XML file
  */
 void LoadIDFFromNexus::LoadParameters(
-    ::NeXus::File *nxfile, const MatrixWorkspace_sptr localWorkspace) {
+    ::NeXus::File *nxfile, const MatrixWorkspace_sptr &localWorkspace) {
 
   std::string parameterString;
 
@@ -314,7 +314,7 @@ void LoadIDFFromNexus::LoadParameters(
 // given workspace, returning success.
 bool LoadIDFFromNexus::loadParameterFile(
     const std::string &fullPathName,
-    const MatrixWorkspace_sptr localWorkspace) {
+    const MatrixWorkspace_sptr &localWorkspace) {
 
   try {
     // load and also populate instrument parameters from this 'fallback'
diff --git a/Framework/DataHandling/src/LoadILLIndirect2.cpp b/Framework/DataHandling/src/LoadILLIndirect2.cpp
index c4d0b384b01..80aa732d883 100644
--- a/Framework/DataHandling/src/LoadILLIndirect2.cpp
+++ b/Framework/DataHandling/src/LoadILLIndirect2.cpp
@@ -271,7 +271,7 @@ void LoadILLIndirect2::loadDataIntoTheWorkSpace(NeXus::NXEntry &entry) {
  * @param nexusfilename
  */
 void LoadILLIndirect2::loadNexusEntriesIntoProperties(
-    std::string nexusfilename) {
+    const std::string &nexusfilename) {
 
   API::Run &runDetails = m_localWorkspace->mutableRun();
 
diff --git a/Framework/DataHandling/src/LoadISISNexus2.cpp b/Framework/DataHandling/src/LoadISISNexus2.cpp
index 63ccf5fb638..abebe9c0e77 100644
--- a/Framework/DataHandling/src/LoadISISNexus2.cpp
+++ b/Framework/DataHandling/src/LoadISISNexus2.cpp
@@ -459,7 +459,7 @@ Check for a set of synthetic logs associated with multi-period log data. Raise
 warnings where necessary.
 */
 void LoadISISNexus2::validateMultiPeriodLogs(
-    Mantid::API::MatrixWorkspace_sptr ws) {
+    const Mantid::API::MatrixWorkspace_sptr &ws) {
   const Run &run = ws->run();
   if (!run.hasProperty("current_period")) {
     g_log.warning("Workspace has no current_period log.");
diff --git a/Framework/DataHandling/src/LoadInstrument.cpp b/Framework/DataHandling/src/LoadInstrument.cpp
index 9451dbb3183..4274685e262 100644
--- a/Framework/DataHandling/src/LoadInstrument.cpp
+++ b/Framework/DataHandling/src/LoadInstrument.cpp
@@ -255,7 +255,8 @@ void LoadInstrument::exec() {
 //-----------------------------------------------------------------------------------------------------------------------
 /// Run the Child Algorithm LoadInstrument (or LoadInstrumentFromRaw)
 void LoadInstrument::runLoadParameterFile(
-    const boost::shared_ptr<API::MatrixWorkspace> &ws, std::string filename) {
+    const boost::shared_ptr<API::MatrixWorkspace> &ws,
+    const std::string &filename) {
   g_log.debug("Loading the parameter definition...");
 
   // First search for XML parameter file in same folder as IDF file
@@ -311,8 +312,9 @@ void LoadInstrument::runLoadParameterFile(
 /// Search the directory for the Parameter IDF file and return full path name if
 /// found, else return "".
 //  directoryName must include a final '/'.
-std::string LoadInstrument::getFullPathParamIDF(std::string directoryName,
-                                                std::string filename) {
+std::string
+LoadInstrument::getFullPathParamIDF(const std::string &directoryName,
+                                    const std::string &filename) {
   Poco::Path directoryPath(directoryName);
   directoryPath.makeDirectory();
   // Remove the path from the filename
diff --git a/Framework/DataHandling/src/LoadIsawDetCal.cpp b/Framework/DataHandling/src/LoadIsawDetCal.cpp
index a531b2645f3..4c8e0c67a36 100644
--- a/Framework/DataHandling/src/LoadIsawDetCal.cpp
+++ b/Framework/DataHandling/src/LoadIsawDetCal.cpp
@@ -29,6 +29,7 @@
 #include <fstream>
 #include <numeric>
 #include <sstream>
+#include <utility>
 
 namespace Mantid {
 namespace DataHandling {
@@ -74,7 +75,7 @@ std::string getBankName(const std::string &bankPart, const int idnum) {
   }
 }
 
-std::string getInstName(API::Workspace_const_sptr wksp) {
+std::string getInstName(const API::Workspace_const_sptr &wksp) {
   MatrixWorkspace_const_sptr matrixWksp =
       boost::dynamic_pointer_cast<const MatrixWorkspace>(wksp);
   if (matrixWksp) {
@@ -352,10 +353,11 @@ void LoadIsawDetCal::exec() {
  * @param componentInfo :: The component info object for the workspace
  */
 void LoadIsawDetCal::center(const double x, const double y, const double z,
-                            const std::string &detname, API::Workspace_sptr ws,
+                            const std::string &detname,
+                            const API::Workspace_sptr &ws,
                             Geometry::ComponentInfo &componentInfo) {
 
-  Instrument_sptr inst = getCheckInst(ws);
+  Instrument_sptr inst = getCheckInst(std::move(ws));
 
   IComponent_const_sptr comp = inst->getComponentByName(detname);
   if (comp == nullptr) {
@@ -378,7 +380,7 @@ void LoadIsawDetCal::center(const double x, const double y, const double z,
  * @throw std::runtime_error if there's any problem with the workspace or it is
  * not possible to get an instrument object from it
  */
-Instrument_sptr LoadIsawDetCal::getCheckInst(API::Workspace_sptr ws) {
+Instrument_sptr LoadIsawDetCal::getCheckInst(const API::Workspace_sptr &ws) {
   MatrixWorkspace_sptr inputW =
       boost::dynamic_pointer_cast<MatrixWorkspace>(ws);
   PeaksWorkspace_sptr inputP = boost::dynamic_pointer_cast<PeaksWorkspace>(ws);
@@ -432,7 +434,7 @@ std::vector<std::string> LoadIsawDetCal::getFilenames() {
  * @param doWishCorrection if true apply a special correction for WISH
  */
 void LoadIsawDetCal::doRotation(V3D rX, V3D rY, ComponentInfo &componentInfo,
-                                boost::shared_ptr<const IComponent> comp,
+                                const boost::shared_ptr<const IComponent> &comp,
                                 bool doWishCorrection) {
   // These are the ISAW axes
   rX.normalize();
diff --git a/Framework/DataHandling/src/LoadLog.cpp b/Framework/DataHandling/src/LoadLog.cpp
index 6f528b5b844..c771655cb70 100644
--- a/Framework/DataHandling/src/LoadLog.cpp
+++ b/Framework/DataHandling/src/LoadLog.cpp
@@ -28,6 +28,7 @@
 #include <boost/algorithm/string.hpp>
 #include <fstream> // used to get ifstream
 #include <sstream>
+#include <utility>
 
 using Mantid::Types::Core::DateAndTime;
 
@@ -202,8 +203,8 @@ void LoadLog::loadTwoColumnLogFile(std::ifstream &logFileStream,
     }
 
     try {
-      Property *log =
-          LogParser::createLogProperty(m_filename, stringToLower(logFileName));
+      Property *log = LogParser::createLogProperty(
+          m_filename, stringToLower(std::move(logFileName)));
       if (log) {
         run.addLogData(log);
       }
@@ -220,7 +221,8 @@ void LoadLog::loadTwoColumnLogFile(std::ifstream &logFileStream,
  * @param run :: The run information object
  */
 void LoadLog::loadThreeColumnLogFile(std::ifstream &logFileStream,
-                                     std::string logFileName, API::Run &run) {
+                                     const std::string &logFileName,
+                                     API::Run &run) {
   std::string str;
   std::string propname;
   std::map<std::string, std::unique_ptr<Kernel::TimeSeriesProperty<double>>>
diff --git a/Framework/DataHandling/src/LoadMuonNexus.cpp b/Framework/DataHandling/src/LoadMuonNexus.cpp
index 7a7b005de06..214b258eb14 100644
--- a/Framework/DataHandling/src/LoadMuonNexus.cpp
+++ b/Framework/DataHandling/src/LoadMuonNexus.cpp
@@ -152,7 +152,7 @@ void LoadMuonNexus::checkOptionalProperties() {
 
 /// Run the Child Algorithm LoadInstrument
 void LoadMuonNexus::runLoadInstrument(
-    DataObjects::Workspace2D_sptr localWorkspace) {
+    const DataObjects::Workspace2D_sptr &localWorkspace) {
 
   IAlgorithm_sptr loadInst = createChildAlgorithm("LoadInstrument");
 
diff --git a/Framework/DataHandling/src/LoadMuonNexus1.cpp b/Framework/DataHandling/src/LoadMuonNexus1.cpp
index 86ae6243d30..77aac4add36 100644
--- a/Framework/DataHandling/src/LoadMuonNexus1.cpp
+++ b/Framework/DataHandling/src/LoadMuonNexus1.cpp
@@ -448,9 +448,8 @@ void LoadMuonNexus1::loadDeadTimes(NXRoot &root) {
  * @param inst :: Pointer to instrument (to use if IDF needed)
  * @returns :: Grouping table - or tables, if per period
  */
-Workspace_sptr
-LoadMuonNexus1::loadDetectorGrouping(NXRoot &root,
-                                     Geometry::Instrument_const_sptr inst) {
+Workspace_sptr LoadMuonNexus1::loadDetectorGrouping(
+    NXRoot &root, const Geometry::Instrument_const_sptr &inst) {
   NXEntry dataEntry = root.openEntry("run/histogram_data_1");
 
   NXInfo infoGrouping = dataEntry.getDataSetInfo("grouping");
@@ -660,9 +659,10 @@ LoadMuonNexus1::createDetectorGroupingTable(std::vector<int> specToLoad,
  *  @param localWorkspace :: A pointer to the workspace in which the data will
  * be stored
  */
-void LoadMuonNexus1::loadData(size_t hist, specnum_t &i, specnum_t specNo,
-                              MuonNexusReader &nxload, const int64_t lengthIn,
-                              DataObjects::Workspace2D_sptr localWorkspace) {
+void LoadMuonNexus1::loadData(
+    size_t hist, specnum_t &i, specnum_t specNo, MuonNexusReader &nxload,
+    const int64_t lengthIn,
+    const DataObjects::Workspace2D_sptr &localWorkspace) {
   // Read in a spectrum
   // Put it into a vector, discarding the 1st entry, which is rubbish
   // But note that the last (overflow) bin is kept
@@ -689,7 +689,7 @@ void LoadMuonNexus1::loadData(size_t hist, specnum_t &i, specnum_t specNo,
  * @param localWorkspace :: The workspace details to use
  */
 void LoadMuonNexus1::loadRunDetails(
-    DataObjects::Workspace2D_sptr localWorkspace) {
+    const DataObjects::Workspace2D_sptr &localWorkspace) {
   API::Run &runDetails = localWorkspace->mutableRun();
 
   runDetails.addProperty("run_title", localWorkspace->getTitle(), true);
@@ -737,7 +737,8 @@ void LoadMuonNexus1::loadRunDetails(
 }
 
 /// Run the LoadLog Child Algorithm
-void LoadMuonNexus1::runLoadLog(DataObjects::Workspace2D_sptr localWorkspace) {
+void LoadMuonNexus1::runLoadLog(
+    const DataObjects::Workspace2D_sptr &localWorkspace) {
   IAlgorithm_sptr loadLog = createChildAlgorithm("LoadMuonLog");
   // Pass through the same input filename
   loadLog->setPropertyValue("Filename", m_filename);
@@ -791,8 +792,8 @@ void LoadMuonNexus1::runLoadLog(DataObjects::Workspace2D_sptr localWorkspace) {
  * @param localWorkspace A workspace to add the log to.
  * @param period A period for this workspace.
  */
-void LoadMuonNexus1::addPeriodLog(DataObjects::Workspace2D_sptr localWorkspace,
-                                  int64_t period) {
+void LoadMuonNexus1::addPeriodLog(
+    const DataObjects::Workspace2D_sptr &localWorkspace, int64_t period) {
   auto &run = localWorkspace->mutableRun();
   ISISRunLogs runLogs(run);
   if (period == 0) {
@@ -803,8 +804,9 @@ void LoadMuonNexus1::addPeriodLog(DataObjects::Workspace2D_sptr localWorkspace,
   }
 }
 
-void LoadMuonNexus1::addGoodFrames(DataObjects::Workspace2D_sptr localWorkspace,
-                                   int64_t period, int nperiods) {
+void LoadMuonNexus1::addGoodFrames(
+    const DataObjects::Workspace2D_sptr &localWorkspace, int64_t period,
+    int nperiods) {
 
   // Get handle to nexus file
   ::NeXus::File handle(m_filename, NXACC_READ);
diff --git a/Framework/DataHandling/src/LoadMuonNexus2.cpp b/Framework/DataHandling/src/LoadMuonNexus2.cpp
index 7238470ca9e..d1e1ba3e54a 100644
--- a/Framework/DataHandling/src/LoadMuonNexus2.cpp
+++ b/Framework/DataHandling/src/LoadMuonNexus2.cpp
@@ -335,8 +335,8 @@ Histogram LoadMuonNexus2::loadData(const BinEdges &edges,
  *   @param entry :: The Nexus entry
  *   @param period :: The period of this workspace
  */
-void LoadMuonNexus2::loadLogs(API::MatrixWorkspace_sptr ws, NXEntry &entry,
-                              int period) {
+void LoadMuonNexus2::loadLogs(const API::MatrixWorkspace_sptr &ws,
+                              NXEntry &entry, int period) {
   // Avoid compiler warning
   (void)period;
 
@@ -373,7 +373,7 @@ void LoadMuonNexus2::loadLogs(API::MatrixWorkspace_sptr ws, NXEntry &entry,
  * @param localWorkspace :: The workspace details to use
  */
 void LoadMuonNexus2::loadRunDetails(
-    DataObjects::Workspace2D_sptr localWorkspace) {
+    const DataObjects::Workspace2D_sptr &localWorkspace) {
   API::Run &runDetails = localWorkspace->mutableRun();
 
   runDetails.addProperty("run_title", localWorkspace->getTitle(), true);
diff --git a/Framework/DataHandling/src/LoadNXcanSAS.cpp b/Framework/DataHandling/src/LoadNXcanSAS.cpp
index c288e53514c..b1cc42fb7c8 100644
--- a/Framework/DataHandling/src/LoadNXcanSAS.cpp
+++ b/Framework/DataHandling/src/LoadNXcanSAS.cpp
@@ -106,7 +106,8 @@ createWorkspaceForHistogram(H5::DataSet &dataSet) {
 
 // ----- LOGS
 
-void loadLogs(H5::Group &entry, Mantid::API::MatrixWorkspace_sptr workspace) {
+void loadLogs(H5::Group &entry,
+              const Mantid::API::MatrixWorkspace_sptr &workspace) {
   auto &run = workspace->mutableRun();
 
   // Load UserFile (optional)
@@ -133,7 +134,7 @@ void loadLogs(H5::Group &entry, Mantid::API::MatrixWorkspace_sptr workspace) {
 }
 
 // ----- INSTRUMENT
-std::string extractIdfFileOnCurrentSystem(std::string idf) {
+std::string extractIdfFileOnCurrentSystem(const std::string &idf) {
   // If the idf is is not empty extract the last element from the file
   if (idf.empty()) {
     return "";
@@ -161,7 +162,7 @@ std::string extractIdfFileOnCurrentSystem(std::string idf) {
 }
 
 void loadInstrument(H5::Group &entry,
-                    Mantid::API::MatrixWorkspace_sptr workspace) {
+                    const Mantid::API::MatrixWorkspace_sptr &workspace) {
   auto instrument = entry.openGroup(sasInstrumentGroupName);
 
   // Get instrument name
@@ -232,7 +233,7 @@ bool hasQDev(H5::Group &dataGroup) {
 }
 
 void loadData1D(H5::Group &dataGroup,
-                Mantid::API::MatrixWorkspace_sptr workspace) {
+                const Mantid::API::MatrixWorkspace_sptr &workspace) {
   // General
   workspace->setDistribution(true);
 
@@ -268,7 +269,7 @@ void loadData1D(H5::Group &dataGroup,
 template <typename Functor>
 void read2DWorkspace(H5::DataSet &dataSet,
                      Mantid::API::MatrixWorkspace_sptr workspace, Functor func,
-                     H5::DataType memoryDataType) {
+                     const H5::DataType &memoryDataType) {
   using namespace Mantid::DataHandling::NXcanSAS;
   auto dimInfo = getDataSpaceInfo(dataSet);
 
@@ -297,8 +298,8 @@ void read2DWorkspace(H5::DataSet &dataSet,
 }
 
 void readQyInto2DWorkspace(H5::DataSet &dataSet,
-                           Mantid::API::MatrixWorkspace_sptr workspace,
-                           H5::DataType memoryDataType) {
+                           const Mantid::API::MatrixWorkspace_sptr &workspace,
+                           const H5::DataType &memoryDataType) {
   using namespace Mantid::DataHandling::NXcanSAS;
 
   // Get info about the data set
@@ -342,13 +343,13 @@ void readQyInto2DWorkspace(H5::DataSet &dataSet,
 }
 
 void loadData2D(H5::Group &dataGroup,
-                Mantid::API::MatrixWorkspace_sptr workspace) {
+                const Mantid::API::MatrixWorkspace_sptr &workspace) {
   // General
   workspace->setDistribution(true);
   //-----------------------------------------
   // Load the I value.
   auto iDataSet = dataGroup.openDataSet(sasDataI);
-  auto iExtractor = [](Mantid::API::MatrixWorkspace_sptr ws,
+  auto iExtractor = [](const Mantid::API::MatrixWorkspace_sptr &ws,
                        size_t index) -> HistogramY & {
     return ws->mutableY(index);
   };
@@ -360,7 +361,7 @@ void loadData2D(H5::Group &dataGroup,
   //-----------------------------------------
   // Load the Idev value
   auto eDataSet = dataGroup.openDataSet(sasDataIdev);
-  auto eExtractor = [](Mantid::API::MatrixWorkspace_sptr ws,
+  auto eExtractor = [](const Mantid::API::MatrixWorkspace_sptr &ws,
                        size_t index) -> HistogramE & {
     return ws->mutableE(index);
   };
@@ -369,7 +370,7 @@ void loadData2D(H5::Group &dataGroup,
   //-----------------------------------------
   // Load the Qx value + units
   auto qxDataSet = dataGroup.openDataSet(sasDataQx);
-  auto qxExtractor = [](Mantid::API::MatrixWorkspace_sptr ws,
+  auto qxExtractor = [](const Mantid::API::MatrixWorkspace_sptr &ws,
                         size_t index) -> HistogramX & {
     return ws->mutableX(index);
   };
@@ -384,7 +385,8 @@ void loadData2D(H5::Group &dataGroup,
   readQyInto2DWorkspace(qyDataSet, workspace, qyDataType);
 }
 
-void loadData(H5::Group &entry, Mantid::API::MatrixWorkspace_sptr workspace) {
+void loadData(H5::Group &entry,
+              const Mantid::API::MatrixWorkspace_sptr &workspace) {
   auto dataGroup = entry.openGroup(sasDataGroupName);
   auto dimensionality = getWorkspaceDimensionality(dataGroup);
   switch (dimensionality) {
@@ -433,7 +435,7 @@ bool hasTransmissionEntry(H5::Group &entry, const std::string &name) {
 }
 
 void loadTransmissionData(H5::Group &transmission,
-                          Mantid::API::MatrixWorkspace_sptr workspace) {
+                          const Mantid::API::MatrixWorkspace_sptr &workspace) {
   //-----------------------------------------
   // Load T
   workspace->mutableY(0) =
diff --git a/Framework/DataHandling/src/LoadNexusLogs.cpp b/Framework/DataHandling/src/LoadNexusLogs.cpp
index 3e44d7f2aba..5e328a533e0 100644
--- a/Framework/DataHandling/src/LoadNexusLogs.cpp
+++ b/Framework/DataHandling/src/LoadNexusLogs.cpp
@@ -549,7 +549,7 @@ void LoadNexusLogs::exec() {
  */
 void LoadNexusLogs::loadVetoPulses(
     ::NeXus::File &file,
-    boost::shared_ptr<API::MatrixWorkspace> workspace) const {
+    const boost::shared_ptr<API::MatrixWorkspace> &workspace) const {
   try {
     file.openGroup("Veto_pulse", "NXgroup");
   } catch (::NeXus::Exception &) {
@@ -583,7 +583,7 @@ void LoadNexusLogs::loadVetoPulses(
 
 void LoadNexusLogs::loadNPeriods(
     ::NeXus::File &file,
-    boost::shared_ptr<API::MatrixWorkspace> workspace) const {
+    const boost::shared_ptr<API::MatrixWorkspace> &workspace) const {
   int value = 1; // Default to 1-period unless
   try {
     file.openGroup("periods", "IXperiods");
@@ -648,7 +648,7 @@ void LoadNexusLogs::loadNPeriods(
 void LoadNexusLogs::loadLogs(
     ::NeXus::File &file, const std::string &entry_name,
     const std::string &entry_class,
-    boost::shared_ptr<API::MatrixWorkspace> workspace) const {
+    const boost::shared_ptr<API::MatrixWorkspace> &workspace) const {
   file.openGroup(entry_name, entry_class);
   std::map<std::string, std::string> entries = file.getEntries();
   std::map<std::string, std::string>::const_iterator iend = entries.end();
@@ -677,7 +677,7 @@ void LoadNexusLogs::loadLogs(
 void LoadNexusLogs::loadNXLog(
     ::NeXus::File &file, const std::string &entry_name,
     const std::string &entry_class,
-    boost::shared_ptr<API::MatrixWorkspace> workspace) const {
+    const boost::shared_ptr<API::MatrixWorkspace> &workspace) const {
   g_log.debug() << "processing " << entry_name << ":" << entry_class << "\n";
 
   file.openGroup(entry_name, entry_class);
@@ -715,7 +715,7 @@ void LoadNexusLogs::loadNXLog(
  */
 void LoadNexusLogs::loadSELog(
     ::NeXus::File &file, const std::string &entry_name,
-    boost::shared_ptr<API::MatrixWorkspace> workspace) const {
+    const boost::shared_ptr<API::MatrixWorkspace> &workspace) const {
   // Open the entry
   file.openGroup(entry_name, "IXseblock");
   std::string propName = entry_name;
diff --git a/Framework/DataHandling/src/LoadNexusMonitors2.cpp b/Framework/DataHandling/src/LoadNexusMonitors2.cpp
index 494bf5036de..8abcaf1e541 100644
--- a/Framework/DataHandling/src/LoadNexusMonitors2.cpp
+++ b/Framework/DataHandling/src/LoadNexusMonitors2.cpp
@@ -47,7 +47,7 @@ DECLARE_ALGORITHM(LoadNexusMonitors2)
 
 namespace {
 void loadSampleDataISIScompatibilityInfo(
-    ::NeXus::File &file, Mantid::API::MatrixWorkspace_sptr const WS) {
+    ::NeXus::File &file, Mantid::API::MatrixWorkspace_sptr const &WS) {
   try {
     file.openGroup("isis_vms_compat", "IXvms");
   } catch (::NeXus::Exception &) {
@@ -403,8 +403,9 @@ void LoadNexusMonitors2::fixUDets(::NeXus::File &file) {
   }
 }
 
-void LoadNexusMonitors2::runLoadLogs(const std::string filename,
-                                     API::MatrixWorkspace_sptr localWorkspace) {
+void LoadNexusMonitors2::runLoadLogs(
+    const std::string &filename,
+    const API::MatrixWorkspace_sptr &localWorkspace) {
   // do the actual work
   API::IAlgorithm_sptr loadLogs = createChildAlgorithm("LoadNexusLogs");
 
diff --git a/Framework/DataHandling/src/LoadNexusProcessed.cpp b/Framework/DataHandling/src/LoadNexusProcessed.cpp
index 270d6e2edd8..beb8c91a4dc 100644
--- a/Framework/DataHandling/src/LoadNexusProcessed.cpp
+++ b/Framework/DataHandling/src/LoadNexusProcessed.cpp
@@ -156,7 +156,7 @@ SpectraInfo extractMappingInfo(NXEntry &mtd_entry, Logger &logger) {
  * @param log : Information logger object
  * @return True only if multiperiod.
  */
-bool isMultiPeriodFile(int nWorkspaceEntries, Workspace_sptr sampleWS,
+bool isMultiPeriodFile(int nWorkspaceEntries, const Workspace_sptr &sampleWS,
                        Logger &log) {
   bool isMultiPeriod = false;
   if (ExperimentInfo_sptr expInfo =
@@ -1736,7 +1736,7 @@ std::map<std::string, std::string> LoadNexusProcessed::validateInputs() {
  * @param data :: reference to the NeXuS data for the axis
  */
 void LoadNexusProcessed::loadNonSpectraAxis(
-    API::MatrixWorkspace_sptr local_workspace, NXData &data) {
+    const API::MatrixWorkspace_sptr &local_workspace, NXData &data) {
   Axis *axis = local_workspace->getAxis(1);
 
   if (axis->isNumeric()) {
@@ -1773,7 +1773,7 @@ void LoadNexusProcessed::loadNonSpectraAxis(
  * @param elem1 :: first element in the vector
  * @param elem2 :: second element in the vecor
  */
-bool UDlesserExecCount(NXClassInfo elem1, NXClassInfo elem2) {
+bool UDlesserExecCount(const NXClassInfo &elem1, const NXClassInfo &elem2) {
   std::string::size_type index1, index2;
   std::string num1, num2;
   // find the number after "_" in algorithm name ( eg:MantidAlogorthm_1)
@@ -1859,7 +1859,7 @@ void LoadNexusProcessed::getWordsInString(const std::string &words4,
  * @param local_workspace :: The workspace to read into
  */
 void LoadNexusProcessed::readBinMasking(
-    NXData &wksp_cls, API::MatrixWorkspace_sptr local_workspace) {
+    NXData &wksp_cls, const API::MatrixWorkspace_sptr &local_workspace) {
   if (wksp_cls.getDataSetInfo("masked_spectra").stat == NX_ERROR) {
     return;
   }
@@ -1897,12 +1897,11 @@ void LoadNexusProcessed::readBinMasking(
  * @param hist :: The workspace index to start reading into
  * @param local_workspace :: A pointer to the workspace
  */
-void LoadNexusProcessed::loadBlock(NXDataSetTyped<double> &data,
-                                   NXDataSetTyped<double> &errors,
-                                   NXDataSetTyped<double> &farea, bool hasFArea,
-                                   NXDouble &xErrors, bool hasXErrors,
-                                   int blocksize, int nchannels, int &hist,
-                                   API::MatrixWorkspace_sptr local_workspace) {
+void LoadNexusProcessed::loadBlock(
+    NXDataSetTyped<double> &data, NXDataSetTyped<double> &errors,
+    NXDataSetTyped<double> &farea, bool hasFArea, NXDouble &xErrors,
+    bool hasXErrors, int blocksize, int nchannels, int &hist,
+    const API::MatrixWorkspace_sptr &local_workspace) {
   data.load(blocksize, hist);
   errors.load(blocksize, hist);
   double *data_start = data();
@@ -1979,13 +1978,11 @@ void LoadNexusProcessed::loadBlock(NXDataSetTyped<double> &data,
  * @param local_workspace :: A pointer to the workspace
  */
 
-void LoadNexusProcessed::loadBlock(NXDataSetTyped<double> &data,
-                                   NXDataSetTyped<double> &errors,
-                                   NXDataSetTyped<double> &farea, bool hasFArea,
-                                   NXDouble &xErrors, bool hasXErrors,
-                                   int blocksize, int nchannels, int &hist,
-                                   int &wsIndex,
-                                   API::MatrixWorkspace_sptr local_workspace) {
+void LoadNexusProcessed::loadBlock(
+    NXDataSetTyped<double> &data, NXDataSetTyped<double> &errors,
+    NXDataSetTyped<double> &farea, bool hasFArea, NXDouble &xErrors,
+    bool hasXErrors, int blocksize, int nchannels, int &hist, int &wsIndex,
+    const API::MatrixWorkspace_sptr &local_workspace) {
   data.load(blocksize, hist);
   errors.load(blocksize, hist);
   double *data_start = data();
@@ -2062,13 +2059,11 @@ void LoadNexusProcessed::loadBlock(NXDataSetTyped<double> &data,
  * @param wsIndex :: The workspace index to save data into
  * @param local_workspace :: A pointer to the workspace
  */
-void LoadNexusProcessed::loadBlock(NXDataSetTyped<double> &data,
-                                   NXDataSetTyped<double> &errors,
-                                   NXDataSetTyped<double> &farea, bool hasFArea,
-                                   NXDouble &xErrors, bool hasXErrors,
-                                   NXDouble &xbins, int blocksize,
-                                   int nchannels, int &hist, int &wsIndex,
-                                   API::MatrixWorkspace_sptr local_workspace) {
+void LoadNexusProcessed::loadBlock(
+    NXDataSetTyped<double> &data, NXDataSetTyped<double> &errors,
+    NXDataSetTyped<double> &farea, bool hasFArea, NXDouble &xErrors,
+    bool hasXErrors, NXDouble &xbins, int blocksize, int nchannels, int &hist,
+    int &wsIndex, const API::MatrixWorkspace_sptr &local_workspace) {
   data.load(blocksize, hist);
   double *data_start = data();
   double *data_end = data_start + nchannels;
diff --git a/Framework/DataHandling/src/LoadOff.cpp b/Framework/DataHandling/src/LoadOff.cpp
index 1ef80513f9f..f67ce2dacaa 100644
--- a/Framework/DataHandling/src/LoadOff.cpp
+++ b/Framework/DataHandling/src/LoadOff.cpp
@@ -15,7 +15,7 @@
 namespace Mantid {
 namespace DataHandling {
 
-LoadOff::LoadOff(std::string filename, ScaleUnits scaleType)
+LoadOff::LoadOff(const std::string &filename, ScaleUnits scaleType)
     : MeshFileIO(scaleType) {
   m_file = std::ifstream(filename.c_str());
   if (!m_file) {
diff --git a/Framework/DataHandling/src/LoadPDFgetNFile.cpp b/Framework/DataHandling/src/LoadPDFgetNFile.cpp
index 2a934c4cfb3..6f6fec0ad9a 100644
--- a/Framework/DataHandling/src/LoadPDFgetNFile.cpp
+++ b/Framework/DataHandling/src/LoadPDFgetNFile.cpp
@@ -106,7 +106,7 @@ void LoadPDFgetNFile::exec() {
  * 1. a 2D vector for column data
  * 2. a 1D string vector for column name
  */
-void LoadPDFgetNFile::parseDataFile(std::string filename) {
+void LoadPDFgetNFile::parseDataFile(const std::string &filename) {
   // 1. Open file
   std::ifstream ifile;
   ifile.open((filename.c_str()));
@@ -257,7 +257,7 @@ void LoadPDFgetNFile::parseDataLine(string line) {
 }
 
 //----------------------------------------------------------------------------------------------
-void LoadPDFgetNFile::setUnit(Workspace2D_sptr ws) {
+void LoadPDFgetNFile::setUnit(const Workspace2D_sptr &ws) {
   // 1. Set X
   string xcolname = mColumnNames[0];
 
diff --git a/Framework/DataHandling/src/LoadPSIMuonBin.cpp b/Framework/DataHandling/src/LoadPSIMuonBin.cpp
index e720abdfb82..c0895643e2b 100644
--- a/Framework/DataHandling/src/LoadPSIMuonBin.cpp
+++ b/Framework/DataHandling/src/LoadPSIMuonBin.cpp
@@ -234,8 +234,8 @@ void LoadPSIMuonBin::makeDeadTimeTable(const size_t &numSpec) {
   setProperty("DeadTimeTable", deadTimeTable);
 }
 
-std::string LoadPSIMuonBin::getFormattedDateTime(std::string date,
-                                                 std::string time) {
+std::string LoadPSIMuonBin::getFormattedDateTime(const std::string &date,
+                                                 const std::string &time) {
   std::string year;
   if (date.size() == 11) {
     year = date.substr(7, 4);
diff --git a/Framework/DataHandling/src/LoadPreNexusMonitors.cpp b/Framework/DataHandling/src/LoadPreNexusMonitors.cpp
index d674efbbbee..29dd9cca6fb 100644
--- a/Framework/DataHandling/src/LoadPreNexusMonitors.cpp
+++ b/Framework/DataHandling/src/LoadPreNexusMonitors.cpp
@@ -226,7 +226,7 @@ void LoadPreNexusMonitors::exec() {
  * geometry
  */
 void LoadPreNexusMonitors::runLoadInstrument(
-    const std::string &instrument, MatrixWorkspace_sptr localWorkspace) {
+    const std::string &instrument, const MatrixWorkspace_sptr &localWorkspace) {
 
   IAlgorithm_sptr loadInst = createChildAlgorithm("LoadInstrument");
 
diff --git a/Framework/DataHandling/src/LoadRKH.cpp b/Framework/DataHandling/src/LoadRKH.cpp
index 2e31b6cb0f8..dcaa1c1d584 100644
--- a/Framework/DataHandling/src/LoadRKH.cpp
+++ b/Framework/DataHandling/src/LoadRKH.cpp
@@ -585,7 +585,7 @@ void LoadRKH::skipLines(std::istream &strm, int nlines) {
  *  @param[out] toCenter an array that is one shorter than oldBoundaries, the
  * values of the means of pairs of values from the input
  */
-void LoadRKH::binCenter(const MantidVec oldBoundaries,
+void LoadRKH::binCenter(const MantidVec &oldBoundaries,
                         MantidVec &toCenter) const {
   VectorHelper::convertToBinCentre(oldBoundaries, toCenter);
 }
diff --git a/Framework/DataHandling/src/LoadRaw3.cpp b/Framework/DataHandling/src/LoadRaw3.cpp
index 13f5d13647f..a964ca6db5f 100644
--- a/Framework/DataHandling/src/LoadRaw3.cpp
+++ b/Framework/DataHandling/src/LoadRaw3.cpp
@@ -311,7 +311,7 @@ void LoadRaw3::exec() {
  */
 void LoadRaw3::excludeMonitors(FILE *file, const int &period,
                                const std::vector<specnum_t> &monitorList,
-                               DataObjects::Workspace2D_sptr ws_sptr) {
+                               const DataObjects::Workspace2D_sptr &ws_sptr) {
   int64_t histCurrent = -1;
   int64_t wsIndex = 0;
   auto histTotal = static_cast<double>(m_total_specs * m_numberOfPeriods);
@@ -358,7 +358,7 @@ void LoadRaw3::excludeMonitors(FILE *file, const int &period,
  *@param ws_sptr :: shared pointer to workspace
  */
 void LoadRaw3::includeMonitors(FILE *file, const int64_t &period,
-                               DataObjects::Workspace2D_sptr ws_sptr) {
+                               const DataObjects::Workspace2D_sptr &ws_sptr) {
 
   int64_t histCurrent = -1;
   int64_t wsIndex = 0;
@@ -404,8 +404,8 @@ void LoadRaw3::includeMonitors(FILE *file, const int64_t &period,
 
 void LoadRaw3::separateMonitors(FILE *file, const int64_t &period,
                                 const std::vector<specnum_t> &monitorList,
-                                DataObjects::Workspace2D_sptr ws_sptr,
-                                DataObjects::Workspace2D_sptr mws_sptr) {
+                                const DataObjects::Workspace2D_sptr &ws_sptr,
+                                const DataObjects::Workspace2D_sptr &mws_sptr) {
   int64_t histCurrent = -1;
   int64_t wsIndex = 0;
   int64_t mwsIndex = 0;
diff --git a/Framework/DataHandling/src/LoadRawHelper.cpp b/Framework/DataHandling/src/LoadRawHelper.cpp
index 83682479d5d..49410e7ce21 100644
--- a/Framework/DataHandling/src/LoadRawHelper.cpp
+++ b/Framework/DataHandling/src/LoadRawHelper.cpp
@@ -216,7 +216,7 @@ void LoadRawHelper::readworkspaceParameters(specnum_t &numberOfSpectra,
  * @return an empty workspace of the given parameters
  */
 DataObjects::Workspace2D_sptr
-LoadRawHelper::createWorkspace(DataObjects::Workspace2D_sptr ws_sptr,
+LoadRawHelper::createWorkspace(const DataObjects::Workspace2D_sptr &ws_sptr,
                                int64_t nVectors, int64_t xLengthIn,
                                int64_t yLengthIn) {
   DataObjects::Workspace2D_sptr empty;
@@ -270,7 +270,7 @@ void LoadRawHelper::createMonitorWorkspace(
     DataObjects::Workspace2D_sptr &normalws_sptr,
     WorkspaceGroup_sptr &mongrp_sptr, const int64_t mwsSpecs,
     const int64_t nwsSpecs, const int64_t numberOfPeriods,
-    const int64_t lengthIn, const std::string title,
+    const int64_t lengthIn, const std::string &title,
     API::Algorithm *const pAlg) {
   try {
     // create monitor group workspace
@@ -328,10 +328,10 @@ void LoadRawHelper::exec() {}
  *  @param bmonitors :: boolean flag to name  the workspaces
  *  @param pAlg      :: pointer to algorithm this method works with.
  */
-void LoadRawHelper::setWorkspaceProperty(DataObjects::Workspace2D_sptr ws_sptr,
-                                         WorkspaceGroup_sptr grpws_sptr,
-                                         const int64_t period, bool bmonitors,
-                                         API::Algorithm *const pAlg) {
+void LoadRawHelper::setWorkspaceProperty(
+    const DataObjects::Workspace2D_sptr &ws_sptr,
+    const WorkspaceGroup_sptr &grpws_sptr, const int64_t period, bool bmonitors,
+    API::Algorithm *const pAlg) {
   if (!ws_sptr)
     return;
   if (!grpws_sptr)
@@ -366,12 +366,11 @@ void LoadRawHelper::setWorkspaceProperty(DataObjects::Workspace2D_sptr ws_sptr,
  * workspace
  *  @param pAlg         :: pointer to algorithm this method works with.
  */
-void LoadRawHelper::setWorkspaceProperty(const std::string &propertyName,
-                                         const std::string &title,
-                                         WorkspaceGroup_sptr grpws_sptr,
-                                         DataObjects::Workspace2D_sptr ws_sptr,
-                                         int64_t numberOfPeriods, bool bMonitor,
-                                         API::Algorithm *const pAlg) {
+void LoadRawHelper::setWorkspaceProperty(
+    const std::string &propertyName, const std::string &title,
+    const WorkspaceGroup_sptr &grpws_sptr,
+    const DataObjects::Workspace2D_sptr &ws_sptr, int64_t numberOfPeriods,
+    bool bMonitor, API::Algorithm *const pAlg) {
   UNUSED_ARG(bMonitor);
   Property *ws = pAlg->getProperty("OutputWorkspace");
   if (!ws)
@@ -401,7 +400,7 @@ void LoadRawHelper::setWorkspaceProperty(const std::string &propertyName,
  *  @param binStart :: start of bin
  */
 void LoadRawHelper::setWorkspaceData(
-    DataObjects::Workspace2D_sptr newWorkspace,
+    const DataObjects::Workspace2D_sptr &newWorkspace,
     const std::vector<boost::shared_ptr<HistogramData::HistogramX>>
         &timeChannelsVec,
     int64_t wsIndex, specnum_t nspecNum, int64_t noTimeRegimes,
@@ -544,8 +543,9 @@ LoadRawHelper::getTimeChannels(const int64_t &regimes,
 /// @param progStart :: progress at start
 /// @param progEnd :: progress at end
 void LoadRawHelper::runLoadInstrument(
-    const std::string &fileName, DataObjects::Workspace2D_sptr localWorkspace,
-    double progStart, double progEnd) {
+    const std::string &fileName,
+    const DataObjects::Workspace2D_sptr &localWorkspace, double progStart,
+    double progEnd) {
   g_log.debug("Loading the instrument definition...");
   m_prog = progStart;
   progress(m_prog, "Loading the instrument geometry...");
@@ -631,7 +631,8 @@ void LoadRawHelper::runLoadInstrument(
 /// @param fileName :: the raw file filename
 /// @param localWorkspace :: The workspace to load the instrument for
 void LoadRawHelper::runLoadInstrumentFromRaw(
-    const std::string &fileName, DataObjects::Workspace2D_sptr localWorkspace) {
+    const std::string &fileName,
+    const DataObjects::Workspace2D_sptr &localWorkspace) {
   IAlgorithm_sptr loadInst = createChildAlgorithm("LoadInstrumentFromRaw");
   loadInst->setPropertyValue("Filename", fileName);
   // Set the workspace property to be the same one filled above
@@ -659,7 +660,8 @@ void LoadRawHelper::runLoadInstrumentFromRaw(
 /// @param fileName :: the raw file filename
 /// @param localWorkspace :: The workspace to load the mapping table for
 void LoadRawHelper::runLoadMappingTable(
-    const std::string &fileName, DataObjects::Workspace2D_sptr localWorkspace) {
+    const std::string &fileName,
+    const DataObjects::Workspace2D_sptr &localWorkspace) {
   g_log.debug("Loading the spectra-detector mapping...");
   progress(m_prog, "Loading the spectra-detector mapping...");
   // Now determine the spectra to detector map calling Child Algorithm
@@ -685,9 +687,10 @@ void LoadRawHelper::runLoadMappingTable(
 /// @param localWorkspace :: The workspace to load the logs for
 /// @param progStart :: starting progress fraction
 /// @param progEnd :: ending progress fraction
-void LoadRawHelper::runLoadLog(const std::string &fileName,
-                               DataObjects::Workspace2D_sptr localWorkspace,
-                               double progStart, double progEnd) {
+void LoadRawHelper::runLoadLog(
+    const std::string &fileName,
+    const DataObjects::Workspace2D_sptr &localWorkspace, double progStart,
+    double progEnd) {
   // search for the log file to load, and save their names in a set.
   std::list<std::string> logFiles = searchForLogFiles(fileName);
 
@@ -773,7 +776,7 @@ std::string LoadRawHelper::extractLogName(const std::string &path) {
  * @param local_workspace :: workspace to add period log data to.
  */
 void LoadRawHelper::createPeriodLogs(
-    int64_t period, DataObjects::Workspace2D_sptr local_workspace) {
+    int64_t period, const DataObjects::Workspace2D_sptr &local_workspace) {
   m_logCreator->addPeriodLogs(static_cast<int>(period),
                               local_workspace->mutableRun());
 }
@@ -785,8 +788,9 @@ void LoadRawHelper::createPeriodLogs(
  * @param localWorkspace :: The workspace to attach the information to
  * @param rawFile :: The handle to an ISIS Raw file
  */
-void LoadRawHelper::loadRunParameters(API::MatrixWorkspace_sptr localWorkspace,
-                                      ISISRAW *const rawFile) const {
+void LoadRawHelper::loadRunParameters(
+    const API::MatrixWorkspace_sptr &localWorkspace,
+    ISISRAW *const rawFile) const {
   ISISRAW &localISISRaw = [this, rawFile]() -> ISISRAW & {
     if (rawFile)
       return *rawFile;
@@ -1098,8 +1102,9 @@ void LoadRawHelper::calculateWorkspacesizes(
 
 void LoadRawHelper::loadSpectra(
     FILE *file, const int &period, const int &total_specs,
-    DataObjects::Workspace2D_sptr ws_sptr,
-    std::vector<boost::shared_ptr<HistogramData::HistogramX>> timeChannelsVec) {
+    const DataObjects::Workspace2D_sptr &ws_sptr,
+    const std::vector<boost::shared_ptr<HistogramData::HistogramX>>
+        &timeChannelsVec) {
   double progStart = m_prog;
   double progEnd = 1.0; // Assume this function is called last
 
diff --git a/Framework/DataHandling/src/LoadSPE.cpp b/Framework/DataHandling/src/LoadSPE.cpp
index 11218db3a9a..791b44ecdf0 100644
--- a/Framework/DataHandling/src/LoadSPE.cpp
+++ b/Framework/DataHandling/src/LoadSPE.cpp
@@ -185,7 +185,8 @@ void LoadSPE::exec() {
  *  @param workspace :: The output workspace
  *  @param index ::     The index of the current spectrum
  */
-void LoadSPE::readHistogram(FILE *speFile, API::MatrixWorkspace_sptr workspace,
+void LoadSPE::readHistogram(FILE *speFile,
+                            const API::MatrixWorkspace_sptr &workspace,
                             size_t index) {
   // First, there should be a comment line
   char comment[100];
diff --git a/Framework/DataHandling/src/LoadSampleShape.cpp b/Framework/DataHandling/src/LoadSampleShape.cpp
index 7e438fe4976..1ab9f5ac533 100644
--- a/Framework/DataHandling/src/LoadSampleShape.cpp
+++ b/Framework/DataHandling/src/LoadSampleShape.cpp
@@ -99,7 +99,7 @@ void LoadSampleShape::exec() {
  * @param inputWS The workspace to get the rotation from
  * @returns a shared pointer to the newly rotated Shape
  */
-void rotate(MeshObject &sampleMesh, MatrixWorkspace_const_sptr inputWS) {
+void rotate(MeshObject &sampleMesh, const MatrixWorkspace_const_sptr &inputWS) {
   const std::vector<double> rotationMatrix =
       inputWS->run().getGoniometer().getR();
   sampleMesh.rotate(rotationMatrix);
diff --git a/Framework/DataHandling/src/LoadSassena.cpp b/Framework/DataHandling/src/LoadSassena.cpp
index 95ebc7333d7..0635840afa1 100644
--- a/Framework/DataHandling/src/LoadSassena.cpp
+++ b/Framework/DataHandling/src/LoadSassena.cpp
@@ -20,6 +20,8 @@
 
 #include <hdf5_hl.h>
 
+#include <utility>
+
 namespace Mantid {
 namespace DataHandling {
 
@@ -47,9 +49,9 @@ int LoadSassena::confidence(Kernel::NexusDescriptor &descriptor) const {
  * @param ws pointer to workspace to be added and registered
  * @param description
  */
-void LoadSassena::registerWorkspace(API::WorkspaceGroup_sptr gws,
-                                    const std::string wsName,
-                                    DataObjects::Workspace2D_sptr ws,
+void LoadSassena::registerWorkspace(const API::WorkspaceGroup_sptr &gws,
+                                    const std::string &wsName,
+                                    const DataObjects::Workspace2D_sptr &ws,
                                     const std::string &description) {
   UNUSED_ARG(description);
   API::AnalysisDataService::Instance().add(wsName, ws);
@@ -63,7 +65,7 @@ void LoadSassena::registerWorkspace(API::WorkspaceGroup_sptr gws,
  * @param dims storing dimensionality
  */
 
-herr_t LoadSassena::dataSetInfo(const hid_t &h5file, const std::string setName,
+herr_t LoadSassena::dataSetInfo(const hid_t &h5file, const std::string &setName,
                                 hsize_t *dims) const {
   H5T_class_t class_id;
   size_t type_size;
@@ -82,7 +84,7 @@ herr_t LoadSassena::dataSetInfo(const hid_t &h5file, const std::string setName,
  * @param buf storing dataset
  */
 herr_t LoadSassena::dataSetDouble(const hid_t &h5file,
-                                  const std::string setName,
+                                  const std::string &setName,
                                   std::vector<double> &buf) {
   herr_t errorcode =
       H5LTread_dataset_double(h5file, setName.c_str(), buf.data());
@@ -110,7 +112,8 @@ bool compare(const mypair &left, const mypair &right) {
  * increasing order of momemtum transfer
  */
 HistogramData::Points
-LoadSassena::loadQvectors(const hid_t &h5file, API::WorkspaceGroup_sptr gws,
+LoadSassena::loadQvectors(const hid_t &h5file,
+                          const API::WorkspaceGroup_sptr &gws,
                           std::vector<int> &sorting_indexes) {
 
   // store the modulus of the vector
@@ -169,7 +172,8 @@ LoadSassena::loadQvectors(const hid_t &h5file, API::WorkspaceGroup_sptr gws,
       "MomentumTransfer"); // Set the Units
 
   this->registerWorkspace(
-      gws, wsName, ws, "X-axis: origin of Q-vectors; Y-axis: tip of Q-vectors");
+      std::move(gws), wsName, ws,
+      "X-axis: origin of Q-vectors; Y-axis: tip of Q-vectors");
   return HistogramData::Points(std::move(qvmod));
 }
 
@@ -184,8 +188,9 @@ LoadSassena::loadQvectors(const hid_t &h5file, API::WorkspaceGroup_sptr gws,
  * @param sorting_indexes permutation of qvmod indexes to render it in
  * increasing order of momemtum transfer
  */
-void LoadSassena::loadFQ(const hid_t &h5file, API::WorkspaceGroup_sptr gws,
-                         const std::string setName,
+void LoadSassena::loadFQ(const hid_t &h5file,
+                         const API::WorkspaceGroup_sptr &gws,
+                         const std::string &setName,
                          const HistogramData::Points &qvmod,
                          const std::vector<int> &sorting_indexes) {
 
@@ -221,7 +226,7 @@ void LoadSassena::loadFQ(const hid_t &h5file, API::WorkspaceGroup_sptr gws,
       Kernel::UnitFactory::Instance().create("MomentumTransfer");
 
   this->registerWorkspace(
-      gws, wsName, ws,
+      std::move(gws), wsName, ws,
       "X-axis: Q-vector modulus; Y-axis: intermediate structure factor");
 }
 
@@ -238,8 +243,9 @@ void LoadSassena::loadFQ(const hid_t &h5file, API::WorkspaceGroup_sptr gws,
  * @param sorting_indexes permutation of qvmod indexes to render it in
  * increasing order of momemtum transfer
  */
-void LoadSassena::loadFQT(const hid_t &h5file, API::WorkspaceGroup_sptr gws,
-                          const std::string setName,
+void LoadSassena::loadFQT(const hid_t &h5file,
+                          const API::WorkspaceGroup_sptr &gws,
+                          const std::string &setName,
                           const HistogramData::Points &qvmod,
                           const std::vector<int> &sorting_indexes) {
 
diff --git a/Framework/DataHandling/src/LoadSpice2D.cpp b/Framework/DataHandling/src/LoadSpice2D.cpp
index 34287f87718..0b71b108096 100644
--- a/Framework/DataHandling/src/LoadSpice2D.cpp
+++ b/Framework/DataHandling/src/LoadSpice2D.cpp
@@ -80,8 +80,9 @@ bool from_string(T &t, const std::string &s,
  * @param wavelength: wavelength value [Angstrom]
  * @param dwavelength: error on the wavelength [Angstrom]
  */
-void store_value(DataObjects::Workspace2D_sptr ws, int specID, double value,
-                 double error, double wavelength, double dwavelength) {
+void store_value(const DataObjects::Workspace2D_sptr &ws, int specID,
+                 double value, double error, double wavelength,
+                 double dwavelength) {
   auto &X = ws->mutableX(specID);
   auto &Y = ws->mutableY(specID);
   auto &E = ws->mutableE(specID);
@@ -659,7 +660,7 @@ void LoadSpice2D::detectorTranslation(
  */
 void LoadSpice2D::runLoadInstrument(
     const std::string &inst_name,
-    DataObjects::Workspace2D_sptr localWorkspace) {
+    const DataObjects::Workspace2D_sptr &localWorkspace) {
 
   API::IAlgorithm_sptr loadInst = createChildAlgorithm("LoadInstrument");
 
diff --git a/Framework/DataHandling/src/LoadSpiceAscii.cpp b/Framework/DataHandling/src/LoadSpiceAscii.cpp
index a2ddfae1144..d95e776cdeb 100644
--- a/Framework/DataHandling/src/LoadSpiceAscii.cpp
+++ b/Framework/DataHandling/src/LoadSpiceAscii.cpp
@@ -436,7 +436,7 @@ LoadSpiceAscii::createRunInfoWS(std::map<std::string, std::string> runinfodict,
  * @param datetimeprop
  */
 void LoadSpiceAscii::setupRunStartTime(
-    API::MatrixWorkspace_sptr runinfows,
+    const API::MatrixWorkspace_sptr &runinfows,
     const std::vector<std::string> &datetimeprop) {
   // Check if no need to process run start time
   if (datetimeprop.empty()) {
@@ -596,7 +596,7 @@ std::string LoadSpiceAscii::processTimeString(const std::string &rawtime,
  * @param pvalue
  */
 template <typename T>
-void LoadSpiceAscii::addProperty(API::MatrixWorkspace_sptr ws,
+void LoadSpiceAscii::addProperty(const API::MatrixWorkspace_sptr &ws,
                                  const std::string &pname, T pvalue) {
   ws->mutableRun().addLogData(new PropertyWithValue<T>(pname, pvalue));
 }
diff --git a/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp b/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp
index 5ccd00dee3a..5efadb955db 100644
--- a/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp
+++ b/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp
@@ -283,7 +283,8 @@ void LoadSpiceXML2DDet::processInputs() {
  * @param outws :: workspace to have sample logs to set up
  * @return
  */
-bool LoadSpiceXML2DDet::setupSampleLogs(API::MatrixWorkspace_sptr outws) {
+bool LoadSpiceXML2DDet::setupSampleLogs(
+    const API::MatrixWorkspace_sptr &outws) {
   // With given spice scan table, 2-theta is read from there.
   if (m_hasScanTable) {
     ITableWorkspace_sptr spicetablews = getProperty("SpiceTableWorkspace");
@@ -938,8 +939,8 @@ API::MatrixWorkspace_sptr LoadSpiceXML2DDet::xmlParseDetectorNode(
  * @param ptnumber
  */
 void LoadSpiceXML2DDet::setupSampleLogFromSpiceTable(
-    MatrixWorkspace_sptr matrixws, ITableWorkspace_sptr spicetablews,
-    int ptnumber) {
+    const MatrixWorkspace_sptr &matrixws,
+    const ITableWorkspace_sptr &spicetablews, int ptnumber) {
   size_t numrows = spicetablews->rowCount();
   std::vector<std::string> colnames = spicetablews->getColumnNames();
   // FIXME - Shouldn't give a better value?
@@ -978,7 +979,7 @@ void LoadSpiceXML2DDet::setupSampleLogFromSpiceTable(
  * @param wavelength
  * @return
  */
-bool LoadSpiceXML2DDet::getHB3AWavelength(MatrixWorkspace_sptr dataws,
+bool LoadSpiceXML2DDet::getHB3AWavelength(const MatrixWorkspace_sptr &dataws,
                                           double &wavelength) {
   bool haswavelength(false);
   wavelength = -1.;
@@ -1043,7 +1044,7 @@ bool LoadSpiceXML2DDet::getHB3AWavelength(MatrixWorkspace_sptr dataws,
  * @param dataws
  * @param wavelength
  */
-void LoadSpiceXML2DDet::setXtoLabQ(API::MatrixWorkspace_sptr dataws,
+void LoadSpiceXML2DDet::setXtoLabQ(const API::MatrixWorkspace_sptr &dataws,
                                    const double &wavelength) {
 
   size_t numspec = dataws->getNumberHistograms();
diff --git a/Framework/DataHandling/src/LoadTBL.cpp b/Framework/DataHandling/src/LoadTBL.cpp
index 5f8d2412c64..32b8778f367 100644
--- a/Framework/DataHandling/src/LoadTBL.cpp
+++ b/Framework/DataHandling/src/LoadTBL.cpp
@@ -81,7 +81,7 @@ int LoadTBL::confidence(Kernel::FileDescriptor &descriptor) const {
  * @param line the line to count from
  * @returns a size_t of how many commas were in line
  */
-size_t LoadTBL::countCommas(std::string line) const {
+size_t LoadTBL::countCommas(const std::string &line) const {
   size_t found = 0;
   size_t pos = line.find(',', 0);
   if (pos != std::string::npos) {
@@ -104,7 +104,7 @@ size_t LoadTBL::countCommas(std::string line) const {
  * @returns a size_t of how many pairs of quotes were in line
  */
 size_t
-LoadTBL::findQuotePairs(std::string line,
+LoadTBL::findQuotePairs(const std::string &line,
                         std::vector<std::vector<size_t>> &quoteBounds) const {
   size_t quoteOne = 0;
   size_t quoteTwo = 0;
@@ -137,7 +137,7 @@ LoadTBL::findQuotePairs(std::string line,
  * @throws std::length_error if anything other than 17 columns (or 16
  * cell-delimiting commas) is found
  */
-void LoadTBL::csvParse(std::string line, std::vector<std::string> &cols,
+void LoadTBL::csvParse(const std::string &line, std::vector<std::string> &cols,
                        std::vector<std::vector<size_t>> &quoteBounds,
                        size_t expectedCommas) const {
   size_t pairID = 0;
diff --git a/Framework/DataHandling/src/LoadTOFRawNexus.cpp b/Framework/DataHandling/src/LoadTOFRawNexus.cpp
index 6e4674f1c1c..70e95229d38 100644
--- a/Framework/DataHandling/src/LoadTOFRawNexus.cpp
+++ b/Framework/DataHandling/src/LoadTOFRawNexus.cpp
@@ -20,6 +20,7 @@
 
 #include <boost/algorithm/string/detail/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
+#include <utility>
 
 namespace Mantid {
 namespace DataHandling {
@@ -267,7 +268,7 @@ namespace {
 // Check the numbers supplied are not in the range and erase the ones that are
 struct range_check {
   range_check(specnum_t min, specnum_t max, detid2index_map id_to_wi)
-      : m_min(min), m_max(max), m_id_to_wi(id_to_wi) {}
+      : m_min(min), m_max(max), m_id_to_wi(std::move(id_to_wi)) {}
 
   bool operator()(specnum_t x) {
     auto wi = static_cast<specnum_t>((m_id_to_wi)[x]);
@@ -292,7 +293,7 @@ private:
 void LoadTOFRawNexus::loadBank(const std::string &nexusfilename,
                                const std::string &entry_name,
                                const std::string &bankName,
-                               API::MatrixWorkspace_sptr WS,
+                               const API::MatrixWorkspace_sptr &WS,
                                const detid2index_map &id_to_wi) {
   g_log.debug() << "Loading bank " << bankName << '\n';
   // To avoid segfaults on RHEL5/6 and Fedora
diff --git a/Framework/DataHandling/src/MaskDetectors.cpp b/Framework/DataHandling/src/MaskDetectors.cpp
index 6e361b54a98..1661e4a4605 100644
--- a/Framework/DataHandling/src/MaskDetectors.cpp
+++ b/Framework/DataHandling/src/MaskDetectors.cpp
@@ -244,8 +244,8 @@ void MaskDetectors::exec() {
  * @param rangeInfo :: information about the spectrum range to use when masking
  */
 void MaskDetectors::handleMaskByMaskWorkspace(
-    const MaskWorkspace_const_sptr maskWs,
-    const API::MatrixWorkspace_const_sptr WS,
+    const MaskWorkspace_const_sptr &maskWs,
+    const API::MatrixWorkspace_const_sptr &WS,
     std::vector<detid_t> &detectorList, std::vector<size_t> &indexList,
     const RangeInfo &rangeInfo) {
 
@@ -280,8 +280,8 @@ void MaskDetectors::handleMaskByMaskWorkspace(
  * @param rangeInfo :: information about the spectrum range to use when masking
  */
 void MaskDetectors::handleMaskByMatrixWorkspace(
-    const API::MatrixWorkspace_const_sptr maskWs,
-    const API::MatrixWorkspace_const_sptr WS,
+    const API::MatrixWorkspace_const_sptr &maskWs,
+    const API::MatrixWorkspace_const_sptr &WS,
     std::vector<detid_t> &detectorList, std::vector<size_t> &indexList,
     const RangeInfo &rangeInfo) {
 
@@ -395,7 +395,7 @@ void MaskDetectors::extractMaskedWSDetIDs(
  * Peaks exec body
  * @param WS :: The input peaks workspace to be masked
  */
-void MaskDetectors::execPeaks(PeaksWorkspace_sptr WS) {
+void MaskDetectors::execPeaks(const PeaksWorkspace_sptr &WS) {
   std::vector<detid_t> detectorList = getProperty("DetectorList");
   const MatrixWorkspace_sptr prevMasking = getProperty("MaskedWorkspace");
 
@@ -455,7 +455,7 @@ void MaskDetectors::execPeaks(PeaksWorkspace_sptr WS) {
 void MaskDetectors::fillIndexListFromSpectra(
     std::vector<size_t> &indexList,
     std::vector<Indexing::SpectrumNumber> spectraList,
-    const API::MatrixWorkspace_sptr WS,
+    const API::MatrixWorkspace_sptr &WS,
     const std::tuple<size_t, size_t, bool> &range_info) {
 
   std::vector<size_t> tmp_index;
@@ -494,7 +494,7 @@ void MaskDetectors::fillIndexListFromSpectra(
  *                            Boolean indicating if these ranges are defined
  */
 void MaskDetectors::appendToIndexListFromWS(
-    std::vector<size_t> &indexList, const MatrixWorkspace_const_sptr sourceWS,
+    std::vector<size_t> &indexList, const MatrixWorkspace_const_sptr &sourceWS,
     const std::tuple<size_t, size_t, bool> &range_info) {
 
   std::vector<size_t> tmp_index;
@@ -537,8 +537,8 @@ void MaskDetectors::appendToIndexListFromWS(
  */
 void MaskDetectors::appendToDetectorListFromWS(
     std::vector<detid_t> &detectorList,
-    const MatrixWorkspace_const_sptr inputWs,
-    const MatrixWorkspace_const_sptr maskWs,
+    const MatrixWorkspace_const_sptr &inputWs,
+    const MatrixWorkspace_const_sptr &maskWs,
     const std::tuple<size_t, size_t, bool> &range_info) {
   const auto startIndex = std::get<0>(range_info);
   const auto endIndex = std::get<1>(range_info);
@@ -567,7 +567,7 @@ void MaskDetectors::appendToDetectorListFromWS(
  */
 void MaskDetectors::appendToIndexListFromMaskWS(
     std::vector<size_t> &indexList,
-    const DataObjects::MaskWorkspace_const_sptr maskedWorkspace,
+    const DataObjects::MaskWorkspace_const_sptr &maskedWorkspace,
     const std::tuple<size_t, size_t, bool> &range_info) {
 
   std::vector<size_t> tmp_index;
@@ -610,7 +610,7 @@ void MaskDetectors::appendToIndexListFromMaskWS(
 void MaskDetectors::appendToDetectorListFromComponentList(
     std::vector<detid_t> &detectorList,
     const std::vector<std::string> &componentList,
-    const API::MatrixWorkspace_const_sptr WS) {
+    const API::MatrixWorkspace_const_sptr &WS) {
   const auto instrument = WS->getInstrument();
   if (!instrument) {
     g_log.error()
diff --git a/Framework/DataHandling/src/MaskDetectorsInShape.cpp b/Framework/DataHandling/src/MaskDetectorsInShape.cpp
index af163e49407..08b2a090d9d 100644
--- a/Framework/DataHandling/src/MaskDetectorsInShape.cpp
+++ b/Framework/DataHandling/src/MaskDetectorsInShape.cpp
@@ -53,7 +53,7 @@ void MaskDetectorsInShape::exec() {
 
 /// Run the FindDetectorsInShape Child Algorithm
 std::vector<int> MaskDetectorsInShape::runFindDetectorsInShape(
-    API::MatrixWorkspace_sptr workspace, const std::string shapeXML,
+    const API::MatrixWorkspace_sptr &workspace, const std::string &shapeXML,
     const bool includeMonitors) {
   IAlgorithm_sptr alg = createChildAlgorithm("FindDetectorsInShape");
   alg->setPropertyValue("IncludeMonitors", includeMonitors ? "1" : "0");
@@ -76,7 +76,8 @@ std::vector<int> MaskDetectorsInShape::runFindDetectorsInShape(
 }
 
 void MaskDetectorsInShape::runMaskDetectors(
-    API::MatrixWorkspace_sptr workspace, const std::vector<int> &detectorIds) {
+    const API::MatrixWorkspace_sptr &workspace,
+    const std::vector<int> &detectorIds) {
   auto &detectorInfo = workspace->mutableDetectorInfo();
   for (const auto &id : detectorIds)
     detectorInfo.setMasked(detectorInfo.indexOf(id), true);
diff --git a/Framework/DataHandling/src/MeshFileIO.cpp b/Framework/DataHandling/src/MeshFileIO.cpp
index 6d481549fd9..6b899115961 100644
--- a/Framework/DataHandling/src/MeshFileIO.cpp
+++ b/Framework/DataHandling/src/MeshFileIO.cpp
@@ -88,7 +88,7 @@ Kernel::Matrix<double> MeshFileIO::generateZRotation(double zRotation) {
  */
 boost::shared_ptr<Geometry::MeshObject>
 MeshFileIO::translate(boost::shared_ptr<Geometry::MeshObject> environmentMesh,
-                      const std::vector<double> translationVector) {
+                      const std::vector<double> &translationVector) {
   std::vector<double> checkVector = std::vector<double>(3, 0.0);
   if (translationVector != checkVector) {
     if (translationVector.size() != 3) {
diff --git a/Framework/DataHandling/src/PDLoadCharacterizations.cpp b/Framework/DataHandling/src/PDLoadCharacterizations.cpp
index 091ccc71d93..6bccfcb4b5f 100644
--- a/Framework/DataHandling/src/PDLoadCharacterizations.cpp
+++ b/Framework/DataHandling/src/PDLoadCharacterizations.cpp
@@ -298,7 +298,7 @@ std::vector<std::string> PDLoadCharacterizations::getFilenames() {
  * @returns line number that file was read to
  */
 int PDLoadCharacterizations::readFocusInfo(std::ifstream &file,
-                                           const std::string filename) {
+                                           const std::string &filename) {
   // end early if already at the end of the file
   if (file.eof())
     return 0;
diff --git a/Framework/DataHandling/src/ProcessBankData.cpp b/Framework/DataHandling/src/ProcessBankData.cpp
index 323529fe143..c75481df46e 100644
--- a/Framework/DataHandling/src/ProcessBankData.cpp
+++ b/Framework/DataHandling/src/ProcessBankData.cpp
@@ -4,9 +4,11 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidDataHandling/ProcessBankData.h"
+#include <utility>
+
 #include "MantidDataHandling/DefaultEventLoader.h"
 #include "MantidDataHandling/LoadEventNexus.h"
+#include "MantidDataHandling/ProcessBankData.h"
 
 using namespace Mantid::DataObjects;
 
@@ -21,14 +23,16 @@ ProcessBankData::ProcessBankData(
     boost::shared_ptr<BankPulseTimes> thisBankPulseTimes, bool have_weight,
     boost::shared_array<float> event_weight, detid_t min_event_id,
     detid_t max_event_id)
-    : Task(), m_loader(m_loader), entry_name(entry_name),
+    : Task(), m_loader(m_loader), entry_name(std::move(entry_name)),
       pixelID_to_wi_vector(m_loader.pixelID_to_wi_vector),
       pixelID_to_wi_offset(m_loader.pixelID_to_wi_offset), prog(prog),
-      event_id(event_id), event_time_of_flight(event_time_of_flight),
-      numEvents(numEvents), startAt(startAt), event_index(event_index),
-      thisBankPulseTimes(thisBankPulseTimes), have_weight(have_weight),
-      event_weight(event_weight), m_min_id(min_event_id),
-      m_max_id(max_event_id) {
+      event_id(std::move(event_id)),
+      event_time_of_flight(std::move(event_time_of_flight)),
+      numEvents(numEvents), startAt(startAt),
+      event_index(std::move(event_index)),
+      thisBankPulseTimes(std::move(thisBankPulseTimes)),
+      have_weight(have_weight), event_weight(std::move(event_weight)),
+      m_min_id(min_event_id), m_max_id(max_event_id) {
   // Cost is approximately proportional to the number of events to process.
   m_cost = static_cast<double>(numEvents);
 }
diff --git a/Framework/DataHandling/src/ReadMaterial.cpp b/Framework/DataHandling/src/ReadMaterial.cpp
index cf3da641202..3a3543c8387 100644
--- a/Framework/DataHandling/src/ReadMaterial.cpp
+++ b/Framework/DataHandling/src/ReadMaterial.cpp
@@ -118,7 +118,7 @@ std::unique_ptr<Kernel::Material> ReadMaterial::buildMaterial() {
   return std::make_unique<Kernel::Material>(builder.build());
 }
 
-void ReadMaterial::setMaterial(const std::string chemicalSymbol,
+void ReadMaterial::setMaterial(const std::string &chemicalSymbol,
                                const int atomicNumber, const int massNumber) {
   if (!chemicalSymbol.empty()) {
     builder.setFormula(chemicalSymbol);
diff --git a/Framework/DataHandling/src/SampleEnvironmentSpecParser.cpp b/Framework/DataHandling/src/SampleEnvironmentSpecParser.cpp
index 332c391333c..b3a10b949a1 100644
--- a/Framework/DataHandling/src/SampleEnvironmentSpecParser.cpp
+++ b/Framework/DataHandling/src/SampleEnvironmentSpecParser.cpp
@@ -258,7 +258,7 @@ SampleEnvironmentSpecParser::parseContainer(Element *element) const {
  * @param targetVariable Value read from element attribute
  */
 void SampleEnvironmentSpecParser::LoadOptionalDoubleFromXML(
-    Poco::XML::Element *componentElement, std::string attributeName,
+    Poco::XML::Element *componentElement, const std::string &attributeName,
     double &targetVariable) const {
 
   auto attributeText = componentElement->getAttribute(attributeName);
@@ -279,7 +279,7 @@ void SampleEnvironmentSpecParser::LoadOptionalDoubleFromXML(
  * @return vector containing translations
  */
 std::vector<double> SampleEnvironmentSpecParser::parseTranslationVector(
-    std::string translationVectorStr) const {
+    const std::string &translationVectorStr) const {
 
   std::vector<double> translationVector;
 
diff --git a/Framework/DataHandling/src/SaveAscii2.cpp b/Framework/DataHandling/src/SaveAscii2.cpp
index 3462bc44c13..b4b20cc7d6e 100644
--- a/Framework/DataHandling/src/SaveAscii2.cpp
+++ b/Framework/DataHandling/src/SaveAscii2.cpp
@@ -473,7 +473,7 @@ bool SaveAscii2::findElementInUnorderedStringVector(
   return std::find(vector.cbegin(), vector.cend(), toFind) != vector.cend();
 }
 
-void SaveAscii2::writeTableWorkspace(ITableWorkspace_const_sptr tws,
+void SaveAscii2::writeTableWorkspace(const ITableWorkspace_const_sptr &tws,
                                      const std::string &filename,
                                      bool appendToFile, bool writeHeader,
                                      int prec, bool scientific,
diff --git a/Framework/DataHandling/src/SaveCSV.cpp b/Framework/DataHandling/src/SaveCSV.cpp
index f96198738c7..ffe7c857944 100644
--- a/Framework/DataHandling/src/SaveCSV.cpp
+++ b/Framework/DataHandling/src/SaveCSV.cpp
@@ -184,9 +184,10 @@ void SaveCSV::exec() {
   outCSV_File.close();
 }
 
-void SaveCSV::saveXerrors(std::ofstream &stream,
-                          const Mantid::DataObjects::Workspace2D_sptr workspace,
-                          const size_t numberOfHist) {
+void SaveCSV::saveXerrors(
+    std::ofstream &stream,
+    const Mantid::DataObjects::Workspace2D_sptr &workspace,
+    const size_t numberOfHist) {
   // If there isn't a dx values present in the first entry then return
   if (!workspace->hasDx(0)) {
     return;
diff --git a/Framework/DataHandling/src/SaveCalFile.cpp b/Framework/DataHandling/src/SaveCalFile.cpp
index 4efc4101662..ddf6721fe4b 100644
--- a/Framework/DataHandling/src/SaveCalFile.cpp
+++ b/Framework/DataHandling/src/SaveCalFile.cpp
@@ -80,9 +80,9 @@ void SaveCalFile::exec() {
  *(selected) if not specified.
  */
 void SaveCalFile::saveCalFile(const std::string &calFileName,
-                              GroupingWorkspace_sptr groupWS,
-                              OffsetsWorkspace_sptr offsetsWS,
-                              MaskWorkspace_sptr maskWS) {
+                              const GroupingWorkspace_sptr &groupWS,
+                              const OffsetsWorkspace_sptr &offsetsWS,
+                              const MaskWorkspace_sptr &maskWS) {
   Instrument_const_sptr inst;
 
   bool doGroup = false;
diff --git a/Framework/DataHandling/src/SaveDetectorsGrouping.cpp b/Framework/DataHandling/src/SaveDetectorsGrouping.cpp
index 17feffa71b4..33f3f59cda0 100644
--- a/Framework/DataHandling/src/SaveDetectorsGrouping.cpp
+++ b/Framework/DataHandling/src/SaveDetectorsGrouping.cpp
@@ -143,8 +143,8 @@ void SaveDetectorsGrouping::convertToDetectorsRanges(
 }
 
 void SaveDetectorsGrouping::printToXML(
-    std::map<int, std::vector<detid_t>> groupdetidrangemap,
-    std::string xmlfilename) {
+    const std::map<int, std::vector<detid_t>> &groupdetidrangemap,
+    const std::string &xmlfilename) {
 
   // 1. Get Instrument information
   const auto &instrument = mGroupWS->getInstrument();
diff --git a/Framework/DataHandling/src/SaveDiffCal.cpp b/Framework/DataHandling/src/SaveDiffCal.cpp
index 3e3a42fce5d..e97d3afb9b1 100644
--- a/Framework/DataHandling/src/SaveDiffCal.cpp
+++ b/Framework/DataHandling/src/SaveDiffCal.cpp
@@ -121,7 +121,7 @@ void SaveDiffCal::writeIntFieldFromTable(H5::Group &group,
 // TODO should flip for mask
 void SaveDiffCal::writeIntFieldFromSVWS(
     H5::Group &group, const std::string &name,
-    DataObjects::SpecialWorkspace2D_const_sptr ws) {
+    const DataObjects::SpecialWorkspace2D_const_sptr &ws) {
   const bool isMask = (name == "use");
 
   // output array defaults to all one (one group, use the pixel)
diff --git a/Framework/DataHandling/src/SaveDiffFittingAscii.cpp b/Framework/DataHandling/src/SaveDiffFittingAscii.cpp
index cbc35b9c213..855f18b005d 100644
--- a/Framework/DataHandling/src/SaveDiffFittingAscii.cpp
+++ b/Framework/DataHandling/src/SaveDiffFittingAscii.cpp
@@ -111,7 +111,7 @@ bool SaveDiffFittingAscii::processGroups() {
 }
 
 void SaveDiffFittingAscii::processAll(
-    const std::vector<API::ITableWorkspace_sptr> input_ws) {
+    const std::vector<API::ITableWorkspace_sptr> &input_ws) {
 
   const std::string filename = getProperty("Filename");
   const std::string outMode = getProperty("OutMode");
@@ -208,7 +208,7 @@ void SaveDiffFittingAscii::writeHeader(
   }
 }
 
-void SaveDiffFittingAscii::writeData(const API::ITableWorkspace_sptr workspace,
+void SaveDiffFittingAscii::writeData(const API::ITableWorkspace_sptr &workspace,
                                      std::ofstream &file,
                                      const size_t columnSize) {
 
diff --git a/Framework/DataHandling/src/SaveDspacemap.cpp b/Framework/DataHandling/src/SaveDspacemap.cpp
index fd45f8af640..f52b3a59d44 100644
--- a/Framework/DataHandling/src/SaveDspacemap.cpp
+++ b/Framework/DataHandling/src/SaveDspacemap.cpp
@@ -56,8 +56,8 @@ void SaveDspacemap::exec() {
  * @param offsetsWS :: OffsetsWorkspace with instrument and offsets
  */
 void SaveDspacemap::CalculateDspaceFromCal(
-    Mantid::DataObjects::OffsetsWorkspace_sptr offsetsWS,
-    std::string DFileName) {
+    const Mantid::DataObjects::OffsetsWorkspace_sptr &offsetsWS,
+    const std::string &DFileName) {
   const char *filename = DFileName.c_str();
   // Get a pointer to the instrument contained in the workspace
   Instrument_const_sptr instrument = offsetsWS->getInstrument();
diff --git a/Framework/DataHandling/src/SaveFITS.cpp b/Framework/DataHandling/src/SaveFITS.cpp
index df21ad55193..a1ed7eb99a1 100644
--- a/Framework/DataHandling/src/SaveFITS.cpp
+++ b/Framework/DataHandling/src/SaveFITS.cpp
@@ -143,7 +143,7 @@ void SaveFITS::exec() {
  * @param img matrix workspace (one spectrum per row)
  * @param filename relative or full path, should be already checked
  */
-void SaveFITS::saveFITSImage(const API::MatrixWorkspace_sptr img,
+void SaveFITS::saveFITSImage(const API::MatrixWorkspace_sptr &img,
                              const std::string &filename) {
   std::ofstream outfile(filename, std::ofstream::binary);
 
@@ -151,7 +151,7 @@ void SaveFITS::saveFITSImage(const API::MatrixWorkspace_sptr img,
   writeFITSImageMatrix(img, outfile);
 }
 
-void SaveFITS::writeFITSHeaderBlock(const API::MatrixWorkspace_sptr img,
+void SaveFITS::writeFITSHeaderBlock(const API::MatrixWorkspace_sptr &img,
                                     std::ofstream &file) {
   // minimal sequence of standard headers
   writeFITSHeaderEntry(g_FITSHdrFirst, file);
@@ -169,7 +169,7 @@ void SaveFITS::writeFITSHeaderBlock(const API::MatrixWorkspace_sptr img,
   writePaddingFITSHeaders(entriesPerHDU - 9, file);
 }
 
-void SaveFITS::writeFITSImageMatrix(const API::MatrixWorkspace_sptr img,
+void SaveFITS::writeFITSImageMatrix(const API::MatrixWorkspace_sptr &img,
                                     std::ofstream &file) {
   const size_t sizeX = img->blocksize();
   const size_t sizeY = img->getNumberHistograms();
@@ -213,7 +213,7 @@ void SaveFITS::writeFITSHeaderEntry(const std::string &hdr,
   file.write(blanks.data(), g_maxLenHdr - count);
 }
 
-void SaveFITS::writeFITSHeaderAxesSizes(const API::MatrixWorkspace_sptr img,
+void SaveFITS::writeFITSHeaderAxesSizes(const API::MatrixWorkspace_sptr &img,
                                         std::ofstream &file) {
   const std::string sizeX = std::to_string(img->blocksize());
   const std::string sizeY = std::to_string(img->getNumberHistograms());
diff --git a/Framework/DataHandling/src/SaveFullprofResolution.cpp b/Framework/DataHandling/src/SaveFullprofResolution.cpp
index 0b71d7030b7..b0fe14c72c8 100644
--- a/Framework/DataHandling/src/SaveFullprofResolution.cpp
+++ b/Framework/DataHandling/src/SaveFullprofResolution.cpp
@@ -480,7 +480,7 @@ std::string SaveFullprofResolution::toProf9IrfString() {
 /** Check wether a profile parameter map has the parameter
  */
 bool SaveFullprofResolution::has_key(std::map<std::string, double> profmap,
-                                     std::string key) {
+                                     const std::string &key) {
   map<string, double>::iterator fiter;
   fiter = profmap.find(key);
   bool exist = true;
diff --git a/Framework/DataHandling/src/SaveGSASInstrumentFile.cpp b/Framework/DataHandling/src/SaveGSASInstrumentFile.cpp
index 9167a981b42..7e69abfc123 100644
--- a/Framework/DataHandling/src/SaveGSASInstrumentFile.cpp
+++ b/Framework/DataHandling/src/SaveGSASInstrumentFile.cpp
@@ -505,7 +505,7 @@ void SaveGSASInstrumentFile::initConstants(
 /** Parse profile table workspace to a map (the new ...
  */
 void SaveGSASInstrumentFile::parseProfileTableWorkspace(
-    ITableWorkspace_sptr ws,
+    const ITableWorkspace_sptr &ws,
     map<unsigned int, map<string, double>> &profilemap) {
   size_t numbanks = ws->columnCount() - 1;
   size_t numparams = ws->rowCount();
@@ -1086,7 +1086,7 @@ double SaveGSASInstrumentFile::calDspRange(double dtt1, double zero,
  * @param irffilename
  */
 void SaveGSASInstrumentFile::loadFullprofResolutionFile(
-    std::string irffilename) {
+    const std::string &irffilename) {
   IAlgorithm_sptr loadfpirf;
   try {
     loadfpirf = createChildAlgorithm("LoadFullprofResolution");
diff --git a/Framework/DataHandling/src/SaveIsawDetCal.cpp b/Framework/DataHandling/src/SaveIsawDetCal.cpp
index f2bfbc93b7a..87374bdf19a 100644
--- a/Framework/DataHandling/src/SaveIsawDetCal.cpp
+++ b/Framework/DataHandling/src/SaveIsawDetCal.cpp
@@ -227,7 +227,8 @@ void SaveIsawDetCal::exec() {
   out.close();
 }
 
-V3D SaveIsawDetCal::findPixelPos(std::string bankName, int col, int row) {
+V3D SaveIsawDetCal::findPixelPos(const std::string &bankName, int col,
+                                 int row) {
   boost::shared_ptr<const IComponent> parent =
       inst->getComponentByName(bankName);
   if (parent->type() == "RectangularDetector") {
@@ -261,8 +262,8 @@ V3D SaveIsawDetCal::findPixelPos(std::string bankName, int col, int row) {
   }
 }
 
-void SaveIsawDetCal::sizeBanks(std::string bankName, int &NCOLS, int &NROWS,
-                               double &xsize, double &ysize) {
+void SaveIsawDetCal::sizeBanks(const std::string &bankName, int &NCOLS,
+                               int &NROWS, double &xsize, double &ysize) {
   if (bankName == "None")
     return;
   boost::shared_ptr<const IComponent> parent =
diff --git a/Framework/DataHandling/src/SaveNXTomo.cpp b/Framework/DataHandling/src/SaveNXTomo.cpp
index 0a5d24977c6..435d1e504a3 100644
--- a/Framework/DataHandling/src/SaveNXTomo.cpp
+++ b/Framework/DataHandling/src/SaveNXTomo.cpp
@@ -304,7 +304,7 @@ void SaveNXTomo::processAll() {
  * @param workspace the workspace to get data from
  * @param nxFile the nexus file to save data into
  */
-void SaveNXTomo::writeSingleWorkspace(const Workspace2D_sptr workspace,
+void SaveNXTomo::writeSingleWorkspace(const Workspace2D_sptr &workspace,
                                       ::NeXus::File &nxFile) {
   try {
     nxFile.openPath("/entry1/tomo_entry/data");
@@ -372,7 +372,7 @@ void SaveNXTomo::writeSingleWorkspace(const Workspace2D_sptr workspace,
 }
 
 void SaveNXTomo::writeImageKeyValue(
-    const DataObjects::Workspace2D_sptr workspace, ::NeXus::File &nxFile,
+    const DataObjects::Workspace2D_sptr &workspace, ::NeXus::File &nxFile,
     int thisFileInd) {
   // Add ImageKey to instrument/image_key if present, use 0 if not
   try {
@@ -401,7 +401,7 @@ void SaveNXTomo::writeImageKeyValue(
   nxFile.closeGroup();
 }
 
-void SaveNXTomo::writeLogValues(const DataObjects::Workspace2D_sptr workspace,
+void SaveNXTomo::writeLogValues(const DataObjects::Workspace2D_sptr &workspace,
                                 ::NeXus::File &nxFile, int thisFileInd) {
   // Add Log information (minus special values - Rotation, ImageKey, Intensity)
   // Unable to add multidimensional string data, storing strings as
@@ -446,7 +446,7 @@ void SaveNXTomo::writeLogValues(const DataObjects::Workspace2D_sptr workspace,
 }
 
 void SaveNXTomo::writeIntensityValue(
-    const DataObjects::Workspace2D_sptr workspace, ::NeXus::File &nxFile,
+    const DataObjects::Workspace2D_sptr &workspace, ::NeXus::File &nxFile,
     int thisFileInd) {
   // Add Intensity to control if present, use 1 if not
   try {
diff --git a/Framework/DataHandling/src/SaveNXcanSAS.cpp b/Framework/DataHandling/src/SaveNXcanSAS.cpp
index 094314b590c..1fdff8ad829 100644
--- a/Framework/DataHandling/src/SaveNXcanSAS.cpp
+++ b/Framework/DataHandling/src/SaveNXcanSAS.cpp
@@ -34,6 +34,7 @@
 #include <cctype>
 #include <functional>
 #include <iterator>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::Geometry;
@@ -56,9 +57,9 @@ void removeSpecialCharacters(std::string &input) {
   input = boost::regex_replace(input, toReplace, replaceWith);
 }
 
-std::string
-makeCompliantName(const std::string &input, bool isStrict,
-                  std::function<void(std::string &)> captializeStrategy) {
+std::string makeCompliantName(
+    const std::string &input, bool isStrict,
+    const std::function<void(std::string &)> &captializeStrategy) {
   auto output = input;
   // Check if input is compliant
   if (!isCanSASCompliant(isStrict, output)) {
@@ -173,7 +174,7 @@ std::vector<std::string> splitDetectorNames(std::string detectorNames) {
  * @return the sasEntry
  */
 H5::Group addSasEntry(H5::H5File &file,
-                      Mantid::API::MatrixWorkspace_sptr workspace,
+                      const Mantid::API::MatrixWorkspace_sptr &workspace,
                       const std::string &suffix) {
   using namespace Mantid::DataHandling::NXcanSAS;
   const std::string sasEntryName = sasEntryGroupName + suffix;
@@ -201,18 +202,20 @@ H5::Group addSasEntry(H5::H5File &file,
 }
 
 //------- SASinstrument
-std::string getInstrumentName(Mantid::API::MatrixWorkspace_sptr workspace) {
+std::string
+getInstrumentName(const Mantid::API::MatrixWorkspace_sptr &workspace) {
   auto instrument = workspace->getInstrument();
   return instrument->getFullName();
 }
 
-std::string getIDF(Mantid::API::MatrixWorkspace_sptr workspace) {
+std::string getIDF(const Mantid::API::MatrixWorkspace_sptr &workspace) {
   auto date = workspace->getWorkspaceStartDate();
   auto instrumentName = getInstrumentName(workspace);
   return workspace->getInstrumentFilename(instrumentName, date);
 }
 
-void addDetectors(H5::Group &group, Mantid::API::MatrixWorkspace_sptr workspace,
+void addDetectors(H5::Group &group,
+                  const Mantid::API::MatrixWorkspace_sptr &workspace,
                   const std::vector<std::string> &detectorNames) {
   // If the group is empty then don't add anything
   if (!detectorNames.empty()) {
@@ -256,7 +259,7 @@ void addDetectors(H5::Group &group, Mantid::API::MatrixWorkspace_sptr workspace,
  * @param detectorNames: the names of the detectors to store
  */
 void addInstrument(H5::Group &group,
-                   Mantid::API::MatrixWorkspace_sptr workspace,
+                   const Mantid::API::MatrixWorkspace_sptr &workspace,
                    const std::string &radiationSource,
                    const std::vector<std::string> &detectorNames) {
   // Setup instrument
@@ -301,7 +304,8 @@ std::string getDate() {
  * @param group: the sasEntry
  * @param workspace: the workspace which is being stored
  */
-void addProcess(H5::Group &group, Mantid::API::MatrixWorkspace_sptr workspace) {
+void addProcess(H5::Group &group,
+                const Mantid::API::MatrixWorkspace_sptr &workspace) {
   // Setup process
   const std::string sasProcessNameForGroup = sasProcessGroupName;
   auto process = Mantid::DataHandling::H5Util::createGroupCanSAS(
@@ -334,8 +338,9 @@ void addProcess(H5::Group &group, Mantid::API::MatrixWorkspace_sptr workspace) {
  * @param group: the sasEntry
  * @param workspace: the workspace which is being stored
  */
-void addProcess(H5::Group &group, Mantid::API::MatrixWorkspace_sptr workspace,
-                Mantid::API::MatrixWorkspace_sptr canWorkspace) {
+void addProcess(H5::Group &group,
+                const Mantid::API::MatrixWorkspace_sptr &workspace,
+                const Mantid::API::MatrixWorkspace_sptr &canWorkspace) {
   // Setup process
   const std::string sasProcessNameForGroup = sasProcessGroupName;
   auto process = Mantid::DataHandling::H5Util::createGroupCanSAS(
@@ -401,7 +406,7 @@ void addNoteToProcess(H5::Group &group, const std::string &firstEntryName,
 }
 
 WorkspaceDimensionality
-getWorkspaceDimensionality(Mantid::API::MatrixWorkspace_sptr workspace) {
+getWorkspaceDimensionality(const Mantid::API::MatrixWorkspace_sptr &workspace) {
   auto numberOfHistograms = workspace->getNumberHistograms();
   WorkspaceDimensionality dimensionality(WorkspaceDimensionality::other);
   if (numberOfHistograms == 1) {
@@ -422,7 +427,8 @@ std::string getIntensityUnitLabel(std::string intensityUnitLabel) {
   }
 }
 
-std::string getIntensityUnit(Mantid::API::MatrixWorkspace_sptr workspace) {
+std::string
+getIntensityUnit(const Mantid::API::MatrixWorkspace_sptr &workspace) {
   auto iUnit = workspace->YUnit();
   if (iUnit.empty()) {
     iUnit = workspace->YUnitLabel();
@@ -438,13 +444,14 @@ std::string getMomentumTransferLabel(std::string momentumTransferLabel) {
   }
 }
 
-std::string
-getUnitFromMDDimension(Mantid::Geometry::IMDDimension_const_sptr dimension) {
+std::string getUnitFromMDDimension(
+    const Mantid::Geometry::IMDDimension_const_sptr &dimension) {
   const auto unitLabel = dimension->getMDUnits().getUnitLabel();
   return unitLabel.ascii();
 }
 
-void addData1D(H5::Group &data, Mantid::API::MatrixWorkspace_sptr workspace) {
+void addData1D(H5::Group &data,
+               const Mantid::API::MatrixWorkspace_sptr &workspace) {
   // Add attributes for @signal, @I_axes, @Q_indices,
   Mantid::DataHandling::H5Util::writeStrAttribute(data, sasSignal, sasDataI);
   Mantid::DataHandling::H5Util::writeStrAttribute(data, sasDataIAxesAttr,
@@ -512,7 +519,7 @@ void addData1D(H5::Group &data, Mantid::API::MatrixWorkspace_sptr workspace) {
   }
 }
 
-bool areAxesNumeric(Mantid::API::MatrixWorkspace_sptr workspace) {
+bool areAxesNumeric(const Mantid::API::MatrixWorkspace_sptr &workspace) {
   const unsigned indices[] = {0, 1};
   for (const auto index : indices) {
     auto axis = workspace->getAxis(index);
@@ -527,12 +534,12 @@ class SpectrumAxisValueProvider {
 public:
   explicit SpectrumAxisValueProvider(
       Mantid::API::MatrixWorkspace_sptr workspace)
-      : m_workspace(workspace) {
+      : m_workspace(std::move(workspace)) {
     setSpectrumAxisValues();
   }
 
   Mantid::MantidVec::value_type *
-  operator()(Mantid::API::MatrixWorkspace_sptr /*unused*/, int index) {
+  operator()(const Mantid::API::MatrixWorkspace_sptr & /*unused*/, int index) {
     auto isPointData =
         m_workspace->getNumberHistograms() == m_spectrumAxisValues.size();
     double value = 0;
@@ -566,7 +573,7 @@ private:
  */
 template <typename T> class QxExtractor {
 public:
-  T *operator()(Mantid::API::MatrixWorkspace_sptr ws, int index) {
+  T *operator()(const Mantid::API::MatrixWorkspace_sptr &ws, int index) {
     if (ws->isHistogramData()) {
       qxPointData.clear();
       Mantid::Kernel::VectorHelper::convertToBinCentre(ws->dataX(index),
@@ -620,7 +627,8 @@ public:
  *  .
  * QxN QxN ... QxN
  */
-void addData2D(H5::Group &data, Mantid::API::MatrixWorkspace_sptr workspace) {
+void addData2D(H5::Group &data,
+               const Mantid::API::MatrixWorkspace_sptr &workspace) {
   if (!areAxesNumeric(workspace)) {
     std::invalid_argument("SaveNXcanSAS: The provided 2D workspace needs "
                           "to have 2 numeric axes.");
@@ -664,7 +672,7 @@ void addData2D(H5::Group &data, Mantid::API::MatrixWorkspace_sptr workspace) {
   iAttributes.emplace(sasUncertaintyAttr, sasDataIdev);
   iAttributes.emplace(sasUncertaintiesAttr, sasDataIdev);
 
-  auto iExtractor = [](Mantid::API::MatrixWorkspace_sptr ws, int index) {
+  auto iExtractor = [](const Mantid::API::MatrixWorkspace_sptr &ws, int index) {
     return ws->dataY(index).data();
   };
   write2DWorkspace(data, workspace, sasDataI, iExtractor, iAttributes);
@@ -674,13 +682,13 @@ void addData2D(H5::Group &data, Mantid::API::MatrixWorkspace_sptr workspace) {
   eAttributes.insert(
       std::make_pair(sasUnitAttr, iUnit)); // same units as intensity
 
-  auto iDevExtractor = [](Mantid::API::MatrixWorkspace_sptr ws, int index) {
-    return ws->dataE(index).data();
-  };
+  auto iDevExtractor = [](const Mantid::API::MatrixWorkspace_sptr &ws,
+                          int index) { return ws->dataE(index).data(); };
   write2DWorkspace(data, workspace, sasDataIdev, iDevExtractor, eAttributes);
 }
 
-void addData(H5::Group &group, Mantid::API::MatrixWorkspace_sptr workspace) {
+void addData(H5::Group &group,
+             const Mantid::API::MatrixWorkspace_sptr &workspace) {
   const std::string sasDataName = sasDataGroupName;
   auto data = Mantid::DataHandling::H5Util::createGroupCanSAS(
       group, sasDataName, nxDataClassAttr, sasDataClassAttr);
@@ -701,8 +709,8 @@ void addData(H5::Group &group, Mantid::API::MatrixWorkspace_sptr workspace) {
 
 //------- SAStransmission_spectrum
 void addTransmission(H5::Group &group,
-                     Mantid::API::MatrixWorkspace_const_sptr workspace,
-                     std::string transmissionName) {
+                     const Mantid::API::MatrixWorkspace_const_sptr &workspace,
+                     const std::string &transmissionName) {
   // Setup process
   const std::string sasTransmissionName =
       sasTransmissionSpectrumGroupName + "_" + transmissionName;
@@ -856,8 +864,9 @@ std::map<std::string, std::string> SaveNXcanSAS::validateInputs() {
   Mantid::API::MatrixWorkspace_sptr transmissionCan =
       getProperty("TransmissionCan");
 
-  auto checkTransmission = [&result](Mantid::API::MatrixWorkspace_sptr trans,
-                                     std::string propertyName) {
+  auto checkTransmission = [&result](
+                               const Mantid::API::MatrixWorkspace_sptr &trans,
+                               const std::string &propertyName) {
     if (trans->getNumberHistograms() != 1) {
       result.emplace(propertyName,
                      "The input workspaces for transmissions have to be 1D.");
diff --git a/Framework/DataHandling/src/SaveNexusProcessed.cpp b/Framework/DataHandling/src/SaveNexusProcessed.cpp
index 4e51d730bfa..d3f73902802 100644
--- a/Framework/DataHandling/src/SaveNexusProcessed.cpp
+++ b/Framework/DataHandling/src/SaveNexusProcessed.cpp
@@ -21,6 +21,7 @@
 #include "MantidKernel/BoundedValidator.h"
 #include "MantidNexus/NexusFileIO.h"
 #include <boost/shared_ptr.hpp>
+#include <utility>
 
 using namespace Mantid::API;
 
@@ -168,7 +169,8 @@ void SaveNexusProcessed::init() {
  * @param matrixWorkspace :: pointer to a MatrixWorkspace
  */
 void SaveNexusProcessed::getWSIndexList(
-    std::vector<int> &indices, MatrixWorkspace_const_sptr matrixWorkspace) {
+    std::vector<int> &indices,
+    const MatrixWorkspace_const_sptr &matrixWorkspace) {
   const std::vector<int> spec_list = getProperty("WorkspaceIndexList");
   int spec_min = getProperty("WorkspaceIndexMin");
   int spec_max = getProperty("WorkspaceIndexMax");
@@ -217,7 +219,7 @@ void SaveNexusProcessed::getWSIndexList(
 }
 
 void SaveNexusProcessed::doExec(
-    Workspace_sptr inputWorkspace,
+    const Workspace_sptr &inputWorkspace,
     boost::shared_ptr<Mantid::NeXus::NexusFileIO> &nexusFile,
     const bool keepFile, optional_size_t entryNumber) {
   // TODO: Remove?
@@ -291,7 +293,8 @@ void SaveNexusProcessed::doExec(
   const bool append_to_file = getProperty("Append");
 
   nexusFile->resetProgress(&prog_init);
-  nexusFile->openNexusWrite(filename, entryNumber, append_to_file || keepFile);
+  nexusFile->openNexusWrite(filename, std::move(entryNumber),
+                            append_to_file || keepFile);
 
   // Equivalent C++ API handle
   ::NeXus::File cppFile(nexusFile->fileID);
diff --git a/Framework/DataHandling/src/SavePDFGui.cpp b/Framework/DataHandling/src/SavePDFGui.cpp
index bf84bd4dab1..019c3242ffa 100644
--- a/Framework/DataHandling/src/SavePDFGui.cpp
+++ b/Framework/DataHandling/src/SavePDFGui.cpp
@@ -92,7 +92,7 @@ void SavePDFGui::exec() {
 }
 
 void SavePDFGui::writeMetaData(std::ofstream &out,
-                               API::MatrixWorkspace_const_sptr inputWS) {
+                               const API::MatrixWorkspace_const_sptr &inputWS) {
   out << "#Comment: neutron";
   auto run = inputWS->run();
   if (run.hasProperty("Qmin")) {
@@ -120,7 +120,7 @@ void SavePDFGui::writeMetaData(std::ofstream &out,
 }
 
 void SavePDFGui::writeWSData(std::ofstream &out,
-                             API::MatrixWorkspace_const_sptr inputWS) {
+                             const API::MatrixWorkspace_const_sptr &inputWS) {
   const auto &x = inputWS->points(0);
   const auto &y = inputWS->y(0);
   const auto &dy = inputWS->e(0);
diff --git a/Framework/DataHandling/src/SaveRMCProfile.cpp b/Framework/DataHandling/src/SaveRMCProfile.cpp
index 70ca4d7f5e7..5d545763d6e 100644
--- a/Framework/DataHandling/src/SaveRMCProfile.cpp
+++ b/Framework/DataHandling/src/SaveRMCProfile.cpp
@@ -96,8 +96,8 @@ void SaveRMCProfile::exec() {
   out.close();
 }
 
-void SaveRMCProfile::writeMetaData(std::ofstream &out,
-                                   API::MatrixWorkspace_const_sptr inputWS) {
+void SaveRMCProfile::writeMetaData(
+    std::ofstream &out, const API::MatrixWorkspace_const_sptr &inputWS) {
   const auto &y = inputWS->y(0);
   const std::string title = getProperty("Title");
   const std::string inputType = getProperty("InputType");
@@ -107,8 +107,8 @@ void SaveRMCProfile::writeMetaData(std::ofstream &out,
   std::cout << "rmc " << inputType << " #  " << title << std::endl;
 }
 
-void SaveRMCProfile::writeWSData(std::ofstream &out,
-                                 API::MatrixWorkspace_const_sptr inputWS) {
+void SaveRMCProfile::writeWSData(
+    std::ofstream &out, const API::MatrixWorkspace_const_sptr &inputWS) {
   const auto &x = inputWS->points(0);
   const auto &y = inputWS->y(0);
   for (size_t i = 0; i < x.size(); ++i) {
diff --git a/Framework/DataHandling/src/SaveReflectometryAscii.cpp b/Framework/DataHandling/src/SaveReflectometryAscii.cpp
index 46d5f045216..c87a19371d4 100644
--- a/Framework/DataHandling/src/SaveReflectometryAscii.cpp
+++ b/Framework/DataHandling/src/SaveReflectometryAscii.cpp
@@ -141,7 +141,7 @@ void SaveReflectometryAscii::separator() {
  * @param write :: if true, write string
  * @param s :: string
  */
-bool SaveReflectometryAscii::writeString(bool write, std::string s) {
+bool SaveReflectometryAscii::writeString(bool write, const std::string &s) {
   if (write) {
     if (m_ext == "custom" || m_ext == ".txt")
       m_file << m_sep << s;
@@ -172,7 +172,7 @@ void SaveReflectometryAscii::outputval(double val) {
 /** Write formatted line of data
  *  @param val :: a string value to be written
  */
-void SaveReflectometryAscii::outputval(std::string val) {
+void SaveReflectometryAscii::outputval(const std::string &val) {
   m_file << std::setw(28) << val;
 }
 
@@ -201,8 +201,8 @@ std::string SaveReflectometryAscii::sampleLogUnit(const std::string &logName) {
  *  @param logName :: the name of a SampleLog entry to get its value from
  *  @param logNameFixed :: the name of the SampleLog entry defined by the header
  */
-void SaveReflectometryAscii::writeInfo(const std::string logName,
-                                       const std::string logNameFixed) {
+void SaveReflectometryAscii::writeInfo(const std::string &logName,
+                                       const std::string &logNameFixed) {
   const std::string logValue = sampleLogValue(logName);
   const std::string logUnit = sampleLogUnit(logName);
   if (!logNameFixed.empty()) {
@@ -255,7 +255,7 @@ void SaveReflectometryAscii::header() {
 }
 
 /// Check file
-void SaveReflectometryAscii::checkFile(const std::string filename) {
+void SaveReflectometryAscii::checkFile(const std::string &filename) {
   if (Poco::File(filename).exists()) {
     g_log.warning("File already exists and will be overwritten");
     try {
diff --git a/Framework/DataHandling/src/SaveSPE.cpp b/Framework/DataHandling/src/SaveSPE.cpp
index f0641f9f0c6..9c18c1f701d 100644
--- a/Framework/DataHandling/src/SaveSPE.cpp
+++ b/Framework/DataHandling/src/SaveSPE.cpp
@@ -210,7 +210,7 @@ void SaveSPE::writeSPEFile(FILE *outSPEFile,
  *  @param WS :: the workspace to be saved
  *  @param outFile :: the file object to write to
  */
-void SaveSPE::writeHists(const API::MatrixWorkspace_const_sptr WS,
+void SaveSPE::writeHists(const API::MatrixWorkspace_const_sptr &WS,
                          FILE *const outFile) {
   // We write out values NUM_PER_LINE at a time, so will need to do extra work
   // if nBins isn't a factor of NUM_PER_LINE
@@ -286,7 +286,7 @@ void SaveSPE::check_and_copy_spectra(const HistogramData::HistogramY &inSignal,
  *  @param outFile :: the file object to write to
  *  @param wsIn :: the index number of the histogram to write
  */
-void SaveSPE::writeHist(const API::MatrixWorkspace_const_sptr WS,
+void SaveSPE::writeHist(const API::MatrixWorkspace_const_sptr &WS,
                         FILE *const outFile, const int wsIn) const {
   check_and_copy_spectra(WS->y(wsIn), WS->e(wsIn), m_tSignal, m_tError);
   FPRINTF_WITH_EXCEPTION(outFile, "%s", Y_HEADER);
diff --git a/Framework/DataHandling/src/SaveTBL.cpp b/Framework/DataHandling/src/SaveTBL.cpp
index 4eff4fdf561..bc27ecab0d1 100644
--- a/Framework/DataHandling/src/SaveTBL.cpp
+++ b/Framework/DataHandling/src/SaveTBL.cpp
@@ -44,7 +44,7 @@ void SaveTBL::init() {
  * Finds the stitch groups that need to be on the same line
  * @param ws : a pointer to a tableworkspace
  */
-void SaveTBL::findGroups(ITableWorkspace_sptr ws) {
+void SaveTBL::findGroups(const ITableWorkspace_sptr &ws) {
   size_t rowCount = ws->rowCount();
   for (size_t i = 0; i < rowCount; ++i) {
     TableRow row = ws->getRow(i);
diff --git a/Framework/DataHandling/src/SaveToSNSHistogramNexus.cpp b/Framework/DataHandling/src/SaveToSNSHistogramNexus.cpp
index 40200da9b2c..1543210a0ef 100644
--- a/Framework/DataHandling/src/SaveToSNSHistogramNexus.cpp
+++ b/Framework/DataHandling/src/SaveToSNSHistogramNexus.cpp
@@ -187,9 +187,9 @@ int SaveToSNSHistogramNexus::copy_file(const char *inFile, int nx__access,
  * @return error code
  */
 int SaveToSNSHistogramNexus::WriteOutDataOrErrors(
-    Geometry::RectangularDetector_const_sptr det, int x_pixel_slab,
+    const Geometry::RectangularDetector_const_sptr &det, int x_pixel_slab,
     const char *field_name, const char *errors_field_name, bool doErrors,
-    bool doBoth, int is_definition, std::string bank) {
+    bool doBoth, int is_definition, const std::string &bank) {
   int dataRank, dataDimensions[NX_MAXRANK];
   int slabDimensions[NX_MAXRANK], slabStartIndices[NX_MAXRANK];
 
@@ -412,7 +412,7 @@ int SaveToSNSHistogramNexus::WriteOutDataOrErrors(
  * @param is_definition
  * @return error code
  */
-int SaveToSNSHistogramNexus::WriteDataGroup(std::string bank,
+int SaveToSNSHistogramNexus::WriteDataGroup(const std::string &bank,
                                             int is_definition) {
   int dataType, dataRank, dataDimensions[NX_MAXRANK];
   NXname name;
diff --git a/Framework/DataHandling/src/SetScalingPSD.cpp b/Framework/DataHandling/src/SetScalingPSD.cpp
index af5f8c78c62..c0c85e120cb 100644
--- a/Framework/DataHandling/src/SetScalingPSD.cpp
+++ b/Framework/DataHandling/src/SetScalingPSD.cpp
@@ -293,7 +293,7 @@ void SetScalingPSD::movePos(API::MatrixWorkspace_sptr &WS,
  * @param detID :: Vector of detector numbers
  * @param pos :: V3D of detector positions corresponding to detID
  */
-void SetScalingPSD::getDetPositionsFromRaw(std::string rawfile,
+void SetScalingPSD::getDetPositionsFromRaw(const std::string &rawfile,
                                            std::vector<int> &detID,
                                            std::vector<Kernel::V3D> &pos) {
   (void)rawfile; // Avoid compiler warning
diff --git a/Framework/DataHandling/src/StartAndEndTimeFromNexusFileExtractor.cpp b/Framework/DataHandling/src/StartAndEndTimeFromNexusFileExtractor.cpp
index a3a7281afcd..02254b4f3e8 100644
--- a/Framework/DataHandling/src/StartAndEndTimeFromNexusFileExtractor.cpp
+++ b/Framework/DataHandling/src/StartAndEndTimeFromNexusFileExtractor.cpp
@@ -24,8 +24,8 @@ namespace DataHandling {
 enum class NexusType { Muon, Processed, ISIS, TofRaw };
 enum class TimeType : unsigned char { StartTime, EndTime };
 
-Mantid::Types::Core::DateAndTime handleMuonNexusFile(TimeType type,
-                                                     std::string filename) {
+Mantid::Types::Core::DateAndTime
+handleMuonNexusFile(TimeType type, const std::string &filename) {
   Mantid::NeXus::NXRoot root(filename);
   if (type == TimeType::StartTime) {
     return Mantid::Types::Core::DateAndTime(root.getString("run/start_time"));
@@ -35,7 +35,7 @@ Mantid::Types::Core::DateAndTime handleMuonNexusFile(TimeType type,
 }
 
 Mantid::Types::Core::DateAndTime
-handleProcessedNexusFile(TimeType type, std::string filename) {
+handleProcessedNexusFile(TimeType type, const std::string &filename) {
   Mantid::NeXus::NXRoot root(filename);
   if (type == TimeType::StartTime) {
     return Mantid::Types::Core::DateAndTime(
@@ -46,8 +46,8 @@ handleProcessedNexusFile(TimeType type, std::string filename) {
   }
 }
 
-Mantid::Types::Core::DateAndTime handleISISNexusFile(TimeType type,
-                                                     std::string filename) {
+Mantid::Types::Core::DateAndTime
+handleISISNexusFile(TimeType type, const std::string &filename) {
   Mantid::NeXus::NXRoot root(filename);
   if (type == TimeType::StartTime) {
     return Mantid::Types::Core::DateAndTime(
@@ -58,8 +58,8 @@ Mantid::Types::Core::DateAndTime handleISISNexusFile(TimeType type,
   }
 }
 
-Mantid::Types::Core::DateAndTime handleTofRawNexusFile(TimeType type,
-                                                       std::string filename) {
+Mantid::Types::Core::DateAndTime
+handleTofRawNexusFile(TimeType type, const std::string &filename) {
   Mantid::NeXus::NXRoot root(filename);
   if (type == TimeType::StartTime) {
     return Mantid::Types::Core::DateAndTime(root.getString("entry/start_time"));
@@ -68,7 +68,7 @@ Mantid::Types::Core::DateAndTime handleTofRawNexusFile(TimeType type,
   }
 }
 
-NexusType whichNexusType(std::string filename) {
+NexusType whichNexusType(const std::string &filename) {
   std::vector<std::string> entryName;
   std::vector<std::string> definition;
   auto count =
@@ -112,8 +112,8 @@ NexusType whichNexusType(std::string filename) {
   return nexusType;
 }
 
-Mantid::Types::Core::DateAndTime extractDateAndTime(TimeType type,
-                                                    std::string filename) {
+Mantid::Types::Core::DateAndTime
+extractDateAndTime(TimeType type, const std::string &filename) {
   auto fullFileName = Mantid::API::FileFinder::Instance().getFullPath(filename);
   // Figure out the type of the Nexus file. We need to handle them individually
   // since they store the datetime differently
diff --git a/Framework/DataHandling/src/XmlHandler.cpp b/Framework/DataHandling/src/XmlHandler.cpp
index 43346b9174d..4c4c2ae194e 100644
--- a/Framework/DataHandling/src/XmlHandler.cpp
+++ b/Framework/DataHandling/src/XmlHandler.cpp
@@ -23,7 +23,7 @@
 namespace Mantid {
 namespace DataHandling {
 
-XmlHandler::XmlHandler(std::string filename) {
+XmlHandler::XmlHandler(const std::string &filename) {
   std::ifstream in(filename);
   Poco::XML::InputSource src(in);
   Poco::XML::DOMParser parser;
diff --git a/Framework/DataHandling/test/CheckMantidVersionTest.h b/Framework/DataHandling/test/CheckMantidVersionTest.h
index fe257da737d..a7478201a77 100644
--- a/Framework/DataHandling/test/CheckMantidVersionTest.h
+++ b/Framework/DataHandling/test/CheckMantidVersionTest.h
@@ -8,6 +8,8 @@
 
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "MantidDataHandling/CheckMantidVersion.h"
 
 using Mantid::DataHandling::CheckMantidVersion;
@@ -21,8 +23,8 @@ class MockedCheckMantidVersion : public CheckMantidVersion {
 public:
   MockedCheckMantidVersion(std::string currentVersion,
                            std::string gitHubVersion)
-      : CheckMantidVersion(), CurrentVersion(currentVersion),
-        GitHubVersion(gitHubVersion) {}
+      : CheckMantidVersion(), CurrentVersion(std::move(currentVersion)),
+        GitHubVersion(std::move(gitHubVersion)) {}
 
   std::string CurrentVersion;
   std::string GitHubVersion;
diff --git a/Framework/DataHandling/test/CompressEventsTest.h b/Framework/DataHandling/test/CompressEventsTest.h
index 8132d6f914e..4d5ce1d84e7 100644
--- a/Framework/DataHandling/test/CompressEventsTest.h
+++ b/Framework/DataHandling/test/CompressEventsTest.h
@@ -37,8 +37,9 @@ public:
     TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("Tolerance", "0.0"));
   }
 
-  void doTest(std::string inputName, std::string outputName, double tolerance,
-              int numPixels = 50, double wallClockTolerance = 0.) {
+  void doTest(const std::string &inputName, const std::string &outputName,
+              double tolerance, int numPixels = 50,
+              double wallClockTolerance = 0.) {
     EventWorkspace_sptr input, output;
     EventType eventType = WEIGHTED_NOTIME;
     if (wallClockTolerance > 0.)
diff --git a/Framework/DataHandling/test/CreateSampleShapeTest.h b/Framework/DataHandling/test/CreateSampleShapeTest.h
index 0c3b29677ca..96d71c38a39 100644
--- a/Framework/DataHandling/test/CreateSampleShapeTest.h
+++ b/Framework/DataHandling/test/CreateSampleShapeTest.h
@@ -83,8 +83,8 @@ public:
     TS_ASSERT_DELTA(2.6989, material.numberDensity(), 1e-04);
   }
 
-  void runStandardTest(std::string xmlShape, double x, double y, double z,
-                       bool inside) {
+  void runStandardTest(const std::string &xmlShape, double x, double y,
+                       double z, bool inside) {
     // Need a test workspace
     Mantid::API::AnalysisDataService::Instance().add(
         "TestWorkspace",
diff --git a/Framework/DataHandling/test/CreateSimulationWorkspaceTest.h b/Framework/DataHandling/test/CreateSimulationWorkspaceTest.h
index 6ed9df97dd6..35f68d49ddc 100644
--- a/Framework/DataHandling/test/CreateSimulationWorkspaceTest.h
+++ b/Framework/DataHandling/test/CreateSimulationWorkspaceTest.h
@@ -178,7 +178,7 @@ private:
         .retrieveWS<MatrixWorkspace>(m_wsName);
   }
 
-  void doBinCheck(Mantid::API::MatrixWorkspace_sptr outputWS,
+  void doBinCheck(const Mantid::API::MatrixWorkspace_sptr &outputWS,
                   const size_t expectedSize) {
     TS_ASSERT_EQUALS(outputWS->readX(0).size(), expectedSize);
     // Check bins are correct
@@ -189,7 +189,7 @@ private:
     }
   }
 
-  void doInstrumentCheck(Mantid::API::MatrixWorkspace_sptr outputWS,
+  void doInstrumentCheck(const Mantid::API::MatrixWorkspace_sptr &outputWS,
                          const std::string &name, const size_t ndets) {
     Mantid::Geometry::Instrument_const_sptr instr = outputWS->getInstrument();
 
@@ -208,7 +208,7 @@ private:
   }
 
   void compareSimulationWorkspaceIDFWithFileIDF(
-      Mantid::API::MatrixWorkspace_sptr simulationWorkspace,
+      const Mantid::API::MatrixWorkspace_sptr &simulationWorkspace,
       const std::string &filename, const std::string &algorithmName) {
     std::string outputWSName = "outWSIDFCompareNexus";
     auto alg = Mantid::API::AlgorithmManager::Instance().createUnmanaged(
diff --git a/Framework/DataHandling/test/DataBlockGeneratorTest.h b/Framework/DataHandling/test/DataBlockGeneratorTest.h
index c450c1ed9f7..8abd5cb4dc2 100644
--- a/Framework/DataHandling/test/DataBlockGeneratorTest.h
+++ b/Framework/DataHandling/test/DataBlockGeneratorTest.h
@@ -96,8 +96,9 @@ public:
   }
 
 private:
-  void do_test_interval(std::vector<std::pair<int64_t, int64_t>> interval,
-                        std::vector<int64_t> expectedOutput) {
+  void
+  do_test_interval(const std::vector<std::pair<int64_t, int64_t>> &interval,
+                   std::vector<int64_t> expectedOutput) {
     Mantid::DataHandling::DataBlockGenerator generator(interval);
 
     TSM_ASSERT("Should be done", !generator.isDone());
diff --git a/Framework/DataHandling/test/DownloadFileTest.h b/Framework/DataHandling/test/DownloadFileTest.h
index 10dca14ca82..e86c96762ec 100644
--- a/Framework/DataHandling/test/DownloadFileTest.h
+++ b/Framework/DataHandling/test/DownloadFileTest.h
@@ -73,8 +73,8 @@ public:
     exec_alg(url, tmpFile.path(), "http://" + url);
   }
 
-  void exec_alg(std::string address, std::string filename,
-                std::string newAddress = "") {
+  void exec_alg(const std::string &address, const std::string &filename,
+                const std::string &newAddress = "") {
     MockedDownloadFile alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
diff --git a/Framework/DataHandling/test/DownloadInstrumentTest.h b/Framework/DataHandling/test/DownloadInstrumentTest.h
index 25258805ac2..e8bea923d84 100644
--- a/Framework/DataHandling/test/DownloadInstrumentTest.h
+++ b/Framework/DataHandling/test/DownloadInstrumentTest.h
@@ -105,7 +105,7 @@ public:
   }
   static void destroySuite(DownloadInstrumentTest *suite) { delete suite; }
 
-  void createDirectory(Poco::Path path) {
+  void createDirectory(const Poco::Path &path) {
     Poco::File file(path);
     if (file.createDirectory()) {
       m_directoriesToRemove.emplace_back(file);
diff --git a/Framework/DataHandling/test/ExtractMonitorWorkspaceTest.h b/Framework/DataHandling/test/ExtractMonitorWorkspaceTest.h
index c3b35941369..520f80cc285 100644
--- a/Framework/DataHandling/test/ExtractMonitorWorkspaceTest.h
+++ b/Framework/DataHandling/test/ExtractMonitorWorkspaceTest.h
@@ -45,7 +45,8 @@ public:
     TS_ASSERT(!alg.isExecuted());
   }
 
-  void doTest(MatrixWorkspace_sptr inws, MatrixWorkspace_sptr monws) {
+  void doTest(const MatrixWorkspace_sptr &inws,
+              const MatrixWorkspace_sptr &monws) {
     inws->setMonitorWorkspace(monws);
     TS_ASSERT_EQUALS(inws->monitorWorkspace(), monws);
 
diff --git a/Framework/DataHandling/test/FindDetectorsInShapeTest.h b/Framework/DataHandling/test/FindDetectorsInShapeTest.h
index 43386547f82..0ff8b160168 100644
--- a/Framework/DataHandling/test/FindDetectorsInShapeTest.h
+++ b/Framework/DataHandling/test/FindDetectorsInShapeTest.h
@@ -117,7 +117,7 @@ public:
     runTest(xmlShape, "320,340,360,380", false);
   }
 
-  void runTest(std::string xmlShape, std::string expectedHits,
+  void runTest(const std::string &xmlShape, std::string expectedHits,
                bool includeMonitors = true) {
     Mantid::DataHandling::FindDetectorsInShape alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize());
diff --git a/Framework/DataHandling/test/InstrumentRayTracerTest.h b/Framework/DataHandling/test/InstrumentRayTracerTest.h
index 563241b26f2..f20863bd0f4 100644
--- a/Framework/DataHandling/test/InstrumentRayTracerTest.h
+++ b/Framework/DataHandling/test/InstrumentRayTracerTest.h
@@ -98,7 +98,7 @@ public:
   }
 
 private:
-  void showResults(Links &results, Instrument_const_sptr inst) {
+  void showResults(Links &results, const Instrument_const_sptr &inst) {
     Links::const_iterator resultItr = results.begin();
     for (; resultItr != results.end(); resultItr++) {
       IComponent_const_sptr component =
diff --git a/Framework/DataHandling/test/LoadAscii2Test.h b/Framework/DataHandling/test/LoadAscii2Test.h
index 12d510c2a88..85b348f697c 100644
--- a/Framework/DataHandling/test/LoadAscii2Test.h
+++ b/Framework/DataHandling/test/LoadAscii2Test.h
@@ -434,7 +434,7 @@ private:
     return save.getPropertyValue("Filename");
   }
 
-  void checkTableData(const Mantid::API::ITableWorkspace_sptr outputWS) {
+  void checkTableData(const Mantid::API::ITableWorkspace_sptr &outputWS) {
 
     const std::string name = "Compare_SaveAsciiWS";
     auto wsToCompare = SaveAscii2Test::writeTableWS(name);
@@ -590,7 +590,7 @@ private:
     return outputWS;
   }
 
-  void checkData(const Mantid::API::MatrixWorkspace_sptr outputWS,
+  void checkData(const Mantid::API::MatrixWorkspace_sptr &outputWS,
                  const int cols) {
     TS_ASSERT_EQUALS(outputWS->getNumberHistograms(), 5);
     TS_ASSERT_EQUALS(outputWS->blocksize(), 4);
diff --git a/Framework/DataHandling/test/LoadAsciiStlTest.h b/Framework/DataHandling/test/LoadAsciiStlTest.h
index 57ebd4ec3fc..f07ca0e9dc9 100644
--- a/Framework/DataHandling/test/LoadAsciiStlTest.h
+++ b/Framework/DataHandling/test/LoadAsciiStlTest.h
@@ -53,7 +53,7 @@ public:
     loadFailureTest("invalid_triangle.stl");
   }
 
-  void loadFailureTest(const std::string filename) {
+  void loadFailureTest(const std::string &filename) {
     std::string path = FileFinder::Instance().getFullPath(filename);
     auto Loader = LoadAsciiStl(path, units);
     TS_ASSERT_THROWS_ANYTHING(Loader.readStl());
diff --git a/Framework/DataHandling/test/LoadAsciiTest.h b/Framework/DataHandling/test/LoadAsciiTest.h
index f970361193a..efacceca209 100644
--- a/Framework/DataHandling/test/LoadAsciiTest.h
+++ b/Framework/DataHandling/test/LoadAsciiTest.h
@@ -275,7 +275,7 @@ private:
     return outputWS;
   }
 
-  void checkData(const Mantid::API::MatrixWorkspace_sptr outputWS,
+  void checkData(const Mantid::API::MatrixWorkspace_sptr &outputWS,
                  const bool threeColumn) {
     if (threeColumn) {
       TS_ASSERT_EQUALS(outputWS->getNumberHistograms(), 1);
diff --git a/Framework/DataHandling/test/LoadDetectorsGroupingFileTest.h b/Framework/DataHandling/test/LoadDetectorsGroupingFileTest.h
index e39ea1170ad..3ec153753df 100644
--- a/Framework/DataHandling/test/LoadDetectorsGroupingFileTest.h
+++ b/Framework/DataHandling/test/LoadDetectorsGroupingFileTest.h
@@ -124,7 +124,7 @@ public:
     API::AnalysisDataService::Instance().remove(ws);
   }
 
-  ScopedFile generateAutoGroupIDGroupXMLFile(std::string xmlfilename) {
+  ScopedFile generateAutoGroupIDGroupXMLFile(const std::string &xmlfilename) {
     std::ostringstream os;
 
     os << "<?xml version=\"1.0\"?>\n";
@@ -173,7 +173,7 @@ public:
     API::AnalysisDataService::Instance().remove(ws);
   }
 
-  ScopedFile generateSpectrumIDXMLFile(std::string xmlfilename) {
+  ScopedFile generateSpectrumIDXMLFile(const std::string &xmlfilename) {
     std::ostringstream os;
 
     os << "<?xml version=\"1.0\"?>\n";
@@ -222,7 +222,7 @@ public:
     API::AnalysisDataService::Instance().remove(ws);
   }
 
-  ScopedFile generateOldSpectrumIDXMLFile(std::string xmlfilename) {
+  ScopedFile generateOldSpectrumIDXMLFile(const std::string &xmlfilename) {
     std::ostringstream os;
 
     os << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
diff --git a/Framework/DataHandling/test/LoadDspacemapTest.h b/Framework/DataHandling/test/LoadDspacemapTest.h
index 7af2fc113de..f8c2843d60d 100644
--- a/Framework/DataHandling/test/LoadDspacemapTest.h
+++ b/Framework/DataHandling/test/LoadDspacemapTest.h
@@ -58,7 +58,8 @@ public:
     TS_ASSERT_DELTA(offsetsWS->dataY(0)[0], -0.6162, 0.0001);
   }
 
-  void doTestVulcan(std::string dspaceFile, std::string fileType) {
+  void doTestVulcan(const std::string &dspaceFile,
+                    const std::string &fileType) {
     std::string outputFile = "./VULCAN_dspacemaptocal_test.cal";
 
     LoadDspacemap testerDSP;
diff --git a/Framework/DataHandling/test/LoadEMUauTest.h b/Framework/DataHandling/test/LoadEMUauTest.h
index 29a0ca3a9d5..53e348f516e 100644
--- a/Framework/DataHandling/test/LoadEMUauTest.h
+++ b/Framework/DataHandling/test/LoadEMUauTest.h
@@ -82,7 +82,7 @@ public:
         run.getProperty("end_time")->value().find("2018-07-26T10:17:12.6") == 0)
 
     // test some data properties
-    auto logpm = [&run](std::string tag) {
+    auto logpm = [&run](const std::string &tag) {
       return dynamic_cast<TimeSeriesProperty<double> *>(run.getProperty(tag))
           ->firstValue();
     };
@@ -91,7 +91,7 @@ public:
 
     // test some instrument parameters
     auto instr = output->getInstrument();
-    auto iparam = [&instr](std::string tag) {
+    auto iparam = [&instr](const std::string &tag) {
       return instr->getNumberParameter(tag)[0];
     };
     TS_ASSERT_DELTA(iparam("AnalysedV2"), 630.866, 1.0e-3);
diff --git a/Framework/DataHandling/test/LoadEmptyInstrumentTest.h b/Framework/DataHandling/test/LoadEmptyInstrumentTest.h
index 95f12043a6c..fa8b7b2b450 100644
--- a/Framework/DataHandling/test/LoadEmptyInstrumentTest.h
+++ b/Framework/DataHandling/test/LoadEmptyInstrumentTest.h
@@ -38,7 +38,7 @@ public:
   static void destroySuite(LoadEmptyInstrumentTest *suite) { delete suite; }
 
   /// Helper that checks that each spectrum has one detector
-  void check_workspace_detectors(MatrixWorkspace_sptr output,
+  void check_workspace_detectors(const MatrixWorkspace_sptr &output,
                                  size_t numberDetectors) {
     TS_ASSERT_EQUALS(output->getNumberHistograms(), numberDetectors);
     for (size_t i = 0; i < output->getNumberHistograms(); i++) {
diff --git a/Framework/DataHandling/test/LoadEventNexusTest.h b/Framework/DataHandling/test/LoadEventNexusTest.h
index bfdd472c443..893761b6f34 100644
--- a/Framework/DataHandling/test/LoadEventNexusTest.h
+++ b/Framework/DataHandling/test/LoadEventNexusTest.h
@@ -106,7 +106,7 @@ load_reference_workspace(const std::string &filename) {
   return boost::dynamic_pointer_cast<const EventWorkspace>(out);
 }
 void run_MPI_load(const Parallel::Communicator &comm,
-                  boost::shared_ptr<std::mutex> mutex,
+                  const boost::shared_ptr<std::mutex> &mutex,
                   const std::string &filename) {
   boost::shared_ptr<const EventWorkspace> reference;
   boost::shared_ptr<const EventWorkspace> eventWS;
@@ -736,7 +736,7 @@ public:
   }
 
   void doTestSingleBank(bool SingleBankPixelsOnly, bool Precount,
-                        std::string BankName = "bank36",
+                        const std::string &BankName = "bank36",
                         bool willFail = false) {
     Mantid::API::FrameworkManager::Instance();
     LoadEventNexus ld;
diff --git a/Framework/DataHandling/test/LoadEventPreNexus2Test.h b/Framework/DataHandling/test/LoadEventPreNexus2Test.h
index b2c80def986..795fe4a2878 100644
--- a/Framework/DataHandling/test/LoadEventPreNexus2Test.h
+++ b/Framework/DataHandling/test/LoadEventPreNexus2Test.h
@@ -69,7 +69,7 @@ public:
     TS_ASSERT_EQUALS(sizeof(DasEvent), 8);
   }
 
-  void checkWorkspace(std::string eventfile, std::string WSName,
+  void checkWorkspace(const std::string &eventfile, const std::string &WSName,
                       int numpixels_with_events) {
     // Get the event file size
     struct stat filestatus;
@@ -143,7 +143,7 @@ public:
     do_test_LoadPreNeXus_CNCS("Parallel");
   }
 
-  void do_test_LoadPreNeXus_CNCS(std::string parallel) {
+  void do_test_LoadPreNeXus_CNCS(const std::string &parallel) {
     std::string eventfile("CNCS_7860_neutron_event.dat");
     eventLoader->setPropertyValue("EventFilename", eventfile);
     eventLoader->setPropertyValue("MappingFilename", "CNCS_TS_2008_08_18.dat");
diff --git a/Framework/DataHandling/test/LoadFullprofResolutionTest.h b/Framework/DataHandling/test/LoadFullprofResolutionTest.h
index 475dc3a427a..975766df8d4 100644
--- a/Framework/DataHandling/test/LoadFullprofResolutionTest.h
+++ b/Framework/DataHandling/test/LoadFullprofResolutionTest.h
@@ -747,7 +747,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Parse a TableWorkspace to a map
    */
-  void parseTableWorkspace(TableWorkspace_sptr tablews,
+  void parseTableWorkspace(const TableWorkspace_sptr &tablews,
                            map<string, double> &parammap) {
     parammap.clear();
 
@@ -766,7 +766,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Parse a TableWorkspace's 2nd bank to a map
    */
-  void parseTableWorkspace2(TableWorkspace_sptr tablews,
+  void parseTableWorkspace2(const TableWorkspace_sptr &tablews,
                             map<string, double> &parammap) {
     parammap.clear();
 
@@ -785,7 +785,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Generate a GEM workspace group with specified number of workspaces.
    */
-  void load_GEM(size_t numberOfWorkspaces, std::string workspaceName) {
+  void load_GEM(size_t numberOfWorkspaces, const std::string &workspaceName) {
     LoadInstrument loaderGEM;
 
     TS_ASSERT_THROWS_NOTHING(loaderGEM.initialize());
@@ -818,7 +818,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Generate a 1 bank .irf file
    */
-  void generate1BankIrfFile(string filename) {
+  void generate1BankIrfFile(const string &filename) {
     ofstream ofile;
     ofile.open(filename.c_str());
 
@@ -879,7 +879,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Generate a 2 bank .irf file
    */
-  void generate2BankIrfFile(string filename) {
+  void generate2BankIrfFile(const string &filename) {
     ofstream ofile;
     ofile.open(filename.c_str());
 
@@ -977,7 +977,7 @@ public:
 
   /** Generate a 3 bank .irf file
    */
-  void generate3BankIrfFile(string filename) {
+  void generate3BankIrfFile(const string &filename) {
     ofstream ofile;
     ofile.open(filename.c_str());
 
@@ -1116,7 +1116,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Generate a 1 bank .irf file for BackToBackExponential fitting function
    */
-  void generate1BankIrfBBXFile(string filename) {
+  void generate1BankIrfBBXFile(const string &filename) {
     ofstream ofile;
     ofile.open(filename.c_str());
 
diff --git a/Framework/DataHandling/test/LoadGSASInstrumentFileTest.h b/Framework/DataHandling/test/LoadGSASInstrumentFileTest.h
index 88434aeb488..e7e65b5ee53 100644
--- a/Framework/DataHandling/test/LoadGSASInstrumentFileTest.h
+++ b/Framework/DataHandling/test/LoadGSASInstrumentFileTest.h
@@ -322,7 +322,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Parse a TableWorkspace to a map
    */
-  void parseTableWorkspace(TableWorkspace_sptr tablews,
+  void parseTableWorkspace(const TableWorkspace_sptr &tablews,
                            map<string, double> &parammap) {
     parammap.clear();
 
@@ -341,7 +341,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Parse a TableWorkspace's 2nd bank to a map
    */
-  void parseTableWorkspace2(TableWorkspace_sptr tablews,
+  void parseTableWorkspace2(const TableWorkspace_sptr &tablews,
                             map<string, double> &parammap) {
     parammap.clear();
 
@@ -360,7 +360,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Generate a 1 bank .prm file
    */
-  void generate1BankPrmFile(string filename) {
+  void generate1BankPrmFile(const string &filename) {
     ofstream ofile;
     ofile.open(filename.c_str());
 
@@ -402,7 +402,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Generate a 2 bank .irf file
    */
-  void generate2BankPrmFile(string filename) {
+  void generate2BankPrmFile(const string &filename) {
     ofstream ofile;
     ofile.open(filename.c_str());
 
@@ -456,7 +456,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Generate a 1 bank .prm file
    */
-  void generateBadHistogramTypePrmFile(string filename) {
+  void generateBadHistogramTypePrmFile(const string &filename) {
     ofstream ofile;
     ofile.open(filename.c_str());
 
@@ -497,7 +497,7 @@ public:
   /** Create a workspace group with specified number of workspaces.
    */
   void createWorkspaceGroup(size_t numberOfWorkspaces,
-                            std::string workspaceName) {
+                            const std::string &workspaceName) {
     // create a workspace with some sample data
     WorkspaceGroup_sptr gws(new API::WorkspaceGroup);
 
diff --git a/Framework/DataHandling/test/LoadILLDiffractionTest.h b/Framework/DataHandling/test/LoadILLDiffractionTest.h
index 4f4c89268a9..1f43b32b0c1 100644
--- a/Framework/DataHandling/test/LoadILLDiffractionTest.h
+++ b/Framework/DataHandling/test/LoadILLDiffractionTest.h
@@ -325,7 +325,7 @@ public:
     TS_ASSERT_DELTA(theta, 147.55, 0.001)
   }
 
-  void do_test_D2B_single_file(std::string dataType) {
+  void do_test_D2B_single_file(const std::string &dataType) {
     // Test a D2B detector scan file with 25 detector positions
 
     const int NUMBER_OF_TUBES = 128;
diff --git a/Framework/DataHandling/test/LoadILLReflectometryTest.h b/Framework/DataHandling/test/LoadILLReflectometryTest.h
index 1b1265d21ba..ee41277b477 100644
--- a/Framework/DataHandling/test/LoadILLReflectometryTest.h
+++ b/Framework/DataHandling/test/LoadILLReflectometryTest.h
@@ -34,7 +34,7 @@ private:
   // Name of the default output workspace
   const std::string m_outWSName{"LoadILLReflectometryTest_OutputWS"};
 
-  static void commonProperties(MatrixWorkspace_sptr output,
+  static void commonProperties(const MatrixWorkspace_sptr &output,
                                const std::string &instrName) {
     TS_ASSERT(output->isHistogramData())
     const auto &spectrumInfo = output->spectrumInfo();
@@ -59,7 +59,7 @@ private:
                      "degree")
   }
 
-  static double detCounts(MatrixWorkspace_sptr output) {
+  static double detCounts(const MatrixWorkspace_sptr &output) {
     // sum of detector counts
     double counts{0.0};
     for (size_t i = 0; i < output->getNumberHistograms(); ++i) {
diff --git a/Framework/DataHandling/test/LoadILLTOF2Test.h b/Framework/DataHandling/test/LoadILLTOF2Test.h
index aee5df882cc..9a2b9dcd7b9 100644
--- a/Framework/DataHandling/test/LoadILLTOF2Test.h
+++ b/Framework/DataHandling/test/LoadILLTOF2Test.h
@@ -46,7 +46,7 @@ public:
    * The elastic peak is obtained on the fly from the sample data.
    */
   MatrixWorkspace_sptr
-  loadDataFile(const std::string dataFile, const size_t numberOfHistograms,
+  loadDataFile(const std::string &dataFile, const size_t numberOfHistograms,
                const size_t numberOfMonitors, const size_t numberOfChannels,
                const double tofDelay, const double tofChannelWidth) {
     LoadILLTOF2 loader;
diff --git a/Framework/DataHandling/test/LoadILLTest.h b/Framework/DataHandling/test/LoadILLTest.h
index cd4ff3f0ddb..5a70735944f 100644
--- a/Framework/DataHandling/test/LoadILLTest.h
+++ b/Framework/DataHandling/test/LoadILLTest.h
@@ -27,7 +27,7 @@ public:
 
   void tearDown() override { AnalysisDataService::Instance().clear(); }
 
-  void checkLoader(std::string filename, std::string resultLoader) {
+  void checkLoader(const std::string &filename, std::string resultLoader) {
     Load alg;
     alg.setChild(true);
     alg.initialize();
diff --git a/Framework/DataHandling/test/LoadISISNexusTest.h b/Framework/DataHandling/test/LoadISISNexusTest.h
index 83f8223fe71..8179ec60a6e 100644
--- a/Framework/DataHandling/test/LoadISISNexusTest.h
+++ b/Framework/DataHandling/test/LoadISISNexusTest.h
@@ -27,7 +27,7 @@ using namespace Mantid::DataHandling;
 class LoadISISNexusTest : public CxxTest::TestSuite {
 private:
   // Helper method to fetch the log property entry corresponding to period.
-  Property *fetchPeriodLog(MatrixWorkspace_sptr workspace,
+  Property *fetchPeriodLog(const MatrixWorkspace_sptr &workspace,
                            int expectedPeriodNumber) {
     std::stringstream period_number_stream;
     period_number_stream << expectedPeriodNumber;
@@ -38,14 +38,14 @@ private:
 
   // Helper method to fetch the log property entry corresponding to the current
   // period.
-  Property *fetchCurrentPeriodLog(MatrixWorkspace_sptr workspace) {
+  Property *fetchCurrentPeriodLog(const MatrixWorkspace_sptr &workspace) {
     Property *p = workspace->run().getLogData("current_period");
     return p;
   }
 
   // Helper method to check that the log data contains a specific period number
   // entry.
-  void checkPeriodLogData(MatrixWorkspace_sptr workspace,
+  void checkPeriodLogData(const MatrixWorkspace_sptr &workspace,
                           int expectedPeriodNumber) {
     Property *p = nullptr;
     TS_ASSERT_THROWS_NOTHING(
diff --git a/Framework/DataHandling/test/LoadInstrumentTest.h b/Framework/DataHandling/test/LoadInstrumentTest.h
index 4278629f6e0..8dd42e1c98a 100644
--- a/Framework/DataHandling/test/LoadInstrumentTest.h
+++ b/Framework/DataHandling/test/LoadInstrumentTest.h
@@ -418,7 +418,7 @@ public:
   }
 
   /// Common initialisation for Nexus loading tests
-  MatrixWorkspace_sptr doLoadNexus(const std::string filename) {
+  MatrixWorkspace_sptr doLoadNexus(const std::string &filename) {
     LoadInstrument nexusLoader;
     nexusLoader.initialize();
     nexusLoader.setChild(true);
@@ -860,9 +860,9 @@ private:
   // @param paramFilename Expected parameter file to be loaded as part of
   // LoadInstrument
   // @param par A specific parameter to check if have been loaded
-  void doTestParameterFileSelection(std::string filename,
-                                    std::string paramFilename,
-                                    std::string par) {
+  void doTestParameterFileSelection(const std::string &filename,
+                                    const std::string &paramFilename,
+                                    const std::string &par) {
     InstrumentDataService::Instance().clear();
 
     LoadInstrument loader;
@@ -914,7 +914,7 @@ public:
     ws = WorkspaceCreationHelper::create2DWorkspace(1, 2);
   }
 
-  void doTest(std::string filename, size_t numTimes = 1) {
+  void doTest(const std::string &filename, size_t numTimes = 1) {
     for (size_t i = 0; i < numTimes; ++i) {
       // Remove any existing instruments, so each time they are loaded.
       InstrumentDataService::Instance().clear();
diff --git a/Framework/DataHandling/test/LoadIsawDetCalTest.h b/Framework/DataHandling/test/LoadIsawDetCalTest.h
index 8274c8d9bfe..0b4d947c355 100644
--- a/Framework/DataHandling/test/LoadIsawDetCalTest.h
+++ b/Framework/DataHandling/test/LoadIsawDetCalTest.h
@@ -48,8 +48,8 @@ void loadEmptyInstrument(const std::string &filename,
 
 class LoadIsawDetCalTest : public CxxTest::TestSuite {
 public:
-  void checkPosition(IComponent_const_sptr det, const double x, const double y,
-                     const double z) {
+  void checkPosition(const IComponent_const_sptr &det, const double x,
+                     const double y, const double z) {
     if (det != nullptr) {
       const auto detPos = det->getPos();
       const V3D testPos(x, y, z);
@@ -59,8 +59,8 @@ public:
     }
   }
 
-  void checkRotation(IComponent_const_sptr det, const double w, const double a,
-                     const double b, const double c) {
+  void checkRotation(const IComponent_const_sptr &det, const double w,
+                     const double a, const double b, const double c) {
     if (det != nullptr) {
       const auto detRot = det->getRotation();
       const Quat testRot(w, a, b, c);
diff --git a/Framework/DataHandling/test/LoadLogTest.h b/Framework/DataHandling/test/LoadLogTest.h
index 6e960d5315c..58dcad0cf3c 100644
--- a/Framework/DataHandling/test/LoadLogTest.h
+++ b/Framework/DataHandling/test/LoadLogTest.h
@@ -173,8 +173,8 @@ public:
     TS_ASSERT(ws->run().hasProperty("str3"));
   }
 
-  void do_test_SNSTextFile(std::string names, std::string units, bool willFail,
-                           bool createWorkspace = true,
+  void do_test_SNSTextFile(const std::string &names, const std::string &units,
+                           bool willFail, bool createWorkspace = true,
                            std::string expectedLastUnit = "Furlongs") {
     // Create an empty workspace and put it in the AnalysisDataService
 
diff --git a/Framework/DataHandling/test/LoadMaskTest.h b/Framework/DataHandling/test/LoadMaskTest.h
index e574bbcd0d3..3dff548e4ac 100644
--- a/Framework/DataHandling/test/LoadMaskTest.h
+++ b/Framework/DataHandling/test/LoadMaskTest.h
@@ -515,9 +515,9 @@ public:
   /*
    * Create a masking file
    */
-  ScopedFileHelper::ScopedFile genMaskingFile(std::string maskfilename,
+  ScopedFileHelper::ScopedFile genMaskingFile(const std::string &maskfilename,
                                               std::vector<int> detids,
-                                              std::vector<int> banks) {
+                                              const std::vector<int> &banks) {
     std::stringstream ss;
 
     // 1. Header
@@ -551,8 +551,8 @@ public:
    * Create an ISIS format masking file
    */
   ScopedFileHelper::ScopedFile
-  genISISMaskingFile(std::string maskfilename,
-                     std::vector<specnum_t> singlespectra,
+  genISISMaskingFile(const std::string &maskfilename,
+                     const std::vector<specnum_t> &singlespectra,
                      std::vector<specnum_t> pairspectra) {
     std::stringstream ss;
 
diff --git a/Framework/DataHandling/test/LoadMcStasTest.h b/Framework/DataHandling/test/LoadMcStasTest.h
index c383eed70df..986f30afe83 100644
--- a/Framework/DataHandling/test/LoadMcStasTest.h
+++ b/Framework/DataHandling/test/LoadMcStasTest.h
@@ -164,7 +164,7 @@ public:
   }
 
 private:
-  double extractSumAndTest(MatrixWorkspace_sptr workspace,
+  double extractSumAndTest(const MatrixWorkspace_sptr &workspace,
                            const double &expectedSum) {
     TS_ASSERT_EQUALS(workspace->getNumberHistograms(), 8192);
     auto sum = 0.0;
@@ -175,8 +175,8 @@ private:
     return sum;
   }
 
-  boost::shared_ptr<WorkspaceGroup> load_test(std::string fileName,
-                                              std::string outputName) {
+  boost::shared_ptr<WorkspaceGroup> load_test(const std::string &fileName,
+                                              const std::string &outputName) {
 
     // specify name of file to load workspace from
     algToBeTested.setProperty("Filename", fileName);
diff --git a/Framework/DataHandling/test/LoadMuonNexus2Test.h b/Framework/DataHandling/test/LoadMuonNexus2Test.h
index c3ea63efbd5..4b9c1947e22 100644
--- a/Framework/DataHandling/test/LoadMuonNexus2Test.h
+++ b/Framework/DataHandling/test/LoadMuonNexus2Test.h
@@ -33,7 +33,7 @@ using Mantid::Types::Core::DateAndTime;
 
 class LoadMuonNexus2Test : public CxxTest::TestSuite {
 public:
-  void check_spectra_and_detectors(MatrixWorkspace_sptr output) {
+  void check_spectra_and_detectors(const MatrixWorkspace_sptr &output) {
 
     //----------------------------------------------------------------------
     // Tests to check that spectra-detector mapping is done correctly
diff --git a/Framework/DataHandling/test/LoadNXcanSASTest.h b/Framework/DataHandling/test/LoadNXcanSASTest.h
index 908c0b7b2d9..03373437559 100644
--- a/Framework/DataHandling/test/LoadNXcanSASTest.h
+++ b/Framework/DataHandling/test/LoadNXcanSASTest.h
@@ -8,6 +8,8 @@
 
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/Axis.h"
@@ -266,7 +268,7 @@ public:
   }
 
 private:
-  void removeWorkspaceFromADS(const std::string toRemove) {
+  void removeWorkspaceFromADS(const std::string &toRemove) {
     if (AnalysisDataService::Instance().doesExist(toRemove)) {
       AnalysisDataService::Instance().remove(toRemove);
     }
@@ -296,10 +298,11 @@ private:
     return ws;
   }
 
-  void save_file_no_issues(MatrixWorkspace_sptr workspace,
-                           NXcanSASTestParameters &parameters,
-                           MatrixWorkspace_sptr transmission = nullptr,
-                           MatrixWorkspace_sptr transmissionCan = nullptr) {
+  void
+  save_file_no_issues(const MatrixWorkspace_sptr &workspace,
+                      NXcanSASTestParameters &parameters,
+                      const MatrixWorkspace_sptr &transmission = nullptr,
+                      const MatrixWorkspace_sptr &transmissionCan = nullptr) {
     auto saveAlg = AlgorithmManager::Instance().createUnmanaged("SaveNXcanSAS");
     saveAlg->initialize();
     saveAlg->setProperty("Filename", parameters.filename);
@@ -342,7 +345,8 @@ private:
     }
   }
 
-  void do_assert_units(MatrixWorkspace_sptr wsIn, MatrixWorkspace_sptr wsOut) {
+  void do_assert_units(const MatrixWorkspace_sptr &wsIn,
+                       const MatrixWorkspace_sptr &wsOut) {
     // Ensure that units of axis 0 are matching
     auto unit0In = wsIn->getAxis(0)->unit()->label().ascii();
     auto unit0Out = wsOut->getAxis(0)->unit()->label().ascii();
@@ -361,8 +365,8 @@ private:
     TSM_ASSERT_EQUALS("Should have the same y unit", unitYIn, unitYOut);
   }
 
-  void do_assert_axis1_values_are_the_same(MatrixWorkspace_sptr wsIn,
-                                           MatrixWorkspace_sptr wsOut) {
+  void do_assert_axis1_values_are_the_same(const MatrixWorkspace_sptr &wsIn,
+                                           const MatrixWorkspace_sptr &wsOut) {
     if (!wsOut->getAxis(1)->isNumeric()) {
       return;
     }
@@ -391,8 +395,8 @@ private:
     }
   }
 
-  void do_assert_sample_logs(MatrixWorkspace_sptr wsIn,
-                             MatrixWorkspace_sptr wsOut) {
+  void do_assert_sample_logs(const MatrixWorkspace_sptr &wsIn,
+                             const MatrixWorkspace_sptr &wsOut) {
     auto &runIn = wsIn->mutableRun();
     auto &runOut = wsOut->mutableRun();
 
@@ -413,16 +417,17 @@ private:
     }
   }
 
-  void do_assert_instrument(MatrixWorkspace_sptr wsIn,
-                            MatrixWorkspace_sptr wsOut) {
-    auto idfIn = getIDFfromWorkspace(wsIn);
-    auto idfOut = getIDFfromWorkspace(wsOut);
+  void do_assert_instrument(const MatrixWorkspace_sptr &wsIn,
+                            const MatrixWorkspace_sptr &wsOut) {
+    auto idfIn = getIDFfromWorkspace(std::move(wsIn));
+    auto idfOut = getIDFfromWorkspace(std::move(wsOut));
     TSM_ASSERT_EQUALS("Should have the same instrument", idfIn, idfOut);
   }
 
-  void do_assert_transmission(MatrixWorkspace_sptr mainWorkspace,
-                              MatrixWorkspace_sptr transIn,
-                              NXcanSASTestTransmissionParameters parameters) {
+  void
+  do_assert_transmission(const MatrixWorkspace_sptr &mainWorkspace,
+                         const MatrixWorkspace_sptr &transIn,
+                         const NXcanSASTestTransmissionParameters &parameters) {
     if (!parameters.usesTransmission || !transIn) {
       return;
     }
@@ -435,32 +440,34 @@ private:
         AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(transName);
 
     // Ensure that both have the same Y data
-    auto readDataY = [](MatrixWorkspace_sptr ws, size_t index) {
+    auto readDataY = [](const MatrixWorkspace_sptr &ws, size_t index) {
       return ws->y(index);
     };
     do_assert_data(transIn, transOut, readDataY);
 
     // Ensure that both have the same E data
-    auto readDataE = [](MatrixWorkspace_sptr ws, size_t index) {
+    auto readDataE = [](const MatrixWorkspace_sptr &ws, size_t index) {
       return ws->e(index);
     };
     do_assert_data(transIn, transOut, readDataE);
 
     // Ensure that both have the same X data
-    auto readDataX = [](MatrixWorkspace_sptr ws, size_t index) {
+    auto readDataX = [](const MatrixWorkspace_sptr &ws, size_t index) {
       return ws->x(index);
     };
     do_assert_data(transIn, transOut, readDataX);
   }
 
-  void do_assert_load(MatrixWorkspace_sptr wsIn, MatrixWorkspace_sptr wsOut,
-                      NXcanSASTestParameters &parameters,
-                      MatrixWorkspace_sptr transmission = nullptr,
-                      MatrixWorkspace_sptr transmissionCan = nullptr,
-                      NXcanSASTestTransmissionParameters sampleParameters =
-                          NXcanSASTestTransmissionParameters(),
-                      NXcanSASTestTransmissionParameters canParameters =
-                          NXcanSASTestTransmissionParameters()) {
+  void
+  do_assert_load(const MatrixWorkspace_sptr &wsIn,
+                 const MatrixWorkspace_sptr &wsOut,
+                 NXcanSASTestParameters &parameters,
+                 const MatrixWorkspace_sptr &transmission = nullptr,
+                 const MatrixWorkspace_sptr &transmissionCan = nullptr,
+                 const NXcanSASTestTransmissionParameters &sampleParameters =
+                     NXcanSASTestTransmissionParameters(),
+                 const NXcanSASTestTransmissionParameters &canParameters =
+                     NXcanSASTestTransmissionParameters()) {
     // Ensure that both have the same units
     do_assert_units(wsIn, wsOut);
 
@@ -468,26 +475,26 @@ private:
     TSM_ASSERT("Should be a point workspace", !wsOut->isHistogramData());
 
     // Ensure that both have the same Y data
-    auto readDataY = [](MatrixWorkspace_sptr ws, size_t index) {
+    auto readDataY = [](const MatrixWorkspace_sptr &ws, size_t index) {
       return ws->y(index);
     };
     do_assert_data(wsIn, wsOut, readDataY);
 
     // Ensure that both have the same E data
-    auto readDataE = [](MatrixWorkspace_sptr ws, size_t index) {
+    auto readDataE = [](const MatrixWorkspace_sptr &ws, size_t index) {
       return ws->e(index);
     };
     do_assert_data(wsIn, wsOut, readDataE);
 
     // Ensure that both have the same X data
-    auto readDataX = [](MatrixWorkspace_sptr ws, size_t index) {
+    auto readDataX = [](const MatrixWorkspace_sptr &ws, size_t index) {
       return ws->x(index);
     };
     do_assert_data(wsIn, wsOut, readDataX);
 
     // If applicable, ensure that both have the same Xdev data
     if (parameters.hasDx) {
-      auto readDataDX = [](MatrixWorkspace_sptr ws, size_t index) {
+      auto readDataDX = [](const MatrixWorkspace_sptr &ws, size_t index) {
         return ws->dataDx(index);
       };
       do_assert_data(wsIn, wsOut, readDataDX);
@@ -503,8 +510,10 @@ private:
     do_assert_instrument(wsIn, wsOut);
 
     // Test transmission workspaces
-    do_assert_transmission(wsOut, transmission, sampleParameters);
-    do_assert_transmission(wsOut, transmissionCan, canParameters);
+    do_assert_transmission(wsOut, std::move(transmission),
+                           std::move(sampleParameters));
+    do_assert_transmission(wsOut, std::move(transmissionCan),
+                           std::move(canParameters));
   }
 };
 
@@ -537,7 +546,7 @@ private:
   NXcanSASTestParameters parameters1D;
   NXcanSASTestParameters parameters2D;
 
-  void save_no_assert(MatrixWorkspace_sptr ws,
+  void save_no_assert(const MatrixWorkspace_sptr &ws,
                       NXcanSASTestParameters &parameters) {
     auto saveAlg = AlgorithmManager::Instance().createUnmanaged("SaveNXcanSAS");
     saveAlg->initialize();
diff --git a/Framework/DataHandling/test/LoadNexusProcessed2Test.h b/Framework/DataHandling/test/LoadNexusProcessed2Test.h
index 3ece0dffb83..b63a4ed5c8a 100644
--- a/Framework/DataHandling/test/LoadNexusProcessed2Test.h
+++ b/Framework/DataHandling/test/LoadNexusProcessed2Test.h
@@ -52,7 +52,7 @@ Mantid::API::MatrixWorkspace_sptr do_load_v1(const std::string &filename) {
 }
 
 namespace test_utility {
-template <typename T> void save(const std::string filename, T &ws) {
+template <typename T> void save(const std::string &filename, T &ws) {
   SaveNexusESS alg;
   alg.setChild(true);
   alg.setRethrows(true);
diff --git a/Framework/DataHandling/test/LoadNexusProcessedTest.h b/Framework/DataHandling/test/LoadNexusProcessedTest.h
index 4a1d3d41dd1..f501fc6c663 100644
--- a/Framework/DataHandling/test/LoadNexusProcessedTest.h
+++ b/Framework/DataHandling/test/LoadNexusProcessedTest.h
@@ -1110,7 +1110,7 @@ public:
   }
 
 private:
-  void doHistoryTest(MatrixWorkspace_sptr matrix_ws) {
+  void doHistoryTest(const MatrixWorkspace_sptr &matrix_ws) {
     const WorkspaceHistory history = matrix_ws->getHistory();
     int nalgs = static_cast<int>(history.size());
     TS_ASSERT_EQUALS(nalgs, 4);
@@ -1201,7 +1201,7 @@ private:
    * be present
    */
   void doSpectrumListTests(LoadNexusProcessed &alg,
-                           const std::vector<int> expectedSpectra) {
+                           const std::vector<int> &expectedSpectra) {
     TS_ASSERT_THROWS_NOTHING(alg.execute());
     TS_ASSERT(alg.isExecuted());
 
diff --git a/Framework/DataHandling/test/LoadPLNTest.h b/Framework/DataHandling/test/LoadPLNTest.h
index ed193864a07..80d8d067d54 100644
--- a/Framework/DataHandling/test/LoadPLNTest.h
+++ b/Framework/DataHandling/test/LoadPLNTest.h
@@ -74,7 +74,7 @@ public:
         run.getProperty("end_time")->value().find("2018-11-12T11:45:06.6") == 0)
 
     // test some data properties
-    auto logpm = [&run](std::string tag) {
+    auto logpm = [&run](const std::string &tag) {
       return dynamic_cast<TimeSeriesProperty<double> *>(run.getProperty(tag))
           ->firstValue();
     };
@@ -129,7 +129,7 @@ public:
         run.getProperty("end_time")->value().find("2018-11-12T11:45:06.6") == 0)
 
     // test some data properties
-    auto logpm = [&run](std::string tag) {
+    auto logpm = [&run](const std::string &tag) {
       return dynamic_cast<TimeSeriesProperty<double> *>(run.getProperty(tag))
           ->firstValue();
     };
diff --git a/Framework/DataHandling/test/LoadRaw3Test.h b/Framework/DataHandling/test/LoadRaw3Test.h
index 9038d686eba..1918a73af95 100644
--- a/Framework/DataHandling/test/LoadRaw3Test.h
+++ b/Framework/DataHandling/test/LoadRaw3Test.h
@@ -1151,7 +1151,7 @@ public:
 private:
   /// Helper method to run common set of tests on a workspace in a multi-period
   /// group.
-  void doTestMultiPeriodWorkspace(MatrixWorkspace_sptr workspace,
+  void doTestMultiPeriodWorkspace(const MatrixWorkspace_sptr &workspace,
                                   const size_t &nHistograms,
                                   int expected_period) {
     // Check the number of histograms.
@@ -1173,8 +1173,8 @@ private:
   }
 
   /// Check that two matrix workspaces match
-  std::string checkWorkspacesMatch(Workspace_sptr workspace1,
-                                   Workspace_sptr workspace2) {
+  std::string checkWorkspacesMatch(const Workspace_sptr &workspace1,
+                                   const Workspace_sptr &workspace2) {
     auto ws1 = boost::dynamic_pointer_cast<MatrixWorkspace>(workspace1);
     auto ws2 = boost::dynamic_pointer_cast<MatrixWorkspace>(workspace2);
     if (!ws1 || !ws2) {
diff --git a/Framework/DataHandling/test/LoadRawBin0Test.h b/Framework/DataHandling/test/LoadRawBin0Test.h
index 82884027b2e..4bbe01e0775 100644
--- a/Framework/DataHandling/test/LoadRawBin0Test.h
+++ b/Framework/DataHandling/test/LoadRawBin0Test.h
@@ -149,7 +149,7 @@ public:
 private:
   /// Helper method to run common set of tests on a workspace in a multi-period
   /// group.
-  void doTestMultiPeriodWorkspace(MatrixWorkspace_sptr workspace,
+  void doTestMultiPeriodWorkspace(const MatrixWorkspace_sptr &workspace,
                                   const size_t &nHistograms,
                                   int expected_period) {
     // Check the number of histograms.
diff --git a/Framework/DataHandling/test/LoadRawSpectrum0Test.h b/Framework/DataHandling/test/LoadRawSpectrum0Test.h
index 51bee7ca53f..f1a86ad09ed 100644
--- a/Framework/DataHandling/test/LoadRawSpectrum0Test.h
+++ b/Framework/DataHandling/test/LoadRawSpectrum0Test.h
@@ -146,7 +146,7 @@ public:
 private:
   /// Helper method to run common set of tests on a workspace in a multi-period
   /// group.
-  void doTestMultiPeriodWorkspace(MatrixWorkspace_sptr workspace,
+  void doTestMultiPeriodWorkspace(const MatrixWorkspace_sptr &workspace,
                                   int expected_period) {
     // Check the current period property.
     const Mantid::API::Run &run = workspace->run();
diff --git a/Framework/DataHandling/test/LoadSampleShapeTest.h b/Framework/DataHandling/test/LoadSampleShapeTest.h
index 8481575cf20..62b10eaac5e 100644
--- a/Framework/DataHandling/test/LoadSampleShapeTest.h
+++ b/Framework/DataHandling/test/LoadSampleShapeTest.h
@@ -217,7 +217,7 @@ private:
 
   const MeshObject *loadMeshObject(LoadSampleShape &alg,
                                    bool outputWsSameAsInputWs,
-                                   const std::string filename) {
+                                   const std::string &filename) {
     alg.initialize();
     alg.setPropertyValue("Filename", filename);
     prepareWorkspaces(alg, outputWsSameAsInputWs);
@@ -226,7 +226,7 @@ private:
     return getMeshObject(alg);
   }
 
-  void loadFailureTest(LoadSampleShape &alg, const std::string filename) {
+  void loadFailureTest(LoadSampleShape &alg, const std::string &filename) {
     alg.initialize();
     alg.setPropertyValue("Filename", filename);
     prepareWorkspaces(alg, true);
@@ -276,7 +276,7 @@ private:
   std::unique_ptr<LoadSampleShape> alg;
   const int numberOfIterations = 5;
 
-  std::unique_ptr<LoadSampleShape> setupAlg(Workspace2D_sptr inputWS) {
+  std::unique_ptr<LoadSampleShape> setupAlg(const Workspace2D_sptr &inputWS) {
     auto loadAlg = std::make_unique<LoadSampleShape>();
     loadAlg->initialize();
     loadAlg->setChild(true);
diff --git a/Framework/DataHandling/test/LoadSpice2dTest.h b/Framework/DataHandling/test/LoadSpice2dTest.h
index 53d177e394c..3f44d326e21 100644
--- a/Framework/DataHandling/test/LoadSpice2dTest.h
+++ b/Framework/DataHandling/test/LoadSpice2dTest.h
@@ -222,7 +222,8 @@ public:
     TS_ASSERT_DELTA(ws2d->x(192 + nmon)[0], 4.5, tolerance);
   }
 
-  void assertDetectorDistances(Mantid::DataObjects::Workspace2D_sptr ws2d) {
+  void
+  assertDetectorDistances(const Mantid::DataObjects::Workspace2D_sptr &ws2d) {
     Mantid::Kernel::Property *prop =
         ws2d->run().getProperty("sample-detector-distance");
     Mantid::Kernel::PropertyWithValue<double> *sdd =
diff --git a/Framework/DataHandling/test/MaskDetectorsInShapeTest.h b/Framework/DataHandling/test/MaskDetectorsInShapeTest.h
index d2227555c13..c675b30f5b8 100644
--- a/Framework/DataHandling/test/MaskDetectorsInShapeTest.h
+++ b/Framework/DataHandling/test/MaskDetectorsInShapeTest.h
@@ -8,6 +8,8 @@
 
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidDataHandling/LoadEmptyInstrument.h"
@@ -59,7 +61,7 @@ public:
     runTest(xmlShape, "320,340,360,380", false);
   }
 
-  void runTest(std::string xmlShape, std::string expectedHits,
+  void runTest(const std::string &xmlShape, std::string expectedHits,
                bool includeMonitors = true) {
     using namespace Mantid::API;
 
@@ -80,21 +82,21 @@ public:
     MatrixWorkspace_const_sptr outWS =
         AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(wsName);
 
-    checkDeadDetectors(outWS, expectedHits);
+    checkDeadDetectors(outWS, std::move(expectedHits));
   }
 
-  void checkDeadDetectors(Mantid::API::MatrixWorkspace_const_sptr outWS,
-                          std::string expectedHits) {
+  void checkDeadDetectors(const Mantid::API::MatrixWorkspace_const_sptr &outWS,
+                          const std::string &expectedHits) {
     // check that the detectors have actually been marked dead
     std::vector<int> expectedDetectorArray =
-        convertStringToVector(expectedHits);
+        convertStringToVector(std::move(expectedHits));
     const auto &detectorInfo = outWS->detectorInfo();
     for (const auto detID : expectedDetectorArray) {
       TS_ASSERT(detectorInfo.isMasked(detectorInfo.indexOf(detID)));
     }
   }
 
-  std::vector<int> convertStringToVector(const std::string input) {
+  std::vector<int> convertStringToVector(const std::string &input) {
     Mantid::Kernel::ArrayProperty<int> arrayProp("name", input);
     return arrayProp();
   }
diff --git a/Framework/DataHandling/test/MaskSpectraTest.h b/Framework/DataHandling/test/MaskSpectraTest.h
index 92d3d7ce3be..3fb4c93b10e 100644
--- a/Framework/DataHandling/test/MaskSpectraTest.h
+++ b/Framework/DataHandling/test/MaskSpectraTest.h
@@ -47,7 +47,7 @@ void checkWorkspace(const MatrixWorkspace &ws) {
   TS_ASSERT_EQUALS(ws.e(3)[0], 0.0);
 }
 
-MatrixWorkspace_sptr runMaskSpectra(MatrixWorkspace_sptr inputWS) {
+MatrixWorkspace_sptr runMaskSpectra(const MatrixWorkspace_sptr &inputWS) {
   MaskSpectra alg;
   alg.setChild(true);
   alg.initialize();
diff --git a/Framework/DataHandling/test/NXcanSASTestHelper.cpp b/Framework/DataHandling/test/NXcanSASTestHelper.cpp
index 6504a1ae60f..a1a2381f0f4 100644
--- a/Framework/DataHandling/test/NXcanSASTestHelper.cpp
+++ b/Framework/DataHandling/test/NXcanSASTestHelper.cpp
@@ -18,7 +18,8 @@
 
 namespace NXcanSASTestHelper {
 
-std::string concatenateStringVector(std::vector<std::string> stringVector) {
+std::string
+concatenateStringVector(const std::vector<std::string> &stringVector) {
   std::ostringstream os;
   for (auto &element : stringVector) {
     os << element;
@@ -28,7 +29,8 @@ std::string concatenateStringVector(std::vector<std::string> stringVector) {
   return os.str();
 }
 
-std::string getIDFfromWorkspace(Mantid::API::MatrixWorkspace_sptr workspace) {
+std::string
+getIDFfromWorkspace(const Mantid::API::MatrixWorkspace_sptr &workspace) {
   auto instrument = workspace->getInstrument();
   auto name = instrument->getFullName();
   auto date = workspace->getWorkspaceStartDate();
@@ -36,7 +38,8 @@ std::string getIDFfromWorkspace(Mantid::API::MatrixWorkspace_sptr workspace) {
 }
 
 void setXValuesOn1DWorkspaceWithPointData(
-    Mantid::API::MatrixWorkspace_sptr workspace, double xmin, double xmax) {
+    const Mantid::API::MatrixWorkspace_sptr &workspace, double xmin,
+    double xmax) {
   auto &xValues = workspace->dataX(0);
   auto size = xValues.size();
   double binWidth = (xmax - xmin) / static_cast<double>(size - 1);
@@ -46,7 +49,7 @@ void setXValuesOn1DWorkspaceWithPointData(
   }
 }
 
-void add_sample_log(Mantid::API::MatrixWorkspace_sptr workspace,
+void add_sample_log(const Mantid::API::MatrixWorkspace_sptr &workspace,
                     const std::string &logName, const std::string &logValue) {
   auto logAlg =
       Mantid::API::AlgorithmManager::Instance().createUnmanaged("AddSampleLog");
@@ -58,7 +61,7 @@ void add_sample_log(Mantid::API::MatrixWorkspace_sptr workspace,
   logAlg->execute();
 }
 
-void set_logs(Mantid::API::MatrixWorkspace_sptr workspace,
+void set_logs(const Mantid::API::MatrixWorkspace_sptr &workspace,
               const std::string &runNumber, const std::string &userFile) {
   if (!runNumber.empty()) {
     add_sample_log(workspace, "run_number", runNumber);
@@ -69,7 +72,7 @@ void set_logs(Mantid::API::MatrixWorkspace_sptr workspace,
   }
 }
 
-void set_instrument(Mantid::API::MatrixWorkspace_sptr workspace,
+void set_instrument(const Mantid::API::MatrixWorkspace_sptr &workspace,
                     const std::string &instrumentName) {
   auto instAlg = Mantid::API::AlgorithmManager::Instance().createUnmanaged(
       "LoadInstrument");
@@ -205,7 +208,7 @@ provide2DWorkspace(NXcanSASTestParameters &parameters) {
   return ws;
 }
 
-void set2DValues(Mantid::API::MatrixWorkspace_sptr ws) {
+void set2DValues(const Mantid::API::MatrixWorkspace_sptr &ws) {
   const auto numberOfHistograms = ws->getNumberHistograms();
 
   for (size_t index = 0; index < numberOfHistograms; ++index) {
@@ -214,7 +217,7 @@ void set2DValues(Mantid::API::MatrixWorkspace_sptr ws) {
   }
 }
 
-void removeFile(std::string filename) {
+void removeFile(const std::string &filename) {
   if (Poco::File(filename).exists())
     Poco::File(filename).remove();
 }
diff --git a/Framework/DataHandling/test/NXcanSASTestHelper.h b/Framework/DataHandling/test/NXcanSASTestHelper.h
index 1d8ec808ea9..aec86f5708d 100644
--- a/Framework/DataHandling/test/NXcanSASTestHelper.h
+++ b/Framework/DataHandling/test/NXcanSASTestHelper.h
@@ -92,20 +92,23 @@ struct NXcanSASTestTransmissionParameters {
   bool usesTransmission;
 };
 
-std::string concatenateStringVector(std::vector<std::string> stringVector);
+std::string
+concatenateStringVector(const std::vector<std::string> &stringVector);
 
-std::string getIDFfromWorkspace(Mantid::API::MatrixWorkspace_sptr workspace);
+std::string
+getIDFfromWorkspace(const Mantid::API::MatrixWorkspace_sptr &workspace);
 
 void setXValuesOn1DWorkspaceWithPointData(
-    Mantid::API::MatrixWorkspace_sptr workspace, double xmin, double xmax);
+    const Mantid::API::MatrixWorkspace_sptr &workspace, double xmin,
+    double xmax);
 
-void add_sample_log(Mantid::API::MatrixWorkspace_sptr workspace,
+void add_sample_log(const Mantid::API::MatrixWorkspace_sptr &workspace,
                     const std::string &logName, const std::string &logValue);
 
-void set_logs(Mantid::API::MatrixWorkspace_sptr workspace,
+void set_logs(const Mantid::API::MatrixWorkspace_sptr &workspace,
               const std::string &runNumber, const std::string &userFile);
 
-void set_instrument(Mantid::API::MatrixWorkspace_sptr workspace,
+void set_instrument(const Mantid::API::MatrixWorkspace_sptr &workspace,
                     const std::string &instrumentName);
 
 Mantid::API::MatrixWorkspace_sptr
@@ -117,7 +120,7 @@ getTransmissionWorkspace(NXcanSASTestTransmissionParameters &parameters);
 Mantid::API::MatrixWorkspace_sptr
 provide2DWorkspace(NXcanSASTestParameters &parameters);
 
-void set2DValues(Mantid::API::MatrixWorkspace_sptr ws);
+void set2DValues(const Mantid::API::MatrixWorkspace_sptr &ws);
 
-void removeFile(std::string filename);
+void removeFile(const std::string &filename);
 } // namespace NXcanSASTestHelper
\ No newline at end of file
diff --git a/Framework/DataHandling/test/RenameLogTest.h b/Framework/DataHandling/test/RenameLogTest.h
index 66913b9a237..013170d6a27 100644
--- a/Framework/DataHandling/test/RenameLogTest.h
+++ b/Framework/DataHandling/test/RenameLogTest.h
@@ -124,8 +124,8 @@ private:
     return testWS;
   }
 
-  void verifyLog(API::MatrixWorkspace_sptr resultWS,
-                 const std::string logName) {
+  void verifyLog(const API::MatrixWorkspace_sptr &resultWS,
+                 const std::string &logName) {
     Kernel::TimeSeriesProperty<double> *rp;
     TS_ASSERT_THROWS_NOTHING(
         rp = dynamic_cast<Kernel::TimeSeriesProperty<double> *>(
diff --git a/Framework/DataHandling/test/SaveCSVTest.h b/Framework/DataHandling/test/SaveCSVTest.h
index 894dca2524c..21c841e8099 100644
--- a/Framework/DataHandling/test/SaveCSVTest.h
+++ b/Framework/DataHandling/test/SaveCSVTest.h
@@ -169,7 +169,8 @@ private:
     Poco::File(fileName).remove();
   }
 
-  void evaluateFileWithDX(std::string fileName, const size_t nSpec) const {
+  void evaluateFileWithDX(const std::string &fileName,
+                          const size_t nSpec) const {
     std::ifstream stream(fileName.c_str());
     std::istringstream dataStream;
     std::string line;
diff --git a/Framework/DataHandling/test/SaveFullprofResolutionTest.h b/Framework/DataHandling/test/SaveFullprofResolutionTest.h
index 15d97bff219..8b088df4b74 100644
--- a/Framework/DataHandling/test/SaveFullprofResolutionTest.h
+++ b/Framework/DataHandling/test/SaveFullprofResolutionTest.h
@@ -184,7 +184,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Find out number of lines in a text file
    */
-  int getFileLines(std::string filename) {
+  int getFileLines(const std::string &filename) {
     ifstream infile;
     infile.open(filename.c_str());
 
@@ -206,7 +206,7 @@ public:
   /** Write out a TableWorkspace contain 2 banks' parameters
    * ISIS HRPD Data
    */
-  void create2BankProf9Table(string workspacename) {
+  void create2BankProf9Table(const string &workspacename) {
     TableWorkspace_sptr partablews = boost::make_shared<TableWorkspace>();
     partablews->addColumn("str", "Name");
     partablews->addColumn("double", "Value_1");
@@ -261,7 +261,7 @@ public:
    * 10
    * Source data is from POWGEN's bank 1 calibrated
    */
-  void createProfile10TableWS(std::string wsname) {
+  void createProfile10TableWS(const std::string &wsname) {
     // Create a map of string/double for parameters of profile 10
     std::map<std::string, double> parammap{
         {"BANK", 1.},        {"Alph0", 1.88187},  {"Alph0t", 64.4102},
diff --git a/Framework/DataHandling/test/SaveGSASInstrumentFileTest.h b/Framework/DataHandling/test/SaveGSASInstrumentFileTest.h
index 02ba90e4e9e..99b14d91ec4 100644
--- a/Framework/DataHandling/test/SaveGSASInstrumentFileTest.h
+++ b/Framework/DataHandling/test/SaveGSASInstrumentFileTest.h
@@ -186,7 +186,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Load table workspace containing instrument parameters
    */
-  void loadProfileTable(string wsname) {
+  void loadProfileTable(const string &wsname) {
     // The data befow is from Bank1 in pg60_2011B.irf
 
     auto tablews = boost::make_shared<TableWorkspace>();
@@ -266,7 +266,7 @@ public:
   //----------------------------------------------------------------------------------------------
   /** Generate a 3 bank .irf file
    */
-  void generate3BankIrfFile(string filename) {
+  void generate3BankIrfFile(const string &filename) {
     ofstream ofile;
     ofile.open(filename.c_str());
 
@@ -457,7 +457,8 @@ public:
   }
 
   // Compare 2 files
-  bool compare2Files(std::string filename1, std::string filename2) {
+  bool compare2Files(const std::string &filename1,
+                     const std::string &filename2) {
     ifstream file1(filename1.c_str(), std::ifstream::in);
     ifstream file2(filename2.c_str(), std::ifstream::in);
 
diff --git a/Framework/DataHandling/test/SaveILLCosmosAsciiTest.h b/Framework/DataHandling/test/SaveILLCosmosAsciiTest.h
index 0669e1eed2a..865a4120f72 100644
--- a/Framework/DataHandling/test/SaveILLCosmosAsciiTest.h
+++ b/Framework/DataHandling/test/SaveILLCosmosAsciiTest.h
@@ -228,7 +228,8 @@ public:
 
 private:
   void headingsTests(std::ifstream &in, std::string &fullline,
-                     bool propertiesLogs = false, std::string sep = "\t") {
+                     bool propertiesLogs = false,
+                     const std::string &sep = "\t") {
     getline(in, fullline);
     TS_ASSERT_EQUALS(fullline, "MFT");
     getline(in, fullline);
diff --git a/Framework/DataHandling/test/SaveNXSPETest.h b/Framework/DataHandling/test/SaveNXSPETest.h
index fb569bdb7ca..fe41ac1a3d7 100644
--- a/Framework/DataHandling/test/SaveNXSPETest.h
+++ b/Framework/DataHandling/test/SaveNXSPETest.h
@@ -175,7 +175,7 @@ private:
       boost::tuple<boost::shared_array<hsize_t>, boost::shared_array<double>,
                    boost::shared_array<double>>;
 
-  DataHolder saveAndReloadWorkspace(const MatrixWorkspace_sptr inputWS) {
+  DataHolder saveAndReloadWorkspace(const MatrixWorkspace_sptr &inputWS) {
     SaveNXSPE saver;
     saver.initialize();
     saver.setChild(true);
diff --git a/Framework/DataHandling/test/SaveNXcanSASTest.h b/Framework/DataHandling/test/SaveNXcanSASTest.h
index 7fba40a62ae..46bdbabd14e 100644
--- a/Framework/DataHandling/test/SaveNXcanSASTest.h
+++ b/Framework/DataHandling/test/SaveNXcanSASTest.h
@@ -373,10 +373,10 @@ public:
 
 private:
   void save_file_no_issues(
-      Mantid::API::MatrixWorkspace_sptr workspace,
+      const Mantid::API::MatrixWorkspace_sptr &workspace,
       NXcanSASTestParameters &parameters,
-      Mantid::API::MatrixWorkspace_sptr transmission = nullptr,
-      Mantid::API::MatrixWorkspace_sptr transmissionCan = nullptr) {
+      const Mantid::API::MatrixWorkspace_sptr &transmission = nullptr,
+      const Mantid::API::MatrixWorkspace_sptr &transmissionCan = nullptr) {
     auto saveAlg = Mantid::API::AlgorithmManager::Instance().createUnmanaged(
         "SaveNXcanSAS");
     saveAlg->initialize();
@@ -472,7 +472,7 @@ private:
   }
 
   void do_assert_detector(H5::Group &instrument,
-                          std::vector<std::string> detectors) {
+                          const std::vector<std::string> &detectors) {
     for (auto &detector : detectors) {
       std::string detectorName = sasInstrumentDetectorGroupName + detector;
       auto detectorNameSanitized =
@@ -616,7 +616,7 @@ private:
   void do_assert_process_note(H5::Group &note, const bool &hasSampleRuns,
                               const bool &hasCanRuns,
                               const std::string &sampleDirectRun,
-                              const std::string canDirectRun) {
+                              const std::string &canDirectRun) {
     auto numAttributes = note.getNumAttrs();
     TSM_ASSERT_EQUALS("Should have 2 attributes", 2, numAttributes);
 
diff --git a/Framework/DataHandling/test/SaveNexusESSTest.h b/Framework/DataHandling/test/SaveNexusESSTest.h
index 969ec56471a..4bbeb8a86e7 100644
--- a/Framework/DataHandling/test/SaveNexusESSTest.h
+++ b/Framework/DataHandling/test/SaveNexusESSTest.h
@@ -33,7 +33,7 @@ using namespace Mantid::DataHandling;
 using namespace Mantid::API;
 
 namespace {
-template <typename T> void do_execute(const std::string filename, T &ws) {
+template <typename T> void do_execute(const std::string &filename, T &ws) {
   SaveNexusESS alg;
   alg.setChild(true);
   alg.setRethrows(true);
diff --git a/Framework/DataHandling/test/SaveNexusProcessedTest.h b/Framework/DataHandling/test/SaveNexusProcessedTest.h
index 955c1419f7b..44bf634212d 100644
--- a/Framework/DataHandling/test/SaveNexusProcessedTest.h
+++ b/Framework/DataHandling/test/SaveNexusProcessedTest.h
@@ -228,7 +228,7 @@ public:
    * @return
    */
   static EventWorkspace_sptr
-  do_testExec_EventWorkspaces(std::string filename_root, EventType type,
+  do_testExec_EventWorkspaces(const std::string &filename_root, EventType type,
                               std::string &outputFile, bool makeDifferentTypes,
                               bool clearfiles, bool PreserveEvents = true,
                               bool CompressNexus = false) {
diff --git a/Framework/DataHandling/test/SaveOpenGenieAsciiTest.h b/Framework/DataHandling/test/SaveOpenGenieAsciiTest.h
index f5c4a3daaee..cf19f1e0ba0 100644
--- a/Framework/DataHandling/test/SaveOpenGenieAsciiTest.h
+++ b/Framework/DataHandling/test/SaveOpenGenieAsciiTest.h
@@ -82,7 +82,7 @@ private:
   const std::string m_inputNexusFile{"SaveOpenGenieAsciiInput.nxs"};
 
   std::unique_ptr<SaveOpenGenieAscii>
-  createAlg(MatrixWorkspace_sptr ws, const std::string &tempFilePath) {
+  createAlg(const MatrixWorkspace_sptr &ws, const std::string &tempFilePath) {
     auto alg = std::make_unique<SaveOpenGenieAscii>();
     alg->initialize();
 
diff --git a/Framework/DataHandling/test/SavePDFGuiTest.h b/Framework/DataHandling/test/SavePDFGuiTest.h
index 640d806e5c5..07b5271a6b2 100644
--- a/Framework/DataHandling/test/SavePDFGuiTest.h
+++ b/Framework/DataHandling/test/SavePDFGuiTest.h
@@ -59,7 +59,7 @@ public:
     return n;
   }
 
-  bool loadWorkspace(const std::string &filename, const std::string wsName) {
+  bool loadWorkspace(const std::string &filename, const std::string &wsName) {
     LoadNexusProcessed load;
     load.initialize();
     load.setProperty("Filename", filename);
diff --git a/Framework/DataHandling/test/SaveParameterFileTest.h b/Framework/DataHandling/test/SaveParameterFileTest.h
index 503862706e6..69616ee7242 100644
--- a/Framework/DataHandling/test/SaveParameterFileTest.h
+++ b/Framework/DataHandling/test/SaveParameterFileTest.h
@@ -77,21 +77,23 @@ public:
                   "linear ; TOF ; TOF");
   }
 
-  void setParam(std::string cName, std::string pName, std::string value) {
+  void setParam(const std::string &cName, const std::string &pName,
+                const std::string &value) {
     Instrument_const_sptr inst = m_ws->getInstrument();
     ParameterMap &paramMap = m_ws->instrumentParameters();
     boost::shared_ptr<const IComponent> comp = inst->getComponentByName(cName);
     paramMap.addString(comp->getComponentID(), pName, value);
   }
 
-  void setParam(std::string cName, std::string pName, double value) {
+  void setParam(const std::string &cName, const std::string &pName,
+                double value) {
     Instrument_const_sptr inst = m_ws->getInstrument();
     ParameterMap &paramMap = m_ws->instrumentParameters();
     boost::shared_ptr<const IComponent> comp = inst->getComponentByName(cName);
     paramMap.addDouble(comp->getComponentID(), pName, value);
   }
 
-  void setParamByDetID(int id, std::string pName, double value) {
+  void setParamByDetID(int id, const std::string &pName, double value) {
     ParameterMap &paramMap = m_ws->instrumentParameters();
     const auto &detectorInfo = m_ws->detectorInfo();
     const auto detectorIndex = detectorInfo.indexOf(id);
@@ -99,7 +101,8 @@ public:
     paramMap.addDouble(detector.getComponentID(), pName, value);
   }
 
-  void setFitParam(std::string cName, std::string pName, std::string value) {
+  void setFitParam(const std::string &cName, const std::string &pName,
+                   const std::string &value) {
     Instrument_const_sptr inst = m_ws->getInstrument();
     ParameterMap &paramMap = m_ws->instrumentParameters();
     boost::shared_ptr<const IComponent> comp = inst->getComponentByName(cName);
@@ -108,7 +111,8 @@ public:
     paramMap.add(comp.get(), param);
   }
 
-  void checkParam(std::string cName, std::string pName, std::string value) {
+  void checkParam(const std::string &cName, const std::string &pName,
+                  std::string value) {
     Instrument_const_sptr inst = m_ws->getInstrument();
     ParameterMap &paramMap = m_ws->instrumentParameters();
     boost::shared_ptr<const IComponent> comp = inst->getComponentByName(cName);
@@ -116,7 +120,8 @@ public:
     TS_ASSERT_EQUALS(value, param);
   }
 
-  void checkParam(std::string cName, std::string pName, double value) {
+  void checkParam(const std::string &cName, const std::string &pName,
+                  double value) {
     Instrument_const_sptr inst = m_ws->getInstrument();
     ParameterMap &paramMap = m_ws->instrumentParameters();
     boost::shared_ptr<const IComponent> comp = inst->getComponentByName(cName);
@@ -124,7 +129,7 @@ public:
     TS_ASSERT_DELTA(value, values.front(), 0.0001);
   }
 
-  void checkParamByDetID(int id, std::string pName, double value) {
+  void checkParamByDetID(int id, const std::string &pName, double value) {
     ParameterMap &paramMap = m_ws->instrumentParameters();
     const auto &detectorInfo = m_ws->detectorInfo();
     const auto &detector = detectorInfo.detector(detectorInfo.indexOf(id));
@@ -133,7 +138,8 @@ public:
     TS_ASSERT_DELTA(value, pValue, 0.0001);
   }
 
-  void checkFitParam(std::string cName, std::string pName, std::string value) {
+  void checkFitParam(const std::string &cName, const std::string &pName,
+                     const std::string &value) {
     Instrument_const_sptr inst = m_ws->getInstrument();
     ParameterMap &paramMap = m_ws->instrumentParameters();
     boost::shared_ptr<const IComponent> comp = inst->getComponentByName(cName);
@@ -150,7 +156,7 @@ public:
     TS_ASSERT_EQUALS(fitParam.getFormulaUnit(), values[8]);
   }
 
-  void loadParams(std::string filename) {
+  void loadParams(const std::string &filename) {
     LoadParameterFile loaderPF;
     TS_ASSERT_THROWS_NOTHING(loaderPF.initialize());
     loaderPF.setPropertyValue("Filename", filename);
@@ -159,7 +165,7 @@ public:
     TS_ASSERT(loaderPF.isExecuted());
   }
 
-  void saveParams(std::string filename) {
+  void saveParams(const std::string &filename) {
     SaveParameterFile saverPF;
     TS_ASSERT_THROWS_NOTHING(saverPF.initialize());
     saverPF.setPropertyValue("Filename", filename);
diff --git a/Framework/DataHandling/test/SaveRMCProfileTest.h b/Framework/DataHandling/test/SaveRMCProfileTest.h
index 5f46b3353c1..89765159bfe 100644
--- a/Framework/DataHandling/test/SaveRMCProfileTest.h
+++ b/Framework/DataHandling/test/SaveRMCProfileTest.h
@@ -59,7 +59,7 @@ public:
     return n;
   }
 
-  bool loadWorkspace(const std::string &filename, const std::string wsName) {
+  bool loadWorkspace(const std::string &filename, const std::string &wsName) {
     LoadNexusProcessed load;
     load.initialize();
     load.setProperty("Filename", filename);
diff --git a/Framework/DataHandling/test/SetSampleTest.h b/Framework/DataHandling/test/SetSampleTest.h
index 62c3e08cf6d..8a7e80e2801 100644
--- a/Framework/DataHandling/test/SetSampleTest.h
+++ b/Framework/DataHandling/test/SetSampleTest.h
@@ -576,7 +576,8 @@ private:
       return false;
   }
 
-  void setTestReferenceFrame(Mantid::API::MatrixWorkspace_sptr workspace) {
+  void
+  setTestReferenceFrame(const Mantid::API::MatrixWorkspace_sptr &workspace) {
     using Mantid::Geometry::Instrument;
     using Mantid::Geometry::ReferenceFrame;
     // Use Z=up,Y=across,X=beam so we test it listens to the reference frame
diff --git a/Framework/DataHandling/test/SetScalingPSDTest.h b/Framework/DataHandling/test/SetScalingPSDTest.h
index 8494437615d..63db0e05938 100644
--- a/Framework/DataHandling/test/SetScalingPSDTest.h
+++ b/Framework/DataHandling/test/SetScalingPSDTest.h
@@ -128,7 +128,7 @@ public:
   }
 
 private:
-  std::string createTestScalingFile(Workspace2D_sptr testWS) {
+  std::string createTestScalingFile(const Workspace2D_sptr &testWS) {
     // NOTE: The only values read by the algorithm are the number of detectors
     // and then from each detector line
     // det no., (l2,theta,phi). All other values will be set to -1 here
diff --git a/Framework/DataObjects/inc/MantidDataObjects/AffineMatrixParameter.h b/Framework/DataObjects/inc/MantidDataObjects/AffineMatrixParameter.h
index cb12678d079..39c06e04c2c 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/AffineMatrixParameter.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/AffineMatrixParameter.h
@@ -29,7 +29,7 @@ public:
   bool isValid() const override;
   std::string toXMLString() const override;
   AffineMatrixParameter *clone() const override;
-  void setMatrix(const AffineMatrixType newMatrix);
+  void setMatrix(const AffineMatrixType &newMatrix);
   AffineMatrixParameter(size_t outD, size_t inD);
   AffineMatrixParameter(const AffineMatrixParameter &);
   AffineMatrixParameter &operator=(const AffineMatrixParameter &other);
diff --git a/Framework/DataObjects/inc/MantidDataObjects/BoxControllerNeXusIO.h b/Framework/DataObjects/inc/MantidDataObjects/BoxControllerNeXusIO.h
index 7c60f5c5bef..1832b1dda3f 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/BoxControllerNeXusIO.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/BoxControllerNeXusIO.h
@@ -129,7 +129,7 @@ private:
   // get the event type from event name
   static EventType
   TypeFromString(const std::vector<std::string> &typesSupported,
-                 const std::string typeName);
+                 const std::string &typeName);
   /// the enum, which suggests the way (currently)two possible data types are
   /// converted to each other
   enum CoordConversion {
diff --git a/Framework/DataObjects/inc/MantidDataObjects/EventList.h b/Framework/DataObjects/inc/MantidDataObjects/EventList.h
index a43e81ea0c9..f751a4e6295 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/EventList.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/EventList.h
@@ -447,7 +447,7 @@ private:
                                 const double maxX, const bool entireRange);
   template <class T>
   void convertTofHelper(std::vector<T> &events,
-                        std::function<double(double)> func);
+                        const std::function<double(double)> &func);
 
   template <class T>
   void convertTofHelper(std::vector<T> &events, const double factor,
diff --git a/Framework/DataObjects/inc/MantidDataObjects/EventWorkspaceHelpers.h b/Framework/DataObjects/inc/MantidDataObjects/EventWorkspaceHelpers.h
index b28ca1aab25..89d4c4fe1f7 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/EventWorkspaceHelpers.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/EventWorkspaceHelpers.h
@@ -20,7 +20,7 @@ namespace DataObjects {
 struct DLLExport EventWorkspaceHelpers {
   /// Converts an EventWorkspace to an equivalent Workspace2D.
   static API::MatrixWorkspace_sptr
-  convertEventTo2D(API::MatrixWorkspace_sptr inputMatrixW);
+  convertEventTo2D(const API::MatrixWorkspace_sptr &inputMatrixW);
 };
 
 } // namespace DataObjects
diff --git a/Framework/DataObjects/inc/MantidDataObjects/FakeMD.h b/Framework/DataObjects/inc/MantidDataObjects/FakeMD.h
index 7f204112964..2a3c9fdc44e 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/FakeMD.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/FakeMD.h
@@ -25,7 +25,7 @@ public:
          const std::vector<double> &peakParams, const int randomSeed,
          const bool randomizeSignal);
 
-  void fill(API::IMDEventWorkspace_sptr workspace);
+  void fill(const API::IMDEventWorkspace_sptr &workspace);
 
 private:
   void setupDetectorCache(const API::IMDEventWorkspace &workspace);
diff --git a/Framework/DataObjects/inc/MantidDataObjects/FractionalRebinning.h b/Framework/DataObjects/inc/MantidDataObjects/FractionalRebinning.h
index 266435f63a0..10f5d984973 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/FractionalRebinning.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/FractionalRebinning.h
@@ -42,8 +42,8 @@ getIntersectionRegion(const std::vector<double> &xAxis,
 
 /// Compute sqrt of errors and put back in bin width division if necessary
 MANTID_DATAOBJECTS_DLL void
-normaliseOutput(API::MatrixWorkspace_sptr outputWS,
-                API::MatrixWorkspace_const_sptr inputWS,
+normaliseOutput(const API::MatrixWorkspace_sptr &outputWS,
+                const API::MatrixWorkspace_const_sptr &inputWS,
                 API::Progress *progress = nullptr);
 
 /// Rebin the input quadrilateral to to output grid
diff --git a/Framework/DataObjects/inc/MantidDataObjects/GroupingWorkspace.h b/Framework/DataObjects/inc/MantidDataObjects/GroupingWorkspace.h
index 065866dd4bf..75c6291d901 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/GroupingWorkspace.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/GroupingWorkspace.h
@@ -25,7 +25,7 @@ namespace DataObjects {
  */
 class DLLExport GroupingWorkspace : public SpecialWorkspace2D {
 public:
-  GroupingWorkspace(Geometry::Instrument_const_sptr inst);
+  GroupingWorkspace(const Geometry::Instrument_const_sptr &inst);
   GroupingWorkspace() = default;
   GroupingWorkspace(size_t numvectors);
   GroupingWorkspace &operator=(const GroupingWorkspace &) = delete;
diff --git a/Framework/DataObjects/inc/MantidDataObjects/MDBoxFlatTree.h b/Framework/DataObjects/inc/MantidDataObjects/MDBoxFlatTree.h
index 8f7cf396a7d..3527cca7f74 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/MDBoxFlatTree.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/MDBoxFlatTree.h
@@ -47,7 +47,7 @@ public:
   //---------------------------------------------------------------------------------------------------------------------
   /// convert MDWS box structure into flat structure used for saving/loading on
   /// hdd
-  void initFlatStructure(API::IMDEventWorkspace_sptr pws,
+  void initFlatStructure(const API::IMDEventWorkspace_sptr &pws,
                          const std::string &fileName);
 
   uint64_t restoreBoxTree(std::vector<API::IMDNode *> &Boxes,
@@ -118,26 +118,28 @@ public:
   // save each experiment info into its own NeXus group within an existing
   // opened group
   static void saveExperimentInfos(::NeXus::File *const file,
-                                  API::IMDEventWorkspace_const_sptr ws);
+                                  const API::IMDEventWorkspace_const_sptr &ws);
   // load experiment infos, previously saved through the the saveExperimentInfo
   // function
-  static void
-  loadExperimentInfos(::NeXus::File *const file, const std::string &filename,
-                      boost::shared_ptr<API::MultipleExperimentInfos> mei,
-                      bool lazy = false);
+  static void loadExperimentInfos(
+      ::NeXus::File *const file, const std::string &filename,
+      const boost::shared_ptr<API::MultipleExperimentInfos> &mei,
+      bool lazy = false);
 
-  static void saveAffineTransformMatricies(::NeXus::File *const file,
-                                           API::IMDWorkspace_const_sptr ws);
+  static void
+  saveAffineTransformMatricies(::NeXus::File *const file,
+                               const API::IMDWorkspace_const_sptr &ws);
   static void saveAffineTransformMatrix(::NeXus::File *const file,
                                         API::CoordTransform const *transform,
-                                        std::string entry_name);
+                                        const std::string &entry_name);
 
   static void saveWSGenericInfo(::NeXus::File *const file,
-                                API::IMDWorkspace_const_sptr ws);
+                                const API::IMDWorkspace_const_sptr &ws);
 };
 
 template <typename T>
-void saveMatrix(::NeXus::File *const file, std::string name,
-                Kernel::Matrix<T> &m, ::NeXus::NXnumtype type, std::string tag);
+void saveMatrix(::NeXus::File *const file, const std::string &name,
+                Kernel::Matrix<T> &m, ::NeXus::NXnumtype type,
+                const std::string &tag);
 } // namespace DataObjects
 } // namespace Mantid
\ No newline at end of file
diff --git a/Framework/DataObjects/inc/MantidDataObjects/MDFramesToSpecialCoordinateSystem.h b/Framework/DataObjects/inc/MantidDataObjects/MDFramesToSpecialCoordinateSystem.h
index 813ae7a9d2d..c6e9884b53d 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/MDFramesToSpecialCoordinateSystem.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/MDFramesToSpecialCoordinateSystem.h
@@ -27,8 +27,8 @@ private:
       Mantid::Kernel::SpecialCoordinateSystem specialCoordinateSystem,
       boost::optional<Mantid::Kernel::SpecialCoordinateSystem> qFrameType)
       const;
-  bool
-  isUnknownFrame(Mantid::Geometry::IMDDimension_const_sptr dimension) const;
+  bool isUnknownFrame(
+      const Mantid::Geometry::IMDDimension_const_sptr &dimension) const;
 };
 
 } // namespace DataObjects
diff --git a/Framework/DataObjects/inc/MantidDataObjects/MDHistoWorkspace.h b/Framework/DataObjects/inc/MantidDataObjects/MDHistoWorkspace.h
index 6d46b5ea36f..4271118b885 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/MDHistoWorkspace.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/MDHistoWorkspace.h
@@ -91,7 +91,8 @@ public:
                        const Mantid::Kernel::VMD &end,
                        Mantid::API::MDNormalization normalize) const override;
 
-  void checkWorkspaceSize(const MDHistoWorkspace &other, std::string operation);
+  void checkWorkspaceSize(const MDHistoWorkspace &other,
+                          const std::string &operation);
 
   // --------------------------------------------------------------------------------------------
   MDHistoWorkspace &operator+=(const MDHistoWorkspace &b);
diff --git a/Framework/DataObjects/inc/MantidDataObjects/MDHistoWorkspaceIterator.h b/Framework/DataObjects/inc/MantidDataObjects/MDHistoWorkspaceIterator.h
index ff5dab5ccea..6b0bd4ee5de 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/MDHistoWorkspaceIterator.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/MDHistoWorkspaceIterator.h
@@ -38,7 +38,8 @@ using VecMDExtents = std::vector<MDExtentPair>;
 class DLLExport MDHistoWorkspaceIterator : public Mantid::API::IMDIterator {
 public:
   MDHistoWorkspaceIterator(
-      MDHistoWorkspace_const_sptr workspace, SkippingPolicy *skippingPolicy,
+      const MDHistoWorkspace_const_sptr &workspace,
+      SkippingPolicy *skippingPolicy,
       Mantid::Geometry::MDImplicitFunction *function = nullptr,
       size_t beginPos = 0, size_t endPos = size_t(-1));
   MDHistoWorkspaceIterator(
@@ -46,7 +47,7 @@ public:
       Mantid::Geometry::MDImplicitFunction *function = nullptr,
       size_t beginPos = 0, size_t endPos = size_t(-1));
   MDHistoWorkspaceIterator(
-      MDHistoWorkspace_const_sptr workspace,
+      const MDHistoWorkspace_const_sptr &workspace,
       Mantid::Geometry::MDImplicitFunction *function = nullptr,
       size_t beginPos = 0, size_t endPos = size_t(-1));
   MDHistoWorkspaceIterator(
diff --git a/Framework/DataObjects/inc/MantidDataObjects/MaskWorkspace.h b/Framework/DataObjects/inc/MantidDataObjects/MaskWorkspace.h
index 001d798283b..590f0f050c5 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/MaskWorkspace.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/MaskWorkspace.h
@@ -20,9 +20,9 @@ class DLLExport MaskWorkspace : public SpecialWorkspace2D,
 public:
   MaskWorkspace() = default;
   MaskWorkspace(std::size_t numvectors);
-  MaskWorkspace(Mantid::Geometry::Instrument_const_sptr instrument,
+  MaskWorkspace(const Mantid::Geometry::Instrument_const_sptr &instrument,
                 const bool includeMonitors = false);
-  MaskWorkspace(const API::MatrixWorkspace_const_sptr parent);
+  MaskWorkspace(const API::MatrixWorkspace_const_sptr &parent);
 
   /// Returns a clone of the workspace
   std::unique_ptr<MaskWorkspace> clone() const {
diff --git a/Framework/DataObjects/inc/MantidDataObjects/MementoTableWorkspace.h b/Framework/DataObjects/inc/MantidDataObjects/MementoTableWorkspace.h
index 081f2361573..cc57d2f8a04 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/MementoTableWorkspace.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/MementoTableWorkspace.h
@@ -48,8 +48,8 @@ private:
     return new MementoTableWorkspace();
   }
 
-  static bool expectedColumn(Mantid::API::Column_const_sptr expected,
-                             Mantid::API::Column_const_sptr candidate);
+  static bool expectedColumn(const Mantid::API::Column_const_sptr &expected,
+                             const Mantid::API::Column_const_sptr &candidate);
 };
 } // namespace DataObjects
 } // namespace Mantid
diff --git a/Framework/DataObjects/inc/MantidDataObjects/OffsetsWorkspace.h b/Framework/DataObjects/inc/MantidDataObjects/OffsetsWorkspace.h
index 26094b9a5e8..9e6418697e9 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/OffsetsWorkspace.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/OffsetsWorkspace.h
@@ -24,7 +24,7 @@ namespace DataObjects {
 class DLLExport OffsetsWorkspace : public SpecialWorkspace2D {
 public:
   OffsetsWorkspace() = default;
-  OffsetsWorkspace(Geometry::Instrument_const_sptr inst);
+  OffsetsWorkspace(const Geometry::Instrument_const_sptr &inst);
 
   /// Returns a clone of the workspace
   std::unique_ptr<OffsetsWorkspace> clone() const {
diff --git a/Framework/DataObjects/inc/MantidDataObjects/ReflectometryTransform.h b/Framework/DataObjects/inc/MantidDataObjects/ReflectometryTransform.h
index fd2eb58b025..5a80a5b485e 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/ReflectometryTransform.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/ReflectometryTransform.h
@@ -58,29 +58,30 @@ protected:
   mutable std::vector<double> m_thetaWidths;
 
   boost::shared_ptr<DataObjects::MDEventWorkspace2Lean>
-  createMDWorkspace(Geometry::IMDDimension_sptr, Geometry::IMDDimension_sptr,
-                    API::BoxController_sptr boxController) const;
+  createMDWorkspace(const Geometry::IMDDimension_sptr &,
+                    const Geometry::IMDDimension_sptr &,
+                    const API::BoxController_sptr &boxController) const;
 
 public:
   // Execute the strategy to produce a transformed, output MDWorkspace
   Mantid::API::IMDEventWorkspace_sptr
-  executeMD(Mantid::API::MatrixWorkspace_const_sptr inputWs,
-            Mantid::API::BoxController_sptr boxController,
+  executeMD(const Mantid::API::MatrixWorkspace_const_sptr &inputWs,
+            const Mantid::API::BoxController_sptr &boxController,
             Mantid::Geometry::MDFrame_uptr frame) const;
 
   // Execute the strategy to produce a transformed, output group of Matrix (2D)
   // Workspaces
   Mantid::API::MatrixWorkspace_sptr
-  execute(Mantid::API::MatrixWorkspace_const_sptr inputWs) const;
+  execute(const Mantid::API::MatrixWorkspace_const_sptr &inputWs) const;
 
   /// Execuate transformation using normalised polynomial binning
   Mantid::API::MatrixWorkspace_sptr executeNormPoly(
       const Mantid::API::MatrixWorkspace_const_sptr &inputWS,
       boost::shared_ptr<Mantid::DataObjects::TableWorkspace> &vertexes,
-      bool dumpVertexes, std::string outputDimensions) const;
+      bool dumpVertexes, const std::string &outputDimensions) const;
 
-  Mantid::API::IMDHistoWorkspace_sptr
-  executeMDNormPoly(Mantid::API::MatrixWorkspace_const_sptr inputWs) const;
+  Mantid::API::IMDHistoWorkspace_sptr executeMDNormPoly(
+      const Mantid::API::MatrixWorkspace_const_sptr &inputWs) const;
   virtual ~ReflectometryTransform() = default;
   ReflectometryTransform(const std::string &d0Label, const std::string &d0ID,
                          double d0Min, double d0Max, const std::string &d1Label,
diff --git a/Framework/DataObjects/inc/MantidDataObjects/SpecialWorkspace2D.h b/Framework/DataObjects/inc/MantidDataObjects/SpecialWorkspace2D.h
index 511f05d599a..a27600d5cd9 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/SpecialWorkspace2D.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/SpecialWorkspace2D.h
@@ -31,9 +31,9 @@ public:
 class DLLExport SpecialWorkspace2D : public Workspace2D {
 public:
   SpecialWorkspace2D() = default;
-  SpecialWorkspace2D(Geometry::Instrument_const_sptr inst,
+  SpecialWorkspace2D(const Geometry::Instrument_const_sptr &inst,
                      const bool includeMonitors = false);
-  SpecialWorkspace2D(API::MatrixWorkspace_const_sptr parent);
+  SpecialWorkspace2D(const API::MatrixWorkspace_const_sptr &parent);
 
   /// Returns a clone of the workspace
   std::unique_ptr<SpecialWorkspace2D> clone() const {
@@ -73,7 +73,7 @@ private:
   SpecialWorkspace2D *doCloneEmpty() const override {
     return new SpecialWorkspace2D();
   }
-  bool isCompatible(boost::shared_ptr<const SpecialWorkspace2D> ws);
+  bool isCompatible(const boost::shared_ptr<const SpecialWorkspace2D> &ws);
 
 protected:
   /// Protected copy constructor. May be used by childs for cloning.
@@ -86,9 +86,9 @@ protected:
   /// Return human-readable string
   const std::string toString() const override;
 
-  void binaryAND(boost::shared_ptr<const SpecialWorkspace2D> ws);
-  void binaryOR(boost::shared_ptr<const SpecialWorkspace2D> ws);
-  void binaryXOR(boost::shared_ptr<const SpecialWorkspace2D> ws);
+  void binaryAND(const boost::shared_ptr<const SpecialWorkspace2D> &ws);
+  void binaryOR(const boost::shared_ptr<const SpecialWorkspace2D> &ws);
+  void binaryXOR(const boost::shared_ptr<const SpecialWorkspace2D> &ws);
   void binaryNOT();
 
   /// Map with key = detector ID, and value = workspace index.
diff --git a/Framework/DataObjects/inc/MantidDataObjects/TableColumn.h b/Framework/DataObjects/inc/MantidDataObjects/TableColumn.h
index 212b83118e4..3a9ab904250 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/TableColumn.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/TableColumn.h
@@ -556,7 +556,7 @@ public:
   /** Constructor
       @param c :: Shared pointer to a column
     */
-  TableColumn_ptr(boost::shared_ptr<API::Column> c)
+  TableColumn_ptr(const boost::shared_ptr<API::Column> &c)
       : TableColumn_ptr<API::Boolean>(c) {
     if (!this->get()) {
       std::string str = "Data type of column " + c->name() +
diff --git a/Framework/DataObjects/inc/MantidDataObjects/TableWorkspace.h b/Framework/DataObjects/inc/MantidDataObjects/TableWorkspace.h
index 0298ac46efd..026ccd6688f 100644
--- a/Framework/DataObjects/inc/MantidDataObjects/TableWorkspace.h
+++ b/Framework/DataObjects/inc/MantidDataObjects/TableWorkspace.h
@@ -17,6 +17,21 @@
 #include "MantidKernel/V3D.h"
 #include <boost/shared_ptr.hpp>
 #include <boost/tuple/tuple.hpp>
+#include <utility>
+
+#include <utility>
+
+#include <utility>
+
+#include <utility>
+
+#include <utility>
+
+#include <utility>
+
+#include <utility>
+
+#include <utility>
 
 namespace Mantid {
 
@@ -321,7 +336,7 @@ private:
     }
   }
 
-  void addColumn(boost::shared_ptr<API::Column> column);
+  void addColumn(const boost::shared_ptr<API::Column> &column);
 
   /** This method finds the row and column index of an integer cell value in a
    * table workspace
@@ -339,7 +354,9 @@ private:
    * @param  col  column number of the value searched
    */
   virtual void find(std::string value, size_t &row, size_t &col) {
-    findValue(value, row, col);
+    findValue(std::move(std::move(std::move(std::move(
+                  std::move(std::move(std::move(std::move(value)))))))),
+              row, col);
   }
   /** This method finds the row and column index of an float value in a table
    * workspace
diff --git a/Framework/DataObjects/src/AffineMatrixParameter.cpp b/Framework/DataObjects/src/AffineMatrixParameter.cpp
index a4d7c95a066..5cc5b9c7b5c 100644
--- a/Framework/DataObjects/src/AffineMatrixParameter.cpp
+++ b/Framework/DataObjects/src/AffineMatrixParameter.cpp
@@ -162,7 +162,7 @@ AffineMatrixParameter::AffineMatrixParameter(const AffineMatrixParameter &other)
  *
  * @param newMatrix : new matrix to use.
  */
-void AffineMatrixParameter::setMatrix(const AffineMatrixType newMatrix) {
+void AffineMatrixParameter::setMatrix(const AffineMatrixType &newMatrix) {
   if (newMatrix.numRows() != this->m_affineMatrix.numRows())
     throw std::runtime_error("setMatrix(): Number of rows must match!");
   if (newMatrix.numCols() != this->m_affineMatrix.numCols())
diff --git a/Framework/DataObjects/src/BoxControllerNeXusIO.cpp b/Framework/DataObjects/src/BoxControllerNeXusIO.cpp
index aec923188e3..25d6f75416e 100644
--- a/Framework/DataObjects/src/BoxControllerNeXusIO.cpp
+++ b/Framework/DataObjects/src/BoxControllerNeXusIO.cpp
@@ -48,7 +48,7 @@ BoxControllerNeXusIO::BoxControllerNeXusIO(API::BoxController *const bc)
 /**get event type form its string representation*/
 BoxControllerNeXusIO::EventType BoxControllerNeXusIO::TypeFromString(
     const std::vector<std::string> &typesSupported,
-    const std::string typeName) {
+    const std::string &typeName) {
   auto it = std::find(typesSupported.begin(), typesSupported.end(), typeName);
   if (it == typesSupported.end())
     throw std::invalid_argument("Unsupported event type: " + typeName +
diff --git a/Framework/DataObjects/src/EventList.cpp b/Framework/DataObjects/src/EventList.cpp
index 8cbaf1a19d1..918f0d08e84 100644
--- a/Framework/DataObjects/src/EventList.cpp
+++ b/Framework/DataObjects/src/EventList.cpp
@@ -2555,7 +2555,7 @@ void EventList::convertTof(std::function<double(double)> func,
  */
 template <class T>
 void EventList::convertTofHelper(std::vector<T> &events,
-                                 std::function<double(double)> func) {
+                                 const std::function<double(double)> &func) {
   // iterate through all events
   for (auto &ev : events)
     ev.m_tof = func(ev.m_tof);
diff --git a/Framework/DataObjects/src/EventWorkspaceHelpers.cpp b/Framework/DataObjects/src/EventWorkspaceHelpers.cpp
index 54ebeea522d..edcc382d398 100644
--- a/Framework/DataObjects/src/EventWorkspaceHelpers.cpp
+++ b/Framework/DataObjects/src/EventWorkspaceHelpers.cpp
@@ -20,8 +20,8 @@ namespace DataObjects {
  * @param inputMatrixW :: input event workspace
  * @return a MatrixWorkspace_sptr
  */
-MatrixWorkspace_sptr
-EventWorkspaceHelpers::convertEventTo2D(MatrixWorkspace_sptr inputMatrixW) {
+MatrixWorkspace_sptr EventWorkspaceHelpers::convertEventTo2D(
+    const MatrixWorkspace_sptr &inputMatrixW) {
   EventWorkspace_sptr inputW =
       boost::dynamic_pointer_cast<EventWorkspace>(inputMatrixW);
   if (!inputW)
diff --git a/Framework/DataObjects/src/FakeMD.cpp b/Framework/DataObjects/src/FakeMD.cpp
index a47360524f4..bd3ffa4ae22 100644
--- a/Framework/DataObjects/src/FakeMD.cpp
+++ b/Framework/DataObjects/src/FakeMD.cpp
@@ -49,7 +49,7 @@ FakeMD::FakeMD(const std::vector<double> &uniformParams,
  * @param workspace A pointer to MD event workspace to fill using the object
  * parameters
  */
-void FakeMD::fill(API::IMDEventWorkspace_sptr workspace) {
+void FakeMD::fill(const API::IMDEventWorkspace_sptr &workspace) {
   setupDetectorCache(*workspace);
 
   CALL_MDEVENT_FUNCTION(this->addFakePeak, workspace)
diff --git a/Framework/DataObjects/src/FractionalRebinning.cpp b/Framework/DataObjects/src/FractionalRebinning.cpp
index f2b3a3057f1..0b5aee3aec7 100644
--- a/Framework/DataObjects/src/FractionalRebinning.cpp
+++ b/Framework/DataObjects/src/FractionalRebinning.cpp
@@ -495,8 +495,9 @@ void calcGeneralIntersections(const std::vector<double> &xAxis,
  * @param inputWS The input workspace used for testing distribution state
  * @param progress An optional progress object. Reported to once per bin.
  */
-void normaliseOutput(MatrixWorkspace_sptr outputWS,
-                     MatrixWorkspace_const_sptr inputWS, Progress *progress) {
+void normaliseOutput(const MatrixWorkspace_sptr &outputWS,
+                     const MatrixWorkspace_const_sptr &inputWS,
+                     Progress *progress) {
   const bool removeBinWidth(inputWS->isDistribution() &&
                             outputWS->id() != "RebinnedOutput");
   for (size_t i = 0; i < outputWS->getNumberHistograms(); ++i) {
diff --git a/Framework/DataObjects/src/GroupingWorkspace.cpp b/Framework/DataObjects/src/GroupingWorkspace.cpp
index 872c9b182cd..ee76a32caaa 100644
--- a/Framework/DataObjects/src/GroupingWorkspace.cpp
+++ b/Framework/DataObjects/src/GroupingWorkspace.cpp
@@ -4,9 +4,11 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidDataObjects/GroupingWorkspace.h"
+#include <utility>
+
 #include "MantidAPI/SpectraAxis.h"
 #include "MantidAPI/WorkspaceFactory.h"
+#include "MantidDataObjects/GroupingWorkspace.h"
 #include "MantidKernel/IPropertyManager.h"
 #include "MantidKernel/System.h"
 
@@ -33,8 +35,9 @@ GroupingWorkspace::GroupingWorkspace(size_t numvectors) {
  * @param inst :: input instrument that is the base for this workspace
  * @return created GroupingWorkspace
  */
-GroupingWorkspace::GroupingWorkspace(Geometry::Instrument_const_sptr inst)
-    : SpecialWorkspace2D(inst) {}
+GroupingWorkspace::GroupingWorkspace(
+    const Geometry::Instrument_const_sptr &inst)
+    : SpecialWorkspace2D(std::move(inst)) {}
 
 //----------------------------------------------------------------------------------------------
 /** Fill a map with key = detector ID, value = group number
diff --git a/Framework/DataObjects/src/MDBoxFlatTree.cpp b/Framework/DataObjects/src/MDBoxFlatTree.cpp
index 06520cb314c..7984ef15c55 100644
--- a/Framework/DataObjects/src/MDBoxFlatTree.cpp
+++ b/Framework/DataObjects/src/MDBoxFlatTree.cpp
@@ -14,6 +14,8 @@
 #include "MantidKernel/Strings.h"
 #include <Poco/File.h>
 
+#include <utility>
+
 using file_holder_type = std::unique_ptr<::NeXus::File>;
 
 namespace Mantid {
@@ -33,7 +35,7 @@ MDBoxFlatTree::MDBoxFlatTree() : m_nDim(-1) {}
  * @param fileName -- the name of the file, where this structure should be
  *written. TODO: It is here for the case of file based workspaces
  */
-void MDBoxFlatTree::initFlatStructure(API::IMDEventWorkspace_sptr pws,
+void MDBoxFlatTree::initFlatStructure(const API::IMDEventWorkspace_sptr &pws,
                                       const std::string &fileName) {
   m_bcXMLDescr = pws->getBoxController()->toXMLString();
   m_FileName = fileName;
@@ -353,8 +355,8 @@ void MDBoxFlatTree::loadBoxStructure(::NeXus::File *hFile, bool onlyEventInfo) {
  *@param ws   -- the shared pointer to the workspace with experiment infos to
  *write.
  */
-void MDBoxFlatTree::saveExperimentInfos(::NeXus::File *const file,
-                                        API::IMDEventWorkspace_const_sptr ws) {
+void MDBoxFlatTree::saveExperimentInfos(
+    ::NeXus::File *const file, const API::IMDEventWorkspace_const_sptr &ws) {
 
   std::map<std::string, std::string> entries;
   file->getEntries(entries);
@@ -406,7 +408,8 @@ void MDBoxFlatTree::saveExperimentInfos(::NeXus::File *const file,
  */
 void MDBoxFlatTree::loadExperimentInfos(
     ::NeXus::File *const file, const std::string &filename,
-    boost::shared_ptr<Mantid::API::MultipleExperimentInfos> mei, bool lazy) {
+    const boost::shared_ptr<Mantid::API::MultipleExperimentInfos> &mei,
+    bool lazy) {
   // First, find how many experimentX blocks there are
   std::map<std::string, std::string> entries;
   file->getEntries(entries);
@@ -748,7 +751,7 @@ MDBoxFlatTree::createOrOpenMDWSgroup(const std::string &fileName, int &nDims,
 /**Save workspace generic info like dimension structure, history, title
  * dimensions etc.*/
 void MDBoxFlatTree::saveWSGenericInfo(::NeXus::File *const file,
-                                      API::IMDWorkspace_const_sptr ws) {
+                                      const API::IMDWorkspace_const_sptr &ws) {
   // Write out the coordinate system
   file->writeData("coordinate_system",
                   static_cast<uint32_t>(ws->getSpecialCoordinateSystem()));
@@ -794,7 +797,7 @@ void MDBoxFlatTree::saveWSGenericInfo(::NeXus::File *const file,
  * @param ws : workspace to get matrix from
  */
 void MDBoxFlatTree::saveAffineTransformMatricies(
-    ::NeXus::File *const file, API::IMDWorkspace_const_sptr ws) {
+    ::NeXus::File *const file, const API::IMDWorkspace_const_sptr &ws) {
   try {
     saveAffineTransformMatrix(file, ws->getTransformToOriginal(),
                               "transform_to_orig");
@@ -816,12 +819,12 @@ void MDBoxFlatTree::saveAffineTransformMatricies(
  */
 void MDBoxFlatTree::saveAffineTransformMatrix(
     ::NeXus::File *const file, API::CoordTransform const *transform,
-    std::string entry_name) {
+    const std::string &entry_name) {
   if (!transform)
     return;
   Kernel::Matrix<coord_t> matrix = transform->makeAffineMatrix();
   g_log.debug() << "TRFM: " << matrix.str() << '\n';
-  saveMatrix<coord_t>(file, entry_name, matrix, ::NeXus::FLOAT32,
+  saveMatrix<coord_t>(file, std::move(entry_name), matrix, ::NeXus::FLOAT32,
                       transform->id());
 }
 
@@ -834,9 +837,9 @@ void MDBoxFlatTree::saveAffineTransformMatrix(
  * @param tag : id for an affine matrix conversion
  */
 template <typename T>
-void saveMatrix(::NeXus::File *const file, std::string name,
+void saveMatrix(::NeXus::File *const file, const std::string &name,
                 Kernel::Matrix<T> &m, ::NeXus::NXnumtype type,
-                std::string tag) {
+                const std::string &tag) {
   std::vector<T> v = m.getVector();
   // Number of data points
   auto nPoints = static_cast<int>(v.size());
diff --git a/Framework/DataObjects/src/MDFramesToSpecialCoordinateSystem.cpp b/Framework/DataObjects/src/MDFramesToSpecialCoordinateSystem.cpp
index 397258fde75..2f1fd3fe91c 100644
--- a/Framework/DataObjects/src/MDFramesToSpecialCoordinateSystem.cpp
+++ b/Framework/DataObjects/src/MDFramesToSpecialCoordinateSystem.cpp
@@ -92,7 +92,7 @@ void MDFramesToSpecialCoordinateSystem::checkQCompatibility(
  * @returns true if the MDFrame is of UnknownFrame type.
  */
 bool MDFramesToSpecialCoordinateSystem::isUnknownFrame(
-    Mantid::Geometry::IMDDimension_const_sptr dimension) const {
+    const Mantid::Geometry::IMDDimension_const_sptr &dimension) const {
   Mantid::Geometry::MDFrame_uptr replica(dimension->getMDFrame().clone());
   auto isUnknown = false;
   if (dynamic_cast<Mantid::Geometry::UnknownFrame *>(replica.get())) {
diff --git a/Framework/DataObjects/src/MDHistoWorkspace.cpp b/Framework/DataObjects/src/MDHistoWorkspace.cpp
index 847ab87165e..b26d2cae3ff 100644
--- a/Framework/DataObjects/src/MDHistoWorkspace.cpp
+++ b/Framework/DataObjects/src/MDHistoWorkspace.cpp
@@ -737,7 +737,7 @@ MDHistoWorkspace::getBinBoundariesOnLine(const VMD &start, const VMD &end,
  * @throw an error if they don't match
  */
 void MDHistoWorkspace::checkWorkspaceSize(const MDHistoWorkspace &other,
-                                          std::string operation) {
+                                          const std::string &operation) {
   if (other.getNumDims() != this->getNumDims())
     throw std::invalid_argument("Cannot perform the " + operation +
                                 " operation on this MDHistoWorkspace. The "
diff --git a/Framework/DataObjects/src/MDHistoWorkspaceIterator.cpp b/Framework/DataObjects/src/MDHistoWorkspaceIterator.cpp
index 43f529b3fee..d93a52bb004 100644
--- a/Framework/DataObjects/src/MDHistoWorkspaceIterator.cpp
+++ b/Framework/DataObjects/src/MDHistoWorkspaceIterator.cpp
@@ -90,7 +90,7 @@ namespace DataObjects {
  * @param endPos :: end position
  */
 MDHistoWorkspaceIterator::MDHistoWorkspaceIterator(
-    MDHistoWorkspace_const_sptr workspace,
+    const MDHistoWorkspace_const_sptr &workspace,
     Mantid::Geometry::MDImplicitFunction *function, size_t beginPos,
     size_t endPos)
     : m_skippingPolicy(new SkipMaskedBins(this)) {
@@ -123,7 +123,8 @@ MDHistoWorkspaceIterator::MDHistoWorkspaceIterator(
  * @param endPos :: End position
  */
 MDHistoWorkspaceIterator::MDHistoWorkspaceIterator(
-    MDHistoWorkspace_const_sptr workspace, SkippingPolicy *skippingPolicy,
+    const MDHistoWorkspace_const_sptr &workspace,
+    SkippingPolicy *skippingPolicy,
     Mantid::Geometry::MDImplicitFunction *function, size_t beginPos,
     size_t endPos)
     : m_skippingPolicy(skippingPolicy) {
diff --git a/Framework/DataObjects/src/MaskWorkspace.cpp b/Framework/DataObjects/src/MaskWorkspace.cpp
index d2a3828e70a..07944ba1797 100644
--- a/Framework/DataObjects/src/MaskWorkspace.cpp
+++ b/Framework/DataObjects/src/MaskWorkspace.cpp
@@ -4,8 +4,10 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidDataObjects/MaskWorkspace.h"
+#include <utility>
+
 #include "MantidAPI/WorkspaceFactory.h"
+#include "MantidDataObjects/MaskWorkspace.h"
 #include "MantidGeometry/Instrument/DetectorInfo.h"
 #include "MantidKernel/IPropertyManager.h"
 #include "MantidKernel/System.h"
@@ -51,9 +53,10 @@ MaskWorkspace::MaskWorkspace(std::size_t numvectors) {
  * workspace.
  * @return MaskWorkspace
  */
-MaskWorkspace::MaskWorkspace(Mantid::Geometry::Instrument_const_sptr instrument,
-                             const bool includeMonitors)
-    : SpecialWorkspace2D(instrument, includeMonitors) {
+MaskWorkspace::MaskWorkspace(
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
+    const bool includeMonitors)
+    : SpecialWorkspace2D(std::move(instrument), includeMonitors) {
   this->clearMask();
 }
 
@@ -63,7 +66,7 @@ MaskWorkspace::MaskWorkspace(Mantid::Geometry::Instrument_const_sptr instrument,
  * It must have an instrument.
  * @return MaskWorkspace
  */
-MaskWorkspace::MaskWorkspace(const API::MatrixWorkspace_const_sptr parent)
+MaskWorkspace::MaskWorkspace(const API::MatrixWorkspace_const_sptr &parent)
     : SpecialWorkspace2D(parent) {
   this->clearMask();
 }
diff --git a/Framework/DataObjects/src/MementoTableWorkspace.cpp b/Framework/DataObjects/src/MementoTableWorkspace.cpp
index 6340f564daa..432172802da 100644
--- a/Framework/DataObjects/src/MementoTableWorkspace.cpp
+++ b/Framework/DataObjects/src/MementoTableWorkspace.cpp
@@ -22,8 +22,8 @@ Determines whether the provided column has the same name and type as expected.
 @return true if all expectations are met.
 */
 bool MementoTableWorkspace::expectedColumn(
-    Mantid::API::Column_const_sptr expected,
-    Mantid::API::Column_const_sptr candidate) {
+    const Mantid::API::Column_const_sptr &expected,
+    const Mantid::API::Column_const_sptr &candidate) {
   if (expected->name() != candidate->name()) {
     return false;
   } else if (expected->type() != candidate->type()) {
diff --git a/Framework/DataObjects/src/OffsetsWorkspace.cpp b/Framework/DataObjects/src/OffsetsWorkspace.cpp
index 59ce2330783..c053f57c95e 100644
--- a/Framework/DataObjects/src/OffsetsWorkspace.cpp
+++ b/Framework/DataObjects/src/OffsetsWorkspace.cpp
@@ -4,9 +4,11 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidDataObjects/OffsetsWorkspace.h"
+#include <utility>
+
 #include "MantidAPI/SpectraAxis.h"
 #include "MantidAPI/WorkspaceFactory.h"
+#include "MantidDataObjects/OffsetsWorkspace.h"
 #include "MantidKernel/IPropertyManager.h"
 #include "MantidKernel/System.h"
 
@@ -21,8 +23,8 @@ DECLARE_WORKSPACE(OffsetsWorkspace)
  * @param inst :: input instrument that is the base for this workspace
  * @return created OffsetsWorkspace
  */
-OffsetsWorkspace::OffsetsWorkspace(Geometry::Instrument_const_sptr inst)
-    : SpecialWorkspace2D(inst) {}
+OffsetsWorkspace::OffsetsWorkspace(const Geometry::Instrument_const_sptr &inst)
+    : SpecialWorkspace2D(std::move(inst)) {}
 
 } // namespace DataObjects
 } // namespace Mantid
diff --git a/Framework/DataObjects/src/Peak.cpp b/Framework/DataObjects/src/Peak.cpp
index 26a71c49d41..a4829a2c3c9 100644
--- a/Framework/DataObjects/src/Peak.cpp
+++ b/Framework/DataObjects/src/Peak.cpp
@@ -20,6 +20,7 @@
 #include <algorithm>
 #include <cctype>
 #include <string>
+#include <utility>
 
 using namespace Mantid;
 using namespace Mantid::Kernel;
@@ -60,7 +61,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst,
       m_peakShape(boost::make_shared<NoShape>()) {
   convention = Kernel::ConfigService::Instance().getString("Q.convention");
   this->setInstrument(m_inst);
-  this->setQLabFrame(QLabFrame, detectorDistance);
+  this->setQLabFrame(QLabFrame, std::move(detectorDistance));
 }
 
 //----------------------------------------------------------------------------------------------
@@ -90,7 +91,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst,
     throw std::invalid_argument(
         "Peak::ctor(): Goniometer matrix must non-singular.");
   this->setInstrument(m_inst);
-  this->setQSampleFrame(QSampleFrame, detectorDistance);
+  this->setQSampleFrame(QSampleFrame, std::move(detectorDistance));
 }
 
 //----------------------------------------------------------------------------------------------
@@ -779,7 +780,7 @@ void Peak::setL(double m_L) { this->m_L = m_L; }
 /** Set the BankName of this peak
  * @param m_bankName :: index to set   */
 void Peak::setBankName(std::string m_bankName) {
-  this->m_bankName = m_bankName;
+  this->m_bankName = std::move(m_bankName);
 }
 
 /** Set all three H,K,L indices of the peak */
diff --git a/Framework/DataObjects/src/PeakShapeBase.cpp b/Framework/DataObjects/src/PeakShapeBase.cpp
index d70e2601c62..8845e3b7d64 100644
--- a/Framework/DataObjects/src/PeakShapeBase.cpp
+++ b/Framework/DataObjects/src/PeakShapeBase.cpp
@@ -8,12 +8,14 @@
 #include "MantidKernel/SpecialCoordinateSystem.h"
 #include <json/json.h>
 
+#include <utility>
+
 namespace Mantid {
 namespace DataObjects {
 
 PeakShapeBase::PeakShapeBase(Kernel::SpecialCoordinateSystem frame,
                              std::string algorithmName, int algorithmVersion)
-    : m_frame(frame), m_algorithmName(algorithmName),
+    : m_frame(frame), m_algorithmName(std::move(algorithmName)),
       m_algorithmVersion(algorithmVersion) {}
 
 /**
diff --git a/Framework/DataObjects/src/PeakShapeEllipsoid.cpp b/Framework/DataObjects/src/PeakShapeEllipsoid.cpp
index 08dadf5172e..07ece5fe3cc 100644
--- a/Framework/DataObjects/src/PeakShapeEllipsoid.cpp
+++ b/Framework/DataObjects/src/PeakShapeEllipsoid.cpp
@@ -8,6 +8,8 @@
 #include "MantidKernel/cow_ptr.h"
 #include <json/json.h>
 
+#include <utility>
+
 namespace Mantid {
 namespace DataObjects {
 
@@ -18,7 +20,7 @@ PeakShapeEllipsoid::PeakShapeEllipsoid(
     const std::vector<double> &abcRadiiBackgroundOuter,
     Kernel::SpecialCoordinateSystem frame, std::string algorithmName,
     int algorithmVersion)
-    : PeakShapeBase(frame, algorithmName, algorithmVersion),
+    : PeakShapeBase(frame, std::move(algorithmName), algorithmVersion),
       m_directions(directions), m_abc_radii(abcRadii),
       m_abc_radiiBackgroundInner(abcRadiiBackgroundInner),
       m_abc_radiiBackgroundOuter(abcRadiiBackgroundOuter) {
diff --git a/Framework/DataObjects/src/PeakShapeSpherical.cpp b/Framework/DataObjects/src/PeakShapeSpherical.cpp
index b8c0b52801c..b8181457580 100644
--- a/Framework/DataObjects/src/PeakShapeSpherical.cpp
+++ b/Framework/DataObjects/src/PeakShapeSpherical.cpp
@@ -7,6 +7,7 @@
 #include "MantidDataObjects/PeakShapeSpherical.h"
 #include <json/json.h>
 #include <stdexcept>
+#include <utility>
 
 namespace Mantid {
 namespace DataObjects {
@@ -22,7 +23,7 @@ PeakShapeSpherical::PeakShapeSpherical(const double &peakRadius,
                                        Kernel::SpecialCoordinateSystem frame,
                                        std::string algorithmName,
                                        int algorithmVersion)
-    : PeakShapeBase(frame, algorithmName, algorithmVersion),
+    : PeakShapeBase(frame, std::move(algorithmName), algorithmVersion),
       m_radius(peakRadius) {}
 
 /**
@@ -40,7 +41,7 @@ PeakShapeSpherical::PeakShapeSpherical(const double &peakRadius,
                                        Kernel::SpecialCoordinateSystem frame,
                                        std::string algorithmName,
                                        int algorithmVersion)
-    : PeakShapeBase(frame, algorithmName, algorithmVersion),
+    : PeakShapeBase(frame, std::move(algorithmName), algorithmVersion),
       m_radius(peakRadius), m_backgroundInnerRadius(peakInnerRadius),
       m_backgroundOuterRadius(peakOuterRadius) {
   if (peakRadius == m_backgroundInnerRadius) {
diff --git a/Framework/DataObjects/src/ReflectometryTransform.cpp b/Framework/DataObjects/src/ReflectometryTransform.cpp
index 22dbfe514bd..ff876f436d7 100644
--- a/Framework/DataObjects/src/ReflectometryTransform.cpp
+++ b/Framework/DataObjects/src/ReflectometryTransform.cpp
@@ -31,6 +31,7 @@
 #include "MantidKernel/VectorHelper.h"
 
 #include <boost/shared_ptr.hpp>
+#include <utility>
 
 using namespace Mantid::API;
 using namespace Mantid::Geometry;
@@ -125,13 +126,13 @@ ReflectometryTransform::ReflectometryTransform(
  */
 boost::shared_ptr<MDEventWorkspace2Lean>
 ReflectometryTransform::createMDWorkspace(
-    Mantid::Geometry::IMDDimension_sptr a,
-    Mantid::Geometry::IMDDimension_sptr b,
-    BoxController_sptr boxController) const {
+    const Mantid::Geometry::IMDDimension_sptr &a,
+    const Mantid::Geometry::IMDDimension_sptr &b,
+    const BoxController_sptr &boxController) const {
   auto ws = boost::make_shared<MDEventWorkspace2Lean>();
 
-  ws->addDimension(a);
-  ws->addDimension(b);
+  ws->addDimension(std::move(a));
+  ws->addDimension(std::move(b));
 
   BoxController_sptr wsbc = ws->getBoxController(); // Get the box controller
   wsbc->setSplitInto(boxController->getSplitInto(0));
@@ -280,8 +281,8 @@ DetectorAngularCache initAngularCaches(const MatrixWorkspace *const workspace) {
  * @returns An MDWorkspace based on centre-point rebinning of the inputWS
  */
 Mantid::API::IMDEventWorkspace_sptr ReflectometryTransform::executeMD(
-    Mantid::API::MatrixWorkspace_const_sptr inputWs,
-    BoxController_sptr boxController,
+    const Mantid::API::MatrixWorkspace_const_sptr &inputWs,
+    const BoxController_sptr &boxController,
     Mantid::Geometry::MDFrame_uptr frame) const {
   auto dim0 = boost::make_shared<MDHistoDimension>(
       m_d0Label, m_d0ID, *frame, static_cast<Mantid::coord_t>(m_d0Min),
@@ -290,7 +291,7 @@ Mantid::API::IMDEventWorkspace_sptr ReflectometryTransform::executeMD(
       m_d1Label, m_d1ID, *frame, static_cast<Mantid::coord_t>(m_d1Min),
       static_cast<Mantid::coord_t>(m_d1Max), m_d1NumBins);
 
-  auto ws = createMDWorkspace(dim0, dim1, boxController);
+  auto ws = createMDWorkspace(dim0, dim1, std::move(boxController));
 
   auto spectraAxis = inputWs->getAxis(1);
   for (size_t index = 0; index < inputWs->getNumberHistograms(); ++index) {
@@ -324,7 +325,7 @@ Mantid::API::IMDEventWorkspace_sptr ReflectometryTransform::executeMD(
  * @return workspace group containing output matrix workspaces of ki and kf
  */
 Mantid::API::MatrixWorkspace_sptr ReflectometryTransform::execute(
-    Mantid::API::MatrixWorkspace_const_sptr inputWs) const {
+    const Mantid::API::MatrixWorkspace_const_sptr &inputWs) const {
   auto ws = boost::make_shared<Mantid::DataObjects::Workspace2D>();
 
   ws->initialize(m_d1NumBins, m_d0NumBins,
@@ -380,7 +381,7 @@ Mantid::API::MatrixWorkspace_sptr ReflectometryTransform::execute(
 }
 
 IMDHistoWorkspace_sptr ReflectometryTransform::executeMDNormPoly(
-    MatrixWorkspace_const_sptr inputWs) const {
+    const MatrixWorkspace_const_sptr &inputWs) const {
 
   auto input_x_dim = inputWs->getXDimension();
 
@@ -428,7 +429,7 @@ IMDHistoWorkspace_sptr ReflectometryTransform::executeMDNormPoly(
 MatrixWorkspace_sptr ReflectometryTransform::executeNormPoly(
     const MatrixWorkspace_const_sptr &inputWS,
     boost::shared_ptr<Mantid::DataObjects::TableWorkspace> &vertexes,
-    bool dumpVertexes, std::string outputDimensions) const {
+    bool dumpVertexes, const std::string &outputDimensions) const {
   MatrixWorkspace_sptr temp = WorkspaceFactory::Instance().create(
       "RebinnedOutput", m_d1NumBins, m_d0NumBins + 1, m_d0NumBins);
   RebinnedOutput_sptr outWS = boost::static_pointer_cast<RebinnedOutput>(temp);
diff --git a/Framework/DataObjects/src/SpecialWorkspace2D.cpp b/Framework/DataObjects/src/SpecialWorkspace2D.cpp
index b347bdbcc43..915bffb65a1 100644
--- a/Framework/DataObjects/src/SpecialWorkspace2D.cpp
+++ b/Framework/DataObjects/src/SpecialWorkspace2D.cpp
@@ -32,8 +32,8 @@ DECLARE_WORKSPACE(SpecialWorkspace2D)
  * @param includeMonitors :: If false the monitors are not included
  * @return created SpecialWorkspace2D
  */
-SpecialWorkspace2D::SpecialWorkspace2D(Geometry::Instrument_const_sptr inst,
-                                       const bool includeMonitors) {
+SpecialWorkspace2D::SpecialWorkspace2D(
+    const Geometry::Instrument_const_sptr &inst, const bool includeMonitors) {
   // Init the Workspace2D with one spectrum per detector, in the same order.
   this->initialize(inst->getNumberDetectors(!includeMonitors), 1, 1);
 
@@ -59,7 +59,8 @@ SpecialWorkspace2D::SpecialWorkspace2D(Geometry::Instrument_const_sptr inst,
  * @param parent :: input workspace that is the base for this workspace
  * @return created SpecialWorkspace2D
  */
-SpecialWorkspace2D::SpecialWorkspace2D(API::MatrixWorkspace_const_sptr parent) {
+SpecialWorkspace2D::SpecialWorkspace2D(
+    const API::MatrixWorkspace_const_sptr &parent) {
   this->initialize(parent->getNumberHistograms(), 1, 1);
   API::WorkspaceFactory::Instance().initializeFromParent(*parent, *this, false);
   // Make the mapping, which will be used for speed later.
@@ -263,7 +264,7 @@ void SpecialWorkspace2D::binaryOperation(const unsigned int operatortype) {
  *
  */
 void SpecialWorkspace2D::binaryAND(
-    boost::shared_ptr<const SpecialWorkspace2D> ws) {
+    const boost::shared_ptr<const SpecialWorkspace2D> &ws) {
 
   for (size_t i = 0; i < this->getNumberHistograms(); i++) {
     double y1 = this->dataY(i)[0];
@@ -281,7 +282,7 @@ void SpecialWorkspace2D::binaryAND(
  *
  */
 void SpecialWorkspace2D::binaryOR(
-    boost::shared_ptr<const SpecialWorkspace2D> ws) {
+    const boost::shared_ptr<const SpecialWorkspace2D> &ws) {
 
   for (size_t i = 0; i < this->getNumberHistograms(); i++) {
     double y1 = this->dataY(i)[0];
@@ -307,7 +308,7 @@ if (y1 < 1.0E-10 && y2 < 1.0E-10){
  *
  */
 void SpecialWorkspace2D::binaryXOR(
-    boost::shared_ptr<const SpecialWorkspace2D> ws) {
+    const boost::shared_ptr<const SpecialWorkspace2D> &ws) {
 
   for (size_t i = 0; i < this->getNumberHistograms(); i++) {
     double y1 = this->dataY(i)[0];
@@ -343,7 +344,7 @@ void SpecialWorkspace2D::binaryNOT() {
  * @ return
  */
 bool SpecialWorkspace2D::isCompatible(
-    boost::shared_ptr<const SpecialWorkspace2D> ws) {
+    const boost::shared_ptr<const SpecialWorkspace2D> &ws) {
 
   // 1. Check number of histogram
   size_t numhist1 = this->getNumberHistograms();
diff --git a/Framework/DataObjects/src/TableWorkspace.cpp b/Framework/DataObjects/src/TableWorkspace.cpp
index c74dcc66a59..8b871aa20e7 100644
--- a/Framework/DataObjects/src/TableWorkspace.cpp
+++ b/Framework/DataObjects/src/TableWorkspace.cpp
@@ -200,7 +200,7 @@ std::vector<std::string> TableWorkspace::getColumnNames() const {
   return nameList;
 }
 
-void TableWorkspace::addColumn(boost::shared_ptr<API::Column> column) {
+void TableWorkspace::addColumn(const boost::shared_ptr<API::Column> &column) {
   auto ci = std::find_if(m_columns.begin(), m_columns.end(),
                          FindName(column->name()));
   if (ci != m_columns.end()) {
diff --git a/Framework/DataObjects/test/EventWorkspaceTest.h b/Framework/DataObjects/test/EventWorkspaceTest.h
index a0536611e9b..24fa648b83f 100644
--- a/Framework/DataObjects/test/EventWorkspaceTest.h
+++ b/Framework/DataObjects/test/EventWorkspaceTest.h
@@ -421,7 +421,7 @@ public:
                       const std::range_error &);
   }
 
-  void do_test_binning(EventWorkspace_sptr ws, const BinEdges &axis,
+  void do_test_binning(const EventWorkspace_sptr &ws, const BinEdges &axis,
                        size_t expected_occupancy_per_bin) {
     MantidVec Y(NUMBINS - 1);
     MantidVec E(NUMBINS - 1);
diff --git a/Framework/DataObjects/test/MDBoxSaveableTest.h b/Framework/DataObjects/test/MDBoxSaveableTest.h
index 8a9992cb61f..5f298769abc 100644
--- a/Framework/DataObjects/test/MDBoxSaveableTest.h
+++ b/Framework/DataObjects/test/MDBoxSaveableTest.h
@@ -24,6 +24,7 @@
 #include <map>
 #include <memory>
 #include <nexus/NeXusFile.hpp>
+#include <utility>
 
 using namespace Mantid;
 using namespace Mantid::Geometry;
@@ -43,7 +44,7 @@ class MDBoxSaveableTest : public CxxTest::TestSuite {
 
   /** Deletes the file created by do_saveNexus */
   static std::string
-  do_deleteNexusFile(std::string barefilename = "MDBoxTest.nxs") {
+  do_deleteNexusFile(const std::string &barefilename = "MDBoxTest.nxs") {
     std::string filename(
         ConfigService::Instance().getString("defaultsave.directory") +
         barefilename);
@@ -69,11 +70,12 @@ public:
    * @return ptr to the NeXus file object
    * */
   void do_createNeXusBackedBox(MDBox<MDLeanEvent<3>, 3> &box,
-                               BoxController_sptr bc,
+                               const BoxController_sptr &bc,
                                std::string barefilename = "MDBoxTest.nxs",
                                bool goofyWeights = true) {
     // Create the NXS file
-    std::string filename = do_createNexus(goofyWeights, barefilename);
+    std::string filename =
+        do_createNexus(goofyWeights, std::move(barefilename));
 
     // Must get ready to load in the data
     auto loader = boost::shared_ptr<API::IBoxControllerIO>(
@@ -100,8 +102,9 @@ public:
    * @param barefilename :: file to save to (no path)
    * @return filename with full path that was saved.
    * */
-  std::string do_createNexus(bool goofyWeights = true,
-                             std::string barefilename = "MDBoxTest.nxs") {
+  std::string
+  do_createNexus(bool goofyWeights = true,
+                 const std::string &barefilename = "MDBoxTest.nxs") {
     // Box with 1000 events evenly spread
     MDBox<MDLeanEvent<3>, 3> b(sc.get());
     MDEventsTestHelper::feedMDBox(&b, 1, 10, 0.5, 1.0);
@@ -118,7 +121,7 @@ public:
     auto Saver = new BoxControllerNeXusIO(sc.get());
     Saver->setDataType(b.getCoordType(), b.getEventType());
 
-    std::string filename = do_deleteNexusFile(barefilename);
+    std::string filename = do_deleteNexusFile(std::move(barefilename));
 
     Saver->openFile(filename, "w");
 
diff --git a/Framework/DataObjects/test/MDEventWorkspaceTest.h b/Framework/DataObjects/test/MDEventWorkspaceTest.h
index 3511ed772c7..3f1d9a598ee 100644
--- a/Framework/DataObjects/test/MDEventWorkspaceTest.h
+++ b/Framework/DataObjects/test/MDEventWorkspaceTest.h
@@ -40,7 +40,7 @@ class MDEventWorkspaceTest : public CxxTest::TestSuite {
 private:
   /// Helper function to return the number of masked bins in a workspace. TODO:
   /// move helper into test helpers
-  size_t getNumberMasked(Mantid::API::IMDWorkspace_sptr ws) {
+  size_t getNumberMasked(const Mantid::API::IMDWorkspace_sptr &ws) {
     auto it = ws->createIterator(nullptr);
     size_t numberMasked = 0;
     size_t counter = 0;
@@ -479,7 +479,7 @@ public:
     TS_ASSERT_DELTA(ext[1].getMax(), ymax, 1e-4);
   }
 
-  void addEvent(MDEventWorkspace2Lean::sptr b, double x, double y) {
+  void addEvent(const MDEventWorkspace2Lean::sptr &b, double x, double y) {
     coord_t centers[2] = {static_cast<coord_t>(x), static_cast<coord_t>(y)};
     b->addEvent(MDLeanEvent<2>(2.0, 2.0, centers));
   }
diff --git a/Framework/DataObjects/test/MDGridBoxTest.h b/Framework/DataObjects/test/MDGridBoxTest.h
index b424ddcef79..500e4f3c403 100644
--- a/Framework/DataObjects/test/MDGridBoxTest.h
+++ b/Framework/DataObjects/test/MDGridBoxTest.h
@@ -1205,7 +1205,8 @@ public:
    */
   void do_check_integrateSphere(MDGridBox<MDLeanEvent<2>, 2> &box, double x,
                                 double y, const double radius,
-                                double numExpected, std::string message) {
+                                double numExpected,
+                                const std::string &message) {
     // The sphere transformation
     bool dimensionsUsed[2] = {true, true};
     coord_t center[2] = {static_cast<coord_t>(x), static_cast<coord_t>(y)};
@@ -1336,7 +1337,8 @@ public:
    */
   void do_check_integrateSphere3d(MDGridBox<MDLeanEvent<3>, 3> &box, double x,
                                   double y, double z, const double radius,
-                                  double numExpected, std::string message) {
+                                  double numExpected,
+                                  const std::string &message) {
     // The sphere transformation
     bool dimensionsUsed[3] = {true, true, true};
     coord_t center[3] = {static_cast<coord_t>(x), static_cast<coord_t>(y),
@@ -1394,7 +1396,7 @@ public:
   void do_check_centroidSphere(MDGridBox<MDLeanEvent<2>, 2> &box, double x,
                                double y, const double radius,
                                double numExpected, double xExpected,
-                               double yExpected, std::string message) {
+                               double yExpected, const std::string &message) {
     // The sphere transformation
     bool dimensionsUsed[2] = {true, true};
     coord_t center[2] = {static_cast<coord_t>(x), static_cast<coord_t>(y)};
diff --git a/Framework/DataObjects/test/MDHistoWorkspaceIteratorTest.h b/Framework/DataObjects/test/MDHistoWorkspaceIteratorTest.h
index c11dcdce2cd..37a9635c150 100644
--- a/Framework/DataObjects/test/MDHistoWorkspaceIteratorTest.h
+++ b/Framework/DataObjects/test/MDHistoWorkspaceIteratorTest.h
@@ -17,6 +17,8 @@
 #include "MantidTestHelpers/MDEventsTestHelper.h"
 #include <boost/scoped_ptr.hpp>
 #include <cmath>
+#include <utility>
+
 #include <cxxtest/TestSuite.h>
 
 using namespace Mantid;
@@ -36,7 +38,7 @@ private:
   class WritableHistoWorkspace : public Mantid::DataObjects::MDHistoWorkspace {
   public:
     WritableHistoWorkspace(MDHistoDimension_sptr x)
-        : Mantid::DataObjects::MDHistoWorkspace(x) {}
+        : Mantid::DataObjects::MDHistoWorkspace(std::move(x)) {}
     void setMaskValueAt(size_t at, bool value) { m_masks[at] = value; }
   };
 
@@ -366,8 +368,8 @@ public:
   }
 
   void do_test_neighbours_1d(
-      boost::function<std::vector<size_t>(MDHistoWorkspaceIterator *)>
-          findNeighbourMemberFunction) {
+      const boost::function<std::vector<size_t>(MDHistoWorkspaceIterator *)>
+          &findNeighbourMemberFunction) {
     const size_t nd = 1;
     MDHistoWorkspace_sptr ws =
         MDEventsTestHelper::makeFakeMDHistoWorkspace(1.0, nd, 10);
diff --git a/Framework/DataObjects/test/MDHistoWorkspaceTest.h b/Framework/DataObjects/test/MDHistoWorkspaceTest.h
index b6171099125..4225ef80392 100644
--- a/Framework/DataObjects/test/MDHistoWorkspaceTest.h
+++ b/Framework/DataObjects/test/MDHistoWorkspaceTest.h
@@ -37,7 +37,7 @@ class MDHistoWorkspaceTest : public CxxTest::TestSuite {
 private:
   /// Helper function to return the number of masked bins in a workspace. TODO:
   /// move helper into test helpers
-  size_t getNumberMasked(Mantid::API::IMDWorkspace_sptr ws) {
+  size_t getNumberMasked(const Mantid::API::IMDWorkspace_sptr &ws) {
     auto it = ws->createIterator(nullptr);
     size_t numberMasked = 0;
     size_t counter = 0;
@@ -93,7 +93,7 @@ public:
   }
 
   /** Check that a workspace has the right signal/error*/
-  void checkWorkspace(MDHistoWorkspace_sptr ws, double expectedSignal,
+  void checkWorkspace(const MDHistoWorkspace_sptr &ws, double expectedSignal,
                       double expectedErrorSquared,
                       double expectedNumEvents = 1.0) {
     for (size_t i = 0; i < ws->getNPoints(); i++) {
diff --git a/Framework/DataObjects/test/WorkspaceCreationTest.h b/Framework/DataObjects/test/WorkspaceCreationTest.h
index 9f7e009d7cf..fb3c4f964dd 100644
--- a/Framework/DataObjects/test/WorkspaceCreationTest.h
+++ b/Framework/DataObjects/test/WorkspaceCreationTest.h
@@ -78,7 +78,7 @@ void run_create_partitioned_parent(const Parallel::Communicator &comm) {
 
 void run_create_partitioned_with_instrument(
     const Parallel::Communicator &comm,
-    boost::shared_ptr<Geometry::Instrument> instrument) {
+    const boost::shared_ptr<Geometry::Instrument> &instrument) {
   IndexInfo indices(4, Parallel::StorageMode::Distributed, comm);
   // should a nullptr spectrum definitions vector indicate building default
   // defs?
diff --git a/Framework/Geometry/inc/MantidGeometry/Crystal/EdgePixel.h b/Framework/Geometry/inc/MantidGeometry/Crystal/EdgePixel.h
index 00ce398a372..d3ac30bf65e 100644
--- a/Framework/Geometry/inc/MantidGeometry/Crystal/EdgePixel.h
+++ b/Framework/Geometry/inc/MantidGeometry/Crystal/EdgePixel.h
@@ -12,9 +12,9 @@ namespace Mantid {
 namespace Geometry {
 
 /// Function to find peaks near detector edge
-MANTID_GEOMETRY_DLL bool edgePixel(Geometry::Instrument_const_sptr inst,
-                                   std::string bankName, int col, int row,
-                                   int Edge);
+MANTID_GEOMETRY_DLL bool edgePixel(const Geometry::Instrument_const_sptr &inst,
+                                   const std::string &bankName, int col,
+                                   int row, int Edge);
 
 } // namespace Geometry
 } // namespace Mantid
diff --git a/Framework/Geometry/inc/MantidGeometry/Crystal/IndexingUtils.h b/Framework/Geometry/inc/MantidGeometry/Crystal/IndexingUtils.h
index e9692b677e2..1bdbb3d8558 100644
--- a/Framework/Geometry/inc/MantidGeometry/Crystal/IndexingUtils.h
+++ b/Framework/Geometry/inc/MantidGeometry/Crystal/IndexingUtils.h
@@ -238,8 +238,8 @@ public:
   /// Choose the direction in a list of directions, that is most nearly
   /// perpendicular to planes with the specified spacing in reciprocal space.
   static int SelectDirection(Kernel::V3D &best_direction,
-                             const std::vector<Kernel::V3D> q_vectors,
-                             const std::vector<Kernel::V3D> direction_list,
+                             const std::vector<Kernel::V3D> &q_vectors,
+                             const std::vector<Kernel::V3D> &direction_list,
                              double plane_spacing, double required_tolerance);
 
   /// Get the lattice parameters for the specified orientation matrix
diff --git a/Framework/Geometry/inc/MantidGeometry/Crystal/PeakTransformSelector.h b/Framework/Geometry/inc/MantidGeometry/Crystal/PeakTransformSelector.h
index 16d7c98c0e7..12cfb9f9ecf 100644
--- a/Framework/Geometry/inc/MantidGeometry/Crystal/PeakTransformSelector.h
+++ b/Framework/Geometry/inc/MantidGeometry/Crystal/PeakTransformSelector.h
@@ -21,15 +21,15 @@ public:
   /// Constructor
   PeakTransformSelector();
   /// Register a candidate factory
-  void registerCandidate(PeakTransformFactory_sptr candidate);
+  void registerCandidate(const PeakTransformFactory_sptr &candidate);
   /// Make choice
-  PeakTransformFactory_sptr makeChoice(const std::string labelX,
-                                       const std::string labelY) const;
+  PeakTransformFactory_sptr makeChoice(const std::string &labelX,
+                                       const std::string &labelY) const;
   /// Make default choice
   PeakTransformFactory_sptr makeDefaultChoice() const;
   /// Has a factory capable of the requested transform.
-  bool hasFactoryForTransform(const std::string labelX,
-                              const std::string labelY) const;
+  bool hasFactoryForTransform(const std::string &labelX,
+                              const std::string &labelY) const;
   /// Get the number of registered factories
   size_t numberRegistered() const;
 
diff --git a/Framework/Geometry/inc/MantidGeometry/Crystal/ReflectionGenerator.h b/Framework/Geometry/inc/MantidGeometry/Crystal/ReflectionGenerator.h
index 06ac79c2986..e1f62dd93cd 100644
--- a/Framework/Geometry/inc/MantidGeometry/Crystal/ReflectionGenerator.h
+++ b/Framework/Geometry/inc/MantidGeometry/Crystal/ReflectionGenerator.h
@@ -105,12 +105,12 @@ public:
   std::vector<Kernel::V3D> getHKLs(double dMin, double dMax) const;
   std::vector<Kernel::V3D>
   getHKLs(double dMin, double dMax,
-          HKLFilter_const_sptr reflectionConditionFilter) const;
+          const HKLFilter_const_sptr &reflectionConditionFilter) const;
 
   std::vector<Kernel::V3D> getUniqueHKLs(double dMin, double dMax) const;
   std::vector<Kernel::V3D>
   getUniqueHKLs(double dMin, double dMax,
-                HKLFilter_const_sptr reflectionConditionFilter) const;
+                const HKLFilter_const_sptr &reflectionConditionFilter) const;
 
   std::vector<double> getDValues(const std::vector<Kernel::V3D> &hkls) const;
   std::vector<double> getFsSquared(const std::vector<Kernel::V3D> &hkls) const;
diff --git a/Framework/Geometry/inc/MantidGeometry/Crystal/SpaceGroupFactory.h b/Framework/Geometry/inc/MantidGeometry/Crystal/SpaceGroupFactory.h
index 8b82398ae82..d0c4ffcef03 100644
--- a/Framework/Geometry/inc/MantidGeometry/Crystal/SpaceGroupFactory.h
+++ b/Framework/Geometry/inc/MantidGeometry/Crystal/SpaceGroupFactory.h
@@ -236,7 +236,7 @@ protected:
   SpaceGroup_const_sptr getPrototype(const std::string &hmSymbol);
   void subscribe(const AbstractSpaceGroupGenerator_sptr &generator);
   SpaceGroup_const_sptr
-  constructFromPrototype(const SpaceGroup_const_sptr prototype) const;
+  constructFromPrototype(const SpaceGroup_const_sptr &prototype) const;
 
   void fillPointGroupMap();
 
diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument.h b/Framework/Geometry/inc/MantidGeometry/Instrument.h
index 0f8bb0a2dbb..48fcfc2fc8c 100644
--- a/Framework/Geometry/inc/MantidGeometry/Instrument.h
+++ b/Framework/Geometry/inc/MantidGeometry/Instrument.h
@@ -48,8 +48,8 @@ public:
   /// String description of the type of component
   std::string type() const override { return "Instrument"; }
 
-  Instrument(const boost::shared_ptr<const Instrument> instr,
-             boost::shared_ptr<ParameterMap> map);
+  Instrument(const boost::shared_ptr<const Instrument> &instr,
+             const boost::shared_ptr<ParameterMap> &map);
   Instrument();
   Instrument(const std::string &name);
   Instrument(const Instrument &);
diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h b/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h
index 26b94a73de8..640bcd5bc6b 100644
--- a/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h
+++ b/Framework/Geometry/inc/MantidGeometry/Instrument/Detector.h
@@ -34,8 +34,8 @@ public:
   std::string type() const override { return "DetectorComponent"; }
 
   Detector(const std::string &name, int id, IComponent *parent);
-  Detector(const std::string &name, int id, boost::shared_ptr<IObject> shape,
-           IComponent *parent);
+  Detector(const std::string &name, int id,
+           const boost::shared_ptr<IObject> &shape, IComponent *parent);
   // functions inherited from IObjectComponent
   Component *clone() const override { return new Detector(*this); }
 
diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorGroup.h b/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorGroup.h
index 317403878ad..1dcaa928b67 100644
--- a/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorGroup.h
+++ b/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorGroup.h
@@ -30,7 +30,7 @@ public:
   DetectorGroup();
   DetectorGroup(const std::vector<IDetector_const_sptr> &dets);
 
-  void addDetector(IDetector_const_sptr det);
+  void addDetector(const IDetector_const_sptr &det);
 
   // IDetector methods
   IDetector *cloneParameterized(const ParameterMap *) const override {
diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/Goniometer.h b/Framework/Geometry/inc/MantidGeometry/Instrument/Goniometer.h
index 609b51e4e84..e09c1b7301e 100644
--- a/Framework/Geometry/inc/MantidGeometry/Instrument/Goniometer.h
+++ b/Framework/Geometry/inc/MantidGeometry/Instrument/Goniometer.h
@@ -11,6 +11,7 @@
 #include "MantidKernel/V3D.h"
 #include <nexus/NeXusFile.hpp>
 #include <string>
+#include <utility>
 
 namespace Mantid {
 namespace Geometry {
@@ -43,8 +44,8 @@ struct GoniometerAxis {
   /// Constructor
   GoniometerAxis(std::string initname, Kernel::V3D initrotationaxis,
                  double initangle, int initsense, int initangleunit)
-      : name(initname), rotationaxis(initrotationaxis), angle(initangle),
-        sense(initsense), angleunit(initangleunit) {}
+      : name(std::move(initname)), rotationaxis(initrotationaxis),
+        angle(initangle), sense(initsense), angleunit(initangleunit) {}
   GoniometerAxis()
       : name(""), rotationaxis(), angle(0.), sense(0), angleunit(0) {}
 
@@ -57,7 +58,7 @@ public:
   // Default constructor
   Goniometer();
   // Constructor from a rotation matrix
-  Goniometer(Kernel::DblMatrix rot);
+  Goniometer(const Kernel::DblMatrix &rot);
   // Default destructor
   virtual ~Goniometer() = default;
   // Return rotation matrix
@@ -67,11 +68,12 @@ public:
   // Return information about axes
   std::string axesInfo();
   // Add axis to goniometer
-  void pushAxis(std::string name, double axisx, double axisy, double axisz,
-                double angle = 0., int sense = CCW, int angUnit = angDegrees);
+  void pushAxis(const std::string &name, double axisx, double axisy,
+                double axisz, double angle = 0., int sense = CCW,
+                int angUnit = angDegrees);
   // Set rotation angle for an axis in the units the angle is set (default --
   // degrees)
-  void setRotationAngle(std::string name, double value);
+  void setRotationAngle(const std::string &name, double value);
   // Set rotation angle for an axis in the units the angle is set (default --
   // degrees)
   void setRotationAngle(size_t axisnumber, double value);
@@ -83,13 +85,13 @@ public:
   // Get axis object
   const GoniometerAxis &getAxis(size_t axisnumber) const;
   // Get axis object
-  const GoniometerAxis &getAxis(std::string axisname) const;
+  const GoniometerAxis &getAxis(const std::string &axisname) const;
   // Return the number of axes
   size_t getNumberAxes() const;
   // Make a default universal goniometer
   void makeUniversalGoniometer();
   // Return Euler angles acording to a convention
-  std::vector<double> getEulerAngles(std::string convention = "YZX");
+  std::vector<double> getEulerAngles(const std::string &convention = "YZX");
 
   void saveNexus(::NeXus::File *file, const std::string &group) const;
   void loadNexus(::NeXus::File *file, const std::string &group);
diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/GridDetectorPixel.h b/Framework/Geometry/inc/MantidGeometry/Instrument/GridDetectorPixel.h
index c98e4fdbd7f..6d638a04a11 100644
--- a/Framework/Geometry/inc/MantidGeometry/Instrument/GridDetectorPixel.h
+++ b/Framework/Geometry/inc/MantidGeometry/Instrument/GridDetectorPixel.h
@@ -34,7 +34,7 @@ public:
   virtual std::string type() const override { return "GridDetectorPixel"; }
 
   GridDetectorPixel(const std::string &name, int id,
-                    boost::shared_ptr<IObject> shape, IComponent *parent,
+                    const boost::shared_ptr<IObject> &shape, IComponent *parent,
                     const GridDetector *panel, size_t col, size_t row,
                     size_t layer);
 
diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/InstrumentDefinitionParser.h b/Framework/Geometry/inc/MantidGeometry/Instrument/InstrumentDefinitionParser.h
index e8d10918a2d..216f9883eab 100644
--- a/Framework/Geometry/inc/MantidGeometry/Instrument/InstrumentDefinitionParser.h
+++ b/Framework/Geometry/inc/MantidGeometry/Instrument/InstrumentDefinitionParser.h
@@ -47,8 +47,8 @@ public:
   InstrumentDefinitionParser(const std::string &filename,
                              const std::string &instName,
                              const std::string &xmlText);
-  InstrumentDefinitionParser(const IDFObject_const_sptr xmlFile,
-                             const IDFObject_const_sptr expectedCacheFile,
+  InstrumentDefinitionParser(const IDFObject_const_sptr &xmlFile,
+                             const IDFObject_const_sptr &expectedCacheFile,
                              const std::string &instName,
                              const std::string &xmlText);
   ~InstrumentDefinitionParser() = default;
@@ -153,7 +153,7 @@ private:
                       const Poco::XML::Element *pCompElem, IdList &idList);
   /// Return true if assembly, false if not assembly and throws exception if
   /// string not in assembly
-  bool isAssembly(std::string) const;
+  bool isAssembly(const std::string &) const;
 
   /// Add XML element to parent assuming the element contains no other component
   /// elements
@@ -263,7 +263,7 @@ private:
       Poco::XML::Element *pRootElem);
 
   /// Check IdList
-  void checkIdListExistsAndDefinesEnoughIDs(IdList idList,
+  void checkIdListExistsAndDefinesEnoughIDs(const IdList &idList,
                                             Poco::XML::Element *pElem,
                                             const std::string &filename) const;
 
@@ -290,7 +290,7 @@ public: // for testing
 
 private:
   /// Reads from a cache file.
-  void applyCache(IDFObject_const_sptr cacheToApply);
+  void applyCache(const IDFObject_const_sptr &cacheToApply);
 
   /// Write out a cache file.
   CachingOption writeAndApplyCache(IDFObject_const_sptr firstChoiceCache,
diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/ParComponentFactory.h b/Framework/Geometry/inc/MantidGeometry/Instrument/ParComponentFactory.h
index 31ca5b2f144..572eba65c90 100644
--- a/Framework/Geometry/inc/MantidGeometry/Instrument/ParComponentFactory.h
+++ b/Framework/Geometry/inc/MantidGeometry/Instrument/ParComponentFactory.h
@@ -44,7 +44,8 @@ public:
   /// Create a parameterized component from the given base component and
   /// ParameterMap
   static boost::shared_ptr<IComponent>
-  create(boost::shared_ptr<const IComponent> base, const ParameterMap *map);
+  create(const boost::shared_ptr<const IComponent> &base,
+         const ParameterMap *map);
 };
 
 } // Namespace Geometry
diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/SampleEnvironment.h b/Framework/Geometry/inc/MantidGeometry/Instrument/SampleEnvironment.h
index 8091db541cf..e813f64165f 100644
--- a/Framework/Geometry/inc/MantidGeometry/Instrument/SampleEnvironment.h
+++ b/Framework/Geometry/inc/MantidGeometry/Instrument/SampleEnvironment.h
@@ -25,7 +25,7 @@ class Track;
 */
 class MANTID_GEOMETRY_DLL SampleEnvironment {
 public:
-  SampleEnvironment(std::string name, Container_const_sptr getContainer);
+  SampleEnvironment(std::string name, const Container_const_sptr &getContainer);
 
   /// @return The name of kit
   inline const std::string name() const { return m_name; }
diff --git a/Framework/Geometry/inc/MantidGeometry/MDGeometry/CompositeImplicitFunction.h b/Framework/Geometry/inc/MantidGeometry/MDGeometry/CompositeImplicitFunction.h
index a6207bb04d1..8d40acfdbfe 100644
--- a/Framework/Geometry/inc/MantidGeometry/MDGeometry/CompositeImplicitFunction.h
+++ b/Framework/Geometry/inc/MantidGeometry/MDGeometry/CompositeImplicitFunction.h
@@ -38,8 +38,8 @@ public:
   using MDImplicitFunction::isPointContained;
   //-----------------------------------------------------------------
 
-  bool
-  addFunction(Mantid::Geometry::MDImplicitFunction_sptr constituentFunction);
+  bool addFunction(
+      const Mantid::Geometry::MDImplicitFunction_sptr &constituentFunction);
   std::string getName() const override;
   std::string toXMLString() const override;
   int getNFunctions() const;
diff --git a/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryXMLBuilder.h b/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryXMLBuilder.h
index c4a67ea3068..e5a4a0f408b 100644
--- a/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryXMLBuilder.h
+++ b/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryXMLBuilder.h
@@ -41,19 +41,19 @@ public:
   bool addOrdinaryDimension(IMDDimension_const_sptr dimensionToAdd) const;
 
   /// Add many ordinary dimensions.
-  void addManyOrdinaryDimensions(VecIMDDimension_sptr manyDims) const;
+  void addManyOrdinaryDimensions(const VecIMDDimension_sptr &manyDims) const;
 
   /// Add x dimension.
-  bool addXDimension(IMDDimension_const_sptr dimension) const;
+  bool addXDimension(const IMDDimension_const_sptr &dimension) const;
 
   /// Add y dimension.
-  bool addYDimension(IMDDimension_const_sptr dimension) const;
+  bool addYDimension(const IMDDimension_const_sptr &dimension) const;
 
   /// Add z dimension.
-  bool addZDimension(IMDDimension_const_sptr dimension) const;
+  bool addZDimension(const IMDDimension_const_sptr &dimension) const;
 
   /// Add t dimension.
-  bool addTDimension(IMDDimension_const_sptr dimension) const;
+  bool addTDimension(const IMDDimension_const_sptr &dimension) const;
 
   /// Copy constructor
   MDGeometryBuilderXML(const MDGeometryBuilderXML &);
diff --git a/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryXMLParser.h b/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryXMLParser.h
index 63d314d3a69..5ee60ef9f81 100644
--- a/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryXMLParser.h
+++ b/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDGeometryXMLParser.h
@@ -78,13 +78,13 @@ public:
 
   bool hasTDimension() const;
 
-  bool isXDimension(Mantid::Geometry::IMDDimension_sptr) const;
+  bool isXDimension(const Mantid::Geometry::IMDDimension_sptr &) const;
 
-  bool isYDimension(Mantid::Geometry::IMDDimension_sptr) const;
+  bool isYDimension(const Mantid::Geometry::IMDDimension_sptr &) const;
 
-  bool isZDimension(Mantid::Geometry::IMDDimension_sptr) const;
+  bool isZDimension(const Mantid::Geometry::IMDDimension_sptr &) const;
 
-  bool isTDimension(Mantid::Geometry::IMDDimension_sptr) const;
+  bool isTDimension(const Mantid::Geometry::IMDDimension_sptr &) const;
 
   void SetRootNodeCheck(std::string elementName);
 
diff --git a/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimension.h b/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimension.h
index ba3af9311f5..9db0adde02d 100644
--- a/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimension.h
+++ b/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimension.h
@@ -6,6 +6,8 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #pragma once
 
+#include <utility>
+
 #include "MantidGeometry/DllConfig.h"
 #include "MantidGeometry/MDGeometry/IMDDimension.h"
 #include "MantidGeometry/MDGeometry/MDFrame.h"
@@ -38,8 +40,8 @@ public:
    */
   MDHistoDimension(std::string name, std::string ID, const MDFrame &frame,
                    coord_t min, coord_t max, size_t numBins)
-      : m_name(name), m_dimensionId(ID), m_frame(frame.clone()), m_min(min),
-        m_max(max), m_numBins(numBins),
+      : m_name(std::move(name)), m_dimensionId(std::move(ID)),
+        m_frame(frame.clone()), m_min(min), m_max(max), m_numBins(numBins),
         m_binWidth((max - min) / static_cast<coord_t>(numBins)) {
     if (max < min) {
       throw std::invalid_argument("Error making MDHistoDimension. Cannot have "
diff --git a/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h b/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h
index ebaa932eeb2..7443fdb7b7d 100644
--- a/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h
+++ b/Framework/Geometry/inc/MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h
@@ -50,7 +50,7 @@ public:
   }
 
   MDHistoDimensionBuilder();
-  void setName(std::string name);
+  void setName(const std::string &name);
   void setId(std::string id);
   void setUnits(const Kernel::UnitLabel &units);
   void setMin(double min);
diff --git a/Framework/Geometry/inc/MantidGeometry/Objects/CSGObject.h b/Framework/Geometry/inc/MantidGeometry/Objects/CSGObject.h
index eda75d48203..31e0e3af432 100644
--- a/Framework/Geometry/inc/MantidGeometry/Objects/CSGObject.h
+++ b/Framework/Geometry/inc/MantidGeometry/Objects/CSGObject.h
@@ -179,7 +179,7 @@ public:
   // Get Geometry Handler
   boost::shared_ptr<GeometryHandler> getGeometryHandler() const override;
   /// Set Geometry Handler
-  void setGeometryHandler(boost::shared_ptr<GeometryHandler> h);
+  void setGeometryHandler(const boost::shared_ptr<GeometryHandler> &h);
 
   /// set vtkGeometryCache writer
   void setVtkGeometryCacheWriter(boost::shared_ptr<vtkGeometryCacheWriter>);
diff --git a/Framework/Geometry/inc/MantidGeometry/Objects/MeshObject.h b/Framework/Geometry/inc/MantidGeometry/Objects/MeshObject.h
index 737d5ba3145..1fd45dfea1b 100644
--- a/Framework/Geometry/inc/MantidGeometry/Objects/MeshObject.h
+++ b/Framework/Geometry/inc/MantidGeometry/Objects/MeshObject.h
@@ -51,7 +51,7 @@ public:
   /// Constructor
   MeshObject(const std::vector<uint32_t> &faces,
              const std::vector<Kernel::V3D> &vertices,
-             const Kernel::Material material);
+             const Kernel::Material &material);
   /// Constructor
   MeshObject(std::vector<uint32_t> &&faces, std::vector<Kernel::V3D> &&vertices,
              const Kernel::Material &&material);
@@ -126,7 +126,7 @@ public:
   // Get Geometry Handler
   boost::shared_ptr<GeometryHandler> getGeometryHandler() const override;
   /// Set Geometry Handler
-  void setGeometryHandler(boost::shared_ptr<GeometryHandler> h);
+  void setGeometryHandler(const boost::shared_ptr<GeometryHandler> &h);
 
   detail::ShapeInfo::GeometryShape shape() const override;
   const detail::ShapeInfo &shapeInfo() const override;
diff --git a/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h b/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h
index 639670b7ad5..33b28379aab 100644
--- a/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h
+++ b/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h
@@ -76,9 +76,9 @@ protected:
       nullptr; ///< ObjComponent that uses this geometry handler
   CSGObject *m_csgObj = nullptr; ///< Object that uses this geometry handler
 public:
-  GeometryHandler(IObjComponent *comp);              ///< Constructor
-  GeometryHandler(boost::shared_ptr<CSGObject> obj); ///< Constructor
-  GeometryHandler(CSGObject *obj);                   ///< Constructor
+  GeometryHandler(IObjComponent *comp);                     ///< Constructor
+  GeometryHandler(const boost::shared_ptr<CSGObject> &obj); ///< Constructor
+  GeometryHandler(CSGObject *obj);                          ///< Constructor
   GeometryHandler(const MeshObject &obj);
   GeometryHandler(const MeshObject2D &obj);
   GeometryHandler(const GeometryHandler &handler);
diff --git a/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheReader.h b/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheReader.h
index 1f99fc99567..7cee8e07227 100644
--- a/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheReader.h
+++ b/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheReader.h
@@ -37,7 +37,7 @@ private:
   std::string mFileName;         ///< The file name
   // Private Methods
   void Init();
-  Poco::XML::Element *getElementByObjectName(std::string name);
+  Poco::XML::Element *getElementByObjectName(const std::string &name);
   void readPoints(Poco::XML::Element *pEle, int noOfPoints,
                   std::vector<double> &points);
   void readTriangles(Poco::XML::Element *pEle, int noOfTriangles,
diff --git a/Framework/Geometry/src/Crystal/EdgePixel.cpp b/Framework/Geometry/src/Crystal/EdgePixel.cpp
index e62018bb6b9..807ef1678c1 100644
--- a/Framework/Geometry/src/Crystal/EdgePixel.cpp
+++ b/Framework/Geometry/src/Crystal/EdgePixel.cpp
@@ -20,8 +20,8 @@ namespace Geometry {
   @param  Edge         Number of edge points for each bank
   @return True if peak is on edge
 */
-bool edgePixel(Mantid::Geometry::Instrument_const_sptr inst,
-               std::string bankName, int col, int row, int Edge) {
+bool edgePixel(const Mantid::Geometry::Instrument_const_sptr &inst,
+               const std::string &bankName, int col, int row, int Edge) {
   if (bankName == "None")
     return false;
   boost::shared_ptr<const Geometry::IComponent> parent =
diff --git a/Framework/Geometry/src/Crystal/IndexingUtils.cpp b/Framework/Geometry/src/Crystal/IndexingUtils.cpp
index adc2ac568b9..ba096aaa319 100644
--- a/Framework/Geometry/src/Crystal/IndexingUtils.cpp
+++ b/Framework/Geometry/src/Crystal/IndexingUtils.cpp
@@ -2854,8 +2854,8 @@ std::vector<V3D> IndexingUtils::MakeCircleDirections(int n_steps,
                            specified.
  */
 int IndexingUtils::SelectDirection(V3D &best_direction,
-                                   const std::vector<V3D> q_vectors,
-                                   const std::vector<V3D> direction_list,
+                                   const std::vector<V3D> &q_vectors,
+                                   const std::vector<V3D> &direction_list,
                                    double plane_spacing,
                                    double required_tolerance) {
   if (q_vectors.empty()) {
diff --git a/Framework/Geometry/src/Crystal/PeakTransformSelector.cpp b/Framework/Geometry/src/Crystal/PeakTransformSelector.cpp
index 97fb701e354..4eb89198f83 100644
--- a/Framework/Geometry/src/Crystal/PeakTransformSelector.cpp
+++ b/Framework/Geometry/src/Crystal/PeakTransformSelector.cpp
@@ -17,7 +17,7 @@ Register a peak transform factory as a candidate.
 @param candidate : candidate peak transform factory
 */
 void PeakTransformSelector::registerCandidate(
-    PeakTransformFactory_sptr candidate) {
+    const PeakTransformFactory_sptr &candidate) {
   m_candidateFactories.insert(candidate);
 }
 
@@ -62,8 +62,8 @@ Make a choice for the peak transform factory.
 @return selected factory
 */
 PeakTransformFactory_sptr
-PeakTransformSelector::makeChoice(const std::string labelX,
-                                  const std::string labelY) const {
+PeakTransformSelector::makeChoice(const std::string &labelX,
+                                  const std::string &labelY) const {
   if (labelX.empty()) {
     throw std::invalid_argument("labelX is empty");
   }
@@ -102,7 +102,7 @@ transformation.
 @return TRUE only if such a factory is available.
 */
 bool PeakTransformSelector::hasFactoryForTransform(
-    const std::string labelX, const std::string labelY) const {
+    const std::string &labelX, const std::string &labelY) const {
   bool hasFactoryForTransform = true;
   try {
     this->makeChoice(labelX, labelY);
diff --git a/Framework/Geometry/src/Crystal/ReflectionGenerator.cpp b/Framework/Geometry/src/Crystal/ReflectionGenerator.cpp
index c64adeba704..39446f2ddda 100644
--- a/Framework/Geometry/src/Crystal/ReflectionGenerator.cpp
+++ b/Framework/Geometry/src/Crystal/ReflectionGenerator.cpp
@@ -76,7 +76,7 @@ std::vector<V3D> ReflectionGenerator::getHKLs(double dMin, double dMax) const {
 /// filter. If the pointer is null, it's ignored.
 std::vector<Kernel::V3D> ReflectionGenerator::getHKLs(
     double dMin, double dMax,
-    HKLFilter_const_sptr reflectionConditionFilter) const {
+    const HKLFilter_const_sptr &reflectionConditionFilter) const {
   HKLGenerator generator(m_crystalStructure.cell(), dMin);
 
   HKLFilter_const_sptr filter = getDRangeFilter(dMin, dMax);
@@ -103,7 +103,7 @@ std::vector<V3D> ReflectionGenerator::getUniqueHKLs(double dMin,
 /// d-limits using the specified reflection condition filter.
 std::vector<V3D> ReflectionGenerator::getUniqueHKLs(
     double dMin, double dMax,
-    HKLFilter_const_sptr reflectionConditionFilter) const {
+    const HKLFilter_const_sptr &reflectionConditionFilter) const {
   HKLGenerator generator(m_crystalStructure.cell(), dMin);
 
   HKLFilter_const_sptr filter = getDRangeFilter(dMin, dMax);
diff --git a/Framework/Geometry/src/Crystal/SpaceGroupFactory.cpp b/Framework/Geometry/src/Crystal/SpaceGroupFactory.cpp
index 4459809313d..6d6e4bfd014 100644
--- a/Framework/Geometry/src/Crystal/SpaceGroupFactory.cpp
+++ b/Framework/Geometry/src/Crystal/SpaceGroupFactory.cpp
@@ -405,7 +405,7 @@ std::string SpaceGroupFactoryImpl::getTransformedSymbolOrthorhombic(
 /// Returns a copy-constructed instance of the supplied space group prototype
 /// object.
 SpaceGroup_const_sptr SpaceGroupFactoryImpl::constructFromPrototype(
-    const SpaceGroup_const_sptr prototype) const {
+    const SpaceGroup_const_sptr &prototype) const {
   return boost::make_shared<const SpaceGroup>(*prototype);
 }
 
diff --git a/Framework/Geometry/src/Instrument.cpp b/Framework/Geometry/src/Instrument.cpp
index e5ed3e3a697..0b79e7780a5 100644
--- a/Framework/Geometry/src/Instrument.cpp
+++ b/Framework/Geometry/src/Instrument.cpp
@@ -24,6 +24,7 @@
 #include <boost/make_shared.hpp>
 #include <nexus/NeXusFile.hpp>
 #include <queue>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using Mantid::Kernel::Exception::InstrumentDefinitionError;
@@ -59,8 +60,8 @@ Instrument::Instrument(const std::string &name)
  *  @param instr :: instrument for parameter inclusion
  *  @param map :: parameter map to include
  */
-Instrument::Instrument(const boost::shared_ptr<const Instrument> instr,
-                       boost::shared_ptr<ParameterMap> map)
+Instrument::Instrument(const boost::shared_ptr<const Instrument> &instr,
+                       const boost::shared_ptr<ParameterMap> &map)
     : CompAssembly(instr.get(), map.get()), m_sourceCache(instr->m_sourceCache),
       m_sampleCache(instr->m_sampleCache), m_defaultView(instr->m_defaultView),
       m_defaultViewAxis(instr->m_defaultViewAxis), m_instr(instr),
@@ -1037,7 +1038,7 @@ Setter for the reference frame.
 @param frame : reference frame object to use.
 */
 void Instrument::setReferenceFrame(boost::shared_ptr<ReferenceFrame> frame) {
-  m_referenceFrame = frame;
+  m_referenceFrame = std::move(frame);
 }
 
 /**
diff --git a/Framework/Geometry/src/Instrument/Container.cpp b/Framework/Geometry/src/Instrument/Container.cpp
index 86dcc73b950..85a74621aa4 100644
--- a/Framework/Geometry/src/Instrument/Container.cpp
+++ b/Framework/Geometry/src/Instrument/Container.cpp
@@ -16,6 +16,7 @@
 #include "Poco/SAX/InputSource.h"
 #include "Poco/SAX/SAXException.h"
 #include <boost/make_shared.hpp>
+#include <utility>
 
 namespace Mantid {
 namespace Geometry {
@@ -55,7 +56,7 @@ void updateTreeValues(Poco::XML::Element *root,
 //------------------------------------------------------------------------------
 Container::Container() : m_shape(boost::make_shared<CSGObject>()) {}
 
-Container::Container(IObject_sptr shape) : m_shape(shape) {}
+Container::Container(IObject_sptr shape) : m_shape(std::move(shape)) {}
 
 Container::Container(const Container &container)
     : m_shape(IObject_sptr(container.m_shape->clone())),
diff --git a/Framework/Geometry/src/Instrument/Detector.cpp b/Framework/Geometry/src/Instrument/Detector.cpp
index fee86e8d666..377b462a276 100644
--- a/Framework/Geometry/src/Instrument/Detector.cpp
+++ b/Framework/Geometry/src/Instrument/Detector.cpp
@@ -45,7 +45,7 @@ Detector::Detector(const std::string &name, int id, IComponent *parent)
  *  @param parent :: The parent component
  */
 Detector::Detector(const std::string &name, int id,
-                   boost::shared_ptr<IObject> shape, IComponent *parent)
+                   const boost::shared_ptr<IObject> &shape, IComponent *parent)
     : IDetector(), ObjComponent(name, shape, parent), m_id(id) {}
 
 /** Gets the detector id
diff --git a/Framework/Geometry/src/Instrument/DetectorGroup.cpp b/Framework/Geometry/src/Instrument/DetectorGroup.cpp
index a8623247a6c..11d09939851 100644
--- a/Framework/Geometry/src/Instrument/DetectorGroup.cpp
+++ b/Framework/Geometry/src/Instrument/DetectorGroup.cpp
@@ -49,7 +49,7 @@ DetectorGroup::DetectorGroup(const std::vector<IDetector_const_sptr> &dets)
 /** Add a detector to the collection
  *  @param det ::  A pointer to the detector to add
  */
-void DetectorGroup::addDetector(IDetector_const_sptr det) {
+void DetectorGroup::addDetector(const IDetector_const_sptr &det) {
   // the topology of the group become undefined and needs recalculation if new
   // detector has been added to the group
   group_topology = undef;
diff --git a/Framework/Geometry/src/Instrument/DetectorInfo.cpp b/Framework/Geometry/src/Instrument/DetectorInfo.cpp
index 07f32908474..992682287be 100644
--- a/Framework/Geometry/src/Instrument/DetectorInfo.cpp
+++ b/Framework/Geometry/src/Instrument/DetectorInfo.cpp
@@ -4,10 +4,12 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidGeometry/Instrument/DetectorInfo.h"
+#include <utility>
+
 #include "MantidBeamline/DetectorInfo.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidGeometry/Instrument/Detector.h"
+#include "MantidGeometry/Instrument/DetectorInfo.h"
 #include "MantidGeometry/Instrument/DetectorInfoIterator.h"
 #include "MantidGeometry/Instrument/ReferenceFrame.h"
 #include "MantidKernel/EigenConversionHelpers.h"
@@ -27,8 +29,10 @@ DetectorInfo::DetectorInfo(
     boost::shared_ptr<const std::vector<detid_t>> detectorIds,
     boost::shared_ptr<const std::unordered_map<detid_t, size_t>>
         detIdToIndexMap)
-    : m_detectorInfo(std::move(detectorInfo)), m_instrument(instrument),
-      m_detectorIDs(detectorIds), m_detIDToIndex(detIdToIndexMap),
+    : m_detectorInfo(std::move(detectorInfo)),
+      m_instrument(std::move(instrument)),
+      m_detectorIDs(std::move(detectorIds)),
+      m_detIDToIndex(std::move(detIdToIndexMap)),
       m_lastDetector(PARALLEL_GET_MAX_THREADS),
       m_lastIndex(PARALLEL_GET_MAX_THREADS, -1) {
 
diff --git a/Framework/Geometry/src/Instrument/Goniometer.cpp b/Framework/Geometry/src/Instrument/Goniometer.cpp
index 15b7efd2f21..e2dd92bd476 100644
--- a/Framework/Geometry/src/Instrument/Goniometer.cpp
+++ b/Framework/Geometry/src/Instrument/Goniometer.cpp
@@ -14,6 +14,8 @@
 #include <sstream>
 #include <stdexcept>
 #include <string>
+#include <utility>
+
 #include <vector>
 
 using namespace Mantid::Kernel;
@@ -64,7 +66,7 @@ Goniometer::Goniometer() : R(3, 3, true), initFromR(false) {}
 /// Constructor from a rotation matrix
 /// @param rot :: DblMatrix matrix that is going to be the internal rotation
 /// matrix of the goniometer. Cannot push additional axes
-Goniometer::Goniometer(DblMatrix rot) {
+Goniometer::Goniometer(const DblMatrix &rot) {
   DblMatrix ide(3, 3), rtr(3, 3);
   rtr = rot.Tprime() * rot;
   ide.identityMatrix();
@@ -83,7 +85,7 @@ const Kernel::DblMatrix &Goniometer::getR() const { return R; }
 /// @param rot :: DblMatrix matrix that is going to be the internal rotation
 /// matrix of the goniometer.
 void Goniometer::setR(Kernel::DblMatrix rot) {
-  R = rot;
+  R = std::move(rot);
   initFromR = true;
 }
 
@@ -129,7 +131,7 @@ std::string Goniometer::axesInfo() {
   @param sense :: rotation sense (CW or CCW), CCW by default
   @param angUnit :: units for angle of type#AngleUnit, angDegrees by default
 */
-void Goniometer::pushAxis(std::string name, double axisx, double axisy,
+void Goniometer::pushAxis(const std::string &name, double axisx, double axisy,
                           double axisz, double angle, int sense, int angUnit) {
   if (initFromR) {
     throw std::runtime_error(
@@ -160,7 +162,7 @@ void Goniometer::pushAxis(std::string name, double axisx, double axisy,
   @param name :: GoniometerAxis name
   @param value :: value in the units that the axis is set
 */
-void Goniometer::setRotationAngle(std::string name, double value) {
+void Goniometer::setRotationAngle(const std::string &name, double value) {
   bool changed = false;
   std::vector<GoniometerAxis>::iterator it;
   for (it = motors.begin(); it < motors.end(); ++it) {
@@ -255,7 +257,7 @@ const GoniometerAxis &Goniometer::getAxis(size_t axisnumber) const {
 
 /// Get GoniometerAxis object using motor name
 /// @param axisname :: axis name
-const GoniometerAxis &Goniometer::getAxis(std::string axisname) const {
+const GoniometerAxis &Goniometer::getAxis(const std::string &axisname) const {
   for (auto it = motors.begin(); it < motors.end(); ++it) {
     if (axisname == it->name) {
       return (*it);
@@ -288,7 +290,7 @@ void Goniometer::makeUniversalGoniometer() {
  * @param convention :: the convention used to calculate Euler Angles. The
  * UniversalGoniometer is YZY, a triple axis goniometer at HFIR is YZX
  */
-std::vector<double> Goniometer::getEulerAngles(std::string convention) {
+std::vector<double> Goniometer::getEulerAngles(const std::string &convention) {
   return Quat(getR()).getEulerAngles(convention);
 }
 
diff --git a/Framework/Geometry/src/Instrument/GridDetector.cpp b/Framework/Geometry/src/Instrument/GridDetector.cpp
index cefb9052583..6acabcbfc1c 100644
--- a/Framework/Geometry/src/Instrument/GridDetector.cpp
+++ b/Framework/Geometry/src/Instrument/GridDetector.cpp
@@ -23,6 +23,7 @@
 #include <boost/regex.hpp>
 #include <ostream>
 #include <stdexcept>
+#include <utility>
 
 namespace Mantid {
 namespace Geometry {
@@ -548,7 +549,7 @@ void GridDetector::initializeValues(boost::shared_ptr<IObject> shape,
   m_xstep = xstep;
   m_ystep = ystep;
   m_zstep = zstep;
-  m_shape = shape;
+  m_shape = std::move(shape);
 
   /// IDs start here
   m_idstart = idstart;
@@ -609,9 +610,9 @@ void GridDetector::initialize(boost::shared_ptr<IObject> shape, int xpixels,
     throw std::runtime_error("GridDetector::initialize() called for a "
                              "parametrized GridDetector");
 
-  initializeValues(shape, xpixels, xstart, xstep, ypixels, ystart, ystep,
-                   zpixels, zstart, zstep, idstart, idFillOrder, idstepbyrow,
-                   idstep);
+  initializeValues(std::move(shape), xpixels, xstart, xstep, ypixels, ystart,
+                   ystep, zpixels, zstart, zstep, idstart, idFillOrder,
+                   idstepbyrow, idstep);
 
   std::string name = this->getName();
   int minDetId = idstart, maxDetId = idstart;
diff --git a/Framework/Geometry/src/Instrument/GridDetectorPixel.cpp b/Framework/Geometry/src/Instrument/GridDetectorPixel.cpp
index 065c74b89a1..0f1f8ac41be 100644
--- a/Framework/Geometry/src/Instrument/GridDetectorPixel.cpp
+++ b/Framework/Geometry/src/Instrument/GridDetectorPixel.cpp
@@ -4,8 +4,10 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidGeometry/Instrument/GridDetectorPixel.h"
+#include <utility>
+
 #include "MantidGeometry/Instrument/GridDetector.h"
+#include "MantidGeometry/Instrument/GridDetectorPixel.h"
 #include "MantidKernel/System.h"
 #include "MantidKernel/V3D.h"
 
@@ -36,12 +38,12 @@ GridDetectorPixel::GridDetectorPixel(const GridDetectorPixel *base,
  * @param layer :: layer of the pixel in the panel
  */
 GridDetectorPixel::GridDetectorPixel(const std::string &name, int id,
-                                     boost::shared_ptr<IObject> shape,
+                                     const boost::shared_ptr<IObject> &shape,
                                      IComponent *parent,
                                      const GridDetector *panel, size_t col,
                                      size_t row, size_t layer)
-    : Detector(name, id, shape, parent), m_panel(panel), m_col(col), m_row(row),
-      m_layer(layer) {
+    : Detector(name, id, std::move(shape), parent), m_panel(panel), m_col(col),
+      m_row(row), m_layer(layer) {
   if (!m_panel)
     throw std::runtime_error("GridDetectorPixel::ctor(): pixel " + name +
                              " has no valid GridDetector parent.");
diff --git a/Framework/Geometry/src/Instrument/InstrumentDefinitionParser.cpp b/Framework/Geometry/src/Instrument/InstrumentDefinitionParser.cpp
index aec5c955e3d..cce5e6cb36f 100644
--- a/Framework/Geometry/src/Instrument/InstrumentDefinitionParser.cpp
+++ b/Framework/Geometry/src/Instrument/InstrumentDefinitionParser.cpp
@@ -39,6 +39,7 @@
 #include <boost/make_shared.hpp>
 #include <boost/regex.hpp>
 #include <unordered_set>
+#include <utility>
 
 using namespace Mantid;
 using namespace Mantid::Kernel;
@@ -95,8 +96,8 @@ InstrumentDefinitionParser::InstrumentDefinitionParser(
  * @param xmlText :: XML contents of IDF
  */
 InstrumentDefinitionParser::InstrumentDefinitionParser(
-    const IDFObject_const_sptr xmlFile,
-    const IDFObject_const_sptr expectedCacheFile, const std::string &instName,
+    const IDFObject_const_sptr &xmlFile,
+    const IDFObject_const_sptr &expectedCacheFile, const std::string &instName,
     const std::string &xmlText)
     : m_xmlFile(boost::make_shared<NullIDFObject>()),
       m_cacheFile(boost::make_shared<NullIDFObject>()), m_pDoc(nullptr),
@@ -414,7 +415,7 @@ void InstrumentDefinitionParser::checkComponentContainsLocationElement(
  * @param filename :: Name of the IDF, for exception message
  */
 void InstrumentDefinitionParser::checkIdListExistsAndDefinesEnoughIDs(
-    IdList idList, Element *pElem, const std::string &filename) const {
+    const IdList &idList, Element *pElem, const std::string &filename) const {
   if (idList.counted != static_cast<int>(idList.vec.size())) {
     std::stringstream ss1, ss2;
     ss1 << idList.vec.size();
@@ -1990,7 +1991,7 @@ void InstrumentDefinitionParser::populateIdList(Poco::XML::Element *pE,
  *  @throw InstrumentDefinitionError Thrown if type not defined in XML
  *definition
  */
-bool InstrumentDefinitionParser::isAssembly(std::string type) const {
+bool InstrumentDefinitionParser::isAssembly(const std::string &type) const {
   const std::string filename = m_xmlFile->getFileFullPathStr();
   auto it = isTypeAssembly.find(type);
 
@@ -2580,7 +2581,8 @@ void InstrumentDefinitionParser::setComponentLinks(
 Apply the cache.
 @param cacheToApply : Cache file object to use the the geometries.
 */
-void InstrumentDefinitionParser::applyCache(IDFObject_const_sptr cacheToApply) {
+void InstrumentDefinitionParser::applyCache(
+    const IDFObject_const_sptr &cacheToApply) {
   const std::string cacheFullPath = cacheToApply->getFileFullPathStr();
   g_log.information("Loading geometry cache from " + cacheFullPath);
   // create a vtk reader
@@ -2605,14 +2607,14 @@ Write the cache file from the IDF file and apply it.
 InstrumentDefinitionParser::CachingOption
 InstrumentDefinitionParser::writeAndApplyCache(
     IDFObject_const_sptr firstChoiceCache, IDFObject_const_sptr fallBackCache) {
-  IDFObject_const_sptr usedCache = firstChoiceCache;
+  IDFObject_const_sptr usedCache = std::move(firstChoiceCache);
   auto cachingOption = WroteGeomCache;
 
   g_log.notice("Geometry cache is not available");
   try {
     Poco::File dir = usedCache->getParentDirectory();
     if (dir.path().empty() || !dir.exists() || !dir.canWrite()) {
-      usedCache = fallBackCache;
+      usedCache = std::move(fallBackCache);
       cachingOption = WroteCacheTemp;
       g_log.information()
           << "Geometrycache directory is read only, writing cache "
diff --git a/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp b/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp
index aeaa34b846d..57587fe9027 100644
--- a/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp
+++ b/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp
@@ -16,6 +16,7 @@
 #include <algorithm>
 #include <ostream>
 #include <stdexcept>
+#include <utility>
 
 namespace {
 Mantid::Kernel::Logger g_log("ObjCompAssembly");
@@ -609,7 +610,7 @@ boost::shared_ptr<IObject> ObjCompAssembly::createOutline() {
  * @param obj :: The outline shape created previously fith createOutline()
  */
 void ObjCompAssembly::setOutline(boost::shared_ptr<const IObject> obj) {
-  m_shape = obj;
+  m_shape = std::move(obj);
 }
 
 /** Print information about elements in the assembly to a stream
diff --git a/Framework/Geometry/src/Instrument/ObjComponent.cpp b/Framework/Geometry/src/Instrument/ObjComponent.cpp
index 4fe26facc65..f24ae4316de 100644
--- a/Framework/Geometry/src/Instrument/ObjComponent.cpp
+++ b/Framework/Geometry/src/Instrument/ObjComponent.cpp
@@ -15,6 +15,7 @@
 #include "MantidKernel/Exception.h"
 #include "MantidKernel/Material.h"
 #include <cfloat>
+#include <utility>
 
 namespace Mantid {
 namespace Geometry {
@@ -44,7 +45,7 @@ ObjComponent::ObjComponent(const std::string &name, IComponent *parent)
 ObjComponent::ObjComponent(const std::string &name,
                            boost::shared_ptr<const IObject> shape,
                            IComponent *parent)
-    : IObjComponent(), Component(name, parent), m_shape(shape) {}
+    : IObjComponent(), Component(name, parent), m_shape(std::move(shape)) {}
 
 /** Return the shape of the component
  */
@@ -65,7 +66,7 @@ void ObjComponent::setShape(boost::shared_ptr<const IObject> newShape) {
     throw std::runtime_error("ObjComponent::setShape - Cannot change the shape "
                              "of a parameterized object");
   else
-    m_shape = newShape;
+    m_shape = std::move(newShape);
 }
 
 /**
diff --git a/Framework/Geometry/src/Instrument/ParComponentFactory.cpp b/Framework/Geometry/src/Instrument/ParComponentFactory.cpp
index 4bcc922dcee..c37cc266ef7 100644
--- a/Framework/Geometry/src/Instrument/ParComponentFactory.cpp
+++ b/Framework/Geometry/src/Instrument/ParComponentFactory.cpp
@@ -58,7 +58,7 @@ ParComponentFactory::createInstrument(boost::shared_ptr<const Instrument> base,
  * @returns A pointer to a parameterized component
  */
 IComponent_sptr
-ParComponentFactory::create(boost::shared_ptr<const IComponent> base,
+ParComponentFactory::create(const boost::shared_ptr<const IComponent> &base,
                             const ParameterMap *map) {
   boost::shared_ptr<const IDetector> det_sptr =
       boost::dynamic_pointer_cast<const IDetector>(base);
diff --git a/Framework/Geometry/src/Instrument/RectangularDetector.cpp b/Framework/Geometry/src/Instrument/RectangularDetector.cpp
index 42cb3d0ce8e..03359db991e 100644
--- a/Framework/Geometry/src/Instrument/RectangularDetector.cpp
+++ b/Framework/Geometry/src/Instrument/RectangularDetector.cpp
@@ -22,6 +22,7 @@
 #include <boost/regex.hpp>
 #include <ostream>
 #include <stdexcept>
+#include <utility>
 
 namespace {
 /**
@@ -180,8 +181,8 @@ void RectangularDetector::initialize(boost::shared_ptr<IObject> shape,
                                      int idstepbyrow, int idstep) {
 
   GridDetector::initialize(
-      shape, xpixels, xstart, xstep, ypixels, ystart, ystep, 0, 0, 0, idstart,
-      idfillbyfirst_y ? "yxz" : "xyz", idstepbyrow, idstep);
+      std::move(shape), xpixels, xstart, xstep, ypixels, ystart, ystep, 0, 0, 0,
+      idstart, idfillbyfirst_y ? "yxz" : "xyz", idstepbyrow, idstep);
 }
 
 //------------------------------------------------------------------------------------------------
diff --git a/Framework/Geometry/src/Instrument/SampleEnvironment.cpp b/Framework/Geometry/src/Instrument/SampleEnvironment.cpp
index 96261b30070..4684a6319e1 100644
--- a/Framework/Geometry/src/Instrument/SampleEnvironment.cpp
+++ b/Framework/Geometry/src/Instrument/SampleEnvironment.cpp
@@ -29,7 +29,7 @@ using Kernel::V3D;
  * @param container The object that represents the can
  */
 SampleEnvironment::SampleEnvironment(std::string name,
-                                     Container_const_sptr container)
+                                     const Container_const_sptr &container)
     : m_name(std::move(name)), m_components(1, container) {}
 
 const IObject &SampleEnvironment::getComponent(const size_t index) const {
diff --git a/Framework/Geometry/src/MDGeometry/CompositeImplicitFunction.cpp b/Framework/Geometry/src/MDGeometry/CompositeImplicitFunction.cpp
index 1de3d75e75f..154f5adbb2b 100644
--- a/Framework/Geometry/src/MDGeometry/CompositeImplicitFunction.cpp
+++ b/Framework/Geometry/src/MDGeometry/CompositeImplicitFunction.cpp
@@ -23,7 +23,7 @@ namespace Mantid {
 namespace Geometry {
 
 bool CompositeImplicitFunction::addFunction(
-    Mantid::Geometry::MDImplicitFunction_sptr constituentFunction) {
+    const Mantid::Geometry::MDImplicitFunction_sptr &constituentFunction) {
   bool bSuccess = false;
   if (constituentFunction.get() != nullptr) {
     this->m_Functions.emplace_back(constituentFunction);
diff --git a/Framework/Geometry/src/MDGeometry/MDGeometryXMLBuilder.cpp b/Framework/Geometry/src/MDGeometry/MDGeometryXMLBuilder.cpp
index 5d1e231ddf8..85b59c805d9 100644
--- a/Framework/Geometry/src/MDGeometry/MDGeometryXMLBuilder.cpp
+++ b/Framework/Geometry/src/MDGeometry/MDGeometryXMLBuilder.cpp
@@ -53,7 +53,7 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addOrdinaryDimension(
  */
 template <typename CheckDimensionPolicy>
 void MDGeometryBuilderXML<CheckDimensionPolicy>::addManyOrdinaryDimensions(
-    VecIMDDimension_sptr manyDims) const {
+    const VecIMDDimension_sptr &manyDims) const {
   for (auto &manyDim : manyDims) {
     addOrdinaryDimension(manyDim);
   }
@@ -106,7 +106,7 @@ void MDGeometryBuilderXML<CheckDimensionPolicy>::applyPolicyChecking(
  */
 template <typename CheckDimensionPolicy>
 bool MDGeometryBuilderXML<CheckDimensionPolicy>::addXDimension(
-    IMDDimension_const_sptr dimension) const {
+    const IMDDimension_const_sptr &dimension) const {
 
   bool bAdded = false;
   if (dimension) {
@@ -126,7 +126,7 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addXDimension(
  */
 template <typename CheckDimensionPolicy>
 bool MDGeometryBuilderXML<CheckDimensionPolicy>::addYDimension(
-    IMDDimension_const_sptr dimension) const {
+    const IMDDimension_const_sptr &dimension) const {
 
   bool bAdded = false;
   if (dimension) {
@@ -146,7 +146,7 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addYDimension(
  */
 template <typename CheckDimensionPolicy>
 bool MDGeometryBuilderXML<CheckDimensionPolicy>::addZDimension(
-    IMDDimension_const_sptr dimension) const {
+    const IMDDimension_const_sptr &dimension) const {
   bool bAdded = false;
   if (dimension) {
     applyPolicyChecking(*dimension);
@@ -165,7 +165,7 @@ bool MDGeometryBuilderXML<CheckDimensionPolicy>::addZDimension(
  */
 template <typename CheckDimensionPolicy>
 bool MDGeometryBuilderXML<CheckDimensionPolicy>::addTDimension(
-    IMDDimension_const_sptr dimension) const {
+    const IMDDimension_const_sptr &dimension) const {
 
   bool bAdded = false;
   if (dimension) {
diff --git a/Framework/Geometry/src/MDGeometry/MDGeometryXMLParser.cpp b/Framework/Geometry/src/MDGeometry/MDGeometryXMLParser.cpp
index 00dee415aaf..26735df1cc4 100644
--- a/Framework/Geometry/src/MDGeometry/MDGeometryXMLParser.cpp
+++ b/Framework/Geometry/src/MDGeometry/MDGeometryXMLParser.cpp
@@ -5,6 +5,7 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include <algorithm>
+#include <utility>
 
 #include "MantidGeometry/MDGeometry/IMDDimensionFactory.h"
 #include "MantidGeometry/MDGeometry/MDGeometryXMLDefinitions.h"
@@ -23,14 +24,14 @@ struct findID {
   const std::string m_id;
   explicit findID(const std::string &id) : m_id(id) {}
 
-  bool operator()(const Mantid::Geometry::IMDDimension_sptr obj) const {
+  bool operator()(const Mantid::Geometry::IMDDimension_sptr &obj) const {
     return m_id == obj->getDimensionId();
   }
 };
 
 /// Helper unary comparison type for finding non-integrated dimensions.
 struct findIntegrated {
-  bool operator()(const Mantid::Geometry::IMDDimension_sptr obj) const {
+  bool operator()(const Mantid::Geometry::IMDDimension_sptr &obj) const {
     return obj->getIsIntegrated();
   }
 };
@@ -307,7 +308,7 @@ Setter for the root element.
 "Dimensions" unless xml snippet passed in directly, in which case do not set.
 */
 void MDGeometryXMLParser::SetRootNodeCheck(std::string elementName) {
-  m_rootNodeName = elementName;
+  m_rootNodeName = std::move(elementName);
 }
 
 /**
@@ -346,7 +347,7 @@ Determines whether query dimension is the x dimension.
 @return true if matches.
 */
 bool MDGeometryXMLParser::isXDimension(
-    Mantid::Geometry::IMDDimension_sptr candidate) const {
+    const Mantid::Geometry::IMDDimension_sptr &candidate) const {
   validate();
   bool bResult = false;
   if (hasXDimension()) {
@@ -363,7 +364,7 @@ Determines whether query dimension is the y dimension.
 @return true if matches.
 */
 bool MDGeometryXMLParser::isYDimension(
-    Mantid::Geometry::IMDDimension_sptr candidate) const {
+    const Mantid::Geometry::IMDDimension_sptr &candidate) const {
   validate();
   bool bResult = false;
   if (hasYDimension()) {
@@ -380,7 +381,7 @@ Determines whether query dimension is the z dimension.
 @return true if matches.
 */
 bool MDGeometryXMLParser::isZDimension(
-    Mantid::Geometry::IMDDimension_sptr candidate) const {
+    const Mantid::Geometry::IMDDimension_sptr &candidate) const {
   validate();
   bool bResult = false;
   if (hasZDimension()) {
@@ -397,7 +398,7 @@ Determines whether query dimension is the t dimension.
 @return true if matches.
 */
 bool MDGeometryXMLParser::isTDimension(
-    Mantid::Geometry::IMDDimension_sptr candidate) const {
+    const Mantid::Geometry::IMDDimension_sptr &candidate) const {
   validate();
   bool bResult = false;
   if (hasTDimension()) {
diff --git a/Framework/Geometry/src/MDGeometry/MDHistoDimensionBuilder.cpp b/Framework/Geometry/src/MDGeometry/MDHistoDimensionBuilder.cpp
index 258aaf310fd..83d19054edb 100644
--- a/Framework/Geometry/src/MDGeometry/MDHistoDimensionBuilder.cpp
+++ b/Framework/Geometry/src/MDGeometry/MDHistoDimensionBuilder.cpp
@@ -4,8 +4,10 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h"
+#include <utility>
+
 #include "MantidGeometry/MDGeometry/MDFrameFactory.h"
+#include "MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h"
 #include "MantidKernel/Strings.h"
 #include "MantidKernel/UnitLabelTypes.h"
 
@@ -21,7 +23,7 @@ MDHistoDimensionBuilder::MDHistoDimensionBuilder()
 Setter for the dimension name
 @param name : friendly name of dimension
 */
-void MDHistoDimensionBuilder::setName(std::string name) {
+void MDHistoDimensionBuilder::setName(const std::string &name) {
   // String any spaces
   m_name = Kernel::Strings::strip(name);
 }
@@ -30,7 +32,7 @@ void MDHistoDimensionBuilder::setName(std::string name) {
 Setter for the dimension id
 @param id : id of the dimension
 */
-void MDHistoDimensionBuilder::setId(std::string id) { m_id = id; }
+void MDHistoDimensionBuilder::setId(std::string id) { m_id = std::move(id); }
 
 /*
 Setter for the dimension units
@@ -69,7 +71,7 @@ void MDHistoDimensionBuilder::setNumBins(size_t nbins) { m_nbins = nbins; }
  * @param frameName: the frame name
  */
 void MDHistoDimensionBuilder::setFrameName(std::string frameName) {
-  m_frameName = frameName;
+  m_frameName = std::move(frameName);
 }
 
 /*
diff --git a/Framework/Geometry/src/Objects/CSGObject.cpp b/Framework/Geometry/src/Objects/CSGObject.cpp
index 6a140257766..9985ef2753a 100644
--- a/Framework/Geometry/src/Objects/CSGObject.cpp
+++ b/Framework/Geometry/src/Objects/CSGObject.cpp
@@ -38,6 +38,7 @@
 #include <deque>
 #include <random>
 #include <stack>
+#include <utility>
 
 using namespace Mantid::Geometry;
 using namespace Mantid::Kernel;
@@ -2113,7 +2114,8 @@ int CSGObject::searchForObject(Kernel::V3D &point) const {
  * Set the geometry handler for Object
  * @param[in] h is pointer to the geometry handler.
  */
-void CSGObject::setGeometryHandler(boost::shared_ptr<GeometryHandler> h) {
+void CSGObject::setGeometryHandler(
+    const boost::shared_ptr<GeometryHandler> &h) {
   if (h)
     m_handler = h;
 }
@@ -2145,7 +2147,7 @@ void CSGObject::initDraw() const {
  */
 void CSGObject::setVtkGeometryCacheWriter(
     boost::shared_ptr<vtkGeometryCacheWriter> writer) {
-  vtkCacheWriter = writer;
+  vtkCacheWriter = std::move(writer);
   updateGeometryHandler();
 }
 
@@ -2154,7 +2156,7 @@ void CSGObject::setVtkGeometryCacheWriter(
  */
 void CSGObject::setVtkGeometryCacheReader(
     boost::shared_ptr<vtkGeometryCacheReader> reader) {
-  vtkCacheReader = reader;
+  vtkCacheReader = std::move(reader);
   updateGeometryHandler();
 }
 
diff --git a/Framework/Geometry/src/Objects/InstrumentRayTracer.cpp b/Framework/Geometry/src/Objects/InstrumentRayTracer.cpp
index b7e5abd938f..772ca27da44 100644
--- a/Framework/Geometry/src/Objects/InstrumentRayTracer.cpp
+++ b/Framework/Geometry/src/Objects/InstrumentRayTracer.cpp
@@ -15,6 +15,7 @@
 #include "MantidKernel/V3D.h"
 #include <deque>
 #include <iterator>
+#include <utility>
 
 namespace Mantid {
 namespace Geometry {
@@ -33,7 +34,7 @@ using Kernel::V3D;
  * have a defined source.
  */
 InstrumentRayTracer::InstrumentRayTracer(Instrument_const_sptr instrument)
-    : m_instrument(instrument) {
+    : m_instrument(std::move(instrument)) {
   if (!m_instrument) {
     std::ostringstream lexer;
     lexer << "Cannot create a InstrumentRayTracer, invalid instrument given. "
diff --git a/Framework/Geometry/src/Objects/MeshObject.cpp b/Framework/Geometry/src/Objects/MeshObject.cpp
index 4cd9be323fa..a17fadbd163 100644
--- a/Framework/Geometry/src/Objects/MeshObject.cpp
+++ b/Framework/Geometry/src/Objects/MeshObject.cpp
@@ -21,7 +21,7 @@ namespace Geometry {
 
 MeshObject::MeshObject(const std::vector<uint32_t> &faces,
                        const std::vector<Kernel::V3D> &vertices,
-                       const Kernel::Material material)
+                       const Kernel::Material &material)
     : m_boundingBox(), m_id("MeshObject"), m_triangles(faces),
       m_vertices(vertices), m_material(material) {
 
@@ -453,7 +453,8 @@ bool MeshObject::searchForObject(Kernel::V3D &point) const {
  * @param[in] h is pointer to the geometry handler. don't delete this pointer in
  * the calling function.
  */
-void MeshObject::setGeometryHandler(boost::shared_ptr<GeometryHandler> h) {
+void MeshObject::setGeometryHandler(
+    const boost::shared_ptr<GeometryHandler> &h) {
   if (h == nullptr)
     return;
   m_handler = h;
diff --git a/Framework/Geometry/src/Rendering/GeometryHandler.cpp b/Framework/Geometry/src/Rendering/GeometryHandler.cpp
index a51eea57de1..d0a8d079e35 100644
--- a/Framework/Geometry/src/Rendering/GeometryHandler.cpp
+++ b/Framework/Geometry/src/Rendering/GeometryHandler.cpp
@@ -19,7 +19,7 @@ namespace Geometry {
 
 GeometryHandler::GeometryHandler(IObjComponent *comp) : m_objComp(comp) {}
 
-GeometryHandler::GeometryHandler(boost::shared_ptr<CSGObject> obj)
+GeometryHandler::GeometryHandler(const boost::shared_ptr<CSGObject> &obj)
     : m_triangulator(new detail::GeometryTriangulator(obj.get())),
       m_csgObj(obj.get()) {}
 
diff --git a/Framework/Geometry/src/Rendering/vtkGeometryCacheReader.cpp b/Framework/Geometry/src/Rendering/vtkGeometryCacheReader.cpp
index 11ec99e32fe..627d711b01a 100644
--- a/Framework/Geometry/src/Rendering/vtkGeometryCacheReader.cpp
+++ b/Framework/Geometry/src/Rendering/vtkGeometryCacheReader.cpp
@@ -13,6 +13,8 @@
 #include <Poco/Exception.h>
 #include <Poco/SAX/InputSource.h>
 
+#include <utility>
+
 #include "MantidGeometry/Objects/CSGObject.h"
 #include "MantidGeometry/Rendering/GeometryHandler.h"
 #include "MantidGeometry/Rendering/vtkGeometryCacheReader.h"
@@ -33,7 +35,7 @@ Kernel::Logger g_log("vtkGeometryCacheReader");
  * Constructor
  */
 vtkGeometryCacheReader::vtkGeometryCacheReader(std::string filename) {
-  mFileName = filename;
+  mFileName = std::move(filename);
   mDoc = nullptr;
   Init();
 }
@@ -104,7 +106,7 @@ void vtkGeometryCacheReader::readCacheForObject(IObject *obj) {
  * Get the Element by using the object name
  */
 Poco::XML::Element *
-vtkGeometryCacheReader::getElementByObjectName(std::string name) {
+vtkGeometryCacheReader::getElementByObjectName(const std::string &name) {
   Element *pRoot = mDoc->documentElement();
   if (pRoot == nullptr || pRoot->nodeName() != "VTKFile")
     return nullptr;
diff --git a/Framework/Geometry/src/Rendering/vtkGeometryCacheWriter.cpp b/Framework/Geometry/src/Rendering/vtkGeometryCacheWriter.cpp
index 84b834bccf0..c3a6460587c 100644
--- a/Framework/Geometry/src/Rendering/vtkGeometryCacheWriter.cpp
+++ b/Framework/Geometry/src/Rendering/vtkGeometryCacheWriter.cpp
@@ -22,6 +22,7 @@
 
 #include <fstream>
 #include <sstream>
+#include <utility>
 
 using Poco::XML::AutoPtr;
 using Poco::XML::Document;
@@ -41,7 +42,7 @@ Kernel::Logger g_log("vtkGeometryCacheWriter");
  * Constructor
  */
 vtkGeometryCacheWriter::vtkGeometryCacheWriter(std::string filename) {
-  mFileName = filename;
+  mFileName = std::move(filename);
 
   mDoc = new Document();
   Init();
diff --git a/Framework/Geometry/test/CSGObjectTest.h b/Framework/Geometry/test/CSGObjectTest.h
index d99f7164575..2f9da83d6f4 100644
--- a/Framework/Geometry/test/CSGObjectTest.h
+++ b/Framework/Geometry/test/CSGObjectTest.h
@@ -416,7 +416,7 @@ public:
     TS_ASSERT_EQUALS(index, expectedResults.size());
   }
 
-  void checkTrackIntercept(IObject_sptr obj, Track &track,
+  void checkTrackIntercept(const IObject_sptr &obj, Track &track,
                            const std::vector<Link> &expectedResults) {
     int unitCount = obj->interceptSurface(track);
     TS_ASSERT_EQUALS(unitCount, expectedResults.size());
diff --git a/Framework/Geometry/test/IndexingUtilsTest.h b/Framework/Geometry/test/IndexingUtilsTest.h
index 3e4d2faea0f..25f07e272c4 100644
--- a/Framework/Geometry/test/IndexingUtilsTest.h
+++ b/Framework/Geometry/test/IndexingUtilsTest.h
@@ -14,6 +14,8 @@
 #include "MantidKernel/V3D.h"
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 using namespace Mantid::Geometry;
 using Mantid::Kernel::Matrix;
 using Mantid::Kernel::V3D;
@@ -55,7 +57,7 @@ public:
 
   static void ShowLatticeParameters(Matrix<double> UB) {
     Matrix<double> UB_inv(3, 3, false);
-    UB_inv = UB;
+    UB_inv = std::move(UB);
     UB_inv.Invert();
     V3D a_dir(UB_inv[0][0], UB_inv[0][1], UB_inv[0][2]);
     V3D b_dir(UB_inv[1][0], UB_inv[1][1], UB_inv[1][2]);
@@ -73,7 +75,8 @@ public:
     std::cout << "-------------------------------------------\n";
   }
 
-  static void ShowIndexingStats(Matrix<double> UB, std::vector<V3D> q_vectors,
+  static void ShowIndexingStats(const Matrix<double> &UB,
+                                const std::vector<V3D> &q_vectors,
                                 double required_tolerance) {
     std::vector<V3D> miller_indices;
     std::vector<V3D> indexed_qs;
diff --git a/Framework/Geometry/test/InstrumentDefinitionParserTest.h b/Framework/Geometry/test/InstrumentDefinitionParserTest.h
index ca4654fedc2..8ad15d693e8 100644
--- a/Framework/Geometry/test/InstrumentDefinitionParserTest.h
+++ b/Framework/Geometry/test/InstrumentDefinitionParserTest.h
@@ -34,7 +34,7 @@ private:
   /// Mock Type to act as IDF files.
   class MockIDFObject : public Mantid::Geometry::IDFObject {
   public:
-    MockIDFObject(const std::string fileName)
+    MockIDFObject(const std::string &fileName)
         : Mantid::Geometry::IDFObject(fileName) {}
     MOCK_CONST_METHOD0(exists, bool());
   };
@@ -42,7 +42,7 @@ private:
   /// Mock Type to act as IDF files.
   class MockIDFObjectWithParentDirectory : public Mantid::Geometry::IDFObject {
   public:
-    MockIDFObjectWithParentDirectory(const std::string fileName)
+    MockIDFObjectWithParentDirectory(const std::string &fileName)
         : Mantid::Geometry::IDFObject(fileName) {}
     MOCK_CONST_METHOD0(exists, bool());
     MOCK_CONST_METHOD0(getParentDirectory, const Poco::Path());
@@ -54,7 +54,7 @@ private:
   */
   struct IDFEnvironment {
     IDFEnvironment(const ScopedFile &idf, const ScopedFile &vtp,
-                   const std::string xmlText, const std::string instName)
+                   const std::string &xmlText, const std::string &instName)
         : _idf(idf), _vtp(vtp), _xmlText(xmlText), _instName(instName){};
 
     ScopedFile _idf;
@@ -980,8 +980,8 @@ public:
     TS_ASSERT_DELTA(instr->getDetector(5)->getPos().Z(), 3.0, 1.0E-8);
   }
 
-  void checkDetectorRot(IDetector_const_sptr det, double deg, double axisx,
-                        double axisy, double axisz) {
+  void checkDetectorRot(const IDetector_const_sptr &det, double deg,
+                        double axisx, double axisy, double axisz) {
     double detDeg, detAxisX, detAxisY, detAxisZ;
     det->getRotation().getAngleAxis(detDeg, detAxisX, detAxisY, detAxisZ);
 
diff --git a/Framework/Geometry/test/InstrumentRayTracerTest.h b/Framework/Geometry/test/InstrumentRayTracerTest.h
index 80357a524c2..5fea17192a9 100644
--- a/Framework/Geometry/test/InstrumentRayTracerTest.h
+++ b/Framework/Geometry/test/InstrumentRayTracerTest.h
@@ -163,8 +163,9 @@ public:
    * @param expectX :: expected x index, -1 if off
    * @param expectY :: expected y index, -1 if off
    */
-  void doTestRectangularDetector(std::string message, Instrument_sptr inst,
-                                 V3D testDir, int expectX, int expectY) {
+  void doTestRectangularDetector(const std::string &message,
+                                 const Instrument_sptr &inst, V3D testDir,
+                                 int expectX, int expectY) {
     InstrumentRayTracer tracker(inst);
     testDir.normalize();
     tracker.traceFromSample(testDir);
diff --git a/Framework/Geometry/test/PointGroupTest.h b/Framework/Geometry/test/PointGroupTest.h
index 39929db7257..8917d739944 100644
--- a/Framework/Geometry/test/PointGroupTest.h
+++ b/Framework/Geometry/test/PointGroupTest.h
@@ -22,7 +22,7 @@ using namespace Mantid::Geometry;
 
 class PointGroupTest : public CxxTest::TestSuite {
 public:
-  void check_point_group(std::string name, V3D hkl, size_t numEquiv,
+  void check_point_group(const std::string &name, V3D hkl, size_t numEquiv,
                          V3D *equiv) {
     PointGroup_sptr testedPointGroup =
         PointGroupFactory::Instance().createPointGroup(name);
diff --git a/Framework/Geometry/test/ShapeFactoryTest.h b/Framework/Geometry/test/ShapeFactoryTest.h
index 9f89f8aa98b..5d6fe1e5c28 100644
--- a/Framework/Geometry/test/ShapeFactoryTest.h
+++ b/Framework/Geometry/test/ShapeFactoryTest.h
@@ -636,7 +636,7 @@ public:
     TS_ASSERT(!shape_sptr->isValid(V3D(0.0, 0.0, 1)));
   }
 
-  boost::shared_ptr<CSGObject> getObject(std::string xmlShape) {
+  boost::shared_ptr<CSGObject> getObject(const std::string &xmlShape) {
     std::string shapeXML = "<type name=\"userShape\"> " + xmlShape + " </type>";
 
     // Set up the DOM parser and parse xml string
diff --git a/Framework/ICat/inc/MantidICat/ICat4/ICat4Catalog.h b/Framework/ICat/inc/MantidICat/ICat4/ICat4Catalog.h
index b0e5ac59b1e..0fdc12b1215 100644
--- a/Framework/ICat/inc/MantidICat/ICat4/ICat4Catalog.h
+++ b/Framework/ICat/inc/MantidICat/ICat4/ICat4Catalog.h
@@ -79,7 +79,7 @@ private:
   void saveDataFiles(std::vector<ICat4::xsd__anyType *> response,
                      API::ITableWorkspace_sptr &outputws);
   // Saves "DataSets" information to the output workspace.
-  void saveDataSets(std::vector<ICat4::xsd__anyType *> response,
+  void saveDataSets(const std::vector<ICat4::xsd__anyType *> &response,
                     API::ITableWorkspace_sptr &outputws);
   // Convert a file size to human readable file format.
   std::string bytesToString(int64_t &fileSize);
diff --git a/Framework/ICat/src/CatalogLogin.cpp b/Framework/ICat/src/CatalogLogin.cpp
index d40247dda00..bb03ee258fe 100644
--- a/Framework/ICat/src/CatalogLogin.cpp
+++ b/Framework/ICat/src/CatalogLogin.cpp
@@ -24,7 +24,7 @@ namespace {
 std::vector<std::string> namesOfFacilitiesWithICAT() {
   const auto &config = Kernel::ConfigService::Instance();
 
-  const auto facilityDoesNotHaveICAT = [&](std::string name) {
+  const auto facilityDoesNotHaveICAT = [&](const std::string &name) {
     return config.getFacility(name).catalogInfo().soapEndPoint().empty();
   };
 
diff --git a/Framework/ICat/src/ICat4/ICat4Catalog.cpp b/Framework/ICat/src/ICat4/ICat4Catalog.cpp
index baf14af9cfe..babd68ba9aa 100644
--- a/Framework/ICat/src/ICat4/ICat4Catalog.cpp
+++ b/Framework/ICat/src/ICat4/ICat4Catalog.cpp
@@ -435,7 +435,7 @@ void ICat4Catalog::getDataSets(const std::string &investigationId,
  * @param response :: A vector containing the results of the search query.
  * @param outputws :: Shared pointer to output workspace.
  */
-void ICat4Catalog::saveDataSets(std::vector<xsd__anyType *> response,
+void ICat4Catalog::saveDataSets(const std::vector<xsd__anyType *> &response,
                                 API::ITableWorkspace_sptr &outputws) {
   if (outputws->getColumnNames().empty()) {
     // Add rows headers to the output workspace.
diff --git a/Framework/Indexing/inc/MantidIndexing/IndexInfo.h b/Framework/Indexing/inc/MantidIndexing/IndexInfo.h
index 2c20d8f7edb..42392f70f58 100644
--- a/Framework/Indexing/inc/MantidIndexing/IndexInfo.h
+++ b/Framework/Indexing/inc/MantidIndexing/IndexInfo.h
@@ -87,8 +87,9 @@ public:
 
   void
   setSpectrumDefinitions(std::vector<SpectrumDefinition> spectrumDefinitions);
-  void setSpectrumDefinitions(
-      Kernel::cow_ptr<std::vector<SpectrumDefinition>> spectrumDefinitions);
+  void
+  setSpectrumDefinitions(const Kernel::cow_ptr<std::vector<SpectrumDefinition>>
+                             &spectrumDefinitions);
   const Kernel::cow_ptr<std::vector<SpectrumDefinition>> &
   spectrumDefinitions() const;
 
diff --git a/Framework/Indexing/src/IndexInfo.cpp b/Framework/Indexing/src/IndexInfo.cpp
index 79b7462634f..eb8e07adf81 100644
--- a/Framework/Indexing/src/IndexInfo.cpp
+++ b/Framework/Indexing/src/IndexInfo.cpp
@@ -174,7 +174,8 @@ void IndexInfo::setSpectrumDefinitions(
  * indices. Validation requires access to the instrument and thus cannot be done
  * internally in IndexInfo, i.e., spectrum definitions must be set by hand. */
 void IndexInfo::setSpectrumDefinitions(
-    Kernel::cow_ptr<std::vector<SpectrumDefinition>> spectrumDefinitions) {
+    const Kernel::cow_ptr<std::vector<SpectrumDefinition>>
+        &spectrumDefinitions) {
   if (!spectrumDefinitions || (size() != spectrumDefinitions->size()))
     throw std::runtime_error(
         "IndexInfo: Size mismatch when setting new spectrum definitions");
diff --git a/Framework/Indexing/test/PartitionerTest.h b/Framework/Indexing/test/PartitionerTest.h
index 3a53a0b5bff..f64f74c41ae 100644
--- a/Framework/Indexing/test/PartitionerTest.h
+++ b/Framework/Indexing/test/PartitionerTest.h
@@ -8,6 +8,8 @@
 
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "MantidIndexing/Partitioner.h"
 
 using namespace Mantid;
@@ -23,7 +25,8 @@ public:
   PartitionerHelper(int numberOfPartitions, const PartitionIndex partition,
                     const MonitorStrategy monitorStrategy,
                     std::vector<GlobalSpectrumIndex> monitors)
-      : Partitioner(numberOfPartitions, partition, monitorStrategy, monitors) {}
+      : Partitioner(numberOfPartitions, partition, monitorStrategy,
+                    std::move(monitors)) {}
 
 private:
   PartitionIndex doIndexOf(const GlobalSpectrumIndex) const override {
diff --git a/Framework/Kernel/inc/MantidKernel/ArrayProperty.h b/Framework/Kernel/inc/MantidKernel/ArrayProperty.h
index 31682068bb7..1dff3f72ca9 100644
--- a/Framework/Kernel/inc/MantidKernel/ArrayProperty.h
+++ b/Framework/Kernel/inc/MantidKernel/ArrayProperty.h
@@ -28,16 +28,18 @@ namespace Kernel {
 template <typename T>
 class DLLExport ArrayProperty : public PropertyWithValue<std::vector<T>> {
 public:
-  ArrayProperty(std::string name, std::vector<T> vec,
-                IValidator_sptr validator = IValidator_sptr(new NullValidator),
+  ArrayProperty(
+      const std::string &name, std::vector<T> vec,
+      const IValidator_sptr &validator = IValidator_sptr(new NullValidator),
+      const unsigned int direction = Direction::Input);
+  ArrayProperty(const std::string &name, const IValidator_sptr &validator,
                 const unsigned int direction = Direction::Input);
-  ArrayProperty(std::string name, IValidator_sptr validator,
-                const unsigned int direction = Direction::Input);
-  ArrayProperty(std::string name,
-                const unsigned int direction = Direction::Input);
-  ArrayProperty(std::string name, const std::string &values,
-                IValidator_sptr validator = IValidator_sptr(new NullValidator),
+  ArrayProperty(const std::string &name,
                 const unsigned int direction = Direction::Input);
+  ArrayProperty(
+      const std::string &name, const std::string &values,
+      const IValidator_sptr &validator = IValidator_sptr(new NullValidator),
+      const unsigned int direction = Direction::Input);
 
   ArrayProperty<T> *clone() const override;
 
diff --git a/Framework/Kernel/inc/MantidKernel/CompositeValidator.h b/Framework/Kernel/inc/MantidKernel/CompositeValidator.h
index b386e9d55e8..539762d4fe4 100644
--- a/Framework/Kernel/inc/MantidKernel/CompositeValidator.h
+++ b/Framework/Kernel/inc/MantidKernel/CompositeValidator.h
@@ -41,7 +41,7 @@ public:
   /// Clones this and the children into a new Validator
   IValidator_sptr clone() const override;
   /// Adds a validator to the group of validators to check
-  void add(IValidator_sptr child);
+  void add(const IValidator_sptr &child);
   /// Add a validator based on a template type. Useful for validators that need
   /// no arguments
   template <typename T> void add() { this->add(boost::make_shared<T>()); }
diff --git a/Framework/Kernel/inc/MantidKernel/ErrorReporter.h b/Framework/Kernel/inc/MantidKernel/ErrorReporter.h
index 785913ae656..40369730102 100644
--- a/Framework/Kernel/inc/MantidKernel/ErrorReporter.h
+++ b/Framework/Kernel/inc/MantidKernel/ErrorReporter.h
@@ -21,16 +21,21 @@ namespace Kernel {
 class MANTID_KERNEL_DLL ErrorReporter {
 public:
   /// Constructor
-  ErrorReporter(std::string application, Types::Core::time_duration startTime,
-                std::string exitCode, bool share);
+  ErrorReporter(const std::string &application,
+                const Types::Core::time_duration &startTime,
+                const std::string &exitCode, bool share);
   /// Constructor
-  ErrorReporter(std::string application, Types::Core::time_duration startTime,
-                std::string exitCode, bool share, std::string name,
-                std::string email, std::string textBox);
+  ErrorReporter(const std::string &application,
+                const Types::Core::time_duration &startTime,
+                const std::string &exitCode, bool share,
+                const std::string &name, const std::string &email,
+                const std::string &textBox);
   /// Constructor
-  ErrorReporter(std::string application, Types::Core::time_duration startTime,
-                std::string exitCode, bool share, std::string name,
-                std::string email, std::string textBox, std::string stacktrace);
+  ErrorReporter(const std::string &application,
+                const Types::Core::time_duration &startTime,
+                const std::string &exitCode, bool share,
+                const std::string &name, const std::string &email,
+                const std::string &textBox, const std::string &stacktrace);
   /// Sends an error report
   int sendErrorReport();
 
diff --git a/Framework/Kernel/inc/MantidKernel/FunctionTask.h b/Framework/Kernel/inc/MantidKernel/FunctionTask.h
index 905d34025fe..6d0d2a849fa 100644
--- a/Framework/Kernel/inc/MantidKernel/FunctionTask.h
+++ b/Framework/Kernel/inc/MantidKernel/FunctionTask.h
@@ -13,6 +13,8 @@
 
 #ifndef Q_MOC_RUN
 #include <boost/function.hpp>
+#include <utility>
+
 #endif
 
 namespace Mantid {
@@ -61,7 +63,7 @@ public:
    * @param cost :: computational cost
    */
   FunctionTask(std::function<void()> func, double cost = 1.0)
-      : Task(cost), m_voidFunc(func) {}
+      : Task(cost), m_voidFunc(std::move(func)) {}
 
   //---------------------------------------------------------------------------------------------
   /** Main method that performs the work for the task. */
diff --git a/Framework/Kernel/inc/MantidKernel/IndexSet.h b/Framework/Kernel/inc/MantidKernel/IndexSet.h
index 92e33fc2b7e..461ffc193b0 100644
--- a/Framework/Kernel/inc/MantidKernel/IndexSet.h
+++ b/Framework/Kernel/inc/MantidKernel/IndexSet.h
@@ -27,7 +27,7 @@ class MANTID_KERNEL_DLL IndexSet {
 public:
   IndexSet(size_t fullRange);
   IndexSet(int64_t min, int64_t max, size_t fullRange);
-  IndexSet(const std::vector<size_t> indices, size_t fullRange);
+  IndexSet(const std::vector<size_t> &indices, size_t fullRange);
 
   /// Returns the size of the set.
   size_t size() const { return m_size; }
diff --git a/Framework/Kernel/inc/MantidKernel/MaskedProperty.h b/Framework/Kernel/inc/MantidKernel/MaskedProperty.h
index 72c24d37fa7..b64a0cfb602 100644
--- a/Framework/Kernel/inc/MantidKernel/MaskedProperty.h
+++ b/Framework/Kernel/inc/MantidKernel/MaskedProperty.h
@@ -28,9 +28,10 @@ template <typename TYPE = std::string>
 class MaskedProperty : public Kernel::PropertyWithValue<TYPE> {
 public:
   /// Constructor with a validator
-  MaskedProperty(const std::string &name, TYPE defaultvalue,
-                 IValidator_sptr validator = IValidator_sptr(new NullValidator),
-                 const unsigned int direction = Direction::Input);
+  MaskedProperty(
+      const std::string &name, TYPE defaultvalue,
+      const IValidator_sptr &validator = IValidator_sptr(new NullValidator),
+      const unsigned int direction = Direction::Input);
   /// Constructor with a validator without validation
   MaskedProperty(const std::string &name, const TYPE &defaultvalue,
                  const unsigned int direction);
diff --git a/Framework/Kernel/inc/MantidKernel/Material.h b/Framework/Kernel/inc/MantidKernel/Material.h
index 6dc7b597b69..72cf13eac41 100644
--- a/Framework/Kernel/inc/MantidKernel/Material.h
+++ b/Framework/Kernel/inc/MantidKernel/Material.h
@@ -56,7 +56,8 @@ public:
 
   using ChemicalFormula = std::vector<FormulaUnit>;
 
-  static ChemicalFormula parseChemicalFormula(const std::string chemicalSymbol);
+  static ChemicalFormula
+  parseChemicalFormula(const std::string &chemicalSymbol);
 
   /// Default constructor. Required for other parts of the code to
   /// function correctly. The material is considered "empty"
diff --git a/Framework/Kernel/inc/MantidKernel/MatrixProperty.h b/Framework/Kernel/inc/MantidKernel/MatrixProperty.h
index e3506e147a2..d840b9e35ef 100644
--- a/Framework/Kernel/inc/MantidKernel/MatrixProperty.h
+++ b/Framework/Kernel/inc/MantidKernel/MatrixProperty.h
@@ -23,9 +23,10 @@ class MatrixProperty : public PropertyWithValue<Matrix<TYPE>> {
 
 public:
   /// Constructor
-  MatrixProperty(const std::string &propName,
-                 IValidator_sptr validator = IValidator_sptr(new NullValidator),
-                 unsigned int direction = Direction::Input);
+  MatrixProperty(
+      const std::string &propName,
+      const IValidator_sptr &validator = IValidator_sptr(new NullValidator),
+      unsigned int direction = Direction::Input);
   /// Copy constructor
   MatrixProperty(const MatrixProperty &rhs);
   // Unhide base class members (at minimum, avoids Intel compiler warning)
diff --git a/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h b/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h
index d24066c5e5c..5a2dc175581 100644
--- a/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h
+++ b/Framework/Kernel/inc/MantidKernel/PropertyWithValue.h
@@ -37,12 +37,12 @@ namespace Kernel {
 template <typename TYPE> class DLLExport PropertyWithValue : public Property {
 public:
   PropertyWithValue(
-      std::string name, TYPE defaultValue,
+      const std::string &name, TYPE defaultValue,
       IValidator_sptr validator = IValidator_sptr(new NullValidator),
       const unsigned int direction = Direction::Input);
-  PropertyWithValue(std::string name, TYPE defaultValue,
+  PropertyWithValue(const std::string &name, TYPE defaultValue,
                     const unsigned int direction);
-  PropertyWithValue(std::string name, TYPE defaultValue,
+  PropertyWithValue(const std::string &name, TYPE defaultValue,
                     const std::string &defaultValueStr,
                     IValidator_sptr validator, const unsigned int direction);
   PropertyWithValue(const PropertyWithValue<TYPE> &right);
diff --git a/Framework/Kernel/inc/MantidKernel/PropertyWithValue.tcc b/Framework/Kernel/inc/MantidKernel/PropertyWithValue.tcc
index 3add2297950..1d2befbb731 100644
--- a/Framework/Kernel/inc/MantidKernel/PropertyWithValue.tcc
+++ b/Framework/Kernel/inc/MantidKernel/PropertyWithValue.tcc
@@ -42,7 +42,8 @@ namespace Kernel {
  * or Direction::InOut (Input & Output) property
  */
 template <typename TYPE>
-PropertyWithValue<TYPE>::PropertyWithValue(std::string name, TYPE defaultValue,
+PropertyWithValue<TYPE>::PropertyWithValue(const std::string &name,
+                                           TYPE defaultValue,
                                            IValidator_sptr validator,
                                            unsigned int direction)
     : Property(std::move(name), typeid(TYPE), direction), m_value(defaultValue),
@@ -56,7 +57,8 @@ PropertyWithValue<TYPE>::PropertyWithValue(std::string name, TYPE defaultValue,
  * or Direction::InOut (Input & Output) property
  */
 template <typename TYPE>
-PropertyWithValue<TYPE>::PropertyWithValue(std::string name, TYPE defaultValue,
+PropertyWithValue<TYPE>::PropertyWithValue(const std::string &name,
+                                           TYPE defaultValue,
                                            unsigned int direction)
     : Property(std::move(name), typeid(TYPE), direction), m_value(defaultValue),
       m_initialValue(std::move(defaultValue)),
@@ -77,7 +79,8 @@ PropertyWithValue<TYPE>::PropertyWithValue(std::string name, TYPE defaultValue,
  * or Direction::InOut (Input & Output) property
  */
 template <typename TYPE>
-PropertyWithValue<TYPE>::PropertyWithValue(std::string name, TYPE defaultValue,
+PropertyWithValue<TYPE>::PropertyWithValue(const std::string &name,
+                                           TYPE defaultValue,
                                            const std::string &defaultValueStr,
                                            IValidator_sptr validator,
                                            unsigned int direction)
diff --git a/Framework/Kernel/inc/MantidKernel/RemoteJobManager.h b/Framework/Kernel/inc/MantidKernel/RemoteJobManager.h
index 6da20d4b5a8..175350eef35 100644
--- a/Framework/Kernel/inc/MantidKernel/RemoteJobManager.h
+++ b/Framework/Kernel/inc/MantidKernel/RemoteJobManager.h
@@ -70,11 +70,13 @@ public:
 private:
   // Wraps up some of the boilerplate code needed to execute HTTP GET and POST
   // requests
-  void initGetRequest(Poco::Net::HTTPRequest &req, std::string extraPath,
-                      std::string queryString);
-  void initPostRequest(Poco::Net::HTTPRequest &req, std::string extraPath);
+  void initGetRequest(Poco::Net::HTTPRequest &req, const std::string &extraPath,
+                      const std::string &queryString);
+  void initPostRequest(Poco::Net::HTTPRequest &req,
+                       const std::string &extraPath);
   void initHTTPRequest(Poco::Net::HTTPRequest &req, const std::string &method,
-                       std::string extraPath, std::string queryString = "");
+                       const std::string &extraPath,
+                       const std::string &queryString = "");
 
   std::string m_displayName;
   std::string
diff --git a/Framework/Kernel/inc/MantidKernel/SingletonHolder.h b/Framework/Kernel/inc/MantidKernel/SingletonHolder.h
index 51ffda22895..84b793dbe82 100644
--- a/Framework/Kernel/inc/MantidKernel/SingletonHolder.h
+++ b/Framework/Kernel/inc/MantidKernel/SingletonHolder.h
@@ -35,7 +35,7 @@ using SingletonDeleterFn = std::function<void()>;
 
 /// Register the given deleter function to be called
 /// at exit
-MANTID_KERNEL_DLL void deleteOnExit(SingletonDeleterFn func);
+MANTID_KERNEL_DLL void deleteOnExit(const SingletonDeleterFn &func);
 
 /// Manage the lifetime of a class intended to be a singleton
 template <typename T> class SingletonHolder {
diff --git a/Framework/Kernel/inc/MantidKernel/ThreadPool.h b/Framework/Kernel/inc/MantidKernel/ThreadPool.h
index 7ac894b1dd5..2e60c564fe0 100644
--- a/Framework/Kernel/inc/MantidKernel/ThreadPool.h
+++ b/Framework/Kernel/inc/MantidKernel/ThreadPool.h
@@ -42,7 +42,7 @@ public:
 
   void start(double waitSec = 0.0);
 
-  void schedule(std::shared_ptr<Task> task, bool start = false);
+  void schedule(const std::shared_ptr<Task> &task, bool start = false);
 
   void joinAll();
 
diff --git a/Framework/Kernel/inc/MantidKernel/Unit.h b/Framework/Kernel/inc/MantidKernel/Unit.h
index 4951a26082b..2d0a7201d86 100644
--- a/Framework/Kernel/inc/MantidKernel/Unit.h
+++ b/Framework/Kernel/inc/MantidKernel/Unit.h
@@ -10,6 +10,8 @@
 // Includes
 //----------------------------------------------------------------------
 #include "MantidKernel/UnitLabel.h"
+#include <utility>
+
 #include <vector>
 #ifndef Q_MOC_RUN
 #include <boost/shared_ptr.hpp>
@@ -684,13 +686,14 @@ private:
 
 //=================================================================================================
 
-MANTID_KERNEL_DLL double timeConversionValue(std::string input_unit,
-                                             std::string output_unit);
+MANTID_KERNEL_DLL double timeConversionValue(const std::string &input_unit,
+                                             const std::string &output_unit);
 
 template <typename T>
-void timeConversionVector(std::vector<T> &vec, std::string input_unit,
-                          std::string output_unit) {
-  double factor = timeConversionValue(input_unit, output_unit);
+void timeConversionVector(std::vector<T> &vec, const std::string &input_unit,
+                          const std::string &output_unit) {
+  double factor =
+      timeConversionValue(std::move(input_unit), std::move(output_unit));
   if (factor != 1.0)
     std::transform(vec.begin(), vec.end(), vec.begin(),
                    [factor](T x) -> T { return x * static_cast<T>(factor); });
diff --git a/Framework/Kernel/inc/MantidKernel/UserCatalogInfo.h b/Framework/Kernel/inc/MantidKernel/UserCatalogInfo.h
index ff57c6ab939..5b2f259e393 100644
--- a/Framework/Kernel/inc/MantidKernel/UserCatalogInfo.h
+++ b/Framework/Kernel/inc/MantidKernel/UserCatalogInfo.h
@@ -24,14 +24,14 @@ public:
 
 template <typename T>
 CatalogConfigService *makeCatalogConfigServiceAdapter(
-    const T &adaptee, const std::string key = "icatDownload.mountPoint") {
+    const T &adaptee, const std::string &key = "icatDownload.mountPoint") {
   class Adapter : public CatalogConfigService {
   private:
     const T &m_adaptee;
     std::string m_key;
 
   public:
-    Adapter(const T &adaptee, const std::string key)
+    Adapter(const T &adaptee, const std::string &key)
         : m_adaptee(adaptee), m_key(key) {}
     OptionalPath preferredMountPoint() const override {
       auto const mountPoint = m_adaptee.getString(m_key);
diff --git a/Framework/Kernel/inc/MantidKernel/VisibleWhenProperty.h b/Framework/Kernel/inc/MantidKernel/VisibleWhenProperty.h
index 6b4cd081f68..29340d9c513 100644
--- a/Framework/Kernel/inc/MantidKernel/VisibleWhenProperty.h
+++ b/Framework/Kernel/inc/MantidKernel/VisibleWhenProperty.h
@@ -19,8 +19,8 @@ class DLLExport VisibleWhenProperty : public EnabledWhenProperty {
 public:
   /// Constructs a VisibleWhenProperty object which checks the property
   /// with name given and if it matches the criteria makes it visible
-  VisibleWhenProperty(std::string otherPropName, ePropertyCriterion when,
-                      std::string value = "");
+  VisibleWhenProperty(const std::string &otherPropName, ePropertyCriterion when,
+                      const std::string &value = "");
 
   /// Constructs a VisibleWhenProperty object which copies two
   /// already constructed VisibleWhenProperty objects and returns the result
diff --git a/Framework/Kernel/src/ArrayProperty.cpp b/Framework/Kernel/src/ArrayProperty.cpp
index a9b9652f492..eea56e12f4e 100644
--- a/Framework/Kernel/src/ArrayProperty.cpp
+++ b/Framework/Kernel/src/ArrayProperty.cpp
@@ -19,8 +19,8 @@ namespace Kernel {
  *  @param direction :: The direction (Input/Output/InOut) of this property
  */
 template <typename T>
-ArrayProperty<T>::ArrayProperty(std::string name, std::vector<T> vec,
-                                IValidator_sptr validator,
+ArrayProperty<T>::ArrayProperty(const std::string &name, std::vector<T> vec,
+                                const IValidator_sptr &validator,
                                 const unsigned int direction)
     : PropertyWithValue<std::vector<T>>(std::move(name), std::move(vec),
                                         std::move(validator), direction) {}
@@ -34,7 +34,8 @@ ArrayProperty<T>::ArrayProperty(std::string name, std::vector<T> vec,
  */
 
 template <typename T>
-ArrayProperty<T>::ArrayProperty(std::string name, IValidator_sptr validator,
+ArrayProperty<T>::ArrayProperty(const std::string &name,
+                                const IValidator_sptr &validator,
                                 const unsigned int direction)
     : PropertyWithValue<std::vector<T>>(std::move(name), std::vector<T>(),
                                         std::move(validator), direction) {}
@@ -47,7 +48,8 @@ ArrayProperty<T>::ArrayProperty(std::string name, IValidator_sptr validator,
  *  @param direction :: The direction (Input/Output/InOut) of this property
  */
 template <typename T>
-ArrayProperty<T>::ArrayProperty(std::string name, const unsigned int direction)
+ArrayProperty<T>::ArrayProperty(const std::string &name,
+                                const unsigned int direction)
     : PropertyWithValue<std::vector<T>>(std::move(name), std::vector<T>(),
                                         IValidator_sptr(new NullValidator),
                                         direction) {}
@@ -68,8 +70,9 @@ ArrayProperty<T>::ArrayProperty(std::string name, const unsigned int direction)
  * the array type
  */
 template <typename T>
-ArrayProperty<T>::ArrayProperty(std::string name, const std::string &values,
-                                IValidator_sptr validator,
+ArrayProperty<T>::ArrayProperty(const std::string &name,
+                                const std::string &values,
+                                const IValidator_sptr &validator,
                                 const unsigned int direction)
     : PropertyWithValue<std::vector<T>>(std::move(name), std::vector<T>(),
                                         values, std::move(validator),
diff --git a/Framework/Kernel/src/CompositeValidator.cpp b/Framework/Kernel/src/CompositeValidator.cpp
index d3a49c65550..696a684d5ef 100644
--- a/Framework/Kernel/src/CompositeValidator.cpp
+++ b/Framework/Kernel/src/CompositeValidator.cpp
@@ -68,7 +68,7 @@ Kernel::IValidator_sptr CompositeValidator::clone() const {
 /** Adds a validator to the group of validators to check
  *  @param child :: A pointer to the validator to add
  */
-void CompositeValidator::add(Kernel::IValidator_sptr child) {
+void CompositeValidator::add(const Kernel::IValidator_sptr &child) {
   m_children.emplace_back(child);
 }
 
@@ -106,7 +106,7 @@ std::string CompositeValidator::checkAny(const boost::any &value) const {
   // capture its error message to a stream so we can potentially print it out
   // to the user if required.
   const auto checkIfValid = [&errorStream,
-                             &value](const IValidator_sptr validator) {
+                             &value](const IValidator_sptr &validator) {
     const auto errorMessage = validator->check(value);
     if (errorMessage.empty()) {
       return true;
diff --git a/Framework/Kernel/src/ErrorReporter.cpp b/Framework/Kernel/src/ErrorReporter.cpp
index 638287dac6c..a79d5dcd835 100644
--- a/Framework/Kernel/src/ErrorReporter.cpp
+++ b/Framework/Kernel/src/ErrorReporter.cpp
@@ -30,27 +30,27 @@ Logger g_log("ErrorReporter");
 // Constructor for ErrorReporter
 /** Constructor
  */
-ErrorReporter::ErrorReporter(const std::string application,
-                             const Types::Core::time_duration upTime,
-                             const std::string exitCode, const bool share)
+ErrorReporter::ErrorReporter(const std::string &application,
+                             const Types::Core::time_duration &upTime,
+                             const std::string &exitCode, const bool share)
     : ErrorReporter(application, upTime, exitCode, share, "", "", "", "") {}
 
 /** Constructor
  */
-ErrorReporter::ErrorReporter(const std::string application,
-                             const Types::Core::time_duration upTime,
-                             const std::string exitCode, const bool share,
-                             const std::string name, const std::string email,
-                             const std::string textBox)
+ErrorReporter::ErrorReporter(const std::string &application,
+                             const Types::Core::time_duration &upTime,
+                             const std::string &exitCode, const bool share,
+                             const std::string &name, const std::string &email,
+                             const std::string &textBox)
     : ErrorReporter(application, upTime, exitCode, share, name, email, textBox,
                     "") {}
 
-ErrorReporter::ErrorReporter(const std::string application,
-                             const Types::Core::time_duration upTime,
-                             const std::string exitCode, const bool share,
-                             const std::string name, const std::string email,
-                             const std::string textBox,
-                             const std::string traceback)
+ErrorReporter::ErrorReporter(const std::string &application,
+                             const Types::Core::time_duration &upTime,
+                             const std::string &exitCode, const bool share,
+                             const std::string &name, const std::string &email,
+                             const std::string &textBox,
+                             const std::string &traceback)
     : m_application(application), m_exitCode(exitCode), m_upTime(upTime),
       m_share(share), m_name(name), m_email(email), m_textbox(textBox),
       m_stacktrace(traceback) {
diff --git a/Framework/Kernel/src/IndexSet.cpp b/Framework/Kernel/src/IndexSet.cpp
index 9599e391dc1..a7842786887 100644
--- a/Framework/Kernel/src/IndexSet.cpp
+++ b/Framework/Kernel/src/IndexSet.cpp
@@ -30,7 +30,7 @@ IndexSet::IndexSet(int64_t min, int64_t max, size_t fullRange) {
 
 /// Constructor for a set containing all specified indices. Range is verified at
 /// construction time and duplicates are removed.
-IndexSet::IndexSet(const std::vector<size_t> indices, size_t fullRange)
+IndexSet::IndexSet(const std::vector<size_t> &indices, size_t fullRange)
     : m_isRange(false) {
   // We use a set to create unique and ordered indices.
   std::set<size_t> index_set;
diff --git a/Framework/Kernel/src/MaskedProperty.cpp b/Framework/Kernel/src/MaskedProperty.cpp
index ba8d5456323..22e9a7dcdda 100644
--- a/Framework/Kernel/src/MaskedProperty.cpp
+++ b/Framework/Kernel/src/MaskedProperty.cpp
@@ -22,7 +22,7 @@ namespace Kernel {
  */
 template <typename TYPE>
 MaskedProperty<TYPE>::MaskedProperty(const std::string &name, TYPE defaultvalue,
-                                     IValidator_sptr validator,
+                                     const IValidator_sptr &validator,
                                      const unsigned int direction)
     : Kernel::PropertyWithValue<TYPE>(name, defaultvalue, validator, direction),
       m_maskedValue("") {
diff --git a/Framework/Kernel/src/Material.cpp b/Framework/Kernel/src/Material.cpp
index 275508c4fd8..72794908c55 100644
--- a/Framework/Kernel/src/Material.cpp
+++ b/Framework/Kernel/src/Material.cpp
@@ -600,7 +600,7 @@ getAtomName(const std::string &text) // TODO change to get number after letters
 } // namespace
 
 Material::ChemicalFormula
-Material::parseChemicalFormula(const std::string chemicalSymbol) {
+Material::parseChemicalFormula(const std::string &chemicalSymbol) {
   Material::ChemicalFormula CF;
 
   tokenizer tokens(chemicalSymbol, " -",
diff --git a/Framework/Kernel/src/MaterialBuilder.cpp b/Framework/Kernel/src/MaterialBuilder.cpp
index 08af881eecb..23be2c3e8e6 100644
--- a/Framework/Kernel/src/MaterialBuilder.cpp
+++ b/Framework/Kernel/src/MaterialBuilder.cpp
@@ -19,7 +19,7 @@ using PhysicalConstants::NeutronAtom;
 namespace Kernel {
 
 namespace {
-inline bool isEmpty(const boost::optional<double> value) {
+inline bool isEmpty(const boost::optional<double> &value) {
   return !value || value == Mantid::EMPTY_DBL();
 }
 } // namespace
diff --git a/Framework/Kernel/src/MatrixProperty.cpp b/Framework/Kernel/src/MatrixProperty.cpp
index 95f70eda350..3a3cc8bad80 100644
--- a/Framework/Kernel/src/MatrixProperty.cpp
+++ b/Framework/Kernel/src/MatrixProperty.cpp
@@ -22,7 +22,7 @@ namespace Kernel {
  */
 template <typename TYPE>
 MatrixProperty<TYPE>::MatrixProperty(const std::string &propName,
-                                     IValidator_sptr validator,
+                                     const IValidator_sptr &validator,
                                      unsigned int direction)
     : PropertyWithValue<HeldType>(propName, HeldType(), validator, direction) {}
 
diff --git a/Framework/Kernel/src/RemoteJobManager.cpp b/Framework/Kernel/src/RemoteJobManager.cpp
index 15e6cbe6703..bb6e28d9b94 100644
--- a/Framework/Kernel/src/RemoteJobManager.cpp
+++ b/Framework/Kernel/src/RemoteJobManager.cpp
@@ -17,6 +17,7 @@
 #include <Poco/URI.h>
 
 #include <sstream>
+#include <utility>
 
 namespace Mantid {
 namespace Kernel {
@@ -182,21 +183,22 @@ std::istream &RemoteJobManager::httpPost(const std::string &path,
 // Wrappers for a lot of the boilerplate code needed to perform an HTTPS GET or
 // POST
 void RemoteJobManager::initGetRequest(Poco::Net::HTTPRequest &req,
-                                      std::string extraPath,
-                                      std::string queryString) {
-  return initHTTPRequest(req, Poco::Net::HTTPRequest::HTTP_GET, extraPath,
-                         queryString);
+                                      const std::string &extraPath,
+                                      const std::string &queryString) {
+  return initHTTPRequest(req, Poco::Net::HTTPRequest::HTTP_GET,
+                         std::move(extraPath), std::move(queryString));
 }
 
 void RemoteJobManager::initPostRequest(Poco::Net::HTTPRequest &req,
-                                       std::string extraPath) {
-  return initHTTPRequest(req, Poco::Net::HTTPRequest::HTTP_POST, extraPath);
+                                       const std::string &extraPath) {
+  return initHTTPRequest(req, Poco::Net::HTTPRequest::HTTP_POST,
+                         std::move(extraPath));
 }
 
 void RemoteJobManager::initHTTPRequest(Poco::Net::HTTPRequest &req,
                                        const std::string &method,
-                                       std::string extraPath,
-                                       std::string queryString) {
+                                       const std::string &extraPath,
+                                       const std::string &queryString) {
   // Set up the session object
   if (m_session) {
 
diff --git a/Framework/Kernel/src/SingletonHolder.cpp b/Framework/Kernel/src/SingletonHolder.cpp
index c418e89babf..8d41da9b4ba 100644
--- a/Framework/Kernel/src/SingletonHolder.cpp
+++ b/Framework/Kernel/src/SingletonHolder.cpp
@@ -36,7 +36,7 @@ void cleanupSingletons() {
 /// functions are added to the start of the list so on deletion it is last in,
 /// first out
 /// @param func :: Exit function to call - the singleton destructor function
-void deleteOnExit(SingletonDeleterFn func) {
+void deleteOnExit(const SingletonDeleterFn &func) {
   auto &deleters = cleanupList();
   if (deleters.empty()) {
     atexit(&cleanupSingletons);
diff --git a/Framework/Kernel/src/ThreadPool.cpp b/Framework/Kernel/src/ThreadPool.cpp
index 7513c6a972c..3a55ae88c8d 100644
--- a/Framework/Kernel/src/ThreadPool.cpp
+++ b/Framework/Kernel/src/ThreadPool.cpp
@@ -125,7 +125,7 @@ void ThreadPool::start(double waitSec) {
  * @param task :: pointer to a Task object to run.
  * @param start :: start the thread at the same time; default false
  */
-void ThreadPool::schedule(std::shared_ptr<Task> task, bool start) {
+void ThreadPool::schedule(const std::shared_ptr<Task> &task, bool start) {
   if (task) {
     m_scheduler->push(task);
     // Start all the threads if they were not already.
diff --git a/Framework/Kernel/src/Unit.cpp b/Framework/Kernel/src/Unit.cpp
index 458efa1090f..41373f2e8ed 100644
--- a/Framework/Kernel/src/Unit.cpp
+++ b/Framework/Kernel/src/Unit.cpp
@@ -1291,7 +1291,8 @@ double AtomicDistance::conversionTOFMax() const {
 
 // ================================================================================
 
-double timeConversionValue(std::string input_unit, std::string output_unit) {
+double timeConversionValue(const std::string &input_unit,
+                           const std::string &output_unit) {
   std::map<std::string, double> timesList;
   double seconds = 1.0e9;
   double milliseconds = 1.0e-3 * seconds;
diff --git a/Framework/Kernel/src/VisibleWhenProperty.cpp b/Framework/Kernel/src/VisibleWhenProperty.cpp
index 85eb26ec50d..82adc3a460d 100644
--- a/Framework/Kernel/src/VisibleWhenProperty.cpp
+++ b/Framework/Kernel/src/VisibleWhenProperty.cpp
@@ -16,9 +16,9 @@ namespace Kernel {
  * @param value :: For the IS_EQUAL_TO or IS_NOT_EQUAL_TO condition, the value
  * (as string) to check for
  */
-VisibleWhenProperty::VisibleWhenProperty(std::string otherPropName,
+VisibleWhenProperty::VisibleWhenProperty(const std::string &otherPropName,
                                          ePropertyCriterion when,
-                                         std::string value)
+                                         const std::string &value)
     : EnabledWhenProperty(otherPropName, when, value) {}
 
 /** Multiple conditions constructor - takes two  VisibleWhenProperty
diff --git a/Framework/Kernel/test/BinaryFileTest.h b/Framework/Kernel/test/BinaryFileTest.h
index 4505525a626..9f6440199af 100644
--- a/Framework/Kernel/test/BinaryFileTest.h
+++ b/Framework/Kernel/test/BinaryFileTest.h
@@ -33,7 +33,7 @@ struct DasEvent {
 };
 
 /** Creates a dummy file with so many bytes */
-static void MakeDummyFile(std::string filename, size_t num_bytes) {
+static void MakeDummyFile(const std::string &filename, size_t num_bytes) {
   std::vector<char> buffer(num_bytes);
   for (size_t i = 0; i < num_bytes; i++) {
     // Put 1,2,3 in 32-bit ints
diff --git a/Framework/Kernel/test/ConfigPropertyObserverTest.h b/Framework/Kernel/test/ConfigPropertyObserverTest.h
index eda5f9655be..941b29a01b4 100644
--- a/Framework/Kernel/test/ConfigPropertyObserverTest.h
+++ b/Framework/Kernel/test/ConfigPropertyObserverTest.h
@@ -15,7 +15,7 @@ using namespace Mantid::Kernel;
 
 template <typename Callback> class MockObserver : ConfigPropertyObserver {
 public:
-  MockObserver(std::string propertyName, Callback callback)
+  MockObserver(const std::string &propertyName, Callback callback)
       : ConfigPropertyObserver(std::move(propertyName)), m_callback(callback) {}
 
 protected:
diff --git a/Framework/Kernel/test/InterpolationTest.h b/Framework/Kernel/test/InterpolationTest.h
index 9d9e41a15f4..47a491ff8b9 100644
--- a/Framework/Kernel/test/InterpolationTest.h
+++ b/Framework/Kernel/test/InterpolationTest.h
@@ -227,8 +227,8 @@ public:
   }
 
 private:
-  Interpolation getInitializedInterpolation(std::string xUnit,
-                                            std::string yUnit) {
+  Interpolation getInitializedInterpolation(const std::string &xUnit,
+                                            const std::string &yUnit) {
     Interpolation interpolation;
 
     // take values from constructor
@@ -286,7 +286,7 @@ private:
    * It takes a string argument to make it more obvious where the problem is.
    */
   void checkValue(const Interpolation &interpolation, double x, double y,
-                  std::string testedRange) {
+                  const std::string &testedRange) {
     std::ostringstream errorString;
     errorString << "Interpolation error " << testedRange;
 
diff --git a/Framework/Kernel/test/ThreadSchedulerMutexesTest.h b/Framework/Kernel/test/ThreadSchedulerMutexesTest.h
index 3c745e553df..d2c7285e932 100644
--- a/Framework/Kernel/test/ThreadSchedulerMutexesTest.h
+++ b/Framework/Kernel/test/ThreadSchedulerMutexesTest.h
@@ -9,6 +9,8 @@
 #include "MantidKernel/System.h"
 #include "MantidKernel/Timer.h"
 #include <boost/make_shared.hpp>
+#include <utility>
+
 #include <cxxtest/TestSuite.h>
 
 #include "MantidKernel/ThreadSchedulerMutexes.h"
@@ -24,7 +26,7 @@ public:
   class TaskWithMutex : public Task {
   public:
     TaskWithMutex(boost::shared_ptr<std::mutex> mutex, double cost) {
-      m_mutex = mutex;
+      m_mutex = std::move(mutex);
       m_cost = cost;
     }
 
diff --git a/Framework/Kernel/test/TypedValidatorTest.h b/Framework/Kernel/test/TypedValidatorTest.h
index 266c39e5566..2be8724760f 100644
--- a/Framework/Kernel/test/TypedValidatorTest.h
+++ b/Framework/Kernel/test/TypedValidatorTest.h
@@ -69,7 +69,7 @@ public:
 private:
   template <typename HeldType>
   void checkIsValidReturnsEmptyString(
-      const Mantid::Kernel::IValidator_sptr valueChecker,
+      const Mantid::Kernel::IValidator_sptr &valueChecker,
       const HeldType &value) {
     std::string error;
     TS_ASSERT_THROWS_NOTHING(error = valueChecker->isValid(value));
diff --git a/Framework/Kernel/test/UnitLabelTest.h b/Framework/Kernel/test/UnitLabelTest.h
index e3a3db0efc8..0b383a9f984 100644
--- a/Framework/Kernel/test/UnitLabelTest.h
+++ b/Framework/Kernel/test/UnitLabelTest.h
@@ -70,7 +70,7 @@ public:
   }
 
 private:
-  void doImplicitConversionTest(UnitLabel lbl, std::string expected) {
+  void doImplicitConversionTest(const UnitLabel &lbl, std::string expected) {
     TS_ASSERT_EQUALS(expected, lbl.ascii());
     const auto &utf8 = lbl.utf8();
     TS_ASSERT_EQUALS(std::wstring(expected.begin(), expected.end()), utf8);
diff --git a/Framework/LiveData/inc/MantidLiveData/ISIS/ISISHistoDataListener.h b/Framework/LiveData/inc/MantidLiveData/ISIS/ISISHistoDataListener.h
index 6bec842c938..77179fa9b50 100644
--- a/Framework/LiveData/inc/MantidLiveData/ISIS/ISISHistoDataListener.h
+++ b/Framework/LiveData/inc/MantidLiveData/ISIS/ISISHistoDataListener.h
@@ -62,13 +62,14 @@ private:
   void getIntArray(const std::string &par, std::vector<int> &arr,
                    const size_t dim);
   void getData(int period, int index, int count,
-               boost::shared_ptr<API::MatrixWorkspace> workspace,
+               const boost::shared_ptr<API::MatrixWorkspace> &workspace,
                size_t workspaceIndex);
   void calculateIndicesForReading(std::vector<int> &index,
                                   std::vector<int> &count);
   void loadSpectraMap();
-  void runLoadInstrument(boost::shared_ptr<API::MatrixWorkspace> localWorkspace,
-                         const std::string &iName);
+  void runLoadInstrument(
+      const boost::shared_ptr<API::MatrixWorkspace> &localWorkspace,
+      const std::string &iName);
   void loadTimeRegimes();
   int getTimeRegimeToLoad() const;
   bool isPeriodIgnored(int period) const;
diff --git a/Framework/LiveData/inc/MantidLiveData/Kafka/IKafkaStreamDecoder.h b/Framework/LiveData/inc/MantidLiveData/Kafka/IKafkaStreamDecoder.h
index 36fc120bfc6..461ee24881c 100644
--- a/Framework/LiveData/inc/MantidLiveData/Kafka/IKafkaStreamDecoder.h
+++ b/Framework/LiveData/inc/MantidLiveData/Kafka/IKafkaStreamDecoder.h
@@ -35,7 +35,7 @@ public:
   public:
     using FnType = std::function<void()>;
 
-    Callback(Callback::FnType callback) : m_mutex(), m_callback() {
+    Callback(const Callback::FnType &callback) : m_mutex(), m_callback() {
       setFunction(std::move(callback));
     }
 
diff --git a/Framework/LiveData/inc/MantidLiveData/LoadLiveData.h b/Framework/LiveData/inc/MantidLiveData/LoadLiveData.h
index 3d5dda4a210..67c22d079b2 100644
--- a/Framework/LiveData/inc/MantidLiveData/LoadLiveData.h
+++ b/Framework/LiveData/inc/MantidLiveData/LoadLiveData.h
@@ -42,14 +42,15 @@ private:
   void runPostProcessing();
 
   void replaceChunk(Mantid::API::Workspace_sptr chunkWS);
-  void addChunk(Mantid::API::Workspace_sptr chunkWS);
-  void addMatrixWSChunk(API::Workspace_sptr accumWS,
-                        API::Workspace_sptr chunkWS);
+  void addChunk(const Mantid::API::Workspace_sptr &chunkWS);
+  void addMatrixWSChunk(const API::Workspace_sptr &accumWS,
+                        const API::Workspace_sptr &chunkWS);
   void addMDWSChunk(API::Workspace_sptr &accumWS,
                     const API::Workspace_sptr &chunkWS);
-  void appendChunk(Mantid::API::Workspace_sptr chunkWS);
-  API::Workspace_sptr appendMatrixWSChunk(API::Workspace_sptr accumWS,
-                                          Mantid::API::Workspace_sptr chunkWS);
+  void appendChunk(const Mantid::API::Workspace_sptr &chunkWS);
+  API::Workspace_sptr
+  appendMatrixWSChunk(API::Workspace_sptr accumWS,
+                      const Mantid::API::Workspace_sptr &chunkWS);
   void updateDefaultBinBoundaries(API::Workspace *workspace);
 
   /// The "accumulation" workspace = after adding, but before post-processing
diff --git a/Framework/LiveData/src/ISIS/FakeISISEventDAE.cpp b/Framework/LiveData/src/ISIS/FakeISISEventDAE.cpp
index dfc83b63f7b..73abf7e0315 100644
--- a/Framework/LiveData/src/ISIS/FakeISISEventDAE.cpp
+++ b/Framework/LiveData/src/ISIS/FakeISISEventDAE.cpp
@@ -17,6 +17,8 @@
 #include <Poco/Net/StreamSocket.h>
 #include <Poco/Net/TCPServer.h>
 
+#include <utility>
+
 namespace Mantid {
 namespace LiveData {
 // Register the algorithm into the algorithm factory
@@ -46,7 +48,8 @@ public:
   TestServerConnection(const Poco::Net::StreamSocket &soc, int nper, int nspec,
                        int rate, int nevents, boost::shared_ptr<Progress> prog)
       : Poco::Net::TCPServerConnection(soc), m_nPeriods(nper),
-        m_nSpectra(nspec), m_Rate(rate), m_nEvents(nevents), m_prog(prog) {
+        m_nSpectra(nspec), m_Rate(rate), m_nEvents(nevents),
+        m_prog(std::move(prog)) {
     m_prog->report(0, "Client Connected");
     sendInitialSetup();
   }
@@ -135,7 +138,8 @@ public:
   TestServerConnectionFactory(int nper, int nspec, int rate, int nevents,
                               boost::shared_ptr<Progress> prog)
       : Poco::Net::TCPServerConnectionFactory(), m_nPeriods(nper),
-        m_nSpectra(nspec), m_Rate(rate), m_nEvents(nevents), m_prog(prog) {}
+        m_nSpectra(nspec), m_Rate(rate), m_nEvents(nevents),
+        m_prog(std::move(prog)) {}
   /**
    * The factory method.
    * @param socket :: The socket.
diff --git a/Framework/LiveData/src/ISIS/ISISHistoDataListener.cpp b/Framework/LiveData/src/ISIS/ISISHistoDataListener.cpp
index cb3d773355b..f5b701b2778 100644
--- a/Framework/LiveData/src/ISIS/ISISHistoDataListener.cpp
+++ b/Framework/LiveData/src/ISIS/ISISHistoDataListener.cpp
@@ -422,7 +422,7 @@ void ISISHistoDataListener::calculateIndicesForReading(
  * @param workspaceIndex :: index in workspace to store data
  */
 void ISISHistoDataListener::getData(int period, int index, int count,
-                                    API::MatrixWorkspace_sptr workspace,
+                                    const API::MatrixWorkspace_sptr &workspace,
                                     size_t workspaceIndex) {
   const int numberOfBins = m_numberOfBins[m_timeRegime];
   const size_t bufferSize = count * (numberOfBins + 1) * sizeof(int);
@@ -466,7 +466,7 @@ void ISISHistoDataListener::loadSpectraMap() {
  *  @param iName :: The instrument name
  */
 void ISISHistoDataListener::runLoadInstrument(
-    MatrixWorkspace_sptr localWorkspace, const std::string &iName) {
+    const MatrixWorkspace_sptr &localWorkspace, const std::string &iName) {
   auto loadInst =
       API::AlgorithmFactory::Instance().create("LoadInstrument", -1);
   if (!loadInst)
diff --git a/Framework/LiveData/src/Kafka/IKafkaStreamDecoder.cpp b/Framework/LiveData/src/Kafka/IKafkaStreamDecoder.cpp
index 588fec16bf2..4f8ac88f0fe 100644
--- a/Framework/LiveData/src/Kafka/IKafkaStreamDecoder.cpp
+++ b/Framework/LiveData/src/Kafka/IKafkaStreamDecoder.cpp
@@ -21,6 +21,8 @@ GNU_DIAG_ON("conversion")
 
 #include <json/json.h>
 
+#include <utility>
+
 using namespace Mantid::Types;
 
 namespace {
@@ -54,7 +56,7 @@ IKafkaStreamDecoder::IKafkaStreamDecoder(std::shared_ptr<IKafkaBroker> broker,
                                          const std::string &sampleEnvTopic,
                                          const std::string &chopperTopic,
                                          const std::string &monitorTopic)
-    : m_broker(broker), m_streamTopic(streamTopic),
+    : m_broker(std::move(broker)), m_streamTopic(streamTopic),
       m_runInfoTopic(runInfoTopic), m_spDetTopic(spDetTopic),
       m_sampleEnvTopic(sampleEnvTopic), m_chopperTopic(chopperTopic),
       m_monitorTopic(monitorTopic), m_interrupt(false), m_specToIdx(),
@@ -227,7 +229,7 @@ void IKafkaStreamDecoder::checkIfAllStopOffsetsReached(
     bool &checkOffsets) {
 
   if (std::all_of(reachedEnd.cbegin(), reachedEnd.cend(),
-                  [](std::pair<std::string, std::vector<bool>> kv) {
+                  [](const std::pair<std::string, std::vector<bool>> &kv) {
                     return std::all_of(
                         kv.second.cbegin(), kv.second.cend(),
                         [](bool partitionEnd) { return partitionEnd; });
diff --git a/Framework/LiveData/src/Kafka/KafkaBroker.cpp b/Framework/LiveData/src/Kafka/KafkaBroker.cpp
index d9a261729ea..574ef98cc5f 100644
--- a/Framework/LiveData/src/Kafka/KafkaBroker.cpp
+++ b/Framework/LiveData/src/Kafka/KafkaBroker.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidLiveData/Kafka/KafkaBroker.h"
 #include "MantidLiveData/Kafka/KafkaTopicSubscriber.h"
 
@@ -15,7 +17,7 @@ namespace LiveData {
  * @param address The address of a broker in the form host:port
  */
 KafkaBroker::KafkaBroker(std::string address)
-    : IKafkaBroker(), m_address(address) {}
+    : IKafkaBroker(), m_address(std::move(address)) {}
 
 /**
  * Create an object to provide access to a topic stream from this broker
diff --git a/Framework/LiveData/src/Kafka/KafkaEventStreamDecoder.cpp b/Framework/LiveData/src/Kafka/KafkaEventStreamDecoder.cpp
index 65e2f62c8f1..6a97ab35a03 100644
--- a/Framework/LiveData/src/Kafka/KafkaEventStreamDecoder.cpp
+++ b/Framework/LiveData/src/Kafka/KafkaEventStreamDecoder.cpp
@@ -30,6 +30,8 @@ GNU_DIAG_ON("conversion")
 #include <chrono>
 #include <json/json.h>
 #include <numeric>
+#include <utility>
+
 #include <tbb/parallel_sort.h>
 
 using namespace Mantid::Types;
@@ -120,8 +122,9 @@ KafkaEventStreamDecoder::KafkaEventStreamDecoder(
     const std::string &runInfoTopic, const std::string &spDetTopic,
     const std::string &sampleEnvTopic, const std::string &chopperTopic,
     const std::string &monitorTopic, const std::size_t bufferThreshold)
-    : IKafkaStreamDecoder(broker, eventTopic, runInfoTopic, spDetTopic,
-                          sampleEnvTopic, chopperTopic, monitorTopic),
+    : IKafkaStreamDecoder(std::move(broker), eventTopic, runInfoTopic,
+                          spDetTopic, sampleEnvTopic, chopperTopic,
+                          monitorTopic),
       m_intermediateBufferFlushThreshold(bufferThreshold) {
 #ifndef _OPENMP
   g_log.warning() << "Multithreading is not available on your system. This "
diff --git a/Framework/LiveData/src/Kafka/KafkaHistoStreamDecoder.cpp b/Framework/LiveData/src/Kafka/KafkaHistoStreamDecoder.cpp
index 4c9b432d3e3..90398f87766 100644
--- a/Framework/LiveData/src/Kafka/KafkaHistoStreamDecoder.cpp
+++ b/Framework/LiveData/src/Kafka/KafkaHistoStreamDecoder.cpp
@@ -29,6 +29,8 @@ GNU_DIAG_ON("conversion")
 
 #include <json/json.h>
 
+#include <utility>
+
 namespace {
 const std::string PROTON_CHARGE_PROPERTY = "proton_charge";
 const std::string RUN_NUMBER_PROPERTY = "run_number";
@@ -59,8 +61,8 @@ KafkaHistoStreamDecoder::KafkaHistoStreamDecoder(
     std::shared_ptr<IKafkaBroker> broker, const std::string &histoTopic,
     const std::string &runInfoTopic, const std::string &spDetTopic,
     const std::string &sampleEnvTopic, const std::string &chopperTopic)
-    : IKafkaStreamDecoder(broker, histoTopic, runInfoTopic, spDetTopic,
-                          sampleEnvTopic, chopperTopic, ""),
+    : IKafkaStreamDecoder(std::move(broker), histoTopic, runInfoTopic,
+                          spDetTopic, sampleEnvTopic, chopperTopic, ""),
       m_workspace() {}
 
 /**
diff --git a/Framework/LiveData/src/Kafka/KafkaTopicSubscriber.cpp b/Framework/LiveData/src/Kafka/KafkaTopicSubscriber.cpp
index d79f64752b3..93d2fba8ed3 100644
--- a/Framework/LiveData/src/Kafka/KafkaTopicSubscriber.cpp
+++ b/Framework/LiveData/src/Kafka/KafkaTopicSubscriber.cpp
@@ -13,6 +13,7 @@
 #include <iostream>
 #include <sstream>
 #include <thread>
+#include <utility>
 
 using RdKafka::Conf;
 using RdKafka::KafkaConsumer;
@@ -77,8 +78,8 @@ const std::string KafkaTopicSubscriber::MONITOR_TOPIC_SUFFIX = "_monitors";
 KafkaTopicSubscriber::KafkaTopicSubscriber(std::string broker,
                                            std::vector<std::string> topics,
                                            SubscribeAtOption subscribeOption)
-    : IKafkaStreamSubscriber(), m_consumer(), m_brokerAddr(broker),
-      m_topicNames(topics), m_subscribeOption(subscribeOption) {}
+    : IKafkaStreamSubscriber(), m_consumer(), m_brokerAddr(std::move(broker)),
+      m_topicNames(std::move(topics)), m_subscribeOption(subscribeOption) {}
 
 /// Destructor
 KafkaTopicSubscriber::~KafkaTopicSubscriber() {
diff --git a/Framework/LiveData/src/LiveDataAlgorithm.cpp b/Framework/LiveData/src/LiveDataAlgorithm.cpp
index 01dbfe061d5..64e8c16429a 100644
--- a/Framework/LiveData/src/LiveDataAlgorithm.cpp
+++ b/Framework/LiveData/src/LiveDataAlgorithm.cpp
@@ -17,6 +17,7 @@
 
 #include <boost/algorithm/string/trim.hpp>
 #include <unordered_set>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -260,7 +261,7 @@ ILiveListener_sptr LiveDataAlgorithm::createLiveListener(bool connect) {
  */
 void LiveDataAlgorithm::setLiveListener(
     Mantid::API::ILiveListener_sptr listener) {
-  m_listener = listener;
+  m_listener = std::move(listener);
 }
 
 //----------------------------------------------------------------------------------------------
diff --git a/Framework/LiveData/src/LoadLiveData.cpp b/Framework/LiveData/src/LoadLiveData.cpp
index 6010a8160b5..b41ca72a889 100644
--- a/Framework/LiveData/src/LoadLiveData.cpp
+++ b/Framework/LiveData/src/LoadLiveData.cpp
@@ -15,6 +15,7 @@
 #include "MantidLiveData/Exception.h"
 
 #include <boost/algorithm/string.hpp>
+#include <utility>
 
 #include <Poco/Thread.h>
 
@@ -204,7 +205,7 @@ LoadLiveData::runProcessing(Mantid::API::Workspace_sptr inputWS,
 Mantid::API::Workspace_sptr
 LoadLiveData::processChunk(Mantid::API::Workspace_sptr chunkWS) {
   try {
-    return runProcessing(chunkWS, false);
+    return runProcessing(std::move(chunkWS), false);
   } catch (...) {
     g_log.error("While processing chunk:");
     throw;
@@ -232,7 +233,7 @@ void LoadLiveData::runPostProcessing() {
  *
  * @param chunkWS :: processed live data chunk workspace
  */
-void LoadLiveData::addChunk(Mantid::API::Workspace_sptr chunkWS) {
+void LoadLiveData::addChunk(const Mantid::API::Workspace_sptr &chunkWS) {
   // Acquire locks on the workspaces we use
   WriteLock _lock1(*m_accumWS);
   ReadLock _lock2(*chunkWS);
@@ -273,8 +274,8 @@ void LoadLiveData::addChunk(Mantid::API::Workspace_sptr chunkWS) {
  * @param accumWS :: accumulation matrix workspace
  * @param chunkWS :: processed live data chunk matrix workspace
  */
-void LoadLiveData::addMatrixWSChunk(Workspace_sptr accumWS,
-                                    Workspace_sptr chunkWS) {
+void LoadLiveData::addMatrixWSChunk(const Workspace_sptr &accumWS,
+                                    const Workspace_sptr &chunkWS) {
   // Handle the addition of the internal monitor workspace, if present
   auto accumMW = boost::dynamic_pointer_cast<MatrixWorkspace>(accumWS);
   auto chunkMW = boost::dynamic_pointer_cast<MatrixWorkspace>(chunkWS);
@@ -342,7 +343,7 @@ void LoadLiveData::replaceChunk(Mantid::API::Workspace_sptr chunkWS) {
   auto instrumentWS = m_accumWS;
   // When the algorithm exits the chunk workspace will be renamed
   // and overwrite the old one
-  m_accumWS = chunkWS;
+  m_accumWS = std::move(chunkWS);
   // Put the original instrument back. Otherwise geometry changes will not be
   // persistent
   copyInstrument(instrumentWS.get(), m_accumWS.get());
@@ -358,7 +359,7 @@ void LoadLiveData::replaceChunk(Mantid::API::Workspace_sptr chunkWS) {
  *
  * @param chunkWS :: processed live data chunk workspace
  */
-void LoadLiveData::appendChunk(Mantid::API::Workspace_sptr chunkWS) {
+void LoadLiveData::appendChunk(const Mantid::API::Workspace_sptr &chunkWS) {
   // ISIS multi-period data come in workspace groups
   WorkspaceGroup_sptr chunk_gws =
       boost::dynamic_pointer_cast<WorkspaceGroup>(chunkWS);
@@ -400,8 +401,9 @@ void LoadLiveData::appendChunk(Mantid::API::Workspace_sptr chunkWS) {
  * @param accumWS :: accumulation matrix workspace
  * @param chunkWS :: processed live data chunk matrix workspace
  */
-Workspace_sptr LoadLiveData::appendMatrixWSChunk(Workspace_sptr accumWS,
-                                                 Workspace_sptr chunkWS) {
+Workspace_sptr
+LoadLiveData::appendMatrixWSChunk(Workspace_sptr accumWS,
+                                  const Workspace_sptr &chunkWS) {
   IAlgorithm_sptr alg;
   ReadLock _lock1(*accumWS);
   ReadLock _lock2(*chunkWS);
diff --git a/Framework/LiveData/test/KafkaEventStreamDecoderTest.h b/Framework/LiveData/test/KafkaEventStreamDecoderTest.h
index 244435a658b..8ff6acffb72 100644
--- a/Framework/LiveData/test/KafkaEventStreamDecoderTest.h
+++ b/Framework/LiveData/test/KafkaEventStreamDecoderTest.h
@@ -547,8 +547,8 @@ private:
     }
   }
 
-  std::unique_ptr<Mantid::LiveData::KafkaEventStreamDecoder>
-  createTestDecoder(std::shared_ptr<Mantid::LiveData::IKafkaBroker> broker) {
+  std::unique_ptr<Mantid::LiveData::KafkaEventStreamDecoder> createTestDecoder(
+      const std::shared_ptr<Mantid::LiveData::IKafkaBroker> &broker) {
     using namespace Mantid::LiveData;
     return std::make_unique<KafkaEventStreamDecoder>(broker, "", "", "", "", "",
                                                      "", 0);
diff --git a/Framework/LiveData/test/KafkaHistoStreamDecoderTest.h b/Framework/LiveData/test/KafkaHistoStreamDecoderTest.h
index 25196cc10b1..3fc38756533 100644
--- a/Framework/LiveData/test/KafkaHistoStreamDecoderTest.h
+++ b/Framework/LiveData/test/KafkaHistoStreamDecoderTest.h
@@ -94,8 +94,8 @@ public:
   }
 
 private:
-  std::unique_ptr<Mantid::LiveData::KafkaHistoStreamDecoder>
-  createTestDecoder(std::shared_ptr<Mantid::LiveData::IKafkaBroker> broker) {
+  std::unique_ptr<Mantid::LiveData::KafkaHistoStreamDecoder> createTestDecoder(
+      const std::shared_ptr<Mantid::LiveData::IKafkaBroker> &broker) {
     using namespace Mantid::LiveData;
     return std::make_unique<KafkaHistoStreamDecoder>(broker, "", "", "", "",
                                                      "");
diff --git a/Framework/LiveData/test/KafkaTesting.h b/Framework/LiveData/test/KafkaTesting.h
index 11670e3e785..85738a1355c 100644
--- a/Framework/LiveData/test/KafkaTesting.h
+++ b/Framework/LiveData/test/KafkaTesting.h
@@ -220,7 +220,7 @@ void fakeReceiveASampleEnvMessage(std::string *buffer) {
 void fakeReceiveARunStartMessage(std::string *buffer, int32_t runNumber,
                                  const std::string &startTime,
                                  const std::string &instName, int32_t nPeriods,
-                                 std::string nexusStructure = "") {
+                                 const std::string &nexusStructure = "") {
   // Convert date to time_t
   auto mantidTime = Mantid::Types::Core::DateAndTime(startTime);
   auto startTimestamp =
diff --git a/Framework/LiveData/test/LoadLiveDataTest.h b/Framework/LiveData/test/LoadLiveDataTest.h
index 92b08d01875..146a2afd6e5 100644
--- a/Framework/LiveData/test/LoadLiveDataTest.h
+++ b/Framework/LiveData/test/LoadLiveDataTest.h
@@ -53,11 +53,13 @@ public:
    */
   template <typename TYPE>
   boost::shared_ptr<TYPE>
-  doExec(std::string AccumulationMethod, std::string ProcessingAlgorithm = "",
-         std::string ProcessingProperties = "",
-         std::string PostProcessingAlgorithm = "",
-         std::string PostProcessingProperties = "", bool PreserveEvents = true,
-         ILiveListener_sptr listener = ILiveListener_sptr(),
+  doExec(const std::string &AccumulationMethod,
+         const std::string &ProcessingAlgorithm = "",
+         const std::string &ProcessingProperties = "",
+         const std::string &PostProcessingAlgorithm = "",
+         const std::string &PostProcessingProperties = "",
+         bool PreserveEvents = true,
+         const ILiveListener_sptr &listener = ILiveListener_sptr(),
          bool makeThrow = false) {
     FacilityHelper::ScopedFacilities loadTESTFacility(
         "unit_testing/UnitTestFacilities.xml", "TEST");
diff --git a/Framework/LiveData/test/MonitorLiveDataTest.h b/Framework/LiveData/test/MonitorLiveDataTest.h
index 48d02480083..26575e099c0 100644
--- a/Framework/LiveData/test/MonitorLiveDataTest.h
+++ b/Framework/LiveData/test/MonitorLiveDataTest.h
@@ -61,10 +61,10 @@ public:
 
   /** Create but don't start a MonitorLiveData thread */
   boost::shared_ptr<MonitorLiveData>
-  makeAlgo(std::string output, std::string accumWS = "",
-           std::string AccumulationMethod = "Replace",
-           std::string RunTransitionBehavior = "Restart",
-           std::string UpdateEvery = "1") {
+  makeAlgo(const std::string &output, const std::string &accumWS = "",
+           const std::string &AccumulationMethod = "Replace",
+           const std::string &RunTransitionBehavior = "Restart",
+           const std::string &UpdateEvery = "1") {
     auto alg = boost::dynamic_pointer_cast<MonitorLiveData>(
         AlgorithmManager::Instance().create("MonitorLiveData", -1, false));
     alg->setPropertyValue("Instrument", "TestDataListener");
@@ -167,7 +167,7 @@ public:
   /** Executes the given algorithm asynchronously, until you reach the given
    * chunk number.
    * @return false if test failed*/
-  bool runAlgoUntilChunk(boost::shared_ptr<MonitorLiveData> alg1,
+  bool runAlgoUntilChunk(const boost::shared_ptr<MonitorLiveData> &alg1,
                          size_t stopAtChunk) {
     Poco::ActiveResult<bool> res1 = alg1->executeAsync();
     Poco::Thread::sleep(50);
diff --git a/Framework/LiveData/test/StartLiveDataTest.h b/Framework/LiveData/test/StartLiveDataTest.h
index 65208964909..431bc8091f8 100644
--- a/Framework/LiveData/test/StartLiveDataTest.h
+++ b/Framework/LiveData/test/StartLiveDataTest.h
@@ -51,12 +51,12 @@ public:
    * @param AccumulationMethod :: parameter string
    * @return the created processed WS
    */
-  EventWorkspace_sptr doExecEvent(std::string AccumulationMethod,
-                                  double UpdateEvery,
-                                  std::string ProcessingAlgorithm = "",
-                                  std::string ProcessingProperties = "",
-                                  std::string PostProcessingAlgorithm = "",
-                                  std::string PostProcessingProperties = "") {
+  EventWorkspace_sptr
+  doExecEvent(const std::string &AccumulationMethod, double UpdateEvery,
+              const std::string &ProcessingAlgorithm = "",
+              const std::string &ProcessingProperties = "",
+              const std::string &PostProcessingAlgorithm = "",
+              const std::string &PostProcessingProperties = "") {
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
     TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("FromNow", "1"));
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/BoxControllerSettingsAlgorithm.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/BoxControllerSettingsAlgorithm.h
index 49227304eac..37183675869 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/BoxControllerSettingsAlgorithm.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/BoxControllerSettingsAlgorithm.h
@@ -31,17 +31,18 @@ protected:
                               int MaxRecursionDepth = 5);
 
   /// Set the settings in the given box controller
-  void setBoxController(Mantid::API::BoxController_sptr bc,
-                        Mantid::Geometry::Instrument_const_sptr instrument);
+  void
+  setBoxController(const Mantid::API::BoxController_sptr &bc,
+                   const Mantid::Geometry::Instrument_const_sptr &instrument);
 
   /// Set the settings in the given box controller
-  void setBoxController(Mantid::API::BoxController_sptr bc);
+  void setBoxController(const Mantid::API::BoxController_sptr &bc);
 
   std::string getBoxSettingsGroupName() { return "Box Splitting Settings"; }
   /// Take the defaults for the box splitting from the instrument parameters.
-  void
-  takeDefaultsFromInstrument(Mantid::Geometry::Instrument_const_sptr instrument,
-                             const size_t ndims);
+  void takeDefaultsFromInstrument(
+      const Mantid::Geometry::Instrument_const_sptr &instrument,
+      const size_t ndims);
 
 private:
 };
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompactMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompactMD.h
index 2499b0801bb..11e967304f3 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompactMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompactMD.h
@@ -37,10 +37,10 @@ public:
   /// Algorithm's version for identification
   int version() const override { return 1; }
   /// Finding the extents of the first non-zero signals.
-  void
-  findFirstNonZeroMinMaxExtents(Mantid::API::IMDHistoWorkspace_sptr inputWs,
-                                std::vector<Mantid::coord_t> &minVec,
-                                std::vector<Mantid::coord_t> &maxVec);
+  void findFirstNonZeroMinMaxExtents(
+      const Mantid::API::IMDHistoWorkspace_sptr &inputWs,
+      std::vector<Mantid::coord_t> &minVec,
+      std::vector<Mantid::coord_t> &maxVec);
 };
 } // namespace MDAlgorithms
 } // namespace Mantid
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompareMDWorkspaces.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompareMDWorkspaces.h
index 5d164554996..c5baef57566 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompareMDWorkspaces.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CompareMDWorkspaces.h
@@ -34,10 +34,11 @@ private:
   void init() override;
   void exec() override;
   void doComparison();
-  void compareMDGeometry(Mantid::API::IMDWorkspace_sptr ws1,
-                         Mantid::API::IMDWorkspace_sptr ws2);
-  void compareMDHistoWorkspaces(Mantid::DataObjects::MDHistoWorkspace_sptr ws1,
-                                Mantid::DataObjects::MDHistoWorkspace_sptr ws2);
+  void compareMDGeometry(const Mantid::API::IMDWorkspace_sptr &ws1,
+                         const Mantid::API::IMDWorkspace_sptr &ws2);
+  void compareMDHistoWorkspaces(
+      const Mantid::DataObjects::MDHistoWorkspace_sptr &ws1,
+      const Mantid::DataObjects::MDHistoWorkspace_sptr &ws2);
 
   template <typename MDE, size_t nd>
   void compareMDWorkspaces(
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvToMDSelector.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvToMDSelector.h
index fcf17e01235..e6711914d6f 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvToMDSelector.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvToMDSelector.h
@@ -33,7 +33,7 @@ public:
   /// function which selects the convertor depending on workspace type and
   /// (possibly, in a future) some workspace properties
   boost::shared_ptr<ConvToMDBase>
-  convSelector(API::MatrixWorkspace_sptr inputWS,
+  convSelector(const API::MatrixWorkspace_sptr &inputWS,
                boost::shared_ptr<ConvToMDBase> &currentSolver) const;
 
 private:
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWPDMDToSpectra.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWPDMDToSpectra.h
index 6485d432325..7e18f4bd312 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWPDMDToSpectra.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWPDMDToSpectra.h
@@ -113,35 +113,37 @@ private:
   void exec() override;
 
   /// Main algorithm to reduce powder diffraction data
-  API::MatrixWorkspace_sptr reducePowderData(
-      API::IMDEventWorkspace_const_sptr dataws,
-      API::IMDEventWorkspace_const_sptr monitorws, const std::string targetunit,
-      const std::map<int, double> &map_runwavelength, const double xmin,
-      const double xmax, const double binsize, bool dolinearinterpolation,
-      const std::vector<detid_t> &vec_excludeddets);
+  API::MatrixWorkspace_sptr
+  reducePowderData(const API::IMDEventWorkspace_const_sptr &dataws,
+                   const API::IMDEventWorkspace_const_sptr &monitorws,
+                   const std::string &targetunit,
+                   const std::map<int, double> &map_runwavelength,
+                   const double xmin, const double xmax, const double binsize,
+                   bool dolinearinterpolation,
+                   const std::vector<detid_t> &vec_excludeddets);
 
   /// Find the binning boundary according to detectors' positions
-  void findXBoundary(API::IMDEventWorkspace_const_sptr dataws,
+  void findXBoundary(const API::IMDEventWorkspace_const_sptr &dataws,
                      const std::string &targetunit,
                      const std::map<int, double> &map_runwavelength,
                      double &xmin, double &xmax);
 
   /// Bin signals to its 2theta position
-  void binMD(API::IMDEventWorkspace_const_sptr mdws, const char &unitbit,
+  void binMD(const API::IMDEventWorkspace_const_sptr &mdws, const char &unitbit,
              const std::map<int, double> &map_runlambda,
              const std::vector<double> &vecx, std::vector<double> &vecy,
              const std::vector<detid_t> &vec_excludedet);
 
   /// Do linear interpolation to zero counts if bin is too small
-  void linearInterpolation(API::MatrixWorkspace_sptr matrixws,
+  void linearInterpolation(const API::MatrixWorkspace_sptr &matrixws,
                            const double &infinitesimal);
 
   /// Set up sample logs
-  void setupSampleLogs(API::MatrixWorkspace_sptr matrixws,
-                       API::IMDEventWorkspace_const_sptr inputmdws);
+  void setupSampleLogs(const API::MatrixWorkspace_sptr &matrixws,
+                       const API::IMDEventWorkspace_const_sptr &inputmdws);
 
   /// Scale reduced data
-  void scaleMatrixWorkspace(API::MatrixWorkspace_sptr matrixws,
+  void scaleMatrixWorkspace(const API::MatrixWorkspace_sptr &matrixws,
                             const double &scalefactor,
                             const double &infinitesimal);
 
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDExpToMomentum.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDExpToMomentum.h
index 20d0878628a..1719bb7fa3f 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDExpToMomentum.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDExpToMomentum.h
@@ -45,7 +45,7 @@ private:
   void addMDEvents(bool usevirtual);
 
   void convertSpiceMatrixToMomentumMDEvents(
-      API::MatrixWorkspace_sptr dataws, bool usevirtual,
+      const API::MatrixWorkspace_sptr &dataws, bool usevirtual,
       const detid_t &startdetid, const int scannumber, const int runnumber,
       double measuretime, int monitor_counts);
 
@@ -66,7 +66,7 @@ private:
   void parseDetectorTable(std::vector<Kernel::V3D> &vec_detpos,
                           std::vector<detid_t> &vec_detid);
 
-  void setupTransferMatrix(API::MatrixWorkspace_sptr dataws,
+  void setupTransferMatrix(const API::MatrixWorkspace_sptr &dataws,
                            Kernel::DblMatrix &rotationMatrix);
 
   void createVirtualInstrument();
@@ -74,7 +74,7 @@ private:
   void updateQRange(const std::vector<Mantid::coord_t> &vec_q);
 
   /// Remove background from
-  void removeBackground(API::MatrixWorkspace_sptr dataws);
+  void removeBackground(const API::MatrixWorkspace_sptr &dataws);
 
   API::ITableWorkspace_sptr m_expDataTableWS;
   API::ITableWorkspace_sptr m_detectorListTableWS;
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDMDtoHKL.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDMDtoHKL.h
index ccfd30d9182..a627f571672 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDMDtoHKL.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertCWSDMDtoHKL.h
@@ -47,7 +47,7 @@ private:
   /// Execution code
   void exec() override;
 
-  void exportEvents(API::IMDEventWorkspace_sptr mdws,
+  void exportEvents(const API::IMDEventWorkspace_sptr &mdws,
                     std::vector<Kernel::V3D> &vec_event_qsample,
                     std::vector<signal_t> &vec_event_signal,
                     std::vector<detid_t> &vec_event_det);
@@ -74,7 +74,7 @@ private:
 
   void getUBMatrix();
 
-  void getRange(const std::vector<Kernel::V3D> vec_hkl,
+  void getRange(const std::vector<Kernel::V3D> &vec_hkl,
                 std::vector<double> &extentMins,
                 std::vector<double> &extentMaxs);
 
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertSpiceDataToRealSpace.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertSpiceDataToRealSpace.h
index 4f3abf712c7..a38007bceaa 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertSpiceDataToRealSpace.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertSpiceDataToRealSpace.h
@@ -59,8 +59,8 @@ private:
 
   /// Parse data table workspace to a vector of matrix workspaces
   std::vector<API::MatrixWorkspace_sptr> convertToMatrixWorkspace(
-      DataObjects::TableWorkspace_sptr tablews,
-      API::MatrixWorkspace_const_sptr parentws,
+      const DataObjects::TableWorkspace_sptr &tablews,
+      const API::MatrixWorkspace_const_sptr &parentws,
       Types::Core::DateAndTime runstart,
       std::map<std::string, std::vector<double>> &logvecmap,
       std::vector<Types::Core::DateAndTime> &vectimes);
@@ -71,43 +71,42 @@ private:
 
   /// Create an MDWorkspace for monitor counts
   API::IMDEventWorkspace_sptr createMonitorMDWorkspace(
-      const std::vector<API::MatrixWorkspace_sptr> vec_ws2d,
+      const std::vector<API::MatrixWorkspace_sptr> &vec_ws2d,
       const std::vector<double> &vecmonitor);
 
   /// Read parameter information from table workspace
-  void readTableInfo(DataObjects::TableWorkspace_const_sptr tablews,
+  void readTableInfo(const DataObjects::TableWorkspace_const_sptr &tablews,
                      size_t &ipt, size_t &irotangle, size_t &itime,
                      std::vector<std::pair<size_t, size_t>> &anodelist,
                      std::map<std::string, size_t> &samplenameindexmap);
 
   /// Return sample logs
-  void parseSampleLogs(DataObjects::TableWorkspace_sptr tablews,
+  void parseSampleLogs(const DataObjects::TableWorkspace_sptr &tablews,
                        const std::map<std::string, size_t> &indexlist,
                        std::map<std::string, std::vector<double>> &logvecmap);
 
   /// Load one run (one pt.) to a matrix workspace
-  API::MatrixWorkspace_sptr
-  loadRunToMatrixWS(DataObjects::TableWorkspace_sptr tablews, size_t irow,
-                    API::MatrixWorkspace_const_sptr parentws,
-                    Types::Core::DateAndTime runstart, size_t ipt,
-                    size_t irotangle, size_t itime,
-                    const std::vector<std::pair<size_t, size_t>> anodelist,
-                    double &duration);
+  API::MatrixWorkspace_sptr loadRunToMatrixWS(
+      const DataObjects::TableWorkspace_sptr &tablews, size_t irow,
+      const API::MatrixWorkspace_const_sptr &parentws,
+      Types::Core::DateAndTime runstart, size_t ipt, size_t irotangle,
+      size_t itime, const std::vector<std::pair<size_t, size_t>> &anodelist,
+      double &duration);
 
   /// Append Experiment Info
   void
-  addExperimentInfos(API::IMDEventWorkspace_sptr mdws,
-                     const std::vector<API::MatrixWorkspace_sptr> vec_ws2d);
+  addExperimentInfos(const API::IMDEventWorkspace_sptr &mdws,
+                     const std::vector<API::MatrixWorkspace_sptr> &vec_ws2d);
 
   /// Append sample logs to MD workspace
   void
-  appendSampleLogs(API::IMDEventWorkspace_sptr mdws,
+  appendSampleLogs(const API::IMDEventWorkspace_sptr &mdws,
                    const std::map<std::string, std::vector<double>> &logvecmap,
                    const std::vector<Types::Core::DateAndTime> &vectimes);
 
   /// Parse detector efficiency table workspace to map
-  std::map<detid_t, double>
-  parseDetectorEfficiencyTable(DataObjects::TableWorkspace_sptr detefftablews);
+  std::map<detid_t, double> parseDetectorEfficiencyTable(
+      const DataObjects::TableWorkspace_sptr &detefftablews);
 
   /// Apply the detector's efficiency correction to
   void
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertToMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertToMD.h
index 19d01bac63c..cb19a48fac4 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertToMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertToMD.h
@@ -60,8 +60,8 @@ private:
   /// progress reporter
   boost::scoped_ptr<API::Progress> m_Progress;
 
-  void setupFileBackend(std::string filebackPath,
-                        API::IMDEventWorkspace_sptr outputWS);
+  void setupFileBackend(const std::string &filebackPath,
+                        const API::IMDEventWorkspace_sptr &outputWS);
 
   //------------------------------------------------------------------------------------------------------------------------------------------
 protected: // for testing, otherwise private:
@@ -74,13 +74,13 @@ protected: // for testing, otherwise private:
   // Workflow helpers:
   /**Check if target workspace new or existing one and we need to create new
    * workspace*/
-  bool doWeNeedNewTargetWorkspace(API::IMDEventWorkspace_sptr spws);
+  bool doWeNeedNewTargetWorkspace(const API::IMDEventWorkspace_sptr &spws);
   /**Create new MD workspace using existing parameters for algorithm */
   API::IMDEventWorkspace_sptr
   createNewMDWorkspace(const MDAlgorithms::MDWSDescription &targWSDescr,
                        const bool filebackend, const std::string &filename);
 
-  bool buildTargetWSDescription(API::IMDEventWorkspace_sptr spws,
+  bool buildTargetWSDescription(const API::IMDEventWorkspace_sptr &spws,
                                 const std::string &QModReq,
                                 const std::string &dEModReq,
                                 const std::vector<std::string> &otherDimNames,
@@ -106,7 +106,7 @@ protected: // for testing, otherwise private:
                   std::vector<double> &minVal, std::vector<double> &maxVal);
 
   /// Sets up the top level splitting, i.e. of level 0, for the box controller
-  void setupTopLevelSplitting(Mantid::API::BoxController_sptr bc);
+  void setupTopLevelSplitting(const Mantid::API::BoxController_sptr &bc);
 };
 
 } // namespace MDAlgorithms
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CreateMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CreateMD.h
index 4e1b3c7bbf2..7f0eb9c749c 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CreateMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CreateMD.h
@@ -43,23 +43,23 @@ private:
                                      const std::string &wsname);
 
   /// Add a sample log to a workspace
-  void addSampleLog(Mantid::API::MatrixWorkspace_sptr workspace,
+  void addSampleLog(const Mantid::API::MatrixWorkspace_sptr &workspace,
                     const std::string &log_name, double log_number);
 
   /// Set the goniometer values in a workspace
-  void setGoniometer(Mantid::API::MatrixWorkspace_sptr workspace);
+  void setGoniometer(const Mantid::API::MatrixWorkspace_sptr &workspace);
 
   /// Set the UB matrix in a workspace
-  void setUB(Mantid::API::MatrixWorkspace_sptr workspace, double a, double b,
-             double c, double alpha, double beta, double gamma,
+  void setUB(const Mantid::API::MatrixWorkspace_sptr &workspace, double a,
+             double b, double c, double alpha, double beta, double gamma,
              const std::vector<double> &u, const std::vector<double> &v);
 
   /// Convert a workspace to MDWorkspace
   Mantid::API::IMDEventWorkspace_sptr
-  convertToMD(Mantid::API::Workspace_sptr workspace,
+  convertToMD(const Mantid::API::Workspace_sptr &workspace,
               const std::string &analysis_mode, bool in_place,
               const std::string &filebackend_filename, const bool filebackend,
-              Mantid::API::IMDEventWorkspace_sptr out_mdws);
+              const Mantid::API::IMDEventWorkspace_sptr &out_mdws);
 
   /// Merge input workspaces
   Mantid::API::IMDEventWorkspace_sptr
@@ -67,13 +67,13 @@ private:
 
   /// Add logs and convert to MDWorkspace for a single run
   Mantid::API::IMDEventWorkspace_sptr
-  single_run(Mantid::API::MatrixWorkspace_sptr input_workspace,
+  single_run(const Mantid::API::MatrixWorkspace_sptr &input_workspace,
              const std::string &emode, double efix, double psi, double gl,
              double gs, bool in_place, const std::vector<double> &alatt,
              const std::vector<double> &angdeg, const std::vector<double> &u,
              const std::vector<double> &v,
              const std::string &filebackend_filename, const bool filebackend,
-             Mantid::API::IMDEventWorkspace_sptr out_mdws);
+             const Mantid::API::IMDEventWorkspace_sptr &out_mdws);
 
   /// Validate the algorithm's input properties
   std::map<std::string, std::string> validateInputs() override;
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CreateMDWorkspace.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CreateMDWorkspace.h
index f51b5659331..af76fc6919d 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CreateMDWorkspace.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CreateMDWorkspace.h
@@ -57,8 +57,8 @@ private:
 
   template <typename MDE, size_t nd>
   void finish(typename DataObjects::MDEventWorkspace<MDE, nd>::sptr ws);
-  Mantid::Geometry::MDFrame_uptr createMDFrame(std::string frame,
-                                               std::string unit);
+  Mantid::Geometry::MDFrame_uptr createMDFrame(const std::string &frame,
+                                               const std::string &unit);
   bool checkIfFrameValid(const std::string &frame,
                          const std::vector<std::string> &targetFrames);
 };
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CutMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CutMD.h
index 4330b015afb..7b52787fc18 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CutMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/CutMD.h
@@ -14,9 +14,9 @@
 namespace Mantid {
 namespace MDAlgorithms {
 
-std::vector<std::string>
-    DLLExport findOriginalQUnits(Mantid::API::IMDWorkspace_const_sptr inws,
-                                 Mantid::Kernel::Logger &logger);
+std::vector<std::string> DLLExport
+findOriginalQUnits(const Mantid::API::IMDWorkspace_const_sptr &inws,
+                   Mantid::Kernel::Logger &logger);
 
 /** CutMD : Slices multidimensional workspaces.
 
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/DisplayNormalizationSetter.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/DisplayNormalizationSetter.h
index 7624bd52a72..24e2d7c1b90 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/DisplayNormalizationSetter.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/DisplayNormalizationSetter.h
@@ -19,7 +19,7 @@ energy-transfer-mode
 */
 class DLLExport DisplayNormalizationSetter {
 public:
-  void operator()(Mantid::API::IMDWorkspace_sptr mdWorkspace,
+  void operator()(const Mantid::API::IMDWorkspace_sptr &mdWorkspace,
                   const Mantid::API::MatrixWorkspace_sptr &underlyingWorkspace,
                   bool isQ = false,
                   const Mantid::Kernel::DeltaEMode::Type &mode =
@@ -27,14 +27,14 @@ public:
 
 private:
   void setNormalizationMDEvent(
-      Mantid::API::IMDWorkspace_sptr mdWorkspace,
+      const Mantid::API::IMDWorkspace_sptr &mdWorkspace,
       const Mantid::API::MatrixWorkspace_sptr &underlyingWorkspace,
       bool isQ = false,
       const Mantid::Kernel::DeltaEMode::Type &mode =
           Mantid::Kernel::DeltaEMode::Elastic);
 
   void applyNormalizationMDEvent(
-      Mantid::API::IMDWorkspace_sptr mdWorkspace,
+      const Mantid::API::IMDWorkspace_sptr &mdWorkspace,
       Mantid::API::MDNormalization displayNormalization,
       Mantid::API::MDNormalization displayNormalizationHisto);
 };
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FindPeaksMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FindPeaksMD.h
index 22666e34921..14cb071885c 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FindPeaksMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FindPeaksMD.h
@@ -74,7 +74,7 @@ private:
   template <typename MDE, size_t nd>
   void findPeaks(typename DataObjects::MDEventWorkspace<MDE, nd>::sptr ws);
   /// Run find peaks on a histo workspace
-  void findPeaksHisto(Mantid::DataObjects::MDHistoWorkspace_sptr ws);
+  void findPeaksHisto(const Mantid::DataObjects::MDHistoWorkspace_sptr &ws);
 
   /// Output PeaksWorkspace
   Mantid::DataObjects::PeaksWorkspace_sptr peakWS;
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FitMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FitMD.h
index 794757a4225..b8350d48d2f 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FitMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/FitMD.h
@@ -9,6 +9,8 @@
 //----------------------------------------------------------------------
 // Includes
 //----------------------------------------------------------------------
+#include <utility>
+
 #include "MantidAPI/IDomainCreator.h"
 
 namespace Mantid {
@@ -64,7 +66,7 @@ public:
   size_t getDomainSize() const override;
   /// Set the workspace
   void setWorkspace(boost::shared_ptr<API::IMDWorkspace> IMDWorkspace) {
-    m_IMDWorkspace = IMDWorkspace;
+    m_IMDWorkspace = std::move(IMDWorkspace);
   }
   /// Set the range
   void setRange(size_t startIndex, size_t count);
@@ -83,8 +85,8 @@ protected:
                              const std::string &outputWorkspacePropertyName);
   /// Create histo output workspace
   boost::shared_ptr<API::Workspace> createHistoOutputWorkspace(
-      const std::string &baseName, API::IFunction_sptr function,
-      boost::shared_ptr<const API::IMDHistoWorkspace> inputWorkspace,
+      const std::string &baseName, const API::IFunction_sptr &function,
+      const boost::shared_ptr<const API::IMDHistoWorkspace> &inputWorkspace,
       const std::string &outputWorkspacePropertyName);
 
   /// Store workspace property name
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/GetSpiceDataRawCountsFromMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/GetSpiceDataRawCountsFromMD.h
index 841374d59de..aba7a9949d9 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/GetSpiceDataRawCountsFromMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/GetSpiceDataRawCountsFromMD.h
@@ -47,34 +47,35 @@ private:
   void exec() override;
 
   /// Export all detectors' counts for a run
-  void exportDetCountsOfRun(API::IMDEventWorkspace_const_sptr datamdws,
-                            API::IMDEventWorkspace_const_sptr monitormdws,
-                            const int runnumber, std::vector<double> &vecX,
-                            std::vector<double> &vecY, std::string &xlabel,
-                            std::string &ylabel, bool donormalize);
+  void
+  exportDetCountsOfRun(const API::IMDEventWorkspace_const_sptr &datamdws,
+                       const API::IMDEventWorkspace_const_sptr &monitormdws,
+                       const int runnumber, std::vector<double> &vecX,
+                       std::vector<double> &vecY, std::string &xlabel,
+                       std::string &ylabel, bool donormalize);
 
   /// Export a detector's counts accross all runs
-  void exportIndividualDetCounts(API::IMDEventWorkspace_const_sptr datamdws,
-                                 API::IMDEventWorkspace_const_sptr monitormdws,
-                                 const int detid, std::vector<double> &vecX,
-                                 std::vector<double> &vecY, std::string &xlabel,
-                                 std::string &ylabel, const bool &donormalize);
+  void exportIndividualDetCounts(
+      const API::IMDEventWorkspace_const_sptr &datamdws,
+      const API::IMDEventWorkspace_const_sptr &monitormdws, const int detid,
+      std::vector<double> &vecX, std::vector<double> &vecY, std::string &xlabel,
+      std::string &ylabel, const bool &donormalize);
 
   /// Export sample log values accross all runs
-  void exportSampleLogValue(API::IMDEventWorkspace_const_sptr datamdws,
+  void exportSampleLogValue(const API::IMDEventWorkspace_const_sptr &datamdws,
                             const std::string &samplelogname,
                             std::vector<double> &vecX,
                             std::vector<double> &vecY, std::string &xlabel,
                             std::string &ylabel);
 
   /// Get detectors' counts
-  void getDetCounts(API::IMDEventWorkspace_const_sptr mdws,
+  void getDetCounts(const API::IMDEventWorkspace_const_sptr &mdws,
                     const int &runnumber, const int &detid,
                     std::vector<double> &vecX, std::vector<double> &vecY,
                     bool formX);
 
   /// Get sample log values
-  void getSampleLogValues(API::IMDEventWorkspace_const_sptr mdws,
+  void getSampleLogValues(const API::IMDEventWorkspace_const_sptr &mdws,
                           const std::string &samplelogname, const int runnumber,
                           std::vector<double> &vecSampleLog);
 
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ImportMDHistoWorkspaceBase.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ImportMDHistoWorkspaceBase.h
index 2deb6d2f409..c9b16ab41c2 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ImportMDHistoWorkspaceBase.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ImportMDHistoWorkspaceBase.h
@@ -37,8 +37,8 @@ protected:
 private:
   // Product of the bins across all dimensions.
   size_t m_bin_product = 0;
-  Mantid::Geometry::MDFrame_uptr createMDFrame(std::string frame,
-                                               std::string unit);
+  Mantid::Geometry::MDFrame_uptr createMDFrame(const std::string &frame,
+                                               const std::string &unit);
   bool checkIfFrameValid(const std::string &frame,
                          const std::vector<std::string> &targetFrames);
 };
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Integrate3DEvents.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Integrate3DEvents.h
index 0208bdf1b60..ef2ddcf9f39 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Integrate3DEvents.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Integrate3DEvents.h
@@ -80,7 +80,7 @@ public:
 
   /// Find the net integrated intensity of a peak, using ellipsoidal volumes
   boost::shared_ptr<const Mantid::Geometry::PeakShape> ellipseIntegrateEvents(
-      std::vector<Kernel::V3D> E1Vec, Mantid::Kernel::V3D const &peak_q,
+      const std::vector<Kernel::V3D> &E1Vec, Mantid::Kernel::V3D const &peak_q,
       bool specify_size, double peak_radius, double back_inner_radius,
       double back_outer_radius, std::vector<double> &axes_radii, double &inti,
       double &sigi);
@@ -88,7 +88,7 @@ public:
   /// Find the net integrated intensity of a modulated peak, using ellipsoidal
   /// volumes
   boost::shared_ptr<const Mantid::Geometry::PeakShape>
-  ellipseIntegrateModEvents(std::vector<Kernel::V3D> E1Vec,
+  ellipseIntegrateModEvents(const std::vector<Kernel::V3D> &E1Vec,
                             Mantid::Kernel::V3D const &peak_q,
                             Mantid::Kernel::V3D const &hkl,
                             Mantid::Kernel::V3D const &mnp, bool specify_size,
@@ -176,7 +176,7 @@ private:
   /// Find the net integrated intensity of a list of Q's using ellipsoids
   boost::shared_ptr<const Mantid::DataObjects::PeakShapeEllipsoid>
   ellipseIntegrateEvents(
-      std::vector<Kernel::V3D> E1Vec, Kernel::V3D const &peak_q,
+      const std::vector<Kernel::V3D> &E1Vec, Kernel::V3D const &peak_q,
       std::vector<std::pair<std::pair<double, double>,
                             Mantid::Kernel::V3D>> const &ev_list,
       std::vector<Mantid::Kernel::V3D> const &directions,
@@ -185,7 +185,7 @@ private:
       std::vector<double> &axes_radii, double &inti, double &sigi);
 
   /// Compute if a particular Q falls on the edge of a detector
-  double detectorQ(std::vector<Kernel::V3D> E1Vec,
+  double detectorQ(const std::vector<Kernel::V3D> &E1Vec,
                    const Mantid::Kernel::V3D QLabFrame,
                    const std::vector<double> &r);
 
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegrateEllipsoids.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegrateEllipsoids.h
index a0851899638..ba54418df9f 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegrateEllipsoids.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegrateEllipsoids.h
@@ -52,8 +52,8 @@ private:
   /// Calculate if this Q is on a detector
   void calculateE1(const Geometry::DetectorInfo &detectorInfo);
 
-  void runMaskDetectors(Mantid::DataObjects::PeaksWorkspace_sptr peakWS,
-                        std::string property, std::string values);
+  void runMaskDetectors(const Mantid::DataObjects::PeaksWorkspace_sptr &peakWS,
+                        const std::string &property, const std::string &values);
 
   /// save for all detector pixels
   std::vector<Kernel::V3D> E1Vec;
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegrateEllipsoidsTwoStep.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegrateEllipsoidsTwoStep.h
index 1148a831df7..c00e19cc3a8 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegrateEllipsoidsTwoStep.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegrateEllipsoidsTwoStep.h
@@ -54,8 +54,8 @@ private:
                         const Kernel::DblMatrix &UBinv, bool hkl_integ);
   /// Calculate if this Q is on a detector
   void calculateE1(const Geometry::DetectorInfo &detectorInfo);
-  void runMaskDetectors(Mantid::DataObjects::PeaksWorkspace_sptr peakWS,
-                        std::string property, std::string values);
+  void runMaskDetectors(const Mantid::DataObjects::PeaksWorkspace_sptr &peakWS,
+                        const std::string &property, const std::string &values);
 
   /// integrate a collection of strong peaks
   DataObjects::PeaksWorkspace_sptr
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksCWSD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksCWSD.h
index 00a8ba972d4..39f6ce7ae3c 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksCWSD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksCWSD.h
@@ -70,7 +70,7 @@ private:
   std::map<int, double> getMeasureTime();
 
   std::vector<detid_t>
-  processMaskWorkspace(DataObjects::MaskWorkspace_const_sptr maskws);
+  processMaskWorkspace(const DataObjects::MaskWorkspace_const_sptr &maskws);
 
   void getPeakInformation();
 
@@ -82,7 +82,8 @@ private:
   void normalizePeaksIntensities();
 
   DataObjects::PeaksWorkspace_sptr
-  createPeakworkspace(Kernel::V3D peakCenter, API::IMDEventWorkspace_sptr mdws);
+  createPeakworkspace(Kernel::V3D peakCenter,
+                      const API::IMDEventWorkspace_sptr &mdws);
 
   /// Input MDEventWorkspace
   Mantid::API::IMDEventWorkspace_sptr m_inputWS;
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD2.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD2.h
index 9f955d09525..ce470c860cb 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD2.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD2.h
@@ -61,14 +61,15 @@ private:
   /// Calculate if this Q is on a detector
   void calculateE1(const Geometry::DetectorInfo &detectorInfo);
   double detectorQ(Mantid::Kernel::V3D QLabFrame, double r);
-  void runMaskDetectors(Mantid::DataObjects::PeaksWorkspace_sptr peakWS,
-                        std::string property, std::string values);
+  void runMaskDetectors(const Mantid::DataObjects::PeaksWorkspace_sptr &peakWS,
+                        const std::string &property, const std::string &values);
 
   /// save for all detector pixels
   std::vector<Kernel::V3D> E1Vec;
 
   /// Check if peaks overlap
-  void checkOverlap(int i, Mantid::DataObjects::PeaksWorkspace_sptr peakWS,
+  void checkOverlap(int i,
+                    const Mantid::DataObjects::PeaksWorkspace_sptr &peakWS,
                     Mantid::Kernel::SpecialCoordinateSystem CoordinatesToUse,
                     double radius);
 };
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMDHKL.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMDHKL.h
index 8b6b73ced15..a6c4ad062a6 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMDHKL.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMDHKL.h
@@ -60,8 +60,8 @@ private:
   DataObjects::MDHistoWorkspace_sptr
   cropHisto(int h, int k, int l, double box, const API::IMDWorkspace_sptr &ws);
   void integratePeak(const int neighborPts,
-                     DataObjects::MDHistoWorkspace_sptr out, double &intensity,
-                     double &errorSquared);
+                     const DataObjects::MDHistoWorkspace_sptr &out,
+                     double &intensity, double &errorSquared);
 };
 
 } // namespace MDAlgorithms
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadDNSSCD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadDNSSCD.h
index 6f4949d3ee9..d67fa614cb7 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadDNSSCD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadDNSSCD.h
@@ -89,13 +89,13 @@ private:
   Mantid::API::IMDEventWorkspace_sptr m_OutWS;
 
   int splitIntoColumns(std::list<std::string> &columns, std::string &str);
-  void read_data(const std::string fname,
+  void read_data(const std::string &fname,
                  std::map<std::string, std::string> &str_metadata,
                  std::map<std::string, double> &num_metadata);
   void fillOutputWorkspace(double wavelength);
   void fillOutputWorkspaceRaw(double wavelength);
   API::ITableWorkspace_sptr saveHuber();
-  void loadHuber(API::ITableWorkspace_sptr tws);
+  void loadHuber(const API::ITableWorkspace_sptr &tws);
   template <class T>
   void updateProperties(API::Run &run, std::map<std::string, T> &metadata,
                         std::string time);
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadMD.h
index 724a3176a74..9d421695064 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadMD.h
@@ -62,8 +62,8 @@ private:
   void loadExperimentInfos(
       boost::shared_ptr<Mantid::API::MultipleExperimentInfos> ws);
 
-  void loadSlab(std::string name, void *data,
-                DataObjects::MDHistoWorkspace_sptr ws,
+  void loadSlab(const std::string &name, void *data,
+                const DataObjects::MDHistoWorkspace_sptr &ws,
                 NeXus::NXnumtype dataType);
   void loadHisto();
 
@@ -80,18 +80,18 @@ private:
       boost::optional<Mantid::API::MDNormalization> &normalization);
 
   /// Load all the affine matricies
-  void loadAffineMatricies(API::IMDWorkspace_sptr ws);
+  void loadAffineMatricies(const API::IMDWorkspace_sptr &ws);
   /// Load a given affine matrix
-  API::CoordTransform *loadAffineMatrix(std::string entry_name);
+  API::CoordTransform *loadAffineMatrix(const std::string &entry_name);
 
   /// Sets MDFrames for workspaces from legacy files
-  void setMDFrameOnWorkspaceFromLegacyFile(API::IMDWorkspace_sptr ws);
+  void setMDFrameOnWorkspaceFromLegacyFile(const API::IMDWorkspace_sptr &ws);
 
   /// Checks if a worspace is a certain type of legacy file
-  void checkForRequiredLegacyFixup(API::IMDWorkspace_sptr ws);
+  void checkForRequiredLegacyFixup(const API::IMDWorkspace_sptr &ws);
 
   /// Negative scaling for Q dimensions
-  std::vector<double> qDimensions(API::IMDWorkspace_sptr ws);
+  std::vector<double> qDimensions(const API::IMDWorkspace_sptr &ws);
 
   /// Open file handle
   // clang-format off
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadSQW2.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadSQW2.h
index f121f9adeeb..7a95acbba7e 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadSQW2.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadSQW2.h
@@ -63,7 +63,7 @@ private:
   Geometry::IMDDimension_sptr createEnDimension(float umin, float umax,
                                                 size_t nbins);
   void setupBoxController();
-  void setupFileBackend(std::string filebackPath);
+  void setupFileBackend(const std::string &filebackPath);
   void readPixelDataIntoWorkspace();
   void splitAllBoxes();
   void warnIfMemoryInsufficient(int64_t npixtot);
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDNorm.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDNorm.h
index e5cf63619a5..f0bf7fced21 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDNorm.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDNorm.h
@@ -34,25 +34,25 @@ private:
   void exec() override;
   void validateBinningForTemporaryDataWorkspace(
       const std::map<std::string, std::string> &,
-      const Mantid::API::IMDHistoWorkspace_sptr);
+      const Mantid::API::IMDHistoWorkspace_sptr &);
   std::map<std::string, std::string> validateInputs() override final;
   std::string QDimensionName(std::vector<double> projection);
   std::string QDimensionNameQSample(int i);
   std::map<std::string, std::string> getBinParameters();
   void createNormalizationWS(const DataObjects::MDHistoWorkspace &dataWS);
   DataObjects::MDHistoWorkspace_sptr
-  binInputWS(std::vector<Geometry::SymmetryOperation> symmetryOps);
+  binInputWS(const std::vector<Geometry::SymmetryOperation> &symmetryOps);
   std::vector<coord_t>
   getValuesFromOtherDimensions(bool &skipNormalization,
                                uint16_t expInfoIndex = 0) const;
   void cacheDimensionXValues();
   void calculateNormalization(const std::vector<coord_t> &otherValues,
-                              Geometry::SymmetryOperation so,
+                              const Geometry::SymmetryOperation &so,
                               uint16_t expInfoIndex, size_t soIndex);
   void calculateIntersections(std::vector<std::array<double, 4>> &intersections,
                               const double theta, const double phi,
-                              Kernel::DblMatrix transform, double lowvalue,
-                              double highvalue);
+                              const Kernel::DblMatrix &transform,
+                              double lowvalue, double highvalue);
   void calcIntegralsForIntersections(const std::vector<double> &xValues,
                                      const API::MatrixWorkspace &integrFlux,
                                      size_t sp, std::vector<double> &yValues);
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDTransfNoQ.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDTransfNoQ.h
index 4dab97231a0..b8352419bc2 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDTransfNoQ.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDTransfNoQ.h
@@ -96,7 +96,7 @@ private:
 private:
   // internal helper function which extract one or two axis from input matrix
   // workspace;
-  static void getAxes(API::MatrixWorkspace_const_sptr inWS,
+  static void getAxes(const API::MatrixWorkspace_const_sptr &inWS,
                       API::NumericAxis *&pXAxis, API::NumericAxis *&pYAxis);
 };
 
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h
index 734df7c6393..07a7f14a0b7 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h
@@ -108,7 +108,7 @@ public: // for the time being
   /// method builds MD Event ws description from a matrix workspace and the
   /// transformations, requested to be performed on the workspace
   void buildFromMatrixWS(const API::MatrixWorkspace_sptr &pWS,
-                         const std::string &QMode, const std::string dEMode,
+                         const std::string &QMode, const std::string &dEMode,
                          const std::vector<std::string> &dimPropertyNames =
                              std::vector<std::string>());
 
@@ -132,12 +132,12 @@ public: // for the time being
   /** function extracts the coordinates from additional workspace properties and
    * places them to AddCoord vector for further usage*/
   static void
-  fillAddProperties(Mantid::API::MatrixWorkspace_const_sptr inWS2D,
+  fillAddProperties(const Mantid::API::MatrixWorkspace_const_sptr &inWS2D,
                     const std::vector<std::string> &dimPropertyNames,
                     std::vector<coord_t> &AddCoord);
 
   static boost::shared_ptr<Geometry::OrientedLattice>
-  getOrientedLattice(Mantid::API::MatrixWorkspace_const_sptr inWS2D);
+  getOrientedLattice(const Mantid::API::MatrixWorkspace_const_sptr &inWS2D);
 
   /// Set the special coordinate system if any.
   void
@@ -145,7 +145,7 @@ public: // for the time being
   /// @return the special coordinate system if any.
   Mantid::Kernel::SpecialCoordinateSystem getCoordinateSystem() const;
   /// Set the md frame
-  void setFrame(const std::string frameKey);
+  void setFrame(const std::string &frameKey);
   /// Retrieve the md frame
   Geometry::MDFrame_uptr getFrame(size_t d) const;
 
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MergeMDFiles.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MergeMDFiles.h
index 1288d08656d..ab2023ee4f0 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MergeMDFiles.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MergeMDFiles.h
@@ -54,7 +54,7 @@ private:
 
   void loadBoxData();
 
-  void doExecByCloning(Mantid::API::IMDEventWorkspace_sptr ws,
+  void doExecByCloning(const Mantid::API::IMDEventWorkspace_sptr &ws,
                        const std::string &outputFile);
 
   void finalizeOutput(const std::string &outputFile);
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/PreprocessDetectorsToMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/PreprocessDetectorsToMD.h
index dfea448c535..9a44dcd6a0a 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/PreprocessDetectorsToMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/PreprocessDetectorsToMD.h
@@ -66,7 +66,8 @@ protected: // for testing
   // build a table workspace corresponding to the input matrix workspace
   boost::shared_ptr<DataObjects::TableWorkspace>
   createTableWorkspace(const API::MatrixWorkspace_const_sptr &inputWS);
-  bool isDetInfoLost(Mantid::API::MatrixWorkspace_const_sptr inWS2D) const;
+  bool
+  isDetInfoLost(const Mantid::API::MatrixWorkspace_const_sptr &inWS2D) const;
   // helper function to get efixed if it is there or not;
   double getEi(const API::MatrixWorkspace_const_sptr &inputWS) const;
 };
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveIsawQvector.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveIsawQvector.h
index de5a8b8ccce..a72107429aa 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveIsawQvector.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveIsawQvector.h
@@ -32,7 +32,7 @@ private:
 
   MDWSDescription m_targWSDescr;
 
-  void initTargetWSDescr(DataObjects::EventWorkspace_sptr wksp);
+  void initTargetWSDescr(const DataObjects::EventWorkspace_sptr &wksp);
 };
 
 } // namespace MDAlgorithms
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD.h
index 90238f869f6..d621277f40c 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD.h
@@ -46,7 +46,7 @@ private:
   void doSaveEvents(typename DataObjects::MDEventWorkspace<MDE, nd>::sptr ws);
 
   /// Save the MDHistoWorkspace.
-  void doSaveHisto(Mantid::DataObjects::MDHistoWorkspace_sptr ws);
+  void doSaveHisto(const Mantid::DataObjects::MDHistoWorkspace_sptr &ws);
 
   /// Save all the affine matricies
   void saveAffineTransformMatricies(::NeXus::File *const file,
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD2.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD2.h
index 9a2a6b0be45..efe1f6204b0 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD2.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SaveMD2.h
@@ -42,7 +42,7 @@ private:
   void exec() override;
 
   /// Save the MDHistoWorkspace.
-  void doSaveHisto(Mantid::DataObjects::MDHistoWorkspace_sptr ws);
+  void doSaveHisto(const Mantid::DataObjects::MDHistoWorkspace_sptr &ws);
 
   /// Save a generic matrix
   template <typename T>
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SlicingAlgorithm.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SlicingAlgorithm.h
index 2bdd1eb5765..91be6c61ac5 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SlicingAlgorithm.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SlicingAlgorithm.h
@@ -136,8 +136,8 @@ protected:
 
 private:
   Mantid::Geometry::MDFrame_uptr
-  createMDFrameForNonAxisAligned(std::string units,
-                                 Mantid::Kernel::VMD basisVector) const;
+  createMDFrameForNonAxisAligned(const std::string &units,
+                                 const Mantid::Kernel::VMD &basisVector) const;
   std::vector<Mantid::Kernel::VMD> getOldBasis(size_t dimension) const;
   bool isProjectingOnFrame(const Mantid::Kernel::VMD &oldVector,
                            const Mantid::Kernel::VMD &basisVector) const;
@@ -146,7 +146,7 @@ private:
       const std::vector<Mantid::Kernel::VMD> &oldBasis) const;
   Mantid::Geometry::MDFrame_uptr
   extractMDFrameForNonAxisAligned(std::vector<size_t> indicesWithProjection,
-                                  std::string units) const;
+                                  const std::string &units) const;
   void setTargetUnits(Mantid::Geometry::MDFrame_uptr &frame,
                       const std::string &units) const;
 };
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SmoothMD.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SmoothMD.h
index 20f2fe9e67d..05e2f54c788 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SmoothMD.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/SmoothMD.h
@@ -37,13 +37,13 @@ public:
   std::map<std::string, std::string> validateInputs() override;
 
   boost::shared_ptr<Mantid::API::IMDHistoWorkspace> hatSmooth(
-      boost::shared_ptr<const Mantid::API::IMDHistoWorkspace> toSmooth,
+      const boost::shared_ptr<const Mantid::API::IMDHistoWorkspace> &toSmooth,
       const std::vector<double> &widthVector,
       boost::optional<boost::shared_ptr<const Mantid::API::IMDHistoWorkspace>>
           weightingWS);
 
   boost::shared_ptr<Mantid::API::IMDHistoWorkspace> gaussianSmooth(
-      boost::shared_ptr<const Mantid::API::IMDHistoWorkspace> toSmooth,
+      const boost::shared_ptr<const Mantid::API::IMDHistoWorkspace> &toSmooth,
       const std::vector<double> &widthVector,
       boost::optional<boost::shared_ptr<const Mantid::API::IMDHistoWorkspace>>
           weightingWS);
diff --git a/Framework/MDAlgorithms/src/BoxControllerSettingsAlgorithm.cpp b/Framework/MDAlgorithms/src/BoxControllerSettingsAlgorithm.cpp
index 855a89d15c0..84d0e2bc6fe 100644
--- a/Framework/MDAlgorithms/src/BoxControllerSettingsAlgorithm.cpp
+++ b/Framework/MDAlgorithms/src/BoxControllerSettingsAlgorithm.cpp
@@ -4,12 +4,14 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidMDAlgorithms/BoxControllerSettingsAlgorithm.h"
+#include <utility>
+
 #include "MantidKernel/ArrayProperty.h"
 #include "MantidKernel/BoundedValidator.h"
 #include "MantidKernel/StringTokenizer.h"
 #include "MantidKernel/Strings.h"
 #include "MantidKernel/System.h"
+#include "MantidMDAlgorithms/BoxControllerSettingsAlgorithm.h"
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -75,7 +77,8 @@ void BoxControllerSettingsAlgorithm::initBoxControllerProps(
  * @param ndims : Number of dimensions in output workspace.
  */
 void BoxControllerSettingsAlgorithm::takeDefaultsFromInstrument(
-    Mantid::Geometry::Instrument_const_sptr instrument, const size_t ndims) {
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
+    const size_t ndims) {
   const std::string splitThresholdName = "SplitThreshold";
   const std::string splitIntoName = "SplitInto";
   const std::string maxRecursionDepthName = "MaxRecursionDepth";
@@ -117,10 +120,11 @@ void BoxControllerSettingsAlgorithm::takeDefaultsFromInstrument(
  * @param instrument :: instrument to read parameters from.
  */
 void BoxControllerSettingsAlgorithm::setBoxController(
-    BoxController_sptr bc, Mantid::Geometry::Instrument_const_sptr instrument) {
+    const BoxController_sptr &bc,
+    const Mantid::Geometry::Instrument_const_sptr &instrument) {
   size_t nd = bc->getNDims();
 
-  takeDefaultsFromInstrument(instrument, nd);
+  takeDefaultsFromInstrument(std::move(instrument), nd);
 
   setBoxController(bc);
 }
@@ -131,7 +135,8 @@ void BoxControllerSettingsAlgorithm::setBoxController(
  *
  * @param bc :: box controller to modify
  */
-void BoxControllerSettingsAlgorithm::setBoxController(BoxController_sptr bc) {
+void BoxControllerSettingsAlgorithm::setBoxController(
+    const BoxController_sptr &bc) {
   size_t nd = bc->getNDims();
 
   int val;
diff --git a/Framework/MDAlgorithms/src/CompactMD.cpp b/Framework/MDAlgorithms/src/CompactMD.cpp
index e08e00e8d2c..8c158a00c83 100644
--- a/Framework/MDAlgorithms/src/CompactMD.cpp
+++ b/Framework/MDAlgorithms/src/CompactMD.cpp
@@ -30,7 +30,7 @@ namespace {
 std::vector<std::string>
 createPBinStringVector(std::vector<Mantid::coord_t> minVector,
                        std::vector<Mantid::coord_t> maxVector,
-                       IMDHistoWorkspace_sptr inputWs) {
+                       const IMDHistoWorkspace_sptr &inputWs) {
   size_t numDims = inputWs->getNumDims();
   std::vector<std::string> pBinStrVector;
   for (size_t iter = 0; iter < numDims; iter++) {
@@ -65,7 +65,7 @@ DECLARE_ALGORITHM(CompactMD)
  */
 
 void CompactMD::findFirstNonZeroMinMaxExtents(
-    IMDHistoWorkspace_sptr inputWs, std::vector<Mantid::coord_t> &minVec,
+    const IMDHistoWorkspace_sptr &inputWs, std::vector<Mantid::coord_t> &minVec,
     std::vector<Mantid::coord_t> &maxVec) {
   auto ws_iter = inputWs->createIterator();
   do {
diff --git a/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp b/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp
index 9554e6a6bcb..77411b55613 100644
--- a/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp
+++ b/Framework/MDAlgorithms/src/CompareMDWorkspaces.cpp
@@ -130,7 +130,8 @@ void CompareMDWorkspaces::compareTol(T a, T b, const std::string &message) {
 /** Compare the dimensions etc. of two MDWorkspaces
  */
 void CompareMDWorkspaces::compareMDGeometry(
-    Mantid::API::IMDWorkspace_sptr ws1, Mantid::API::IMDWorkspace_sptr ws2) {
+    const Mantid::API::IMDWorkspace_sptr &ws1,
+    const Mantid::API::IMDWorkspace_sptr &ws2) {
   compare(ws1->getNumDims(), ws2->getNumDims(),
           "Workspaces have a different number of dimensions");
   for (size_t d = 0; d < ws1->getNumDims(); d++) {
@@ -156,8 +157,8 @@ void CompareMDWorkspaces::compareMDGeometry(
 /** Compare the dimensions etc. of two MDWorkspaces
  */
 void CompareMDWorkspaces::compareMDHistoWorkspaces(
-    Mantid::DataObjects::MDHistoWorkspace_sptr ws1,
-    Mantid::DataObjects::MDHistoWorkspace_sptr ws2) {
+    const Mantid::DataObjects::MDHistoWorkspace_sptr &ws1,
+    const Mantid::DataObjects::MDHistoWorkspace_sptr &ws2) {
   compare(ws1->getNumDims(), ws2->getNumDims(),
           "Workspaces have a different number of dimensions");
   compare(ws1->getNPoints(), ws2->getNPoints(),
diff --git a/Framework/MDAlgorithms/src/ConvToMDBase.cpp b/Framework/MDAlgorithms/src/ConvToMDBase.cpp
index 7938951d5d8..78eec7938d9 100644
--- a/Framework/MDAlgorithms/src/ConvToMDBase.cpp
+++ b/Framework/MDAlgorithms/src/ConvToMDBase.cpp
@@ -4,9 +4,11 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidMDAlgorithms/ConvToMDBase.h"
+#include <utility>
+
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/Run.h"
+#include "MantidMDAlgorithms/ConvToMDBase.h"
 
 namespace Mantid {
 namespace MDAlgorithms {
@@ -46,7 +48,7 @@ size_t ConvToMDBase::initialize(
   m_detID = WSD.m_PreprDetTable->getColVector<int>("DetectorID");
 
   // set up output MD workspace wrapper
-  m_OutWSWrapper = inWSWrapper;
+  m_OutWSWrapper = std::move(inWSWrapper);
   // get the index which identify the run the source workspace came from.
   // This index will mark the workspace' events for diffetent worksapces to
   // combine
diff --git a/Framework/MDAlgorithms/src/ConvToMDSelector.cpp b/Framework/MDAlgorithms/src/ConvToMDSelector.cpp
index 90ef582c913..049b9296600 100644
--- a/Framework/MDAlgorithms/src/ConvToMDSelector.cpp
+++ b/Framework/MDAlgorithms/src/ConvToMDSelector.cpp
@@ -33,7 +33,7 @@ initiated)
 *@returns shared pointer to new solver, which corresponds to the workspace
 */
 boost::shared_ptr<ConvToMDBase> ConvToMDSelector::convSelector(
-    API::MatrixWorkspace_sptr inputWS,
+    const API::MatrixWorkspace_sptr &inputWS,
     boost::shared_ptr<ConvToMDBase> &currentSolver) const {
   // identify what kind of workspace we expect to process
   wsType inputWSType = Undefined;
diff --git a/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp b/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp
index 8779b9fd0a3..c9179896012 100644
--- a/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp
+++ b/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidMDAlgorithms/ConvertCWPDMDToSpectra.h"
 
 #include "MantidAPI/Axis.h"
@@ -208,8 +210,9 @@ void ConvertCWPDMDToSpectra::exec() {
  * @return
  */
 API::MatrixWorkspace_sptr ConvertCWPDMDToSpectra::reducePowderData(
-    API::IMDEventWorkspace_const_sptr dataws,
-    IMDEventWorkspace_const_sptr monitorws, const std::string targetunit,
+    const API::IMDEventWorkspace_const_sptr &dataws,
+    const IMDEventWorkspace_const_sptr &monitorws,
+    const std::string &targetunit,
     const std::map<int, double> &map_runwavelength, const double xmin,
     const double xmax, const double binsize, bool dolinearinterpolation,
     const std::vector<detid_t> &vec_excludeddets) {
@@ -259,7 +262,8 @@ API::MatrixWorkspace_sptr ConvertCWPDMDToSpectra::reducePowderData(
     unitchar = 'q';
 
   binMD(dataws, unitchar, map_runwavelength, vecx, vecy, vec_excludeddets);
-  binMD(monitorws, unitchar, map_runwavelength, vecx, vecm, vec_excludeddets);
+  binMD(std::move(monitorws), unitchar, map_runwavelength, vecx, vecm,
+        vec_excludeddets);
 
   // Normalize by division
   double maxmonitorcounts = 0;
@@ -317,7 +321,8 @@ API::MatrixWorkspace_sptr ConvertCWPDMDToSpectra::reducePowderData(
  * @param xmax :: (output) upper binning boundary
  */
 void ConvertCWPDMDToSpectra::findXBoundary(
-    API::IMDEventWorkspace_const_sptr dataws, const std::string &targetunit,
+    const API::IMDEventWorkspace_const_sptr &dataws,
+    const std::string &targetunit,
     const std::map<int, double> &map_runwavelength, double &xmin,
     double &xmax) {
   // Go through all instruments
@@ -425,12 +430,10 @@ void ConvertCWPDMDToSpectra::findXBoundary(
  * @param vecy
  * @param vec_excludedet
  */
-void ConvertCWPDMDToSpectra::binMD(API::IMDEventWorkspace_const_sptr mdws,
-                                   const char &unitbit,
-                                   const std::map<int, double> &map_runlambda,
-                                   const std::vector<double> &vecx,
-                                   std::vector<double> &vecy,
-                                   const std::vector<detid_t> &vec_excludedet) {
+void ConvertCWPDMDToSpectra::binMD(
+    const API::IMDEventWorkspace_const_sptr &mdws, const char &unitbit,
+    const std::map<int, double> &map_runlambda, const std::vector<double> &vecx,
+    std::vector<double> &vecy, const std::vector<detid_t> &vec_excludedet) {
   // Check whether MD workspace has proper instrument and experiment Info
   if (mdws->getNumExperimentInfo() == 0)
     throw std::runtime_error(
@@ -599,7 +602,7 @@ void ConvertCWPDMDToSpectra::binMD(API::IMDEventWorkspace_const_sptr mdws,
  * @param infinitesimal
  */
 void ConvertCWPDMDToSpectra::linearInterpolation(
-    API::MatrixWorkspace_sptr matrixws, const double &infinitesimal) {
+    const API::MatrixWorkspace_sptr &matrixws, const double &infinitesimal) {
   g_log.debug() << "Number of spectrum = " << matrixws->getNumberHistograms()
                 << " Infinitesimal = " << infinitesimal << "\n";
   size_t numspec = matrixws->getNumberHistograms();
@@ -670,8 +673,8 @@ void ConvertCWPDMDToSpectra::linearInterpolation(
  * @param inputmdws
  */
 void ConvertCWPDMDToSpectra::setupSampleLogs(
-    API::MatrixWorkspace_sptr matrixws,
-    API::IMDEventWorkspace_const_sptr inputmdws) {
+    const API::MatrixWorkspace_sptr &matrixws,
+    const API::IMDEventWorkspace_const_sptr &inputmdws) {
   // get hold of the last experiment info from md workspace to copy over
   auto lastindex = static_cast<uint16_t>(inputmdws->getNumExperimentInfo() - 1);
   ExperimentInfo_const_sptr lastexpinfo =
@@ -696,7 +699,7 @@ void ConvertCWPDMDToSpectra::setupSampleLogs(
  * @param infinitesimal
  */
 void ConvertCWPDMDToSpectra::scaleMatrixWorkspace(
-    API::MatrixWorkspace_sptr matrixws, const double &scalefactor,
+    const API::MatrixWorkspace_sptr &matrixws, const double &scalefactor,
     const double &infinitesimal) {
   size_t numspec = matrixws->getNumberHistograms();
   for (size_t iws = 0; iws < numspec; ++iws) {
diff --git a/Framework/MDAlgorithms/src/ConvertCWSDExpToMomentum.cpp b/Framework/MDAlgorithms/src/ConvertCWSDExpToMomentum.cpp
index 8bdb5af394e..88b8e36f26e 100644
--- a/Framework/MDAlgorithms/src/ConvertCWSDExpToMomentum.cpp
+++ b/Framework/MDAlgorithms/src/ConvertCWSDExpToMomentum.cpp
@@ -342,7 +342,8 @@ void ConvertCWSDExpToMomentum::addMDEvents(bool usevirtual) {
  * Q-sample
  */
 void ConvertCWSDExpToMomentum::setupTransferMatrix(
-    API::MatrixWorkspace_sptr dataws, Kernel::DblMatrix &rotationMatrix) {
+    const API::MatrixWorkspace_sptr &dataws,
+    Kernel::DblMatrix &rotationMatrix) {
   // Check sample logs
   if (!dataws->run().hasProperty("_omega") ||
       !dataws->run().hasProperty("_chi") || !dataws->run().hasProperty("_phi"))
@@ -384,9 +385,9 @@ void ConvertCWSDExpToMomentum::setupTransferMatrix(
  * workspace
  */
 void ConvertCWSDExpToMomentum::convertSpiceMatrixToMomentumMDEvents(
-    MatrixWorkspace_sptr dataws, bool usevirtual, const detid_t &startdetid,
-    const int scannumber, const int runnumber, double measuretime,
-    int monitor_counts) {
+    const MatrixWorkspace_sptr &dataws, bool usevirtual,
+    const detid_t &startdetid, const int scannumber, const int runnumber,
+    double measuretime, int monitor_counts) {
   // Create transformation matrix from which the transformation is
   Kernel::DblMatrix rotationMatrix;
   setupTransferMatrix(dataws, rotationMatrix);
@@ -696,7 +697,7 @@ void ConvertCWSDExpToMomentum::updateQRange(
  * @param dataws
  */
 void ConvertCWSDExpToMomentum::removeBackground(
-    API::MatrixWorkspace_sptr dataws) {
+    const API::MatrixWorkspace_sptr &dataws) {
   if (dataws->getNumberHistograms() != m_backgroundWS->getNumberHistograms())
     throw std::runtime_error("Impossible to have this situation");
 
diff --git a/Framework/MDAlgorithms/src/ConvertCWSDMDtoHKL.cpp b/Framework/MDAlgorithms/src/ConvertCWSDMDtoHKL.cpp
index 94a2166a39b..ee6693b9c76 100644
--- a/Framework/MDAlgorithms/src/ConvertCWSDMDtoHKL.cpp
+++ b/Framework/MDAlgorithms/src/ConvertCWSDMDtoHKL.cpp
@@ -169,7 +169,8 @@ void ConvertCWSDMDtoHKL::getUBMatrix() {
  * number of detectors
  */
 void ConvertCWSDMDtoHKL::exportEvents(
-    IMDEventWorkspace_sptr mdws, std::vector<Kernel::V3D> &vec_event_qsample,
+    const IMDEventWorkspace_sptr &mdws,
+    std::vector<Kernel::V3D> &vec_event_qsample,
     std::vector<signal_t> &vec_event_signal,
     std::vector<detid_t> &vec_event_det) {
   // Set the size of the output vectors
@@ -373,7 +374,7 @@ API::IMDEventWorkspace_sptr ConvertCWSDMDtoHKL::createHKLMDWorkspace(
   return mdws;
 }
 
-void ConvertCWSDMDtoHKL::getRange(const std::vector<Kernel::V3D> vec_hkl,
+void ConvertCWSDMDtoHKL::getRange(const std::vector<Kernel::V3D> &vec_hkl,
                                   std::vector<double> &extentMins,
                                   std::vector<double> &extentMaxs) {
   assert(extentMins.size() == 3);
diff --git a/Framework/MDAlgorithms/src/ConvertSpiceDataToRealSpace.cpp b/Framework/MDAlgorithms/src/ConvertSpiceDataToRealSpace.cpp
index e72e3f73326..0d55347e1e5 100644
--- a/Framework/MDAlgorithms/src/ConvertSpiceDataToRealSpace.cpp
+++ b/Framework/MDAlgorithms/src/ConvertSpiceDataToRealSpace.cpp
@@ -209,8 +209,9 @@ void ConvertSpiceDataToRealSpace::exec() {
  */
 std::vector<MatrixWorkspace_sptr>
 ConvertSpiceDataToRealSpace::convertToMatrixWorkspace(
-    DataObjects::TableWorkspace_sptr tablews,
-    API::MatrixWorkspace_const_sptr parentws, Types::Core::DateAndTime runstart,
+    const DataObjects::TableWorkspace_sptr &tablews,
+    const API::MatrixWorkspace_const_sptr &parentws,
+    Types::Core::DateAndTime runstart,
     std::map<std::string, std::vector<double>> &logvecmap,
     std::vector<Types::Core::DateAndTime> &vectimes) {
   // Get table workspace's column information
@@ -249,7 +250,7 @@ ConvertSpiceDataToRealSpace::convertToMatrixWorkspace(
  * @param logvecmap
  */
 void ConvertSpiceDataToRealSpace::parseSampleLogs(
-    DataObjects::TableWorkspace_sptr tablews,
+    const DataObjects::TableWorkspace_sptr &tablews,
     const std::map<std::string, size_t> &indexlist,
     std::map<std::string, std::vector<double>> &logvecmap) {
   size_t numrows = tablews->rowCount();
@@ -287,10 +288,11 @@ void ConvertSpiceDataToRealSpace::parseSampleLogs(
  * @return
  */
 MatrixWorkspace_sptr ConvertSpiceDataToRealSpace::loadRunToMatrixWS(
-    DataObjects::TableWorkspace_sptr tablews, size_t irow,
-    MatrixWorkspace_const_sptr parentws, Types::Core::DateAndTime runstart,
-    size_t ipt, size_t irotangle, size_t itime,
-    const std::vector<std::pair<size_t, size_t>> anodelist, double &duration) {
+    const DataObjects::TableWorkspace_sptr &tablews, size_t irow,
+    const MatrixWorkspace_const_sptr &parentws,
+    Types::Core::DateAndTime runstart, size_t ipt, size_t irotangle,
+    size_t itime, const std::vector<std::pair<size_t, size_t>> &anodelist,
+    double &duration) {
   // New workspace from parent workspace
   MatrixWorkspace_sptr tempws =
       WorkspaceFactory::Instance().create(parentws, m_numSpec, 2, 1);
@@ -367,7 +369,7 @@ MatrixWorkspace_sptr ConvertSpiceDataToRealSpace::loadRunToMatrixWS(
  * @param samplenameindexmap
  */
 void ConvertSpiceDataToRealSpace::readTableInfo(
-    TableWorkspace_const_sptr tablews, size_t &ipt, size_t &irotangle,
+    const TableWorkspace_const_sptr &tablews, size_t &ipt, size_t &irotangle,
     size_t &itime, std::vector<std::pair<size_t, size_t>> &anodelist,
     std::map<std::string, size_t> &samplenameindexmap) {
 
@@ -439,7 +441,7 @@ void ConvertSpiceDataToRealSpace::readTableInfo(
  * @param vectimes
  */
 void ConvertSpiceDataToRealSpace::appendSampleLogs(
-    IMDEventWorkspace_sptr mdws,
+    const IMDEventWorkspace_sptr &mdws,
     const std::map<std::string, std::vector<double>> &logvecmap,
     const std::vector<Types::Core::DateAndTime> &vectimes) {
   // Check!
@@ -524,8 +526,8 @@ void ConvertSpiceDataToRealSpace::appendSampleLogs(
  * @param vec_ws2d
  */
 void ConvertSpiceDataToRealSpace::addExperimentInfos(
-    API::IMDEventWorkspace_sptr mdws,
-    const std::vector<API::MatrixWorkspace_sptr> vec_ws2d) {
+    const API::IMDEventWorkspace_sptr &mdws,
+    const std::vector<API::MatrixWorkspace_sptr> &vec_ws2d) {
   // Add N experiment info as there are N measurment points
   for (const auto &ws2d : vec_ws2d) {
     // Create an ExperimentInfo object
@@ -633,7 +635,7 @@ IMDEventWorkspace_sptr ConvertSpiceDataToRealSpace::createDataMDWorkspace(
  * @return
  */
 IMDEventWorkspace_sptr ConvertSpiceDataToRealSpace::createMonitorMDWorkspace(
-    const std::vector<MatrixWorkspace_sptr> vec_ws2d,
+    const std::vector<MatrixWorkspace_sptr> &vec_ws2d,
     const std::vector<double> &vecmonitor) {
   // Create a target output workspace.
   IMDEventWorkspace_sptr outWs =
@@ -710,7 +712,7 @@ IMDEventWorkspace_sptr ConvertSpiceDataToRealSpace::createMonitorMDWorkspace(
  */
 std::map<detid_t, double>
 ConvertSpiceDataToRealSpace::parseDetectorEfficiencyTable(
-    DataObjects::TableWorkspace_sptr detefftablews) {
+    const DataObjects::TableWorkspace_sptr &detefftablews) {
   std::map<detid_t, double> deteffmap;
 
   // check table workspace
diff --git a/Framework/MDAlgorithms/src/ConvertToMD.cpp b/Framework/MDAlgorithms/src/ConvertToMD.cpp
index 630390295c8..9c0530b042e 100644
--- a/Framework/MDAlgorithms/src/ConvertToMD.cpp
+++ b/Framework/MDAlgorithms/src/ConvertToMD.cpp
@@ -445,7 +445,7 @@ is ignored in any other case
 together and used to describe selected transformation.
 */
 bool ConvertToMD::buildTargetWSDescription(
-    API::IMDEventWorkspace_sptr spws, const std::string &QModReq,
+    const API::IMDEventWorkspace_sptr &spws, const std::string &QModReq,
     const std::string &dEModReq, const std::vector<std::string> &otherDimNames,
     std::vector<double> &dimMin, std::vector<double> &dimMax,
     const std::string &QFrame, const std::string &convertTo_,
@@ -604,7 +604,8 @@ ConvertToMD::createNewMDWorkspace(const MDWSDescription &targWSDescr,
  * the first level.
  * @param bc A pointer to the box controller.
  */
-void ConvertToMD::setupTopLevelSplitting(Mantid::API::BoxController_sptr bc) {
+void ConvertToMD::setupTopLevelSplitting(
+    const Mantid::API::BoxController_sptr &bc) {
   const size_t topLevelSplitSetting = 50;
   const size_t dimCutoff = 4;
 
@@ -625,7 +626,8 @@ void ConvertToMD::setupTopLevelSplitting(Mantid::API::BoxController_sptr bc) {
  *
  *@returns true if one needs to create new workspace and false otherwise
  */
-bool ConvertToMD::doWeNeedNewTargetWorkspace(API::IMDEventWorkspace_sptr spws) {
+bool ConvertToMD::doWeNeedNewTargetWorkspace(
+    const API::IMDEventWorkspace_sptr &spws) {
 
   bool createNewWs(false);
   if (!spws) {
@@ -762,7 +764,8 @@ void ConvertToMD::findMinMax(
  * @param outputWS :: Workspace on which to set the file back end
  */
 void ConvertToMD::setupFileBackend(
-    std::string filebackPath, Mantid::API::IMDEventWorkspace_sptr outputWS) {
+    const std::string &filebackPath,
+    const Mantid::API::IMDEventWorkspace_sptr &outputWS) {
   using DataObjects::BoxControllerNeXusIO;
   auto savemd = this->createChildAlgorithm("SaveMD", 0.01, 0.05, true);
   savemd->setProperty("InputWorkspace", outputWS);
diff --git a/Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp b/Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp
index a1227491a92..55655141263 100644
--- a/Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp
+++ b/Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp
@@ -75,7 +75,8 @@ Check that the input workspace is of the correct type.
 @throw: runtime_error if the units do not appear to be correct/compatible with
 the algorithm.
 */
-void checkInputWorkspace(Mantid::API::MatrixWorkspace_const_sptr inputWs) {
+void checkInputWorkspace(
+    const Mantid::API::MatrixWorkspace_const_sptr &inputWs) {
   auto spectraAxis = inputWs->getAxis(1);
   const std::string label = spectraAxis->unit()->label();
   const std::string expectedLabel = "degrees";
@@ -148,7 +149,7 @@ Get the value of theta from the logs
 @return : theta found in the logs
 @throw: runtime_errror if 'stheta' was not found.
 */
-double getThetaFromLogs(MatrixWorkspace_sptr inputWs) {
+double getThetaFromLogs(const MatrixWorkspace_sptr &inputWs) {
 
   double theta = -1.;
   const Mantid::API::Run &run = inputWs->run();
diff --git a/Framework/MDAlgorithms/src/CreateMD.cpp b/Framework/MDAlgorithms/src/CreateMD.cpp
index b4eafe793cd..ff6410e5655 100644
--- a/Framework/MDAlgorithms/src/CreateMD.cpp
+++ b/Framework/MDAlgorithms/src/CreateMD.cpp
@@ -15,6 +15,8 @@
 #include "MantidKernel/MandatoryValidator.h"
 #include <Poco/Path.h>
 
+#include <utility>
+
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
 using namespace Mantid::DataObjects;
@@ -308,7 +310,7 @@ Mantid::API::Workspace_sptr CreateMD::loadWs(const std::string &filename,
  * @param log_name :: the name of the log
  * @param log_number :: the value to record in the log
  */
-void CreateMD::addSampleLog(Mantid::API::MatrixWorkspace_sptr workspace,
+void CreateMD::addSampleLog(const Mantid::API::MatrixWorkspace_sptr &workspace,
                             const std::string &log_name, double log_number) {
   Algorithm_sptr log_alg = createChildAlgorithm("AddSampleLog");
 
@@ -327,7 +329,8 @@ void CreateMD::addSampleLog(Mantid::API::MatrixWorkspace_sptr workspace,
  *
  * @param workspace :: the workspace to set the goniometer values in
  */
-void CreateMD::setGoniometer(Mantid::API::MatrixWorkspace_sptr workspace) {
+void CreateMD::setGoniometer(
+    const Mantid::API::MatrixWorkspace_sptr &workspace) {
   Algorithm_sptr log_alg = createChildAlgorithm("SetGoniometer");
   if (!workspace->run().getProperty("gl")) {
     std::ostringstream temp_ss;
@@ -356,8 +359,8 @@ void CreateMD::setGoniometer(Mantid::API::MatrixWorkspace_sptr workspace) {
  * @param u :: lattice vector parallel to incident neutron beam
  * @param v :: lattice vector perpendicular to u in the horizontal plane
  */
-void CreateMD::setUB(Mantid::API::MatrixWorkspace_sptr workspace, double a,
-                     double b, double c, double alpha, double beta,
+void CreateMD::setUB(const Mantid::API::MatrixWorkspace_sptr &workspace,
+                     double a, double b, double c, double alpha, double beta,
                      double gamma, const std::vector<double> &u,
                      const std::vector<double> &v) {
   Algorithm_sptr set_ub_alg = createChildAlgorithm("SetUB");
@@ -383,10 +386,12 @@ void CreateMD::setUB(Mantid::API::MatrixWorkspace_sptr workspace, double a,
  * @out_mdws :: output workspace to use if merge step is carried out
  * @returns the output converted workspace
  */
-Mantid::API::IMDEventWorkspace_sptr CreateMD::convertToMD(
-    Mantid::API::Workspace_sptr workspace, const std::string &analysis_mode,
-    bool in_place, const std::string &filebackend_filename,
-    const bool filebackend, Mantid::API::IMDEventWorkspace_sptr out_mdws) {
+Mantid::API::IMDEventWorkspace_sptr
+CreateMD::convertToMD(const Mantid::API::Workspace_sptr &workspace,
+                      const std::string &analysis_mode, bool in_place,
+                      const std::string &filebackend_filename,
+                      const bool filebackend,
+                      const Mantid::API::IMDEventWorkspace_sptr &out_mdws) {
   Algorithm_sptr min_max_alg = createChildAlgorithm("ConvertToMDMinMaxGlobal");
   min_max_alg->setProperty("InputWorkspace", workspace);
   min_max_alg->setProperty("QDimensions", "Q3D");
@@ -462,12 +467,13 @@ CreateMD::merge_runs(const std::vector<std::string> &to_merge) {
  * @param out_mdws :output workspace to use if merge step is carried out
  */
 Mantid::API::IMDEventWorkspace_sptr CreateMD::single_run(
-    Mantid::API::MatrixWorkspace_sptr input_workspace, const std::string &emode,
-    double efix, double psi, double gl, double gs, bool in_place,
-    const std::vector<double> &alatt, const std::vector<double> &angdeg,
-    const std::vector<double> &u, const std::vector<double> &v,
-    const std::string &filebackend_filename, const bool filebackend,
-    Mantid::API::IMDEventWorkspace_sptr out_mdws) {
+    const Mantid::API::MatrixWorkspace_sptr &input_workspace,
+    const std::string &emode, double efix, double psi, double gl, double gs,
+    bool in_place, const std::vector<double> &alatt,
+    const std::vector<double> &angdeg, const std::vector<double> &u,
+    const std::vector<double> &v, const std::string &filebackend_filename,
+    const bool filebackend,
+    const Mantid::API::IMDEventWorkspace_sptr &out_mdws) {
 
   std::vector<std::vector<double>> ub_params{alatt, angdeg, u, v};
 
@@ -493,7 +499,7 @@ Mantid::API::IMDEventWorkspace_sptr CreateMD::single_run(
     setGoniometer(input_workspace);
 
     return convertToMD(input_workspace, emode, in_place, filebackend_filename,
-                       filebackend, out_mdws);
+                       filebackend, std::move(out_mdws));
   }
 }
 
diff --git a/Framework/MDAlgorithms/src/CreateMDWorkspace.cpp b/Framework/MDAlgorithms/src/CreateMDWorkspace.cpp
index 9c3883ba245..bbaaa2c2a42 100644
--- a/Framework/MDAlgorithms/src/CreateMDWorkspace.cpp
+++ b/Framework/MDAlgorithms/src/CreateMDWorkspace.cpp
@@ -243,8 +243,8 @@ void CreateMDWorkspace::exec() {
   setProperty("OutputWorkspace", boost::dynamic_pointer_cast<Workspace>(out));
 }
 
-MDFrame_uptr CreateMDWorkspace::createMDFrame(std::string frame,
-                                              std::string unit) {
+MDFrame_uptr CreateMDWorkspace::createMDFrame(const std::string &frame,
+                                              const std::string &unit) {
   auto frameFactory = makeMDFrameFactoryChain();
   MDFrameArgument frameArg(frame, unit);
   return frameFactory->create(frameArg);
diff --git a/Framework/MDAlgorithms/src/CutMD.cpp b/Framework/MDAlgorithms/src/CutMD.cpp
index 07d65b3d8e4..0e0c56601b7 100644
--- a/Framework/MDAlgorithms/src/CutMD.cpp
+++ b/Framework/MDAlgorithms/src/CutMD.cpp
@@ -31,7 +31,7 @@ namespace {
 // Typedef to simplify function signatures
 using MinMax = std::pair<double, double>;
 
-MinMax getDimensionExtents(IMDEventWorkspace_sptr ws, size_t index) {
+MinMax getDimensionExtents(const IMDEventWorkspace_sptr &ws, size_t index) {
   if (!ws)
     throw std::runtime_error(
         "Invalid workspace passed to getDimensionExtents.");
@@ -50,7 +50,7 @@ std::string numToStringWithPrecision(const double num) {
 DblMatrix scaleProjection(const DblMatrix &inMatrix,
                           const std::vector<std::string> &inUnits,
                           std::vector<std::string> &outUnits,
-                          IMDEventWorkspace_sptr inWS) {
+                          const IMDEventWorkspace_sptr &inWS) {
   DblMatrix ret(inMatrix);
   // Check if we actually need to do anything
   if (std::equal(inUnits.begin(), inUnits.end(), outUnits.begin()))
@@ -209,7 +209,7 @@ Determine the original q units. Assumes first 3 dimensions by index are r,l,d
 @param logger : logging object
 @return vector of markers
 */
-std::vector<std::string> findOriginalQUnits(IMDWorkspace_const_sptr inws,
+std::vector<std::string> findOriginalQUnits(const IMDWorkspace_const_sptr &inws,
                                             Mantid::Kernel::Logger &logger) {
   std::vector<std::string> unitMarkers(3);
   for (size_t i = 0; i < inws->getNumDims() && i < 3; ++i) {
diff --git a/Framework/MDAlgorithms/src/DisplayNormalizationSetter.cpp b/Framework/MDAlgorithms/src/DisplayNormalizationSetter.cpp
index 6572ab64d00..1d89a09fbf4 100644
--- a/Framework/MDAlgorithms/src/DisplayNormalizationSetter.cpp
+++ b/Framework/MDAlgorithms/src/DisplayNormalizationSetter.cpp
@@ -4,10 +4,12 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidMDAlgorithms/DisplayNormalizationSetter.h"
+#include <utility>
+
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidDataObjects/EventWorkspace.h"
+#include "MantidMDAlgorithms/DisplayNormalizationSetter.h"
 
 namespace Mantid {
 namespace MDAlgorithms {
@@ -21,7 +23,7 @@ namespace MDAlgorithms {
  * @param mode: the energy transfer mode
  */
 void DisplayNormalizationSetter::
-operator()(Mantid::API::IMDWorkspace_sptr mdWorkspace,
+operator()(const Mantid::API::IMDWorkspace_sptr &mdWorkspace,
            const Mantid::API::MatrixWorkspace_sptr &underlyingWorkspace,
            bool isQ, const Mantid::Kernel::DeltaEMode::Type &mode) {
   if (boost::dynamic_pointer_cast<Mantid::API::IMDEventWorkspace>(
@@ -42,7 +44,7 @@ operator()(Mantid::API::IMDWorkspace_sptr mdWorkspace,
  * @param mode: the energy transfer mode
  */
 void DisplayNormalizationSetter::setNormalizationMDEvent(
-    Mantid::API::IMDWorkspace_sptr mdWorkspace,
+    const Mantid::API::IMDWorkspace_sptr &mdWorkspace,
     const Mantid::API::MatrixWorkspace_sptr &underlyingWorkspace, bool isQ,
     const Mantid::Kernel::DeltaEMode::Type &mode) {
 
@@ -73,7 +75,7 @@ void DisplayNormalizationSetter::setNormalizationMDEvent(
         Mantid::API::MDNormalization::NumEventsNormalization;
   }
 
-  applyNormalizationMDEvent(mdWorkspace, displayNormalization,
+  applyNormalizationMDEvent(std::move(mdWorkspace), displayNormalization,
                             displayNormalizationHisto);
 }
 
@@ -86,7 +88,7 @@ void DisplayNormalizationSetter::setNormalizationMDEvent(
  * MDHisto workspaces
  */
 void DisplayNormalizationSetter::applyNormalizationMDEvent(
-    Mantid::API::IMDWorkspace_sptr mdWorkspace,
+    const Mantid::API::IMDWorkspace_sptr &mdWorkspace,
     Mantid::API::MDNormalization displayNormalization,
     Mantid::API::MDNormalization displayNormalizationHisto) {
   auto ws =
diff --git a/Framework/MDAlgorithms/src/FindPeaksMD.cpp b/Framework/MDAlgorithms/src/FindPeaksMD.cpp
index 10a1aab1631..eb8992ca9d5 100644
--- a/Framework/MDAlgorithms/src/FindPeaksMD.cpp
+++ b/Framework/MDAlgorithms/src/FindPeaksMD.cpp
@@ -586,7 +586,7 @@ void FindPeaksMD::findPeaks(typename MDEventWorkspace<MDE, nd>::sptr ws) {
  * @param ws :: MDHistoWorkspace
  */
 void FindPeaksMD::findPeaksHisto(
-    Mantid::DataObjects::MDHistoWorkspace_sptr ws) {
+    const Mantid::DataObjects::MDHistoWorkspace_sptr &ws) {
   size_t nd = ws->getNumDims();
   if (nd < 3)
     throw std::invalid_argument("Workspace must have at least 3 dimensions.");
diff --git a/Framework/MDAlgorithms/src/FitMD.cpp b/Framework/MDAlgorithms/src/FitMD.cpp
index a0b92864cb4..fe289f2f494 100644
--- a/Framework/MDAlgorithms/src/FitMD.cpp
+++ b/Framework/MDAlgorithms/src/FitMD.cpp
@@ -269,8 +269,8 @@ boost::shared_ptr<API::Workspace> FitMD::createEventOutputWorkspace(
  * @param outputWorkspacePropertyName :: The property name
  */
 boost::shared_ptr<API::Workspace> FitMD::createHistoOutputWorkspace(
-    const std::string &baseName, API::IFunction_sptr function,
-    API::IMDHistoWorkspace_const_sptr inputWorkspace,
+    const std::string &baseName, const API::IFunction_sptr &function,
+    const API::IMDHistoWorkspace_const_sptr &inputWorkspace,
     const std::string &outputWorkspacePropertyName) {
   // have to cast const away to be able to pass the workspace to the algorithm
   API::IMDHistoWorkspace_sptr nonConstInputWS =
diff --git a/Framework/MDAlgorithms/src/GetSpiceDataRawCountsFromMD.cpp b/Framework/MDAlgorithms/src/GetSpiceDataRawCountsFromMD.cpp
index 9aefe3c58f3..b82ab214b1b 100644
--- a/Framework/MDAlgorithms/src/GetSpiceDataRawCountsFromMD.cpp
+++ b/Framework/MDAlgorithms/src/GetSpiceDataRawCountsFromMD.cpp
@@ -17,6 +17,7 @@
 #include "MantidKernel/ListValidator.h"
 
 #include <algorithm>
+#include <utility>
 
 namespace Mantid {
 namespace MDAlgorithms {
@@ -147,15 +148,16 @@ void GetSpiceDataRawCountsFromMD::exec() {
  * @param donormalize
  */
 void GetSpiceDataRawCountsFromMD::exportDetCountsOfRun(
-    API::IMDEventWorkspace_const_sptr datamdws,
-    API::IMDEventWorkspace_const_sptr monitormdws, const int runnumber,
+    const API::IMDEventWorkspace_const_sptr &datamdws,
+    const API::IMDEventWorkspace_const_sptr &monitormdws, const int runnumber,
     std::vector<double> &vecX, std::vector<double> &vecY, std::string &xlabel,
     std::string &ylabel, bool donormalize) {
   // Get detector counts
   std::vector<double> vec2theta;
   std::vector<double> vecDetCounts;
   int detid = -1;
-  getDetCounts(datamdws, runnumber, detid, vec2theta, vecDetCounts, true);
+  getDetCounts(std::move(datamdws), runnumber, detid, vec2theta, vecDetCounts,
+               true);
   if (vec2theta.size() != vecDetCounts.size())
     throw std::runtime_error(
         "Logic error! Vector of 2theta must have same size as "
@@ -166,8 +168,8 @@ void GetSpiceDataRawCountsFromMD::exportDetCountsOfRun(
   std::vector<double> vecMonitorCounts;
   // Normalize if required
   if (donormalize) {
-    getDetCounts(monitormdws, runnumber, detid, vec2thetaMon, vecMonitorCounts,
-                 false);
+    getDetCounts(std::move(monitormdws), runnumber, detid, vec2thetaMon,
+                 vecMonitorCounts, false);
     // check
     if (vecDetCounts.size() != vecMonitorCounts.size())
       throw std::runtime_error(
@@ -218,8 +220,8 @@ void GetSpiceDataRawCountsFromMD::exportDetCountsOfRun(
  * @param donormalize
  */
 void GetSpiceDataRawCountsFromMD::exportIndividualDetCounts(
-    API::IMDEventWorkspace_const_sptr datamdws,
-    API::IMDEventWorkspace_const_sptr monitormdws, const int detid,
+    const API::IMDEventWorkspace_const_sptr &datamdws,
+    const API::IMDEventWorkspace_const_sptr &monitormdws, const int detid,
     std::vector<double> &vecX, std::vector<double> &vecY, std::string &xlabel,
     std::string &ylabel, const bool &donormalize) {
   // Get detector counts
@@ -246,8 +248,8 @@ void GetSpiceDataRawCountsFromMD::exportIndividualDetCounts(
   // FIXME - Consider refactoring in future
   // Normalize if required
   if (donormalize) {
-    getDetCounts(monitormdws, runnumber, detid, vec2thetaMon, vecMonitorCounts,
-                 false);
+    getDetCounts(std::move(monitormdws), runnumber, detid, vec2thetaMon,
+                 vecMonitorCounts, false);
     if (vecDetCounts.size() != vecMonitorCounts.size())
       throw std::runtime_error(
           "Number of detectors' counts' is different from that of "
@@ -296,7 +298,7 @@ void GetSpiceDataRawCountsFromMD::exportIndividualDetCounts(
  * @param ylabel
  */
 void GetSpiceDataRawCountsFromMD::exportSampleLogValue(
-    API::IMDEventWorkspace_const_sptr datamdws,
+    const API::IMDEventWorkspace_const_sptr &datamdws,
     const std::string &samplelogname, std::vector<double> &vecX,
     std::vector<double> &vecY, std::string &xlabel, std::string &ylabel) {
   // prepare
@@ -349,7 +351,7 @@ void GetSpiceDataRawCountsFromMD::exportSampleLogValue(
  * @param formX :: flag to set up vecX
  */
 void GetSpiceDataRawCountsFromMD::getDetCounts(
-    API::IMDEventWorkspace_const_sptr mdws, const int &runnumber,
+    const API::IMDEventWorkspace_const_sptr &mdws, const int &runnumber,
     const int &detid, std::vector<double> &vecX, std::vector<double> &vecY,
     bool formX) {
   // Get sample and source position
@@ -441,7 +443,7 @@ void GetSpiceDataRawCountsFromMD::getDetCounts(
  * @param vecSampleLog
  */
 void GetSpiceDataRawCountsFromMD::getSampleLogValues(
-    IMDEventWorkspace_const_sptr mdws, const std::string &samplelogname,
+    const IMDEventWorkspace_const_sptr &mdws, const std::string &samplelogname,
     const int runnumber, std::vector<double> &vecSampleLog) {
   // Clear input
   vecSampleLog.clear();
diff --git a/Framework/MDAlgorithms/src/ImportMDHistoWorkspaceBase.cpp b/Framework/MDAlgorithms/src/ImportMDHistoWorkspaceBase.cpp
index fe71eb9bc19..53ae75ebfbb 100644
--- a/Framework/MDAlgorithms/src/ImportMDHistoWorkspaceBase.cpp
+++ b/Framework/MDAlgorithms/src/ImportMDHistoWorkspaceBase.cpp
@@ -145,8 +145,9 @@ MDHistoWorkspace_sptr ImportMDHistoWorkspaceBase::createEmptyOutputWorkspace() {
  * @param unit: the selected unit
  * @returns a unique pointer to an MDFrame
  */
-MDFrame_uptr ImportMDHistoWorkspaceBase::createMDFrame(std::string frame,
-                                                       std::string unit) {
+MDFrame_uptr
+ImportMDHistoWorkspaceBase::createMDFrame(const std::string &frame,
+                                          const std::string &unit) {
   auto frameFactory = makeMDFrameFactoryChain();
   MDFrameArgument frameArg(frame, unit);
   return frameFactory->create(frameArg);
diff --git a/Framework/MDAlgorithms/src/Integrate3DEvents.cpp b/Framework/MDAlgorithms/src/Integrate3DEvents.cpp
index 798c7c90763..b7fa3fe54a4 100644
--- a/Framework/MDAlgorithms/src/Integrate3DEvents.cpp
+++ b/Framework/MDAlgorithms/src/Integrate3DEvents.cpp
@@ -18,6 +18,8 @@
 
 extern "C" {
 #include <cstdio>
+#include <utility>
+
 #include <gsl/gsl_eigen.h>
 #include <gsl/gsl_matrix.h>
 #include <gsl/gsl_vector.h>
@@ -447,7 +449,7 @@ bool Integrate3DEvents::correctForDetectorEdges(
  */
 Mantid::Geometry::PeakShape_const_sptr
 Integrate3DEvents::ellipseIntegrateEvents(
-    std::vector<V3D> E1Vec, V3D const &peak_q, bool specify_size,
+    const std::vector<V3D> &E1Vec, V3D const &peak_q, bool specify_size,
     double peak_radius, double back_inner_radius, double back_outer_radius,
     std::vector<double> &axes_radii, double &inti, double &sigi) {
   inti = 0.0; // default values, in case something
@@ -494,18 +496,18 @@ Integrate3DEvents::ellipseIntegrateEvents(
     return boost::make_shared<NoShape>(); // ellipsoids will be zero.
   }
 
-  return ellipseIntegrateEvents(E1Vec, peak_q, some_events, eigen_vectors,
-                                sigmas, specify_size, peak_radius,
-                                back_inner_radius, back_outer_radius,
-                                axes_radii, inti, sigi);
+  return ellipseIntegrateEvents(std::move(E1Vec), peak_q, some_events,
+                                eigen_vectors, sigmas, specify_size,
+                                peak_radius, back_inner_radius,
+                                back_outer_radius, axes_radii, inti, sigi);
 }
 
 Mantid::Geometry::PeakShape_const_sptr
 Integrate3DEvents::ellipseIntegrateModEvents(
-    std::vector<V3D> E1Vec, V3D const &peak_q, V3D const &hkl, V3D const &mnp,
-    bool specify_size, double peak_radius, double back_inner_radius,
-    double back_outer_radius, std::vector<double> &axes_radii, double &inti,
-    double &sigi) {
+    const std::vector<V3D> &E1Vec, V3D const &peak_q, V3D const &hkl,
+    V3D const &mnp, bool specify_size, double peak_radius,
+    double back_inner_radius, double back_outer_radius,
+    std::vector<double> &axes_radii, double &inti, double &sigi) {
   inti = 0.0; // default values, in case something
   sigi = 0.0; // is wrong with the peak.
 
@@ -555,10 +557,10 @@ Integrate3DEvents::ellipseIntegrateModEvents(
     return boost::make_shared<NoShape>(); // ellipsoids will be zero.
   }
 
-  return ellipseIntegrateEvents(E1Vec, peak_q, some_events, eigen_vectors,
-                                sigmas, specify_size, peak_radius,
-                                back_inner_radius, back_outer_radius,
-                                axes_radii, inti, sigi);
+  return ellipseIntegrateEvents(std::move(E1Vec), peak_q, some_events,
+                                eigen_vectors, sigmas, specify_size,
+                                peak_radius, back_inner_radius,
+                                back_outer_radius, axes_radii, inti, sigi);
 }
 /**
  * Calculate the number of events in an ellipsoid centered at 0,0,0 with
@@ -1107,7 +1109,7 @@ void Integrate3DEvents::addModEvent(
  *
  */
 PeakShapeEllipsoid_const_sptr Integrate3DEvents::ellipseIntegrateEvents(
-    std::vector<V3D> E1Vec, V3D const &peak_q,
+    const std::vector<V3D> &E1Vec, V3D const &peak_q,
     std::vector<std::pair<std::pair<double, double>, Mantid::Kernel::V3D>> const
         &ev_list,
     std::vector<V3D> const &directions, std::vector<double> const &sigmas,
@@ -1212,7 +1214,8 @@ PeakShapeEllipsoid_const_sptr Integrate3DEvents::ellipseIntegrateEvents(
  * @param QLabFrame: The Peak center.
  * @param r: Peak radius.
  */
-double Integrate3DEvents::detectorQ(std::vector<V3D> E1Vec, const V3D QLabFrame,
+double Integrate3DEvents::detectorQ(const std::vector<V3D> &E1Vec,
+                                    const V3D QLabFrame,
                                     const std::vector<double> &r) {
   double quot = 1.0;
   for (auto &E1 : E1Vec) {
diff --git a/Framework/MDAlgorithms/src/IntegrateEllipsoids.cpp b/Framework/MDAlgorithms/src/IntegrateEllipsoids.cpp
index ce914be9ceb..e11aaaad9fe 100644
--- a/Framework/MDAlgorithms/src/IntegrateEllipsoids.cpp
+++ b/Framework/MDAlgorithms/src/IntegrateEllipsoids.cpp
@@ -746,8 +746,8 @@ void IntegrateEllipsoids::calculateE1(
 }
 
 void IntegrateEllipsoids::runMaskDetectors(
-    Mantid::DataObjects::PeaksWorkspace_sptr peakWS, std::string property,
-    std::string values) {
+    const Mantid::DataObjects::PeaksWorkspace_sptr &peakWS,
+    const std::string &property, const std::string &values) {
   IAlgorithm_sptr alg = createChildAlgorithm("MaskBTP");
   alg->setProperty<Workspace_sptr>("Workspace", peakWS);
   alg->setProperty(property, values);
diff --git a/Framework/MDAlgorithms/src/IntegrateEllipsoidsTwoStep.cpp b/Framework/MDAlgorithms/src/IntegrateEllipsoidsTwoStep.cpp
index 78ea2ccc95e..0d5a049faa3 100644
--- a/Framework/MDAlgorithms/src/IntegrateEllipsoidsTwoStep.cpp
+++ b/Framework/MDAlgorithms/src/IntegrateEllipsoidsTwoStep.cpp
@@ -559,8 +559,8 @@ void IntegrateEllipsoidsTwoStep::calculateE1(
 }
 
 void IntegrateEllipsoidsTwoStep::runMaskDetectors(
-    Mantid::DataObjects::PeaksWorkspace_sptr peakWS, std::string property,
-    std::string values) {
+    const Mantid::DataObjects::PeaksWorkspace_sptr &peakWS,
+    const std::string &property, const std::string &values) {
   IAlgorithm_sptr alg = createChildAlgorithm("MaskBTP");
   alg->setProperty<Workspace_sptr>("Workspace", peakWS);
   alg->setProperty(property, values);
diff --git a/Framework/MDAlgorithms/src/IntegratePeaksCWSD.cpp b/Framework/MDAlgorithms/src/IntegratePeaksCWSD.cpp
index 066aa52318b..df0ce5a5a94 100644
--- a/Framework/MDAlgorithms/src/IntegratePeaksCWSD.cpp
+++ b/Framework/MDAlgorithms/src/IntegratePeaksCWSD.cpp
@@ -368,7 +368,7 @@ void IntegratePeaksCWSD::simplePeakIntegration(
  * @param maskws
  */
 std::vector<detid_t> IntegratePeaksCWSD::processMaskWorkspace(
-    DataObjects::MaskWorkspace_const_sptr maskws) {
+    const DataObjects::MaskWorkspace_const_sptr &maskws) {
   std::vector<detid_t> vecMaskedDetID;
 
   // Add the detector IDs of all masked detector to a vector
@@ -452,9 +452,8 @@ DataObjects::PeaksWorkspace_sptr IntegratePeaksCWSD::createOutputs() {
  * @param mdws :: source MDEventWorkspace where the run numbers come from
  * @return
  */
-DataObjects::PeaksWorkspace_sptr
-IntegratePeaksCWSD::createPeakworkspace(Kernel::V3D peakCenter,
-                                        API::IMDEventWorkspace_sptr mdws) {
+DataObjects::PeaksWorkspace_sptr IntegratePeaksCWSD::createPeakworkspace(
+    Kernel::V3D peakCenter, const API::IMDEventWorkspace_sptr &mdws) {
   g_log.notice("Create peak workspace for output ... ...");
   // new peak workspace
   DataObjects::PeaksWorkspace_sptr peakws =
diff --git a/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp b/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp
index 246604a2e3d..5f856905e9d 100644
--- a/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp
+++ b/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp
@@ -721,8 +721,8 @@ double IntegratePeaksMD2::detectorQ(Mantid::Kernel::V3D QLabFrame, double r) {
 }
 
 void IntegratePeaksMD2::runMaskDetectors(
-    Mantid::DataObjects::PeaksWorkspace_sptr peakWS, std::string property,
-    std::string values) {
+    const Mantid::DataObjects::PeaksWorkspace_sptr &peakWS,
+    const std::string &property, const std::string &values) {
   // For CORELLI do not count as edge if next to another detector bank
   if (property == "Tube" && peakWS->getInstrument()->getName() == "CORELLI") {
     IAlgorithm_sptr alg = createChildAlgorithm("MaskBTP");
@@ -750,7 +750,7 @@ void IntegratePeaksMD2::runMaskDetectors(
 }
 
 void IntegratePeaksMD2::checkOverlap(
-    int i, Mantid::DataObjects::PeaksWorkspace_sptr peakWS,
+    int i, const Mantid::DataObjects::PeaksWorkspace_sptr &peakWS,
     Mantid::Kernel::SpecialCoordinateSystem CoordinatesToUse, double radius) {
   // Get a direct ref to that peak.
   IPeak &p1 = peakWS->getPeak(i);
diff --git a/Framework/MDAlgorithms/src/IntegratePeaksMDHKL.cpp b/Framework/MDAlgorithms/src/IntegratePeaksMDHKL.cpp
index a20ee522922..777e53bc68c 100644
--- a/Framework/MDAlgorithms/src/IntegratePeaksMDHKL.cpp
+++ b/Framework/MDAlgorithms/src/IntegratePeaksMDHKL.cpp
@@ -195,7 +195,7 @@ IntegratePeaksMDHKL::normalize(int h, int k, int l, double box, int gridPts,
 }
 
 void IntegratePeaksMDHKL::integratePeak(const int neighborPts,
-                                        MDHistoWorkspace_sptr out,
+                                        const MDHistoWorkspace_sptr &out,
                                         double &intensity,
                                         double &errorSquared) {
   std::vector<int> gridPts;
diff --git a/Framework/MDAlgorithms/src/InvalidParameter.cpp b/Framework/MDAlgorithms/src/InvalidParameter.cpp
index 2d0bba40cef..3865fbed263 100644
--- a/Framework/MDAlgorithms/src/InvalidParameter.cpp
+++ b/Framework/MDAlgorithms/src/InvalidParameter.cpp
@@ -4,13 +4,16 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidMDAlgorithms/InvalidParameter.h"
 
 namespace Mantid {
 namespace MDAlgorithms {
 InvalidParameter::InvalidParameter() {}
 
-InvalidParameter::InvalidParameter(std::string value) : m_value(value) {}
+InvalidParameter::InvalidParameter(std::string value)
+    : m_value(std::move(value)) {}
 
 std::string InvalidParameter::getName() const { return parameterName(); }
 
diff --git a/Framework/MDAlgorithms/src/InvalidParameterParser.cpp b/Framework/MDAlgorithms/src/InvalidParameterParser.cpp
index 56ff18f988c..f27ec3ef84c 100644
--- a/Framework/MDAlgorithms/src/InvalidParameterParser.cpp
+++ b/Framework/MDAlgorithms/src/InvalidParameterParser.cpp
@@ -7,6 +7,7 @@
 #include "MantidMDAlgorithms/InvalidParameterParser.h"
 #include "MantidAPI/ImplicitFunctionParameterParserFactory.h"
 #include <boost/algorithm/string.hpp>
+#include <utility>
 
 namespace Mantid {
 namespace MDAlgorithms {
@@ -23,7 +24,7 @@ InvalidParameterParser::createParameter(Poco::XML::Element *parameterElement) {
 
 InvalidParameter *
 InvalidParameterParser::parseInvalidParameter(std::string value) {
-  return new InvalidParameter(value);
+  return new InvalidParameter(std::move(value));
 }
 
 void InvalidParameterParser::setSuccessorParser(
diff --git a/Framework/MDAlgorithms/src/LoadDNSSCD.cpp b/Framework/MDAlgorithms/src/LoadDNSSCD.cpp
index e58b7e14a42..4dc8143a57d 100644
--- a/Framework/MDAlgorithms/src/LoadDNSSCD.cpp
+++ b/Framework/MDAlgorithms/src/LoadDNSSCD.cpp
@@ -240,7 +240,7 @@ void LoadDNSSCD::init() {
 /** Read Huber angles from a given table workspace.
  */
 
-void LoadDNSSCD::loadHuber(ITableWorkspace_sptr tws) {
+void LoadDNSSCD::loadHuber(const ITableWorkspace_sptr &tws) {
   ColumnVector<double> huber = tws->getVector("Huber(degrees)");
   // set huber[0] for each run in m_data
   for (auto &ds : m_data) {
@@ -789,7 +789,7 @@ void LoadDNSSCD::fillOutputWorkspaceRaw(double wavelength) {
   setProperty("NormalizationWorkspace", normWS);
 }
 
-void LoadDNSSCD::read_data(const std::string fname,
+void LoadDNSSCD::read_data(const std::string &fname,
                            std::map<std::string, std::string> &str_metadata,
                            std::map<std::string, double> &num_metadata) {
   std::ifstream file(fname);
diff --git a/Framework/MDAlgorithms/src/LoadMD.cpp b/Framework/MDAlgorithms/src/LoadMD.cpp
index af997aae16c..0ebd94bfad8 100644
--- a/Framework/MDAlgorithms/src/LoadMD.cpp
+++ b/Framework/MDAlgorithms/src/LoadMD.cpp
@@ -275,7 +275,8 @@ void LoadMD::exec() {
  * @param ws
  * @param dataType
  */
-void LoadMD::loadSlab(std::string name, void *data, MDHistoWorkspace_sptr ws,
+void LoadMD::loadSlab(const std::string &name, void *data,
+                      const MDHistoWorkspace_sptr &ws,
                       NeXus::NXnumtype dataType) {
   m_file->openData(name);
   if (m_file->getInfo().type != dataType)
@@ -634,7 +635,7 @@ void LoadMD::doLoad(typename MDEventWorkspace<MDE, nd>::sptr ws) {
  * appropriate coordinate transform and set those on the workspace.
  * @param ws : workspace to set the coordinate transforms on
  */
-void LoadMD::loadAffineMatricies(IMDWorkspace_sptr ws) {
+void LoadMD::loadAffineMatricies(const IMDWorkspace_sptr &ws) {
   std::map<std::string, std::string> entries;
   m_file->getEntries(entries);
 
@@ -655,7 +656,7 @@ void LoadMD::loadAffineMatricies(IMDWorkspace_sptr ws) {
  * @param entry_name : the entry point in the NeXus file to read
  * @return the coordinate transform object
  */
-CoordTransform *LoadMD::loadAffineMatrix(std::string entry_name) {
+CoordTransform *LoadMD::loadAffineMatrix(const std::string &entry_name) {
   m_file->openData(entry_name);
   std::vector<coord_t> vec;
   m_file->getData<coord_t>(vec);
@@ -686,7 +687,8 @@ CoordTransform *LoadMD::loadAffineMatrix(std::string entry_name) {
  * Set MDFrames for workspaces from legacy files
  * @param ws:: poitner to the workspace which needs to be corrected
  */
-void LoadMD::setMDFrameOnWorkspaceFromLegacyFile(API::IMDWorkspace_sptr ws) {
+void LoadMD::setMDFrameOnWorkspaceFromLegacyFile(
+    const API::IMDWorkspace_sptr &ws) {
 
   g_log.information()
       << "LoadMD: Encountered a legacy file which has a mismatch between "
@@ -761,7 +763,7 @@ void LoadMD::setMDFrameOnWorkspaceFromLegacyFile(API::IMDWorkspace_sptr ws) {
  * where
  * all MDFrames were stored as MDFrames
  */
-void LoadMD::checkForRequiredLegacyFixup(API::IMDWorkspace_sptr ws) {
+void LoadMD::checkForRequiredLegacyFixup(const API::IMDWorkspace_sptr &ws) {
   // Check if the special coordinate is not none
   auto isQBasedSpecialCoordinateSystem = true;
   if (m_coordSystem == Mantid::Kernel::SpecialCoordinateSystem::None) {
@@ -787,7 +789,7 @@ void LoadMD::checkForRequiredLegacyFixup(API::IMDWorkspace_sptr ws) {
 /**
  * Find scaling for Q dimensions
  */
-std::vector<double> LoadMD::qDimensions(API::IMDWorkspace_sptr ws) {
+std::vector<double> LoadMD::qDimensions(const API::IMDWorkspace_sptr &ws) {
   std::vector<double> scaling(m_numDims);
   for (size_t d = 0; d < m_numDims; d++) {
     std::string dimd = ws->getDimension(d)->getName();
diff --git a/Framework/MDAlgorithms/src/LoadSQW2.cpp b/Framework/MDAlgorithms/src/LoadSQW2.cpp
index a4ca1f4aec9..df4856bb6c8 100644
--- a/Framework/MDAlgorithms/src/LoadSQW2.cpp
+++ b/Framework/MDAlgorithms/src/LoadSQW2.cpp
@@ -595,7 +595,7 @@ void LoadSQW2::setupBoxController() {
  * box controller has already been initialized
  * @param filebackPath Path to the file used for backend storage
  */
-void LoadSQW2::setupFileBackend(std::string filebackPath) {
+void LoadSQW2::setupFileBackend(const std::string &filebackPath) {
   using DataObjects::BoxControllerNeXusIO;
   auto savemd = this->createChildAlgorithm("SaveMD", 0.01, 0.05, true);
   savemd->setProperty("InputWorkspace", m_outputWS);
diff --git a/Framework/MDAlgorithms/src/MDEventWSWrapper.cpp b/Framework/MDAlgorithms/src/MDEventWSWrapper.cpp
index d81d9a73226..0df5201068f 100644
--- a/Framework/MDAlgorithms/src/MDEventWSWrapper.cpp
+++ b/Framework/MDAlgorithms/src/MDEventWSWrapper.cpp
@@ -4,8 +4,10 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidMDAlgorithms/MDEventWSWrapper.h"
+#include <utility>
+
 #include "MantidGeometry/MDGeometry/MDTypes.h"
+#include "MantidMDAlgorithms/MDEventWSWrapper.h"
 
 namespace Mantid {
 namespace MDAlgorithms {
@@ -202,7 +204,7 @@ MDEventWSWrapper::createEmptyMDWS(const MDWSDescription &WSD) {
 /// set up existing workspace pointer as internal pointer for the class to
 /// perform proper MD operations on this workspace
 void MDEventWSWrapper::setMDWS(API::IMDEventWorkspace_sptr spWS) {
-  m_Workspace = spWS;
+  m_Workspace = std::move(spWS);
   m_NDimensions = m_Workspace->getNumDims();
 }
 
diff --git a/Framework/MDAlgorithms/src/MDNorm.cpp b/Framework/MDAlgorithms/src/MDNorm.cpp
index 544fa1e7bca..e2ba9446964 100644
--- a/Framework/MDAlgorithms/src/MDNorm.cpp
+++ b/Framework/MDAlgorithms/src/MDNorm.cpp
@@ -746,7 +746,7 @@ void MDNorm::createNormalizationWS(
  */
 void MDNorm::validateBinningForTemporaryDataWorkspace(
     const std::map<std::string, std::string> &parameters,
-    const Mantid::API::IMDHistoWorkspace_sptr tempDataWS) {
+    const Mantid::API::IMDHistoWorkspace_sptr &tempDataWS) {
 
   // parse the paramters map and get extents from tempDataWS
   const std::string numBinsStr = parameters.at("OutputBins");
@@ -921,8 +921,8 @@ void MDNorm::validateBinningForTemporaryDataWorkspace(
  * All slicing algorithm properties are passed along
  * @return MDHistoWorkspace as a result of the binning
  */
-DataObjects::MDHistoWorkspace_sptr
-MDNorm::binInputWS(std::vector<Geometry::SymmetryOperation> symmetryOps) {
+DataObjects::MDHistoWorkspace_sptr MDNorm::binInputWS(
+    const std::vector<Geometry::SymmetryOperation> &symmetryOps) {
   Mantid::API::IMDHistoWorkspace_sptr tempDataWS =
       this->getProperty("TemporaryDataWorkspace");
   Mantid::API::Workspace_sptr outputWS;
@@ -1142,7 +1142,7 @@ void MDNorm::cacheDimensionXValues() {
  * @param soIndex - the index of symmetry operation (for progress purposes)
  */
 void MDNorm::calculateNormalization(const std::vector<coord_t> &otherValues,
-                                    Geometry::SymmetryOperation so,
+                                    const Geometry::SymmetryOperation &so,
                                     uint16_t expInfoIndex, size_t soIndex) {
   const auto &currentExptInfo = *(m_inputWS->getExperimentInfo(expInfoIndex));
   std::vector<double> lowValues, highValues;
@@ -1330,7 +1330,7 @@ m_accumulate = true;
  */
 void MDNorm::calculateIntersections(
     std::vector<std::array<double, 4>> &intersections, const double theta,
-    const double phi, Kernel::DblMatrix transform, double lowvalue,
+    const double phi, const Kernel::DblMatrix &transform, double lowvalue,
     double highvalue) {
   V3D qout(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta)),
       qin(0., 0., 1);
diff --git a/Framework/MDAlgorithms/src/MDTransfNoQ.cpp b/Framework/MDAlgorithms/src/MDTransfNoQ.cpp
index e0aad525d45..146d8188cbc 100644
--- a/Framework/MDAlgorithms/src/MDTransfNoQ.cpp
+++ b/Framework/MDAlgorithms/src/MDTransfNoQ.cpp
@@ -119,7 +119,7 @@ MDTransfNoQ::getNMatrixDimensions(Kernel::DeltaEMode::Type mode,
 }
 // internal helper function which extract one or two axis from input matrix
 // workspace;
-void MDTransfNoQ::getAxes(API::MatrixWorkspace_const_sptr inWS,
+void MDTransfNoQ::getAxes(const API::MatrixWorkspace_const_sptr &inWS,
                           API::NumericAxis *&pXAxis,
                           API::NumericAxis *&pYAxis) {
   // get the X axis of input workspace, it has to be there; if not axis throws
diff --git a/Framework/MDAlgorithms/src/MDWSDescription.cpp b/Framework/MDAlgorithms/src/MDWSDescription.cpp
index 3560edc8cde..aecd160aff6 100644
--- a/Framework/MDAlgorithms/src/MDWSDescription.cpp
+++ b/Framework/MDAlgorithms/src/MDWSDescription.cpp
@@ -20,6 +20,7 @@
 #include "MantidMDAlgorithms/MDTransfFactory.h"
 
 #include <boost/lexical_cast.hpp>
+#include <utility>
 
 namespace Mantid {
 namespace MDAlgorithms {
@@ -67,7 +68,7 @@ which will be used as dimensions.
 */
 void MDWSDescription::buildFromMatrixWS(
     const API::MatrixWorkspace_sptr &pWS, const std::string &QMode,
-    const std::string dEMode,
+    const std::string &dEMode,
     const std::vector<std::string> &dimPropertyNames) {
   m_InWS = pWS;
   // fill additional dimensions values, defined by workspace properties;
@@ -125,7 +126,7 @@ void MDWSDescription::buildFromMatrixWS(
 }
 
 void MDWSDescription::setWS(API::MatrixWorkspace_sptr otherMatrixWS) {
-  m_InWS = otherMatrixWS;
+  m_InWS = std::move(otherMatrixWS);
 }
 /// Method checks if input workspace has defined goniometer
 bool MDWSDescription::hasGoniometer() const {
@@ -349,7 +350,7 @@ std::string MDWSDescription::getEModeStr() const {
  *properties) for current multidimensional event
  */
 void MDWSDescription::fillAddProperties(
-    Mantid::API::MatrixWorkspace_const_sptr inWS2D,
+    const Mantid::API::MatrixWorkspace_const_sptr &inWS2D,
     const std::vector<std::string> &dimPropertyNames,
     std::vector<coord_t> &AddCoord) {
   size_t nDimPropNames = dimPropertyNames.size();
@@ -400,7 +401,7 @@ void MDWSDescription::checkMinMaxNdimConsistent(
 /** function retrieves copy of the oriented lattice from the workspace */
 boost::shared_ptr<Geometry::OrientedLattice>
 MDWSDescription::getOrientedLattice(
-    Mantid::API::MatrixWorkspace_const_sptr inWS2D) {
+    const Mantid::API::MatrixWorkspace_const_sptr &inWS2D) {
   // try to get the WS oriented lattice
   boost::shared_ptr<Geometry::OrientedLattice> orl;
   if (inWS2D->sample().hasOrientedLattice())
@@ -432,7 +433,7 @@ Geometry::MDFrame_uptr MDWSDescription::getFrame(size_t d) const {
  * Sets the frame.
  * @param frameKey : Frame key desired.
  */
-void MDWSDescription::setFrame(const std::string frameKey) {
+void MDWSDescription::setFrame(const std::string &frameKey) {
   m_frameKey = frameKey;
 }
 
diff --git a/Framework/MDAlgorithms/src/MaskMD.cpp b/Framework/MDAlgorithms/src/MaskMD.cpp
index ad6b749a707..7dd1249f4dc 100644
--- a/Framework/MDAlgorithms/src/MaskMD.cpp
+++ b/Framework/MDAlgorithms/src/MaskMD.cpp
@@ -116,7 +116,7 @@ workspace.
 @throws runtime_error if the requested dimension is unknown either by id, or by
 name in the workspace.
 */
-size_t tryFetchDimensionIndex(Mantid::API::IMDWorkspace_sptr ws,
+size_t tryFetchDimensionIndex(const Mantid::API::IMDWorkspace_sptr &ws,
                               const std::string &candidateNameOrId) {
   size_t dimWorkspaceIndex;
   try {
diff --git a/Framework/MDAlgorithms/src/MergeMDFiles.cpp b/Framework/MDAlgorithms/src/MergeMDFiles.cpp
index 6c3720a0fa8..74c9a3836f7 100644
--- a/Framework/MDAlgorithms/src/MergeMDFiles.cpp
+++ b/Framework/MDAlgorithms/src/MergeMDFiles.cpp
@@ -197,8 +197,9 @@ uint64_t MergeMDFiles::loadEventsFromSubBoxes(API::IMDNode *TargetBox) {
  * @param outputFile :: the name of the output file where file-based workspace
  *should be saved
  */
-void MergeMDFiles::doExecByCloning(Mantid::API::IMDEventWorkspace_sptr ws,
-                                   const std::string &outputFile) {
+void MergeMDFiles::doExecByCloning(
+    const Mantid::API::IMDEventWorkspace_sptr &ws,
+    const std::string &outputFile) {
   m_OutIWS = ws;
   m_MDEventType = ws->getEventTypeName();
 
diff --git a/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp b/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp
index ee4152a6e70..e8d6dc38f3b 100644
--- a/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp
+++ b/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp
@@ -399,7 +399,7 @@ void PreprocessDetectorsToMD::buildFakeDetectorsPositions(
 /// function checks if source workspace still has information about detectors.
 /// Some ws (like rebinned one) do not have this information any more.
 bool PreprocessDetectorsToMD::isDetInfoLost(
-    Mantid::API::MatrixWorkspace_const_sptr inWS2D) const {
+    const Mantid::API::MatrixWorkspace_const_sptr &inWS2D) const {
   auto pYAxis = dynamic_cast<API::NumericAxis *>(inWS2D->getAxis(1));
   // if this is numeric axis, then the detector's information has been lost:
   return pYAxis != nullptr;
diff --git a/Framework/MDAlgorithms/src/SaveIsawQvector.cpp b/Framework/MDAlgorithms/src/SaveIsawQvector.cpp
index 761bcdc86db..a4a5fb82ab4 100644
--- a/Framework/MDAlgorithms/src/SaveIsawQvector.cpp
+++ b/Framework/MDAlgorithms/src/SaveIsawQvector.cpp
@@ -194,7 +194,7 @@ void SaveIsawQvector::exec() {
  *
  * @param wksp The workspace to get information from.
  */
-void SaveIsawQvector::initTargetWSDescr(EventWorkspace_sptr wksp) {
+void SaveIsawQvector::initTargetWSDescr(const EventWorkspace_sptr &wksp) {
   m_targWSDescr.setMinMax(std::vector<double>(3, -2000.),
                           std::vector<double>(3, 2000.));
   m_targWSDescr.buildFromMatrixWS(wksp, Q3D, ELASTIC);
diff --git a/Framework/MDAlgorithms/src/SaveMD.cpp b/Framework/MDAlgorithms/src/SaveMD.cpp
index 31253526ebe..8f9fd29e434 100644
--- a/Framework/MDAlgorithms/src/SaveMD.cpp
+++ b/Framework/MDAlgorithms/src/SaveMD.cpp
@@ -33,7 +33,7 @@ namespace {
 template <typename MDE, size_t nd>
 void prepareUpdate(MDBoxFlatTree &BoxFlatStruct, BoxController *bc,
                    typename MDEventWorkspace<MDE, nd>::sptr ws,
-                   std::string filename) {
+                   const std::string &filename) {
   // remove all boxes from the DiskBuffer. DB will calculate boxes positions
   // on HDD.
   bc->getFileIO()->flushCache();
@@ -236,7 +236,7 @@ void SaveMD::doSaveEvents(typename MDEventWorkspace<MDE, nd>::sptr ws) {
  *
  * @param ws :: MDHistoWorkspace to save
  */
-void SaveMD::doSaveHisto(Mantid::DataObjects::MDHistoWorkspace_sptr ws) {
+void SaveMD::doSaveHisto(const Mantid::DataObjects::MDHistoWorkspace_sptr &ws) {
   std::string filename = getPropertyValue("Filename");
 
   // Erase the file if it exists
diff --git a/Framework/MDAlgorithms/src/SaveMD2.cpp b/Framework/MDAlgorithms/src/SaveMD2.cpp
index 548baf4c74a..1bafc3309dd 100644
--- a/Framework/MDAlgorithms/src/SaveMD2.cpp
+++ b/Framework/MDAlgorithms/src/SaveMD2.cpp
@@ -88,7 +88,8 @@ void SaveMD2::init() {
  *
  * @param ws :: MDHistoWorkspace to save
  */
-void SaveMD2::doSaveHisto(Mantid::DataObjects::MDHistoWorkspace_sptr ws) {
+void SaveMD2::doSaveHisto(
+    const Mantid::DataObjects::MDHistoWorkspace_sptr &ws) {
   std::string filename = getPropertyValue("Filename");
 
   // Erase the file if it exists
diff --git a/Framework/MDAlgorithms/src/SlicingAlgorithm.cpp b/Framework/MDAlgorithms/src/SlicingAlgorithm.cpp
index 954651bc8ef..d8b8a17c5b6 100644
--- a/Framework/MDAlgorithms/src/SlicingAlgorithm.cpp
+++ b/Framework/MDAlgorithms/src/SlicingAlgorithm.cpp
@@ -19,6 +19,7 @@
 #include "MantidKernel/VisibleWhenProperty.h"
 
 #include <boost/regex.hpp>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -903,7 +904,7 @@ SlicingAlgorithm::getImplicitFunctionForChunk(const size_t *const chunkMin,
  * @returns the unique pointer
  */
 Mantid::Geometry::MDFrame_uptr SlicingAlgorithm::createMDFrameForNonAxisAligned(
-    std::string units, Mantid::Kernel::VMD basisVector) const {
+    const std::string &units, const Mantid::Kernel::VMD &basisVector) const {
   // Get set of basis vectors
   auto oldBasis = getOldBasis(m_inWS->getNumDims());
 
@@ -911,7 +912,8 @@ Mantid::Geometry::MDFrame_uptr SlicingAlgorithm::createMDFrameForNonAxisAligned(
   auto indicesWithProjection = getIndicesWithProjection(basisVector, oldBasis);
 
   // Extract MDFrame
-  return extractMDFrameForNonAxisAligned(indicesWithProjection, units);
+  return extractMDFrameForNonAxisAligned(indicesWithProjection,
+                                         std::move(units));
 }
 
 std::vector<Mantid::Kernel::VMD>
@@ -964,7 +966,7 @@ std::vector<size_t> SlicingAlgorithm::getIndicesWithProjection(
  */
 Mantid::Geometry::MDFrame_uptr
 SlicingAlgorithm::extractMDFrameForNonAxisAligned(
-    std::vector<size_t> indicesWithProjection, std::string units) const {
+    std::vector<size_t> indicesWithProjection, const std::string &units) const {
   if (indicesWithProjection.empty()) {
     g_log.warning() << "Slicing Algorithm: Chosen vector does not "
                        "project on any vector of the old basis.";
diff --git a/Framework/MDAlgorithms/src/SmoothMD.cpp b/Framework/MDAlgorithms/src/SmoothMD.cpp
index 30b8e145c16..e7409a0de4c 100644
--- a/Framework/MDAlgorithms/src/SmoothMD.cpp
+++ b/Framework/MDAlgorithms/src/SmoothMD.cpp
@@ -175,7 +175,7 @@ const std::string SmoothMD::summary() const {
  * @return Smoothed MDHistoWorkspace
  */
 IMDHistoWorkspace_sptr
-SmoothMD::hatSmooth(IMDHistoWorkspace_const_sptr toSmooth,
+SmoothMD::hatSmooth(const IMDHistoWorkspace_const_sptr &toSmooth,
                     const WidthVector &widthVector,
                     OptionalIMDHistoWorkspace_const_sptr weightingWS) {
 
@@ -278,7 +278,7 @@ SmoothMD::hatSmooth(IMDHistoWorkspace_const_sptr toSmooth,
  * @return Smoothed MDHistoWorkspace
  */
 IMDHistoWorkspace_sptr
-SmoothMD::gaussianSmooth(IMDHistoWorkspace_const_sptr toSmooth,
+SmoothMD::gaussianSmooth(const IMDHistoWorkspace_const_sptr &toSmooth,
                          const WidthVector &widthVector,
                          OptionalIMDHistoWorkspace_const_sptr weightingWS) {
 
diff --git a/Framework/MDAlgorithms/test/BinMDTest.h b/Framework/MDAlgorithms/test/BinMDTest.h
index d795e966a52..4cf15306a92 100644
--- a/Framework/MDAlgorithms/test/BinMDTest.h
+++ b/Framework/MDAlgorithms/test/BinMDTest.h
@@ -26,6 +26,7 @@
 #include "MantidTestHelpers/MDEventsTestHelper.h"
 
 #include <cmath>
+#include <utility>
 
 #include <cxxtest/TestSuite.h>
 
@@ -132,8 +133,9 @@ public:
     AnalysisDataService::Instance().addOrReplace("BinMDTest_ws", in_ws);
 
     execute_bin(functionXML, name1, name2, name3, name4, expected_signal,
-                expected_numBins, IterateEvents, numEventsPerBox, expectBasisX,
-                expectBasisY, expectBasisZ, in_ws);
+                expected_numBins, IterateEvents, numEventsPerBox,
+                std::move(expectBasisX), std::move(expectBasisY),
+                std::move(expectBasisZ), in_ws);
   }
 
   MDHistoWorkspace_sptr
@@ -142,7 +144,7 @@ public:
               const std::string &name4, const double expected_signal,
               const size_t expected_numBins, bool IterateEvents,
               size_t numEventsPerBox, VMD expectBasisX, VMD expectBasisY,
-              VMD expectBasisZ, IMDEventWorkspace_sptr in_ws) {
+              VMD expectBasisZ, const IMDEventWorkspace_sptr &in_ws) {
     BinMD alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
@@ -584,9 +586,9 @@ public:
    * @param origWS :: both should have this as its originalWorkspace
    * @return binned2 shared pointer
    */
-  MDHistoWorkspace_sptr do_compare_histo(std::string binned1Name,
-                                         std::string binned2Name,
-                                         std::string origWS) {
+  MDHistoWorkspace_sptr do_compare_histo(const std::string &binned1Name,
+                                         const std::string &binned2Name,
+                                         const std::string &origWS) {
     MDHistoWorkspace_sptr binned1 =
         AnalysisDataService::Instance().retrieveWS<MDHistoWorkspace>(
             binned1Name);
@@ -1078,7 +1080,7 @@ public:
     return outWSName;
   }
 
-  std::string saveWorkspace(IMDEventWorkspace_sptr in_ws) {
+  std::string saveWorkspace(const IMDEventWorkspace_sptr &in_ws) {
     SaveMD2 saver;
     saver.setChild(true);
     saver.setRethrows(true);
@@ -1128,7 +1130,7 @@ public:
     AnalysisDataService::Instance().remove("BinMDTest_ws");
   }
 
-  void do_test(std::string binParams, bool IterateEvents) {
+  void do_test(const std::string &binParams, bool IterateEvents) {
     BinMD alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
diff --git a/Framework/MDAlgorithms/test/BinaryOperationMDTest.h b/Framework/MDAlgorithms/test/BinaryOperationMDTest.h
index d0a832cc4ac..8b21a38ab82 100644
--- a/Framework/MDAlgorithms/test/BinaryOperationMDTest.h
+++ b/Framework/MDAlgorithms/test/BinaryOperationMDTest.h
@@ -95,8 +95,9 @@ public:
   }
 
   /// Run the mock algorithm
-  void doTest(MockBinaryOperationMD &alg, std::string lhs, std::string rhs,
-              std::string outName, bool succeeds = true) {
+  void doTest(MockBinaryOperationMD &alg, const std::string &lhs,
+              const std::string &rhs, const std::string &outName,
+              bool succeeds = true) {
     out.reset();
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
diff --git a/Framework/MDAlgorithms/test/BoxControllerSettingsAlgorithmTest.h b/Framework/MDAlgorithms/test/BoxControllerSettingsAlgorithmTest.h
index 65e5c12ddc7..135c89af553 100644
--- a/Framework/MDAlgorithms/test/BoxControllerSettingsAlgorithmTest.h
+++ b/Framework/MDAlgorithms/test/BoxControllerSettingsAlgorithmTest.h
@@ -14,6 +14,7 @@
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 
 #include <boost/format.hpp>
+#include <utility>
 
 #include <cxxtest/TestSuite.h>
 
@@ -47,8 +48,9 @@ private:
   Helper function. Runs LoadParameterAlg, to get an instrument parameter
   definition from a file onto a workspace.
   */
-  void apply_instrument_parameter_file_to_workspace(MatrixWorkspace_sptr ws,
-                                                    const ScopedFile &file) {
+  void
+  apply_instrument_parameter_file_to_workspace(const MatrixWorkspace_sptr &ws,
+                                               const ScopedFile &file) {
     // Load the Instrument Parameter file over the existing test workspace +
     // instrument.
     using DataHandling::LoadParameterFile;
@@ -119,9 +121,9 @@ public:
     TS_ASSERT_EQUALS(bc->getMaxDepth(), 34);
   }
 
-  void doTest(BoxController_sptr bc, std::string SplitInto = "",
-              std::string SplitThreshold = "",
-              std::string MaxRecursionDepth = "") {
+  void doTest(const BoxController_sptr &bc, const std::string &SplitInto = "",
+              const std::string &SplitThreshold = "",
+              const std::string &MaxRecursionDepth = "") {
     BoxControllerSettingsAlgorithmImpl alg;
     alg.initBoxControllerProps();
     if (!SplitInto.empty())
@@ -130,7 +132,7 @@ public:
       alg.setPropertyValue("SplitThreshold", SplitThreshold);
     if (!MaxRecursionDepth.empty())
       alg.setPropertyValue("MaxRecursionDepth", MaxRecursionDepth);
-    alg.setBoxController(bc);
+    alg.setBoxController(std::move(bc));
   }
 
   void test_SplitInto() {
diff --git a/Framework/MDAlgorithms/test/CentroidPeaksMD2Test.h b/Framework/MDAlgorithms/test/CentroidPeaksMD2Test.h
index f669d3671db..843b77ece15 100644
--- a/Framework/MDAlgorithms/test/CentroidPeaksMD2Test.h
+++ b/Framework/MDAlgorithms/test/CentroidPeaksMD2Test.h
@@ -43,7 +43,7 @@ public:
 
   //-------------------------------------------------------------------------------
   /** Create the (blank) MDEW */
-  static void createMDEW(std::string CoordinatesToUse) {
+  static void createMDEW(const std::string &CoordinatesToUse) {
     // ---- Start with empty MDEW ----
     std::string frames;
     if (CoordinatesToUse == "Q (lab frame)") {
@@ -98,9 +98,10 @@ public:
 
   //-------------------------------------------------------------------------------
   /** Run the CentroidPeaksMD2 with the given peak radius param */
-  void doRun(V3D startPos, double PeakRadius, double binCount,
-             V3D expectedResult, std::string message,
-             std::string OutputWorkspace = "CentroidPeaksMD2Test_Peaks") {
+  void
+  doRun(V3D startPos, double PeakRadius, double binCount, V3D expectedResult,
+        const std::string &message,
+        const std::string &OutputWorkspace = "CentroidPeaksMD2Test_Peaks") {
     // Make a fake instrument - doesn't matter, we won't use it really
     Instrument_sptr inst =
         ComponentCreationHelper::createTestInstrumentCylindrical(5);
diff --git a/Framework/MDAlgorithms/test/CentroidPeaksMDTest.h b/Framework/MDAlgorithms/test/CentroidPeaksMDTest.h
index 2791e5e7351..2694382ce73 100644
--- a/Framework/MDAlgorithms/test/CentroidPeaksMDTest.h
+++ b/Framework/MDAlgorithms/test/CentroidPeaksMDTest.h
@@ -43,7 +43,7 @@ public:
 
   //-------------------------------------------------------------------------------
   /** Create the (blank) MDEW */
-  static void createMDEW(std::string CoordinatesToUse) {
+  static void createMDEW(const std::string &CoordinatesToUse) {
     // ---- Start with empty MDEW ----
     std::string frames;
     if (CoordinatesToUse == "Q (lab frame)") {
@@ -100,8 +100,8 @@ public:
   //-------------------------------------------------------------------------------
   /** Run the CentroidPeaksMD with the given peak radius param */
   void doRun(V3D startPos, double PeakRadius, V3D expectedResult,
-             std::string message,
-             std::string OutputWorkspace = "CentroidPeaksMDTest_Peaks") {
+             const std::string &message,
+             const std::string &OutputWorkspace = "CentroidPeaksMDTest_Peaks") {
     // Make a fake instrument - doesn't matter, we won't use it really
     Instrument_sptr inst =
         ComponentCreationHelper::createTestInstrumentCylindrical(5);
diff --git a/Framework/MDAlgorithms/test/CloneMDWorkspaceTest.h b/Framework/MDAlgorithms/test/CloneMDWorkspaceTest.h
index 5fc2b64ec2c..3c5cc4d73d6 100644
--- a/Framework/MDAlgorithms/test/CloneMDWorkspaceTest.h
+++ b/Framework/MDAlgorithms/test/CloneMDWorkspaceTest.h
@@ -45,7 +45,7 @@ public:
     do_test(true, "CloneMDWorkspaceTest_ws_custom_cloned_name2.nxs", true);
   }
 
-  void do_test(bool fileBacked, std::string Filename = "",
+  void do_test(bool fileBacked, const std::string &Filename = "",
                bool file_needs_updating = false) {
     // Name of the output workspace.
     std::string outWSName("CloneMDWorkspaceTest_OutputWS");
@@ -117,7 +117,7 @@ public:
   }
 
   /** Clone a workspace and check that the clone matches */
-  void do_test_MDHisto(MDHistoWorkspace_sptr ws1) {
+  void do_test_MDHisto(const MDHistoWorkspace_sptr &ws1) {
     // Name of the output workspace.
     std::string outWSName("CloneMDWorkspaceTest_OutputWS");
     // Add the input workspace
diff --git a/Framework/MDAlgorithms/test/CompareMDWorkspacesTest.h b/Framework/MDAlgorithms/test/CompareMDWorkspacesTest.h
index 09d48d0b74d..a876e49842b 100644
--- a/Framework/MDAlgorithms/test/CompareMDWorkspacesTest.h
+++ b/Framework/MDAlgorithms/test/CompareMDWorkspacesTest.h
@@ -31,9 +31,9 @@ public:
     TS_ASSERT(alg.isInitialized())
   }
 
-  void doTest(std::string ws1, std::string ws2,
-              std::string resultExpected = "Success!", bool CheckEvents = true,
-              bool IgnoreDifferentID = false) {
+  void doTest(const std::string &ws1, const std::string &ws2,
+              const std::string &resultExpected = "Success!",
+              bool CheckEvents = true, bool IgnoreDifferentID = false) {
 
     CompareMDWorkspaces alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
diff --git a/Framework/MDAlgorithms/test/ConvertToMDComponentsTest.h b/Framework/MDAlgorithms/test/ConvertToMDComponentsTest.h
index 89cb7617a90..e6bb76af1e6 100644
--- a/Framework/MDAlgorithms/test/ConvertToMDComponentsTest.h
+++ b/Framework/MDAlgorithms/test/ConvertToMDComponentsTest.h
@@ -18,6 +18,8 @@
 
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 using namespace Mantid;
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -26,23 +28,22 @@ using namespace Mantid::MDAlgorithms;
 
 class Convert2MDComponentsTestHelper : public ConvertToMD {
 public:
-  TableWorkspace_const_sptr
-  preprocessDetectorsPositions(Mantid::API::MatrixWorkspace_const_sptr InWS2D,
-                               const std::string dEModeRequested = "Direct",
-                               bool updateMasks = true) {
+  TableWorkspace_const_sptr preprocessDetectorsPositions(
+      const Mantid::API::MatrixWorkspace_const_sptr &InWS2D,
+      const std::string &dEModeRequested = "Direct", bool updateMasks = true) {
     std::string OutWSName(this->getProperty("PreprocDetectorsWS"));
     return ConvertToMD::preprocessDetectorsPositions(InWS2D, dEModeRequested,
                                                      updateMasks, OutWSName);
   }
   void setSourceWS(Mantid::API::MatrixWorkspace_sptr InWS2D) {
-    this->m_InWS2D = InWS2D;
+    this->m_InWS2D = std::move(InWS2D);
     // and create the class, which will deal with the target workspace
     if (!this->m_OutWSWrapper)
       this->m_OutWSWrapper = boost::shared_ptr<MDAlgorithms::MDEventWSWrapper>(
           new MDAlgorithms::MDEventWSWrapper());
   }
   Convert2MDComponentsTestHelper() { ConvertToMD::initialize(); }
-  bool buildTargetWSDescription(API::IMDEventWorkspace_sptr spws,
+  bool buildTargetWSDescription(const API::IMDEventWorkspace_sptr &spws,
                                 const std::string &Q_mod_req,
                                 const std::string &dEModeRequested,
                                 const std::vector<std::string> &other_dim_names,
@@ -52,8 +53,8 @@ public:
     std::vector<double> dimMin = this->getProperty("MinValues");
     std::vector<double> dimMax = this->getProperty("MaxValues");
     return ConvertToMD::buildTargetWSDescription(
-        spws, Q_mod_req, dEModeRequested, other_dim_names, dimMin, dimMax,
-        QFrame, convert_to_, targWSDescr);
+        std::move(spws), Q_mod_req, dEModeRequested, other_dim_names, dimMin,
+        dimMax, QFrame, convert_to_, targWSDescr);
   }
   void copyMetaData(API::IMDEventWorkspace_sptr mdEventWS) const {
     ConvertToMD::copyMetaData(mdEventWS);
diff --git a/Framework/MDAlgorithms/test/ConvertToMDTest.h b/Framework/MDAlgorithms/test/ConvertToMDTest.h
index 9847608765c..014f131a4cc 100644
--- a/Framework/MDAlgorithms/test/ConvertToMDTest.h
+++ b/Framework/MDAlgorithms/test/ConvertToMDTest.h
@@ -19,6 +19,8 @@
 #include <Poco/File.h>
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 using namespace Mantid;
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -57,16 +59,15 @@ Mantid::API::MatrixWorkspace_sptr createTestWorkspaces() {
 class Convert2AnyTestHelper : public ConvertToMD {
 public:
   Convert2AnyTestHelper(){};
-  TableWorkspace_const_sptr
-  preprocessDetectorsPositions(Mantid::API::MatrixWorkspace_const_sptr InWS2D,
-                               const std::string dEModeRequested = "Direct",
-                               bool updateMasks = false) {
+  TableWorkspace_const_sptr preprocessDetectorsPositions(
+      const Mantid::API::MatrixWorkspace_const_sptr &InWS2D,
+      const std::string &dEModeRequested = "Direct", bool updateMasks = false) {
     return ConvertToMD::preprocessDetectorsPositions(
         InWS2D, dEModeRequested, updateMasks,
         std::string(this->getProperty("PreprocDetectorsWS")));
   }
   void setSourceWS(Mantid::API::MatrixWorkspace_sptr InWS2D) {
-    m_InWS2D = InWS2D;
+    m_InWS2D = std::move(InWS2D);
   }
 };
 // helper function to provide list of names to test:
diff --git a/Framework/MDAlgorithms/test/ConvertToQ3DdETest.h b/Framework/MDAlgorithms/test/ConvertToQ3DdETest.h
index 9bbadd84470..2446c162256 100644
--- a/Framework/MDAlgorithms/test/ConvertToQ3DdETest.h
+++ b/Framework/MDAlgorithms/test/ConvertToQ3DdETest.h
@@ -59,7 +59,7 @@ public:
   /** Calculate min-max value defaults*/
   Mantid::API::IAlgorithm *
   calcMinMaxValDefaults(const std::string &QMode, const std::string &QFrame,
-                        std::string OtherProperties = std::string("")) {
+                        const std::string &OtherProperties = std::string("")) {
 
     Mantid::API::IAlgorithm *childAlg =
         Mantid::API::FrameworkManager::Instance().createAlgorithm(
diff --git a/Framework/MDAlgorithms/test/ConvertToReflectometryQTest.h b/Framework/MDAlgorithms/test/ConvertToReflectometryQTest.h
index f704953755f..04378718a13 100644
--- a/Framework/MDAlgorithms/test/ConvertToReflectometryQTest.h
+++ b/Framework/MDAlgorithms/test/ConvertToReflectometryQTest.h
@@ -42,7 +42,7 @@ private:
   Makes the tests much more readable like this.
   */
   boost::shared_ptr<ConvertToReflectometryQ>
-  make_standard_algorithm(const std::string outputdimensions = "Q (lab frame)",
+  make_standard_algorithm(const std::string &outputdimensions = "Q (lab frame)",
                           bool outputAsMD = true) {
     MatrixWorkspace_sptr in_ws =
         WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(10, 10);
diff --git a/Framework/MDAlgorithms/test/CreateMDWorkspaceTest.h b/Framework/MDAlgorithms/test/CreateMDWorkspaceTest.h
index 11af60f6a5e..64d9c0c8d86 100644
--- a/Framework/MDAlgorithms/test/CreateMDWorkspaceTest.h
+++ b/Framework/MDAlgorithms/test/CreateMDWorkspaceTest.h
@@ -91,8 +91,9 @@ public:
                    ->isExecuted());
   }
 
-  void do_test_exec(std::string Filename, bool lean, int MinRecursionDepth = 0,
-                    int expectedNumMDBoxes = 216, bool withFrames = false) {
+  void do_test_exec(const std::string &Filename, bool lean,
+                    int MinRecursionDepth = 0, int expectedNumMDBoxes = 216,
+                    bool withFrames = false) {
 
     std::string wsName = "CreateMDWorkspaceTest_out";
     CreateMDWorkspace alg;
diff --git a/Framework/MDAlgorithms/test/CutMDTest.h b/Framework/MDAlgorithms/test/CutMDTest.h
index 54c878295c6..cc8cef0d150 100644
--- a/Framework/MDAlgorithms/test/CutMDTest.h
+++ b/Framework/MDAlgorithms/test/CutMDTest.h
@@ -42,7 +42,7 @@ class CutMDTest : public CxxTest::TestSuite {
 private:
   IMDWorkspace_sptr m_inWS;
 
-  void addNormalization(std::string wsName) {
+  void addNormalization(const std::string &wsName) {
     auto ws = AnalysisDataService::Instance().retrieveWS<IMDWorkspace>(wsName);
     auto eventWS = boost::dynamic_pointer_cast<IMDEventWorkspace>(ws);
     auto histoWS = boost::dynamic_pointer_cast<IMDHistoWorkspace>(ws);
diff --git a/Framework/MDAlgorithms/test/DivideMDTest.h b/Framework/MDAlgorithms/test/DivideMDTest.h
index eb32ec58885..cb039a85f71 100644
--- a/Framework/MDAlgorithms/test/DivideMDTest.h
+++ b/Framework/MDAlgorithms/test/DivideMDTest.h
@@ -62,7 +62,7 @@ public:
 
   /** Get a MDEventWorkspace and check that all events have the given
    * signal/error */
-  void checkMDEWSignal(std::string wsName, signal_t expectedSignal,
+  void checkMDEWSignal(const std::string &wsName, signal_t expectedSignal,
                        signal_t expectedError) {
     IMDEventWorkspace_sptr ws =
         AnalysisDataService::Instance().retrieveWS<IMDEventWorkspace>(wsName);
diff --git a/Framework/MDAlgorithms/test/FlippingRatioCorrectionMDTest.h b/Framework/MDAlgorithms/test/FlippingRatioCorrectionMDTest.h
index 1d2cc0a197b..1020c148891 100644
--- a/Framework/MDAlgorithms/test/FlippingRatioCorrectionMDTest.h
+++ b/Framework/MDAlgorithms/test/FlippingRatioCorrectionMDTest.h
@@ -85,7 +85,7 @@ public:
   }
 
 private:
-  void checkFRCorrection(std::string wsName, double expectedValuePeak1,
+  void checkFRCorrection(const std::string &wsName, double expectedValuePeak1,
                          double expectedValuePeak2) {
     Mantid::MDAlgorithms::BinMD algBin;
     TS_ASSERT_THROWS_NOTHING(algBin.initialize())
diff --git a/Framework/MDAlgorithms/test/ImportMDEventWorkspaceTest.h b/Framework/MDAlgorithms/test/ImportMDEventWorkspaceTest.h
index 84212d4c102..92dc688f9a2 100644
--- a/Framework/MDAlgorithms/test/ImportMDEventWorkspaceTest.h
+++ b/Framework/MDAlgorithms/test/ImportMDEventWorkspaceTest.h
@@ -72,7 +72,7 @@ public:
   /// Create a simple input file.
   MDFileObject(
       const FileContentsBuilder &builder = FileContentsBuilder(),
-      std::string filename = "test_import_md_event_workspace_file.txt") {
+      const std::string &filename = "test_import_md_event_workspace_file.txt") {
     Poco::Path path(
         Mantid::Kernel::ConfigService::Instance().getTempDir().c_str());
     path.append(filename);
diff --git a/Framework/MDAlgorithms/test/IntegrateMDHistoWorkspaceTest.h b/Framework/MDAlgorithms/test/IntegrateMDHistoWorkspaceTest.h
index 50c8c3d8f3b..0636526f31d 100644
--- a/Framework/MDAlgorithms/test/IntegrateMDHistoWorkspaceTest.h
+++ b/Framework/MDAlgorithms/test/IntegrateMDHistoWorkspaceTest.h
@@ -18,7 +18,7 @@ namespace {
 
 // This helper sets the signal values to the linear index to have some
 // variety
-void resetSignalsToLinearIndexValue(IMDHistoWorkspace_sptr ws) {
+void resetSignalsToLinearIndexValue(const IMDHistoWorkspace_sptr &ws) {
   auto numberOfIndices = static_cast<size_t>(ws->getNPoints());
   for (size_t i = 0; i < numberOfIndices; ++i) {
     auto &signal = ws->signalAt(i);
diff --git a/Framework/MDAlgorithms/test/IntegratePeaksMD2Test.h b/Framework/MDAlgorithms/test/IntegratePeaksMD2Test.h
index 3ef787860f1..790cb2067be 100644
--- a/Framework/MDAlgorithms/test/IntegratePeaksMD2Test.h
+++ b/Framework/MDAlgorithms/test/IntegratePeaksMD2Test.h
@@ -51,11 +51,11 @@ public:
 
   //-------------------------------------------------------------------------------
   /** Run the IntegratePeaksMD2 with the given peak radius integration param */
-  static void doRun(double PeakRadius, double BackgroundRadius,
-                    std::string OutputWorkspace = "IntegratePeaksMD2Test_peaks",
-                    double BackgroundStartRadius = 0.0, bool edge = true,
-                    bool cyl = false, std::string fnct = "NoFit",
-                    double adaptive = 0.0) {
+  static void
+  doRun(double PeakRadius, double BackgroundRadius,
+        const std::string &OutputWorkspace = "IntegratePeaksMD2Test_peaks",
+        double BackgroundStartRadius = 0.0, bool edge = true, bool cyl = false,
+        const std::string &fnct = "NoFit", double adaptive = 0.0) {
     IntegratePeaksMD2 alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
diff --git a/Framework/MDAlgorithms/test/IntegratePeaksMDHKLTest.h b/Framework/MDAlgorithms/test/IntegratePeaksMDHKLTest.h
index 43630aa372d..23327899699 100644
--- a/Framework/MDAlgorithms/test/IntegratePeaksMDHKLTest.h
+++ b/Framework/MDAlgorithms/test/IntegratePeaksMDHKLTest.h
@@ -55,7 +55,7 @@ public:
   /** Run the IntegratePeaksMDHKL with the given peak radius integration param
    */
   static void
-  doRun(std::string OutputWorkspace = "IntegratePeaksMDHKLTest_peaks") {
+  doRun(const std::string &OutputWorkspace = "IntegratePeaksMDHKLTest_peaks") {
     IntegratePeaksMDHKL alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
diff --git a/Framework/MDAlgorithms/test/IntegratePeaksMDTest.h b/Framework/MDAlgorithms/test/IntegratePeaksMDTest.h
index 857f85c65a2..167d9e8ab1e 100644
--- a/Framework/MDAlgorithms/test/IntegratePeaksMDTest.h
+++ b/Framework/MDAlgorithms/test/IntegratePeaksMDTest.h
@@ -48,10 +48,11 @@ public:
 
   //-------------------------------------------------------------------------------
   /** Run the IntegratePeaksMD with the given peak radius integration param */
-  static void doRun(double PeakRadius, double BackgroundRadius,
-                    std::string OutputWorkspace = "IntegratePeaksMDTest_peaks",
-                    double BackgroundStartRadius = 0.0, bool edge = true,
-                    bool cyl = false, std::string fnct = "NoFit") {
+  static void
+  doRun(double PeakRadius, double BackgroundRadius,
+        const std::string &OutputWorkspace = "IntegratePeaksMDTest_peaks",
+        double BackgroundStartRadius = 0.0, bool edge = true, bool cyl = false,
+        const std::string &fnct = "NoFit") {
     IntegratePeaksMD alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
diff --git a/Framework/MDAlgorithms/test/LoadMDTest.h b/Framework/MDAlgorithms/test/LoadMDTest.h
index bab2255eb40..6a83c2b735f 100644
--- a/Framework/MDAlgorithms/test/LoadMDTest.h
+++ b/Framework/MDAlgorithms/test/LoadMDTest.h
@@ -488,7 +488,7 @@ public:
   }
 
   /** Run SaveMD v1 with the MDHistoWorkspace */
-  void doTestHistoV1(MDHistoWorkspace_sptr ws) {
+  void doTestHistoV1(const MDHistoWorkspace_sptr &ws) {
     std::string filename = "SaveMDTestHisto.nxs";
 
     SaveMD alg1;
@@ -531,7 +531,7 @@ public:
   }
 
   /** Run SaveMD2 with the MDHistoWorkspace */
-  void doTestHisto(MDHistoWorkspace_sptr ws) {
+  void doTestHisto(const MDHistoWorkspace_sptr &ws) {
     std::string filename = "SaveMD2TestHisto.nxs";
 
     SaveMD2 alg1;
@@ -682,7 +682,7 @@ public:
   }
 
   Mantid::API::IMDWorkspace_sptr
-  testSaveAndLoadWorkspace(Mantid::API::IMDWorkspace_sptr inputWS,
+  testSaveAndLoadWorkspace(const Mantid::API::IMDWorkspace_sptr &inputWS,
                            const char *rootGroup,
                            const bool rmCoordField = false) {
     const std::string fileName = "SaveMDSpecialCoordinatesTest.nxs";
diff --git a/Framework/MDAlgorithms/test/LoadSQW2Test.h b/Framework/MDAlgorithms/test/LoadSQW2Test.h
index ad577885c83..afb097b986c 100644
--- a/Framework/MDAlgorithms/test/LoadSQW2Test.h
+++ b/Framework/MDAlgorithms/test/LoadSQW2Test.h
@@ -20,6 +20,7 @@
 #include <Poco/TemporaryFile.h>
 
 #include <array>
+#include <utility>
 
 using Mantid::API::ExperimentInfo;
 using Mantid::API::IAlgorithm;
@@ -159,7 +160,8 @@ private:
     SizeTList nbins;
   };
 
-  IMDEventWorkspace_sptr runAlgorithm(std::string filename, Arguments args) {
+  IMDEventWorkspace_sptr runAlgorithm(const std::string &filename,
+                                      const Arguments &args) {
     auto algm = createAlgorithm();
     algm->setProperty("Filename", filename);
     algm->setProperty("MetadataOnly", args.metadataOnly);
@@ -180,9 +182,9 @@ private:
   }
 
   void checkGeometryAsExpected(const IMDEventWorkspace &outputWS,
-                               std::string outputFrame, DataType dtype) {
+                               const std::string &outputFrame, DataType dtype) {
     TS_ASSERT_EQUALS(4, outputWS.getNumDims());
-    auto expectedDim = getExpectedDimProperties(outputFrame, dtype);
+    auto expectedDim = getExpectedDimProperties(std::move(outputFrame), dtype);
     for (size_t i = 0; i < 4; ++i) {
       auto dim = outputWS.getDimension(i);
       TS_ASSERT_EQUALS(expectedDim.ids[i], dim->getDimensionId());
@@ -196,7 +198,7 @@ private:
   }
 
   GNU_DIAG_OFF("missing-braces")
-  DimensionProperties getExpectedDimProperties(std::string outputFrame,
+  DimensionProperties getExpectedDimProperties(const std::string &outputFrame,
                                                DataType dtype) {
     DimensionProperties expected;
     expected.ids = {"qx", "qy", "qz", "en"};
@@ -297,8 +299,8 @@ private:
     TS_ASSERT_DELTA(0.0, vVec[2], 1e-04);
   }
 
-  void checkDataAsExpected(const IMDEventWorkspace &outputWS, Arguments args,
-                           DataType dtype) {
+  void checkDataAsExpected(const IMDEventWorkspace &outputWS,
+                           const Arguments &args, DataType dtype) {
     if (args.metadataOnly) {
       TS_ASSERT_EQUALS(0, outputWS.getNEvents());
     } else {
@@ -353,7 +355,7 @@ private:
   }
 
   void checkOutputFile(const IMDEventWorkspace &outputWS,
-                       std::string outputFilename) {
+                       const std::string &outputFilename) {
     TS_ASSERT(outputWS.isFileBacked());
     Poco::File fileback(outputFilename);
     TS_ASSERT(fileback.getSize() > 0);
diff --git a/Framework/MDAlgorithms/test/MergeMDFilesTest.h b/Framework/MDAlgorithms/test/MergeMDFilesTest.h
index 923f4a41b88..64db29a3036 100644
--- a/Framework/MDAlgorithms/test/MergeMDFilesTest.h
+++ b/Framework/MDAlgorithms/test/MergeMDFilesTest.h
@@ -32,7 +32,7 @@ public:
 
   void test_exec_fileBacked() { do_test_exec("MergeMDFilesTest_OutputWS.nxs"); }
 
-  void do_test_exec(std::string OutputFilename) {
+  void do_test_exec(const std::string &OutputFilename) {
     if (OutputFilename != "") {
       if (Poco::File(OutputFilename).exists())
         Poco::File(OutputFilename).remove();
diff --git a/Framework/MDAlgorithms/test/MultiplyMDTest.h b/Framework/MDAlgorithms/test/MultiplyMDTest.h
index d50d56c8f14..a59854b4203 100644
--- a/Framework/MDAlgorithms/test/MultiplyMDTest.h
+++ b/Framework/MDAlgorithms/test/MultiplyMDTest.h
@@ -61,7 +61,7 @@ public:
 
   /** Get a MDEventWorkspace and check that all events have the given
    * signal/error */
-  void checkMDEWSignal(std::string wsName, signal_t expectedSignal,
+  void checkMDEWSignal(const std::string &wsName, signal_t expectedSignal,
                        signal_t expectedError) {
     IMDEventWorkspace_sptr ws =
         AnalysisDataService::Instance().retrieveWS<IMDEventWorkspace>(wsName);
diff --git a/Framework/MDAlgorithms/test/QueryMDWorkspaceTest.h b/Framework/MDAlgorithms/test/QueryMDWorkspaceTest.h
index ace0a40c734..d012668da65 100644
--- a/Framework/MDAlgorithms/test/QueryMDWorkspaceTest.h
+++ b/Framework/MDAlgorithms/test/QueryMDWorkspaceTest.h
@@ -30,7 +30,7 @@ public:
 
   QueryMDWorkspaceTest() { FrameworkManager::Instance(); }
 
-  void checkInputs(std::string strNormalisation) {
+  void checkInputs(const std::string &strNormalisation) {
     MDEventWorkspace3Lean::sptr in_ws =
         MDEventsTestHelper::makeMDEW<3>(10, -10.0, 20.0, 3);
     QueryMDWorkspace query;
diff --git a/Framework/MDAlgorithms/test/RecalculateTrajectoriesExtentsTest.h b/Framework/MDAlgorithms/test/RecalculateTrajectoriesExtentsTest.h
index e7683d13ce7..c96e482de6a 100644
--- a/Framework/MDAlgorithms/test/RecalculateTrajectoriesExtentsTest.h
+++ b/Framework/MDAlgorithms/test/RecalculateTrajectoriesExtentsTest.h
@@ -34,8 +34,8 @@ public:
     delete suite;
   }
 
-  IMDEventWorkspace_sptr create_workspace(std::vector<double> extents,
-                                          std::string name) {
+  IMDEventWorkspace_sptr create_workspace(const std::vector<double> &extents,
+                                          const std::string &name) {
     // ---- empty MDEW ----
     TS_ASSERT_EQUALS(extents.size(), 6)
     CreateMDWorkspace algC;
@@ -76,7 +76,7 @@ public:
     TS_ASSERT(alg.isInitialized())
   }
 
-  void do_test(std::string name, std::vector<double> extents) {
+  void do_test(const std::string &name, std::vector<double> extents) {
     IMDEventWorkspace_sptr inputWS = create_workspace(extents, name);
 
     RecalculateTrajectoriesExtents alg;
diff --git a/Framework/MDAlgorithms/test/SaveMD2Test.h b/Framework/MDAlgorithms/test/SaveMD2Test.h
index fcc675a7a4f..1b45b7e3414 100644
--- a/Framework/MDAlgorithms/test/SaveMD2Test.h
+++ b/Framework/MDAlgorithms/test/SaveMD2Test.h
@@ -46,7 +46,7 @@ public:
     do_test_exec(23, "SaveMD2Test_updating.nxs", true, true);
   }
 
-  void do_test_exec(size_t numPerBox, std::string filename,
+  void do_test_exec(size_t numPerBox, const std::string &filename,
                     bool MakeFileBacked = false,
                     bool UpdateFileBackEnd = false) {
 
@@ -103,8 +103,8 @@ public:
   }
 
   /// Add some data and update the back-end
-  void do_test_UpdateFileBackEnd(MDEventWorkspace1Lean::sptr ws,
-                                 std::string filename) {
+  void do_test_UpdateFileBackEnd(const MDEventWorkspace1Lean::sptr &ws,
+                                 const std::string &filename) {
     size_t initial_numEvents = ws->getNPoints();
     TSM_ASSERT_EQUALS("Starting off with 230 events.", initial_numEvents, 230);
 
@@ -335,7 +335,7 @@ public:
   }
 
   /** Run SaveMD with the MDHistoWorkspace */
-  void doTestHisto(MDHistoWorkspace_sptr ws) {
+  void doTestHisto(const MDHistoWorkspace_sptr &ws) {
     std::string filename = "SaveMD2TestHisto.nxs";
 
     SaveMD2 alg;
diff --git a/Framework/MDAlgorithms/test/SaveMDTest.h b/Framework/MDAlgorithms/test/SaveMDTest.h
index 81e927489b5..aa73db31c62 100644
--- a/Framework/MDAlgorithms/test/SaveMDTest.h
+++ b/Framework/MDAlgorithms/test/SaveMDTest.h
@@ -50,7 +50,7 @@ public:
     do_test_exec(23, "SaveMDTest_other_file_name_test.nxs", true, false, true);
   }
 
-  void do_test_exec(size_t numPerBox, std::string filename,
+  void do_test_exec(size_t numPerBox, const std::string &filename,
                     bool MakeFileBacked = false, bool UpdateFileBackEnd = false,
                     bool OtherFileName = false) {
 
@@ -108,8 +108,8 @@ public:
   }
 
   /// Add some data and update the back-end
-  void do_test_UpdateFileBackEnd(MDEventWorkspace1Lean::sptr ws,
-                                 std::string filename) {
+  void do_test_UpdateFileBackEnd(const MDEventWorkspace1Lean::sptr &ws,
+                                 const std::string &filename) {
     size_t initial_numEvents = ws->getNPoints();
     TSM_ASSERT_EQUALS("Starting off with 230 events.", initial_numEvents, 230);
 
@@ -150,8 +150,8 @@ public:
       Poco::File(fullPath).remove();
   }
 
-  void do_test_OtherFileName(MDEventWorkspace1Lean::sptr ws,
-                             std::string originalFileName) {
+  void do_test_OtherFileName(const MDEventWorkspace1Lean::sptr &ws,
+                             const std::string &originalFileName) {
     const std::string otherFileName = "SaveMD_other_file_name.nxs";
 
     auto algSave = AlgorithmManager::Instance().createUnmanaged("SaveMD");
@@ -284,7 +284,7 @@ public:
   }
 
   /** Run SaveMD with the MDHistoWorkspace */
-  void doTestHisto(MDHistoWorkspace_sptr ws) {
+  void doTestHisto(const MDHistoWorkspace_sptr &ws) {
     std::string filename = "SaveMDTestHisto.nxs";
 
     SaveMD alg;
diff --git a/Framework/MDAlgorithms/test/SaveZODSTest.h b/Framework/MDAlgorithms/test/SaveZODSTest.h
index 6798349998a..41eb380be56 100644
--- a/Framework/MDAlgorithms/test/SaveZODSTest.h
+++ b/Framework/MDAlgorithms/test/SaveZODSTest.h
@@ -27,8 +27,8 @@ public:
     TS_ASSERT(alg.isInitialized())
   }
 
-  std::string do_test(std::string InputWorkspace, std::string Filename,
-                      bool expectSuccess = true) {
+  std::string do_test(const std::string &InputWorkspace,
+                      const std::string &Filename, bool expectSuccess = true) {
     SaveZODS alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
diff --git a/Framework/MDAlgorithms/test/SetMDUsingMaskTest.h b/Framework/MDAlgorithms/test/SetMDUsingMaskTest.h
index 8c22e846b14..238ddcdeebd 100644
--- a/Framework/MDAlgorithms/test/SetMDUsingMaskTest.h
+++ b/Framework/MDAlgorithms/test/SetMDUsingMaskTest.h
@@ -26,9 +26,10 @@ public:
     TS_ASSERT(alg.isInitialized())
   }
 
-  void do_test(std::string InputWorkspace, std::string MaskWorkspace,
-               std::string ValueWorkspace, std::string Value,
-               std::string OutputWorkspace, double expectedSignal,
+  void do_test(const std::string &InputWorkspace,
+               const std::string &MaskWorkspace,
+               const std::string &ValueWorkspace, const std::string &Value,
+               const std::string &OutputWorkspace, double expectedSignal,
                double expectedError, bool succeeds = true) {
     MDHistoWorkspace_sptr histo_A =
         MDEventsTestHelper::makeFakeMDHistoWorkspace(2.0, 2, 5, 10.0, 2.0);
diff --git a/Framework/MDAlgorithms/test/SliceMDTest.h b/Framework/MDAlgorithms/test/SliceMDTest.h
index e8a69d52565..7ad71cd97b5 100644
--- a/Framework/MDAlgorithms/test/SliceMDTest.h
+++ b/Framework/MDAlgorithms/test/SliceMDTest.h
@@ -144,7 +144,7 @@ public:
                      const uint64_t expectedNumPoints,
                      const size_t expectedNumDims, bool willFail,
                      const std::string &OutputFilename,
-                     IMDEventWorkspace_sptr in_ws) {
+                     const IMDEventWorkspace_sptr &in_ws) {
     SliceMD alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
@@ -210,7 +210,7 @@ public:
                     const std::string &name3, const std::string &name4,
                     const uint64_t expectedNumPoints,
                     const size_t expectedNumDims, bool willFail = false,
-                    std::string OutputFilename = "") {
+                    const std::string &OutputFilename = "") {
 
     Mantid::Geometry::QSample frame;
     IMDEventWorkspace_sptr in_ws =
diff --git a/Framework/MDAlgorithms/test/SlicingAlgorithmTest.h b/Framework/MDAlgorithms/test/SlicingAlgorithmTest.h
index cd540027941..3ca0c17dbec 100644
--- a/Framework/MDAlgorithms/test/SlicingAlgorithmTest.h
+++ b/Framework/MDAlgorithms/test/SlicingAlgorithmTest.h
@@ -594,10 +594,11 @@ public:
 
   //----------------------------------------------------------------------------
   std::unique_ptr<SlicingAlgorithmImpl> do_createGeneralTransform(
-      IMDEventWorkspace_sptr inWS, std::string name1, std::string name2,
-      std::string name3, std::string name4, VMD translation,
-      std::string extents, std::string numBins, bool ForceOrthogonal = false,
-      bool NormalizeBasisVectors = true) {
+      const IMDEventWorkspace_sptr &inWS, const std::string &name1,
+      const std::string &name2, const std::string &name3,
+      const std::string &name4, const VMD &translation,
+      const std::string &extents, const std::string &numBins,
+      bool ForceOrthogonal = false, bool NormalizeBasisVectors = true) {
     auto alg = std::make_unique<SlicingAlgorithmImpl>();
     alg->m_inWS = inWS;
     alg->initSlicingProps();
diff --git a/Framework/MDAlgorithms/test/ThresholdMDTest.h b/Framework/MDAlgorithms/test/ThresholdMDTest.h
index 590dd4479cf..64950aae136 100644
--- a/Framework/MDAlgorithms/test/ThresholdMDTest.h
+++ b/Framework/MDAlgorithms/test/ThresholdMDTest.h
@@ -51,7 +51,7 @@ public:
     TS_ASSERT(alg.isInitialized())
   }
 
-  IMDHistoWorkspace_sptr doExecute(IMDHistoWorkspace_sptr inWS,
+  IMDHistoWorkspace_sptr doExecute(const IMDHistoWorkspace_sptr &inWS,
                                    const std::string &condition,
                                    const double &referenceValue) {
     const std::string outWSName = "OutWS";
diff --git a/Framework/MDAlgorithms/test/TransformMDTest.h b/Framework/MDAlgorithms/test/TransformMDTest.h
index 2f75f3bbd86..5ab835d75b9 100644
--- a/Framework/MDAlgorithms/test/TransformMDTest.h
+++ b/Framework/MDAlgorithms/test/TransformMDTest.h
@@ -95,7 +95,7 @@ public:
   }
 
   //--------------------------------------------------------------------------------------------
-  void do_test_histo(MDHistoWorkspace_sptr ws1, bool inPlace = false) {
+  void do_test_histo(const MDHistoWorkspace_sptr &ws1, bool inPlace = false) {
     // Name of the output workspace.
     std::string outWSName("TransformMDTest_OutputWS");
     std::string inWSName("TransformMDTest_ws");
diff --git a/Framework/MDAlgorithms/test/UnaryOperationMDTest.h b/Framework/MDAlgorithms/test/UnaryOperationMDTest.h
index 14b0f2e9b65..24c153af76a 100644
--- a/Framework/MDAlgorithms/test/UnaryOperationMDTest.h
+++ b/Framework/MDAlgorithms/test/UnaryOperationMDTest.h
@@ -60,8 +60,8 @@ public:
   }
 
   /// Run the mock algorithm
-  void doTest(MockUnaryOperationMD &alg, std::string inName,
-              std::string outName, bool succeeds = true) {
+  void doTest(MockUnaryOperationMD &alg, const std::string &inName,
+              const std::string &outName, bool succeeds = true) {
     out.reset();
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
diff --git a/Framework/MDAlgorithms/test/WeightedMeanMDTest.h b/Framework/MDAlgorithms/test/WeightedMeanMDTest.h
index 1d91aca4e09..e836ac0fe72 100644
--- a/Framework/MDAlgorithms/test/WeightedMeanMDTest.h
+++ b/Framework/MDAlgorithms/test/WeightedMeanMDTest.h
@@ -45,8 +45,8 @@ private:
 
   /// Helper method to run the WeightedMean algorithm on two matrix workspaces
   /// and return the result.
-  MatrixWorkspace_sptr run_matrix_weighed_mean(MatrixWorkspace_sptr a,
-                                               MatrixWorkspace_sptr b,
+  MatrixWorkspace_sptr run_matrix_weighed_mean(const MatrixWorkspace_sptr &a,
+                                               const MatrixWorkspace_sptr &b,
                                                const std::string &name) {
     AnalysisDataServiceImpl &ADS = Mantid::API::AnalysisDataService::Instance();
     IAlgorithm *alg =
@@ -61,7 +61,8 @@ private:
   }
 
   /// Helper method to run input type validation checks.
-  void do_test_workspace_input_types(IMDWorkspace_sptr a, IMDWorkspace_sptr b) {
+  void do_test_workspace_input_types(const IMDWorkspace_sptr &a,
+                                     const IMDWorkspace_sptr &b) {
     WeightedMeanMD alg;
     alg.initialize();
 
diff --git a/Framework/Muon/inc/MantidMuon/ApplyMuonDetectorGroupPairing.h b/Framework/Muon/inc/MantidMuon/ApplyMuonDetectorGroupPairing.h
index ba1de51814f..ff6d99d2776 100644
--- a/Framework/Muon/inc/MantidMuon/ApplyMuonDetectorGroupPairing.h
+++ b/Framework/Muon/inc/MantidMuon/ApplyMuonDetectorGroupPairing.h
@@ -56,14 +56,16 @@ public:
 
   /// return a workspace for a pair of detector groups, specified in options.
   API::MatrixWorkspace_sptr
-  createPairWorkspaceManually(API::Workspace_sptr inputWS, const bool noRebin);
+  createPairWorkspaceManually(const API::Workspace_sptr &inputWS,
+                              const bool noRebin);
 
   /// Store the input properties in options.
   Muon::AnalysisOptions getUserInput();
 
   /// Set MuonProcess properties (input workspace and period properties).
   void
-  setMuonProcessPeriodProperties(IAlgorithm &alg, API::Workspace_sptr inputWS,
+  setMuonProcessPeriodProperties(IAlgorithm &alg,
+                                 const API::Workspace_sptr &inputWS,
                                  const Muon::AnalysisOptions &options) const;
 
   /// Set MuonProcess properties according to the given options.
@@ -72,10 +74,9 @@ public:
                                     const Muon::AnalysisOptions &options) const;
 
   /// Apply the asymmetry calculation to two workspaces.
-  API::MatrixWorkspace_sptr
-  createPairWorkspaceFromGroupWorkspaces(API::MatrixWorkspace_sptr inputWS1,
-                                         API::MatrixWorkspace_sptr inputWS2,
-                                         const double &alpha);
+  API::MatrixWorkspace_sptr createPairWorkspaceFromGroupWorkspaces(
+      const API::MatrixWorkspace_sptr &inputWS1,
+      const API::MatrixWorkspace_sptr &inputWS2, const double &alpha);
 
   /// Set grouping properties of MuonProcess
   void setMuonProcessAlgorithmGroupingProperties(
diff --git a/Framework/Muon/inc/MantidMuon/ApplyMuonDetectorGrouping.h b/Framework/Muon/inc/MantidMuon/ApplyMuonDetectorGrouping.h
index 09630bd81cd..4f6256f9a86 100644
--- a/Framework/Muon/inc/MantidMuon/ApplyMuonDetectorGrouping.h
+++ b/Framework/Muon/inc/MantidMuon/ApplyMuonDetectorGrouping.h
@@ -59,9 +59,9 @@ private:
   void clipXRangeToWorkspace(const API::WorkspaceGroup &ws,
                              Muon::AnalysisOptions &options);
   /// Creates and analyses a workspace, if noRebin does not rebin.
-  API::Workspace_sptr createAnalysisWorkspace(API::Workspace_sptr inputWS,
-                                              bool noRebin,
-                                              Muon::AnalysisOptions options);
+  API::Workspace_sptr
+  createAnalysisWorkspace(const API::Workspace_sptr &inputWS, bool noRebin,
+                          Muon::AnalysisOptions options);
   /// Sets algorithm properties according to options.
   void setMuonProcessAlgorithmProperties(API::IAlgorithm &alg,
                                          const AnalysisOptions &options) const;
@@ -70,7 +70,7 @@ private:
   /// MuonProcess.
   void
   setMuonProcessPeriodProperties(API::IAlgorithm &alg,
-                                 API::Workspace_sptr inputWS,
+                                 const API::Workspace_sptr &inputWS,
                                  const Muon::AnalysisOptions &options) const;
 
   void setMuonProcessAlgorithmOutputTypeProperty(
diff --git a/Framework/Muon/inc/MantidMuon/CalMuonDetectorPhases.h b/Framework/Muon/inc/MantidMuon/CalMuonDetectorPhases.h
index 4a00123c04c..018a1393e80 100644
--- a/Framework/Muon/inc/MantidMuon/CalMuonDetectorPhases.h
+++ b/Framework/Muon/inc/MantidMuon/CalMuonDetectorPhases.h
@@ -57,7 +57,8 @@ private:
   removeExpDecay(const API::MatrixWorkspace_sptr &wsInput);
   /// Fit the workspace
   void fitWorkspace(const API::MatrixWorkspace_sptr &ws, double freq,
-                    std::string groupName, API::ITableWorkspace_sptr resTab,
+                    const std::string &groupName,
+                    const API::ITableWorkspace_sptr &resTab,
                     API::WorkspaceGroup_sptr &resGroup);
   /// Create the fitting function as string
   std::string createFittingFunction(double freq, bool fixFreq);
diff --git a/Framework/Muon/inc/MantidMuon/CalculateMuonAsymmetry.h b/Framework/Muon/inc/MantidMuon/CalculateMuonAsymmetry.h
index 06d2101dccf..5fe014f469c 100644
--- a/Framework/Muon/inc/MantidMuon/CalculateMuonAsymmetry.h
+++ b/Framework/Muon/inc/MantidMuon/CalculateMuonAsymmetry.h
@@ -69,10 +69,10 @@ private:
   void init() override;
   void exec() override;
   // calculate Muon normalisation constant
-  std::vector<double> getNormConstants(std::vector<std::string> wsNames);
+  std::vector<double> getNormConstants(const std::vector<std::string> &wsNames);
   std::map<std::string, std::string> validateInputs() override;
   double getNormValue(API::CompositeFunction_sptr &func);
-  void addNormalizedFits(size_t numberOfFits, const std::vector<double>);
+  void addNormalizedFits(size_t numberOfFits, const std::vector<double> &);
   void normalizeWorkspace(
       const API::MatrixWorkspace_sptr &normalizedWorkspace,
       const API::MatrixWorkspace_const_sptr &unnormalizedWorkspace,
diff --git a/Framework/Muon/inc/MantidMuon/LoadAndApplyMuonDetectorGrouping.h b/Framework/Muon/inc/MantidMuon/LoadAndApplyMuonDetectorGrouping.h
index 484263f8305..a7b9ec57c75 100644
--- a/Framework/Muon/inc/MantidMuon/LoadAndApplyMuonDetectorGrouping.h
+++ b/Framework/Muon/inc/MantidMuon/LoadAndApplyMuonDetectorGrouping.h
@@ -61,14 +61,14 @@ private:
   /// Add all the supplied groups to the ADS, inside wsGrouped, by
   /// executing the ApplyMuonDetectorGrouping algorithm
   void addGroupingToADS(const Mantid::Muon::AnalysisOptions &options,
-                        Mantid::API::Workspace_sptr ws,
-                        Mantid::API::WorkspaceGroup_sptr wsGrouped);
+                        const Mantid::API::Workspace_sptr &ws,
+                        const Mantid::API::WorkspaceGroup_sptr &wsGrouped);
 
   /// Add all the supplied pairs to the ADS, inside wsGrouped, by
   /// executing the ApplyMuonDetectorGroupPairing algorithm
   void addPairingToADS(const Mantid::Muon::AnalysisOptions &options,
-                       Mantid::API::Workspace_sptr ws,
-                       Mantid::API::WorkspaceGroup_sptr wsGrouped);
+                       const Mantid::API::Workspace_sptr &ws,
+                       const Mantid::API::WorkspaceGroup_sptr &wsGrouped);
 
   void addGroupingInformationToADS(const Mantid::API::Grouping &grouping);
 
@@ -87,8 +87,9 @@ private:
   /// are paired are also included as groups.
   void CheckValidGroupsAndPairs(const Mantid::API::Grouping &grouping);
 
-  void getTimeLimitsFromInputWorkspace(Mantid::API::Workspace_sptr inputWS,
-                                       Mantid::Muon::AnalysisOptions &options);
+  void
+  getTimeLimitsFromInputWorkspace(const Mantid::API::Workspace_sptr &inputWS,
+                                  Mantid::Muon::AnalysisOptions &options);
 
   void getTimeLimitsFromInputs(AnalysisOptions &options);
 };
diff --git a/Framework/Muon/inc/MantidMuon/MuonAlgorithmHelper.h b/Framework/Muon/inc/MantidMuon/MuonAlgorithmHelper.h
index cf83755b300..7e22e0efeca 100644
--- a/Framework/Muon/inc/MantidMuon/MuonAlgorithmHelper.h
+++ b/Framework/Muon/inc/MantidMuon/MuonAlgorithmHelper.h
@@ -55,7 +55,7 @@ namespace MuonAlgorithmHelper {
 
 /// Returns a first period MatrixWorkspace in a run workspace
 MANTID_MUON_DLL Mantid::API::MatrixWorkspace_sptr
-firstPeriod(API::Workspace_sptr ws);
+firstPeriod(const API::Workspace_sptr &ws);
 
 /// Get a run label for a workspace
 MANTID_MUON_DLL std::string getRunLabel(API::Workspace_sptr ws);
@@ -89,15 +89,15 @@ generateWorkspaceName(const Muon::DatasetParams &params);
 /// Find all the detector IDs contained inside a workspace (either matrix or
 /// group) and return as an ordered set.
 MANTID_MUON_DLL std::set<Mantid::detid_t>
-getAllDetectorIDsFromWorkspace(Mantid::API::Workspace_sptr ws);
+getAllDetectorIDsFromWorkspace(const Mantid::API::Workspace_sptr &ws);
 
 /// Find all the detector IDs contained inside a group workspace
 MANTID_MUON_DLL std::set<Mantid::detid_t>
-getAllDetectorIDsFromGroupWorkspace(Mantid::API::WorkspaceGroup_sptr ws);
+getAllDetectorIDsFromGroupWorkspace(const Mantid::API::WorkspaceGroup_sptr &ws);
 
 /// Find all the detector IDs contained inside a matrix workspace
-MANTID_MUON_DLL std::set<Mantid::detid_t>
-getAllDetectorIDsFromMatrixWorkspace(Mantid::API::MatrixWorkspace_sptr ws);
+MANTID_MUON_DLL std::set<Mantid::detid_t> getAllDetectorIDsFromMatrixWorkspace(
+    const Mantid::API::MatrixWorkspace_sptr &ws);
 
 /// Find all the detector IDs contained inside a grouping object and return as a
 /// vector of ints
@@ -108,7 +108,7 @@ getAllDetectorIDsFromGroup(const API::Grouping &grouping);
 /// workspace. Workspace can be matrix or group type.
 MANTID_MUON_DLL bool
 checkGroupDetectorsInWorkspace(const API::Grouping &grouping,
-                               API::Workspace_sptr ws);
+                               const API::Workspace_sptr &ws);
 
 /// Checks that all of the entries of a vector are contained in a set.
 MANTID_MUON_DLL bool checkItemsInSet(const std::vector<int> &items,
@@ -142,9 +142,9 @@ subtractWorkspaces(const Mantid::API::MatrixWorkspace_sptr &lhs,
 MANTID_MUON_DLL Mantid::API::MatrixWorkspace_sptr
 extractSpectrum(const Mantid::API::Workspace_sptr &inputWS, const int index);
 
-MANTID_MUON_DLL void addSampleLog(Mantid::API::MatrixWorkspace_sptr workspace,
-                                  const std::string &logName,
-                                  const std::string &logValue);
+MANTID_MUON_DLL void
+addSampleLog(const Mantid::API::MatrixWorkspace_sptr &workspace,
+             const std::string &logName, const std::string &logValue);
 
 MANTID_MUON_DLL bool isAlphanumericOrUnderscore(char character);
 
diff --git a/Framework/Muon/inc/MantidMuon/MuonGroupingAsymmetry.h b/Framework/Muon/inc/MantidMuon/MuonGroupingAsymmetry.h
index 9a9f4dbbb86..60c713dd299 100644
--- a/Framework/Muon/inc/MantidMuon/MuonGroupingAsymmetry.h
+++ b/Framework/Muon/inc/MantidMuon/MuonGroupingAsymmetry.h
@@ -44,9 +44,9 @@ private:
 
   std::map<std::string, std::string> validateInputs() override;
 
-  WorkspaceGroup_sptr createGroupWorkspace(WorkspaceGroup_sptr inputWS);
+  WorkspaceGroup_sptr createGroupWorkspace(const WorkspaceGroup_sptr &inputWS);
 
-  void addGroupingAsymmetrySampleLogs(MatrixWorkspace_sptr workspace);
+  void addGroupingAsymmetrySampleLogs(const MatrixWorkspace_sptr &workspace);
 };
 
 } // namespace Muon
diff --git a/Framework/Muon/inc/MantidMuon/MuonGroupingCounts.h b/Framework/Muon/inc/MantidMuon/MuonGroupingCounts.h
index 32bf5f020b8..59caf162073 100644
--- a/Framework/Muon/inc/MantidMuon/MuonGroupingCounts.h
+++ b/Framework/Muon/inc/MantidMuon/MuonGroupingCounts.h
@@ -42,7 +42,7 @@ private:
   void init() override;
   void exec() override;
 
-  void setGroupingSampleLogs(MatrixWorkspace_sptr workspace);
+  void setGroupingSampleLogs(const MatrixWorkspace_sptr &workspace);
 };
 
 } // namespace Muon
diff --git a/Framework/Muon/inc/MantidMuon/MuonPairingAsymmetry.h b/Framework/Muon/inc/MantidMuon/MuonPairingAsymmetry.h
index 671b2263661..2df71cb4fd1 100644
--- a/Framework/Muon/inc/MantidMuon/MuonPairingAsymmetry.h
+++ b/Framework/Muon/inc/MantidMuon/MuonPairingAsymmetry.h
@@ -47,27 +47,27 @@ private:
   std::map<std::string, std::string> validateInputs() override;
   void validateManualGroups(std::map<std::string, std::string> &errors);
   void validateGroupsWorkspaces(std::map<std::string, std::string> &errors);
-  void validatePeriods(WorkspaceGroup_sptr inputWS,
+  void validatePeriods(const WorkspaceGroup_sptr &inputWS,
                        std::map<std::string, std::string> &errors);
 
-  WorkspaceGroup_sptr createGroupWorkspace(WorkspaceGroup_sptr inputWS);
-  MatrixWorkspace_sptr appendSpectra(MatrixWorkspace_sptr inputWS1,
-                                     MatrixWorkspace_sptr inputWS2);
+  WorkspaceGroup_sptr createGroupWorkspace(const WorkspaceGroup_sptr &inputWS);
+  MatrixWorkspace_sptr appendSpectra(const MatrixWorkspace_sptr &inputWS1,
+                                     const MatrixWorkspace_sptr &inputWS2);
 
   /// Perform an asymmetry calculation
-  MatrixWorkspace_sptr pairAsymmetryCalc(MatrixWorkspace_sptr inputWS,
+  MatrixWorkspace_sptr pairAsymmetryCalc(const MatrixWorkspace_sptr &inputWS,
                                          const double &alpha);
   MatrixWorkspace_sptr calcPairAsymmetryWithSummedAndSubtractedPeriods(
       const std::vector<int> &summedPeriods,
       const std::vector<int> &subtractedPeriods,
-      WorkspaceGroup_sptr groupedPeriods, const double &alpha);
+      const WorkspaceGroup_sptr &groupedPeriods, const double &alpha);
 
   /// Execute the algorithm if "SpecifyGroupsManually" is checked
   MatrixWorkspace_sptr execSpecifyGroupsManually();
 
   MatrixWorkspace_sptr execGroupWorkspaceInput();
 
-  void setPairAsymmetrySampleLogs(MatrixWorkspace_sptr workspace);
+  void setPairAsymmetrySampleLogs(const MatrixWorkspace_sptr &workspace);
 };
 
 } // namespace Muon
diff --git a/Framework/Muon/inc/MantidMuon/MuonPreProcess.h b/Framework/Muon/inc/MantidMuon/MuonPreProcess.h
index 84441fe2c9c..70b2407de69 100644
--- a/Framework/Muon/inc/MantidMuon/MuonPreProcess.h
+++ b/Framework/Muon/inc/MantidMuon/MuonPreProcess.h
@@ -45,11 +45,11 @@ private:
   void exec() override;
 
   /// Apply a series of corrections ; DTC, offset, rebin, crop
-  WorkspaceGroup_sptr correctWorkspaces(WorkspaceGroup_sptr wsGroup);
+  WorkspaceGroup_sptr correctWorkspaces(const WorkspaceGroup_sptr &wsGroup);
   MatrixWorkspace_sptr correctWorkspace(MatrixWorkspace_sptr ws);
 
   MatrixWorkspace_sptr applyDTC(MatrixWorkspace_sptr ws,
-                                TableWorkspace_sptr dt);
+                                const TableWorkspace_sptr &dt);
 
   MatrixWorkspace_sptr applyTimeOffset(MatrixWorkspace_sptr ws,
                                        const double &offset);
@@ -60,10 +60,10 @@ private:
   MatrixWorkspace_sptr applyRebinning(MatrixWorkspace_sptr ws,
                                       const std::vector<double> &rebinArgs);
 
-  MatrixWorkspace_sptr cloneWorkspace(MatrixWorkspace_sptr ws);
+  MatrixWorkspace_sptr cloneWorkspace(const MatrixWorkspace_sptr &ws);
 
   /// Add the correction inputs into the logs
-  void addPreProcessSampleLogs(WorkspaceGroup_sptr group);
+  void addPreProcessSampleLogs(const WorkspaceGroup_sptr &group);
 
   /// Perform validation of inputs to the algorithm
   std::map<std::string, std::string> validateInputs() override;
diff --git a/Framework/Muon/inc/MantidMuon/PlotAsymmetryByLogValue.h b/Framework/Muon/inc/MantidMuon/PlotAsymmetryByLogValue.h
index a45994979e0..9eebe959a52 100644
--- a/Framework/Muon/inc/MantidMuon/PlotAsymmetryByLogValue.h
+++ b/Framework/Muon/inc/MantidMuon/PlotAsymmetryByLogValue.h
@@ -67,7 +67,7 @@ private:
   // Load run, apply dead time corrections and detector grouping
   API::Workspace_sptr doLoad(size_t runNumber);
   // Analyse loaded run
-  void doAnalysis(API::Workspace_sptr loadedWs, size_t index);
+  void doAnalysis(const API::Workspace_sptr &loadedWs, size_t index);
   // Parse run names
   void parseRunNames(std::string &firstFN, std::string &lastFN,
                      std::string &fnBase, std::string &fnExt, int &fnZeros);
@@ -83,10 +83,11 @@ private:
   void groupDetectors(API::Workspace_sptr &loadedWs,
                       API::Workspace_sptr grouping);
   /// Calculate the integral asymmetry for a workspace (single period)
-  void calcIntAsymmetry(API::MatrixWorkspace_sptr ws, double &Y, double &E);
+  void calcIntAsymmetry(const API::MatrixWorkspace_sptr &ws, double &Y,
+                        double &E);
   /// Calculate the integral asymmetry for a workspace (red & green)
-  void calcIntAsymmetry(API::MatrixWorkspace_sptr ws_red,
-                        API::MatrixWorkspace_sptr ws_green, double &Y,
+  void calcIntAsymmetry(const API::MatrixWorkspace_sptr &ws_red,
+                        const API::MatrixWorkspace_sptr &ws_green, double &Y,
                         double &E);
   /// Group detectors
   void groupDetectors(API::MatrixWorkspace_sptr &ws,
diff --git a/Framework/Muon/inc/MantidMuon/RRFMuon.h b/Framework/Muon/inc/MantidMuon/RRFMuon.h
index 793a0abd6da..54ce32546cb 100644
--- a/Framework/Muon/inc/MantidMuon/RRFMuon.h
+++ b/Framework/Muon/inc/MantidMuon/RRFMuon.h
@@ -43,7 +43,7 @@ private:
   /// Run the algorithm
   void exec() override;
   /// Get conversion factor from frequency units to input workspace units
-  double unitConversionFactor(std::string uin, std::string uuser);
+  double unitConversionFactor(const std::string &uin, const std::string &uuser);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Muon/inc/MantidMuon/RemoveExpDecay.h b/Framework/Muon/inc/MantidMuon/RemoveExpDecay.h
index 9327fa0404b..03b02418ad0 100644
--- a/Framework/Muon/inc/MantidMuon/RemoveExpDecay.h
+++ b/Framework/Muon/inc/MantidMuon/RemoveExpDecay.h
@@ -56,7 +56,8 @@ private:
   HistogramData::Histogram
   removeDecay(const HistogramData::Histogram &histogram) const;
   // calculate Muon normalisation constant
-  double calNormalisationConst(API::MatrixWorkspace_sptr ws, int wsIndex);
+  double calNormalisationConst(const API::MatrixWorkspace_sptr &ws,
+                               int wsIndex);
 };
 
 } // namespace Algorithms
diff --git a/Framework/Muon/src/ApplyMuonDetectorGroupPairing.cpp b/Framework/Muon/src/ApplyMuonDetectorGroupPairing.cpp
index 7406f76e62c..7a26b99d096 100644
--- a/Framework/Muon/src/ApplyMuonDetectorGroupPairing.cpp
+++ b/Framework/Muon/src/ApplyMuonDetectorGroupPairing.cpp
@@ -22,6 +22,8 @@
 #include <algorithm>
 #include <cctype>
 #include <string>
+#include <utility>
+
 #include <vector>
 
 const std::vector<std::string> g_analysisTypes = {"Counts", "Asymmetry"};
@@ -340,7 +342,7 @@ const std::string ApplyMuonDetectorGroupPairing::getGroupWorkspaceNamesManually(
  */
 MatrixWorkspace_sptr
 ApplyMuonDetectorGroupPairing::createPairWorkspaceFromGroupWorkspaces(
-    MatrixWorkspace_sptr inputWS1, MatrixWorkspace_sptr inputWS2,
+    const MatrixWorkspace_sptr &inputWS1, const MatrixWorkspace_sptr &inputWS2,
     const double &alpha) {
 
   IAlgorithm_sptr alg = this->createChildAlgorithm("AppendSpectra");
@@ -372,7 +374,7 @@ ApplyMuonDetectorGroupPairing::createPairWorkspaceFromGroupWorkspaces(
  * options.
  */
 MatrixWorkspace_sptr ApplyMuonDetectorGroupPairing::createPairWorkspaceManually(
-    Workspace_sptr inputWS, bool noRebin) {
+    const Workspace_sptr &inputWS, bool noRebin) {
 
   IAlgorithm_sptr alg = this->createChildAlgorithm("MuonProcess");
   if (!this->isLogging())
@@ -427,8 +429,8 @@ Muon::AnalysisOptions ApplyMuonDetectorGroupPairing::getUserInput() {
 // Checks that the detector IDs in grouping are in the workspace
 void ApplyMuonDetectorGroupPairing::checkDetectorIDsInWorkspace(
     API::Grouping &grouping, Workspace_sptr workspace) {
-  bool check =
-      MuonAlgorithmHelper::checkGroupDetectorsInWorkspace(grouping, workspace);
+  bool check = MuonAlgorithmHelper::checkGroupDetectorsInWorkspace(
+      grouping, std::move(workspace));
   if (!check) {
     g_log.error("One or more detector IDs specified in the groups is not "
                 "contained in the InputWorkspace");
@@ -443,7 +445,7 @@ void ApplyMuonDetectorGroupPairing::checkDetectorIDsInWorkspace(
  * to the given options. For use with MuonProcess.
  */
 void ApplyMuonDetectorGroupPairing::setMuonProcessPeriodProperties(
-    IAlgorithm &alg, Workspace_sptr inputWS,
+    IAlgorithm &alg, const Workspace_sptr &inputWS,
     const Muon::AnalysisOptions &options) const {
 
   auto inputGroup = boost::make_shared<WorkspaceGroup>();
diff --git a/Framework/Muon/src/ApplyMuonDetectorGrouping.cpp b/Framework/Muon/src/ApplyMuonDetectorGrouping.cpp
index 6d129b7a2a0..02fca46359c 100644
--- a/Framework/Muon/src/ApplyMuonDetectorGrouping.cpp
+++ b/Framework/Muon/src/ApplyMuonDetectorGrouping.cpp
@@ -19,6 +19,8 @@
 #include <algorithm>
 #include <cctype>
 #include <string>
+#include <utility>
+
 #include <vector>
 
 const std::vector<std::string> g_analysisTypes = {"Counts", "Asymmetry"};
@@ -44,7 +46,7 @@ Mantid::Muon::PlotType getPlotType(const std::string &plotType) {
  * single period otherwise leave it alone.
  */
 Mantid::API::WorkspaceGroup_sptr
-convertInputWStoWSGroup(Mantid::API::Workspace_sptr inputWS) {
+convertInputWStoWSGroup(const Mantid::API::Workspace_sptr &inputWS) {
 
   // Cast input WS to a WorkspaceGroup
   auto muonWS = boost::make_shared<Mantid::API::WorkspaceGroup>();
@@ -317,7 +319,8 @@ void ApplyMuonDetectorGrouping::clipXRangeToWorkspace(
  * Creates workspace, processing the data using the MuonProcess algorithm.
  */
 Workspace_sptr ApplyMuonDetectorGrouping::createAnalysisWorkspace(
-    Workspace_sptr inputWS, bool noRebin, Muon::AnalysisOptions options) {
+    const Workspace_sptr &inputWS, bool noRebin,
+    Muon::AnalysisOptions options) {
 
   IAlgorithm_sptr alg = Algorithm::createChildAlgorithm("MuonProcess");
 
@@ -325,7 +328,7 @@ Workspace_sptr ApplyMuonDetectorGrouping::createAnalysisWorkspace(
     options.rebinArgs = "";
   }
 
-  setMuonProcessPeriodProperties(*alg, inputWS, options);
+  setMuonProcessPeriodProperties(*alg, std::move(inputWS), options);
   setMuonProcessAlgorithmProperties(*alg, options);
   alg->setPropertyValue("OutputWorkspace", "__NotUsed__");
   alg->execute();
@@ -350,7 +353,7 @@ bool ApplyMuonDetectorGrouping::renameAndMoveUnNormWorkspace(
  * to the given options. For use with MuonProcess.
  */
 void ApplyMuonDetectorGrouping::setMuonProcessPeriodProperties(
-    IAlgorithm &alg, Workspace_sptr inputWS,
+    IAlgorithm &alg, const Workspace_sptr &inputWS,
     const Muon::AnalysisOptions &options) const {
 
   auto inputGroup = boost::make_shared<WorkspaceGroup>();
diff --git a/Framework/Muon/src/CalMuonDetectorPhases.cpp b/Framework/Muon/src/CalMuonDetectorPhases.cpp
index 3f0f0940673..9788d4f3253 100644
--- a/Framework/Muon/src/CalMuonDetectorPhases.cpp
+++ b/Framework/Muon/src/CalMuonDetectorPhases.cpp
@@ -152,10 +152,10 @@ void CalMuonDetectorPhases::exec() {
  * @param resTab :: [output] Table workspace storing the asymmetries and phases
  * @param resGroup :: [output] Workspace group storing the fitting results
  */
-void CalMuonDetectorPhases::fitWorkspace(const API::MatrixWorkspace_sptr &ws,
-                                         double freq, std::string groupName,
-                                         API::ITableWorkspace_sptr resTab,
-                                         API::WorkspaceGroup_sptr &resGroup) {
+void CalMuonDetectorPhases::fitWorkspace(
+    const API::MatrixWorkspace_sptr &ws, double freq,
+    const std::string &groupName, const API::ITableWorkspace_sptr &resTab,
+    API::WorkspaceGroup_sptr &resGroup) {
 
   auto nhist = static_cast<int>(ws->getNumberHistograms());
 
diff --git a/Framework/Muon/src/CalculateMuonAsymmetry.cpp b/Framework/Muon/src/CalculateMuonAsymmetry.cpp
index 6b24c51409c..d4f26063172 100644
--- a/Framework/Muon/src/CalculateMuonAsymmetry.cpp
+++ b/Framework/Muon/src/CalculateMuonAsymmetry.cpp
@@ -228,7 +228,7 @@ void CalculateMuonAsymmetry::exec() {
  * @return normalization constants
  */
 void CalculateMuonAsymmetry::addNormalizedFits(
-    size_t numberOfFits, const std::vector<double> norms) {
+    size_t numberOfFits, const std::vector<double> &norms) {
   for (size_t j = 0; j < numberOfFits; j++) {
     API::Workspace_sptr fitWorkspace = getProperty("OutputWorkspace");
     API::MatrixWorkspace_sptr fitWorkspaceActual;
@@ -279,7 +279,7 @@ void CalculateMuonAsymmetry::addNormalizedFits(
  * @return normalization constants
  */
 std::vector<double> CalculateMuonAsymmetry::getNormConstants(
-    const std::vector<std::string> wsNames) {
+    const std::vector<std::string> &wsNames) {
   std::vector<double> norms;
   double startX = getProperty("StartX");
   double endX = getProperty("EndX");
diff --git a/Framework/Muon/src/LoadAndApplyMuonDetectorGrouping.cpp b/Framework/Muon/src/LoadAndApplyMuonDetectorGrouping.cpp
index a6cc50655d6..6a2627176ca 100644
--- a/Framework/Muon/src/LoadAndApplyMuonDetectorGrouping.cpp
+++ b/Framework/Muon/src/LoadAndApplyMuonDetectorGrouping.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidMuon/LoadAndApplyMuonDetectorGrouping.h"
 #include "MantidMuon/MuonAlgorithmHelper.h"
 
@@ -198,7 +200,7 @@ LoadAndApplyMuonDetectorGrouping::validateInputs() {
 }
 
 void LoadAndApplyMuonDetectorGrouping::getTimeLimitsFromInputWorkspace(
-    Workspace_sptr inputWS, AnalysisOptions &options) {
+    const Workspace_sptr &inputWS, AnalysisOptions &options) {
   MatrixWorkspace_sptr inputMatrixWS =
       boost::dynamic_pointer_cast<MatrixWorkspace>(inputWS);
   WorkspaceGroup_sptr inputGroupWS =
@@ -268,8 +270,8 @@ void LoadAndApplyMuonDetectorGrouping::exec() {
 // Checks that the detector IDs in grouping are in the workspace
 void LoadAndApplyMuonDetectorGrouping::checkDetectorIDsInWorkspace(
     API::Grouping &grouping, Workspace_sptr workspace) {
-  bool check =
-      MuonAlgorithmHelper::checkGroupDetectorsInWorkspace(grouping, workspace);
+  bool check = MuonAlgorithmHelper::checkGroupDetectorsInWorkspace(
+      grouping, std::move(workspace));
   if (!check) {
     g_log.error("One or more detector IDs specified in the groups is not "
                 "contained in the InputWorkspace");
@@ -288,7 +290,8 @@ WorkspaceGroup_sptr
 LoadAndApplyMuonDetectorGrouping::addGroupedWSWithDefaultName(
     Workspace_sptr workspace) {
   auto &ads = AnalysisDataService::Instance();
-  std::string groupedWSName = MuonAlgorithmHelper::getRunLabel(workspace);
+  std::string groupedWSName =
+      MuonAlgorithmHelper::getRunLabel(std::move(workspace));
 
   WorkspaceGroup_sptr groupedWS;
   if (ads.doesExist(groupedWSName)) {
@@ -388,8 +391,8 @@ void LoadAndApplyMuonDetectorGrouping::CheckValidGroupsAndPairs(
  */
 void LoadAndApplyMuonDetectorGrouping::addGroupingToADS(
     const Mantid::Muon::AnalysisOptions &options,
-    Mantid::API::Workspace_sptr ws,
-    Mantid::API::WorkspaceGroup_sptr wsGrouped) {
+    const Mantid::API::Workspace_sptr &ws,
+    const Mantid::API::WorkspaceGroup_sptr &wsGrouped) {
 
   size_t numGroups = options.grouping.groups.size();
   for (auto i = 0u; i < numGroups; ++i) {
@@ -426,8 +429,8 @@ void LoadAndApplyMuonDetectorGrouping::addGroupingToADS(
  */
 void LoadAndApplyMuonDetectorGrouping::addPairingToADS(
     const Mantid::Muon::AnalysisOptions &options,
-    Mantid::API::Workspace_sptr ws,
-    Mantid::API::WorkspaceGroup_sptr wsGrouped) {
+    const Mantid::API::Workspace_sptr &ws,
+    const Mantid::API::WorkspaceGroup_sptr &wsGrouped) {
 
   size_t numPairs = options.grouping.pairs.size();
   for (size_t i = 0; i < numPairs; i++) {
diff --git a/Framework/Muon/src/MuonAlgorithmHelper.cpp b/Framework/Muon/src/MuonAlgorithmHelper.cpp
index 6e0e93e477c..f04f4c25d95 100644
--- a/Framework/Muon/src/MuonAlgorithmHelper.cpp
+++ b/Framework/Muon/src/MuonAlgorithmHelper.cpp
@@ -15,6 +15,8 @@
 
 #include <fstream>
 #include <string>
+#include <utility>
+
 #include <vector>
 
 namespace Mantid {
@@ -28,7 +30,7 @@ using namespace Mantid::API;
  * workspace has one period only - it is returned.
  * @param ws :: Run workspace
  */
-MatrixWorkspace_sptr firstPeriod(Workspace_sptr ws) {
+MatrixWorkspace_sptr firstPeriod(const Workspace_sptr &ws) {
 
   if (auto group = boost::dynamic_pointer_cast<WorkspaceGroup>(ws)) {
     return boost::dynamic_pointer_cast<MatrixWorkspace>(group->getItem(0));
@@ -43,7 +45,7 @@ MatrixWorkspace_sptr firstPeriod(Workspace_sptr ws) {
  * @return :: run label
  */
 std::string getRunLabel(Mantid::API::Workspace_sptr ws) {
-  const std::vector<Mantid::API::Workspace_sptr> wsList{ws};
+  const std::vector<Mantid::API::Workspace_sptr> wsList{std::move(ws)};
   return getRunLabel(wsList);
 }
 
@@ -282,7 +284,7 @@ std::string generateWorkspaceName(const Muon::DatasetParams &params) {
  * group) and return as an ordered set.
  */
 std::set<Mantid::detid_t>
-getAllDetectorIDsFromWorkspace(Mantid::API::Workspace_sptr ws) {
+getAllDetectorIDsFromWorkspace(const Mantid::API::Workspace_sptr &ws) {
 
   std::set<Mantid::detid_t> detectorIDs;
   if (auto workspace = boost::dynamic_pointer_cast<MatrixWorkspace>(ws)) {
@@ -296,8 +298,8 @@ getAllDetectorIDsFromWorkspace(Mantid::API::Workspace_sptr ws) {
 /**
  * Find all the detector IDs contained inside a matrix workspace
  */
-std::set<Mantid::detid_t>
-getAllDetectorIDsFromMatrixWorkspace(Mantid::API::MatrixWorkspace_sptr ws) {
+std::set<Mantid::detid_t> getAllDetectorIDsFromMatrixWorkspace(
+    const Mantid::API::MatrixWorkspace_sptr &ws) {
 
   std::set<Mantid::detid_t> detectorIDs;
   std::set<Mantid::detid_t> spectrumIDs;
@@ -312,8 +314,8 @@ getAllDetectorIDsFromMatrixWorkspace(Mantid::API::MatrixWorkspace_sptr ws) {
 /**
  * Find all the detector IDs contained inside a group workspace
  */
-std::set<Mantid::detid_t>
-getAllDetectorIDsFromGroupWorkspace(Mantid::API::WorkspaceGroup_sptr ws) {
+std::set<Mantid::detid_t> getAllDetectorIDsFromGroupWorkspace(
+    const Mantid::API::WorkspaceGroup_sptr &ws) {
 
   std::set<Mantid::detid_t> detectorIDs;
   std::set<Mantid::detid_t> detectorIDsSingleWorkspace;
@@ -348,8 +350,8 @@ std::vector<int> getAllDetectorIDsFromGroup(const Grouping &grouping) {
 // Checks if all the detectors in the groups in a Grouping are in the workspace.
 // Workspace can be matrix or group type.
 bool checkGroupDetectorsInWorkspace(const Grouping &grouping,
-                                    Workspace_sptr ws) {
-  std::set<int> detectorIDs = getAllDetectorIDsFromWorkspace(ws);
+                                    const Workspace_sptr &ws) {
+  std::set<int> detectorIDs = getAllDetectorIDsFromWorkspace(std::move(ws));
   std::vector<int> groupDetectorIDs = getAllDetectorIDsFromGroup(grouping);
   return checkItemsInSet(groupDetectorIDs, detectorIDs);
 }
@@ -605,8 +607,8 @@ MatrixWorkspace_sptr extractSpectrum(const Workspace_sptr &inputWS,
   return outWS;
 }
 
-void addSampleLog(MatrixWorkspace_sptr workspace, const std::string &logName,
-                  const std::string &logValue) {
+void addSampleLog(const MatrixWorkspace_sptr &workspace,
+                  const std::string &logName, const std::string &logValue) {
   IAlgorithm_sptr alg =
       AlgorithmManager::Instance().createUnmanaged("AddSampleLog");
   alg->initialize();
diff --git a/Framework/Muon/src/MuonGroupingAsymmetry.cpp b/Framework/Muon/src/MuonGroupingAsymmetry.cpp
index 86624ee6054..a43b232ad84 100644
--- a/Framework/Muon/src/MuonGroupingAsymmetry.cpp
+++ b/Framework/Muon/src/MuonGroupingAsymmetry.cpp
@@ -66,7 +66,7 @@ estimateAsymmetry(const Workspace_sptr &inputWS, const int index,
 }
 
 std::pair<MatrixWorkspace_sptr, MatrixWorkspace_sptr> estimateMuonAsymmetry(
-    WorkspaceGroup_sptr inputWS, const std::vector<int> &summedPeriods,
+    const WorkspaceGroup_sptr &inputWS, const std::vector<int> &summedPeriods,
     const std::vector<int> &subtractedPeriods, int groupIndex,
     const double startX, const double endX, const double normalizationIn) {
   MatrixWorkspace_sptr tempWS;
@@ -118,7 +118,7 @@ std::pair<MatrixWorkspace_sptr, MatrixWorkspace_sptr> estimateMuonAsymmetry(
   return outputPair;
 }
 
-MatrixWorkspace_sptr groupDetectors(MatrixWorkspace_sptr workspace,
+MatrixWorkspace_sptr groupDetectors(const MatrixWorkspace_sptr &workspace,
                                     const std::vector<int> &detectorIDs) {
 
   auto outputWS = WorkspaceFactory::Instance().create(workspace, 1);
@@ -284,8 +284,8 @@ std::map<std::string, std::string> MuonGroupingAsymmetry::validateInputs() {
   return errors;
 }
 
-WorkspaceGroup_sptr
-MuonGroupingAsymmetry::createGroupWorkspace(WorkspaceGroup_sptr inputWS) {
+WorkspaceGroup_sptr MuonGroupingAsymmetry::createGroupWorkspace(
+    const WorkspaceGroup_sptr &inputWS) {
   const std::vector<int> group = this->getProperty("Grouping");
   auto groupedPeriods = boost::make_shared<WorkspaceGroup>();
   // for each period
@@ -320,7 +320,7 @@ void MuonGroupingAsymmetry::exec() {
 }
 
 void MuonGroupingAsymmetry::addGroupingAsymmetrySampleLogs(
-    MatrixWorkspace_sptr workspace) {
+    const MatrixWorkspace_sptr &workspace) {
   MuonAlgorithmHelper::addSampleLog(workspace, "analysis_asymmetry_group_name",
                                     getPropertyValue("GroupName"));
   MuonAlgorithmHelper::addSampleLog(workspace, "analysis_asymmetry_group",
diff --git a/Framework/Muon/src/MuonGroupingCounts.cpp b/Framework/Muon/src/MuonGroupingCounts.cpp
index 760841a98ac..2d1f6979e82 100644
--- a/Framework/Muon/src/MuonGroupingCounts.cpp
+++ b/Framework/Muon/src/MuonGroupingCounts.cpp
@@ -25,11 +25,11 @@ using namespace Mantid::HistogramData;
 namespace {
 
 bool checkPeriodInWorkspaceGroup(const int &period,
-                                 WorkspaceGroup_sptr workspace) {
+                                 const WorkspaceGroup_sptr &workspace) {
   return period <= workspace->getNumberOfEntries();
 }
 
-MatrixWorkspace_sptr groupDetectors(MatrixWorkspace_sptr workspace,
+MatrixWorkspace_sptr groupDetectors(const MatrixWorkspace_sptr &workspace,
                                     const std::vector<int> &detectorIDs) {
 
   auto outputWS = WorkspaceFactory::Instance().create(workspace, 1);
@@ -199,7 +199,8 @@ void MuonGroupingCounts::exec() {
   setProperty("OutputWorkspace", outputWS);
 }
 
-void MuonGroupingCounts::setGroupingSampleLogs(MatrixWorkspace_sptr workspace) {
+void MuonGroupingCounts::setGroupingSampleLogs(
+    const MatrixWorkspace_sptr &workspace) {
   MuonAlgorithmHelper::addSampleLog(workspace, "analysis_group_name",
                                     getPropertyValue("GroupName"));
   MuonAlgorithmHelper::addSampleLog(workspace, "analysis_group",
diff --git a/Framework/Muon/src/MuonPairingAsymmetry.cpp b/Framework/Muon/src/MuonPairingAsymmetry.cpp
index 66d1b70c7bc..5116956eb3a 100644
--- a/Framework/Muon/src/MuonPairingAsymmetry.cpp
+++ b/Framework/Muon/src/MuonPairingAsymmetry.cpp
@@ -23,11 +23,11 @@ using namespace Mantid::Kernel;
 
 namespace {
 bool checkPeriodInWorkspaceGroup(const int &period,
-                                 WorkspaceGroup_const_sptr workspace) {
+                                 const WorkspaceGroup_const_sptr &workspace) {
   return period <= workspace->getNumberOfEntries();
 }
 
-int countPeriods(Workspace_const_sptr ws) {
+int countPeriods(const Workspace_const_sptr &ws) {
   if (auto tmp = boost::dynamic_pointer_cast<const WorkspaceGroup>(ws)) {
     return tmp->getNumberOfEntries();
   } else {
@@ -35,8 +35,8 @@ int countPeriods(Workspace_const_sptr ws) {
   }
 }
 
-bool checkConsistentPeriods(Workspace_const_sptr ws1,
-                            Workspace_const_sptr ws2) {
+bool checkConsistentPeriods(const Workspace_const_sptr &ws1,
+                            const Workspace_const_sptr &ws2) {
   if (ws1->isGroup()) {
     if (!ws2->isGroup()) {
       return false;
@@ -48,12 +48,13 @@ bool checkConsistentPeriods(Workspace_const_sptr ws1,
   return true;
 }
 
-MatrixWorkspace_sptr getWorkspace(WorkspaceGroup_sptr group, const int &index) {
+MatrixWorkspace_sptr getWorkspace(const WorkspaceGroup_sptr &group,
+                                  const int &index) {
   auto ws = group->getItem(index);
   return boost::dynamic_pointer_cast<MatrixWorkspace>(ws);
 }
 
-MatrixWorkspace_sptr groupDetectors(MatrixWorkspace_sptr workspace,
+MatrixWorkspace_sptr groupDetectors(const MatrixWorkspace_sptr &workspace,
                                     const std::vector<int> &detectorIDs) {
 
   auto outputWS = WorkspaceFactory::Instance().create(workspace, 1);
@@ -83,7 +84,7 @@ MatrixWorkspace_sptr groupDetectors(MatrixWorkspace_sptr workspace,
 
 // Convert a Workspace_sptr (which may be single period, MatrixWorkspace, or
 // multi period WorkspaceGroup) to a WorkspaceGroup_sptr
-WorkspaceGroup_sptr workspaceToWorkspaceGroup(Workspace_sptr workspace) {
+WorkspaceGroup_sptr workspaceToWorkspaceGroup(const Workspace_sptr &workspace) {
 
   WorkspaceGroup_sptr ws1;
   if (workspace->isGroup()) {
@@ -333,7 +334,7 @@ MatrixWorkspace_sptr
 MuonPairingAsymmetry::calcPairAsymmetryWithSummedAndSubtractedPeriods(
     const std::vector<int> &summedPeriods,
     const std::vector<int> &subtractedPeriods,
-    WorkspaceGroup_sptr groupedPeriods, const double &alpha) {
+    const WorkspaceGroup_sptr &groupedPeriods, const double &alpha) {
   auto summedWS =
       MuonAlgorithmHelper::sumPeriods(groupedPeriods, summedPeriods);
   auto subtractedWS =
@@ -358,7 +359,7 @@ workspace has two spectra corresponding to the two groupings specified in the
 inputs.
 */
 WorkspaceGroup_sptr
-MuonPairingAsymmetry::createGroupWorkspace(WorkspaceGroup_sptr inputWS) {
+MuonPairingAsymmetry::createGroupWorkspace(const WorkspaceGroup_sptr &inputWS) {
 
   std::vector<int> group1 = this->getProperty("Group1");
   std::vector<int> group2 = this->getProperty("Group2");
@@ -381,7 +382,7 @@ MuonPairingAsymmetry::createGroupWorkspace(WorkspaceGroup_sptr inputWS) {
  * @returns MatrixWorkspace containing result of the calculation.
  */
 MatrixWorkspace_sptr
-MuonPairingAsymmetry::pairAsymmetryCalc(MatrixWorkspace_sptr inputWS,
+MuonPairingAsymmetry::pairAsymmetryCalc(const MatrixWorkspace_sptr &inputWS,
                                         const double &alpha) {
   MatrixWorkspace_sptr outWS;
 
@@ -404,7 +405,7 @@ MuonPairingAsymmetry::pairAsymmetryCalc(MatrixWorkspace_sptr inputWS,
 }
 
 void MuonPairingAsymmetry::setPairAsymmetrySampleLogs(
-    MatrixWorkspace_sptr workspace) {
+    const MatrixWorkspace_sptr &workspace) {
   MuonAlgorithmHelper::addSampleLog(workspace, "analysis_pairName",
                                     getProperty("PairName"));
   MuonAlgorithmHelper::addSampleLog(workspace, "analysis_alpha",
@@ -420,8 +421,8 @@ void MuonPairingAsymmetry::setPairAsymmetrySampleLogs(
 }
 
 MatrixWorkspace_sptr
-MuonPairingAsymmetry::appendSpectra(MatrixWorkspace_sptr inputWS1,
-                                    MatrixWorkspace_sptr inputWS2) {
+MuonPairingAsymmetry::appendSpectra(const MatrixWorkspace_sptr &inputWS1,
+                                    const MatrixWorkspace_sptr &inputWS2) {
 
   IAlgorithm_sptr alg = this->createChildAlgorithm("AppendSpectra");
   alg->setProperty("InputWorkspace1", inputWS1);
@@ -433,7 +434,8 @@ MuonPairingAsymmetry::appendSpectra(MatrixWorkspace_sptr inputWS1,
 }
 
 void MuonPairingAsymmetry::validatePeriods(
-    WorkspaceGroup_sptr inputWS, std::map<std::string, std::string> &errors) {
+    const WorkspaceGroup_sptr &inputWS,
+    std::map<std::string, std::string> &errors) {
   const std::vector<int> summedPeriods = getProperty("SummedPeriods");
   const std::vector<int> subtractedPeriods = getProperty("SubtractedPeriods");
   if (summedPeriods.empty() && subtractedPeriods.empty()) {
diff --git a/Framework/Muon/src/MuonPreProcess.cpp b/Framework/Muon/src/MuonPreProcess.cpp
index 38c409f9009..2d78c07483c 100644
--- a/Framework/Muon/src/MuonPreProcess.cpp
+++ b/Framework/Muon/src/MuonPreProcess.cpp
@@ -155,7 +155,7 @@ void MuonPreProcess::exec() {
  * @return Corrected workspaces
  */
 WorkspaceGroup_sptr
-MuonPreProcess::correctWorkspaces(WorkspaceGroup_sptr wsGroup) {
+MuonPreProcess::correctWorkspaces(const WorkspaceGroup_sptr &wsGroup) {
   WorkspaceGroup_sptr outWS = boost::make_shared<WorkspaceGroup>();
   for (auto &&workspace : *wsGroup) {
     if (auto ws = boost::dynamic_pointer_cast<MatrixWorkspace>(workspace)) {
@@ -191,7 +191,7 @@ MatrixWorkspace_sptr MuonPreProcess::correctWorkspace(MatrixWorkspace_sptr ws) {
 }
 
 MatrixWorkspace_sptr MuonPreProcess::applyDTC(MatrixWorkspace_sptr ws,
-                                              TableWorkspace_sptr dt) {
+                                              const TableWorkspace_sptr &dt) {
   if (dt != nullptr) {
     IAlgorithm_sptr dtc = this->createChildAlgorithm("ApplyDeadTimeCorr");
     dtc->setProperty("InputWorkspace", ws);
@@ -248,7 +248,8 @@ MuonPreProcess::applyRebinning(MatrixWorkspace_sptr ws,
   }
 }
 
-MatrixWorkspace_sptr MuonPreProcess::cloneWorkspace(MatrixWorkspace_sptr ws) {
+MatrixWorkspace_sptr
+MuonPreProcess::cloneWorkspace(const MatrixWorkspace_sptr &ws) {
   IAlgorithm_sptr cloneWorkspace = this->createChildAlgorithm("CloneWorkspace");
   cloneWorkspace->setProperty("InputWorkspace", ws);
   cloneWorkspace->execute();
@@ -256,7 +257,7 @@ MatrixWorkspace_sptr MuonPreProcess::cloneWorkspace(MatrixWorkspace_sptr ws) {
   return boost::dynamic_pointer_cast<MatrixWorkspace>(wsClone);
 }
 
-void MuonPreProcess::addPreProcessSampleLogs(WorkspaceGroup_sptr group) {
+void MuonPreProcess::addPreProcessSampleLogs(const WorkspaceGroup_sptr &group) {
   const std::string numPeriods = std::to_string(group->getNumberOfEntries());
 
   for (auto &&workspace : *group) {
diff --git a/Framework/Muon/src/PlotAsymmetryByLogValue.cpp b/Framework/Muon/src/PlotAsymmetryByLogValue.cpp
index 4012572a49b..c344108e354 100644
--- a/Framework/Muon/src/PlotAsymmetryByLogValue.cpp
+++ b/Framework/Muon/src/PlotAsymmetryByLogValue.cpp
@@ -5,6 +5,8 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include <cmath>
+#include <utility>
+
 #include <vector>
 
 #include "MantidAPI/AlgorithmManager.h"
@@ -565,7 +567,7 @@ void PlotAsymmetryByLogValue::parseRunNames(std::string &firstFN,
 void PlotAsymmetryByLogValue::applyDeadtimeCorr(Workspace_sptr &loadedWs,
                                                 Workspace_sptr deadTimes) {
   ScopedWorkspace ws(loadedWs);
-  ScopedWorkspace dt(deadTimes);
+  ScopedWorkspace dt(std::move(deadTimes));
 
   IAlgorithm_sptr applyCorr =
       AlgorithmManager::Instance().createUnmanaged("ApplyDeadTimeCorr");
@@ -610,7 +612,7 @@ void PlotAsymmetryByLogValue::groupDetectors(Workspace_sptr &loadedWs,
 
   // Could be groups of workspaces, so need to work with ADS
   ScopedWorkspace inWS(loadedWs);
-  ScopedWorkspace grWS(grouping);
+  ScopedWorkspace grWS(std::move(grouping));
   ScopedWorkspace outWS;
 
   IAlgorithm_sptr alg =
@@ -628,7 +630,7 @@ void PlotAsymmetryByLogValue::groupDetectors(Workspace_sptr &loadedWs,
  *   @param loadedWs :: [input] Workspace to apply analysis to
  *   @param index :: [input] Vector index where results will be stored
  */
-void PlotAsymmetryByLogValue::doAnalysis(Workspace_sptr loadedWs,
+void PlotAsymmetryByLogValue::doAnalysis(const Workspace_sptr &loadedWs,
                                          size_t index) {
 
   // Check if workspace is a workspace group
@@ -698,7 +700,7 @@ void PlotAsymmetryByLogValue::doAnalysis(Workspace_sptr loadedWs,
  *   @param Y :: Reference to a variable receiving the value of asymmetry
  *   @param E :: Reference to a variable receiving the value of the error
  */
-void PlotAsymmetryByLogValue::calcIntAsymmetry(MatrixWorkspace_sptr ws,
+void PlotAsymmetryByLogValue::calcIntAsymmetry(const MatrixWorkspace_sptr &ws,
                                                double &Y, double &E) {
 
   // Output workspace
@@ -746,9 +748,9 @@ void PlotAsymmetryByLogValue::calcIntAsymmetry(MatrixWorkspace_sptr ws,
  *   @param Y :: Reference to a variable receiving the value of asymmetry
  *   @param E :: Reference to a variable receiving the value of the error
  */
-void PlotAsymmetryByLogValue::calcIntAsymmetry(MatrixWorkspace_sptr ws_red,
-                                               MatrixWorkspace_sptr ws_green,
-                                               double &Y, double &E) {
+void PlotAsymmetryByLogValue::calcIntAsymmetry(
+    const MatrixWorkspace_sptr &ws_red, const MatrixWorkspace_sptr &ws_green,
+    double &Y, double &E) {
   if (!m_int) { //  "Differential asymmetry"
     HistogramBuilder builder;
     builder.setX(ws_red->x(0).size());
diff --git a/Framework/Muon/src/RRFMuon.cpp b/Framework/Muon/src/RRFMuon.cpp
index 945cc980b95..801d8bfb95f 100644
--- a/Framework/Muon/src/RRFMuon.cpp
+++ b/Framework/Muon/src/RRFMuon.cpp
@@ -109,7 +109,8 @@ void RRFMuon::exec() {
  *  @param uin :: [input] input workspace units
  *  @param uuser :: [input] units selected by user
  */
-double RRFMuon::unitConversionFactor(std::string uin, std::string uuser) {
+double RRFMuon::unitConversionFactor(const std::string &uin,
+                                     const std::string &uuser) {
 
   if ((uin == "microsecond")) {
 
diff --git a/Framework/Muon/src/RemoveExpDecay.cpp b/Framework/Muon/src/RemoveExpDecay.cpp
index e8ac3d63edb..c23d6384979 100644
--- a/Framework/Muon/src/RemoveExpDecay.cpp
+++ b/Framework/Muon/src/RemoveExpDecay.cpp
@@ -178,8 +178,9 @@ HistogramData::Histogram MuonRemoveExpDecay::removeDecay(
  * @param wsIndex :: workspace index
  * @return normalisation constant
  */
-double MuonRemoveExpDecay::calNormalisationConst(API::MatrixWorkspace_sptr ws,
-                                                 int wsIndex) {
+double
+MuonRemoveExpDecay::calNormalisationConst(const API::MatrixWorkspace_sptr &ws,
+                                          int wsIndex) {
   double retVal = 1.0;
 
   API::IAlgorithm_sptr fit;
diff --git a/Framework/Muon/test/ApplyMuonDetectorGroupPairingTest.h b/Framework/Muon/test/ApplyMuonDetectorGroupPairingTest.h
index 78f280b46e8..b0bfef20a03 100644
--- a/Framework/Muon/test/ApplyMuonDetectorGroupPairingTest.h
+++ b/Framework/Muon/test/ApplyMuonDetectorGroupPairingTest.h
@@ -36,8 +36,8 @@ namespace {
 // Set algorithm properties to sensible defaults (assuming data with 10 groups)
 // Use when specifying groups manually
 void setPairAlgorithmProperties(ApplyMuonDetectorGroupPairing &alg,
-                                std::string inputWSName,
-                                std::string wsGroupName) {
+                                const std::string &inputWSName,
+                                const std::string &wsGroupName) {
   alg.setProperty("SpecifyGroupsManually", true);
   alg.setProperty("PairName", "test");
   alg.setProperty("Alpha", 1.0);
@@ -58,8 +58,8 @@ void setPairAlgorithmProperties(ApplyMuonDetectorGroupPairing &alg,
 // Set algorithm properties to sensible defaults (assuming data with 10 groups)
 // Use when entering workspaces to pair
 void setPairAlgorithmPropertiesForInputWorkspace(
-    ApplyMuonDetectorGroupPairing &alg, std::string inputWSName,
-    std::string wsGroupName) {
+    ApplyMuonDetectorGroupPairing &alg, const std::string &inputWSName,
+    const std::string &wsGroupName) {
   alg.setProperty("SpecifyGroupsManually", false);
   alg.setProperty("PairName", "test");
   alg.setProperty("Alpha", 1.0);
@@ -72,7 +72,7 @@ void setPairAlgorithmPropertiesForInputWorkspace(
 // algorithm (a MatrixWorkspace and an empty group).
 class setUpADSWithWorkspace {
 public:
-  setUpADSWithWorkspace(Workspace_sptr ws) {
+  setUpADSWithWorkspace(const Workspace_sptr &ws) {
     AnalysisDataService::Instance().addOrReplace(inputWSName, ws);
     wsGroup = boost::make_shared<WorkspaceGroup>();
     AnalysisDataService::Instance().addOrReplace(groupWSName, wsGroup);
diff --git a/Framework/Muon/test/ApplyMuonDetectorGroupingTest.h b/Framework/Muon/test/ApplyMuonDetectorGroupingTest.h
index 44d16b3aaf7..08b59730bc1 100644
--- a/Framework/Muon/test/ApplyMuonDetectorGroupingTest.h
+++ b/Framework/Muon/test/ApplyMuonDetectorGroupingTest.h
@@ -50,7 +50,7 @@ IAlgorithm_sptr algorithmWithPropertiesSet(const std::string &inputWSName,
 // algorithm (a MatrixWorkspace and an empty GroupWorkspace).
 class setUpADSWithWorkspace {
 public:
-  setUpADSWithWorkspace(Workspace_sptr ws) {
+  setUpADSWithWorkspace(const Workspace_sptr &ws) {
     AnalysisDataService::Instance().addOrReplace(inputWSName, ws);
     wsGroup = boost::make_shared<WorkspaceGroup>();
     AnalysisDataService::Instance().addOrReplace(groupWSName, wsGroup);
diff --git a/Framework/Muon/test/CalMuonDetectorPhasesTest.h b/Framework/Muon/test/CalMuonDetectorPhasesTest.h
index 93c061a72b0..4fb6b5b2833 100644
--- a/Framework/Muon/test/CalMuonDetectorPhasesTest.h
+++ b/Framework/Muon/test/CalMuonDetectorPhasesTest.h
@@ -187,7 +187,7 @@ private:
   }
 
   /// Runs test of execution on the given workspace
-  void runExecutionTest(const MatrixWorkspace_sptr workspace) {
+  void runExecutionTest(const MatrixWorkspace_sptr &workspace) {
     auto calc = AlgorithmManager::Instance().create("CalMuonDetectorPhases");
     calc->initialize();
     calc->setChild(true);
diff --git a/Framework/Muon/test/CalculateMuonAsymmetryTest.h b/Framework/Muon/test/CalculateMuonAsymmetryTest.h
index a541963ed7f..5f97b2a47d6 100644
--- a/Framework/Muon/test/CalculateMuonAsymmetryTest.h
+++ b/Framework/Muon/test/CalculateMuonAsymmetryTest.h
@@ -16,6 +16,8 @@
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "MantidAPI/FunctionFactory.h"
 #include "MantidAPI/IFunction.h"
 #include "MantidAPI/ITableWorkspace.h"
@@ -90,7 +92,7 @@ ITableWorkspace_sptr genTable() {
   return table;
 }
 
-IAlgorithm_sptr setUpFuncAlg(std::vector<std::string> wsNames,
+IAlgorithm_sptr setUpFuncAlg(const std::vector<std::string> &wsNames,
                              const IFunction_sptr &func) {
   IAlgorithm_sptr asymmAlg = AlgorithmManager::Instance().create(
       "ConvertFitFunctionForMuonTFAsymmetry");
@@ -103,31 +105,32 @@ IAlgorithm_sptr setUpFuncAlg(std::vector<std::string> wsNames,
   return asymmAlg;
 }
 
-IFunction_sptr genSingleFunc(std::vector<std::string> wsNames) {
+IFunction_sptr genSingleFunc(const std::vector<std::string> &wsNames) {
   IFunction_sptr func = FunctionFactory::Instance().createInitialized(
       "name=GausOsc,Frequency=3.0");
-  IAlgorithm_sptr alg = setUpFuncAlg(wsNames, func);
+  IAlgorithm_sptr alg = setUpFuncAlg(std::move(wsNames), func);
   alg->execute();
   IFunction_sptr funcOut = alg->getProperty("OutputFunction");
   return funcOut;
 }
 
-IFunction_sptr genDoubleFunc(std::vector<std::string> wsNames) {
+IFunction_sptr genDoubleFunc(const std::vector<std::string> &wsNames) {
   std::string multiFuncString = "composite=MultiDomainFunction,NumDeriv=1;";
   multiFuncString += "name=GausOsc,$domains=i,Frequency=3.0;";
   multiFuncString += "name=GausOsc,$domains=i,Frequency=3.0;";
   IFunction_sptr func =
       FunctionFactory::Instance().createInitialized(multiFuncString);
-  IAlgorithm_sptr alg = setUpFuncAlg(wsNames, func);
+  IAlgorithm_sptr alg = setUpFuncAlg(std::move(wsNames), func);
   alg->execute();
   IFunction_sptr funcOut = alg->getProperty("OutputFunction");
   std::cout << funcOut << std::endl;
   return funcOut;
 }
 
-IAlgorithm_sptr setUpAlg(ITableWorkspace_sptr &table, IFunction_sptr func,
-                         std::vector<std::string> wsNamesNorm,
-                         std::vector<std::string> wsOut) {
+IAlgorithm_sptr setUpAlg(ITableWorkspace_sptr &table,
+                         const IFunction_sptr &func,
+                         const std::vector<std::string> &wsNamesNorm,
+                         const std::vector<std::string> &wsOut) {
   IAlgorithm_sptr asymmAlg =
       AlgorithmManager::Instance().create("CalculateMuonAsymmetry");
   asymmAlg->initialize();
diff --git a/Framework/Muon/test/ConvertFitFunctionForMuonTFAsymmetryTest.h b/Framework/Muon/test/ConvertFitFunctionForMuonTFAsymmetryTest.h
index 2499f7c21a3..7d7b8c16f2a 100644
--- a/Framework/Muon/test/ConvertFitFunctionForMuonTFAsymmetryTest.h
+++ b/Framework/Muon/test/ConvertFitFunctionForMuonTFAsymmetryTest.h
@@ -59,7 +59,7 @@ ITableWorkspace_sptr genTable() {
   return table;
 }
 
-IAlgorithm_sptr setUpAlg(std::vector<std::string> wsNames,
+IAlgorithm_sptr setUpAlg(const std::vector<std::string> &wsNames,
                          const IFunction_sptr &func) {
   IAlgorithm_sptr asymmAlg = AlgorithmManager::Instance().create(
       "ConvertFitFunctionForMuonTFAsymmetry");
diff --git a/Framework/Muon/test/LoadAndApplyMuonDetectorGroupingTest.h b/Framework/Muon/test/LoadAndApplyMuonDetectorGroupingTest.h
index cf4c786dbd9..ee52ecb44b6 100644
--- a/Framework/Muon/test/LoadAndApplyMuonDetectorGroupingTest.h
+++ b/Framework/Muon/test/LoadAndApplyMuonDetectorGroupingTest.h
@@ -43,7 +43,7 @@ algorithmWithPropertiesSet(const std::string &inputWSName,
 // algorithm (a MatrixWorkspace and an empty group).
 class setUpADSWithWorkspace {
 public:
-  setUpADSWithWorkspace(Workspace_sptr ws) {
+  setUpADSWithWorkspace(const Workspace_sptr &ws) {
     AnalysisDataService::Instance().addOrReplace(inputWSName, ws);
     wsGroup = boost::make_shared<WorkspaceGroup>();
     AnalysisDataService::Instance().addOrReplace(groupWSName, wsGroup);
diff --git a/Framework/Muon/test/MuonGroupingAsymmetryTest.h b/Framework/Muon/test/MuonGroupingAsymmetryTest.h
index 589608f3bd5..66789bd9827 100644
--- a/Framework/Muon/test/MuonGroupingAsymmetryTest.h
+++ b/Framework/Muon/test/MuonGroupingAsymmetryTest.h
@@ -27,7 +27,7 @@ namespace {
 // algorithm (a MatrixWorkspace).
 class setUpADSWithWorkspace {
 public:
-  setUpADSWithWorkspace(Workspace_sptr ws) {
+  setUpADSWithWorkspace(const Workspace_sptr &ws) {
     AnalysisDataService::Instance().addOrReplace(inputWSName, ws);
   };
   ~setUpADSWithWorkspace() { AnalysisDataService::Instance().clear(); };
@@ -51,7 +51,7 @@ algorithmWithWorkspacePropertiesSet(const std::string &inputWSName) {
 // Set up algorithm without any optional properties
 // i.e. just the input workspace and group name.
 IAlgorithm_sptr
-setUpAlgorithmWithoutOptionalProperties(WorkspaceGroup_sptr ws,
+setUpAlgorithmWithoutOptionalProperties(const WorkspaceGroup_sptr &ws,
                                         const std::string &name,
                                         const std::vector<int> &grouping) {
   setUpADSWithWorkspace setup(ws);
@@ -62,7 +62,7 @@ setUpAlgorithmWithoutOptionalProperties(WorkspaceGroup_sptr ws,
 }
 
 // Retrieve the output workspace from an executed algorithm
-MatrixWorkspace_sptr getOutputWorkspace(IAlgorithm_sptr alg) {
+MatrixWorkspace_sptr getOutputWorkspace(const IAlgorithm_sptr &alg) {
   MatrixWorkspace_sptr outputWS = alg->getProperty("OutputWorkspace");
   return outputWS;
 }
diff --git a/Framework/Muon/test/MuonGroupingCountsTest.h b/Framework/Muon/test/MuonGroupingCountsTest.h
index 6eeef999d71..bd42678b49d 100644
--- a/Framework/Muon/test/MuonGroupingCountsTest.h
+++ b/Framework/Muon/test/MuonGroupingCountsTest.h
@@ -26,7 +26,7 @@ namespace {
 // algorithm (a MatrixWorkspace).
 class setUpADSWithWorkspace {
 public:
-  setUpADSWithWorkspace(Workspace_sptr ws) {
+  setUpADSWithWorkspace(const Workspace_sptr &ws) {
     AnalysisDataService::Instance().addOrReplace(inputWSName, ws);
   };
   ~setUpADSWithWorkspace() { AnalysisDataService::Instance().clear(); };
@@ -50,7 +50,7 @@ algorithmWithoutOptionalPropertiesSet(const std::string &inputWSName) {
 // Set up algorithm without any optional properties
 // i.e. just the input workspace and group name.
 IAlgorithm_sptr
-setUpAlgorithmWithoutOptionalProperties(WorkspaceGroup_sptr ws,
+setUpAlgorithmWithoutOptionalProperties(const WorkspaceGroup_sptr &ws,
                                         const std::string &name) {
   setUpADSWithWorkspace setup(ws);
   IAlgorithm_sptr alg =
@@ -60,7 +60,7 @@ setUpAlgorithmWithoutOptionalProperties(WorkspaceGroup_sptr ws,
 }
 
 // Set up algorithm with GroupName applied
-IAlgorithm_sptr setUpAlgorithmWithGroupName(WorkspaceGroup_sptr ws,
+IAlgorithm_sptr setUpAlgorithmWithGroupName(const WorkspaceGroup_sptr &ws,
                                             const std::string &name) {
   setUpADSWithWorkspace setup(ws);
   IAlgorithm_sptr alg =
@@ -71,7 +71,7 @@ IAlgorithm_sptr setUpAlgorithmWithGroupName(WorkspaceGroup_sptr ws,
 
 // Set up algorithm with TimeOffset applied
 IAlgorithm_sptr
-setUpAlgorithmWithGroupNameAndDetectors(WorkspaceGroup_sptr ws,
+setUpAlgorithmWithGroupNameAndDetectors(const WorkspaceGroup_sptr &ws,
                                         const std::string &name,
                                         const std::vector<int> &detectors) {
   setUpADSWithWorkspace setup(ws);
@@ -83,7 +83,7 @@ setUpAlgorithmWithGroupNameAndDetectors(WorkspaceGroup_sptr ws,
 }
 
 // Retrieve the output workspace from an executed algorithm
-MatrixWorkspace_sptr getOutputWorkspace(IAlgorithm_sptr alg) {
+MatrixWorkspace_sptr getOutputWorkspace(const IAlgorithm_sptr &alg) {
   Workspace_sptr outputWS = alg->getProperty("OutputWorkspace");
   auto wsOut = boost::dynamic_pointer_cast<MatrixWorkspace>(outputWS);
   return wsOut;
diff --git a/Framework/Muon/test/MuonPairingAsymmetryTest.h b/Framework/Muon/test/MuonPairingAsymmetryTest.h
index ff748fb2031..3922da95028 100644
--- a/Framework/Muon/test/MuonPairingAsymmetryTest.h
+++ b/Framework/Muon/test/MuonPairingAsymmetryTest.h
@@ -27,7 +27,7 @@ namespace {
 // algorithm (a MatrixWorkspace).
 class setUpADSWithWorkspace {
 public:
-  setUpADSWithWorkspace(Workspace_sptr ws) {
+  setUpADSWithWorkspace(const Workspace_sptr &ws) {
     AnalysisDataService::Instance().addOrReplace(inputWSName, ws);
   };
   ~setUpADSWithWorkspace() { AnalysisDataService::Instance().clear(); };
@@ -55,7 +55,7 @@ IAlgorithm_sptr algorithmWithoutOptionalPropertiesSet(
 
 // Set up algorithm without any optional properties.
 IAlgorithm_sptr
-setUpAlgorithmWithoutOptionalProperties(WorkspaceGroup_sptr ws,
+setUpAlgorithmWithoutOptionalProperties(const WorkspaceGroup_sptr &ws,
                                         const std::string &name) {
   const std::vector<int> group1 = {1, 2};
   const std::vector<int> group2 = {3, 4};
@@ -67,7 +67,7 @@ setUpAlgorithmWithoutOptionalProperties(WorkspaceGroup_sptr ws,
 }
 
 // Set up algorithm with groupings
-IAlgorithm_sptr setUpAlgorithmWithGroups(WorkspaceGroup_sptr ws,
+IAlgorithm_sptr setUpAlgorithmWithGroups(const WorkspaceGroup_sptr &ws,
                                          const std::vector<int> &group1,
                                          const std::vector<int> &group2) {
   setUpADSWithWorkspace setup(ws);
@@ -78,8 +78,8 @@ IAlgorithm_sptr setUpAlgorithmWithGroups(WorkspaceGroup_sptr ws,
 
 // Set up algorithm to accept two group workspaces
 IAlgorithm_sptr
-setUpAlgorithmWithGroupWorkspaces(MatrixWorkspace_sptr groupedWS1,
-                                  MatrixWorkspace_sptr groupedWS2) {
+setUpAlgorithmWithGroupWorkspaces(const MatrixWorkspace_sptr &groupedWS1,
+                                  const MatrixWorkspace_sptr &groupedWS2) {
   auto alg = boost::make_shared<MuonPairingAsymmetry>();
   alg->initialize();
   alg->setProperty("SpecifyGroupsManually", false);
@@ -94,8 +94,8 @@ setUpAlgorithmWithGroupWorkspaces(MatrixWorkspace_sptr groupedWS1,
 
 // Set up MuonPairingAsymmetry algorithm to accept two WorkspaceGroups
 IAlgorithm_sptr
-setUpAlgorithmWithGroupWorkspaceGroups(WorkspaceGroup_sptr groupedWS1,
-                                       WorkspaceGroup_sptr groupedWS2) {
+setUpAlgorithmWithGroupWorkspaceGroups(const WorkspaceGroup_sptr &groupedWS1,
+                                       const WorkspaceGroup_sptr &groupedWS2) {
   auto alg = boost::make_shared<MuonPairingAsymmetry>();
   alg->setRethrows(true);
   alg->initialize();
@@ -110,7 +110,7 @@ setUpAlgorithmWithGroupWorkspaceGroups(WorkspaceGroup_sptr groupedWS1,
 }
 
 // Retrieve the output workspace from an executed algorithm
-MatrixWorkspace_sptr getOutputWorkspace(IAlgorithm_sptr alg) {
+MatrixWorkspace_sptr getOutputWorkspace(const IAlgorithm_sptr &alg) {
   MatrixWorkspace_sptr outputWS = alg->getProperty("OutputWorkspace");
   return outputWS;
 }
diff --git a/Framework/Muon/test/MuonPreProcessTest.h b/Framework/Muon/test/MuonPreProcessTest.h
index 4ad8086d6ec..c2554089ce3 100644
--- a/Framework/Muon/test/MuonPreProcessTest.h
+++ b/Framework/Muon/test/MuonPreProcessTest.h
@@ -13,6 +13,8 @@
 
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 using namespace Mantid;
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -41,22 +43,23 @@ class setUpADSWithWorkspace {
 public:
   std::string const inputWSName = "inputData";
 
-  setUpADSWithWorkspace(Workspace_sptr ws) {
+  setUpADSWithWorkspace(const Workspace_sptr &ws) {
     AnalysisDataService::Instance().addOrReplace(inputWSName, ws);
   };
   ~setUpADSWithWorkspace() { AnalysisDataService::Instance().clear(); };
 };
 
 // Set up algorithm with none of the optional properties
-IAlgorithm_sptr setUpAlgorithmWithNoOptionalProperties(Workspace_sptr ws) {
-  setUpADSWithWorkspace setup(ws);
+IAlgorithm_sptr
+setUpAlgorithmWithNoOptionalProperties(const Workspace_sptr &ws) {
+  setUpADSWithWorkspace setup(std::move(ws));
   IAlgorithm_sptr alg =
       algorithmWithoutOptionalPropertiesSet(setup.inputWSName);
   return alg;
 }
 
 // Set up algorithm with TimeOffset applied
-IAlgorithm_sptr setUpAlgorithmWithTimeOffset(MatrixWorkspace_sptr ws,
+IAlgorithm_sptr setUpAlgorithmWithTimeOffset(const MatrixWorkspace_sptr &ws,
                                              const double &offset) {
   setUpADSWithWorkspace setup(ws);
   IAlgorithm_sptr alg =
@@ -67,8 +70,8 @@ IAlgorithm_sptr setUpAlgorithmWithTimeOffset(MatrixWorkspace_sptr ws,
 
 // Set up algorithm with DeadTimeTable applied
 IAlgorithm_sptr
-setUpAlgorithmWithDeadTimeTable(MatrixWorkspace_sptr ws,
-                                ITableWorkspace_sptr deadTimes) {
+setUpAlgorithmWithDeadTimeTable(const MatrixWorkspace_sptr &ws,
+                                const ITableWorkspace_sptr &deadTimes) {
   setUpADSWithWorkspace setup(ws);
   IAlgorithm_sptr alg =
       algorithmWithoutOptionalPropertiesSet(setup.inputWSName);
@@ -77,7 +80,7 @@ setUpAlgorithmWithDeadTimeTable(MatrixWorkspace_sptr ws,
 }
 
 // Set up algorithm with TimeMin applied
-IAlgorithm_sptr setUpAlgorithmWithTimeMin(MatrixWorkspace_sptr ws,
+IAlgorithm_sptr setUpAlgorithmWithTimeMin(const MatrixWorkspace_sptr &ws,
                                           const double &timeMin) {
   setUpADSWithWorkspace setup(ws);
   IAlgorithm_sptr alg =
@@ -87,7 +90,7 @@ IAlgorithm_sptr setUpAlgorithmWithTimeMin(MatrixWorkspace_sptr ws,
 }
 
 // Set up algorithm with TimeMax applied
-IAlgorithm_sptr setUpAlgorithmWithTimeMax(MatrixWorkspace_sptr ws,
+IAlgorithm_sptr setUpAlgorithmWithTimeMax(const MatrixWorkspace_sptr &ws,
                                           const double &timeMax) {
   setUpADSWithWorkspace setup(ws);
   IAlgorithm_sptr alg =
@@ -98,8 +101,8 @@ IAlgorithm_sptr setUpAlgorithmWithTimeMax(MatrixWorkspace_sptr ws,
 
 // Get the workspace at a particular index from the output workspace
 // group produced by the PreProcess alg
-MatrixWorkspace_sptr getOutputWorkspace(IAlgorithm_sptr muonPreProcessAlg,
-                                        const int &index) {
+MatrixWorkspace_sptr
+getOutputWorkspace(const IAlgorithm_sptr &muonPreProcessAlg, const int &index) {
   WorkspaceGroup_sptr outputWS;
   outputWS = muonPreProcessAlg->getProperty("OutputWorkspace");
   MatrixWorkspace_sptr wsOut =
diff --git a/Framework/Muon/test/PhaseQuadMuonTest.h b/Framework/Muon/test/PhaseQuadMuonTest.h
index 8f0969d7ae8..b6d69c4febb 100644
--- a/Framework/Muon/test/PhaseQuadMuonTest.h
+++ b/Framework/Muon/test/PhaseQuadMuonTest.h
@@ -17,6 +17,8 @@
 #include "MantidDataObjects/TableWorkspace.h"
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 using namespace Mantid::DataObjects;
 using namespace Mantid::API;
 
@@ -25,8 +27,8 @@ namespace {
 const int dead1 = 4;
 const int dead2 = 12;
 
-void populatePhaseTableWithDeadDetectors(ITableWorkspace_sptr phaseTable,
-                                         const MatrixWorkspace_sptr ws) {
+void populatePhaseTableWithDeadDetectors(const ITableWorkspace_sptr &phaseTable,
+                                         const MatrixWorkspace_sptr &ws) {
   phaseTable->addColumn("int", "DetectprID");
   phaseTable->addColumn("double", "Asymmetry");
   phaseTable->addColumn("double", "phase");
@@ -42,7 +44,7 @@ void populatePhaseTableWithDeadDetectors(ITableWorkspace_sptr phaseTable,
     }
   }
 }
-void populatePhaseTable(ITableWorkspace_sptr phaseTable,
+void populatePhaseTable(const ITableWorkspace_sptr &phaseTable,
                         std::vector<std::string> names, bool swap = false) {
   phaseTable->addColumn("int", names[0]);
   phaseTable->addColumn("double", names[1]);
@@ -58,12 +60,14 @@ void populatePhaseTable(ITableWorkspace_sptr phaseTable,
     phaseRow2 << i << asym << phase;
   }
 }
-void populatePhaseTable(ITableWorkspace_sptr phaseTable) {
-  populatePhaseTable(phaseTable, {"DetectorID", "Asymmetry", "Phase"});
+void populatePhaseTable(const ITableWorkspace_sptr &phaseTable) {
+  populatePhaseTable(std::move(phaseTable),
+                     {"DetectorID", "Asymmetry", "Phase"});
 }
 
-IAlgorithm_sptr setupAlg(MatrixWorkspace_sptr m_loadedData, bool isChildAlg,
-                         ITableWorkspace_sptr phaseTable) {
+IAlgorithm_sptr setupAlg(const MatrixWorkspace_sptr &m_loadedData,
+                         bool isChildAlg,
+                         const ITableWorkspace_sptr &phaseTable) {
   // Set up PhaseQuad
   IAlgorithm_sptr phaseQuad = AlgorithmManager::Instance().create("PhaseQuad");
   phaseQuad->setChild(isChildAlg);
@@ -74,26 +78,28 @@ IAlgorithm_sptr setupAlg(MatrixWorkspace_sptr m_loadedData, bool isChildAlg,
   return phaseQuad;
 }
 
-IAlgorithm_sptr setupAlg(MatrixWorkspace_sptr m_loadedData, bool isChildAlg) {
+IAlgorithm_sptr setupAlg(const MatrixWorkspace_sptr &m_loadedData,
+                         bool isChildAlg) {
   // Create and populate a detector table
   boost::shared_ptr<ITableWorkspace> phaseTable(
       new Mantid::DataObjects::TableWorkspace);
   populatePhaseTable(phaseTable);
 
-  return setupAlg(m_loadedData, isChildAlg, phaseTable);
+  return setupAlg(std::move(m_loadedData), isChildAlg, phaseTable);
 }
 
-IAlgorithm_sptr setupAlg(MatrixWorkspace_sptr m_loadedData, bool isChildAlg,
-                         std::vector<std::string> names, bool swap = false) {
+IAlgorithm_sptr setupAlg(const MatrixWorkspace_sptr &m_loadedData,
+                         bool isChildAlg, std::vector<std::string> names,
+                         bool swap = false) {
   // Create and populate a detector table
   boost::shared_ptr<ITableWorkspace> phaseTable(
       new Mantid::DataObjects::TableWorkspace);
-  populatePhaseTable(phaseTable, names, swap);
+  populatePhaseTable(phaseTable, std::move(names), swap);
 
-  return setupAlg(m_loadedData, isChildAlg, phaseTable);
+  return setupAlg(std::move(m_loadedData), isChildAlg, phaseTable);
 }
 
-IAlgorithm_sptr setupAlgDead(MatrixWorkspace_sptr m_loadedData) {
+IAlgorithm_sptr setupAlgDead(const MatrixWorkspace_sptr &m_loadedData) {
   // Create and populate a detector table
   boost::shared_ptr<ITableWorkspace> phaseTable(
       new Mantid::DataObjects::TableWorkspace);
@@ -102,7 +108,7 @@ IAlgorithm_sptr setupAlgDead(MatrixWorkspace_sptr m_loadedData) {
   return setupAlg(m_loadedData, true, phaseTable);
 }
 
-MatrixWorkspace_sptr setupWS(MatrixWorkspace_sptr m_loadedData) {
+MatrixWorkspace_sptr setupWS(const MatrixWorkspace_sptr &m_loadedData) {
   boost::shared_ptr<ITableWorkspace> phaseTable(
       new Mantid::DataObjects::TableWorkspace);
   MatrixWorkspace_sptr ws = m_loadedData->clone();
diff --git a/Framework/Nexus/inc/MantidNexus/MuonNexusReader.h b/Framework/Nexus/inc/MantidNexus/MuonNexusReader.h
index 0ba3101577d..7a8748dae8f 100644
--- a/Framework/Nexus/inc/MantidNexus/MuonNexusReader.h
+++ b/Framework/Nexus/inc/MantidNexus/MuonNexusReader.h
@@ -48,7 +48,7 @@ private:
   /// file to base all NXlog times on
   std::time_t startTime_time_t; ///< startTime in time_t format
   std::time_t
-  to_time_t(boost::posix_time::ptime t) ///< convert posix time to time_t
+  to_time_t(const boost::posix_time::ptime &t) ///< convert posix time to time_t
   {
     /**
     Take the input Posix time, subtract the unix epoch, and return the seconds
diff --git a/Framework/Nexus/inc/MantidNexus/NexusFileIO.h b/Framework/Nexus/inc/MantidNexus/NexusFileIO.h
index a78851eb13c..e6b04b00193 100644
--- a/Framework/Nexus/inc/MantidNexus/NexusFileIO.h
+++ b/Framework/Nexus/inc/MantidNexus/NexusFileIO.h
@@ -83,7 +83,7 @@ public:
       float *errorSquareds, int64_t *pulsetimes, bool compress) const;
 
   int writeEventList(const DataObjects::EventList &el,
-                     std::string group_name) const;
+                     const std::string &group_name) const;
 
   template <class T>
   void writeEventListData(std::vector<T> events, bool writeTOF,
@@ -103,7 +103,7 @@ public:
                  const int &spectra) const;
 
   /// write bin masking information
-  bool writeNexusBinMasking(API::MatrixWorkspace_const_sptr ws) const;
+  bool writeNexusBinMasking(const API::MatrixWorkspace_const_sptr &ws) const;
 
   /// Reset the pointer to the progress object.
   void resetProgress(Mantid::API::Progress *prog);
@@ -171,7 +171,7 @@ private:
   int findMantidWSEntries() const;
   /// convert posix time to time_t
   std::time_t
-  to_time_t(boost::posix_time::ptime t) ///< convert posix time to time_t
+  to_time_t(const boost::posix_time::ptime &t) ///< convert posix time to time_t
   {
     /**
     Take the input Posix time, subtract the unix epoch, and return the seconds
@@ -202,7 +202,7 @@ private:
 
   /// Writes given vector column to the currently open Nexus file
   template <typename VecType, typename ElemType>
-  void writeNexusVectorColumn(API::Column_const_sptr col,
+  void writeNexusVectorColumn(const API::Column_const_sptr &col,
                               const std::string &columnName, int nexusType,
                               const std::string &interpret_as) const;
 
diff --git a/Framework/Nexus/inc/MantidNexus/NexusIOHelper.h b/Framework/Nexus/inc/MantidNexus/NexusIOHelper.h
index 5f191b93a87..69de03ffe0d 100644
--- a/Framework/Nexus/inc/MantidNexus/NexusIOHelper.h
+++ b/Framework/Nexus/inc/MantidNexus/NexusIOHelper.h
@@ -12,6 +12,9 @@
 #include <nexus/NeXusFile.hpp>
 #include <numeric>
 #include <string>
+#include <utility>
+
+#include <utility>
 
 namespace Mantid {
 namespace NeXus {
@@ -46,8 +49,8 @@ namespace {
     throw std::runtime_error("Unknown type in Nexus file");                    \
   }
 
-std::pair<::NeXus::Info, bool> checkIfOpenAndGetInfo(::NeXus::File &file,
-                                                     std::string entry) {
+std::pair<::NeXus::Info, bool>
+checkIfOpenAndGetInfo(::NeXus::File &file, const std::string &&entry) {
   std::pair<::NeXus::Info, bool> info_and_close;
   info_and_close.second = false;
   if (!file.isDataSetOpen()) {
@@ -160,8 +163,10 @@ T readNexusAnyVariable(::NeXus::File &file, bool close_file) {
  * and calls readNexusAnyVector via the RUN_NEXUSIOHELPER_FUNCTION macro.
  */
 template <typename T>
-std::vector<T> readNexusVector(::NeXus::File &file, std::string entry = "") {
-  auto info_and_close = checkIfOpenAndGetInfo(file, entry);
+std::vector<T> readNexusVector(::NeXus::File &file,
+                               const std::string &entry = "") {
+  auto info_and_close =
+      checkIfOpenAndGetInfo(file, std::move(std::move(entry)));
   auto dims = (info_and_close.first).dims;
   auto total_size = std::accumulate(dims.begin(), dims.end(), int64_t{1},
                                     std::multiplies<>());
@@ -173,17 +178,19 @@ std::vector<T> readNexusVector(::NeXus::File &file, std::string entry = "") {
  * readNexusAnySlab via the RUN_NEXUSIOHELPER_FUNCTION macro.
  */
 template <typename T>
-std::vector<T> readNexusSlab(::NeXus::File &file, std::string entry,
+std::vector<T> readNexusSlab(::NeXus::File &file, const std::string &entry,
                              const std::vector<int64_t> &start,
                              const std::vector<int64_t> &size) {
-  auto info_and_close = checkIfOpenAndGetInfo(file, entry);
+  auto info_and_close =
+      checkIfOpenAndGetInfo(file, std::move(std::move(entry)));
   RUN_NEXUSIOHELPER_FUNCTION((info_and_close.first).type, readNexusAnySlab,
                              file, start, size, info_and_close.second);
 }
 
 template <typename T>
-T readNexusValue(::NeXus::File &file, std::string entry = "") {
-  auto info_and_close = checkIfOpenAndGetInfo(file, entry);
+T readNexusValue(::NeXus::File &file, const std::string &entry = "") {
+  auto info_and_close =
+      checkIfOpenAndGetInfo(file, std::move(std::move(entry)));
   RUN_NEXUSIOHELPER_FUNCTION((info_and_close.first).type, readNexusAnyVariable,
                              file, info_and_close.second);
 }
diff --git a/Framework/Nexus/src/NexusFileIO.cpp b/Framework/Nexus/src/NexusFileIO.cpp
index 08cbbffce57..c82b40f08d4 100644
--- a/Framework/Nexus/src/NexusFileIO.cpp
+++ b/Framework/Nexus/src/NexusFileIO.cpp
@@ -574,7 +574,7 @@ size_t getSizeOf(const Kernel::V3D & /*unused*/) { return 3; }
  */
 template <typename VecType, typename ElemType>
 void NexusFileIO::writeNexusVectorColumn(
-    Column_const_sptr col, const std::string &columnName, int nexusType,
+    const Column_const_sptr &col, const std::string &columnName, int nexusType,
     const std::string &interpret_as) const {
   ConstColumnVector<VecType> column(col);
   size_t rowCount = column.size();
@@ -893,7 +893,7 @@ void NexusFileIO::writeEventListData(std::vector<T> events, bool writeTOF,
  * @param group_name :: group_name to create.
  * */
 int NexusFileIO::writeEventList(const DataObjects::EventList &el,
-                                std::string group_name) const {
+                                const std::string &group_name) const {
   // write data entry
   NXstatus status = NXmakegroup(fileID, group_name.c_str(), "NXdata");
   if (status == NX_ERROR)
@@ -1162,7 +1162,7 @@ bool NexusFileIO::checkEntryAtLevelByAttribute(const std::string &attribute,
  * @return true for OK, false for error
  */
 bool NexusFileIO::writeNexusBinMasking(
-    API::MatrixWorkspace_const_sptr ws) const {
+    const API::MatrixWorkspace_const_sptr &ws) const {
   std::vector<int> spectra;
   std::vector<std::size_t> bins;
   std::vector<double> weights;
diff --git a/Framework/NexusGeometry/inc/MantidNexusGeometry/InstrumentBuilder.h b/Framework/NexusGeometry/inc/MantidNexusGeometry/InstrumentBuilder.h
index 242cf870995..24828bdff3e 100644
--- a/Framework/NexusGeometry/inc/MantidNexusGeometry/InstrumentBuilder.h
+++ b/Framework/NexusGeometry/inc/MantidNexusGeometry/InstrumentBuilder.h
@@ -37,9 +37,10 @@ public:
   Geometry::IComponent *addComponent(const std::string &compName,
                                      const Eigen::Vector3d &position);
   /// Adds tubes (ObjComponentAssemblies) to the last registered bank
-  void addTubes(const std::string &bankName,
-                const std::vector<detail::TubeBuilder> &tubes,
-                boost::shared_ptr<const Mantid::Geometry::IObject> pixelShape);
+  void addTubes(
+      const std::string &bankName,
+      const std::vector<detail::TubeBuilder> &tubes,
+      const boost::shared_ptr<const Mantid::Geometry::IObject> &pixelShape);
   /// Adds detector to the root (instrument)
   void addDetectorToInstrument(
       const std::string &detName, detid_t detId,
@@ -69,8 +70,9 @@ public:
 
 private:
   /// Add a single tube to the last registed bank
-  void doAddTube(const std::string &compName, const detail::TubeBuilder &tube,
-                 boost::shared_ptr<const Mantid::Geometry::IObject> pixelShape);
+  void doAddTube(
+      const std::string &compName, const detail::TubeBuilder &tube,
+      const boost::shared_ptr<const Mantid::Geometry::IObject> &pixelShape);
   /// Sorts detectors
   void sortDetectors() const;
   /// product
diff --git a/Framework/NexusGeometry/inc/MantidNexusGeometry/TubeBuilder.h b/Framework/NexusGeometry/inc/MantidNexusGeometry/TubeBuilder.h
index 2d297dff520..94626863f7d 100644
--- a/Framework/NexusGeometry/inc/MantidNexusGeometry/TubeBuilder.h
+++ b/Framework/NexusGeometry/inc/MantidNexusGeometry/TubeBuilder.h
@@ -25,7 +25,8 @@ Colinear detectors with cylindrical shape.
 class MANTID_NEXUSGEOMETRY_DLL TubeBuilder {
 public:
   TubeBuilder(const Mantid::Geometry::IObject &pixelShape,
-              Eigen::Vector3d firstDetectorPosition, int firstDetectorId);
+              const Eigen::Vector3d &firstDetectorPosition,
+              int firstDetectorId);
   const Eigen::Vector3d &tubePosition() const;
   const std::vector<Eigen::Vector3d> &detPositions() const;
   const std::vector<int> &detIDs() const;
diff --git a/Framework/NexusGeometry/src/InstrumentBuilder.cpp b/Framework/NexusGeometry/src/InstrumentBuilder.cpp
index 22df87101ee..30e54b073b6 100644
--- a/Framework/NexusGeometry/src/InstrumentBuilder.cpp
+++ b/Framework/NexusGeometry/src/InstrumentBuilder.cpp
@@ -14,6 +14,7 @@
 
 #include "MantidNexusGeometry/NexusShapeFactory.h"
 #include <boost/make_shared.hpp>
+#include <utility>
 
 namespace Mantid {
 namespace NexusGeometry {
@@ -56,7 +57,7 @@ InstrumentBuilder::addComponent(const std::string &compName,
 */
 void InstrumentBuilder::addTubes(
     const std::string &bankName, const std::vector<detail::TubeBuilder> &tubes,
-    boost::shared_ptr<const Mantid::Geometry::IObject> pixelShape) {
+    const boost::shared_ptr<const Mantid::Geometry::IObject> &pixelShape) {
   for (size_t i = 0; i < tubes.size(); i++)
     doAddTube(bankName + "_tube_" + std::to_string(i), tubes[i], pixelShape);
 }
@@ -68,7 +69,7 @@ void InstrumentBuilder::addTubes(
 */
 void InstrumentBuilder::doAddTube(
     const std::string &compName, const detail::TubeBuilder &tube,
-    boost::shared_ptr<const Mantid::Geometry::IObject> pixelShape) {
+    const boost::shared_ptr<const Mantid::Geometry::IObject> &pixelShape) {
   auto *objComp(new Geometry::ObjCompAssembly(compName));
   const auto &pos = tube.tubePosition();
   objComp->setPos(pos(0), pos(1), pos(2));
@@ -98,7 +99,7 @@ void InstrumentBuilder::addDetectorToLastBank(
   detector->translate(Mantid::Kernel::toV3D(relativeOffset));
   // No rotation set for detector pixels of a bank. This is not possible in the
   // Nexus Geometry specification.
-  detector->setShape(shape);
+  detector->setShape(std::move(shape));
   m_lastBank->add(detector);
   m_instrument->markAsDetectorIncomplete(detector);
 }
diff --git a/Framework/NexusGeometry/src/TubeBuilder.cpp b/Framework/NexusGeometry/src/TubeBuilder.cpp
index cc73f59d596..c01c154a3e7 100644
--- a/Framework/NexusGeometry/src/TubeBuilder.cpp
+++ b/Framework/NexusGeometry/src/TubeBuilder.cpp
@@ -17,7 +17,7 @@ namespace NexusGeometry {
 namespace detail {
 
 TubeBuilder::TubeBuilder(const Mantid::Geometry::IObject &pixelShape,
-                         Eigen::Vector3d firstDetectorPosition,
+                         const Eigen::Vector3d &firstDetectorPosition,
                          int firstDetectorId)
     : m_pixelHeight(pixelShape.getGeometryHandler()->shapeInfo().height()),
       m_pixelRadius(pixelShape.getGeometryHandler()->shapeInfo().radius()) {
diff --git a/Framework/Parallel/inc/MantidParallel/IO/EventLoader.h b/Framework/Parallel/inc/MantidParallel/IO/EventLoader.h
index ccda1bfe2ec..a058a511b4d 100644
--- a/Framework/Parallel/inc/MantidParallel/IO/EventLoader.h
+++ b/Framework/Parallel/inc/MantidParallel/IO/EventLoader.h
@@ -37,13 +37,13 @@ MANTID_PARALLEL_DLL void
 load(const Communicator &communicator, const std::string &filename,
      const std::string &groupName, const std::vector<std::string> &bankNames,
      const std::vector<int32_t> &bankOffsets,
-     std::vector<std::vector<Types::Event::TofEvent> *> eventLists);
+     const std::vector<std::vector<Types::Event::TofEvent> *> &eventLists);
 
 MANTID_PARALLEL_DLL void
 load(const std::string &filename, const std::string &groupName,
      const std::vector<std::string> &bankNames,
      const std::vector<int32_t> &bankOffsets,
-     std::vector<std::vector<Types::Event::TofEvent> *> eventLists,
+     const std::vector<std::vector<Types::Event::TofEvent> *> &eventLists,
      bool precalcEvents);
 
 } // namespace EventLoader
diff --git a/Framework/Parallel/inc/MantidParallel/IO/EventLoaderHelpers.h b/Framework/Parallel/inc/MantidParallel/IO/EventLoaderHelpers.h
index 866894d4c5a..9e0ff901105 100644
--- a/Framework/Parallel/inc/MantidParallel/IO/EventLoaderHelpers.h
+++ b/Framework/Parallel/inc/MantidParallel/IO/EventLoaderHelpers.h
@@ -76,10 +76,11 @@ void load(const Chunker &chunker, NXEventDataSource<TimeOffsetType> &dataSource,
 }
 
 template <class TimeOffsetType>
-void load(const Communicator &comm, const H5::Group &group,
-          const std::vector<std::string> &bankNames,
-          const std::vector<int32_t> &bankOffsets,
-          std::vector<std::vector<Types::Event::TofEvent> *> eventLists) {
+void load(
+    const Communicator &comm, const H5::Group &group,
+    const std::vector<std::string> &bankNames,
+    const std::vector<int32_t> &bankOffsets,
+    const std::vector<std::vector<Types::Event::TofEvent> *> &eventLists) {
   // In tests loading from a single SSD this chunk size seems close to the
   // optimum. May need to be adjusted in the future (potentially dynamically)
   // when loading from parallel file systems and running on a cluster.
diff --git a/Framework/Parallel/src/Communicator.cpp b/Framework/Parallel/src/Communicator.cpp
index 0d8f458daf9..6e44485b03c 100644
--- a/Framework/Parallel/src/Communicator.cpp
+++ b/Framework/Parallel/src/Communicator.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidParallel/Communicator.h"
 
 #ifdef MPI_EXPERIMENTAL
@@ -24,7 +26,7 @@ Communicator::Communicator(const boost::mpi::communicator &comm)
 
 Communicator::Communicator(boost::shared_ptr<detail::ThreadingBackend> backend,
                            const int rank)
-    : m_backend(backend), m_rank(rank) {}
+    : m_backend(std::move(backend)), m_rank(rank) {}
 
 int Communicator::rank() const {
   if (m_backend)
diff --git a/Framework/Parallel/src/IO/EventLoader.cpp b/Framework/Parallel/src/IO/EventLoader.cpp
index 170795e68bb..a4a0ba4641a 100644
--- a/Framework/Parallel/src/IO/EventLoader.cpp
+++ b/Framework/Parallel/src/IO/EventLoader.cpp
@@ -45,11 +45,11 @@ makeAnyEventIdToBankMap(const std::string &filename,
 }
 
 /// Load events from given banks into event lists using MPI.
-void load(const Communicator &comm, const std::string &filename,
-          const std::string &groupName,
-          const std::vector<std::string> &bankNames,
-          const std::vector<int32_t> &bankOffsets,
-          std::vector<std::vector<Types::Event::TofEvent> *> eventLists) {
+void load(
+    const Communicator &comm, const std::string &filename,
+    const std::string &groupName, const std::vector<std::string> &bankNames,
+    const std::vector<int32_t> &bankOffsets,
+    const std::vector<std::vector<Types::Event::TofEvent> *> &eventLists) {
   H5::H5File file(filename, H5F_ACC_RDONLY);
   H5::Group group = file.openGroup(groupName);
   load(readDataType(group, bankNames, "event_time_offset"), comm, group,
@@ -60,7 +60,7 @@ void load(const Communicator &comm, const std::string &filename,
 void load(const std::string &filename, const std::string &groupname,
           const std::vector<std::string> &bankNames,
           const std::vector<int32_t> &bankOffsets,
-          std::vector<std::vector<Types::Event::TofEvent> *> eventLists,
+          const std::vector<std::vector<Types::Event::TofEvent> *> &eventLists,
           bool precalcEvents) {
   auto concurencyNumber = PARALLEL_GET_MAX_THREADS;
   auto numThreads = std::max<int>(concurencyNumber / 2, 1);
diff --git a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmHistory.cpp b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmHistory.cpp
index 03a7faa6ae7..f45dc113d3d 100644
--- a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmHistory.cpp
+++ b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmHistory.cpp
@@ -27,7 +27,7 @@ using namespace boost::python;
  * @returns A python list created from the set of child algorithm histories
  */
 boost::python::list
-getChildrenAsList(boost::shared_ptr<AlgorithmHistory> self) {
+getChildrenAsList(const boost::shared_ptr<AlgorithmHistory> &self) {
   boost::python::list names;
   const auto histories = self->getChildHistories();
   for (const auto &history : histories) {
diff --git a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmObserver.cpp b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmObserver.cpp
index d42b9dd3121..867fcfa855f 100644
--- a/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmObserver.cpp
+++ b/Framework/PythonInterface/mantid/api/src/Exports/AlgorithmObserver.cpp
@@ -14,22 +14,23 @@ using namespace Mantid::API;
 using namespace Mantid::PythonInterface;
 using namespace boost::python;
 
-void observeFinish(AlgorithmObserver &self, boost::python::object alg) {
+void observeFinish(AlgorithmObserver &self, const boost::python::object &alg) {
   IAlgorithm_sptr &calg = boost::python::extract<IAlgorithm_sptr &>(alg);
   self.observeFinish(calg);
 }
 
-void observeError(AlgorithmObserver &self, boost::python::object alg) {
+void observeError(AlgorithmObserver &self, const boost::python::object &alg) {
   IAlgorithm_sptr &calg = boost::python::extract<IAlgorithm_sptr &>(alg);
   self.observeError(calg);
 }
 
-void observeProgress(AlgorithmObserver &self, boost::python::object alg) {
+void observeProgress(AlgorithmObserver &self,
+                     const boost::python::object &alg) {
   IAlgorithm_sptr &calg = boost::python::extract<IAlgorithm_sptr &>(alg);
   self.observeProgress(calg);
 }
 
-void stopObserving(AlgorithmObserver &self, boost::python::object alg) {
+void stopObserving(AlgorithmObserver &self, const boost::python::object &alg) {
   IAlgorithm_sptr &calg = boost::python::extract<IAlgorithm_sptr &>(alg);
   self.stopObserving(calg);
 }
diff --git a/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp b/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp
index 867883010c0..b03273526f0 100644
--- a/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp
+++ b/Framework/PythonInterface/mantid/api/src/Exports/FileFinder.cpp
@@ -39,7 +39,8 @@ GNU_DIAG_ON("unused-local-typedef")
  * combination of exts_list and facility_exts.
  */
 std::vector<std::string> runFinderProxy(FileFinderImpl &self,
-                                        std::string hintstr, list exts_list,
+                                        const std::string &hintstr,
+                                        list exts_list,
                                         const bool useExtsOnly) {
   // Convert python list to c++ vector
   std::vector<std::string> exts;
diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp
index e5245a9dc57..2817282c22a 100644
--- a/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp
+++ b/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp
@@ -16,6 +16,7 @@
 #include <boost/python/iterator.hpp>
 #include <boost/python/manage_new_object.hpp>
 #include <boost/python/return_internal_reference.hpp>
+#include <utility>
 
 using namespace boost::python;
 using namespace Mantid::Geometry;
@@ -102,7 +103,7 @@ public:
       throw std::runtime_error(columnName +
                                " is a read only column of a peaks workspace");
     }
-    m_setterMap[columnName](peak, value);
+    m_setterMap[columnName](peak, std::move(value));
   }
 
 private:
@@ -122,7 +123,7 @@ private:
    * setter's value type
    */
   template <typename T> SetterType setterFunction(MemberFunc<T> func) {
-    return [func](IPeak &peak, const object value) {
+    return [func](IPeak &peak, const object &value) {
       extract<T> extractor{value};
       if (!extractor.check()) {
         throw std::runtime_error(
@@ -143,7 +144,7 @@ private:
    * setter's value type
    */
   SetterType setterFunction(MemberFuncV3D func) {
-    return [func](IPeak &peak, const object value) {
+    return [func](IPeak &peak, const object &value) {
       extract<const V3D &> extractor{value};
       if (!extractor.check()) {
         throw std::runtime_error(
diff --git a/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp
index deaa6bd6c3d..e2bf4e2c7df 100644
--- a/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp
+++ b/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp
@@ -82,7 +82,7 @@ namespace {
  * @param typeID The python identifier of the column type.
  * @param row The row to get the value from.
  */
-PyObject *getValue(Mantid::API::Column_const_sptr column,
+PyObject *getValue(const Mantid::API::Column_const_sptr &column,
                    const std::type_info &typeID, const int row) {
   if (typeID.hash_code() == typeid(Mantid::API::Boolean).hash_code()) {
     bool res = column->cell<Mantid::API::Boolean>(row);
@@ -129,7 +129,7 @@ PyObject *getValue(Mantid::API::Column_const_sptr column,
  * @param row :: The index of the row
  * @param value :: The value to set
  */
-void setValue(const Column_sptr column, const int row, const object &value) {
+void setValue(const Column_sptr &column, const int row, const object &value) {
   const auto &typeID = column->get_type_info();
 
   // Special case: Treat Mantid Boolean as normal bool
@@ -542,7 +542,7 @@ public:
     return data;
   }
 
-  static void setstate(ITableWorkspace &ws, dict state) {
+  static void setstate(ITableWorkspace &ws, const dict &state) {
     readMetaData(ws, state);
     readData(ws, state);
   }
diff --git a/Framework/PythonInterface/mantid/api/src/Exports/Run.cpp b/Framework/PythonInterface/mantid/api/src/Exports/Run.cpp
index 86e71d566f2..1a7e17e2221 100644
--- a/Framework/PythonInterface/mantid/api/src/Exports/Run.cpp
+++ b/Framework/PythonInterface/mantid/api/src/Exports/Run.cpp
@@ -16,6 +16,7 @@
 #include <boost/python/list.hpp>
 #include <boost/python/overloads.hpp>
 #include <boost/python/register_ptr_to_python.hpp>
+#include <utility>
 
 using Mantid::API::LogManager;
 using Mantid::API::Run;
@@ -103,7 +104,7 @@ void addOrReplaceProperty(Run &self, const std::string &name,
  * @param key The key
  * @param default_ The default to return if it does not exist
  */
-bpl::object getWithDefault(bpl::object self, bpl::object key,
+bpl::object getWithDefault(bpl::object self, const bpl::object &key,
                            bpl::object default_) {
   bpl::object exists(self.attr("__contains__"));
   if (extract<bool>(exists(key))()) {
@@ -119,8 +120,8 @@ bpl::object getWithDefault(bpl::object self, bpl::object key,
  * @param self The bpl::object called on
  * @param key The key
  */
-bpl::object get(bpl::object self, bpl::object key) {
-  return getWithDefault(self, key, bpl::object());
+bpl::object get(bpl::object self, const bpl::object &key) {
+  return getWithDefault(std::move(self), std::move(key), bpl::object());
 }
 
 /**
diff --git a/Framework/PythonInterface/mantid/api/src/FitFunctions/IFunctionAdapter.cpp b/Framework/PythonInterface/mantid/api/src/FitFunctions/IFunctionAdapter.cpp
index 6428d5c8bd1..bda56715c42 100644
--- a/Framework/PythonInterface/mantid/api/src/FitFunctions/IFunctionAdapter.cpp
+++ b/Framework/PythonInterface/mantid/api/src/FitFunctions/IFunctionAdapter.cpp
@@ -10,6 +10,7 @@
 
 #include <boost/python/class.hpp>
 #include <boost/python/list.hpp>
+#include <utility>
 
 #define PY_ARRAY_UNIQUE_SYMBOL API_ARRAY_API
 #define NO_IMPORT_ARRAY
@@ -80,7 +81,7 @@ IFunction::Attribute createAttributeFromPythonValue(const object &value) {
 IFunctionAdapter::IFunctionAdapter(PyObject *self, std::string functionMethod,
                                    std::string derivMethod)
     : m_self(self), m_functionName(std::move(functionMethod)),
-      m_derivName(derivMethod),
+      m_derivName(std::move(derivMethod)),
       m_derivOveridden(typeHasAttribute(self, m_derivName.c_str())) {
   if (!typeHasAttribute(self, "init"))
     throw std::runtime_error("Function does not define an init method.");
diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/UnitCell.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/UnitCell.cpp
index a2880c72ca7..5811c325eb7 100644
--- a/Framework/PythonInterface/mantid/geometry/src/Exports/UnitCell.cpp
+++ b/Framework/PythonInterface/mantid/geometry/src/Exports/UnitCell.cpp
@@ -30,7 +30,7 @@ namespace //<unnamed>
 using namespace Mantid::PythonInterface;
 
 /// Pass-through function to set the unit cell from a 2D numpy array
-void recalculateFromGstar(UnitCell &self, object values) {
+void recalculateFromGstar(UnitCell &self, const object &values) {
   // Create a double matrix and put this in to the unit cell
   self.recalculateFromGstar(Converters::PyObjectToMatrix(values)());
 }
diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayProperty.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayProperty.cpp
index 9fdb7d3f4cd..0c904dd32a9 100644
--- a/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayProperty.cpp
+++ b/Framework/PythonInterface/mantid/kernel/src/Exports/ArrayProperty.cpp
@@ -114,7 +114,7 @@ template <> std::string dtype(ArrayProperty<std::string> &self) {
 template <typename T>
 ArrayProperty<T> *createArrayPropertyFromList(const std::string &name,
                                               const boost::python::list &values,
-                                              IValidator_sptr validator,
+                                              const IValidator_sptr &validator,
                                               const unsigned int direction) {
   return new ArrayProperty<T>(name, Converters::PySequenceToVector<T>(values)(),
                               validator, direction);
@@ -130,10 +130,10 @@ ArrayProperty<T> *createArrayPropertyFromList(const std::string &name,
  * @return
  */
 template <typename T>
-ArrayProperty<T> *createArrayPropertyFromNDArray(const std::string &name,
-                                                 const NDArray &values,
-                                                 IValidator_sptr validator,
-                                                 const unsigned int direction) {
+ArrayProperty<T> *
+createArrayPropertyFromNDArray(const std::string &name, const NDArray &values,
+                               const IValidator_sptr &validator,
+                               const unsigned int direction) {
   return new ArrayProperty<T>(name, Converters::NDArrayToVector<T>(values)(),
                               validator, direction);
 }
diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/CompositeValidator.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/CompositeValidator.cpp
index f2cc1cb0d7b..685993a4f75 100644
--- a/Framework/PythonInterface/mantid/kernel/src/Exports/CompositeValidator.cpp
+++ b/Framework/PythonInterface/mantid/kernel/src/Exports/CompositeValidator.cpp
@@ -52,7 +52,7 @@ void export_CompositeValidator() {
                &createCompositeValidator, default_call_policies(),
                (arg("validators"), arg("relation") = CompositeRelation::AND)))
       .def("add",
-           (void (CompositeValidator::*)(IValidator_sptr)) &
+           (void (CompositeValidator::*)(const IValidator_sptr &)) &
                CompositeValidator::add,
            (arg("self"), arg("other")), "Add another validator to the list");
 }
diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/IPropertyManager.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/IPropertyManager.cpp
index 0ff4fb1eb75..ebff49089ca 100644
--- a/Framework/PythonInterface/mantid/kernel/src/Exports/IPropertyManager.cpp
+++ b/Framework/PythonInterface/mantid/kernel/src/Exports/IPropertyManager.cpp
@@ -76,7 +76,7 @@ void setProperties(IPropertyManager &self, const boost::python::dict &kwargs) {
  * @param value :: The value of the property as a bpl object
  */
 void declareProperty(IPropertyManager &self, const std::string &name,
-                     boost::python::object value) {
+                     const boost::python::object &value) {
   auto p = std::unique_ptr<Property>(
       Registry::PropertyWithValueFactory::create(name, value, 0));
   self.declareProperty(std::move(p));
@@ -91,7 +91,7 @@ void declareProperty(IPropertyManager &self, const std::string &name,
  * @param value :: The value of the property as a bpl object
  */
 void declareOrSetProperty(IPropertyManager &self, const std::string &name,
-                          boost::python::object value) {
+                          const boost::python::object &value) {
   bool propExists = self.existsProperty(name);
   if (propExists) {
     setProperty(self, name, value);
diff --git a/Framework/RemoteJobManagers/inc/MantidRemoteJobManagers/MantidWebServiceAPIHelper.h b/Framework/RemoteJobManagers/inc/MantidRemoteJobManagers/MantidWebServiceAPIHelper.h
index cd27ba638b8..118dd2fc36b 100644
--- a/Framework/RemoteJobManagers/inc/MantidRemoteJobManagers/MantidWebServiceAPIHelper.h
+++ b/Framework/RemoteJobManagers/inc/MantidRemoteJobManagers/MantidWebServiceAPIHelper.h
@@ -82,13 +82,13 @@ public:
 private:
   // Wraps up some of the boilerplate code needed to execute HTTP GET and POST
   // requests
-  void initGetRequest(Poco::Net::HTTPRequest &req, std::string extraPath,
-                      std::string queryString) const;
+  void initGetRequest(Poco::Net::HTTPRequest &req, const std::string &extraPath,
+                      const std::string &queryString) const;
   void initPostRequest(Poco::Net::HTTPRequest &req,
-                       std::string extraPath) const;
+                       const std::string &extraPath) const;
   void initHTTPRequest(Poco::Net::HTTPRequest &req, const std::string &method,
-                       std::string extraPath,
-                       std::string queryString = "") const;
+                       const std::string &extraPath,
+                       const std::string &queryString = "") const;
 
   std::string m_displayName;
   std::string
diff --git a/Framework/RemoteJobManagers/src/MantidWebServiceAPIHelper.cpp b/Framework/RemoteJobManagers/src/MantidWebServiceAPIHelper.cpp
index 25308d73222..1c45bfde63d 100644
--- a/Framework/RemoteJobManagers/src/MantidWebServiceAPIHelper.cpp
+++ b/Framework/RemoteJobManagers/src/MantidWebServiceAPIHelper.cpp
@@ -19,6 +19,7 @@
 
 #include <ostream>
 #include <sstream>
+#include <utility>
 
 namespace Mantid {
 namespace RemoteJobManagers {
@@ -169,22 +170,22 @@ void MantidWebServiceAPIHelper::clearSessionCookies() { g_cookies.clear(); }
 
 // Wrappers for a lot of the boilerplate code needed to perform an HTTPS GET or
 // POST
-void MantidWebServiceAPIHelper::initGetRequest(Poco::Net::HTTPRequest &req,
-                                               std::string extraPath,
-                                               std::string queryString) const {
-  return initHTTPRequest(req, Poco::Net::HTTPRequest::HTTP_GET, extraPath,
-                         queryString);
+void MantidWebServiceAPIHelper::initGetRequest(
+    Poco::Net::HTTPRequest &req, const std::string &extraPath,
+    const std::string &queryString) const {
+  return initHTTPRequest(req, Poco::Net::HTTPRequest::HTTP_GET,
+                         std::move(extraPath), std::move(queryString));
 }
 
-void MantidWebServiceAPIHelper::initPostRequest(Poco::Net::HTTPRequest &req,
-                                                std::string extraPath) const {
-  return initHTTPRequest(req, Poco::Net::HTTPRequest::HTTP_POST, extraPath);
+void MantidWebServiceAPIHelper::initPostRequest(
+    Poco::Net::HTTPRequest &req, const std::string &extraPath) const {
+  return initHTTPRequest(req, Poco::Net::HTTPRequest::HTTP_POST,
+                         std::move(extraPath));
 }
 
-void MantidWebServiceAPIHelper::initHTTPRequest(Poco::Net::HTTPRequest &req,
-                                                const std::string &method,
-                                                std::string extraPath,
-                                                std::string queryString) const {
+void MantidWebServiceAPIHelper::initHTTPRequest(
+    Poco::Net::HTTPRequest &req, const std::string &method,
+    const std::string &extraPath, const std::string &queryString) const {
   // Set up the session object
   m_session.reset();
 
diff --git a/Framework/SINQ/inc/MantidSINQ/InvertMDDim.h b/Framework/SINQ/inc/MantidSINQ/InvertMDDim.h
index 29a5ffca558..dfc7952fa12 100644
--- a/Framework/SINQ/inc/MantidSINQ/InvertMDDim.h
+++ b/Framework/SINQ/inc/MantidSINQ/InvertMDDim.h
@@ -44,13 +44,14 @@ private:
   /// Execution code
   void exec() override;
 
-  void copyMetaData(Mantid::API::IMDHistoWorkspace_sptr inws,
-                    Mantid::API::IMDHistoWorkspace_sptr outws);
-  void recurseDim(Mantid::API::IMDHistoWorkspace_sptr inWS,
-                  Mantid::API::IMDHistoWorkspace_sptr outWS, int currentDim,
-                  int *idx, int rank);
+  void copyMetaData(const Mantid::API::IMDHistoWorkspace_sptr &inws,
+                    const Mantid::API::IMDHistoWorkspace_sptr &outws);
+  void recurseDim(const Mantid::API::IMDHistoWorkspace_sptr &inWS,
+                  const Mantid::API::IMDHistoWorkspace_sptr &outWS,
+                  int currentDim, int *idx, int rank);
 
-  unsigned int calcIndex(Mantid::API::IMDHistoWorkspace_sptr ws, int *dim);
-  unsigned int calcInvertedIndex(Mantid::API::IMDHistoWorkspace_sptr ws,
+  unsigned int calcIndex(const Mantid::API::IMDHistoWorkspace_sptr &ws,
+                         int *dim);
+  unsigned int calcInvertedIndex(const Mantid::API::IMDHistoWorkspace_sptr &ws,
                                  int *dim);
 };
diff --git a/Framework/SINQ/inc/MantidSINQ/LoadFlexiNexus.h b/Framework/SINQ/inc/MantidSINQ/LoadFlexiNexus.h
index a1085680de8..297e47d7437 100644
--- a/Framework/SINQ/inc/MantidSINQ/LoadFlexiNexus.h
+++ b/Framework/SINQ/inc/MantidSINQ/LoadFlexiNexus.h
@@ -64,7 +64,7 @@ private:
   // A dictionary
   std::map<std::string, std::string> dictionary;
 
-  void loadDictionary(std::string dictionaryFile);
+  void loadDictionary(const std::string &dictionaryFile);
 
   void load2DWorkspace(NeXus::File *fin);
 
@@ -80,10 +80,10 @@ private:
 
   std::unordered_set<std::string> populateSpecialMap();
 
-  void addMetaData(NeXus::File *fin, Mantid::API::Workspace_sptr ws,
-                   Mantid::API::ExperimentInfo_sptr info);
+  void addMetaData(NeXus::File *fin, const Mantid::API::Workspace_sptr &ws,
+                   const Mantid::API::ExperimentInfo_sptr &info);
 
-  int safeOpenpath(NeXus::File *fin, std::string path);
+  int safeOpenpath(NeXus::File *fin, const std::string &path);
   int calculateCAddress(int *pos, int *dim, int rank);
   int calculateF77Address(int *pos, int rank);
 };
diff --git a/Framework/SINQ/inc/MantidSINQ/MDHistoToWorkspace2D.h b/Framework/SINQ/inc/MantidSINQ/MDHistoToWorkspace2D.h
index b45e7d312e5..b2890b897d0 100644
--- a/Framework/SINQ/inc/MantidSINQ/MDHistoToWorkspace2D.h
+++ b/Framework/SINQ/inc/MantidSINQ/MDHistoToWorkspace2D.h
@@ -51,13 +51,13 @@ private:
 
   size_t m_rank;
   size_t m_currentSpectra;
-  size_t calculateNSpectra(Mantid::API::IMDHistoWorkspace_sptr inws);
-  void recurseData(Mantid::API::IMDHistoWorkspace_sptr inWS,
-                   Mantid::DataObjects::Workspace2D_sptr outWS,
+  size_t calculateNSpectra(const Mantid::API::IMDHistoWorkspace_sptr &inws);
+  void recurseData(const Mantid::API::IMDHistoWorkspace_sptr &inWS,
+                   const Mantid::DataObjects::Workspace2D_sptr &outWS,
                    size_t currentDim, Mantid::coord_t *pos);
 
-  void checkW2D(Mantid::DataObjects::Workspace2D_sptr outWS);
+  void checkW2D(const Mantid::DataObjects::Workspace2D_sptr &outWS);
 
-  void copyMetaData(Mantid::API::IMDHistoWorkspace_sptr inWS,
-                    Mantid::DataObjects::Workspace2D_sptr outWS);
+  void copyMetaData(const Mantid::API::IMDHistoWorkspace_sptr &inWS,
+                    const Mantid::DataObjects::Workspace2D_sptr &outWS);
 };
diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiAutoCorrelation5.h b/Framework/SINQ/inc/MantidSINQ/PoldiAutoCorrelation5.h
index fe59f3c4210..e4ac09f9774 100644
--- a/Framework/SINQ/inc/MantidSINQ/PoldiAutoCorrelation5.h
+++ b/Framework/SINQ/inc/MantidSINQ/PoldiAutoCorrelation5.h
@@ -59,8 +59,8 @@ protected:
   void exec() override;
 
   void logConfigurationInformation(
-      boost::shared_ptr<PoldiDeadWireDecorator> cleanDetector,
-      PoldiAbstractChopper_sptr chopper);
+      const boost::shared_ptr<PoldiDeadWireDecorator> &cleanDetector,
+      const PoldiAbstractChopper_sptr &chopper);
 
 private:
   /// Overwrites Algorithm method.
diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiFitPeaks1D.h b/Framework/SINQ/inc/MantidSINQ/PoldiFitPeaks1D.h
index 9bc3749470e..444ff42d500 100644
--- a/Framework/SINQ/inc/MantidSINQ/PoldiFitPeaks1D.h
+++ b/Framework/SINQ/inc/MantidSINQ/PoldiFitPeaks1D.h
@@ -43,9 +43,10 @@ protected:
 
   API::IFunction_sptr getPeakProfile(const PoldiPeak_sptr &poldiPeak) const;
   void
-  setValuesFromProfileFunction(PoldiPeak_sptr poldiPeak,
+  setValuesFromProfileFunction(const PoldiPeak_sptr &poldiPeak,
                                const API::IFunction_sptr &fittedFunction) const;
-  double getFwhmWidthRelation(API::IPeakFunction_sptr peakFunction) const;
+  double
+  getFwhmWidthRelation(const API::IPeakFunction_sptr &peakFunction) const;
 
   API::IAlgorithm_sptr
   getFitAlgorithm(const DataObjects::Workspace2D_sptr &dataWorkspace,
diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiFitPeaks1D2.h b/Framework/SINQ/inc/MantidSINQ/PoldiFitPeaks1D2.h
index 895e1d514b7..65138c4e17f 100644
--- a/Framework/SINQ/inc/MantidSINQ/PoldiFitPeaks1D2.h
+++ b/Framework/SINQ/inc/MantidSINQ/PoldiFitPeaks1D2.h
@@ -106,10 +106,11 @@ protected:
   API::IFunction_sptr getPeakProfile(const PoldiPeak_sptr &poldiPeak) const;
 
   void
-  setValuesFromProfileFunction(PoldiPeak_sptr poldiPeak,
+  setValuesFromProfileFunction(const PoldiPeak_sptr &poldiPeak,
                                const API::IFunction_sptr &fittedFunction) const;
 
-  double getFwhmWidthRelation(API::IPeakFunction_sptr peakFunction) const;
+  double
+  getFwhmWidthRelation(const API::IPeakFunction_sptr &peakFunction) const;
 
   API::IAlgorithm_sptr
   getFitAlgorithm(const DataObjects::Workspace2D_sptr &dataWorkspace,
diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiFitPeaks2D.h b/Framework/SINQ/inc/MantidSINQ/PoldiFitPeaks2D.h
index e9394f8cc54..62d7459d1f0 100644
--- a/Framework/SINQ/inc/MantidSINQ/PoldiFitPeaks2D.h
+++ b/Framework/SINQ/inc/MantidSINQ/PoldiFitPeaks2D.h
@@ -75,7 +75,7 @@ protected:
 
   // Conversion between peaks and functions
   PoldiPeak_sptr
-  getPeakFromPeakFunction(API::IPeakFunction_sptr profileFunction,
+  getPeakFromPeakFunction(const API::IPeakFunction_sptr &profileFunction,
                           const Kernel::V3D &hkl);
 
   // Conversion between peak collections and functions
@@ -83,11 +83,11 @@ protected:
   getFunctionFromPeakCollection(const PoldiPeakCollection_sptr &peakCollection);
 
   Poldi2DFunction_sptr getFunctionIndividualPeaks(
-      std::string profileFunctionName,
+      const std::string &profileFunctionName,
       const PoldiPeakCollection_sptr &peakCollection) const;
 
   Poldi2DFunction_sptr
-  getFunctionPawley(std::string profileFunctionName,
+  getFunctionPawley(const std::string &profileFunctionName,
                     const PoldiPeakCollection_sptr &peakCollection);
 
   std::string getLatticeSystemFromPointGroup(
@@ -131,7 +131,7 @@ protected:
   API::IFunction_sptr
   getFunction(const API::IAlgorithm_sptr &fitAlgorithm) const;
 
-  void addBackgroundTerms(Poldi2DFunction_sptr poldi2DFunction) const;
+  void addBackgroundTerms(const Poldi2DFunction_sptr &poldi2DFunction) const;
 
   boost::shared_ptr<Kernel::DblMatrix> getLocalCovarianceMatrix(
       const boost::shared_ptr<const Kernel::DblMatrix> &covarianceMatrix,
diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h b/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h
index 3c3da954772..b308644161e 100644
--- a/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h
+++ b/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h
@@ -62,16 +62,17 @@ protected:
       MantidVec::const_iterator baseDataStart,
       MantidVec::const_iterator originalDataStart) const;
 
-  UncertainValue
-  getBackgroundWithSigma(std::list<MantidVec::const_iterator> peakPositions,
-                         const MantidVec &correlationCounts) const;
-  MantidVec getBackground(std::list<MantidVec::const_iterator> peakPositions,
-                          const MantidVec &correlationCounts) const;
+  UncertainValue getBackgroundWithSigma(
+      const std::list<MantidVec::const_iterator> &peakPositions,
+      const MantidVec &correlationCounts) const;
+  MantidVec
+  getBackground(const std::list<MantidVec::const_iterator> &peakPositions,
+                const MantidVec &correlationCounts) const;
   bool distanceToPeaksGreaterThanMinimum(
       std::list<MantidVec::const_iterator> peakPositions,
       MantidVec::const_iterator point) const;
   size_t getNumberOfBackgroundPoints(
-      std::list<MantidVec::const_iterator> peakPositions,
+      const std::list<MantidVec::const_iterator> &peakPositions,
       const MantidVec &correlationCounts) const;
 
   double getMedianFromSortedVector(MantidVec::const_iterator begin,
@@ -95,8 +96,9 @@ protected:
                          MantidVec::const_iterator peakPosition,
                          const MantidVec &xData) const;
 
-  void setErrorsOnWorkspace(DataObjects::Workspace2D_sptr correlationWorkspace,
-                            double error) const;
+  void setErrorsOnWorkspace(
+      const DataObjects::Workspace2D_sptr &correlationWorkspace,
+      double error) const;
 
   void setMinimumDistance(int newMinimumDistance);
   void setMinimumPeakHeight(double newMinimumPeakHeight);
@@ -104,7 +106,7 @@ protected:
 
   static bool vectorElementGreaterThan(MantidVec::const_iterator first,
                                        MantidVec::const_iterator second);
-  bool isLessThanMinimum(PoldiPeak_sptr peak);
+  bool isLessThanMinimum(const PoldiPeak_sptr &peak);
 
   int m_minimumDistance;
   int m_doubleMinimumDistance;
diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiTruncateData.h b/Framework/SINQ/inc/MantidSINQ/PoldiTruncateData.h
index f14d9889ead..da2b9ecd3a7 100644
--- a/Framework/SINQ/inc/MantidSINQ/PoldiTruncateData.h
+++ b/Framework/SINQ/inc/MantidSINQ/PoldiTruncateData.h
@@ -42,10 +42,12 @@ public:
   size_t getActualBinCount();
 
 protected:
-  void setChopperFromWorkspace(API::MatrixWorkspace_const_sptr workspace);
+  void
+  setChopperFromWorkspace(const API::MatrixWorkspace_const_sptr &workspace);
   void setChopper(PoldiAbstractChopper_sptr chopper);
 
-  void setTimeBinWidthFromWorkspace(API::MatrixWorkspace_const_sptr workspace);
+  void setTimeBinWidthFromWorkspace(
+      const API::MatrixWorkspace_const_sptr &workspace);
   void setTimeBinWidth(double timeBinWidth);
   void setActualBinCount(size_t actualBinCount);
 
@@ -58,16 +60,17 @@ protected:
   getExtraCountsWorkspace(API::MatrixWorkspace_sptr workspace);
 
   API::MatrixWorkspace_sptr
-  getWorkspaceBelowX(API::MatrixWorkspace_sptr workspace, double x);
+  getWorkspaceBelowX(const API::MatrixWorkspace_sptr &workspace, double x);
   API::MatrixWorkspace_sptr
-  getWorkspaceAboveX(API::MatrixWorkspace_sptr workspace, double x);
+  getWorkspaceAboveX(const API::MatrixWorkspace_sptr &workspace, double x);
 
   API::Algorithm_sptr
-  getCropAlgorithmForWorkspace(API::MatrixWorkspace_sptr workspace);
-  API::MatrixWorkspace_sptr getOutputWorkspace(API::Algorithm_sptr algorithm);
+  getCropAlgorithmForWorkspace(const API::MatrixWorkspace_sptr &workspace);
+  API::MatrixWorkspace_sptr
+  getOutputWorkspace(const API::Algorithm_sptr &algorithm);
 
   API::MatrixWorkspace_sptr
-  getSummedSpectra(API::MatrixWorkspace_sptr workspace);
+  getSummedSpectra(const API::MatrixWorkspace_sptr &workspace);
 
   PoldiAbstractChopper_sptr m_chopper;
   double m_timeBinWidth;
diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiDeadWireDecorator.h b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiDeadWireDecorator.h
index ac667389111..83f317de25e 100644
--- a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiDeadWireDecorator.h
+++ b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiDeadWireDecorator.h
@@ -30,12 +30,14 @@ namespace Poldi {
   */
 class MANTID_SINQ_DLL PoldiDeadWireDecorator : public PoldiDetectorDecorator {
 public:
-  PoldiDeadWireDecorator(std::set<int> deadWires,
-                         boost::shared_ptr<PoldiAbstractDetector> detector =
-                             boost::shared_ptr<PoldiAbstractDetector>());
-  PoldiDeadWireDecorator(const Geometry::DetectorInfo &poldiDetectorInfo,
-                         boost::shared_ptr<PoldiAbstractDetector> detector =
-                             boost::shared_ptr<PoldiAbstractDetector>());
+  PoldiDeadWireDecorator(
+      std::set<int> deadWires,
+      const boost::shared_ptr<PoldiAbstractDetector> &detector =
+          boost::shared_ptr<PoldiAbstractDetector>());
+  PoldiDeadWireDecorator(
+      const Geometry::DetectorInfo &poldiDetectorInfo,
+      const boost::shared_ptr<PoldiAbstractDetector> &detector =
+          boost::shared_ptr<PoldiAbstractDetector>());
 
   void setDeadWires(std::set<int> deadWires);
   std::set<int> deadWires();
diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiPeakCollection.h b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiPeakCollection.h
index 993afd00cdb..04d41ccbd40 100644
--- a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiPeakCollection.h
+++ b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiPeakCollection.h
@@ -84,7 +84,7 @@ protected:
   std::string getUnitCellStringFromLog(const API::LogManager_sptr &tableLog);
 
   std::string getStringValueFromLog(const API::LogManager_sptr &logManager,
-                                    std::string valueName);
+                                    const std::string &valueName);
 
   std::string intensityTypeToString(IntensityType type) const;
   IntensityType intensityTypeFromString(std::string typeString) const;
diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiSourceSpectrum.h b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiSourceSpectrum.h
index 7b99555b342..66c3592715d 100644
--- a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiSourceSpectrum.h
+++ b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiSourceSpectrum.h
@@ -27,19 +27,19 @@ namespace Poldi {
 
 class MANTID_SINQ_DLL PoldiSourceSpectrum {
 public:
-  PoldiSourceSpectrum(Kernel::Interpolation spectrum);
-  PoldiSourceSpectrum(Geometry::Instrument_const_sptr poldiInstrument);
+  PoldiSourceSpectrum(const Kernel::Interpolation &spectrum);
+  PoldiSourceSpectrum(const Geometry::Instrument_const_sptr &poldiInstrument);
   double intensity(double wavelength) const;
 
 protected:
-  void
-  setSpectrumFromInstrument(Geometry::Instrument_const_sptr poldiInstrument);
+  void setSpectrumFromInstrument(
+      const Geometry::Instrument_const_sptr &poldiInstrument);
   Geometry::IComponent_const_sptr
-  getSourceComponent(Geometry::Instrument_const_sptr poldiInstrument);
-  Geometry::Parameter_sptr
-  getSpectrumParameter(Geometry::IComponent_const_sptr source,
-                       Geometry::ParameterMap_sptr instrumentParameterMap);
-  void setSpectrum(Geometry::Parameter_sptr spectrumParameter);
+  getSourceComponent(const Geometry::Instrument_const_sptr &poldiInstrument);
+  Geometry::Parameter_sptr getSpectrumParameter(
+      const Geometry::IComponent_const_sptr &source,
+      const Geometry::ParameterMap_sptr &instrumentParameterMap);
+  void setSpectrum(const Geometry::Parameter_sptr &spectrumParameter);
 
   Kernel::Interpolation m_spectrum;
 };
diff --git a/Framework/SINQ/inc/MantidSINQ/ProjectMD.h b/Framework/SINQ/inc/MantidSINQ/ProjectMD.h
index 59cc9aaf6ba..76bb71579a5 100644
--- a/Framework/SINQ/inc/MantidSINQ/ProjectMD.h
+++ b/Framework/SINQ/inc/MantidSINQ/ProjectMD.h
@@ -43,14 +43,16 @@ private:
   /// Execution code
   void exec() override;
 
-  void copyMetaData(Mantid::API::IMDHistoWorkspace_sptr inws,
-                    Mantid::API::IMDHistoWorkspace_sptr outws);
-  void sumData(Mantid::API::IMDHistoWorkspace_sptr inws,
-               Mantid::API::IMDHistoWorkspace_sptr outws, int *sourceDim,
+  void copyMetaData(const Mantid::API::IMDHistoWorkspace_sptr &inws,
+                    const Mantid::API::IMDHistoWorkspace_sptr &outws);
+  void sumData(const Mantid::API::IMDHistoWorkspace_sptr &inws,
+               const Mantid::API::IMDHistoWorkspace_sptr &outws, int *sourceDim,
                int *targetDim, int targetDimCount, int dimNo, int start,
                int end, int currentDim);
 
-  double getValue(Mantid::API::IMDHistoWorkspace_sptr ws, int *dim);
-  void putValue(Mantid::API::IMDHistoWorkspace_sptr ws, int *dim, double val);
-  unsigned int calcIndex(Mantid::API::IMDHistoWorkspace_sptr ws, int *dim);
+  double getValue(const Mantid::API::IMDHistoWorkspace_sptr &ws, int *dim);
+  void putValue(const Mantid::API::IMDHistoWorkspace_sptr &ws, int *dim,
+                double val);
+  unsigned int calcIndex(const Mantid::API::IMDHistoWorkspace_sptr &ws,
+                         int *dim);
 };
diff --git a/Framework/SINQ/inc/MantidSINQ/SINQHMListener.h b/Framework/SINQ/inc/MantidSINQ/SINQHMListener.h
index f5e8fb77406..1c3fa228624 100644
--- a/Framework/SINQ/inc/MantidSINQ/SINQHMListener.h
+++ b/Framework/SINQ/inc/MantidSINQ/SINQHMListener.h
@@ -52,11 +52,11 @@ private:
   int dim[3]; // @SINQ we only do 3D HM's, change when more dimensions
   std::string hmhost;
 
-  std::istream &httpRequest(std::string path);
+  std::istream &httpRequest(const std::string &path);
   void loadDimensions();
   void doSpecialDim();
-  void readHMData(Mantid::API::IMDHistoWorkspace_sptr ws);
-  void recurseDim(int *data, Mantid::API::IMDHistoWorkspace_sptr ws,
+  void readHMData(const Mantid::API::IMDHistoWorkspace_sptr &ws);
+  void recurseDim(int *data, const Mantid::API::IMDHistoWorkspace_sptr &ws,
                   int currentDim, Mantid::coord_t *idx);
   int calculateCAddress(Mantid::coord_t *pos);
 
diff --git a/Framework/SINQ/inc/MantidSINQ/SINQTranspose3D.h b/Framework/SINQ/inc/MantidSINQ/SINQTranspose3D.h
index 69c24e6415d..0c64ce7aefb 100644
--- a/Framework/SINQ/inc/MantidSINQ/SINQTranspose3D.h
+++ b/Framework/SINQ/inc/MantidSINQ/SINQTranspose3D.h
@@ -54,11 +54,11 @@ private:
   /// Execution code
   void exec() override;
 
-  void doYXZ(Mantid::API::IMDHistoWorkspace_sptr inws);
-  void doXZY(Mantid::API::IMDHistoWorkspace_sptr inws);
-  void doTRICS(Mantid::API::IMDHistoWorkspace_sptr inws);
-  void doAMOR(Mantid::API::IMDHistoWorkspace_sptr inws);
+  void doYXZ(const Mantid::API::IMDHistoWorkspace_sptr &inws);
+  void doXZY(const Mantid::API::IMDHistoWorkspace_sptr &inws);
+  void doTRICS(const Mantid::API::IMDHistoWorkspace_sptr &inws);
+  void doAMOR(const Mantid::API::IMDHistoWorkspace_sptr &inws);
 
-  void copyMetaData(Mantid::API::IMDHistoWorkspace_sptr inws,
-                    Mantid::API::IMDHistoWorkspace_sptr outws);
+  void copyMetaData(const Mantid::API::IMDHistoWorkspace_sptr &inws,
+                    const Mantid::API::IMDHistoWorkspace_sptr &outws);
 };
diff --git a/Framework/SINQ/inc/MantidSINQ/SliceMDHisto.h b/Framework/SINQ/inc/MantidSINQ/SliceMDHisto.h
index 7d3e390ff64..22a30baf55d 100644
--- a/Framework/SINQ/inc/MantidSINQ/SliceMDHisto.h
+++ b/Framework/SINQ/inc/MantidSINQ/SliceMDHisto.h
@@ -48,11 +48,11 @@ private:
 
   unsigned int m_rank;
   std::vector<int> m_dim;
-  void cutData(Mantid::API::IMDHistoWorkspace_sptr inWS,
-               Mantid::API::IMDHistoWorkspace_sptr outWS,
+  void cutData(const Mantid::API::IMDHistoWorkspace_sptr &inWS,
+               const Mantid::API::IMDHistoWorkspace_sptr &outWS,
                Mantid::coord_t *sourceDim, Mantid::coord_t *targetDim,
                std::vector<int> start, std::vector<int> end, unsigned int dim);
 
-  void copyMetaData(Mantid::API::IMDHistoWorkspace_sptr inws,
-                    Mantid::API::IMDHistoWorkspace_sptr outws);
+  void copyMetaData(const Mantid::API::IMDHistoWorkspace_sptr &inws,
+                    const Mantid::API::IMDHistoWorkspace_sptr &outws);
 };
diff --git a/Framework/SINQ/src/InvertMDDim.cpp b/Framework/SINQ/src/InvertMDDim.cpp
index 428afdddea0..f2d8e13a4bf 100644
--- a/Framework/SINQ/src/InvertMDDim.cpp
+++ b/Framework/SINQ/src/InvertMDDim.cpp
@@ -62,9 +62,9 @@ void InvertMDDim::exec() {
   setProperty("OutputWorkspace", outWS);
 }
 
-void InvertMDDim::recurseDim(IMDHistoWorkspace_sptr inWS,
-                             IMDHistoWorkspace_sptr outWS, int currentDim,
-                             int *idx, int rank) {
+void InvertMDDim::recurseDim(const IMDHistoWorkspace_sptr &inWS,
+                             const IMDHistoWorkspace_sptr &outWS,
+                             int currentDim, int *idx, int rank) {
   boost::shared_ptr<const IMDDimension> dimi = inWS->getDimension(currentDim);
   if (currentDim == rank - 1) {
     for (int i = 0; i < static_cast<int>(dimi->getNBins()); i++) {
@@ -82,8 +82,9 @@ void InvertMDDim::recurseDim(IMDHistoWorkspace_sptr inWS,
   }
 }
 
-void InvertMDDim::copyMetaData(Mantid::API::IMDHistoWorkspace_sptr inws,
-                               Mantid::API::IMDHistoWorkspace_sptr outws) {
+void InvertMDDim::copyMetaData(
+    const Mantid::API::IMDHistoWorkspace_sptr &inws,
+    const Mantid::API::IMDHistoWorkspace_sptr &outws) {
   outws->setTitle(inws->getTitle());
   ExperimentInfo_sptr info;
 
@@ -97,7 +98,8 @@ void InvertMDDim::copyMetaData(Mantid::API::IMDHistoWorkspace_sptr inws,
  * IMDHistoWorkspace.
  * I.e. a proper address calculation from an index array.
  */
-unsigned int InvertMDDim::calcIndex(IMDHistoWorkspace_sptr ws, int dim[]) {
+unsigned int InvertMDDim::calcIndex(const IMDHistoWorkspace_sptr &ws,
+                                    int dim[]) {
   size_t idx = 0;
   switch (ws->getNumDims()) {
   case 2:
@@ -115,7 +117,7 @@ unsigned int InvertMDDim::calcIndex(IMDHistoWorkspace_sptr ws, int dim[]) {
   return static_cast<unsigned int>(idx);
 }
 
-unsigned int InvertMDDim::calcInvertedIndex(IMDHistoWorkspace_sptr ws,
+unsigned int InvertMDDim::calcInvertedIndex(const IMDHistoWorkspace_sptr &ws,
                                             int dim[]) {
   size_t idx = 0;
   switch (ws->getNumDims()) {
diff --git a/Framework/SINQ/src/LoadFlexiNexus.cpp b/Framework/SINQ/src/LoadFlexiNexus.cpp
index 50b92f5544d..48156e4a8e1 100644
--- a/Framework/SINQ/src/LoadFlexiNexus.cpp
+++ b/Framework/SINQ/src/LoadFlexiNexus.cpp
@@ -71,7 +71,7 @@ void LoadFlexiNexus::exec() {
   readData(&fin);
 }
 
-void LoadFlexiNexus::loadDictionary(std::string dictFile) {
+void LoadFlexiNexus::loadDictionary(const std::string &dictFile) {
   std::ifstream in(dictFile.c_str(), std::ifstream::in);
   std::string line, key, value;
 
@@ -312,8 +312,8 @@ MDHistoDimension_sptr LoadFlexiNexus::makeDimension(NeXus::File *fin, int index,
   return MDHistoDimension_sptr(
       new MDHistoDimension(name, name, frame, min, max, length));
 }
-void LoadFlexiNexus::addMetaData(NeXus::File *fin, Workspace_sptr ws,
-                                 ExperimentInfo_sptr info) {
+void LoadFlexiNexus::addMetaData(NeXus::File *fin, const Workspace_sptr &ws,
+                                 const ExperimentInfo_sptr &info) {
   std::map<std::string, std::string>::const_iterator it;
 
   // assign a title
@@ -404,7 +404,7 @@ std::unordered_set<std::string> LoadFlexiNexus::populateSpecialMap() {
   return specialMap;
 }
 
-int LoadFlexiNexus::safeOpenpath(NeXus::File *fin, std::string path) {
+int LoadFlexiNexus::safeOpenpath(NeXus::File *fin, const std::string &path) {
   try {
     fin->openPath(path);
   } catch (NeXus::Exception &) {
diff --git a/Framework/SINQ/src/MDHistoToWorkspace2D.cpp b/Framework/SINQ/src/MDHistoToWorkspace2D.cpp
index db9f959ae21..e6761fdd99e 100644
--- a/Framework/SINQ/src/MDHistoToWorkspace2D.cpp
+++ b/Framework/SINQ/src/MDHistoToWorkspace2D.cpp
@@ -85,7 +85,8 @@ void MDHistoToWorkspace2D::exec() {
   setProperty("OutputWorkspace", boost::dynamic_pointer_cast<Workspace>(outWS));
 }
 
-size_t MDHistoToWorkspace2D::calculateNSpectra(IMDHistoWorkspace_sptr inWS) {
+size_t
+MDHistoToWorkspace2D::calculateNSpectra(const IMDHistoWorkspace_sptr &inWS) {
   size_t nSpectra = 1;
   for (size_t i = 0; i < m_rank - 1; i++) {
     boost::shared_ptr<const IMDDimension> dim = inWS->getDimension(i);
@@ -94,8 +95,8 @@ size_t MDHistoToWorkspace2D::calculateNSpectra(IMDHistoWorkspace_sptr inWS) {
   return nSpectra;
 }
 
-void MDHistoToWorkspace2D::recurseData(IMDHistoWorkspace_sptr inWS,
-                                       Workspace2D_sptr outWS,
+void MDHistoToWorkspace2D::recurseData(const IMDHistoWorkspace_sptr &inWS,
+                                       const Workspace2D_sptr &outWS,
                                        size_t currentDim, coord_t *pos) {
   boost::shared_ptr<const IMDDimension> dim = inWS->getDimension(currentDim);
   if (currentDim == m_rank - 1) {
@@ -128,7 +129,7 @@ void MDHistoToWorkspace2D::recurseData(IMDHistoWorkspace_sptr inWS,
 }
 
 void MDHistoToWorkspace2D::checkW2D(
-    Mantid::DataObjects::Workspace2D_sptr outWS) {
+    const Mantid::DataObjects::Workspace2D_sptr &outWS) {
   size_t nSpectra = outWS->getNumberHistograms();
   size_t length = outWS->blocksize();
 
@@ -155,8 +156,8 @@ void MDHistoToWorkspace2D::checkW2D(
 }
 
 void MDHistoToWorkspace2D::copyMetaData(
-    Mantid::API::IMDHistoWorkspace_sptr inWS,
-    Mantid::DataObjects::Workspace2D_sptr outWS) {
+    const Mantid::API::IMDHistoWorkspace_sptr &inWS,
+    const Mantid::DataObjects::Workspace2D_sptr &outWS) {
   if (inWS->getNumExperimentInfo() > 0) {
     ExperimentInfo_sptr info = inWS->getExperimentInfo(0);
     outWS->copyExperimentInfoFrom(info.get());
diff --git a/Framework/SINQ/src/PoldiAutoCorrelation5.cpp b/Framework/SINQ/src/PoldiAutoCorrelation5.cpp
index b7ee1476624..f40f8a392da 100644
--- a/Framework/SINQ/src/PoldiAutoCorrelation5.cpp
+++ b/Framework/SINQ/src/PoldiAutoCorrelation5.cpp
@@ -113,8 +113,8 @@ void PoldiAutoCorrelation5::exec() {
 }
 
 void PoldiAutoCorrelation5::logConfigurationInformation(
-    boost::shared_ptr<PoldiDeadWireDecorator> cleanDetector,
-    PoldiAbstractChopper_sptr chopper) {
+    const boost::shared_ptr<PoldiDeadWireDecorator> &cleanDetector,
+    const PoldiAbstractChopper_sptr &chopper) {
   if (cleanDetector && chopper) {
     g_log.information()
         << "____________________________________________________ \n";
diff --git a/Framework/SINQ/src/PoldiFitPeaks1D.cpp b/Framework/SINQ/src/PoldiFitPeaks1D.cpp
index b44a2547d45..f0cecc14250 100644
--- a/Framework/SINQ/src/PoldiFitPeaks1D.cpp
+++ b/Framework/SINQ/src/PoldiFitPeaks1D.cpp
@@ -113,7 +113,8 @@ PoldiFitPeaks1D::getPeakProfile(const PoldiPeak_sptr &poldiPeak) const {
 }
 
 void PoldiFitPeaks1D::setValuesFromProfileFunction(
-    PoldiPeak_sptr poldiPeak, const IFunction_sptr &fittedFunction) const {
+    const PoldiPeak_sptr &poldiPeak,
+    const IFunction_sptr &fittedFunction) const {
   CompositeFunction_sptr totalFunction =
       boost::dynamic_pointer_cast<CompositeFunction>(fittedFunction);
 
@@ -134,8 +135,8 @@ void PoldiFitPeaks1D::setValuesFromProfileFunction(
   }
 }
 
-double
-PoldiFitPeaks1D::getFwhmWidthRelation(IPeakFunction_sptr peakFunction) const {
+double PoldiFitPeaks1D::getFwhmWidthRelation(
+    const IPeakFunction_sptr &peakFunction) const {
   return peakFunction->fwhm() / peakFunction->getParameter(2);
 }
 
diff --git a/Framework/SINQ/src/PoldiFitPeaks1D2.cpp b/Framework/SINQ/src/PoldiFitPeaks1D2.cpp
index 257516171d6..c6a97a0dc4b 100644
--- a/Framework/SINQ/src/PoldiFitPeaks1D2.cpp
+++ b/Framework/SINQ/src/PoldiFitPeaks1D2.cpp
@@ -256,7 +256,8 @@ PoldiFitPeaks1D2::getPeakProfile(const PoldiPeak_sptr &poldiPeak) const {
 }
 
 void PoldiFitPeaks1D2::setValuesFromProfileFunction(
-    PoldiPeak_sptr poldiPeak, const IFunction_sptr &fittedFunction) const {
+    const PoldiPeak_sptr &poldiPeak,
+    const IFunction_sptr &fittedFunction) const {
   IPeakFunction_sptr peakFunction =
       boost::dynamic_pointer_cast<IPeakFunction>(fittedFunction);
 
@@ -271,8 +272,8 @@ void PoldiFitPeaks1D2::setValuesFromProfileFunction(
   }
 }
 
-double
-PoldiFitPeaks1D2::getFwhmWidthRelation(IPeakFunction_sptr peakFunction) const {
+double PoldiFitPeaks1D2::getFwhmWidthRelation(
+    const IPeakFunction_sptr &peakFunction) const {
   return peakFunction->fwhm() / peakFunction->getParameter(2);
 }
 
diff --git a/Framework/SINQ/src/PoldiFitPeaks2D.cpp b/Framework/SINQ/src/PoldiFitPeaks2D.cpp
index adb481bed87..e9456e9734b 100644
--- a/Framework/SINQ/src/PoldiFitPeaks2D.cpp
+++ b/Framework/SINQ/src/PoldiFitPeaks2D.cpp
@@ -381,9 +381,8 @@ PoldiPeakCollection_sptr PoldiFitPeaks2D::getCountPeakCollection(
 }
 
 /// Creates a PoldiPeak from the given profile function/hkl pair.
-PoldiPeak_sptr
-PoldiFitPeaks2D::getPeakFromPeakFunction(IPeakFunction_sptr profileFunction,
-                                         const V3D &hkl) {
+PoldiPeak_sptr PoldiFitPeaks2D::getPeakFromPeakFunction(
+    const IPeakFunction_sptr &profileFunction, const V3D &hkl) {
 
   // Use EstimatePeakErrors to calculate errors of FWHM and so on
   IAlgorithm_sptr errorAlg = createChildAlgorithm("EstimatePeakErrors");
@@ -466,7 +465,7 @@ Poldi2DFunction_sptr PoldiFitPeaks2D::getFunctionFromPeakCollection(
  * @return :: A Poldi2DFunction with peak profile functions.
  */
 Poldi2DFunction_sptr PoldiFitPeaks2D::getFunctionIndividualPeaks(
-    std::string profileFunctionName,
+    const std::string &profileFunctionName,
     const PoldiPeakCollection_sptr &peakCollection) const {
   auto mdFunction = boost::make_shared<Poldi2DFunction>();
 
@@ -519,7 +518,7 @@ Poldi2DFunction_sptr PoldiFitPeaks2D::getFunctionIndividualPeaks(
  * @return :: A Poldi2DFunction with a PawleyFunction.
  */
 Poldi2DFunction_sptr PoldiFitPeaks2D::getFunctionPawley(
-    std::string profileFunctionName,
+    const std::string &profileFunctionName,
     const PoldiPeakCollection_sptr &peakCollection) {
   auto mdFunction = boost::make_shared<Poldi2DFunction>();
 
@@ -1048,7 +1047,7 @@ PoldiFitPeaks2D::getFunction(const IAlgorithm_sptr &fitAlgorithm) const {
  * @param poldi2DFunction :: Poldi2DFunction to which the background is added.
  */
 void PoldiFitPeaks2D::addBackgroundTerms(
-    Poldi2DFunction_sptr poldi2DFunction) const {
+    const Poldi2DFunction_sptr &poldi2DFunction) const {
   bool addConstantBackground = getProperty("FitConstantBackground");
   if (addConstantBackground) {
     IFunction_sptr constantBackground =
diff --git a/Framework/SINQ/src/PoldiPeakSearch.cpp b/Framework/SINQ/src/PoldiPeakSearch.cpp
index 930825f230d..6c4dc245326 100644
--- a/Framework/SINQ/src/PoldiPeakSearch.cpp
+++ b/Framework/SINQ/src/PoldiPeakSearch.cpp
@@ -22,6 +22,7 @@
 #include <list>
 #include <numeric>
 #include <queue>
+#include <utility>
 
 #include "boost/math/distributions.hpp"
 
@@ -314,7 +315,7 @@ PoldiPeakSearch::getFWHMEstimate(const MantidVec::const_iterator &baseListStart,
  * @param error :: Error that is set on the workspace.
  */
 void PoldiPeakSearch::setErrorsOnWorkspace(
-    Workspace2D_sptr correlationWorkspace, double error) const {
+    const Workspace2D_sptr &correlationWorkspace, double error) const {
   MantidVec &errors = correlationWorkspace->dataE(0);
 
   std::fill(errors.begin(), errors.end(), error);
@@ -332,7 +333,7 @@ void PoldiPeakSearch::setErrorsOnWorkspace(
  * @return Vector only with counts that belong to the background.
  */
 MantidVec PoldiPeakSearch::getBackground(
-    std::list<MantidVec::const_iterator> peakPositions,
+    const std::list<MantidVec::const_iterator> &peakPositions,
     const MantidVec &correlationCounts) const {
   size_t backgroundPoints =
       getNumberOfBackgroundPoints(peakPositions, correlationCounts);
@@ -366,9 +367,10 @@ MantidVec PoldiPeakSearch::getBackground(
  * @return Background estimation with error.
  */
 UncertainValue PoldiPeakSearch::getBackgroundWithSigma(
-    std::list<MantidVec::const_iterator> peakPositions,
+    const std::list<MantidVec::const_iterator> &peakPositions,
     const MantidVec &correlationCounts) const {
-  MantidVec background = getBackground(peakPositions, correlationCounts);
+  MantidVec background =
+      getBackground(std::move(peakPositions), correlationCounts);
 
   /* Instead of using Mean and Standard deviation, which are appropriate
    * for data originating from a normal distribution (which is not the case
@@ -420,7 +422,7 @@ bool PoldiPeakSearch::distanceToPeaksGreaterThanMinimum(
  * @return Number of background points.
  */
 size_t PoldiPeakSearch::getNumberOfBackgroundPoints(
-    std::list<MantidVec::const_iterator> peakPositions,
+    const std::list<MantidVec::const_iterator> &peakPositions,
     const MantidVec &correlationCounts) const {
   /* subtracting 2, to match original algorithm, where
    * the first and the last point of the spectrum are not
@@ -528,7 +530,7 @@ bool PoldiPeakSearch::vectorElementGreaterThan(
   return *first > *second;
 }
 
-bool PoldiPeakSearch::isLessThanMinimum(PoldiPeak_sptr peak) {
+bool PoldiPeakSearch::isLessThanMinimum(const PoldiPeak_sptr &peak) {
   return peak->intensity().value() <= m_minimumPeakHeight;
 }
 
diff --git a/Framework/SINQ/src/PoldiTruncateData.cpp b/Framework/SINQ/src/PoldiTruncateData.cpp
index 9f22eb59d5b..e9423520443 100644
--- a/Framework/SINQ/src/PoldiTruncateData.cpp
+++ b/Framework/SINQ/src/PoldiTruncateData.cpp
@@ -4,8 +4,10 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidSINQ/PoldiTruncateData.h"
+#include <utility>
+
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidSINQ/PoldiTruncateData.h"
 #include "MantidSINQ/PoldiUtilities/PoldiInstrumentAdapter.h"
 
 namespace Mantid {
@@ -44,7 +46,7 @@ const std::string PoldiTruncateData::summary() const {
  *definition and log.
  */
 void PoldiTruncateData::setChopperFromWorkspace(
-    MatrixWorkspace_const_sptr workspace) {
+    const MatrixWorkspace_const_sptr &workspace) {
   PoldiInstrumentAdapter poldiInstrument(workspace);
   setChopper(poldiInstrument.chopper());
 }
@@ -54,7 +56,7 @@ void PoldiTruncateData::setChopperFromWorkspace(
  *  @param chopper :: POLDI chopper compatible with the measurement.
  */
 void PoldiTruncateData::setChopper(PoldiAbstractChopper_sptr chopper) {
-  m_chopper = chopper;
+  m_chopper = std::move(chopper);
 }
 
 /** Extracts timing information from the given MatrixWorkspace.
@@ -68,7 +70,7 @@ void PoldiTruncateData::setChopper(PoldiAbstractChopper_sptr chopper) {
  *  @param workspace :: Workspace with POLDI data
  */
 void PoldiTruncateData::setTimeBinWidthFromWorkspace(
-    MatrixWorkspace_const_sptr workspace) {
+    const MatrixWorkspace_const_sptr &workspace) {
   if (!workspace || workspace->getNumberHistograms() < 1) {
     throw std::invalid_argument(
         "Workspace does not contain any data. Aborting.");
@@ -233,7 +235,7 @@ MatrixWorkspace_sptr
 PoldiTruncateData::getCroppedWorkspace(MatrixWorkspace_sptr workspace) {
   double maximumXValue = getMaximumTimeValue(getCalculatedBinCount());
 
-  return getWorkspaceBelowX(workspace, maximumXValue);
+  return getWorkspaceBelowX(std::move(workspace), maximumXValue);
 }
 
 /** Returns a MatrixWorkspace with all extra counts
@@ -260,7 +262,7 @@ MatrixWorkspace_sptr
 PoldiTruncateData::getExtraCountsWorkspace(MatrixWorkspace_sptr workspace) {
   double minimumXValue = getMinimumExtraTimeValue(getCalculatedBinCount());
   MatrixWorkspace_sptr croppedOutput =
-      getWorkspaceAboveX(workspace, minimumXValue);
+      getWorkspaceAboveX(std::move(workspace), minimumXValue);
 
   return getSummedSpectra(croppedOutput);
 }
@@ -272,9 +274,9 @@ PoldiTruncateData::getExtraCountsWorkspace(MatrixWorkspace_sptr workspace) {
  *  @return MatrixWorkspace cropped to values with x < specified limit.
  */
 MatrixWorkspace_sptr
-PoldiTruncateData::getWorkspaceBelowX(MatrixWorkspace_sptr workspace,
+PoldiTruncateData::getWorkspaceBelowX(const MatrixWorkspace_sptr &workspace,
                                       double x) {
-  Algorithm_sptr crop = getCropAlgorithmForWorkspace(workspace);
+  Algorithm_sptr crop = getCropAlgorithmForWorkspace(std::move(workspace));
   crop->setProperty("XMax", x);
 
   return getOutputWorkspace(crop);
@@ -288,9 +290,9 @@ PoldiTruncateData::getWorkspaceBelowX(MatrixWorkspace_sptr workspace,
  *  @return MatrixWorkspace cropped to values with x >= specified limit.
  */
 MatrixWorkspace_sptr
-PoldiTruncateData::getWorkspaceAboveX(MatrixWorkspace_sptr workspace,
+PoldiTruncateData::getWorkspaceAboveX(const MatrixWorkspace_sptr &workspace,
                                       double x) {
-  Algorithm_sptr crop = getCropAlgorithmForWorkspace(workspace);
+  Algorithm_sptr crop = getCropAlgorithmForWorkspace(std::move(workspace));
   crop->setProperty("Xmin", x);
 
   return getOutputWorkspace(crop);
@@ -307,7 +309,7 @@ PoldiTruncateData::getWorkspaceAboveX(MatrixWorkspace_sptr workspace,
  *  @return Pointer to crop algorithm.
  */
 Algorithm_sptr PoldiTruncateData::getCropAlgorithmForWorkspace(
-    MatrixWorkspace_sptr workspace) {
+    const MatrixWorkspace_sptr &workspace) {
   Algorithm_sptr crop = createChildAlgorithm("CropWorkspace");
 
   if (!crop) {
@@ -328,7 +330,7 @@ Algorithm_sptr PoldiTruncateData::getCropAlgorithmForWorkspace(
  *  @return MatrixWorkspace stored in algorithm's OutputWorkspace property.
  */
 MatrixWorkspace_sptr
-PoldiTruncateData::getOutputWorkspace(Algorithm_sptr algorithm) {
+PoldiTruncateData::getOutputWorkspace(const Algorithm_sptr &algorithm) {
   if (!algorithm || !algorithm->execute()) {
     throw std::runtime_error("Workspace could not be retrieved successfully.");
   }
@@ -346,7 +348,7 @@ PoldiTruncateData::getOutputWorkspace(Algorithm_sptr algorithm) {
  *  @return MatrixWorkspace with one spectrum which contains all counts.
  */
 MatrixWorkspace_sptr
-PoldiTruncateData::getSummedSpectra(MatrixWorkspace_sptr workspace) {
+PoldiTruncateData::getSummedSpectra(const MatrixWorkspace_sptr &workspace) {
   Algorithm_sptr sumSpectra = createChildAlgorithm("SumSpectra");
 
   if (!sumSpectra) {
diff --git a/Framework/SINQ/src/PoldiUtilities/PoldiDGrid.cpp b/Framework/SINQ/src/PoldiUtilities/PoldiDGrid.cpp
index 976966e6eee..d1dedab391c 100644
--- a/Framework/SINQ/src/PoldiUtilities/PoldiDGrid.cpp
+++ b/Framework/SINQ/src/PoldiUtilities/PoldiDGrid.cpp
@@ -4,8 +4,10 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidSINQ/PoldiUtilities/PoldiDGrid.h"
+#include <utility>
+
 #include "MantidSINQ/PoldiUtilities/PoldiConversions.h"
+#include "MantidSINQ/PoldiUtilities/PoldiDGrid.h"
 
 namespace Mantid {
 namespace Poldi {
@@ -13,18 +15,19 @@ namespace Poldi {
 PoldiDGrid::PoldiDGrid(boost::shared_ptr<PoldiAbstractDetector> detector,
                        boost::shared_ptr<PoldiAbstractChopper> chopper,
                        double deltaT, std::pair<double, double> wavelengthRange)
-    : m_detector(detector), m_chopper(chopper), m_deltaT(deltaT),
-      m_wavelengthRange(wavelengthRange), m_dRangeAsMultiples(), m_deltaD(0.0),
-      m_dgrid(), m_hasCachedCalculation(false) {}
+    : m_detector(std::move(detector)), m_chopper(std::move(chopper)),
+      m_deltaT(deltaT), m_wavelengthRange(wavelengthRange),
+      m_dRangeAsMultiples(), m_deltaD(0.0), m_dgrid(),
+      m_hasCachedCalculation(false) {}
 
 void PoldiDGrid::setDetector(
     boost::shared_ptr<PoldiAbstractDetector> newDetector) {
-  m_detector = newDetector;
+  m_detector = std::move(newDetector);
 }
 
 void PoldiDGrid::setChopper(
     boost::shared_ptr<PoldiAbstractChopper> newChopper) {
-  m_chopper = newChopper;
+  m_chopper = std::move(newChopper);
 }
 
 void PoldiDGrid::setDeltaT(double newDeltaT) { m_deltaT = newDeltaT; }
diff --git a/Framework/SINQ/src/PoldiUtilities/PoldiDeadWireDecorator.cpp b/Framework/SINQ/src/PoldiUtilities/PoldiDeadWireDecorator.cpp
index c8502b5d57a..96a497e8d99 100644
--- a/Framework/SINQ/src/PoldiUtilities/PoldiDeadWireDecorator.cpp
+++ b/Framework/SINQ/src/PoldiUtilities/PoldiDeadWireDecorator.cpp
@@ -8,6 +8,7 @@
 #include "MantidGeometry/Instrument/DetectorInfo.h"
 
 #include <algorithm>
+#include <utility>
 
 namespace Mantid {
 namespace Poldi {
@@ -16,15 +17,15 @@ using namespace Geometry;
 
 PoldiDeadWireDecorator::PoldiDeadWireDecorator(
     std::set<int> deadWires,
-    boost::shared_ptr<Poldi::PoldiAbstractDetector> detector)
-    : PoldiDetectorDecorator(detector), m_deadWireSet(deadWires),
+    const boost::shared_ptr<Poldi::PoldiAbstractDetector> &detector)
+    : PoldiDetectorDecorator(detector), m_deadWireSet(std::move(deadWires)),
       m_goodElements() {
   setDecoratedDetector(detector);
 }
 
 PoldiDeadWireDecorator::PoldiDeadWireDecorator(
     const Geometry::DetectorInfo &poldiDetectorInfo,
-    boost::shared_ptr<PoldiAbstractDetector> detector)
+    const boost::shared_ptr<PoldiAbstractDetector> &detector)
     : PoldiDetectorDecorator(detector), m_deadWireSet(), m_goodElements() {
   setDecoratedDetector(detector);
 
@@ -42,7 +43,7 @@ PoldiDeadWireDecorator::PoldiDeadWireDecorator(
 }
 
 void PoldiDeadWireDecorator::setDeadWires(std::set<int> deadWires) {
-  m_deadWireSet = deadWires;
+  m_deadWireSet = std::move(deadWires);
 
   detectorSetHook();
 }
diff --git a/Framework/SINQ/src/PoldiUtilities/PoldiDetectorDecorator.cpp b/Framework/SINQ/src/PoldiUtilities/PoldiDetectorDecorator.cpp
index dabf81181a1..62cf8b06a98 100644
--- a/Framework/SINQ/src/PoldiUtilities/PoldiDetectorDecorator.cpp
+++ b/Framework/SINQ/src/PoldiUtilities/PoldiDetectorDecorator.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidSINQ/PoldiUtilities/PoldiDetectorDecorator.h"
 
 namespace Mantid {
@@ -14,12 +16,12 @@ using namespace Geometry;
 PoldiDetectorDecorator::PoldiDetectorDecorator(
     boost::shared_ptr<PoldiAbstractDetector> decoratedDetector)
     : PoldiAbstractDetector(), m_decoratedDetector() {
-  setDecoratedDetector(decoratedDetector);
+  setDecoratedDetector(std::move(decoratedDetector));
 }
 
 void PoldiDetectorDecorator::setDecoratedDetector(
     boost::shared_ptr<PoldiAbstractDetector> detector) {
-  m_decoratedDetector = detector;
+  m_decoratedDetector = std::move(detector);
 
   detectorSetHook();
 }
diff --git a/Framework/SINQ/src/PoldiUtilities/PoldiPeak.cpp b/Framework/SINQ/src/PoldiUtilities/PoldiPeak.cpp
index da1dc717713..8085d491464 100644
--- a/Framework/SINQ/src/PoldiUtilities/PoldiPeak.cpp
+++ b/Framework/SINQ/src/PoldiUtilities/PoldiPeak.cpp
@@ -8,6 +8,7 @@
 
 #include <cmath>
 #include <stdexcept>
+#include <utility>
 
 namespace Mantid {
 namespace Poldi {
@@ -18,7 +19,7 @@ PoldiPeak_sptr PoldiPeak::clone() const {
 
 const MillerIndices &PoldiPeak::hkl() const { return m_hkl; }
 
-void PoldiPeak::setHKL(MillerIndices hkl) { m_hkl = hkl; }
+void PoldiPeak::setHKL(MillerIndices hkl) { m_hkl = std::move(hkl); }
 
 UncertainValue PoldiPeak::d() const { return m_d; }
 
@@ -118,14 +119,16 @@ PoldiPeak_sptr PoldiPeak::create(double qValue, double intensity) {
 }
 
 PoldiPeak_sptr PoldiPeak::create(MillerIndices hkl, double dValue) {
-  return PoldiPeak_sptr(new PoldiPeak(
-      UncertainValue(dValue), UncertainValue(0.0), UncertainValue(0.0), hkl));
+  return PoldiPeak_sptr(new PoldiPeak(UncertainValue(dValue),
+                                      UncertainValue(0.0), UncertainValue(0.0),
+                                      std::move(hkl)));
 }
 
 PoldiPeak_sptr PoldiPeak::create(MillerIndices hkl, UncertainValue dValue,
                                  UncertainValue intensity,
                                  UncertainValue fwhmRelative) {
-  return PoldiPeak_sptr(new PoldiPeak(dValue, intensity, fwhmRelative, hkl));
+  return PoldiPeak_sptr(
+      new PoldiPeak(dValue, intensity, fwhmRelative, std::move(hkl)));
 }
 
 bool PoldiPeak::greaterThan(const PoldiPeak_sptr &first,
@@ -144,7 +147,7 @@ bool PoldiPeak::lessThan(const PoldiPeak_sptr &first,
 
 PoldiPeak::PoldiPeak(UncertainValue d, UncertainValue intensity,
                      UncertainValue fwhm, MillerIndices hkl)
-    : m_hkl(hkl), m_intensity(intensity) {
+    : m_hkl(std::move(hkl)), m_intensity(intensity) {
   setD(d);
   setFwhm(fwhm, Relative);
 }
diff --git a/Framework/SINQ/src/PoldiUtilities/PoldiPeakCollection.cpp b/Framework/SINQ/src/PoldiUtilities/PoldiPeakCollection.cpp
index 8217baa4b03..6eb5691a00f 100644
--- a/Framework/SINQ/src/PoldiUtilities/PoldiPeakCollection.cpp
+++ b/Framework/SINQ/src/PoldiUtilities/PoldiPeakCollection.cpp
@@ -4,11 +4,13 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidSINQ/PoldiUtilities/PoldiPeakCollection.h"
+#include <utility>
+
 #include "MantidAPI/LogManager.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidGeometry/Crystal/PointGroupFactory.h"
+#include "MantidSINQ/PoldiUtilities/PoldiPeakCollection.h"
 
 #include "MantidGeometry/Crystal/ReflectionGenerator.h"
 
@@ -97,7 +99,7 @@ PoldiPeakCollection::IntensityType PoldiPeakCollection::intensityType() const {
 
 void PoldiPeakCollection::setProfileFunctionName(
     std::string newProfileFunction) {
-  m_profileFunctionName = newProfileFunction;
+  m_profileFunctionName = std::move(newProfileFunction);
 }
 
 std::string PoldiPeakCollection::getProfileFunctionName() const {
@@ -275,7 +277,7 @@ PoldiPeakCollection::getUnitCellStringFromLog(const LogManager_sptr &tableLog) {
 
 std::string
 PoldiPeakCollection::getStringValueFromLog(const LogManager_sptr &logManager,
-                                           std::string valueName) {
+                                           const std::string &valueName) {
   if (logManager->hasProperty(valueName)) {
     return logManager->getPropertyValueAsType<std::string>(valueName);
   }
@@ -297,7 +299,7 @@ std::string PoldiPeakCollection::intensityTypeToString(
 
 PoldiPeakCollection::IntensityType
 PoldiPeakCollection::intensityTypeFromString(std::string typeString) const {
-  std::string lowerCaseType(typeString);
+  std::string lowerCaseType(std::move(typeString));
   std::transform(lowerCaseType.begin(), lowerCaseType.end(),
                  lowerCaseType.begin(), ::tolower);
 
diff --git a/Framework/SINQ/src/PoldiUtilities/PoldiSourceSpectrum.cpp b/Framework/SINQ/src/PoldiUtilities/PoldiSourceSpectrum.cpp
index 22c3345fe69..ea2be969a91 100644
--- a/Framework/SINQ/src/PoldiUtilities/PoldiSourceSpectrum.cpp
+++ b/Framework/SINQ/src/PoldiUtilities/PoldiSourceSpectrum.cpp
@@ -4,9 +4,11 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidSINQ/PoldiUtilities/PoldiSourceSpectrum.h"
+#include <utility>
+
 #include "MantidGeometry/Instrument/FitParameter.h"
 #include "MantidGeometry/Instrument/ParameterMap.h"
+#include "MantidSINQ/PoldiUtilities/PoldiSourceSpectrum.h"
 
 namespace Mantid {
 namespace Poldi {
@@ -14,12 +16,13 @@ namespace Poldi {
 using namespace Mantid::Kernel;
 using namespace Mantid::Geometry;
 
-PoldiSourceSpectrum::PoldiSourceSpectrum(Interpolation spectrum)
+PoldiSourceSpectrum::PoldiSourceSpectrum(const Interpolation &spectrum)
     : m_spectrum(spectrum) {}
 
-PoldiSourceSpectrum::PoldiSourceSpectrum(Instrument_const_sptr poldiInstrument)
+PoldiSourceSpectrum::PoldiSourceSpectrum(
+    const Instrument_const_sptr &poldiInstrument)
     : m_spectrum() {
-  setSpectrumFromInstrument(poldiInstrument);
+  setSpectrumFromInstrument(std::move(poldiInstrument));
 }
 
 /** Returns the interpolated intensity at the given wavelength
@@ -43,7 +46,7 @@ double PoldiSourceSpectrum::intensity(double wavelength) const {
  *spectrum.
  */
 void PoldiSourceSpectrum::setSpectrumFromInstrument(
-    Instrument_const_sptr poldiInstrument) {
+    const Instrument_const_sptr &poldiInstrument) {
   IComponent_const_sptr source = getSourceComponent(poldiInstrument);
 
   Parameter_sptr spectrumParameter =
@@ -61,8 +64,8 @@ void PoldiSourceSpectrum::setSpectrumFromInstrument(
  * @param poldiInstrument :: Instrument with valid POLDI definition
  * @return Shared pointer to source component
  */
-IComponent_const_sptr
-PoldiSourceSpectrum::getSourceComponent(Instrument_const_sptr poldiInstrument) {
+IComponent_const_sptr PoldiSourceSpectrum::getSourceComponent(
+    const Instrument_const_sptr &poldiInstrument) {
   IComponent_const_sptr source = poldiInstrument->getComponentByName("source");
 
   if (!source) {
@@ -86,7 +89,8 @@ PoldiSourceSpectrum::getSourceComponent(Instrument_const_sptr poldiInstrument) {
  * @return Shared pointer to Parameter that contains the spectrum.
  */
 Parameter_sptr PoldiSourceSpectrum::getSpectrumParameter(
-    IComponent_const_sptr source, ParameterMap_sptr instrumentParameterMap) {
+    const IComponent_const_sptr &source,
+    const ParameterMap_sptr &instrumentParameterMap) {
   Parameter_sptr spectrumParameter = instrumentParameterMap->getRecursive(
       &(*source), "WavelengthDistribution", "fitting");
 
@@ -107,7 +111,7 @@ Parameter_sptr PoldiSourceSpectrum::getSpectrumParameter(
  * @param spectrumParameter :: Shared pointer to fitting parameter with lookup
  *table
  */
-void PoldiSourceSpectrum::setSpectrum(Parameter_sptr spectrumParameter) {
+void PoldiSourceSpectrum::setSpectrum(const Parameter_sptr &spectrumParameter) {
   if (!spectrumParameter) {
     throw std::runtime_error("Spectrum parameter pointer is null");
   }
diff --git a/Framework/SINQ/src/ProjectMD.cpp b/Framework/SINQ/src/ProjectMD.cpp
index a2ab0ac2741..5036dbc5f36 100644
--- a/Framework/SINQ/src/ProjectMD.cpp
+++ b/Framework/SINQ/src/ProjectMD.cpp
@@ -89,8 +89,8 @@ void ProjectMD::exec() {
   // assign the workspace
   setProperty("OutputWorkspace", outWS);
 }
-void ProjectMD::copyMetaData(Mantid::API::IMDHistoWorkspace_sptr inws,
-                             Mantid::API::IMDHistoWorkspace_sptr outws) {
+void ProjectMD::copyMetaData(const Mantid::API::IMDHistoWorkspace_sptr &inws,
+                             const Mantid::API::IMDHistoWorkspace_sptr &outws) {
   outws->setTitle(inws->getTitle());
   ExperimentInfo_sptr info;
 
@@ -109,7 +109,7 @@ void ProjectMD::copyMetaData(Mantid::API::IMDHistoWorkspace_sptr inws,
  *      The documentation actually suggest F77, the code too?
  *  This isolates this from the storage order concern.
  */
-unsigned int ProjectMD::calcIndex(IMDHistoWorkspace_sptr ws, int dim[]) {
+unsigned int ProjectMD::calcIndex(const IMDHistoWorkspace_sptr &ws, int dim[]) {
   size_t idx = 0;
   switch (ws->getNumDims()) {
   case 1:
@@ -130,7 +130,7 @@ unsigned int ProjectMD::calcIndex(IMDHistoWorkspace_sptr ws, int dim[]) {
   return static_cast<unsigned int>(idx);
 }
 
-double ProjectMD::getValue(IMDHistoWorkspace_sptr ws, int dim[]) {
+double ProjectMD::getValue(const IMDHistoWorkspace_sptr &ws, int dim[]) {
   unsigned int idx = calcIndex(ws, dim);
   double val = ws->signalAt(idx);
   // double *a = ws->getSignalArray();
@@ -139,7 +139,8 @@ double ProjectMD::getValue(IMDHistoWorkspace_sptr ws, int dim[]) {
   // " << dim[1] << "," <<dim[2] <<'\n';
   return val;
 }
-void ProjectMD::putValue(IMDHistoWorkspace_sptr ws, int dim[], double value) {
+void ProjectMD::putValue(const IMDHistoWorkspace_sptr &ws, int dim[],
+                         double value) {
   unsigned int idx = calcIndex(ws, dim);
   // std::cout << "Result index " << idx << " value " << value << " dim= " <<
   // dim[0] << ", " << dim[1] <<", " << dim[2] <<'\n';
@@ -147,8 +148,8 @@ void ProjectMD::putValue(IMDHistoWorkspace_sptr ws, int dim[], double value) {
   ws->setErrorSquaredAt(idx, value);
 }
 
-void ProjectMD::sumData(IMDHistoWorkspace_sptr inWS,
-                        IMDHistoWorkspace_sptr outWS, int *sourceDim,
+void ProjectMD::sumData(const IMDHistoWorkspace_sptr &inWS,
+                        const IMDHistoWorkspace_sptr &outWS, int *sourceDim,
                         int *targetDim, int targetDimCount, int dimNo,
                         int start, int end, int currentDim) {
   boost::shared_ptr<const IMDDimension> dimi;
diff --git a/Framework/SINQ/src/SINQHMListener.cpp b/Framework/SINQ/src/SINQHMListener.cpp
index 3e778b43f95..58c876d6058 100644
--- a/Framework/SINQ/src/SINQHMListener.cpp
+++ b/Framework/SINQ/src/SINQHMListener.cpp
@@ -25,6 +25,7 @@
 #include <Poco/StreamCopier.h>
 
 #include <boost/algorithm/string/trim.hpp>
+#include <utility>
 
 using namespace Mantid::API;
 using namespace Mantid::DataObjects;
@@ -165,7 +166,7 @@ void SINQHMListener::loadDimensions() {
   doSpecialDim();
 }
 
-std::istream &SINQHMListener::httpRequest(std::string path) {
+std::istream &SINQHMListener::httpRequest(const std::string &path) {
 
   HTTPRequest req(HTTPRequest::HTTP_GET, path, HTTPMessage::HTTP_1_1);
   req.setKeepAlive(true);
@@ -208,7 +209,7 @@ int SINQHMListener::calculateCAddress(coord_t *pos) {
   }
   return result;
 }
-void SINQHMListener::recurseDim(int *data, IMDHistoWorkspace_sptr ws,
+void SINQHMListener::recurseDim(int *data, const IMDHistoWorkspace_sptr &ws,
                                 int currentDim, coord_t *idx) {
   if (currentDim == rank) {
     int Cindex = calculateCAddress(idx);
@@ -226,7 +227,7 @@ void SINQHMListener::recurseDim(int *data, IMDHistoWorkspace_sptr ws,
   }
 }
 
-void SINQHMListener::readHMData(IMDHistoWorkspace_sptr ws) {
+void SINQHMListener::readHMData(const IMDHistoWorkspace_sptr &ws) {
   int *data = nullptr, length = 1;
   coord_t *idx;
 
@@ -256,7 +257,7 @@ void SINQHMListener::readHMData(IMDHistoWorkspace_sptr ws) {
    * why....
    */
   idx = reinterpret_cast<coord_t *>(malloc(rank * sizeof(coord_t)));
-  recurseDim(data, ws, 0, idx);
+  recurseDim(data, std::move(ws), 0, idx);
 
   free(data);
   free(idx);
diff --git a/Framework/SINQ/src/SINQTranspose3D.cpp b/Framework/SINQ/src/SINQTranspose3D.cpp
index 856019ec3b3..82a4806b537 100644
--- a/Framework/SINQ/src/SINQTranspose3D.cpp
+++ b/Framework/SINQ/src/SINQTranspose3D.cpp
@@ -57,7 +57,7 @@ void SINQTranspose3D::exec() {
   }
 }
 
-void SINQTranspose3D::doYXZ(IMDHistoWorkspace_sptr inWS) {
+void SINQTranspose3D::doYXZ(const IMDHistoWorkspace_sptr &inWS) {
   size_t idxIn, idxOut;
 
   boost::shared_ptr<const IMDDimension> x, y, z;
@@ -92,7 +92,7 @@ void SINQTranspose3D::doYXZ(IMDHistoWorkspace_sptr inWS) {
   setProperty("OutputWorkspace", outWS);
 }
 
-void SINQTranspose3D::doXZY(IMDHistoWorkspace_sptr inWS) {
+void SINQTranspose3D::doXZY(const IMDHistoWorkspace_sptr &inWS) {
   size_t idxIn, idxOut;
   unsigned int xdim, ydim, zdim;
 
@@ -130,7 +130,7 @@ void SINQTranspose3D::doXZY(IMDHistoWorkspace_sptr inWS) {
   // assign the workspace
   setProperty("OutputWorkspace", outWS);
 }
-void SINQTranspose3D::doTRICS(IMDHistoWorkspace_sptr inWS) {
+void SINQTranspose3D::doTRICS(const IMDHistoWorkspace_sptr &inWS) {
   size_t idxIn, idxOut;
   unsigned int xdim, ydim, zdim;
 
@@ -169,7 +169,7 @@ void SINQTranspose3D::doTRICS(IMDHistoWorkspace_sptr inWS) {
   // assign the workspace
   setProperty("OutputWorkspace", outWS);
 }
-void SINQTranspose3D::doAMOR(IMDHistoWorkspace_sptr inWS) {
+void SINQTranspose3D::doAMOR(const IMDHistoWorkspace_sptr &inWS) {
   double val;
   unsigned int xdim, ydim, zdim, idx;
 
@@ -208,8 +208,9 @@ void SINQTranspose3D::doAMOR(IMDHistoWorkspace_sptr inWS) {
   setProperty("OutputWorkspace", outWS);
 }
 
-void SINQTranspose3D::copyMetaData(Mantid::API::IMDHistoWorkspace_sptr inws,
-                                   Mantid::API::IMDHistoWorkspace_sptr outws) {
+void SINQTranspose3D::copyMetaData(
+    const Mantid::API::IMDHistoWorkspace_sptr &inws,
+    const Mantid::API::IMDHistoWorkspace_sptr &outws) {
   outws->setTitle(inws->getTitle());
   ExperimentInfo_sptr info;
 
diff --git a/Framework/SINQ/src/SliceMDHisto.cpp b/Framework/SINQ/src/SliceMDHisto.cpp
index 7ead2951c05..b6e57a138aa 100644
--- a/Framework/SINQ/src/SliceMDHisto.cpp
+++ b/Framework/SINQ/src/SliceMDHisto.cpp
@@ -99,8 +99,8 @@ void SliceMDHisto::exec() {
   setProperty("OutputWorkspace", outWS);
 }
 
-void SliceMDHisto::cutData(Mantid::API::IMDHistoWorkspace_sptr inWS,
-                           Mantid::API::IMDHistoWorkspace_sptr outWS,
+void SliceMDHisto::cutData(const Mantid::API::IMDHistoWorkspace_sptr &inWS,
+                           const Mantid::API::IMDHistoWorkspace_sptr &outWS,
                            Mantid::coord_t *sourceDim,
                            Mantid::coord_t *targetDim, std::vector<int> start,
                            std::vector<int> end, unsigned int dim) {
@@ -130,8 +130,9 @@ void SliceMDHisto::cutData(Mantid::API::IMDHistoWorkspace_sptr inWS,
   }
 }
 
-void SliceMDHisto::copyMetaData(Mantid::API::IMDHistoWorkspace_sptr inws,
-                                Mantid::API::IMDHistoWorkspace_sptr outws) {
+void SliceMDHisto::copyMetaData(
+    const Mantid::API::IMDHistoWorkspace_sptr &inws,
+    const Mantid::API::IMDHistoWorkspace_sptr &outws) {
   outws->setTitle(inws->getTitle());
   ExperimentInfo_sptr info;
 
diff --git a/Framework/SINQ/test/PoldiDGridTest.h b/Framework/SINQ/test/PoldiDGridTest.h
index faf194afd1e..7acbe6e061a 100644
--- a/Framework/SINQ/test/PoldiDGridTest.h
+++ b/Framework/SINQ/test/PoldiDGridTest.h
@@ -14,6 +14,7 @@
 #include "MantidSINQ/PoldiUtilities/PoldiMockInstrumentHelpers.h"
 
 #include <stdexcept>
+#include <utility>
 
 using ::testing::Return;
 using namespace Mantid::Poldi;
@@ -28,7 +29,8 @@ class TestablePoldiDGrid : public PoldiDGrid {
           boost::shared_ptr<PoldiAbstractChopper>(),
       double deltaT = 0.0,
       std::pair<double, double> wavelengthRange = std::pair<double, double>())
-      : PoldiDGrid(detector, chopper, deltaT, wavelengthRange) {}
+      : PoldiDGrid(std::move(detector), std::move(chopper), deltaT,
+                   wavelengthRange) {}
 };
 
 class PoldiDGridTest : public CxxTest::TestSuite {
diff --git a/Framework/SINQ/test/PoldiFitPeaks2DTest.h b/Framework/SINQ/test/PoldiFitPeaks2DTest.h
index fd40da297df..04b91d797c1 100644
--- a/Framework/SINQ/test/PoldiFitPeaks2DTest.h
+++ b/Framework/SINQ/test/PoldiFitPeaks2DTest.h
@@ -481,8 +481,8 @@ private:
   PoldiInstrumentAdapter_sptr m_instrument;
   PoldiTimeTransformer_sptr m_timeTransformer;
 
-  void compareIntensities(PoldiPeakCollection_sptr first,
-                          PoldiPeakCollection_sptr second,
+  void compareIntensities(const PoldiPeakCollection_sptr &first,
+                          const PoldiPeakCollection_sptr &second,
                           double relativePrecision) {
     for (size_t i = 0; i < first->peakCount(); ++i) {
       PoldiPeak_sptr peak = first->peak(i);
diff --git a/Framework/SINQ/test/PoldiPeakCollectionTest.h b/Framework/SINQ/test/PoldiPeakCollectionTest.h
index c59ee2fdc12..5dd7d0703cf 100644
--- a/Framework/SINQ/test/PoldiPeakCollectionTest.h
+++ b/Framework/SINQ/test/PoldiPeakCollectionTest.h
@@ -36,7 +36,7 @@ class TestablePoldiPeakCollection : public PoldiPeakCollection {
 
   TestablePoldiPeakCollection() : PoldiPeakCollection() {}
 
-  TestablePoldiPeakCollection(TableWorkspace_sptr workspace)
+  TestablePoldiPeakCollection(const TableWorkspace_sptr &workspace)
       : PoldiPeakCollection(workspace) {}
 };
 
diff --git a/Framework/SINQ/test/PoldiSourceSpectrumTest.h b/Framework/SINQ/test/PoldiSourceSpectrumTest.h
index 81084f222b4..3a2d2185d48 100644
--- a/Framework/SINQ/test/PoldiSourceSpectrumTest.h
+++ b/Framework/SINQ/test/PoldiSourceSpectrumTest.h
@@ -12,6 +12,7 @@
 #include "MantidSINQ/PoldiUtilities/PoldiSourceSpectrum.h"
 #include <cxxtest/TestSuite.h>
 #include <stdexcept>
+#include <utility>
 
 using namespace Mantid::Poldi;
 using namespace Mantid::Kernel;
@@ -97,10 +98,10 @@ private:
     friend class PoldiSourceSpectrumTest;
 
   public:
-    TestablePoldiSourceSpectrum(Interpolation spectrum = Interpolation())
+    TestablePoldiSourceSpectrum(const Interpolation &spectrum = Interpolation())
         : PoldiSourceSpectrum(spectrum) {}
 
     TestablePoldiSourceSpectrum(Instrument_const_sptr poldiInstrument)
-        : PoldiSourceSpectrum(poldiInstrument) {}
+        : PoldiSourceSpectrum(std::move(poldiInstrument)) {}
   };
 };
diff --git a/Framework/ScriptRepository/inc/MantidScriptRepository/ScriptRepositoryImpl.h b/Framework/ScriptRepository/inc/MantidScriptRepository/ScriptRepositoryImpl.h
index eccbb0b4964..c6a68c63058 100644
--- a/Framework/ScriptRepository/inc/MantidScriptRepository/ScriptRepositoryImpl.h
+++ b/Framework/ScriptRepository/inc/MantidScriptRepository/ScriptRepositoryImpl.h
@@ -15,7 +15,7 @@
 namespace Mantid {
 namespace API {
 
-void writeJsonFile(const std::string &filename, Json::Value json,
+void writeJsonFile(const std::string &filename, const Json::Value &json,
                    const std::string &error);
 
 Json::Value readJsonFile(const std::string &filename, const std::string &error);
diff --git a/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp b/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp
index 328ab2b505a..12d7fe2dbf2 100644
--- a/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp
+++ b/Framework/ScriptRepository/src/ScriptRepositoryImpl.cpp
@@ -82,7 +82,7 @@ const char *emptyURL =
 /**
 Write json object to file
 */
-void writeJsonFile(const std::string &filename, Json::Value json,
+void writeJsonFile(const std::string &filename, const Json::Value &json,
                    const std::string &error) {
   Poco::FileOutputStream filestream(filename);
   if (!filestream.good()) {
diff --git a/Framework/ScriptRepository/test/ScriptRepositoryTestImpl.h b/Framework/ScriptRepository/test/ScriptRepositoryTestImpl.h
index 1f5b1b125d1..93e45055462 100644
--- a/Framework/ScriptRepository/test/ScriptRepositoryTestImpl.h
+++ b/Framework/ScriptRepository/test/ScriptRepositoryTestImpl.h
@@ -83,7 +83,8 @@ to simulate changes and new values for the downloading.
 
 class ScriptRepositoryImplLocal : public ScriptRepositoryImpl {
 public:
-  ScriptRepositoryImplLocal(std::string a = "", std::string b = "")
+  ScriptRepositoryImplLocal(const std::string &a = "",
+                            const std::string &b = "")
       : ScriptRepositoryImpl(a, b) {
     repository_json_content = REPOSITORYJSON;
     tofconv_readme_content = TOFCONV_README;
diff --git a/Framework/TestHelpers/inc/MantidTestHelpers/BinaryOperationMDTestHelper.h b/Framework/TestHelpers/inc/MantidTestHelpers/BinaryOperationMDTestHelper.h
index 4e3d45ba6f8..97ad18fe1e3 100644
--- a/Framework/TestHelpers/inc/MantidTestHelpers/BinaryOperationMDTestHelper.h
+++ b/Framework/TestHelpers/inc/MantidTestHelpers/BinaryOperationMDTestHelper.h
@@ -16,17 +16,19 @@
 namespace BinaryOperationMDTestHelper {
 /// Run a binary algorithm.
 DLLExport Mantid::DataObjects::MDHistoWorkspace_sptr
-doTest(std::string algoName, std::string lhs, std::string rhs,
-       std::string outName, bool succeeds = true, std::string otherProp = "",
-       std::string otherPropValue = "");
+doTest(const std::string &algoName, const std::string &lhs,
+       const std::string &rhs, const std::string &outName, bool succeeds = true,
+       const std::string &otherProp = "",
+       const std::string &otherPropValue = "");
 
 } // namespace BinaryOperationMDTestHelper
 
 namespace UnaryOperationMDTestHelper {
 /// Run a unary algorithm.
 DLLExport Mantid::DataObjects::MDHistoWorkspace_sptr
-doTest(std::string algoName, std::string inName, std::string outName,
-       bool succeeds = true, std::string otherProp = "",
-       std::string otherPropValue = "");
+doTest(const std::string &algoName, const std::string &inName,
+       const std::string &outName, bool succeeds = true,
+       const std::string &otherProp = "",
+       const std::string &otherPropValue = "");
 
 } // namespace UnaryOperationMDTestHelper
diff --git a/Framework/TestHelpers/inc/MantidTestHelpers/ComponentCreationHelper.h b/Framework/TestHelpers/inc/MantidTestHelpers/ComponentCreationHelper.h
index 66454bb43c3..362683a46b8 100644
--- a/Framework/TestHelpers/inc/MantidTestHelpers/ComponentCreationHelper.h
+++ b/Framework/TestHelpers/inc/MantidTestHelpers/ComponentCreationHelper.h
@@ -200,7 +200,7 @@ Mantid::Geometry::Instrument_sptr createTestInstrumentCylindrical(
 
 void addRectangularBank(Mantid::Geometry::Instrument &testInstrument,
                         int idStart, int pixels, double pixelSpacing,
-                        std::string bankName,
+                        const std::string &bankName,
                         const Mantid::Kernel::V3D &bankPos,
                         const Mantid::Kernel::Quat &bankRot);
 
diff --git a/Framework/TestHelpers/inc/MantidTestHelpers/DataProcessorTestHelper.h b/Framework/TestHelpers/inc/MantidTestHelpers/DataProcessorTestHelper.h
index 46730b0efe9..11a86d24311 100644
--- a/Framework/TestHelpers/inc/MantidTestHelpers/DataProcessorTestHelper.h
+++ b/Framework/TestHelpers/inc/MantidTestHelpers/DataProcessorTestHelper.h
@@ -25,15 +25,15 @@ namespace DataProcessorTestHelper {
 
 // Add a property value from a list to the given row data with an optional
 // prefix
-DLLExport void
-addPropertyValue(MantidQt::MantidWidgets::DataProcessor::RowData_sptr rowData,
-                 const std::vector<std::string> &list, const size_t index,
-                 const std::string &property, const std::string &prefix = "");
+DLLExport void addPropertyValue(
+    const MantidQt::MantidWidgets::DataProcessor::RowData_sptr &rowData,
+    const std::vector<std::string> &list, const size_t index,
+    const std::string &property, const std::string &prefix = "");
 
 // Add a property value to the given row data
-DLLExport void
-addPropertyValue(MantidQt::MantidWidgets::DataProcessor::RowData_sptr rowData,
-                 const std::string &property, const std::string &value);
+DLLExport void addPropertyValue(
+    const MantidQt::MantidWidgets::DataProcessor::RowData_sptr &rowData,
+    const std::string &property, const std::string &value);
 
 // Utility to create a row data class from a string list of simple inputs
 DLLExport MantidQt::MantidWidgets::DataProcessor::RowData_sptr
diff --git a/Framework/TestHelpers/inc/MantidTestHelpers/FakeObjects.h b/Framework/TestHelpers/inc/MantidTestHelpers/FakeObjects.h
index 9803484a3c4..1b4d7ad274b 100644
--- a/Framework/TestHelpers/inc/MantidTestHelpers/FakeObjects.h
+++ b/Framework/TestHelpers/inc/MantidTestHelpers/FakeObjects.h
@@ -728,8 +728,9 @@ public:
 
     throw std::runtime_error("Not Implemented");
   }
-  MDHistoWorkspaceTester(MDHistoDimension_sptr dimX, MDHistoDimension_sptr dimY,
-                         MDHistoDimension_sptr dimZ) {
+  MDHistoWorkspaceTester(const MDHistoDimension_sptr &dimX,
+                         const MDHistoDimension_sptr &dimY,
+                         const MDHistoDimension_sptr &dimZ) {
     std::vector<IMDDimension_sptr> dimensions{dimX, dimY, dimZ};
     initGeometry(dimensions);
   }
diff --git a/Framework/TestHelpers/inc/MantidTestHelpers/MDEventsTestHelper.h b/Framework/TestHelpers/inc/MantidTestHelpers/MDEventsTestHelper.h
index a67c9c86d76..bbeab78161e 100644
--- a/Framework/TestHelpers/inc/MantidTestHelpers/MDEventsTestHelper.h
+++ b/Framework/TestHelpers/inc/MantidTestHelpers/MDEventsTestHelper.h
@@ -38,8 +38,8 @@ createOutputWorkspace(size_t splitInto) {
 template <typename MDE, size_t nd>
 void addMDDimensions(
     boost::shared_ptr<Mantid::DataObjects::MDEventWorkspace<MDE, nd>> out,
-    Mantid::coord_t min, Mantid::coord_t max, std::string axisNameFormat,
-    std::string axisIdFormat) {
+    Mantid::coord_t min, Mantid::coord_t max, const std::string &axisNameFormat,
+    const std::string &axisIdFormat) {
 
   // Create MDFrame of General Frame type
   Mantid::Geometry::GeneralFrame frame(
@@ -64,8 +64,8 @@ template <typename MDE, size_t nd>
 void addMDDimensionsWithFrames(
     boost::shared_ptr<Mantid::DataObjects::MDEventWorkspace<MDE, nd>> out,
     Mantid::coord_t min, Mantid::coord_t max,
-    const Mantid::Geometry::MDFrame &frame, std::string axisNameFormat,
-    std::string axisIdFormat) {
+    const Mantid::Geometry::MDFrame &frame, const std::string &axisNameFormat,
+    const std::string &axisIdFormat) {
   for (size_t d = 0; d < nd; d++) {
     char name[200];
     sprintf(name, axisNameFormat.c_str(), d);
@@ -85,7 +85,7 @@ void addMDDimensionsWithIndividualFrames(
     boost::shared_ptr<Mantid::DataObjects::MDEventWorkspace<MDE, nd>> out,
     Mantid::coord_t min, Mantid::coord_t max,
     const std::vector<Mantid::Geometry::MDFrame_sptr> &frame,
-    std::string axisNameFormat, std::string axisIdFormat) {
+    const std::string &axisNameFormat, const std::string &axisIdFormat) {
   for (size_t d = 0; d < nd; d++) {
     char name[200];
     sprintf(name, axisNameFormat.c_str(), d);
@@ -172,17 +172,17 @@ makeFakeMDHistoWorkspace(double signal, size_t numDims, size_t numBins = 10,
 Mantid::DataObjects::MDHistoWorkspace_sptr makeFakeMDHistoWorkspaceWithMDFrame(
     double signal, size_t numDims, const Mantid::Geometry::MDFrame &frame,
     size_t numBins = 10, coord_t max = 10.0, double errorSquared = 1.0,
-    std::string name = "", double numEvents = 1.0);
+    const std::string &name = "", double numEvents = 1.0);
 
 /// More general fake n-dimensionsal MDHistoWorkspace
 Mantid::DataObjects::MDHistoWorkspace_sptr makeFakeMDHistoWorkspaceGeneral(
     size_t numDims, double signal, double errorSquared, size_t *numBins,
-    coord_t *min, coord_t *max, std::string name = "");
+    coord_t *min, coord_t *max, const std::string &name = "");
 /// More general fake n-dimensionsal MDHistoWorkspace
 Mantid::DataObjects::MDHistoWorkspace_sptr makeFakeMDHistoWorkspaceGeneral(
     size_t numDims, double signal, double errorSquared, size_t *numBins,
     coord_t *min, coord_t *max, std::vector<std::string> names,
-    std::string name = "");
+    const std::string &name = "");
 
 //-------------------------------------------------------------------------------------
 /** Create a test MDEventWorkspace<nd> . Dimensions are names Axis0, Axis1, etc.
@@ -202,7 +202,7 @@ Mantid::DataObjects::MDHistoWorkspace_sptr makeFakeMDHistoWorkspaceGeneral(
 template <typename MDE, size_t nd>
 boost::shared_ptr<Mantid::DataObjects::MDEventWorkspace<MDE, nd>>
 makeAnyMDEW(size_t splitInto, coord_t min, coord_t max,
-            size_t numEventsPerBox = 0, std::string wsName = "",
+            size_t numEventsPerBox = 0, const std::string &wsName = "",
             std::string axisNameFormat = "Axis%d",
             std::string axisIdFormat = "Axis%d") {
   // Create bare workspace
@@ -242,7 +242,7 @@ boost::shared_ptr<Mantid::DataObjects::MDEventWorkspace<MDE, nd>>
 makeAnyMDEWWithIndividualFrames(
     size_t splitInto, coord_t min, coord_t max,
     std::vector<Mantid::Geometry::MDFrame_sptr> frames,
-    size_t numEventsPerBox = 0, std::string wsName = "",
+    size_t numEventsPerBox = 0, const std::string &wsName = "",
     std::string axisNameFormat = "Axis%d",
     std::string axisIdFormat = "Axis%d") {
   // Create bare workspace
@@ -283,7 +283,8 @@ template <typename MDE, size_t nd>
 boost::shared_ptr<Mantid::DataObjects::MDEventWorkspace<MDE, nd>>
 makeAnyMDEWWithFrames(size_t splitInto, coord_t min, coord_t max,
                       const Mantid::Geometry::MDFrame &frame,
-                      size_t numEventsPerBox = 0, std::string wsName = "",
+                      size_t numEventsPerBox = 0,
+                      const std::string &wsName = "",
                       std::string axisNameFormat = "Axis%d",
                       std::string axisIdFormat = "Axis%d") {
   // Create bare workspace
@@ -499,7 +500,7 @@ static void extents_match(MDBOX box, size_t dim, double min, double max) {
   TSM_ASSERT_DELTA(dim, box->getExtents(dim).getMax(), max, 1e-6);
 }
 
-void checkAndDeleteFile(std::string filename);
+void checkAndDeleteFile(const std::string &filename);
 
 //=====================================================================================
 //===================================== TEST METHODS
diff --git a/Framework/TestHelpers/inc/MantidTestHelpers/NexusFileReader.h b/Framework/TestHelpers/inc/MantidTestHelpers/NexusFileReader.h
index 0215002c068..519febe4c98 100644
--- a/Framework/TestHelpers/inc/MantidTestHelpers/NexusFileReader.h
+++ b/Framework/TestHelpers/inc/MantidTestHelpers/NexusFileReader.h
@@ -121,7 +121,7 @@ public:
   // read a multidimensional dataset and returns vector containing the data
   template <typename T>
   std::vector<T> readDataSetMultidimensional(FullNXPath &pathToGroup,
-                                             std::string dataSetName) {
+                                             const std::string &dataSetName) {
 
     std::vector<T> dataInFile;
 
@@ -299,7 +299,7 @@ public:
     return false;
   }
 
-  bool hasDataset(const std::string dsetName, const FullNXPath &pathToGroup) {
+  bool hasDataset(const std::string &dsetName, const FullNXPath &pathToGroup) {
 
     H5::Group parentGroup = openfullH5Path(pathToGroup);
 
@@ -373,7 +373,7 @@ public:
   }
 
   bool hasAttributeInDataSet(
-      const std::string dataSetName, const std::string &attrName,
+      const std::string &dataSetName, const std::string &attrName,
       const std::string &attrVal,
       const FullNXPath &pathToGroup /*where the dataset lives*/) {
 
@@ -387,7 +387,7 @@ public:
     return attributeValue == attrVal;
   }
 
-  bool hasNXAttributeInDataSet(const std::string dataSetName,
+  bool hasNXAttributeInDataSet(const std::string &dataSetName,
                                const std::string &attrVal,
                                const FullNXPath &pathToGroup) {
     H5::Attribute attribute;
diff --git a/Framework/TestHelpers/inc/MantidTestHelpers/SANSInstrumentCreationHelper.h b/Framework/TestHelpers/inc/MantidTestHelpers/SANSInstrumentCreationHelper.h
index 10238c69637..65ca02b5c5c 100644
--- a/Framework/TestHelpers/inc/MantidTestHelpers/SANSInstrumentCreationHelper.h
+++ b/Framework/TestHelpers/inc/MantidTestHelpers/SANSInstrumentCreationHelper.h
@@ -31,14 +31,14 @@ public:
    * @param workspace: name of the workspace to be created.
    */
   static Mantid::DataObjects::Workspace2D_sptr
-  createSANSInstrumentWorkspace(std::string workspace);
+  createSANSInstrumentWorkspace(const std::string &workspace);
   /** Run the Child Algorithm LoadInstrument (as for LoadRaw)
    * @param inst_name :: The name written in the Nexus file
    * @param workspace :: The workspace to insert the instrument into
    */
   static void
   runLoadInstrument(const std::string &inst_name,
-                    Mantid::DataObjects::Workspace2D_sptr workspace);
+                    const Mantid::DataObjects::Workspace2D_sptr &workspace);
 
   /**
    * Populate spectra mapping to detector IDs
@@ -48,6 +48,6 @@ public:
    * @param nybins: number of bins in Y
    */
   static void
-  runLoadMappingTable(Mantid::DataObjects::Workspace2D_sptr workspace,
+  runLoadMappingTable(const Mantid::DataObjects::Workspace2D_sptr &workspace,
                       int nxbins, int nybins);
 };
diff --git a/Framework/TestHelpers/inc/MantidTestHelpers/WorkspaceCreationHelper.h b/Framework/TestHelpers/inc/MantidTestHelpers/WorkspaceCreationHelper.h
index a8abc58fef0..7d188678306 100644
--- a/Framework/TestHelpers/inc/MantidTestHelpers/WorkspaceCreationHelper.h
+++ b/Framework/TestHelpers/inc/MantidTestHelpers/WorkspaceCreationHelper.h
@@ -234,7 +234,7 @@ create2DWorkspaceFromFunction(fT yFunc, int nSpec, double x0, double x1,
 }
 
 /// Add random noise to the signalcreate2DWorkspaceWithFullInstrument
-void addNoise(Mantid::API::MatrixWorkspace_sptr ws, double noise,
+void addNoise(const Mantid::API::MatrixWorkspace_sptr &ws, double noise,
               const double lower = -0.5, const double upper = 0.5);
 
 /// Create a test workspace with a fully defined instrument.
@@ -305,7 +305,8 @@ createWorkspaceSingleValue(double value);
 Mantid::DataObjects::WorkspaceSingleValue_sptr
 createWorkspaceSingleValueWithError(double value, double error);
 /** Perform some finalization on event workspace stuff */
-void eventWorkspace_Finalize(Mantid::DataObjects::EventWorkspace_sptr ew);
+void eventWorkspace_Finalize(
+    const Mantid::DataObjects::EventWorkspace_sptr &ew);
 /** Create event workspace with:
  * 500 pixels
  * 1000 histogrammed bins.
@@ -348,22 +349,23 @@ Mantid::API::MatrixWorkspace_sptr createGroupedWorkspace2DWithRingsAndBoxes(
     size_t RootOfNumHist = 10, int numBins = 10, double binDelta = 1.0);
 // not strictly creating a workspace, but really helpful to see what one
 // contains
-void displayDataY(Mantid::API::MatrixWorkspace_const_sptr ws);
+void displayDataY(const Mantid::API::MatrixWorkspace_const_sptr &ws);
 // not strictly creating a workspace, but really helpful to see what one
 // contains
-void displayData(Mantid::API::MatrixWorkspace_const_sptr ws);
+void displayData(const Mantid::API::MatrixWorkspace_const_sptr &ws);
 // not strictly creating a workspace, but really helpful to see what one
 // contains
-void displayDataX(Mantid::API::MatrixWorkspace_const_sptr ws);
+void displayDataX(const Mantid::API::MatrixWorkspace_const_sptr &ws);
 // not strictly creating a workspace, but really helpful to see what one
 // contains
-void displayDataE(Mantid::API::MatrixWorkspace_const_sptr ws);
+void displayDataE(const Mantid::API::MatrixWorkspace_const_sptr &ws);
 
-void addTSPEntry(Mantid::API::Run &runInfo, std::string name, double val);
-void setOrientedLattice(Mantid::API::MatrixWorkspace_sptr ws, double a,
+void addTSPEntry(Mantid::API::Run &runInfo, const std::string &name,
+                 double val);
+void setOrientedLattice(const Mantid::API::MatrixWorkspace_sptr &ws, double a,
                         double b, double c);
-void setGoniometer(Mantid::API::MatrixWorkspace_sptr ws, double phi, double chi,
-                   double omega);
+void setGoniometer(const Mantid::API::MatrixWorkspace_sptr &ws, double phi,
+                   double chi, double omega);
 
 // create workspace which should be result of homering (transform to energy in
 // inelastic)
@@ -378,9 +380,9 @@ Mantid::API::MatrixWorkspace_sptr createProcessedInelasticWS(
     const std::vector<double> &azimutal, size_t numBins = 4, double Emin = -10,
     double Emax = 10, double Ei = 11);
 
-Mantid::DataObjects::EventWorkspace_sptr
-createEventWorkspace3(Mantid::DataObjects::EventWorkspace_const_sptr sourceWS,
-                      std::string wsname, Mantid::API::Algorithm *alg);
+Mantid::DataObjects::EventWorkspace_sptr createEventWorkspace3(
+    const Mantid::DataObjects::EventWorkspace_const_sptr &sourceWS,
+    const std::string &wsname, Mantid::API::Algorithm *alg);
 
 /// Function to create a fixed RebinnedOutput workspace
 Mantid::DataObjects::RebinnedOutput_sptr createRebinnedOutputWorkspace();
@@ -403,7 +405,8 @@ createPeaksWorkspace(const int numPeaks,
 /**Build table workspace with preprocessed detectors for existing workspace with
  * instrument */
 boost::shared_ptr<Mantid::DataObjects::TableWorkspace>
-buildPreprocessedDetectorsWorkspace(Mantid::API::MatrixWorkspace_sptr ws);
+buildPreprocessedDetectorsWorkspace(
+    const Mantid::API::MatrixWorkspace_sptr &ws);
 // create range of angular detectors positions
 void create2DAngles(std::vector<double> &L2, std::vector<double> &polar,
                     std::vector<double> &azim, size_t nPolar = 10,
@@ -440,7 +443,7 @@ create2DWorkspaceWithReflectometryInstrumentMultiDetector(
     const int nSpectra = 4, const int nBins = 20, const double deltaX = 5000.0);
 
 void createInstrumentForWorkspaceWithDistances(
-    Mantid::API::MatrixWorkspace_sptr workspace,
+    const Mantid::API::MatrixWorkspace_sptr &workspace,
     const Mantid::Kernel::V3D &samplePosition,
     const Mantid::Kernel::V3D &sourcePosition,
     const std::vector<Mantid::Kernel::V3D> &detectorPositions);
diff --git a/Framework/TestHelpers/src/BinaryOperationMDTestHelper.cpp b/Framework/TestHelpers/src/BinaryOperationMDTestHelper.cpp
index e835e4e5ccf..bce53656bb8 100644
--- a/Framework/TestHelpers/src/BinaryOperationMDTestHelper.cpp
+++ b/Framework/TestHelpers/src/BinaryOperationMDTestHelper.cpp
@@ -59,10 +59,11 @@ void setUpBinaryOperationMDTestHelper() {
 }
 
 /// Run a binary algorithm.
-MDHistoWorkspace_sptr doTest(std::string algoName, std::string lhs,
-                             std::string rhs, std::string outName,
-                             bool succeeds, std::string otherProp,
-                             std::string otherPropValue) {
+MDHistoWorkspace_sptr doTest(const std::string &algoName,
+                             const std::string &lhs, const std::string &rhs,
+                             const std::string &outName, bool succeeds,
+                             const std::string &otherProp,
+                             const std::string &otherPropValue) {
   setUpBinaryOperationMDTestHelper();
 
   IAlgorithm *alg = FrameworkManager::Instance().createAlgorithm(algoName);
@@ -94,10 +95,11 @@ MDHistoWorkspace_sptr doTest(std::string algoName, std::string lhs,
 
 namespace UnaryOperationMDTestHelper {
 
-MDHistoWorkspace_sptr doTest(std::string algoName, std::string inName,
-                             std::string outName, bool succeeds,
-                             std::string otherProp,
-                             std::string otherPropValue) {
+MDHistoWorkspace_sptr doTest(const std::string &algoName,
+                             const std::string &inName,
+                             const std::string &outName, bool succeeds,
+                             const std::string &otherProp,
+                             const std::string &otherPropValue) {
   MDHistoWorkspace_sptr histo =
       MDEventsTestHelper::makeFakeMDHistoWorkspace(2.0, 2, 5, 10.0, 2.0);
   IMDEventWorkspace_sptr event =
diff --git a/Framework/TestHelpers/src/ComponentCreationHelper.cpp b/Framework/TestHelpers/src/ComponentCreationHelper.cpp
index c520c9f1b3c..b40c9378213 100644
--- a/Framework/TestHelpers/src/ComponentCreationHelper.cpp
+++ b/Framework/TestHelpers/src/ComponentCreationHelper.cpp
@@ -531,7 +531,7 @@ createCylInstrumentWithDetInGivenPositions(const std::vector<double> &L2,
 //----------------------------------------------------------------------------------------------
 
 void addRectangularBank(Instrument &testInstrument, int idStart, int pixels,
-                        double pixelSpacing, std::string bankName,
+                        double pixelSpacing, const std::string &bankName,
                         const V3D &bankPos, const Quat &bankRot) {
 
   const double cylRadius(pixelSpacing / 2);
diff --git a/Framework/TestHelpers/src/DataProcessorTestHelper.cpp b/Framework/TestHelpers/src/DataProcessorTestHelper.cpp
index e42ae87e764..e8074c49288 100644
--- a/Framework/TestHelpers/src/DataProcessorTestHelper.cpp
+++ b/Framework/TestHelpers/src/DataProcessorTestHelper.cpp
@@ -14,7 +14,7 @@ namespace DataProcessorTestHelper {
 /* Add a property value from a list to the given row data with an optional
  * prefix
  */
-void addPropertyValue(RowData_sptr rowData,
+void addPropertyValue(const RowData_sptr &rowData,
                       const std::vector<std::string> &list, const size_t index,
                       const std::string &property, const std::string &prefix) {
   if (index >= list.size() || list[index].empty())
@@ -28,7 +28,7 @@ void addPropertyValue(RowData_sptr rowData,
 
 /* Add a property value to the given row data
  */
-void addPropertyValue(RowData_sptr rowData, const std::string &property,
+void addPropertyValue(const RowData_sptr &rowData, const std::string &property,
                       const std::string &value) {
   // Set the value and preprocessed value to the given value
   rowData->setOptionValue(property, value);
diff --git a/Framework/TestHelpers/src/MDEventsTestHelper.cpp b/Framework/TestHelpers/src/MDEventsTestHelper.cpp
index 1d758e654d1..690db659153 100644
--- a/Framework/TestHelpers/src/MDEventsTestHelper.cpp
+++ b/Framework/TestHelpers/src/MDEventsTestHelper.cpp
@@ -244,10 +244,9 @@ makeFakeMDHistoWorkspace(double signal, size_t numDims, size_t numBins,
  * @param name :: optional name
  * @return the MDHisto
  */
-MDHistoWorkspace_sptr
-makeFakeMDHistoWorkspaceGeneral(size_t numDims, double signal,
-                                double errorSquared, size_t *numBins,
-                                coord_t *min, coord_t *max, std::string name) {
+MDHistoWorkspace_sptr makeFakeMDHistoWorkspaceGeneral(
+    size_t numDims, double signal, double errorSquared, size_t *numBins,
+    coord_t *min, coord_t *max, const std::string &name) {
   std::vector<std::string> names{"x", "y", "z", "t"};
   // Create MDFrame of General Frame type
   Mantid::Geometry::GeneralFrame frame(
@@ -283,7 +282,7 @@ makeFakeMDHistoWorkspaceGeneral(size_t numDims, double signal,
 MDHistoWorkspace_sptr makeFakeMDHistoWorkspaceGeneral(
     size_t numDims, double signal, double errorSquared, size_t *numBins,
     coord_t *min, coord_t *max, std::vector<std::string> names,
-    std::string name) {
+    const std::string &name) {
   std::vector<Mantid::Geometry::MDHistoDimension_sptr> dimensions;
   // Create MDFrame of General Frame type
   Mantid::Geometry::GeneralFrame frame(
@@ -316,7 +315,7 @@ MDHistoWorkspace_sptr makeFakeMDHistoWorkspaceGeneral(
  */
 Mantid::DataObjects::MDHistoWorkspace_sptr makeFakeMDHistoWorkspaceWithMDFrame(
     double signal, size_t numDims, const Mantid::Geometry::MDFrame &frame,
-    size_t numBins, coord_t max, double errorSquared, std::string name,
+    size_t numBins, coord_t max, double errorSquared, const std::string &name,
     double numEvents) {
   // MDHistoWorkspace *ws = nullptr;
   MDHistoWorkspace_sptr ws_sptr;
@@ -365,7 +364,7 @@ Mantid::DataObjects::MDHistoWorkspace_sptr makeFakeMDHistoWorkspaceWithMDFrame(
  * Delete a file from disk
  * @param filename : File name to check and delete
  */
-void checkAndDeleteFile(std::string filename) {
+void checkAndDeleteFile(const std::string &filename) {
   if (!filename.empty()) {
     if (Poco::File(filename).exists()) {
       Poco::File(filename).remove();
diff --git a/Framework/TestHelpers/src/ReflectometryHelper.cpp b/Framework/TestHelpers/src/ReflectometryHelper.cpp
index 0a03f9137a3..91e8a5b5979 100644
--- a/Framework/TestHelpers/src/ReflectometryHelper.cpp
+++ b/Framework/TestHelpers/src/ReflectometryHelper.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidTestHelpers/ReflectometryHelper.h"
 
 #include "MantidAPI/AlgorithmManager.h"
@@ -115,7 +117,8 @@ void prepareInputGroup(std::string const &name, std::string const &paramsType,
   mkGroup->execute();
 }
 
-std::vector<MatrixWorkspace_sptr> groupToVector(WorkspaceGroup_sptr group) {
+std::vector<MatrixWorkspace_sptr>
+groupToVector(const WorkspaceGroup_sptr &group) {
   std::vector<MatrixWorkspace_sptr> out;
   for (size_t i = 0; i < group->size(); ++i) {
     out.emplace_back(
@@ -129,9 +132,9 @@ std::vector<MatrixWorkspace_sptr> retrieveOutWS(std::string const &name) {
   return groupToVector(group);
 }
 
-void applyPolarizationEfficiencies(WorkspaceGroup_sptr ws) {
+void applyPolarizationEfficiencies(const WorkspaceGroup_sptr &ws) {
 
-  auto wss = groupToVector(ws);
+  auto wss = groupToVector(std::move(ws));
   auto Rpp = wss[0];
   auto Rpa = wss[1];
   auto Rap = wss[2];
diff --git a/Framework/TestHelpers/src/SANSInstrumentCreationHelper.cpp b/Framework/TestHelpers/src/SANSInstrumentCreationHelper.cpp
index d73a3262928..a2e26a0b9f9 100644
--- a/Framework/TestHelpers/src/SANSInstrumentCreationHelper.cpp
+++ b/Framework/TestHelpers/src/SANSInstrumentCreationHelper.cpp
@@ -44,7 +44,7 @@ const int SANSInstrumentCreationHelper::nMonitors = 2;
  * @param workspace: name of the workspace to be created.
  */
 Workspace2D_sptr SANSInstrumentCreationHelper::createSANSInstrumentWorkspace(
-    std::string workspace) {
+    const std::string &workspace) {
   // Create a test workspace with test data with a well defined peak
   // The test instrument has two monitor channels
   Workspace2D_sptr ws = WorkspaceCreationHelper::create2DWorkspace123(
@@ -67,7 +67,7 @@ Workspace2D_sptr SANSInstrumentCreationHelper::createSANSInstrumentWorkspace(
  */
 void SANSInstrumentCreationHelper::runLoadInstrument(
     const std::string &inst_name,
-    Mantid::DataObjects::Workspace2D_sptr workspace) {
+    const Mantid::DataObjects::Workspace2D_sptr &workspace) {
   // Determine the search directory for XML instrument definition files (IDFs)
   // std::string directoryName =
   // Mantid::Kernel::ConfigService::Instance().getInstrumentDirectory();
@@ -97,7 +97,8 @@ void SANSInstrumentCreationHelper::runLoadInstrument(
  * @param nybins: number of bins in Y
  */
 void SANSInstrumentCreationHelper::runLoadMappingTable(
-    Mantid::DataObjects::Workspace2D_sptr workspace, int nxbins, int nybins) {
+    const Mantid::DataObjects::Workspace2D_sptr &workspace, int nxbins,
+    int nybins) {
   // Get the number of monitor channels
   size_t nMonitors(0);
   size_t nXbins, nYbins;
diff --git a/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp b/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
index 9e491ac2393..a910ef03d33 100644
--- a/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
+++ b/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
@@ -366,7 +366,7 @@ Workspace2D_sptr create2DWorkspaceNonUniformlyBinned(int nhist,
  * @param lower :: The lower bound of the flucation (default=-0.5)
  * @param upper:: The upper bound of the flucation (default=-0.5)
  */
-void addNoise(Mantid::API::MatrixWorkspace_sptr ws, double noise,
+void addNoise(const Mantid::API::MatrixWorkspace_sptr &ws, double noise,
               const double lower, const double upper) {
   const size_t seed(12345);
   MersenneTwister randGen(seed, lower, upper);
@@ -707,7 +707,7 @@ MatrixWorkspace_sptr create2DWorkspaceWithReflectometryInstrumentMultiDetector(
 }
 
 void createInstrumentForWorkspaceWithDistances(
-    MatrixWorkspace_sptr workspace, const V3D &samplePosition,
+    const MatrixWorkspace_sptr &workspace, const V3D &samplePosition,
     const V3D &sourcePosition, const std::vector<V3D> &detectorPositions) {
   Instrument_sptr instrument = boost::make_shared<Instrument>();
   instrument->setReferenceFrame(
@@ -739,7 +739,7 @@ WorkspaceSingleValue_sptr createWorkspaceSingleValueWithError(double value,
 }
 
 /** Perform some finalization on event workspace stuff */
-void eventWorkspace_Finalize(EventWorkspace_sptr ew) {
+void eventWorkspace_Finalize(const EventWorkspace_sptr &ew) {
   // get a proton charge
   ew->mutableRun().integrateProtonCharge();
 }
@@ -944,7 +944,7 @@ createGroupedWorkspace2DWithRingsAndBoxes(size_t RootOfNumHist, int numBins,
 
 // not strictly creating a workspace, but really helpful to see what one
 // contains
-void displayDataY(MatrixWorkspace_const_sptr ws) {
+void displayDataY(const MatrixWorkspace_const_sptr &ws) {
   const size_t numHists = ws->getNumberHistograms();
   for (size_t i = 0; i < numHists; ++i) {
     std::cout << "Histogram " << i << " = ";
@@ -955,11 +955,13 @@ void displayDataY(MatrixWorkspace_const_sptr ws) {
     std::cout << '\n';
   }
 }
-void displayData(MatrixWorkspace_const_sptr ws) { displayDataX(ws); }
+void displayData(const MatrixWorkspace_const_sptr &ws) {
+  displayDataX(std::move(ws));
+}
 
 // not strictly creating a workspace, but really helpful to see what one
 // contains
-void displayDataX(MatrixWorkspace_const_sptr ws) {
+void displayDataX(const MatrixWorkspace_const_sptr &ws) {
   const size_t numHists = ws->getNumberHistograms();
   for (size_t i = 0; i < numHists; ++i) {
     std::cout << "Histogram " << i << " = ";
@@ -973,7 +975,7 @@ void displayDataX(MatrixWorkspace_const_sptr ws) {
 
 // not strictly creating a workspace, but really helpful to see what one
 // contains
-void displayDataE(MatrixWorkspace_const_sptr ws) {
+void displayDataE(const MatrixWorkspace_const_sptr &ws) {
   const size_t numHists = ws->getNumberHistograms();
   for (size_t i = 0; i < numHists; ++i) {
     std::cout << "Histogram " << i << " = ";
@@ -992,7 +994,7 @@ void displayDataE(MatrixWorkspace_const_sptr ws) {
  * @param name :: property name
  * @param val :: value
  */
-void addTSPEntry(Run &runInfo, std::string name, double val) {
+void addTSPEntry(Run &runInfo, const std::string &name, double val) {
   TimeSeriesProperty<double> *tsp;
   tsp = new TimeSeriesProperty<double>(name);
   tsp->addValue("2011-05-24T00:00:00", val);
@@ -1008,7 +1010,7 @@ void addTSPEntry(Run &runInfo, std::string name, double val) {
  * @param b :: lattice length
  * @param c :: lattice length
  */
-void setOrientedLattice(Mantid::API::MatrixWorkspace_sptr ws, double a,
+void setOrientedLattice(const Mantid::API::MatrixWorkspace_sptr &ws, double a,
                         double b, double c) {
   ws->mutableSample().setOrientedLattice(
       std::make_unique<OrientedLattice>(a, b, c, 90., 90., 90.));
@@ -1022,8 +1024,8 @@ void setOrientedLattice(Mantid::API::MatrixWorkspace_sptr ws, double a,
  * @param chi :: +X rotation angle (deg)
  * @param omega :: +Y rotation angle (deg)
  */
-void setGoniometer(Mantid::API::MatrixWorkspace_sptr ws, double phi, double chi,
-                   double omega) {
+void setGoniometer(const Mantid::API::MatrixWorkspace_sptr &ws, double phi,
+                   double chi, double omega) {
   addTSPEntry(ws->mutableRun(), "phi", phi);
   addTSPEntry(ws->mutableRun(), "chi", chi);
   addTSPEntry(ws->mutableRun(), "omega", omega);
@@ -1151,9 +1153,9 @@ createProcessedInelasticWS(const std::vector<double> &L2,
  * The new workspace should be exactly the same as the source workspace but
  * without any events
  */
-Mantid::DataObjects::EventWorkspace_sptr
-createEventWorkspace3(Mantid::DataObjects::EventWorkspace_const_sptr sourceWS,
-                      std::string wsname, API::Algorithm *alg) {
+Mantid::DataObjects::EventWorkspace_sptr createEventWorkspace3(
+    const Mantid::DataObjects::EventWorkspace_const_sptr &sourceWS,
+    const std::string &wsname, API::Algorithm *alg) {
   UNUSED_ARG(wsname);
   // 1. Initialize:use dummy numbers for arguments, for event workspace it
   // doesn't matter
@@ -1474,7 +1476,8 @@ void processDetectorsPositions(const API::MatrixWorkspace_const_sptr &inputWS,
 }
 
 boost::shared_ptr<Mantid::DataObjects::TableWorkspace>
-buildPreprocessedDetectorsWorkspace(Mantid::API::MatrixWorkspace_sptr ws) {
+buildPreprocessedDetectorsWorkspace(
+    const Mantid::API::MatrixWorkspace_sptr &ws) {
   Mantid::DataObjects::TableWorkspace_sptr DetPos = createTableWorkspace(ws);
   auto Ei = ws->run().getPropertyValueAsType<double>("Ei");
   processDetectorsPositions(ws, DetPos, Ei);
diff --git a/Framework/Types/inc/MantidTypes/Core/DateAndTime.h b/Framework/Types/inc/MantidTypes/Core/DateAndTime.h
index da4b659f1d2..d0f48450d1c 100644
--- a/Framework/Types/inc/MantidTypes/Core/DateAndTime.h
+++ b/Framework/Types/inc/MantidTypes/Core/DateAndTime.h
@@ -45,9 +45,9 @@ public:
   DateAndTime(const int32_t seconds, const int32_t nanoseconds);
   DateAndTime(const int64_t seconds, const int64_t nanoseconds);
   DateAndTime(const std::string &ISO8601_string);
-  DateAndTime(const boost::posix_time::ptime _ptime);
+  DateAndTime(const boost::posix_time::ptime &_ptime);
 
-  void set_from_ptime(boost::posix_time::ptime _ptime);
+  void set_from_ptime(const boost::posix_time::ptime &_ptime);
   boost::posix_time::ptime to_ptime() const;
 
   void set_from_time_t(std::time_t _timet);
@@ -59,7 +59,7 @@ public:
   void setFromISO8601(const std::string &str);
   std::string toSimpleString() const;
   std::string
-  toFormattedString(const std::string format = "%Y-%b-%d %H:%M:%S") const;
+  toFormattedString(const std::string &format = "%Y-%b-%d %H:%M:%S") const;
   std::string toISO8601String() const;
 
   /// Stream output operator
@@ -112,7 +112,7 @@ public:
   static DateAndTime getCurrentTime();
   static DateAndTime maximum();
   static DateAndTime minimum();
-  static double secondsFromDuration(time_duration duration);
+  static double secondsFromDuration(const time_duration &duration);
   static time_duration durationFromSeconds(double duration);
   static int64_t nanosecondsFromDuration(const time_duration &td);
   static int64_t nanosecondsFromSeconds(double sec);
diff --git a/Framework/Types/src/Core/DateAndTime.cpp b/Framework/Types/src/Core/DateAndTime.cpp
index d64835cba9e..3b6c1c9884e 100644
--- a/Framework/Types/src/Core/DateAndTime.cpp
+++ b/Framework/Types/src/Core/DateAndTime.cpp
@@ -133,7 +133,7 @@ DateAndTime::DateAndTime(const std::string &ISO8601_string) : _nanoseconds(0) {
 /** Construct time from a boost::posix_time::ptime.
  * @param _ptime :: boost::posix_time::ptime
  */
-DateAndTime::DateAndTime(const boost::posix_time::ptime _ptime)
+DateAndTime::DateAndTime(const boost::posix_time::ptime &_ptime)
     : _nanoseconds(0) {
   this->set_from_ptime(_ptime);
 }
@@ -207,7 +207,7 @@ boost::posix_time::ptime DateAndTime::to_ptime() const {
  *
  * @param _ptime :: boost::posix_time::ptime date and time.
  */
-void DateAndTime::set_from_ptime(boost::posix_time::ptime _ptime) {
+void DateAndTime::set_from_ptime(const boost::posix_time::ptime &_ptime) {
   if (_ptime.is_special()) {
     // --- SPECIAL VALUES! ----
     if (_ptime.is_infinity() || _ptime.is_pos_infinity())
@@ -452,7 +452,7 @@ std::string DateAndTime::toSimpleString() const {
  * @param format : format for strftime(). Default "%Y-%b-%d %H:%M:%S"
  * @return date as string, formatted as requested
  */
-std::string DateAndTime::toFormattedString(const std::string format) const {
+std::string DateAndTime::toFormattedString(const std::string &format) const {
   char buffer[25];
   std::tm date_as_tm = this->to_tm();
   strftime(buffer, 25, format.c_str(), &date_as_tm);
@@ -688,7 +688,7 @@ DateAndTime DateAndTime::getCurrentTime() {
  * Return the number of seconds in a time_duration, as a double, including
  * fractional seconds.
  */
-double DateAndTime::secondsFromDuration(time_duration duration) {
+double DateAndTime::secondsFromDuration(const time_duration &duration) {
 #ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
   // Nanosecond resolution
   return static_cast<double>(duration.total_nanoseconds()) / 1e9;
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/AlignAndFocusPowder.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/AlignAndFocusPowder.h
index 8657a78876b..a82e1e84769 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/AlignAndFocusPowder.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/AlignAndFocusPowder.h
@@ -75,23 +75,22 @@ private:
                    const std::string &groupFilename);
   API::MatrixWorkspace_sptr rebin(API::MatrixWorkspace_sptr matrixws);
 
-  API::MatrixWorkspace_sptr conjoinWorkspaces(API::MatrixWorkspace_sptr ws1,
-                                              API::MatrixWorkspace_sptr ws2,
-                                              size_t offset);
+  API::MatrixWorkspace_sptr
+  conjoinWorkspaces(const API::MatrixWorkspace_sptr &ws1,
+                    const API::MatrixWorkspace_sptr &ws2, size_t offset);
 
   /// Call diffraction focus to a matrix workspace.
   API::MatrixWorkspace_sptr diffractionFocus(API::MatrixWorkspace_sptr ws);
 
   /// Convert units
   API::MatrixWorkspace_sptr convertUnits(API::MatrixWorkspace_sptr matrixws,
-                                         std::string target);
+                                         const std::string &target);
 
   /// Call edit instrument geometry
-  API::MatrixWorkspace_sptr editInstrument(API::MatrixWorkspace_sptr ws,
-                                           std::vector<double> polars,
-                                           std::vector<specnum_t> specids,
-                                           std::vector<double> l2s,
-                                           std::vector<double> phis);
+  API::MatrixWorkspace_sptr editInstrument(
+      API::MatrixWorkspace_sptr ws, const std::vector<double> &polars,
+      const std::vector<specnum_t> &specids, const std::vector<double> &l2s,
+      const std::vector<double> &phis);
   void convertOffsetsToCal(DataObjects::OffsetsWorkspace_sptr &offsetsWS);
   double getVecPropertyFromPmOrSelf(const std::string &name,
                                     std::vector<double> &avec);
@@ -123,7 +122,7 @@ private:
   double tmin{0.0};
   double tmax{0.0};
   bool m_preserveEvents{false};
-  void doSortEvents(Mantid::API::Workspace_sptr ws);
+  void doSortEvents(const Mantid::API::Workspace_sptr &ws);
 
   /// Low resolution TOF matrix workspace
   API::MatrixWorkspace_sptr m_lowResW;
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/DgsReduction.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/DgsReduction.h
index 5da83dcc1e4..6ed48dc7a61 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/DgsReduction.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/DgsReduction.h
@@ -32,12 +32,13 @@ public:
 private:
   void init() override;
   void exec() override;
-  API::Workspace_sptr loadInputData(const std::string prop,
+  API::Workspace_sptr loadInputData(const std::string &prop,
                                     const bool mustLoad = true);
-  API::MatrixWorkspace_sptr loadGroupingFile(const std::string prop);
+  API::MatrixWorkspace_sptr loadGroupingFile(const std::string &prop);
   API::MatrixWorkspace_sptr loadHardMask();
-  double getParameter(std::string algParam, API::MatrixWorkspace_sptr ws,
-                      std::string altParam);
+  double getParameter(const std::string &algParam,
+                      const API::MatrixWorkspace_sptr &ws,
+                      const std::string &altParam);
 
   boost::shared_ptr<Kernel::PropertyManager> reductionManager;
 };
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/DgsRemap.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/DgsRemap.h
index 5b7a37597bb..52e054f871e 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/DgsRemap.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/DgsRemap.h
@@ -30,9 +30,9 @@ public:
 private:
   void init() override;
   void exec() override;
-  void execGrouping(API::MatrixWorkspace_sptr iWS,
+  void execGrouping(const API::MatrixWorkspace_sptr &iWS,
                     API::MatrixWorkspace_sptr &oWS);
-  void execMasking(API::MatrixWorkspace_sptr iWS);
+  void execMasking(const API::MatrixWorkspace_sptr &iWS);
 };
 
 } // namespace WorkflowAlgorithms
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/EQSANSInstrument.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/EQSANSInstrument.h
index f8bc95b1595..9482d96bbb4 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/EQSANSInstrument.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/EQSANSInstrument.h
@@ -24,17 +24,17 @@ const double default_slit_positions[3][8] = {
     {0.0, 10.0, 10.0, 15.0, 15.0, 20.0, 20.0, 40.0}};
 
 double readInstrumentParameter(const std::string &parameter,
-                               API::MatrixWorkspace_sptr dataWS);
+                               const API::MatrixWorkspace_sptr &dataWS);
 int getDetectorFromPixel(const int &pixel_x, const int &pixel_y,
-                         API::MatrixWorkspace_sptr dataWS);
+                         const API::MatrixWorkspace_sptr &dataWS);
 void getCoordinateFromPixel(const double &pixel_x, const double &pixel_y,
-                            API::MatrixWorkspace_sptr dataWS, double &x,
+                            const API::MatrixWorkspace_sptr &dataWS, double &x,
                             double &y);
 void getPixelFromCoordinate(const double &x, const double &y,
-                            API::MatrixWorkspace_sptr dataWS, double &pixel_x,
-                            double &pixel_y);
-void getDefaultBeamCenter(API::MatrixWorkspace_sptr dataWS, double &pixel_x,
-                          double &pixel_y);
+                            const API::MatrixWorkspace_sptr &dataWS,
+                            double &pixel_x, double &pixel_y);
+void getDefaultBeamCenter(const API::MatrixWorkspace_sptr &dataWS,
+                          double &pixel_x, double &pixel_y);
 
 } // namespace EQSANSInstrument
 } // namespace WorkflowAlgorithms
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/EQSANSMonitorTOF.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/EQSANSMonitorTOF.h
index 4b8bc0f2890..18c9ef46276 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/EQSANSMonitorTOF.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/EQSANSMonitorTOF.h
@@ -52,7 +52,7 @@ private:
   void exec() override;
 
   /// Compute TOF offset
-  double getTofOffset(API::MatrixWorkspace_const_sptr inputWS,
+  double getTofOffset(const API::MatrixWorkspace_const_sptr &inputWS,
                       bool frame_skipping, double source_to_monitor);
 };
 
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/ExtractQENSMembers.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/ExtractQENSMembers.h
index eaf91d39f4d..18dd6e576e9 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/ExtractQENSMembers.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/ExtractQENSMembers.h
@@ -33,7 +33,7 @@ private:
   getQValues(const std::vector<Mantid::API::MatrixWorkspace_sptr> &workspaces);
 
   std::vector<std::string>
-  getAxisLabels(Mantid::API::MatrixWorkspace_sptr workspace,
+  getAxisLabels(const Mantid::API::MatrixWorkspace_sptr &workspace,
                 size_t axisIndex) const;
 
   std::vector<std::string>
@@ -41,20 +41,21 @@ private:
                          const std::vector<std::string> &newNames) const;
 
   Mantid::API::MatrixWorkspace_sptr
-  extractSpectrum(Mantid::API::MatrixWorkspace_sptr inputWS, size_t spectrum);
+  extractSpectrum(const Mantid::API::MatrixWorkspace_sptr &inputWS,
+                  size_t spectrum);
 
   Mantid::API::MatrixWorkspace_sptr
-  appendSpectra(Mantid::API::MatrixWorkspace_sptr inputWS,
-                Mantid::API::MatrixWorkspace_sptr spectraWorkspace);
+  appendSpectra(const Mantid::API::MatrixWorkspace_sptr &inputWS,
+                const Mantid::API::MatrixWorkspace_sptr &spectraWorkspace);
 
   Mantid::API::WorkspaceGroup_sptr
   groupWorkspaces(const std::vector<std::string> &workspaceNames);
 
   std::vector<Mantid::API::MatrixWorkspace_sptr>
-  createMembersWorkspaces(Mantid::API::MatrixWorkspace_sptr initialWS,
+  createMembersWorkspaces(const Mantid::API::MatrixWorkspace_sptr &initialWS,
                           const std::vector<std::string> &members);
 
-  void appendToMembers(Mantid::API::MatrixWorkspace_sptr resultWS,
+  void appendToMembers(const Mantid::API::MatrixWorkspace_sptr &resultWS,
                        std::vector<Mantid::API::MatrixWorkspace_sptr> &members);
 
   void setNumericAxis(
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/HFIRDarkCurrentSubtraction.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/HFIRDarkCurrentSubtraction.h
index 8167b77c912..61d45c8c2be 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/HFIRDarkCurrentSubtraction.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/HFIRDarkCurrentSubtraction.h
@@ -59,7 +59,7 @@ private:
   void init() override;
   /// Execution code
   void exec() override;
-  double getCountingTime(API::MatrixWorkspace_sptr inputWS);
+  double getCountingTime(const API::MatrixWorkspace_sptr &inputWS);
 
   static const int DEFAULT_MONITOR_ID = 0;
   static const int DEFAULT_TIMER_ID = 1;
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/HFIRInstrument.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/HFIRInstrument.h
index a42ba6969a7..76d24d463d6 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/HFIRInstrument.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/HFIRInstrument.h
@@ -20,18 +20,18 @@ namespace HFIRInstrument {
 */
 
 double readInstrumentParameter(const std::string &parameter,
-                               API::MatrixWorkspace_sptr dataWS);
+                               const API::MatrixWorkspace_sptr &dataWS);
 int getDetectorFromPixel(const int &pixel_x, const int &pixel_y,
-                         API::MatrixWorkspace_sptr dataWS);
+                         const API::MatrixWorkspace_sptr &dataWS);
 void getCoordinateFromPixel(const double &pixel_x, const double &pixel_y,
-                            API::MatrixWorkspace_sptr dataWS, double &x,
+                            const API::MatrixWorkspace_sptr &dataWS, double &x,
                             double &y);
 void getPixelFromCoordinate(const double &x, const double &y,
-                            API::MatrixWorkspace_sptr dataWS, double &pixel_x,
-                            double &pixel_y);
-void getDefaultBeamCenter(API::MatrixWorkspace_sptr dataWS, double &pixel_x,
-                          double &pixel_y);
-double getSourceToSampleDistance(API::MatrixWorkspace_sptr dataWS);
+                            const API::MatrixWorkspace_sptr &dataWS,
+                            double &pixel_x, double &pixel_y);
+void getDefaultBeamCenter(const API::MatrixWorkspace_sptr &dataWS,
+                          double &pixel_x, double &pixel_y);
+double getSourceToSampleDistance(const API::MatrixWorkspace_sptr &dataWS);
 
 } // namespace HFIRInstrument
 } // namespace WorkflowAlgorithms
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/IMuonAsymmetryCalculator.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/IMuonAsymmetryCalculator.h
index 54c73581ced..17b9d84bb99 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/IMuonAsymmetryCalculator.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/IMuonAsymmetryCalculator.h
@@ -20,9 +20,9 @@ namespace WorkflowAlgorithms {
 */
 class DLLExport IMuonAsymmetryCalculator {
 public:
-  IMuonAsymmetryCalculator(const API::WorkspaceGroup_sptr inputWS,
-                           const std::vector<int> summedPeriods,
-                           const std::vector<int> subtractedPeriods);
+  IMuonAsymmetryCalculator(const API::WorkspaceGroup_sptr &inputWS,
+                           const std::vector<int> &summedPeriods,
+                           const std::vector<int> &subtractedPeriods);
   virtual ~IMuonAsymmetryCalculator() = default;
   /// Overridden in derived classes to perform asymmetry calculation
   virtual API::MatrixWorkspace_sptr calculate() const = 0;
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupAsymmetryCalculator.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupAsymmetryCalculator.h
index 8226fe81590..9c9294fce63 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupAsymmetryCalculator.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupAsymmetryCalculator.h
@@ -16,12 +16,12 @@ namespace WorkflowAlgorithms {
 */
 class DLLExport MuonGroupAsymmetryCalculator : public MuonGroupCalculator {
 public:
-  MuonGroupAsymmetryCalculator(const API::WorkspaceGroup_sptr inputWS,
-                               const std::vector<int> summedPeriods,
-                               const std::vector<int> subtractedPeriods,
+  MuonGroupAsymmetryCalculator(const API::WorkspaceGroup_sptr &inputWS,
+                               const std::vector<int> &summedPeriods,
+                               const std::vector<int> &subtractedPeriods,
                                const int groupIndex, const double start = 0.0,
                                const double end = 30.0,
-                               const std::string wsName = "");
+                               const std::string &wsName = "");
   /// Performs group asymmetry calculation
   API::MatrixWorkspace_sptr calculate() const override;
 
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupCalculator.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupCalculator.h
index 7bd7d3fb087..145e64d2dc9 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupCalculator.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupCalculator.h
@@ -15,12 +15,12 @@ namespace WorkflowAlgorithms {
  */
 class DLLExport MuonGroupCalculator : public IMuonAsymmetryCalculator {
 public:
-  MuonGroupCalculator(const Mantid::API::WorkspaceGroup_sptr inputWS,
-                      const std::vector<int> summedPeriods,
-                      const std::vector<int> subtractedPeriods,
+  MuonGroupCalculator(const Mantid::API::WorkspaceGroup_sptr &inputWS,
+                      const std::vector<int> &summedPeriods,
+                      const std::vector<int> &subtractedPeriods,
                       const int groupIndex);
   void setStartEnd(const double start, const double end);
-  void setWSName(const std::string wsName);
+  void setWSName(const std::string &wsName);
 
 protected:
   /// Workspace index of the group to analyse
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupCountsCalculator.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupCountsCalculator.h
index 39527d5f274..7065beb04fd 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupCountsCalculator.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonGroupCountsCalculator.h
@@ -16,9 +16,9 @@ namespace WorkflowAlgorithms {
 */
 class DLLExport MuonGroupCountsCalculator : public MuonGroupCalculator {
 public:
-  MuonGroupCountsCalculator(const Mantid::API::WorkspaceGroup_sptr inputWS,
-                            const std::vector<int> summedPeriods,
-                            const std::vector<int> subtractedPeriods,
+  MuonGroupCountsCalculator(const Mantid::API::WorkspaceGroup_sptr &inputWS,
+                            const std::vector<int> &summedPeriods,
+                            const std::vector<int> &subtractedPeriods,
                             const int groupIndex);
   /// Performs group counts calculation
   Mantid::API::MatrixWorkspace_sptr calculate() const override;
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonPairAsymmetryCalculator.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonPairAsymmetryCalculator.h
index e648207f6aa..00d978d8757 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonPairAsymmetryCalculator.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonPairAsymmetryCalculator.h
@@ -16,9 +16,9 @@ namespace WorkflowAlgorithms {
 */
 class DLLExport MuonPairAsymmetryCalculator : public IMuonAsymmetryCalculator {
 public:
-  MuonPairAsymmetryCalculator(const API::WorkspaceGroup_sptr inputWS,
-                              const std::vector<int> summedPeriods,
-                              const std::vector<int> subtractedPeriods,
+  MuonPairAsymmetryCalculator(const API::WorkspaceGroup_sptr &inputWS,
+                              const std::vector<int> &summedPeriods,
+                              const std::vector<int> &subtractedPeriods,
                               const int firstPairIndex,
                               const int secondPairIndex,
                               const double alpha = 1);
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonProcess.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonProcess.h
index b5e022ab695..7489a3e35a1 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonProcess.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/MuonProcess.h
@@ -39,12 +39,12 @@ private:
   /// Groups specified workspace group according to specified
   /// DetectorGroupingTable.
   API::WorkspaceGroup_sptr
-  groupWorkspaces(API::WorkspaceGroup_sptr wsGroup,
-                  DataObjects::TableWorkspace_sptr grouping);
+  groupWorkspaces(const API::WorkspaceGroup_sptr &wsGroup,
+                  const DataObjects::TableWorkspace_sptr &grouping);
 
   /// Applies dead time correction to the workspace group.
-  API::WorkspaceGroup_sptr applyDTC(API::WorkspaceGroup_sptr wsGroup,
-                                    DataObjects::TableWorkspace_sptr dt);
+  API::WorkspaceGroup_sptr applyDTC(const API::WorkspaceGroup_sptr &wsGroup,
+                                    const DataObjects::TableWorkspace_sptr &dt);
 
   /// Applies offset, crops and rebin the workspace according to specified
   /// params
@@ -52,8 +52,9 @@ private:
                                              double loadedTimeZero);
 
   /// Applies offset, crops and rebins all workspaces in the group
-  API::WorkspaceGroup_sptr correctWorkspaces(API::WorkspaceGroup_sptr wsGroup,
-                                             double loadedTimeZero);
+  API::WorkspaceGroup_sptr
+  correctWorkspaces(const API::WorkspaceGroup_sptr &wsGroup,
+                    double loadedTimeZero);
 
   /// Builds an error message from a list of invalid periods
   std::string buildErrorString(const std::vector<int> &invalidPeriods) const;
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/SANSBeamFinder.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/SANSBeamFinder.h
index 14feb749b97..4e5ade30135 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/SANSBeamFinder.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/SANSBeamFinder.h
@@ -40,8 +40,8 @@ private:
   void exec() override;
   API::MatrixWorkspace_sptr
   loadBeamFinderFile(const std::string &beamCenterFile);
-  void maskEdges(API::MatrixWorkspace_sptr beamCenterWS, int high, int low,
-                 int left, int right,
+  void maskEdges(const API::MatrixWorkspace_sptr &beamCenterWS, int high,
+                 int low, int left, int right,
                  const std::string &componentName = "detector1");
 
   boost::shared_ptr<Kernel::PropertyManager> m_reductionManager;
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/SetupEQSANSReduction.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/SetupEQSANSReduction.h
index d58c344d69d..fc5e6f053b3 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/SetupEQSANSReduction.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/SetupEQSANSReduction.h
@@ -39,12 +39,12 @@ private:
   /// Execution code
   void exec() override;
   std::string _findFile(std::string dataRun);
-  void
-  setupSensitivity(boost::shared_ptr<Kernel::PropertyManager> reductionManager);
+  void setupSensitivity(
+      const boost::shared_ptr<Kernel::PropertyManager> &reductionManager);
   void setupTransmission(
-      boost::shared_ptr<Kernel::PropertyManager> reductionManager);
-  void
-  setupBackground(boost::shared_ptr<Kernel::PropertyManager> reductionManager);
+      const boost::shared_ptr<Kernel::PropertyManager> &reductionManager);
+  void setupBackground(
+      const boost::shared_ptr<Kernel::PropertyManager> &reductionManager);
 };
 
 } // namespace WorkflowAlgorithms
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/SetupHFIRReduction.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/SetupHFIRReduction.h
index ab794a925ae..e3f63b5d70f 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/SetupHFIRReduction.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/SetupHFIRReduction.h
@@ -40,11 +40,11 @@ private:
   /// Execution code
   void exec() override;
   void setupTransmission(
-      boost::shared_ptr<Kernel::PropertyManager> reductionManager);
-  void
-  setupBackground(boost::shared_ptr<Kernel::PropertyManager> reductionManager);
-  void
-  setupSensitivity(boost::shared_ptr<Kernel::PropertyManager> reductionManager);
+      const boost::shared_ptr<Kernel::PropertyManager> &reductionManager);
+  void setupBackground(
+      const boost::shared_ptr<Kernel::PropertyManager> &reductionManager);
+  void setupSensitivity(
+      const boost::shared_ptr<Kernel::PropertyManager> &reductionManager);
 };
 
 } // namespace WorkflowAlgorithms
diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/StepScan.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/StepScan.h
index 54981c1a711..7fec136646b 100644
--- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/StepScan.h
+++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/StepScan.h
@@ -35,13 +35,13 @@ private:
   void exec() override;
 
   DataObjects::EventWorkspace_sptr
-  getMonitorWorkspace(API::MatrixWorkspace_sptr inputWS);
+  getMonitorWorkspace(const API::MatrixWorkspace_sptr &inputWS);
   DataObjects::EventWorkspace_sptr
-  cloneInputWorkspace(API::Workspace_sptr inputWS);
-  void runMaskDetectors(API::MatrixWorkspace_sptr inputWS,
-                        API::MatrixWorkspace_sptr maskWS);
-  void runFilterByXValue(API::MatrixWorkspace_sptr inputWS, const double xmin,
-                         const double xmax);
+  cloneInputWorkspace(const API::Workspace_sptr &inputWS);
+  void runMaskDetectors(const API::MatrixWorkspace_sptr &inputWS,
+                        const API::MatrixWorkspace_sptr &maskWS);
+  void runFilterByXValue(const API::MatrixWorkspace_sptr &inputWS,
+                         const double xmin, const double xmax);
 };
 
 } // namespace WorkflowAlgorithms
diff --git a/Framework/WorkflowAlgorithms/src/AlignAndFocusPowder.cpp b/Framework/WorkflowAlgorithms/src/AlignAndFocusPowder.cpp
index 38c7735f2c5..2a5961d7306 100644
--- a/Framework/WorkflowAlgorithms/src/AlignAndFocusPowder.cpp
+++ b/Framework/WorkflowAlgorithms/src/AlignAndFocusPowder.cpp
@@ -823,9 +823,9 @@ void AlignAndFocusPowder::exec() {
 /** Call edit instrument geometry
  */
 API::MatrixWorkspace_sptr AlignAndFocusPowder::editInstrument(
-    API::MatrixWorkspace_sptr ws, std::vector<double> polars,
-    std::vector<specnum_t> specids, std::vector<double> l2s,
-    std::vector<double> phis) {
+    API::MatrixWorkspace_sptr ws, const std::vector<double> &polars,
+    const std::vector<specnum_t> &specids, const std::vector<double> &l2s,
+    const std::vector<double> &phis) {
   g_log.information() << "running EditInstrumentGeometry started at "
                       << Types::Core::DateAndTime::getCurrentTime() << "\n";
 
@@ -884,7 +884,7 @@ AlignAndFocusPowder::diffractionFocus(API::MatrixWorkspace_sptr ws) {
  */
 API::MatrixWorkspace_sptr
 AlignAndFocusPowder::convertUnits(API::MatrixWorkspace_sptr matrixws,
-                                  std::string target) {
+                                  const std::string &target) {
   g_log.information() << "running ConvertUnits(Target=" << target
                       << ") started at "
                       << Types::Core::DateAndTime::getCurrentTime() << "\n";
@@ -955,8 +955,8 @@ AlignAndFocusPowder::rebin(API::MatrixWorkspace_sptr matrixws) {
 /** Add workspace2 to workspace1 by adding spectrum.
  */
 MatrixWorkspace_sptr
-AlignAndFocusPowder::conjoinWorkspaces(API::MatrixWorkspace_sptr ws1,
-                                       API::MatrixWorkspace_sptr ws2,
+AlignAndFocusPowder::conjoinWorkspaces(const API::MatrixWorkspace_sptr &ws1,
+                                       const API::MatrixWorkspace_sptr &ws2,
                                        size_t offset) {
   // Get information from ws1: maximum spectrum number, and store original
   // spectrum Nos
@@ -1129,7 +1129,7 @@ void AlignAndFocusPowder::loadCalFile(const std::string &calFilename,
  *
  * @param ws :: any Workspace. Does nothing if not EventWorkspace.
  */
-void AlignAndFocusPowder::doSortEvents(Mantid::API::Workspace_sptr ws) {
+void AlignAndFocusPowder::doSortEvents(const Mantid::API::Workspace_sptr &ws) {
   EventWorkspace_sptr eventWS = boost::dynamic_pointer_cast<EventWorkspace>(ws);
   if (!eventWS)
     return;
diff --git a/Framework/WorkflowAlgorithms/src/DgsReduction.cpp b/Framework/WorkflowAlgorithms/src/DgsReduction.cpp
index f14fbc06ef2..0f1c2057880 100644
--- a/Framework/WorkflowAlgorithms/src/DgsReduction.cpp
+++ b/Framework/WorkflowAlgorithms/src/DgsReduction.cpp
@@ -566,7 +566,7 @@ void DgsReduction::init() {
  * Create a workspace by either loading a file or using an existing
  * workspace.
  */
-Workspace_sptr DgsReduction::loadInputData(const std::string prop,
+Workspace_sptr DgsReduction::loadInputData(const std::string &prop,
                                            const bool mustLoad) {
   g_log.debug() << "MustLoad = " << mustLoad << '\n';
   Workspace_sptr inputWS;
@@ -648,7 +648,7 @@ MatrixWorkspace_sptr DgsReduction::loadHardMask() {
   }
 }
 
-MatrixWorkspace_sptr DgsReduction::loadGroupingFile(const std::string prop) {
+MatrixWorkspace_sptr DgsReduction::loadGroupingFile(const std::string &prop) {
   const std::string propName = prop + "GroupingFile";
   const std::string groupFile = this->getProperty(propName);
   if (groupFile.empty()) {
@@ -672,8 +672,9 @@ MatrixWorkspace_sptr DgsReduction::loadGroupingFile(const std::string prop) {
   }
 }
 
-double DgsReduction::getParameter(std::string algParam, MatrixWorkspace_sptr ws,
-                                  std::string altParam) {
+double DgsReduction::getParameter(const std::string &algParam,
+                                  const MatrixWorkspace_sptr &ws,
+                                  const std::string &altParam) {
   double param = this->getProperty(algParam);
   if (EMPTY_DBL() == param) {
     param = ws->getInstrument()->getNumberParameter(altParam)[0];
diff --git a/Framework/WorkflowAlgorithms/src/DgsRemap.cpp b/Framework/WorkflowAlgorithms/src/DgsRemap.cpp
index f2675e2c31f..dc3a07d6894 100644
--- a/Framework/WorkflowAlgorithms/src/DgsRemap.cpp
+++ b/Framework/WorkflowAlgorithms/src/DgsRemap.cpp
@@ -74,7 +74,7 @@ void DgsRemap::exec() {
   this->setProperty("OutputWorkspace", outputWS);
 }
 
-void DgsRemap::execMasking(MatrixWorkspace_sptr iWS) {
+void DgsRemap::execMasking(const MatrixWorkspace_sptr &iWS) {
   MatrixWorkspace_sptr maskWS = this->getProperty("MaskWorkspace");
   if (maskWS) {
     IAlgorithm_sptr mask = this->createChildAlgorithm("MaskDetectors");
@@ -84,7 +84,7 @@ void DgsRemap::execMasking(MatrixWorkspace_sptr iWS) {
   }
 }
 
-void DgsRemap::execGrouping(MatrixWorkspace_sptr iWS,
+void DgsRemap::execGrouping(const MatrixWorkspace_sptr &iWS,
                             MatrixWorkspace_sptr &oWS) {
   MatrixWorkspace_sptr groupWS = this->getProperty("GroupingWorkspace");
   std::string oldGroupingFile = this->getProperty("OldGroupingFile");
diff --git a/Framework/WorkflowAlgorithms/src/EQSANSInstrument.cpp b/Framework/WorkflowAlgorithms/src/EQSANSInstrument.cpp
index 8e335feaa8d..a775a38f9fc 100644
--- a/Framework/WorkflowAlgorithms/src/EQSANSInstrument.cpp
+++ b/Framework/WorkflowAlgorithms/src/EQSANSInstrument.cpp
@@ -7,10 +7,12 @@
 //----------------------------------------------------------------------
 // Includes
 //----------------------------------------------------------------------
-#include "MantidWorkflowAlgorithms/EQSANSInstrument.h"
+#include <utility>
+
 #include "MantidDataObjects/EventWorkspace.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidKernel/Exception.h"
+#include "MantidWorkflowAlgorithms/EQSANSInstrument.h"
 
 namespace Mantid {
 namespace WorkflowAlgorithms {
@@ -24,7 +26,7 @@ namespace EQSANSInstrument {
  * Read a parameter from the instrument description
  */
 double readInstrumentParameter(const std::string &parameter,
-                               API::MatrixWorkspace_sptr dataWS) {
+                               const API::MatrixWorkspace_sptr &dataWS) {
   std::vector<double> pars =
       dataWS->getInstrument()->getNumberParameter(parameter);
   if (pars.empty())
@@ -37,9 +39,9 @@ double readInstrumentParameter(const std::string &parameter,
  * Return the detector ID corresponding to the [x,y] pixel coordinates.
  */
 int getDetectorFromPixel(const int &pixel_x, const int &pixel_y,
-                         API::MatrixWorkspace_sptr dataWS) {
-  int ny_pixels =
-      static_cast<int>(readInstrumentParameter("number-of-y-pixels", dataWS));
+                         const API::MatrixWorkspace_sptr &dataWS) {
+  int ny_pixels = static_cast<int>(
+      readInstrumentParameter("number-of-y-pixels", std::move(dataWS)));
   return ny_pixels * pixel_x + pixel_y;
 }
 
@@ -48,7 +50,7 @@ int getDetectorFromPixel(const int &pixel_x, const int &pixel_y,
  * given pixel coordinates [m].
  */
 void getCoordinateFromPixel(const double &pixel_x, const double &pixel_y,
-                            API::MatrixWorkspace_sptr dataWS, double &x,
+                            const API::MatrixWorkspace_sptr &dataWS, double &x,
                             double &y) {
   const int nx_pixels =
       static_cast<int>(readInstrumentParameter("number-of-x-pixels", dataWS));
@@ -68,8 +70,8 @@ void getCoordinateFromPixel(const double &pixel_x, const double &pixel_y,
  * @param y: real-space y coordinate [m]
  */
 void getPixelFromCoordinate(const double &x, const double &y,
-                            API::MatrixWorkspace_sptr dataWS, double &pixel_x,
-                            double &pixel_y) {
+                            const API::MatrixWorkspace_sptr &dataWS,
+                            double &pixel_x, double &pixel_y) {
   const int nx_pixels =
       static_cast<int>(readInstrumentParameter("number-of-x-pixels", dataWS));
   const int ny_pixels =
@@ -84,9 +86,9 @@ void getPixelFromCoordinate(const double &x, const double &y,
  * Returns the default beam center position, or the pixel location
  * of real-space coordinates (0,0).
  */
-void getDefaultBeamCenter(API::MatrixWorkspace_sptr dataWS, double &pixel_x,
-                          double &pixel_y) {
-  getPixelFromCoordinate(0.0, 0.0, dataWS, pixel_x, pixel_y);
+void getDefaultBeamCenter(const API::MatrixWorkspace_sptr &dataWS,
+                          double &pixel_x, double &pixel_y) {
+  getPixelFromCoordinate(0.0, 0.0, std::move(dataWS), pixel_x, pixel_y);
 }
 
 } // namespace EQSANSInstrument
diff --git a/Framework/WorkflowAlgorithms/src/EQSANSLoad.cpp b/Framework/WorkflowAlgorithms/src/EQSANSLoad.cpp
index 6eb5dc99573..67d70ac8cf4 100644
--- a/Framework/WorkflowAlgorithms/src/EQSANSLoad.cpp
+++ b/Framework/WorkflowAlgorithms/src/EQSANSLoad.cpp
@@ -120,7 +120,7 @@ void EQSANSLoad::init() {
 /// Returns the value of a run property from a given workspace
 /// @param inputWS :: input workspace
 /// @param pname :: name of the property to retrieve
-double getRunPropertyDbl(MatrixWorkspace_sptr inputWS,
+double getRunPropertyDbl(const MatrixWorkspace_sptr &inputWS,
                          const std::string &pname) {
   Mantid::Kernel::Property *prop = inputWS->run().getProperty(pname);
   auto *dp = dynamic_cast<Mantid::Kernel::PropertyWithValue<double> *>(prop);
diff --git a/Framework/WorkflowAlgorithms/src/EQSANSMonitorTOF.cpp b/Framework/WorkflowAlgorithms/src/EQSANSMonitorTOF.cpp
index 80c5abb0c8f..a35a04e1d8d 100644
--- a/Framework/WorkflowAlgorithms/src/EQSANSMonitorTOF.cpp
+++ b/Framework/WorkflowAlgorithms/src/EQSANSMonitorTOF.cpp
@@ -190,7 +190,7 @@ void EQSANSMonitorTOF::exec() {
   setProperty("OutputWorkspace", outputWS);
 }
 
-double EQSANSMonitorTOF::getTofOffset(MatrixWorkspace_const_sptr inputWS,
+double EQSANSMonitorTOF::getTofOffset(const MatrixWorkspace_const_sptr &inputWS,
                                       bool frame_skipping,
                                       double source_to_monitor) {
   //# Storage for chopper information read from the logs
diff --git a/Framework/WorkflowAlgorithms/src/EQSANSQ2D.cpp b/Framework/WorkflowAlgorithms/src/EQSANSQ2D.cpp
index 0e05c886d9d..e28de98b3f7 100644
--- a/Framework/WorkflowAlgorithms/src/EQSANSQ2D.cpp
+++ b/Framework/WorkflowAlgorithms/src/EQSANSQ2D.cpp
@@ -39,7 +39,8 @@ void EQSANSQ2D::init() {
 /// Returns the value of a run property from a given workspace
 /// @param inputWS :: input workspace
 /// @param pname :: name of the property to retrieve
-double getRunProperty(MatrixWorkspace_sptr inputWS, const std::string &pname) {
+double getRunProperty(const MatrixWorkspace_sptr &inputWS,
+                      const std::string &pname) {
   return inputWS->run().getPropertyValueAsType<double>(pname);
 }
 
diff --git a/Framework/WorkflowAlgorithms/src/ExtractQENSMembers.cpp b/Framework/WorkflowAlgorithms/src/ExtractQENSMembers.cpp
index c1659b2fcd3..09762927893 100644
--- a/Framework/WorkflowAlgorithms/src/ExtractQENSMembers.cpp
+++ b/Framework/WorkflowAlgorithms/src/ExtractQENSMembers.cpp
@@ -158,7 +158,7 @@ std::vector<double> ExtractQENSMembers::getQValues(
  * @return          The retrieved axis labels.
  */
 std::vector<std::string>
-ExtractQENSMembers::getAxisLabels(MatrixWorkspace_sptr workspace,
+ExtractQENSMembers::getAxisLabels(const MatrixWorkspace_sptr &workspace,
                                   size_t axisIndex) const {
   auto axis = workspace->getAxis(axisIndex);
   std::vector<std::string> labels;
@@ -201,7 +201,7 @@ std::vector<std::string> ExtractQENSMembers::renameConvolvedMembers(
  * @return          A workspace containing the extracted spectrum.
  */
 MatrixWorkspace_sptr
-ExtractQENSMembers::extractSpectrum(MatrixWorkspace_sptr inputWS,
+ExtractQENSMembers::extractSpectrum(const MatrixWorkspace_sptr &inputWS,
                                     size_t spectrum) {
   auto extractAlg = createChildAlgorithm("ExtractSpectra", -1.0, -1.0, false);
   extractAlg->setProperty("InputWorkspace", inputWS);
@@ -221,9 +221,9 @@ ExtractQENSMembers::extractSpectrum(MatrixWorkspace_sptr inputWS,
  * @param inputWS           The input workspace to append to.
  * @param spectraWorkspace  The workspace whose spectra to append.
  */
-MatrixWorkspace_sptr
-ExtractQENSMembers::appendSpectra(MatrixWorkspace_sptr inputWS,
-                                  MatrixWorkspace_sptr spectraWorkspace) {
+MatrixWorkspace_sptr ExtractQENSMembers::appendSpectra(
+    const MatrixWorkspace_sptr &inputWS,
+    const MatrixWorkspace_sptr &spectraWorkspace) {
   auto appendAlg = createChildAlgorithm("AppendSpectra", -1.0, -1.0, false);
   appendAlg->setProperty("InputWorkspace1", inputWS);
   appendAlg->setProperty("InputWorkspace2", spectraWorkspace);
@@ -256,7 +256,8 @@ WorkspaceGroup_sptr ExtractQENSMembers::groupWorkspaces(
  * @return          A vector of the created members workspaces.
  */
 std::vector<MatrixWorkspace_sptr> ExtractQENSMembers::createMembersWorkspaces(
-    MatrixWorkspace_sptr initialWS, const std::vector<std::string> &members) {
+    const MatrixWorkspace_sptr &initialWS,
+    const std::vector<std::string> &members) {
   std::vector<MatrixWorkspace_sptr> memberWorkspaces;
   memberWorkspaces.reserve(members.size());
   for (auto i = 0u; i < members.size(); ++i)
@@ -272,7 +273,7 @@ std::vector<MatrixWorkspace_sptr> ExtractQENSMembers::createMembersWorkspaces(
  * @param members   A vector containing the member workspaces.
  */
 void ExtractQENSMembers::appendToMembers(
-    MatrixWorkspace_sptr resultWS,
+    const MatrixWorkspace_sptr &resultWS,
     std::vector<Mantid::API::MatrixWorkspace_sptr> &members) {
   for (auto i = 0u; i < members.size(); ++i)
     members[i] = appendSpectra(members[i], extractSpectrum(resultWS, i));
diff --git a/Framework/WorkflowAlgorithms/src/HFIRDarkCurrentSubtraction.cpp b/Framework/WorkflowAlgorithms/src/HFIRDarkCurrentSubtraction.cpp
index 1fc8de3bca3..ea3bf5f6c29 100644
--- a/Framework/WorkflowAlgorithms/src/HFIRDarkCurrentSubtraction.cpp
+++ b/Framework/WorkflowAlgorithms/src/HFIRDarkCurrentSubtraction.cpp
@@ -157,8 +157,8 @@ void HFIRDarkCurrentSubtraction::exec() {
 
 /// Get the counting time from a workspace
 /// @param inputWS :: workspace to read the counting time from
-double
-HFIRDarkCurrentSubtraction::getCountingTime(MatrixWorkspace_sptr inputWS) {
+double HFIRDarkCurrentSubtraction::getCountingTime(
+    const MatrixWorkspace_sptr &inputWS) {
   // First, look whether we have the information in the log
   if (inputWS->run().hasProperty("timer")) {
     return inputWS->run().getPropertyValueAsType<double>("timer");
diff --git a/Framework/WorkflowAlgorithms/src/HFIRInstrument.cpp b/Framework/WorkflowAlgorithms/src/HFIRInstrument.cpp
index fcedefe5c75..1063baa7a96 100644
--- a/Framework/WorkflowAlgorithms/src/HFIRInstrument.cpp
+++ b/Framework/WorkflowAlgorithms/src/HFIRInstrument.cpp
@@ -21,6 +21,7 @@
 #include <boost/regex.hpp>
 #include <boost/shared_array.hpp>
 #include <boost/shared_ptr.hpp>
+#include <utility>
 
 namespace Mantid {
 namespace WorkflowAlgorithms {
@@ -34,7 +35,7 @@ namespace HFIRInstrument {
  * Read a parameter from the instrument description
  */
 double readInstrumentParameter(const std::string &parameter,
-                               API::MatrixWorkspace_sptr dataWS) {
+                               const API::MatrixWorkspace_sptr &dataWS) {
   std::vector<double> pars =
       dataWS->getInstrument()->getNumberParameter(parameter);
   if (pars.empty())
@@ -47,7 +48,7 @@ double readInstrumentParameter(const std::string &parameter,
  * Return the detector ID corresponding to the [x,y] pixel coordinates.
  */
 int getDetectorFromPixel(const int &pixel_x, const int &pixel_y,
-                         API::MatrixWorkspace_sptr dataWS) {
+                         const API::MatrixWorkspace_sptr &dataWS) {
   UNUSED_ARG(dataWS);
   return 1000000 + 1000 * pixel_x + pixel_y;
 }
@@ -57,7 +58,7 @@ int getDetectorFromPixel(const int &pixel_x, const int &pixel_y,
  * given pixel coordinates [m].
  */
 void getCoordinateFromPixel(const double &pixel_x, const double &pixel_y,
-                            API::MatrixWorkspace_sptr dataWS, double &x,
+                            const API::MatrixWorkspace_sptr &dataWS, double &x,
                             double &y) {
   const int nx_pixels =
       static_cast<int>(readInstrumentParameter("number-of-x-pixels", dataWS));
@@ -78,8 +79,8 @@ void getCoordinateFromPixel(const double &pixel_x, const double &pixel_y,
  *
  */
 void getPixelFromCoordinate(const double &x, const double &y,
-                            API::MatrixWorkspace_sptr dataWS, double &pixel_x,
-                            double &pixel_y) {
+                            const API::MatrixWorkspace_sptr &dataWS,
+                            double &pixel_x, double &pixel_y) {
   const int nx_pixels =
       static_cast<int>(readInstrumentParameter("number-of-x-pixels", dataWS));
   const int ny_pixels =
@@ -94,9 +95,9 @@ void getPixelFromCoordinate(const double &x, const double &y,
  * Returns the default beam center position, or the pixel location
  * of real-space coordinates (0,0).
  */
-void getDefaultBeamCenter(API::MatrixWorkspace_sptr dataWS, double &pixel_x,
-                          double &pixel_y) {
-  getPixelFromCoordinate(0.0, 0.0, dataWS, pixel_x, pixel_y);
+void getDefaultBeamCenter(const API::MatrixWorkspace_sptr &dataWS,
+                          double &pixel_x, double &pixel_y) {
+  getPixelFromCoordinate(0.0, 0.0, std::move(dataWS), pixel_x, pixel_y);
 }
 
 /*
@@ -106,7 +107,7 @@ void getDefaultBeamCenter(API::MatrixWorkspace_sptr dataWS, double &pixel_x,
  * defined in instrument parameters file as "aperture-distances"
  * and sums "Header/sample_aperture_to_flange"
  */
-double getSourceToSampleDistance(API::MatrixWorkspace_sptr dataWS) {
+double getSourceToSampleDistance(const API::MatrixWorkspace_sptr &dataWS) {
 
   double sourceToSampleDistance;
 
diff --git a/Framework/WorkflowAlgorithms/src/IMuonAsymmetryCalculator.cpp b/Framework/WorkflowAlgorithms/src/IMuonAsymmetryCalculator.cpp
index 3dd6530b6e5..369be067158 100644
--- a/Framework/WorkflowAlgorithms/src/IMuonAsymmetryCalculator.cpp
+++ b/Framework/WorkflowAlgorithms/src/IMuonAsymmetryCalculator.cpp
@@ -25,8 +25,8 @@ namespace WorkflowAlgorithms {
  * from summed periods
  */
 IMuonAsymmetryCalculator::IMuonAsymmetryCalculator(
-    const WorkspaceGroup_sptr inputWS, const std::vector<int> summedPeriods,
-    const std::vector<int> subtractedPeriods)
+    const WorkspaceGroup_sptr &inputWS, const std::vector<int> &summedPeriods,
+    const std::vector<int> &subtractedPeriods)
     : m_inputWS(inputWS), m_summedPeriods(summedPeriods),
       m_subtractedPeriods(subtractedPeriods) {}
 
diff --git a/Framework/WorkflowAlgorithms/src/MuonGroupAsymmetryCalculator.cpp b/Framework/WorkflowAlgorithms/src/MuonGroupAsymmetryCalculator.cpp
index a49dd44f833..92a15201ad5 100644
--- a/Framework/WorkflowAlgorithms/src/MuonGroupAsymmetryCalculator.cpp
+++ b/Framework/WorkflowAlgorithms/src/MuonGroupAsymmetryCalculator.cpp
@@ -33,10 +33,10 @@ namespace WorkflowAlgorithms {
  * @param wsName :: the name of the workspace (for normalization table)
  */
 MuonGroupAsymmetryCalculator::MuonGroupAsymmetryCalculator(
-    const Mantid::API::WorkspaceGroup_sptr inputWS,
-    const std::vector<int> summedPeriods,
-    const std::vector<int> subtractedPeriods, const int groupIndex,
-    const double start, const double end, const std::string wsName)
+    const Mantid::API::WorkspaceGroup_sptr &inputWS,
+    const std::vector<int> &summedPeriods,
+    const std::vector<int> &subtractedPeriods, const int groupIndex,
+    const double start, const double end, const std::string &wsName)
     : MuonGroupCalculator(inputWS, summedPeriods, subtractedPeriods,
                           groupIndex) {
   MuonGroupCalculator::setStartEnd(start, end);
diff --git a/Framework/WorkflowAlgorithms/src/MuonGroupCalculator.cpp b/Framework/WorkflowAlgorithms/src/MuonGroupCalculator.cpp
index c17150ef32a..4dc4d1ec996 100644
--- a/Framework/WorkflowAlgorithms/src/MuonGroupCalculator.cpp
+++ b/Framework/WorkflowAlgorithms/src/MuonGroupCalculator.cpp
@@ -19,16 +19,16 @@ namespace WorkflowAlgorithms {
  * @param groupIndex :: [input] Workspace index of the group to analyse
  */
 MuonGroupCalculator::MuonGroupCalculator(
-    const Mantid::API::WorkspaceGroup_sptr inputWS,
-    const std::vector<int> summedPeriods,
-    const std::vector<int> subtractedPeriods, const int groupIndex)
+    const Mantid::API::WorkspaceGroup_sptr &inputWS,
+    const std::vector<int> &summedPeriods,
+    const std::vector<int> &subtractedPeriods, const int groupIndex)
     : IMuonAsymmetryCalculator(inputWS, summedPeriods, subtractedPeriods),
       m_groupIndex(groupIndex) {}
 void MuonGroupCalculator::setStartEnd(const double start, const double end) {
   m_startX = start;
   m_endX = end;
 }
-void MuonGroupCalculator::setWSName(const std::string wsName) {
+void MuonGroupCalculator::setWSName(const std::string &wsName) {
   m_wsName = wsName;
 }
 } // namespace WorkflowAlgorithms
diff --git a/Framework/WorkflowAlgorithms/src/MuonGroupCountsCalculator.cpp b/Framework/WorkflowAlgorithms/src/MuonGroupCountsCalculator.cpp
index dd456574196..0d50f9124dc 100644
--- a/Framework/WorkflowAlgorithms/src/MuonGroupCountsCalculator.cpp
+++ b/Framework/WorkflowAlgorithms/src/MuonGroupCountsCalculator.cpp
@@ -21,9 +21,9 @@ namespace WorkflowAlgorithms {
  * @param groupIndex :: [input] Workspace index of the group to analyse
  */
 MuonGroupCountsCalculator::MuonGroupCountsCalculator(
-    const Mantid::API::WorkspaceGroup_sptr inputWS,
-    const std::vector<int> summedPeriods,
-    const std::vector<int> subtractedPeriods, const int groupIndex)
+    const Mantid::API::WorkspaceGroup_sptr &inputWS,
+    const std::vector<int> &summedPeriods,
+    const std::vector<int> &subtractedPeriods, const int groupIndex)
     : MuonGroupCalculator(inputWS, summedPeriods, subtractedPeriods,
                           groupIndex) {}
 
diff --git a/Framework/WorkflowAlgorithms/src/MuonPairAsymmetryCalculator.cpp b/Framework/WorkflowAlgorithms/src/MuonPairAsymmetryCalculator.cpp
index 41f8868be78..e51b7ca8a64 100644
--- a/Framework/WorkflowAlgorithms/src/MuonPairAsymmetryCalculator.cpp
+++ b/Framework/WorkflowAlgorithms/src/MuonPairAsymmetryCalculator.cpp
@@ -27,9 +27,9 @@ namespace WorkflowAlgorithms {
  * @param alpha :: [input] Alpha (balance) value of the pair
  */
 MuonPairAsymmetryCalculator::MuonPairAsymmetryCalculator(
-    const API::WorkspaceGroup_sptr inputWS,
-    const std::vector<int> summedPeriods,
-    const std::vector<int> subtractedPeriods, const int firstPairIndex,
+    const API::WorkspaceGroup_sptr &inputWS,
+    const std::vector<int> &summedPeriods,
+    const std::vector<int> &subtractedPeriods, const int firstPairIndex,
     const int secondPairIndex, const double alpha)
     : IMuonAsymmetryCalculator(inputWS, summedPeriods, subtractedPeriods),
       m_alpha(alpha), m_firstPairIndex(firstPairIndex),
diff --git a/Framework/WorkflowAlgorithms/src/MuonProcess.cpp b/Framework/WorkflowAlgorithms/src/MuonProcess.cpp
index 1fd924f9262..414e9abca83 100644
--- a/Framework/WorkflowAlgorithms/src/MuonProcess.cpp
+++ b/Framework/WorkflowAlgorithms/src/MuonProcess.cpp
@@ -218,8 +218,9 @@ void MuonProcess::exec() {
  * @param grouping :: Detector grouping table to use
  * @return Grouped workspaces
  */
-WorkspaceGroup_sptr MuonProcess::groupWorkspaces(WorkspaceGroup_sptr wsGroup,
-                                                 TableWorkspace_sptr grouping) {
+WorkspaceGroup_sptr
+MuonProcess::groupWorkspaces(const WorkspaceGroup_sptr &wsGroup,
+                             const TableWorkspace_sptr &grouping) {
   WorkspaceGroup_sptr outWS = boost::make_shared<WorkspaceGroup>();
   for (int i = 0; i < wsGroup->getNumberOfEntries(); i++) {
     auto ws = boost::dynamic_pointer_cast<MatrixWorkspace>(wsGroup->getItem(i));
@@ -242,8 +243,8 @@ WorkspaceGroup_sptr MuonProcess::groupWorkspaces(WorkspaceGroup_sptr wsGroup,
  * @param dt :: Dead time table to use
  * @return Corrected workspace group
  */
-WorkspaceGroup_sptr MuonProcess::applyDTC(WorkspaceGroup_sptr wsGroup,
-                                          TableWorkspace_sptr dt) {
+WorkspaceGroup_sptr MuonProcess::applyDTC(const WorkspaceGroup_sptr &wsGroup,
+                                          const TableWorkspace_sptr &dt) {
   WorkspaceGroup_sptr outWS = boost::make_shared<WorkspaceGroup>();
   for (int i = 0; i < wsGroup->getNumberOfEntries(); i++) {
     auto ws = boost::dynamic_pointer_cast<MatrixWorkspace>(wsGroup->getItem(i));
@@ -273,8 +274,9 @@ WorkspaceGroup_sptr MuonProcess::applyDTC(WorkspaceGroup_sptr wsGroup,
  * offset
  * @return Corrected workspaces
  */
-WorkspaceGroup_sptr MuonProcess::correctWorkspaces(WorkspaceGroup_sptr wsGroup,
-                                                   double loadedTimeZero) {
+WorkspaceGroup_sptr
+MuonProcess::correctWorkspaces(const WorkspaceGroup_sptr &wsGroup,
+                               double loadedTimeZero) {
   WorkspaceGroup_sptr outWS = boost::make_shared<WorkspaceGroup>();
   for (int i = 0; i < wsGroup->getNumberOfEntries(); i++) {
     auto ws = boost::dynamic_pointer_cast<MatrixWorkspace>(wsGroup->getItem(i));
diff --git a/Framework/WorkflowAlgorithms/src/ProcessIndirectFitParameters.cpp b/Framework/WorkflowAlgorithms/src/ProcessIndirectFitParameters.cpp
index 1afb28210ac..8da85b6f7c7 100644
--- a/Framework/WorkflowAlgorithms/src/ProcessIndirectFitParameters.cpp
+++ b/Framework/WorkflowAlgorithms/src/ProcessIndirectFitParameters.cpp
@@ -80,7 +80,7 @@ void extractColumnValues(Column const &column, std::size_t startRow,
 
 template <typename T, typename OutputIterator>
 void extractValuesFromColumns(std::size_t startRow, std::size_t endRow,
-                              std::vector<Column_const_sptr> columns,
+                              const std::vector<Column_const_sptr> &columns,
                               OutputIterator outputIt) {
   for (auto &&column : columns)
     extractColumnValues<T>(*column, startRow, endRow, outputIt);
@@ -104,7 +104,9 @@ std::vector<double> getNumericColumnValuesOrIndices(Column const &column,
   return getIncrementingSequence(0.0, length);
 }
 
-std::string getColumnName(Column_const_sptr column) { return column->name(); }
+std::string getColumnName(const Column_const_sptr &column) {
+  return column->name();
+}
 
 std::vector<std::string>
 extractColumnNames(std::vector<Column_const_sptr> const &columns) {
diff --git a/Framework/WorkflowAlgorithms/src/SANSBeamFinder.cpp b/Framework/WorkflowAlgorithms/src/SANSBeamFinder.cpp
index d79fce45460..7b1eab7f3d3 100644
--- a/Framework/WorkflowAlgorithms/src/SANSBeamFinder.cpp
+++ b/Framework/WorkflowAlgorithms/src/SANSBeamFinder.cpp
@@ -246,8 +246,8 @@ void SANSBeamFinder::exec() {
  * 2016/05/06 : this only works for RectangularDetector
  *
  */
-void SANSBeamFinder::maskEdges(MatrixWorkspace_sptr beamCenterWS, int high,
-                               int low, int left, int right,
+void SANSBeamFinder::maskEdges(const MatrixWorkspace_sptr &beamCenterWS,
+                               int high, int low, int left, int right,
                                const std::string &componentName) {
 
   auto instrument = beamCenterWS->getInstrument();
diff --git a/Framework/WorkflowAlgorithms/src/SetupEQSANSReduction.cpp b/Framework/WorkflowAlgorithms/src/SetupEQSANSReduction.cpp
index 1dbd40376b4..3b364ee50b6 100644
--- a/Framework/WorkflowAlgorithms/src/SetupEQSANSReduction.cpp
+++ b/Framework/WorkflowAlgorithms/src/SetupEQSANSReduction.cpp
@@ -890,7 +890,7 @@ void SetupEQSANSReduction::exec() {
 }
 
 void SetupEQSANSReduction::setupSensitivity(
-    boost::shared_ptr<PropertyManager> reductionManager) {
+    const boost::shared_ptr<PropertyManager> &reductionManager) {
   const std::string reductionManagerName = getProperty("ReductionProperties");
 
   const std::string sensitivityFile = getPropertyValue("SensitivityFile");
@@ -957,7 +957,7 @@ void SetupEQSANSReduction::setupSensitivity(
   }
 }
 void SetupEQSANSReduction::setupTransmission(
-    boost::shared_ptr<PropertyManager> reductionManager) {
+    const boost::shared_ptr<PropertyManager> &reductionManager) {
   const std::string reductionManagerName = getProperty("ReductionProperties");
   // Transmission options
   const bool thetaDependentTrans = getProperty("ThetaDependentTransmission");
@@ -1042,7 +1042,7 @@ void SetupEQSANSReduction::setupTransmission(
 }
 
 void SetupEQSANSReduction::setupBackground(
-    boost::shared_ptr<PropertyManager> reductionManager) {
+    const boost::shared_ptr<PropertyManager> &reductionManager) {
   const std::string reductionManagerName = getProperty("ReductionProperties");
   // Background
   const std::string backgroundFile = getPropertyValue("BackgroundFiles");
diff --git a/Framework/WorkflowAlgorithms/src/SetupHFIRReduction.cpp b/Framework/WorkflowAlgorithms/src/SetupHFIRReduction.cpp
index abff959319d..dfb032453ad 100644
--- a/Framework/WorkflowAlgorithms/src/SetupHFIRReduction.cpp
+++ b/Framework/WorkflowAlgorithms/src/SetupHFIRReduction.cpp
@@ -904,7 +904,7 @@ void SetupHFIRReduction::exec() {
 }
 
 void SetupHFIRReduction::setupSensitivity(
-    boost::shared_ptr<PropertyManager> reductionManager) {
+    const boost::shared_ptr<PropertyManager> &reductionManager) {
   const std::string reductionManagerName = getProperty("ReductionProperties");
 
   const std::string sensitivityFile = getPropertyValue("SensitivityFile");
@@ -994,7 +994,7 @@ void SetupHFIRReduction::setupSensitivity(
 }
 
 void SetupHFIRReduction::setupBackground(
-    boost::shared_ptr<PropertyManager> reductionManager) {
+    const boost::shared_ptr<PropertyManager> &reductionManager) {
   const std::string reductionManagerName = getProperty("ReductionProperties");
   // Background
   const std::string backgroundFile = getPropertyValue("BackgroundFiles");
@@ -1112,7 +1112,7 @@ void SetupHFIRReduction::setupBackground(
 }
 
 void SetupHFIRReduction::setupTransmission(
-    boost::shared_ptr<PropertyManager> reductionManager) {
+    const boost::shared_ptr<PropertyManager> &reductionManager) {
   const std::string reductionManagerName = getProperty("ReductionProperties");
   // Transmission options
   const bool thetaDependentTrans = getProperty("ThetaDependentTransmission");
diff --git a/Framework/WorkflowAlgorithms/src/StepScan.cpp b/Framework/WorkflowAlgorithms/src/StepScan.cpp
index 81b4ab565b8..3efd351eca4 100644
--- a/Framework/WorkflowAlgorithms/src/StepScan.cpp
+++ b/Framework/WorkflowAlgorithms/src/StepScan.cpp
@@ -114,14 +114,14 @@ void StepScan::exec() {
  * pointer.
  */
 DataObjects::EventWorkspace_sptr
-StepScan::getMonitorWorkspace(API::MatrixWorkspace_sptr inputWS) {
+StepScan::getMonitorWorkspace(const API::MatrixWorkspace_sptr &inputWS) {
   // See if there's a monitor workspace inside the input one
   return boost::dynamic_pointer_cast<DataObjects::EventWorkspace>(
       inputWS->monitorWorkspace());
 }
 
 DataObjects::EventWorkspace_sptr
-StepScan::cloneInputWorkspace(API::Workspace_sptr inputWS) {
+StepScan::cloneInputWorkspace(const API::Workspace_sptr &inputWS) {
   IAlgorithm_sptr clone = createChildAlgorithm("CloneWorkspace");
   clone->setProperty("InputWorkspace", inputWS);
   clone->executeAsChildAlg();
@@ -134,8 +134,8 @@ StepScan::cloneInputWorkspace(API::Workspace_sptr inputWS) {
  *  @param inputWS The input workspace
  *  @param maskWS  A masking workspace
  */
-void StepScan::runMaskDetectors(MatrixWorkspace_sptr inputWS,
-                                MatrixWorkspace_sptr maskWS) {
+void StepScan::runMaskDetectors(const MatrixWorkspace_sptr &inputWS,
+                                const MatrixWorkspace_sptr &maskWS) {
   IAlgorithm_sptr maskingAlg = createChildAlgorithm("MaskDetectors");
   maskingAlg->setProperty<MatrixWorkspace_sptr>("Workspace", inputWS);
   maskingAlg->setProperty<MatrixWorkspace_sptr>("MaskedWorkspace", maskWS);
@@ -147,7 +147,7 @@ void StepScan::runMaskDetectors(MatrixWorkspace_sptr inputWS,
  *  @param xmin    The minimum value of the filter
  *  @param xmax    The maximum value of the filter
  */
-void StepScan::runFilterByXValue(MatrixWorkspace_sptr inputWS,
+void StepScan::runFilterByXValue(const MatrixWorkspace_sptr &inputWS,
                                  const double xmin, const double xmax) {
   std::string rangeUnit = getProperty("RangeUnit");
   // Run ConvertUnits on the input workspace if xmin/max were given in a
diff --git a/Framework/WorkflowAlgorithms/test/AlignAndFocusPowderTest.h b/Framework/WorkflowAlgorithms/test/AlignAndFocusPowderTest.h
index 8f737f7403c..f3c3cd481e0 100644
--- a/Framework/WorkflowAlgorithms/test/AlignAndFocusPowderTest.h
+++ b/Framework/WorkflowAlgorithms/test/AlignAndFocusPowderTest.h
@@ -692,7 +692,8 @@ public:
   }
 
   /* Utility functions */
-  void loadDiffCal(std::string calfilename, bool group, bool cal, bool mask) {
+  void loadDiffCal(const std::string &calfilename, bool group, bool cal,
+                   bool mask) {
     LoadDiffCal loadDiffAlg;
     loadDiffAlg.initialize();
     loadDiffAlg.setPropertyValue("Filename", calfilename);
@@ -704,7 +705,7 @@ public:
     loadDiffAlg.execute();
   }
 
-  void groupAllBanks(std::string m_inputWS) {
+  void groupAllBanks(const std::string &m_inputWS) {
     CreateGroupingWorkspace groupAlg;
     groupAlg.initialize();
     groupAlg.setPropertyValue("InputWorkspace", m_inputWS);
@@ -713,7 +714,7 @@ public:
     groupAlg.execute();
   }
 
-  void rebin(std::string params, bool preserveEvents = true) {
+  void rebin(const std::string &params, bool preserveEvents = true) {
     Rebin rebin;
     rebin.initialize();
     rebin.setPropertyValue("InputWorkspace", m_inputWS);
@@ -734,8 +735,9 @@ public:
     resamplexAlg.execute();
   }
 
-  std::string createArgForNumberHistograms(double val, MatrixWorkspace_sptr ws,
-                                           std::string delimiter = ",") {
+  std::string createArgForNumberHistograms(double val,
+                                           const MatrixWorkspace_sptr &ws,
+                                           const std::string &delimiter = ",") {
     std::vector<std::string> vec;
     for (size_t i = 0; i < ws->getNumberHistograms(); i++)
       vec.emplace_back(boost::lexical_cast<std::string>(val));
diff --git a/Framework/WorkflowAlgorithms/test/ExtractQENSMembersTest.h b/Framework/WorkflowAlgorithms/test/ExtractQENSMembersTest.h
index 31adb867821..b3e725f6513 100644
--- a/Framework/WorkflowAlgorithms/test/ExtractQENSMembersTest.h
+++ b/Framework/WorkflowAlgorithms/test/ExtractQENSMembersTest.h
@@ -26,6 +26,7 @@
 #include <algorithm>
 #include <memory>
 #include <random>
+#include <utility>
 
 using Mantid::Algorithms::ExtractQENSMembers;
 
@@ -94,7 +95,7 @@ public:
   }
 
 private:
-  void checkMembersOutput(WorkspaceGroup_sptr membersWorkspace,
+  void checkMembersOutput(const WorkspaceGroup_sptr &membersWorkspace,
                           const std::vector<std::string> &members,
                           const std::string &outputName, size_t numSpectra,
                           const std::vector<double> &dataX) const {
@@ -112,31 +113,32 @@ private:
     }
   }
 
-  WorkspaceGroup_sptr extractMembers(MatrixWorkspace_sptr inputWs,
-                                     WorkspaceGroup_sptr resultGroupWs,
+  WorkspaceGroup_sptr extractMembers(const MatrixWorkspace_sptr &inputWs,
+                                     const WorkspaceGroup_sptr &resultGroupWs,
                                      const std::string &outputWsName) const {
-    auto extractAlgorithm =
-        extractMembersAlgorithm(inputWs, resultGroupWs, outputWsName);
+    auto extractAlgorithm = extractMembersAlgorithm(
+        std::move(inputWs), std::move(resultGroupWs), outputWsName);
     extractAlgorithm->execute();
     return AnalysisDataService::Instance().retrieveWS<WorkspaceGroup>(
         outputWsName);
   }
 
   WorkspaceGroup_sptr
-  extractMembers(MatrixWorkspace_sptr inputWs,
-                 WorkspaceGroup_sptr resultGroupWs,
+  extractMembers(const MatrixWorkspace_sptr &inputWs,
+                 const WorkspaceGroup_sptr &resultGroupWs,
                  const std::vector<std::string> &convolvedMembers,
                  const std::string &outputWsName) const {
-    auto extractAlgorithm = extractMembersAlgorithm(
-        inputWs, resultGroupWs, convolvedMembers, outputWsName);
+    auto extractAlgorithm =
+        extractMembersAlgorithm(std::move(inputWs), std::move(resultGroupWs),
+                                convolvedMembers, outputWsName);
     extractAlgorithm->execute();
     return AnalysisDataService::Instance().retrieveWS<WorkspaceGroup>(
         outputWsName);
   }
 
   IAlgorithm_sptr
-  extractMembersAlgorithm(MatrixWorkspace_sptr inputWs,
-                          WorkspaceGroup_sptr resultGroupWs,
+  extractMembersAlgorithm(const MatrixWorkspace_sptr &inputWs,
+                          const WorkspaceGroup_sptr &resultGroupWs,
                           const std::string &outputWsName) const {
     auto extractMembersAlg =
         AlgorithmManager::Instance().create("ExtractQENSMembers");
@@ -147,8 +149,8 @@ private:
   }
 
   IAlgorithm_sptr
-  extractMembersAlgorithm(MatrixWorkspace_sptr inputWs,
-                          WorkspaceGroup_sptr resultGroupWs,
+  extractMembersAlgorithm(const MatrixWorkspace_sptr &inputWs,
+                          const WorkspaceGroup_sptr &resultGroupWs,
                           const std::vector<std::string> &convolvedMembers,
                           const std::string &outputWsName) const {
     auto extractMembersAlg =
@@ -205,9 +207,11 @@ private:
     return createWorkspace->getProperty("OutputWorkspace");
   }
 
-  MatrixWorkspace_sptr appendSpectra(MatrixWorkspace_sptr workspace,
-                                     MatrixWorkspace_sptr spectraWS) const {
-    auto appendAlgorithm = appendSpectraAlgorithm(workspace, spectraWS);
+  MatrixWorkspace_sptr
+  appendSpectra(const MatrixWorkspace_sptr &workspace,
+                const MatrixWorkspace_sptr &spectraWS) const {
+    auto appendAlgorithm =
+        appendSpectraAlgorithm(std::move(workspace), std::move(spectraWS));
     appendAlgorithm->execute();
     return appendAlgorithm->getProperty("OutputWorkspace");
   }
@@ -257,8 +261,9 @@ private:
     return createWorkspace;
   }
 
-  IAlgorithm_sptr appendSpectraAlgorithm(MatrixWorkspace_sptr workspace,
-                                         MatrixWorkspace_sptr spectraWS) const {
+  IAlgorithm_sptr
+  appendSpectraAlgorithm(const MatrixWorkspace_sptr &workspace,
+                         const MatrixWorkspace_sptr &spectraWS) const {
     auto appendAlgorithm = AlgorithmManager::Instance().create("AppendSpectra");
     appendAlgorithm->setChild(true);
     appendAlgorithm->setProperty("InputWorkspace1", workspace);
diff --git a/MantidPlot/src/ApplicationWindow.cpp b/MantidPlot/src/ApplicationWindow.cpp
index a403111cc38..b5af9c61655 100644
--- a/MantidPlot/src/ApplicationWindow.cpp
+++ b/MantidPlot/src/ApplicationWindow.cpp
@@ -180,6 +180,7 @@
 #include <gsl/gsl_sort.h>
 
 #include <boost/regex.hpp>
+#include <utility>
 
 #include <Poco/Path.h>
 
@@ -3161,7 +3162,7 @@ void ApplicationWindow::initTable(Table *w, const QString &caption) {
  * base
  */
 TableStatistics *ApplicationWindow::newTableStatistics(Table *base, int type,
-                                                       QList<int> target,
+                                                       const QList<int> &target,
                                                        const QString &caption) {
   TableStatistics *s = new TableStatistics(scriptingEnv(), this, base,
                                            (TableStatistics::Type)type, target);
@@ -4231,7 +4232,7 @@ void ApplicationWindow::importASCII(
     const QString &local_column_separator, int local_ignored_lines,
     bool local_rename_columns, bool local_strip_spaces,
     bool local_simplify_spaces, bool local_import_comments,
-    bool update_dec_separators, QLocale local_separators,
+    bool update_dec_separators, const QLocale &local_separators,
     const QString &local_comment_string, bool import_read_only, int endLineChar,
     const QString &sepforloadAscii) {
   if (files.isEmpty())
@@ -6158,7 +6159,7 @@ void ApplicationWindow::loadDataFile() {
   saveSettings(); // save new list of recent files
 }
 
-void ApplicationWindow::loadDataFileByName(QString fn) {
+void ApplicationWindow::loadDataFileByName(const QString &fn) {
   QFileInfo fnInfo(fn);
   AlgorithmInputHistory::Instance().setPreviousDirectory(
       fnInfo.absoluteDir().path());
@@ -13709,7 +13710,7 @@ void ApplicationWindow::updateRecentProjectsList() {
                                   recentProjects[i]);
 }
 
-void ApplicationWindow::updateRecentFilesList(QString fname) {
+void ApplicationWindow::updateRecentFilesList(const QString &fname) {
   if (!fname.isEmpty()) {
     recentFiles.removeAll(fname);
     recentFiles.push_front(fname);
@@ -16791,8 +16792,8 @@ bool ApplicationWindow::isOfType(const QObject *obj,
  * @param sourceFile The full path to the .project file
  * @return True is loading was successful, false otherwise
  */
-bool ApplicationWindow::loadProjectRecovery(std::string sourceFile,
-                                            std::string recoveryFolder) {
+bool ApplicationWindow::loadProjectRecovery(const std::string &sourceFile,
+                                            const std::string &recoveryFolder) {
   // Wait on this thread until scriptWindow is finished (Should be a seperate
   // thread)
   do {
@@ -16801,7 +16802,7 @@ bool ApplicationWindow::loadProjectRecovery(std::string sourceFile,
   const bool isRecovery = true;
   ProjectSerialiser projectWriter(this, isRecovery);
   // File version is not applicable to project recovery - so set to 0
-  const auto loadSuccess = projectWriter.load(sourceFile, 0);
+  const auto loadSuccess = projectWriter.load(std::move(sourceFile), 0);
 
   // Handle the removal of old checkpoints and start project saving again
   Poco::Path deletePath(recoveryFolder);
@@ -16820,7 +16821,7 @@ bool ApplicationWindow::loadProjectRecovery(std::string sourceFile,
  * @param destination:: The full path to write the recovery file to
  * @return True if saving is successful, false otherwise
  */
-bool ApplicationWindow::saveProjectRecovery(std::string destination) {
+bool ApplicationWindow::saveProjectRecovery(const std::string &destination) {
   const bool isRecovery = true;
   ProjectSerialiser projectWriter(this, isRecovery);
   return projectWriter.save(QString::fromStdString(destination));
diff --git a/MantidPlot/src/ApplicationWindow.h b/MantidPlot/src/ApplicationWindow.h
index 0bc349a2f26..df62345d86a 100644
--- a/MantidPlot/src/ApplicationWindow.h
+++ b/MantidPlot/src/ApplicationWindow.h
@@ -233,7 +233,7 @@ public slots:
   /// Load mantid data files using generic load algorithm, opening user dialog
   void loadDataFile();
   /// Load mantid data files (generic load algorithm)
-  void loadDataFileByName(QString fn);
+  void loadDataFileByName(const QString &fn);
   /// Open from the list of recent files
   void openRecentFile(QAction *action);
 
@@ -492,7 +492,7 @@ public slots:
                    int local_ignored_lines, bool local_rename_columns,
                    bool local_strip_spaces, bool local_simplify_spaces,
                    bool local_import_comments, bool update_dec_separators,
-                   QLocale local_separators,
+                   const QLocale &local_separators,
                    const QString &local_comment_string, bool import_read_only,
                    int endLineChar, const QString &sepforloadAscii);
   void exportAllTables(const QString &sep, bool colNames, bool colComments,
@@ -503,7 +503,7 @@ public slots:
   //! recalculate selected cells of current table
   void recalculateTable();
 
-  TableStatistics *newTableStatistics(Table *base, int type, QList<int>,
+  TableStatistics *newTableStatistics(Table *base, int type, const QList<int> &,
                                       const QString &caption = QString::null);
   //@}
 
@@ -916,7 +916,7 @@ public slots:
   void updateRecentProjectsList();
   //! Inserts file name in the list of recent files (if fname not empty) and
   // updates the "recent files" menu
-  void updateRecentFilesList(QString fname = "");
+  void updateRecentFilesList(const QString &fname = "");
   //! Open QtiPlot homepage in external browser
   void showHomePage();
   //! Open bug tracking system at berliOS in external browser
@@ -1123,11 +1123,12 @@ public slots:
 
   bool isOfType(const QObject *obj, const char *toCompare) const;
 
-  bool loadProjectRecovery(std::string sourceFile, std::string recoveryFolder);
+  bool loadProjectRecovery(const std::string &sourceFile,
+                           const std::string &recoveryFolder);
 
   // The string must be copied from the other thread in saveProjectRecovery
   /// Saves the current project as part of recovery auto saving
-  bool saveProjectRecovery(std::string destination);
+  bool saveProjectRecovery(const std::string &destination);
 
   /// Checks for and attempts project recovery if required
   void checkForProjectRecovery();
diff --git a/MantidPlot/src/AssociationsDialog.cpp b/MantidPlot/src/AssociationsDialog.cpp
index c2f5329ef7b..88be52400b0 100644
--- a/MantidPlot/src/AssociationsDialog.cpp
+++ b/MantidPlot/src/AssociationsDialog.cpp
@@ -45,8 +45,9 @@
 #include <QMessageBox>
 #include <QPushButton>
 #include <QTableWidget>
+#include <utility>
 
-AssociationsDialog::AssociationsDialog(Graph *g, Qt::WFlags fl)
+AssociationsDialog::AssociationsDialog(Graph *g, const Qt::WFlags &fl)
     : QDialog(g, fl) {
   setObjectName("AssociationsDialog");
   setWindowTitle(tr("MantidPlot - Plot Associations"));
@@ -192,7 +193,7 @@ QString AssociationsDialog::plotAssociation(const QString &text) {
 }
 
 void AssociationsDialog::initTablesList(QList<MdiSubWindow *> lst, int curve) {
-  tables = lst;
+  tables = std::move(lst);
   active_table = nullptr;
 
   if (curve < 0 || curve >= static_cast<int>(associations->count()))
diff --git a/MantidPlot/src/AssociationsDialog.h b/MantidPlot/src/AssociationsDialog.h
index d247ba76570..502b6f6df42 100644
--- a/MantidPlot/src/AssociationsDialog.h
+++ b/MantidPlot/src/AssociationsDialog.h
@@ -46,7 +46,7 @@ class AssociationsDialog : public QDialog {
   Q_OBJECT
 
 public:
-  AssociationsDialog(Graph *g, Qt::WFlags fl = nullptr);
+  AssociationsDialog(Graph *g, const Qt::WFlags &fl = nullptr);
 
   void initTablesList(QList<MdiSubWindow *> lst, int curve);
 
diff --git a/MantidPlot/src/AxesDialog.cpp b/MantidPlot/src/AxesDialog.cpp
index 8548910e072..912115a736a 100644
--- a/MantidPlot/src/AxesDialog.cpp
+++ b/MantidPlot/src/AxesDialog.cpp
@@ -1496,7 +1496,7 @@ Mantid::Kernel::Logger g_log("AxisDialog");
  *  @param g :: the graph the dialog is settign the options for
  *  @param fl :: The QT flags for this window
  */
-AxesDialog::AxesDialog(ApplicationWindow *app, Graph *g, Qt::WFlags fl)
+AxesDialog::AxesDialog(ApplicationWindow *app, Graph *g, const Qt::WFlags &fl)
     : QDialog(g, fl), m_app(app), m_graph(g) {
   QPixmap image4((const char **)image4_data);
   QPixmap image5((const char **)image5_data);
diff --git a/MantidPlot/src/AxesDialog.h b/MantidPlot/src/AxesDialog.h
index 2c22a6e3db8..5396b1fcdf6 100644
--- a/MantidPlot/src/AxesDialog.h
+++ b/MantidPlot/src/AxesDialog.h
@@ -71,7 +71,7 @@ class AxesDialog : public QDialog {
   Q_OBJECT
 
 public:
-  AxesDialog(ApplicationWindow *app, Graph *g, Qt::WFlags fl = nullptr);
+  AxesDialog(ApplicationWindow *app, Graph *g, const Qt::WFlags &fl = nullptr);
   ~AxesDialog() override;
 
 public slots:
diff --git a/MantidPlot/src/BoxCurve.h b/MantidPlot/src/BoxCurve.h
index 55f8019398d..edc1839f79e 100644
--- a/MantidPlot/src/BoxCurve.h
+++ b/MantidPlot/src/BoxCurve.h
@@ -33,6 +33,8 @@
 #include <qwt_plot.h>
 #include <qwt_symbol.h>
 
+#include <utility>
+
 //! Box curve
 class BoxCurve : public DataCurve {
 public:
@@ -97,7 +99,7 @@ private:
 class QwtSingleArrayData : public QwtData {
 public:
   QwtSingleArrayData(const double x, QwtArray<double> y, size_t) {
-    d_y = y;
+    d_y = std::move(y);
     d_x = x;
   };
 
diff --git a/MantidPlot/src/ColorMapDialog.cpp b/MantidPlot/src/ColorMapDialog.cpp
index ec3bd737efd..e161f8a3505 100644
--- a/MantidPlot/src/ColorMapDialog.cpp
+++ b/MantidPlot/src/ColorMapDialog.cpp
@@ -33,7 +33,7 @@
 #include <QLayout>
 #include <QPushButton>
 
-ColorMapDialog::ColorMapDialog(QWidget *parent, Qt::WFlags fl)
+ColorMapDialog::ColorMapDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl), applyBtn(nullptr), closeBtn(nullptr),
       editor(nullptr), d_matrix(nullptr) {
   setObjectName("ColorMapDialog");
diff --git a/MantidPlot/src/ColorMapDialog.h b/MantidPlot/src/ColorMapDialog.h
index 916b1a9d156..27811a06fef 100644
--- a/MantidPlot/src/ColorMapDialog.h
+++ b/MantidPlot/src/ColorMapDialog.h
@@ -37,7 +37,7 @@ class ColorMapDialog : public QDialog {
   Q_OBJECT
 
 public:
-  ColorMapDialog(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  ColorMapDialog(QWidget *parent = nullptr, const Qt::WFlags &fl = nullptr);
   void setMatrix(Matrix *m);
 
 protected slots:
diff --git a/MantidPlot/src/ConfigDialog.cpp b/MantidPlot/src/ConfigDialog.cpp
index 92fd15419a6..5e6fb1596b8 100644
--- a/MantidPlot/src/ConfigDialog.cpp
+++ b/MantidPlot/src/ConfigDialog.cpp
@@ -1541,7 +1541,7 @@ void ConfigDialog::correctTreePatrialTicks(QTreeWidgetItem &topLevelCat) {
 }
 
 QTreeWidgetItem *
-ConfigDialog::createCheckedTreeItem(QString name,
+ConfigDialog::createCheckedTreeItem(const QString &name,
                                     Qt::CheckState checkBoxState) {
   QTreeWidgetItem *item = new QTreeWidgetItem(QStringList(name));
   item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
diff --git a/MantidPlot/src/ConfigDialog.h b/MantidPlot/src/ConfigDialog.h
index 669c79f9e91..e68e6907f65 100644
--- a/MantidPlot/src/ConfigDialog.h
+++ b/MantidPlot/src/ConfigDialog.h
@@ -178,7 +178,7 @@ private:
   void updateMdPlottingSettings();
   void setupMdPlottingConnections();
 
-  QTreeWidgetItem *createCheckedTreeItem(QString name,
+  QTreeWidgetItem *createCheckedTreeItem(const QString &name,
                                          Qt::CheckState checkBoxState);
   QStringList buildHiddenCategoryString(QTreeWidgetItem *parent = nullptr);
 
diff --git a/MantidPlot/src/CurveRangeDialog.cpp b/MantidPlot/src/CurveRangeDialog.cpp
index 6af557138fa..0f2159bdb3b 100644
--- a/MantidPlot/src/CurveRangeDialog.cpp
+++ b/MantidPlot/src/CurveRangeDialog.cpp
@@ -27,7 +27,7 @@
 #include <QPushButton>
 #include <QSpinBox>
 
-CurveRangeDialog::CurveRangeDialog(QWidget *parent, Qt::WFlags fl)
+CurveRangeDialog::CurveRangeDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl), d_curve(nullptr), d_graph(nullptr) {
   setWindowTitle(tr("MantidPlot - Plot range"));
   setObjectName("CurveRangeDialog");
diff --git a/MantidPlot/src/CurveRangeDialog.h b/MantidPlot/src/CurveRangeDialog.h
index 1f36476e890..28749672cab 100644
--- a/MantidPlot/src/CurveRangeDialog.h
+++ b/MantidPlot/src/CurveRangeDialog.h
@@ -30,7 +30,7 @@ class CurveRangeDialog : public QDialog {
   Q_OBJECT
 
 public:
-  CurveRangeDialog(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  CurveRangeDialog(QWidget *parent = nullptr, const Qt::WFlags &fl = nullptr);
 
 public slots:
   void setCurveToModify(Graph *g, int curve);
diff --git a/MantidPlot/src/CurvesDialog.cpp b/MantidPlot/src/CurvesDialog.cpp
index 9c4b51f0fc4..0539402541b 100644
--- a/MantidPlot/src/CurvesDialog.cpp
+++ b/MantidPlot/src/CurvesDialog.cpp
@@ -56,7 +56,8 @@
 
 using namespace MantidQt::API;
 
-CurvesDialog::CurvesDialog(ApplicationWindow *app, Graph *g, Qt::WFlags fl)
+CurvesDialog::CurvesDialog(ApplicationWindow *app, Graph *g,
+                           const Qt::WFlags &fl)
     : QDialog(g, fl), d_app(app), d_graph(g) {
   if (!app) {
     throw std::logic_error(
diff --git a/MantidPlot/src/CurvesDialog.h b/MantidPlot/src/CurvesDialog.h
index 90fb0c8a74e..9d113a1a1dc 100644
--- a/MantidPlot/src/CurvesDialog.h
+++ b/MantidPlot/src/CurvesDialog.h
@@ -45,7 +45,8 @@ class CurvesDialog : public QDialog {
   Q_OBJECT
 
 public:
-  CurvesDialog(ApplicationWindow *app, Graph *g, Qt::WFlags fl = nullptr);
+  CurvesDialog(ApplicationWindow *app, Graph *g,
+               const Qt::WFlags &fl = nullptr);
   ~CurvesDialog() override;
 
 private slots:
diff --git a/MantidPlot/src/CustomActionDialog.cpp b/MantidPlot/src/CustomActionDialog.cpp
index 1f6a1206e07..51b62e93ba6 100644
--- a/MantidPlot/src/CustomActionDialog.cpp
+++ b/MantidPlot/src/CustomActionDialog.cpp
@@ -36,7 +36,7 @@
 #include <QShortcut>
 #include <QToolBar>
 
-CustomActionDialog::CustomActionDialog(QWidget *parent, Qt::WFlags fl)
+CustomActionDialog::CustomActionDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl) {
   setWindowTitle(tr("MantidPlot") + " - " + tr("Add Custom Action"));
 
diff --git a/MantidPlot/src/CustomActionDialog.h b/MantidPlot/src/CustomActionDialog.h
index 2cf37166bce..bc7d4c3aa4a 100644
--- a/MantidPlot/src/CustomActionDialog.h
+++ b/MantidPlot/src/CustomActionDialog.h
@@ -38,7 +38,7 @@ public:
    * @param parent :: parent widget (must be the application window!=
    * @param fl :: window flags
    */
-  CustomActionDialog(QWidget *parent, Qt::WFlags fl = nullptr);
+  CustomActionDialog(QWidget *parent, const Qt::WFlags &fl = nullptr);
 
 private slots:
   void chooseIcon();
diff --git a/MantidPlot/src/DataSetDialog.cpp b/MantidPlot/src/DataSetDialog.cpp
index 4a498d9a3b9..b488801c6be 100644
--- a/MantidPlot/src/DataSetDialog.cpp
+++ b/MantidPlot/src/DataSetDialog.cpp
@@ -40,7 +40,7 @@
 #include <QVBoxLayout>
 
 DataSetDialog::DataSetDialog(const QString &text, ApplicationWindow *app,
-                             Graph *g, Qt::WFlags fl)
+                             Graph *g, const Qt::WFlags &fl)
     : QDialog(g, fl), d_app(app), d_graph(g) {
   setAttribute(Qt::WA_DeleteOnClose);
   setWindowTitle(tr("MantidPlot - Select data set"));
diff --git a/MantidPlot/src/DataSetDialog.h b/MantidPlot/src/DataSetDialog.h
index dc60ab2abdf..ebb4b7657ec 100644
--- a/MantidPlot/src/DataSetDialog.h
+++ b/MantidPlot/src/DataSetDialog.h
@@ -45,7 +45,7 @@ class DataSetDialog : public QDialog {
 
 public:
   DataSetDialog(const QString &text, ApplicationWindow *app, Graph *g = nullptr,
-                Qt::WFlags fl = nullptr);
+                const Qt::WFlags &fl = nullptr);
 
 public slots:
   void accept() override;
diff --git a/MantidPlot/src/ErrDialog.cpp b/MantidPlot/src/ErrDialog.cpp
index addd11bef98..47597ad6dba 100644
--- a/MantidPlot/src/ErrDialog.cpp
+++ b/MantidPlot/src/ErrDialog.cpp
@@ -45,7 +45,7 @@
 #include <QVBoxLayout>
 #include <QWidget>
 
-ErrDialog::ErrDialog(ApplicationWindow *parent, Qt::WFlags fl)
+ErrDialog::ErrDialog(ApplicationWindow *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl) {
   setFocusPolicy(Qt::StrongFocus);
   setSizeGripEnabled(true);
@@ -166,7 +166,7 @@ void ErrDialog::setCurveNames(const QStringList &names) {
   nameLabel->addItems(names);
 }
 
-void ErrDialog::setSrcTables(QList<MdiSubWindow *> tables) {
+void ErrDialog::setSrcTables(const QList<MdiSubWindow *> &tables) {
   if (tables.isEmpty())
     return;
 
diff --git a/MantidPlot/src/ErrDialog.h b/MantidPlot/src/ErrDialog.h
index 84287351570..83ac907e708 100644
--- a/MantidPlot/src/ErrDialog.h
+++ b/MantidPlot/src/ErrDialog.h
@@ -52,7 +52,7 @@ public:
    * @param parent :: parent widget
    * @param fl :: window flags
    */
-  ErrDialog(ApplicationWindow *parent, Qt::WFlags fl = nullptr);
+  ErrDialog(ApplicationWindow *parent, const Qt::WFlags &fl = nullptr);
 
 private:
   QLabel *textLabel1;
@@ -82,7 +82,7 @@ public slots:
   //! Supply the dialog with a curves list
   void setCurveNames(const QStringList &names);
   //! Supply the dialog with a tables list
-  void setSrcTables(QList<MdiSubWindow *> tables);
+  void setSrcTables(const QList<MdiSubWindow *> &tables);
   //! Select a table
   void selectSrcTable(int tabnr);
 
diff --git a/MantidPlot/src/ExpDecayDialog.cpp b/MantidPlot/src/ExpDecayDialog.cpp
index d39b38573f4..e13b229a77d 100644
--- a/MantidPlot/src/ExpDecayDialog.cpp
+++ b/MantidPlot/src/ExpDecayDialog.cpp
@@ -43,7 +43,7 @@
 #include <QMessageBox>
 #include <QPushButton>
 
-ExpDecayDialog::ExpDecayDialog(int type, QWidget *parent, Qt::WFlags fl)
+ExpDecayDialog::ExpDecayDialog(int type, QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl), fitter(nullptr), graph(nullptr), buttonFit(nullptr),
       buttonCancel(nullptr), boxName(nullptr), boxAmplitude(nullptr),
       boxFirst(nullptr), boxSecond(nullptr), boxThird(nullptr),
diff --git a/MantidPlot/src/ExpDecayDialog.h b/MantidPlot/src/ExpDecayDialog.h
index 8c3b04102ae..217f8c9d991 100644
--- a/MantidPlot/src/ExpDecayDialog.h
+++ b/MantidPlot/src/ExpDecayDialog.h
@@ -44,7 +44,8 @@ class ExpDecayDialog : public QDialog {
   Q_OBJECT
 
 public:
-  ExpDecayDialog(int type, QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  ExpDecayDialog(int type, QWidget *parent = nullptr,
+                 const Qt::WFlags &fl = nullptr);
 
 public slots:
   void fit();
diff --git a/MantidPlot/src/ExportDialog.cpp b/MantidPlot/src/ExportDialog.cpp
index 514ac1e30d7..9ed732b7409 100644
--- a/MantidPlot/src/ExportDialog.cpp
+++ b/MantidPlot/src/ExportDialog.cpp
@@ -39,7 +39,7 @@
 #include <QPushButton>
 
 ExportDialog::ExportDialog(const QString &tableName, QWidget *parent,
-                           Qt::WFlags fl)
+                           const Qt::WFlags &fl)
     : QDialog(parent, fl) {
   setWindowTitle(tr("MantidPlot - Export ASCII"));
   setSizeGripEnabled(true);
diff --git a/MantidPlot/src/ExportDialog.h b/MantidPlot/src/ExportDialog.h
index 2d135b20e0d..bd5f0a65f97 100644
--- a/MantidPlot/src/ExportDialog.h
+++ b/MantidPlot/src/ExportDialog.h
@@ -47,7 +47,7 @@ public:
    * @param fl :: window flags
    */
   ExportDialog(const QString &tableName, QWidget *parent = nullptr,
-               Qt::WFlags fl = nullptr);
+               const Qt::WFlags &fl = nullptr);
 
 private:
   void closeEvent(QCloseEvent *) override;
diff --git a/MantidPlot/src/FFTDialog.cpp b/MantidPlot/src/FFTDialog.cpp
index 6b529eed2df..3f0be090532 100644
--- a/MantidPlot/src/FFTDialog.cpp
+++ b/MantidPlot/src/FFTDialog.cpp
@@ -49,7 +49,7 @@
 #include <QPushButton>
 #include <QRadioButton>
 
-FFTDialog::FFTDialog(int type, QWidget *parent, Qt::WFlags fl)
+FFTDialog::FFTDialog(int type, QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl), buttonOK(nullptr), buttonCancel(nullptr),
       forwardBtn(nullptr), backwardBtn(nullptr), boxName(nullptr),
       boxReal(nullptr), boxImaginary(nullptr), boxSampling(nullptr),
diff --git a/MantidPlot/src/FFTDialog.h b/MantidPlot/src/FFTDialog.h
index 9e92aaa6980..4e4ddb1d828 100644
--- a/MantidPlot/src/FFTDialog.h
+++ b/MantidPlot/src/FFTDialog.h
@@ -47,7 +47,8 @@ class FFTDialog : public QDialog {
 public:
   enum DataType { onGraph = 0, onTable = 1, onMatrix = 2 };
 
-  FFTDialog(int type, QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  FFTDialog(int type, QWidget *parent = nullptr,
+            const Qt::WFlags &fl = nullptr);
 
 public slots:
   void setGraph(Graph *g);
diff --git a/MantidPlot/src/FilterDialog.cpp b/MantidPlot/src/FilterDialog.cpp
index 43dfe6aba9a..b078fb7dad0 100644
--- a/MantidPlot/src/FilterDialog.cpp
+++ b/MantidPlot/src/FilterDialog.cpp
@@ -42,7 +42,7 @@
 #include <QMessageBox>
 #include <QPushButton>
 
-FilterDialog::FilterDialog(int type, QWidget *parent, Qt::WFlags fl)
+FilterDialog::FilterDialog(int type, QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl), graph(nullptr), buttonFilter(nullptr),
       buttonCancel(nullptr), boxName(nullptr), boxOffset(nullptr),
       boxStart(nullptr), boxEnd(nullptr), boxColor(nullptr) {
diff --git a/MantidPlot/src/FilterDialog.h b/MantidPlot/src/FilterDialog.h
index da87c900489..c361fe97851 100644
--- a/MantidPlot/src/FilterDialog.h
+++ b/MantidPlot/src/FilterDialog.h
@@ -43,7 +43,8 @@ class FilterDialog : public QDialog {
   Q_OBJECT
 
 public:
-  FilterDialog(int type, QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  FilterDialog(int type, QWidget *parent = nullptr,
+               const Qt::WFlags &fl = nullptr);
 
 public slots:
   void setGraph(Graph *g);
diff --git a/MantidPlot/src/FindDialog.cpp b/MantidPlot/src/FindDialog.cpp
index e1ff277bd3b..9fddeefb9b5 100644
--- a/MantidPlot/src/FindDialog.cpp
+++ b/MantidPlot/src/FindDialog.cpp
@@ -41,7 +41,8 @@
 #include <QRegExp>
 #include <QVBoxLayout>
 
-FindDialog::FindDialog(QWidget *parent, Qt::WFlags fl) : QDialog(parent, fl) {
+FindDialog::FindDialog(QWidget *parent, const Qt::WFlags &fl)
+    : QDialog(parent, fl) {
   setWindowTitle(tr("MantidPlot") + " - " + tr("Find"));
   setSizeGripEnabled(true);
 
diff --git a/MantidPlot/src/FindDialog.h b/MantidPlot/src/FindDialog.h
index 53a86644a51..3b74832f7a1 100644
--- a/MantidPlot/src/FindDialog.h
+++ b/MantidPlot/src/FindDialog.h
@@ -42,7 +42,7 @@ class FindDialog : public QDialog {
   Q_OBJECT
 
 public:
-  FindDialog(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  FindDialog(QWidget *parent = nullptr, const Qt::WFlags &fl = nullptr);
   ~FindDialog() override;
 
 private:
diff --git a/MantidPlot/src/FitDialog.cpp b/MantidPlot/src/FitDialog.cpp
index 7bba4f70f2c..7524d652aed 100644
--- a/MantidPlot/src/FitDialog.cpp
+++ b/MantidPlot/src/FitDialog.cpp
@@ -56,7 +56,7 @@
 
 using namespace MantidQt::API;
 
-FitDialog::FitDialog(Graph *g, QWidget *parent, Qt::WFlags fl)
+FitDialog::FitDialog(Graph *g, QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl) {
   setObjectName("FitDialog");
   setWindowTitle(tr("MantidPlot - Fit Wizard"));
@@ -1215,7 +1215,7 @@ void FitDialog::changeDataRange() {
   boxTo->setValue(qMax(start, end));
 }
 
-void FitDialog::setSrcTables(QList<MdiSubWindow *> tables) {
+void FitDialog::setSrcTables(const QList<MdiSubWindow *> &tables) {
   if (tables.isEmpty()) {
     tableNamesBox->addItem(tr("No data tables"));
     colNamesBox->addItem(tr("No data tables"));
diff --git a/MantidPlot/src/FitDialog.h b/MantidPlot/src/FitDialog.h
index 5e8d0e4219b..664ee1aac00 100644
--- a/MantidPlot/src/FitDialog.h
+++ b/MantidPlot/src/FitDialog.h
@@ -44,9 +44,10 @@ class FitDialog : public QDialog {
   Q_OBJECT
 
 public:
-  FitDialog(Graph *g, QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  FitDialog(Graph *g, QWidget *parent = nullptr,
+            const Qt::WFlags &fl = nullptr);
 
-  void setSrcTables(QList<MdiSubWindow *> tables);
+  void setSrcTables(const QList<MdiSubWindow *> &tables);
 
 protected:
   void closeEvent(QCloseEvent *e) override;
diff --git a/MantidPlot/src/FloatingWindow.cpp b/MantidPlot/src/FloatingWindow.cpp
index b25f7632c4a..5a21ef17e6a 100644
--- a/MantidPlot/src/FloatingWindow.cpp
+++ b/MantidPlot/src/FloatingWindow.cpp
@@ -24,7 +24,8 @@
 /**
  * Constructor.
  */
-FloatingWindow::FloatingWindow(ApplicationWindow *appWindow, Qt::WindowFlags f)
+FloatingWindow::FloatingWindow(ApplicationWindow *appWindow,
+                               const Qt::WindowFlags &f)
     :
 #ifdef Q_OS_WIN
       QMainWindow(appWindow, f),
diff --git a/MantidPlot/src/FloatingWindow.h b/MantidPlot/src/FloatingWindow.h
index 91626dcc479..29bd0079555 100644
--- a/MantidPlot/src/FloatingWindow.h
+++ b/MantidPlot/src/FloatingWindow.h
@@ -19,7 +19,8 @@ class QSize;
 class FloatingWindow : public QMainWindow {
   Q_OBJECT
 public:
-  FloatingWindow(ApplicationWindow *appWindow, Qt::WindowFlags f = nullptr);
+  FloatingWindow(ApplicationWindow *appWindow,
+                 const Qt::WindowFlags &f = nullptr);
   ~FloatingWindow() override;
   void setStaysOnTopFlag();
   void removeStaysOnTopFlag();
diff --git a/MantidPlot/src/FunctionCurve.cpp b/MantidPlot/src/FunctionCurve.cpp
index 0d658b286bf..6ee0f4231f9 100644
--- a/MantidPlot/src/FunctionCurve.cpp
+++ b/MantidPlot/src/FunctionCurve.cpp
@@ -243,8 +243,9 @@ void FunctionCurve::loadData(int points) {
  * @param wi :: An index of a histogram with the data.
  * @param peakRadius :: A peak radius to pass to the domain.
  */
-void FunctionCurve::loadMantidData(Mantid::API::MatrixWorkspace_const_sptr ws,
-                                   size_t wi, int peakRadius) {
+void FunctionCurve::loadMantidData(
+    const Mantid::API::MatrixWorkspace_const_sptr &ws, size_t wi,
+    int peakRadius) {
   if (!d_variable.isEmpty() || d_formulas.isEmpty() ||
       d_formulas[0] != "Mantid")
     return;
diff --git a/MantidPlot/src/FunctionCurve.h b/MantidPlot/src/FunctionCurve.h
index 6e4bb863f8f..d92cfdfb8e1 100644
--- a/MantidPlot/src/FunctionCurve.h
+++ b/MantidPlot/src/FunctionCurve.h
@@ -84,8 +84,9 @@ public:
 
   void loadData(int points = 0);
 
-  void loadMantidData(boost::shared_ptr<const Mantid::API::MatrixWorkspace> ws,
-                      size_t wi, int peakRadius = 0);
+  void loadMantidData(
+      const boost::shared_ptr<const Mantid::API::MatrixWorkspace> &ws,
+      size_t wi, int peakRadius = 0);
 
   /// No error bars on this curve: Always return an empty list.
   QList<ErrorBarSettings *> errorBarSettingsList() const override {
diff --git a/MantidPlot/src/FunctionDialog.cpp b/MantidPlot/src/FunctionDialog.cpp
index c21971bc176..b40241efae5 100644
--- a/MantidPlot/src/FunctionDialog.cpp
+++ b/MantidPlot/src/FunctionDialog.cpp
@@ -44,7 +44,8 @@
 #include <QTextEdit>
 #include <QWidget>
 
-FunctionDialog::FunctionDialog(ApplicationWindow *app, Graph *g, Qt::WFlags fl)
+FunctionDialog::FunctionDialog(ApplicationWindow *app, Graph *g,
+                               const Qt::WFlags &fl)
     : QDialog(g, fl), d_app(app), graph(g) {
   setObjectName("FunctionDialog");
   setWindowTitle(tr("MantidPlot - Add function curve"));
diff --git a/MantidPlot/src/FunctionDialog.h b/MantidPlot/src/FunctionDialog.h
index 69389b2ff24..f7a42019654 100644
--- a/MantidPlot/src/FunctionDialog.h
+++ b/MantidPlot/src/FunctionDialog.h
@@ -47,7 +47,7 @@ class FunctionDialog : public QDialog {
 
 public:
   FunctionDialog(ApplicationWindow *app, Graph *g = nullptr,
-                 Qt::WFlags fl = nullptr);
+                 const Qt::WFlags &fl = nullptr);
 
 protected:
   QComboBox *boxXFunction;
diff --git a/MantidPlot/src/Graph.cpp b/MantidPlot/src/Graph.cpp
index 632d8d90f56..07c10ddf1f8 100644
--- a/MantidPlot/src/Graph.cpp
+++ b/MantidPlot/src/Graph.cpp
@@ -126,7 +126,8 @@ namespace {
 Mantid::Kernel::Logger g_log("Graph");
 } // namespace
 
-Graph::Graph(int x, int y, int width, int height, QWidget *parent, Qt::WFlags f)
+Graph::Graph(int x, int y, int width, int height, QWidget *parent,
+             const Qt::WFlags &f)
     : QWidget(parent, f) {
   setWindowFlags(f);
   n_curves = 0;
@@ -1183,7 +1184,7 @@ void Graph::setScale(QwtPlot::Axis axis, ScaleTransformation::Type scaleType) {
  *  @param axis :: the scale to change either QwtPlot::xBottom or QwtPlot::yLeft
  *  @param logOrLin :: either "log" or "linear"
  */
-void Graph::setScale(QwtPlot::Axis axis, QString logOrLin) {
+void Graph::setScale(QwtPlot::Axis axis, const QString &logOrLin) {
   if (logOrLin == "log") {
     setScale(axis, ScaleTransformation::Log10);
   } else if (logOrLin == "linear") {
@@ -2842,7 +2843,7 @@ PlotCurve *Graph::insertCurve(Table *w, const QString &xColName,
   return c;
 }
 
-PlotCurve *Graph::insertCurve(QString workspaceName, int index, bool err,
+PlotCurve *Graph::insertCurve(const QString &workspaceName, int index, bool err,
                               GraphOptions::CurveType style,
                               bool distribution) {
   return (new MantidMatrixCurve(workspaceName, this, index,
@@ -4954,7 +4955,7 @@ void Graph::setCurveLineColor(int curveIndex, int colorIndex) {
   }
 }
 
-void Graph::setCurveLineColor(int curveIndex, QColor qColor) {
+void Graph::setCurveLineColor(int curveIndex, const QColor &qColor) {
   QwtPlotCurve *c = curve(curveIndex);
   if (c) {
     QPen pen = c->pen();
diff --git a/MantidPlot/src/Graph.h b/MantidPlot/src/Graph.h
index 30d7f397b38..075294f3189 100644
--- a/MantidPlot/src/Graph.h
+++ b/MantidPlot/src/Graph.h
@@ -158,7 +158,7 @@ class Graph : public QWidget {
 
 public:
   Graph(int x = 0, int y = 0, int width = 500, int height = 400,
-        QWidget *parent = nullptr, Qt::WFlags f = nullptr);
+        QWidget *parent = nullptr, const Qt::WFlags &f = nullptr);
   ~Graph() override;
 
   enum Ticks { NoTicks = 0, Out = 1, InOut = 2, In = 3 };
@@ -265,7 +265,7 @@ public slots:
                          const QString &yColName, int style, int startRow = 0,
                          int endRow = -1);
   PlotCurve *
-  insertCurve(QString workspaceName, int index, bool err = false,
+  insertCurve(const QString &workspaceName, int index, bool err = false,
               GraphOptions::CurveType style = GraphOptions::Unspecified,
               bool distribution = false);
   PlotCurve *insertCurve(PlotCurve *c, int lineWidth = -1,
@@ -338,7 +338,7 @@ public slots:
   void setCurveStyle(int index, int s);
   void setCurveFullRange(int curveIndex);
   void setCurveLineColor(int curveIndex, int colorIndex);
-  void setCurveLineColor(int curveIndex, QColor qColor);
+  void setCurveLineColor(int curveIndex, const QColor &qColor);
   void setCurveLineStyle(int curveIndex, Qt::PenStyle style);
   void setCurveLineWidth(int curveIndex, double width);
   void setGrayScale();
@@ -417,7 +417,7 @@ public slots:
                 bool log10AfterBreak = false, int breakWidth = 4,
                 bool breakDecoration = true, double nth_power = 2.0);
   void setScale(QwtPlot::Axis axis, ScaleTransformation::Type scaleType);
-  void setScale(QwtPlot::Axis axis, QString logOrLin);
+  void setScale(QwtPlot::Axis axis, const QString &logOrLin);
   double axisStep(int axis) { return d_user_step[axis]; };
   //! Set the axis scale
   void setAxisScale(int axis, double start, double end, int scaleType = -1,
diff --git a/MantidPlot/src/Graph3D.cpp b/MantidPlot/src/Graph3D.cpp
index 69b40302340..1521f5326e8 100644
--- a/MantidPlot/src/Graph3D.cpp
+++ b/MantidPlot/src/Graph3D.cpp
@@ -107,7 +107,7 @@ Triple UserParametricSurface::operator()(double u, double v) {
 }
 
 Graph3D::Graph3D(const QString &label, QWidget *parent, const char *name,
-                 Qt::WFlags f)
+                 const Qt::WFlags &f)
     : MdiSubWindow(parent, label, name, f) {
   initPlot();
 }
@@ -2346,7 +2346,7 @@ void Graph3D::setDataColorMap(const QString &fileName) {
   sp->updateGL();
 }
 
-bool Graph3D::openColorMap(ColorVector &cv, QString fname) {
+bool Graph3D::openColorMap(ColorVector &cv, const QString &fname) {
   if (fname.isEmpty())
     return false;
 
diff --git a/MantidPlot/src/Graph3D.h b/MantidPlot/src/Graph3D.h
index d101f7106ce..f326a107fac 100644
--- a/MantidPlot/src/Graph3D.h
+++ b/MantidPlot/src/Graph3D.h
@@ -55,7 +55,7 @@ class Graph3D : public MdiSubWindow {
 
 public:
   Graph3D(const QString &label, QWidget *parent, const char *name = nullptr,
-          Qt::WFlags f = nullptr);
+          const Qt::WFlags &f = nullptr);
   ~Graph3D() override;
 
   void initPlot();
@@ -317,7 +317,7 @@ public slots:
 
   QString colorMap() { return color_map; };
   void setDataColorMap(const QString &fileName);
-  bool openColorMap(Qwt3D::ColorVector &cv, QString fname);
+  bool openColorMap(Qwt3D::ColorVector &cv, const QString &fname);
 
   void setMeshColor(const QColor &);
   void setAxesColor(const QColor &);
diff --git a/MantidPlot/src/ImageDialog.cpp b/MantidPlot/src/ImageDialog.cpp
index 0b46d115879..437b6dd5ab5 100644
--- a/MantidPlot/src/ImageDialog.cpp
+++ b/MantidPlot/src/ImageDialog.cpp
@@ -21,7 +21,7 @@
 #include <QLabel>
 #include <QLayout>
 
-ImageDialog::ImageDialog(QWidget *parent, Qt::WFlags fl)
+ImageDialog::ImageDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl), aspect_ratio(1.) {
   setObjectName("ImageDialog");
   setWindowTitle(tr("MantidPlot - Image Geometry"));
diff --git a/MantidPlot/src/ImageDialog.h b/MantidPlot/src/ImageDialog.h
index a5936852a96..db5ccc0dcd2 100644
--- a/MantidPlot/src/ImageDialog.h
+++ b/MantidPlot/src/ImageDialog.h
@@ -39,7 +39,7 @@ class ImageDialog : public QDialog {
   Q_OBJECT
 
 public:
-  ImageDialog(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  ImageDialog(QWidget *parent = nullptr, const Qt::WFlags &fl = nullptr);
 
   void setOrigin(const QPoint &o);
   void setSize(const QSize &size);
diff --git a/MantidPlot/src/ImageExportDialog.cpp b/MantidPlot/src/ImageExportDialog.cpp
index 9d0b967b9f3..dad44dcbdaa 100644
--- a/MantidPlot/src/ImageExportDialog.cpp
+++ b/MantidPlot/src/ImageExportDialog.cpp
@@ -42,7 +42,7 @@
 #include <QStackedWidget>
 
 ImageExportDialog::ImageExportDialog(QWidget *parent, bool vector_options,
-                                     bool extended, Qt::WFlags flags)
+                                     bool extended, const Qt::WFlags &flags)
     : ExtensibleFileDialog(parent, extended, flags) {
   setWindowTitle(tr("MantidPlot - Choose a filename to save under"));
   setAcceptMode(QFileDialog::AcceptSave);
diff --git a/MantidPlot/src/ImageExportDialog.h b/MantidPlot/src/ImageExportDialog.h
index 20a4f0118ec..8c23e08525b 100644
--- a/MantidPlot/src/ImageExportDialog.h
+++ b/MantidPlot/src/ImageExportDialog.h
@@ -75,8 +75,8 @@ public:
    */
   ImageExportDialog(QWidget *parent = nullptr, bool vector_options = true,
                     bool extended = true,
-                    Qt::WFlags flags = Qt::WindowCloseButtonHint |
-                                       Qt::WindowType::WindowTitleHint);
+                    const Qt::WFlags &flags = Qt::WindowCloseButtonHint |
+                                              Qt::WindowType::WindowTitleHint);
   //! For vector formats: returns the output resolution the user selected,
   // defaulting to the screen resolution.
   int resolution() const { return d_resolution->value(); }
diff --git a/MantidPlot/src/ImportASCIIDialog.cpp b/MantidPlot/src/ImportASCIIDialog.cpp
index bd87d3897db..ee04b06f672 100644
--- a/MantidPlot/src/ImportASCIIDialog.cpp
+++ b/MantidPlot/src/ImportASCIIDialog.cpp
@@ -50,7 +50,7 @@
 #include <gsl/gsl_math.h>
 
 ImportASCIIDialog::ImportASCIIDialog(bool new_windows_only, QWidget *parent,
-                                     bool extended, Qt::WFlags flags)
+                                     bool extended, const Qt::WFlags &flags)
     : ExtensibleFileDialog(parent, extended, flags) {
   setWindowTitle(tr("MantidPlot - Import ASCII File(s)"));
 
diff --git a/MantidPlot/src/ImportASCIIDialog.h b/MantidPlot/src/ImportASCIIDialog.h
index cb767e331b6..5b8b3e0e2b9 100644
--- a/MantidPlot/src/ImportASCIIDialog.h
+++ b/MantidPlot/src/ImportASCIIDialog.h
@@ -117,8 +117,8 @@ public:
    */
   ImportASCIIDialog(bool new_windows_only, QWidget *parent = nullptr,
                     bool extended = true,
-                    Qt::WFlags flags = Qt::WindowCloseButtonHint |
-                                       Qt::WindowType::WindowTitleHint);
+                    const Qt::WFlags &flags = Qt::WindowCloseButtonHint |
+                                              Qt::WindowType::WindowTitleHint);
 
   //! Return the selected import mode
   /**
diff --git a/MantidPlot/src/IntDialog.cpp b/MantidPlot/src/IntDialog.cpp
index bc9edb76b73..d072c34e0f9 100644
--- a/MantidPlot/src/IntDialog.cpp
+++ b/MantidPlot/src/IntDialog.cpp
@@ -41,7 +41,7 @@
 #include <QSpinBox>
 #include <QTextEdit>
 
-IntDialog::IntDialog(QWidget *parent, Graph *g, Qt::WFlags fl)
+IntDialog::IntDialog(QWidget *parent, Graph *g, const Qt::WFlags &fl)
     : QDialog(parent, fl), d_graph(g) {
   setObjectName("IntegrationDialog");
   setAttribute(Qt::WA_DeleteOnClose);
diff --git a/MantidPlot/src/IntDialog.h b/MantidPlot/src/IntDialog.h
index 9036ec6136a..f4e4257bb15 100644
--- a/MantidPlot/src/IntDialog.h
+++ b/MantidPlot/src/IntDialog.h
@@ -44,7 +44,7 @@ class IntDialog : public QDialog {
 
 public:
   IntDialog(QWidget *parent = nullptr, Graph *g = nullptr,
-            Qt::WFlags fl = nullptr);
+            const Qt::WFlags &fl = nullptr);
 
 public slots:
   void accept() override;
diff --git a/MantidPlot/src/InterpolationDialog.cpp b/MantidPlot/src/InterpolationDialog.cpp
index 071c38c9453..54a9bb20dfc 100644
--- a/MantidPlot/src/InterpolationDialog.cpp
+++ b/MantidPlot/src/InterpolationDialog.cpp
@@ -42,7 +42,7 @@
 #include <QPushButton>
 #include <QSpinBox>
 
-InterpolationDialog::InterpolationDialog(QWidget *parent, Qt::WFlags fl)
+InterpolationDialog::InterpolationDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl), graph(nullptr) {
   setObjectName("InterpolationDialog");
   setWindowTitle(tr("MantidPlot - Interpolation Options"));
diff --git a/MantidPlot/src/InterpolationDialog.h b/MantidPlot/src/InterpolationDialog.h
index 9008dddd68f..837dbf5702f 100644
--- a/MantidPlot/src/InterpolationDialog.h
+++ b/MantidPlot/src/InterpolationDialog.h
@@ -43,7 +43,8 @@ class InterpolationDialog : public QDialog {
   Q_OBJECT
 
 public:
-  InterpolationDialog(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  InterpolationDialog(QWidget *parent = nullptr,
+                      const Qt::WFlags &fl = nullptr);
 
 public slots:
   void activateCurve(const QString &curveName);
diff --git a/MantidPlot/src/LayerDialog.cpp b/MantidPlot/src/LayerDialog.cpp
index cde51096487..f2a43002f88 100644
--- a/MantidPlot/src/LayerDialog.cpp
+++ b/MantidPlot/src/LayerDialog.cpp
@@ -29,7 +29,7 @@
 #include <QPushButton>
 #include <QSpinBox>
 
-LayerDialog::LayerDialog(QWidget *parent, Qt::WFlags fl)
+LayerDialog::LayerDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl), multi_layer(nullptr) {
   setObjectName("LayerDialog");
   setWindowTitle(tr("MantidPlot - Arrange Layers"));
diff --git a/MantidPlot/src/LayerDialog.h b/MantidPlot/src/LayerDialog.h
index bb13823e624..71967c37e4c 100644
--- a/MantidPlot/src/LayerDialog.h
+++ b/MantidPlot/src/LayerDialog.h
@@ -30,7 +30,7 @@ class LayerDialog : public QDialog {
   Q_OBJECT
 
 public:
-  LayerDialog(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  LayerDialog(QWidget *parent = nullptr, const Qt::WFlags &fl = nullptr);
   void setMultiLayer(MultiLayer *g);
 
 protected slots:
diff --git a/MantidPlot/src/LineDialog.cpp b/MantidPlot/src/LineDialog.cpp
index 2a9a76ed66e..afef704cd36 100644
--- a/MantidPlot/src/LineDialog.cpp
+++ b/MantidPlot/src/LineDialog.cpp
@@ -29,7 +29,7 @@
 #include <QGroupBox>
 #include <QSpinBox>
 
-LineDialog::LineDialog(ArrowMarker *line, QWidget *parent, Qt::WFlags fl)
+LineDialog::LineDialog(ArrowMarker *line, QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl) {
   unitBox = nullptr;
 
diff --git a/MantidPlot/src/LineDialog.h b/MantidPlot/src/LineDialog.h
index 2f54e19f625..875243a0618 100644
--- a/MantidPlot/src/LineDialog.h
+++ b/MantidPlot/src/LineDialog.h
@@ -36,7 +36,7 @@ class LineDialog : public QDialog {
 
 public:
   LineDialog(ArrowMarker *line, QWidget *parent = nullptr,
-             Qt::WFlags fl = nullptr);
+             const Qt::WFlags &fl = nullptr);
 
   enum Unit { ScaleCoordinates, Pixels };
 
diff --git a/MantidPlot/src/Mantid/AlgorithmMonitor.cpp b/MantidPlot/src/Mantid/AlgorithmMonitor.cpp
index bb16b32ab27..b090ed4438f 100644
--- a/MantidPlot/src/Mantid/AlgorithmMonitor.cpp
+++ b/MantidPlot/src/Mantid/AlgorithmMonitor.cpp
@@ -58,7 +58,7 @@ AlgorithmMonitor::~AlgorithmMonitor() {
  *
  * @param alg :: algorithm to monitor.
  */
-void AlgorithmMonitor::add(Mantid::API::IAlgorithm_sptr alg) {
+void AlgorithmMonitor::add(const Mantid::API::IAlgorithm_sptr &alg) {
   lock();
   alg->addObserver(m_finishedObserver);
   alg->addObserver(m_errorObserver);
diff --git a/MantidPlot/src/Mantid/AlgorithmMonitor.h b/MantidPlot/src/Mantid/AlgorithmMonitor.h
index 2f926b48b7b..aea9f1db805 100644
--- a/MantidPlot/src/Mantid/AlgorithmMonitor.h
+++ b/MantidPlot/src/Mantid/AlgorithmMonitor.h
@@ -34,7 +34,7 @@ public:
   /// Destructor
   ~AlgorithmMonitor() override;
   /// Add algorithm to monitor
-  void add(Mantid::API::IAlgorithm_sptr alg);
+  void add(const Mantid::API::IAlgorithm_sptr &alg);
   /// Removes stopped algorithm
   void remove(const Mantid::API::IAlgorithm *alg);
 
@@ -116,7 +116,7 @@ private:
 class AlgButton : public QPushButton {
   Q_OBJECT
 public:
-  AlgButton(const QString &text, Mantid::API::IAlgorithm_sptr alg)
+  AlgButton(const QString &text, const Mantid::API::IAlgorithm_sptr &alg)
       : QPushButton(text), m_alg(alg->getAlgorithmID()) {
     connect(this, SIGNAL(clicked()), this, SLOT(sendClicked()));
   }
diff --git a/MantidPlot/src/Mantid/FitParameterTie.cpp b/MantidPlot/src/Mantid/FitParameterTie.cpp
index f5dc7572862..dbf91658842 100644
--- a/MantidPlot/src/Mantid/FitParameterTie.cpp
+++ b/MantidPlot/src/Mantid/FitParameterTie.cpp
@@ -8,11 +8,12 @@
 #include "MantidAPI/CompositeFunction.h"
 #include <QRegExp>
 #include <stdexcept>
+#include <utility>
 
 /// Constructor
 FitParameterTie::FitParameterTie(
     boost::shared_ptr<Mantid::API::CompositeFunction> cf)
-    : m_compositeFunction(cf), m_prop(nullptr) {}
+    : m_compositeFunction(std::move(cf)), m_prop(nullptr) {}
 
 /// Destructor
 FitParameterTie::~FitParameterTie() {
diff --git a/MantidPlot/src/Mantid/IFunctionWrapper.cpp b/MantidPlot/src/Mantid/IFunctionWrapper.cpp
index f8d3448b446..eb2943a0ad0 100644
--- a/MantidPlot/src/Mantid/IFunctionWrapper.cpp
+++ b/MantidPlot/src/Mantid/IFunctionWrapper.cpp
@@ -5,6 +5,9 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "IFunctionWrapper.h"
+
+#include <utility>
+
 #include "MantidAPI/CompositeFunction.h"
 #include "MantidAPI/FunctionFactory.h"
 #include "MantidAPI/IPeakFunction.h"
@@ -27,7 +30,7 @@ void IFunctionWrapper::setFunction(const QString &name) {
 
 void IFunctionWrapper::setFunction(
     boost::shared_ptr<Mantid::API::IFunction> function) {
-  m_function = function;
+  m_function = std::move(function);
   m_compositeFunction =
       boost::dynamic_pointer_cast<Mantid::API::CompositeFunction>(m_function);
   m_peakFunction =
diff --git a/MantidPlot/src/Mantid/InputHistory.cpp b/MantidPlot/src/Mantid/InputHistory.cpp
index e52d175f08e..1879698a2cf 100644
--- a/MantidPlot/src/Mantid/InputHistory.cpp
+++ b/MantidPlot/src/Mantid/InputHistory.cpp
@@ -68,7 +68,8 @@ void InputHistoryImpl::save() {
      Upadates the non-default algorithm properties in the history.
      @param alg :: Pointer to the algorthm
 */
-void InputHistoryImpl::updateAlgorithm(Mantid::API::IAlgorithm_sptr alg) {
+void InputHistoryImpl::updateAlgorithm(
+    const Mantid::API::IAlgorithm_sptr &alg) {
   const std::vector<Property *> &props = alg->getProperties();
   QList<PropertyData> prop_hist_list;
   for (std::vector<Property *>::const_iterator prop = props.begin();
diff --git a/MantidPlot/src/Mantid/InputHistory.h b/MantidPlot/src/Mantid/InputHistory.h
index c4dc5dcba93..1841b5e9bf0 100644
--- a/MantidPlot/src/Mantid/InputHistory.h
+++ b/MantidPlot/src/Mantid/InputHistory.h
@@ -38,7 +38,7 @@ class InputHistoryImpl {
 public:
   InputHistoryImpl(const InputHistoryImpl &) = delete;
   InputHistoryImpl &operator=(const InputHistoryImpl &) = delete;
-  void updateAlgorithm(Mantid::API::IAlgorithm_sptr alg);
+  void updateAlgorithm(const Mantid::API::IAlgorithm_sptr &alg);
   /// The name:value map of non-default properties with which algorithm algName
   /// was called last time.
   QMap<QString, QString> algorithmProperties(const QString &algName);
diff --git a/MantidPlot/src/Mantid/LabelToolLogValuesDialog.cpp b/MantidPlot/src/Mantid/LabelToolLogValuesDialog.cpp
index 261dcf3be6d..521ed90a3dd 100644
--- a/MantidPlot/src/Mantid/LabelToolLogValuesDialog.cpp
+++ b/MantidPlot/src/Mantid/LabelToolLogValuesDialog.cpp
@@ -41,7 +41,7 @@ using namespace Mantid::Kernel;
  */
 LabelToolLogValuesDialog::LabelToolLogValuesDialog(const QString &wsname,
                                                    QWidget *parentContainer,
-                                                   Qt::WFlags flags,
+                                                   const Qt::WFlags &flags,
                                                    size_t experimentInfoIndex)
     : SampleLogDialogBase(wsname, parentContainer, flags, experimentInfoIndex) {
 
diff --git a/MantidPlot/src/Mantid/LabelToolLogValuesDialog.h b/MantidPlot/src/Mantid/LabelToolLogValuesDialog.h
index 676f20dc53c..45fcb520f76 100644
--- a/MantidPlot/src/Mantid/LabelToolLogValuesDialog.h
+++ b/MantidPlot/src/Mantid/LabelToolLogValuesDialog.h
@@ -38,7 +38,7 @@ class LabelToolLogValuesDialog : public SampleLogDialogBase {
 public:
   /// Constructor
   LabelToolLogValuesDialog(const QString &wsname, QWidget *parentContainer,
-                           Qt::WFlags flags = nullptr,
+                           const Qt::WFlags &flags = nullptr,
                            size_t experimentInfoIndex = 0);
 
   virtual ~LabelToolLogValuesDialog() override;
diff --git a/MantidPlot/src/Mantid/MantidApplication.cpp b/MantidPlot/src/Mantid/MantidApplication.cpp
index a12261ca305..17fa5370465 100644
--- a/MantidPlot/src/Mantid/MantidApplication.cpp
+++ b/MantidPlot/src/Mantid/MantidApplication.cpp
@@ -39,8 +39,8 @@ MantidApplication::MantidApplication(int &argc, char **argv)
 }
 
 void MantidApplication::errorHandling(bool continueWork, int share,
-                                      QString name, QString email,
-                                      QString textbox) {
+                                      const QString &name, const QString &email,
+                                      const QString &textbox) {
   if (share == 0) {
     Mantid::Kernel::ErrorReporter errorReporter(
         "mantidplot", Mantid::Kernel::UsageService::Instance().getUpTime(), "",
diff --git a/MantidPlot/src/Mantid/MantidApplication.h b/MantidPlot/src/Mantid/MantidApplication.h
index 977eadb591a..dd8e64600a9 100644
--- a/MantidPlot/src/Mantid/MantidApplication.h
+++ b/MantidPlot/src/Mantid/MantidApplication.h
@@ -20,6 +20,6 @@ public:
 signals:
   bool runAsPythonScript(const QString &code);
 public slots:
-  void errorHandling(bool continueWork, int sharing, QString name,
-                     QString email, QString textbox);
+  void errorHandling(bool continueWork, int sharing, const QString &name,
+                     const QString &email, const QString &textbox);
 };
diff --git a/MantidPlot/src/Mantid/MantidMDCurveDialog.cpp b/MantidPlot/src/Mantid/MantidMDCurveDialog.cpp
index 320b0dd862b..d05d007cced 100644
--- a/MantidPlot/src/Mantid/MantidMDCurveDialog.cpp
+++ b/MantidPlot/src/Mantid/MantidMDCurveDialog.cpp
@@ -12,7 +12,7 @@ using Mantid::API::AnalysisDataService;
 using Mantid::API::IMDWorkspace;
 using Mantid::API::IMDWorkspace_sptr;
 
-MantidMDCurveDialog::MantidMDCurveDialog(QWidget *parent, QString wsName)
+MantidMDCurveDialog::MantidMDCurveDialog(QWidget *parent, const QString &wsName)
     : QDialog(parent), m_wsName(wsName) {
   ui.setupUi(this);
   m_lineOptions = new LinePlotOptions(this);
diff --git a/MantidPlot/src/Mantid/MantidMDCurveDialog.h b/MantidPlot/src/Mantid/MantidMDCurveDialog.h
index d63a8af756e..d2ba68801cb 100644
--- a/MantidPlot/src/Mantid/MantidMDCurveDialog.h
+++ b/MantidPlot/src/Mantid/MantidMDCurveDialog.h
@@ -17,7 +17,8 @@ class MantidMDCurveDialog : public QDialog {
   Q_OBJECT
 
 public:
-  MantidMDCurveDialog(QWidget *parent = nullptr, QString wsName = QString());
+  MantidMDCurveDialog(QWidget *parent = nullptr,
+                      const QString &wsName = QString());
   ~MantidMDCurveDialog() override;
 
   LinePlotOptions *getLineOptionsWidget() { return m_lineOptions; }
diff --git a/MantidPlot/src/Mantid/MantidMatrix.cpp b/MantidPlot/src/Mantid/MantidMatrix.cpp
index 0b71aa06f6f..453512d4305 100644
--- a/MantidPlot/src/Mantid/MantidMatrix.cpp
+++ b/MantidPlot/src/Mantid/MantidMatrix.cpp
@@ -91,7 +91,7 @@ int modelTypeToInt(MantidMatrixModel::Type type) {
 }
 } // namespace
 
-MantidMatrix::MantidMatrix(Mantid::API::MatrixWorkspace_const_sptr ws,
+MantidMatrix::MantidMatrix(const Mantid::API::MatrixWorkspace_const_sptr &ws,
                            QWidget *parent, const QString &label,
                            const QString &name, int start, int end)
     : MdiSubWindow(parent, label, name, nullptr), WorkspaceObserver(),
@@ -213,8 +213,8 @@ void MantidMatrix::viewChanged(int index) {
   }
 }
 
-void MantidMatrix::setup(Mantid::API::MatrixWorkspace_const_sptr ws, int start,
-                         int end) {
+void MantidMatrix::setup(const Mantid::API::MatrixWorkspace_const_sptr &ws,
+                         int start, int end) {
   if (!ws) {
     QMessageBox::critical(nullptr, "WorkspaceMatrixModel error",
                           "2D workspace expected.");
@@ -997,7 +997,8 @@ void MantidMatrix::afterReplaceHandle(
   }
 }
 
-void MantidMatrix::changeWorkspace(Mantid::API::MatrixWorkspace_sptr ws) {
+void MantidMatrix::changeWorkspace(
+    const Mantid::API::MatrixWorkspace_sptr &ws) {
   if (m_workspaceTotalHist != static_cast<int>(ws->getNumberHistograms()) ||
       m_cols != static_cast<int>(ws->blocksize())) {
     closeDependants();
@@ -1171,7 +1172,8 @@ void MantidMatrix::goToTab(const QString &name) {
  */
 const std::string &MantidMatrix::getWorkspaceName() { return m_strName; }
 
-void findYRange(MatrixWorkspace_const_sptr ws, double &miny, double &maxy) {
+void findYRange(const MatrixWorkspace_const_sptr &ws, double &miny,
+                double &maxy) {
   // this is here to fill m_min and m_max with numbers that aren't nan
   miny = std::numeric_limits<double>::max();
   maxy = std::numeric_limits<double>::lowest();
@@ -1349,7 +1351,8 @@ void MantidMatrix::setupNewExtension(MantidMatrixModel::Type type) {
  * Update the existing extensions
  * @param ws: the new workspace
  */
-void MantidMatrix::updateExtensions(Mantid::API::MatrixWorkspace_sptr ws) {
+void MantidMatrix::updateExtensions(
+    const Mantid::API::MatrixWorkspace_sptr &ws) {
   auto it = m_extensions.begin();
   while (it != m_extensions.cend()) {
     auto type = it->first;
diff --git a/MantidPlot/src/Mantid/MantidMatrix.h b/MantidPlot/src/Mantid/MantidMatrix.h
index 19caf3206f4..8cb759dddb9 100644
--- a/MantidPlot/src/Mantid/MantidMatrix.h
+++ b/MantidPlot/src/Mantid/MantidMatrix.h
@@ -56,7 +56,7 @@ class ProjectData;
  * @param miny :: Variable to receive the minimum value.
  * @param maxy :: Variable to receive the maximum value.
  */
-void findYRange(Mantid::API::MatrixWorkspace_const_sptr ws, double &miny,
+void findYRange(const Mantid::API::MatrixWorkspace_const_sptr &ws, double &miny,
                 double &maxy);
 
 /** MantidMatrix is the class that represents a Qtiplot window for displaying
@@ -70,9 +70,9 @@ class MantidMatrix : public MdiSubWindow, MantidQt::API::WorkspaceObserver {
   Q_OBJECT
 
 public:
-  MantidMatrix(Mantid::API::MatrixWorkspace_const_sptr ws, QWidget *parent,
-               const QString &label, const QString &name = QString(),
-               int start = -1, int end = -1);
+  MantidMatrix(const Mantid::API::MatrixWorkspace_const_sptr &ws,
+               QWidget *parent, const QString &label,
+               const QString &name = QString(), int start = -1, int end = -1);
 
   void connectTableView(QTableView *, MantidMatrixModel *);
   MantidMatrixModel *model() { return m_modelY; }
@@ -173,7 +173,7 @@ signals:
 
 public slots:
 
-  void changeWorkspace(Mantid::API::MatrixWorkspace_sptr ws);
+  void changeWorkspace(const Mantid::API::MatrixWorkspace_sptr &ws);
   void closeMatrix();
 
   //! Return the width of all columns
@@ -245,7 +245,7 @@ public slots:
   void setMatrixProperties();
 
 protected:
-  void setup(Mantid::API::MatrixWorkspace_const_sptr ws, int start = -1,
+  void setup(const Mantid::API::MatrixWorkspace_const_sptr &ws, int start = -1,
              int end = -1);
 
   ApplicationWindow *m_appWindow;
@@ -308,7 +308,7 @@ private:
   /// Hook up a MantidMatrixExtension
   void setupNewExtension(MantidMatrixModel::Type type);
   /// Update the existing extensions
-  void updateExtensions(Mantid::API::MatrixWorkspace_sptr ws);
+  void updateExtensions(const Mantid::API::MatrixWorkspace_sptr &ws);
 
   /// ExtensioRequest handler
   MantidMatrixExtensionRequest m_extensionRequest;
diff --git a/MantidPlot/src/Mantid/MantidMatrixCurve.cpp b/MantidPlot/src/Mantid/MantidMatrixCurve.cpp
index 723a09b5b09..dead95e8e38 100644
--- a/MantidPlot/src/Mantid/MantidMatrixCurve.cpp
+++ b/MantidPlot/src/Mantid/MantidMatrixCurve.cpp
@@ -289,7 +289,7 @@ void MantidMatrixCurve::itemChanged() {
  */
 QString MantidMatrixCurve::createCurveName(
     const QString &prefix,
-    const boost::shared_ptr<const Mantid::API::MatrixWorkspace> ws) {
+    const boost::shared_ptr<const Mantid::API::MatrixWorkspace> &ws) {
   QString name = "";
 
   if (prefix.isEmpty())
diff --git a/MantidPlot/src/Mantid/MantidMatrixCurve.h b/MantidPlot/src/Mantid/MantidMatrixCurve.h
index 1b901acbb6d..20af7ed6aca 100644
--- a/MantidPlot/src/Mantid/MantidMatrixCurve.h
+++ b/MantidPlot/src/Mantid/MantidMatrixCurve.h
@@ -145,7 +145,7 @@ private:
   /// Make the curve name
   QString createCurveName(
       const QString &prefix,
-      const boost::shared_ptr<const Mantid::API::MatrixWorkspace> ws);
+      const boost::shared_ptr<const Mantid::API::MatrixWorkspace> &ws);
 
   QString
       m_wsName; ///< Workspace name. If empty the ws isn't in the data service
diff --git a/MantidPlot/src/Mantid/MantidMatrixDialog.cpp b/MantidPlot/src/Mantid/MantidMatrixDialog.cpp
index 7a7ac69f35a..d27ab3a758d 100644
--- a/MantidPlot/src/Mantid/MantidMatrixDialog.cpp
+++ b/MantidPlot/src/Mantid/MantidMatrixDialog.cpp
@@ -15,7 +15,7 @@
 #include <QPushButton>
 #include <QSpinBox>
 
-MantidMatrixDialog::MantidMatrixDialog(QWidget *parent, Qt::WFlags fl)
+MantidMatrixDialog::MantidMatrixDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl), d_matrix(nullptr) {
   setWindowTitle(tr("MantidPlot - Matrix Properties"));
 
diff --git a/MantidPlot/src/Mantid/MantidMatrixDialog.h b/MantidPlot/src/Mantid/MantidMatrixDialog.h
index 18fccb4abc3..9b2fcb113a8 100644
--- a/MantidPlot/src/Mantid/MantidMatrixDialog.h
+++ b/MantidPlot/src/Mantid/MantidMatrixDialog.h
@@ -25,7 +25,7 @@ public:
    * @param parent :: parent widget
    * @param fl :: window flags
    */
-  MantidMatrixDialog(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  MantidMatrixDialog(QWidget *parent = nullptr, const Qt::WFlags &fl = nullptr);
   void setMatrix(MantidMatrix *m);
 
 private slots:
diff --git a/MantidPlot/src/Mantid/MantidMatrixTabExtension.h b/MantidPlot/src/Mantid/MantidMatrixTabExtension.h
index 205a28f4d05..36c0cf2b0a3 100644
--- a/MantidPlot/src/Mantid/MantidMatrixTabExtension.h
+++ b/MantidPlot/src/Mantid/MantidMatrixTabExtension.h
@@ -15,7 +15,7 @@
  * Holds the information for a new tab.
  */
 struct MantidMatrixTabExtension {
-  MantidMatrixTabExtension(QString label, QTableView *tableView,
+  MantidMatrixTabExtension(const QString &&label, QTableView *tableView,
                            MantidMatrixModel *model,
                            MantidMatrixModel::Type type)
       : label(label), tableView(tableView), model(model), type(type) {}
diff --git a/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp b/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp
index 2d5483c9178..6421dc566e2 100644
--- a/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp
+++ b/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp
@@ -35,7 +35,8 @@ using namespace Mantid::Kernel;
  *        ExperimentInfo objects. Should only be non-zero for MDWorkspaces.
  */
 MantidSampleLogDialog::MantidSampleLogDialog(const QString &wsname,
-                                             MantidUI *mui, Qt::WFlags flags,
+                                             MantidUI *mui,
+                                             const Qt::WFlags &flags,
                                              size_t experimentInfoIndex)
     : SampleLogDialogBase(wsname, mui->appWindow(), flags, experimentInfoIndex),
       m_mantidUI(mui) {
diff --git a/MantidPlot/src/Mantid/MantidSampleLogDialog.h b/MantidPlot/src/Mantid/MantidSampleLogDialog.h
index 4cb33e38381..810c0d8f51c 100644
--- a/MantidPlot/src/Mantid/MantidSampleLogDialog.h
+++ b/MantidPlot/src/Mantid/MantidSampleLogDialog.h
@@ -39,7 +39,7 @@ class MantidSampleLogDialog : public SampleLogDialogBase {
 public:
   /// Constructor
   MantidSampleLogDialog(const QString &wsname, MantidUI *mui,
-                        Qt::WFlags flags = nullptr,
+                        const Qt::WFlags &flags = nullptr,
                         size_t experimentInfoIndex = 0);
 
   /// Destructor
diff --git a/MantidPlot/src/Mantid/MantidSampleMaterialDialog.cpp b/MantidPlot/src/Mantid/MantidSampleMaterialDialog.cpp
index 8a8eddc24c3..ca345897ded 100644
--- a/MantidPlot/src/Mantid/MantidSampleMaterialDialog.cpp
+++ b/MantidPlot/src/Mantid/MantidSampleMaterialDialog.cpp
@@ -29,7 +29,7 @@ using namespace Mantid::Kernel;
  */
 MantidSampleMaterialDialog::MantidSampleMaterialDialog(const QString &wsName,
                                                        MantidUI *mtdUI,
-                                                       Qt::WFlags flags)
+                                                       const Qt::WFlags &flags)
     : QDialog(mtdUI->appWindow(), flags), m_wsName(wsName), m_mantidUI(mtdUI) {
   m_uiForm.setupUi(this);
 
diff --git a/MantidPlot/src/Mantid/MantidSampleMaterialDialog.h b/MantidPlot/src/Mantid/MantidSampleMaterialDialog.h
index 2044d628e05..9dc60cedfae 100644
--- a/MantidPlot/src/Mantid/MantidSampleMaterialDialog.h
+++ b/MantidPlot/src/Mantid/MantidSampleMaterialDialog.h
@@ -34,7 +34,7 @@ class MantidSampleMaterialDialog : public QDialog,
 
 public:
   MantidSampleMaterialDialog(const QString &wsName, MantidUI *mtdUI,
-                             Qt::WFlags flags = nullptr);
+                             const Qt::WFlags &flags = nullptr);
 
 public slots:
   void updateMaterial();
diff --git a/MantidPlot/src/Mantid/MantidTable.cpp b/MantidPlot/src/Mantid/MantidTable.cpp
index 5d41e306f8f..da323c473bf 100644
--- a/MantidPlot/src/Mantid/MantidTable.cpp
+++ b/MantidPlot/src/Mantid/MantidTable.cpp
@@ -34,7 +34,7 @@ using namespace MantidQt::API;
  * @return the MantidTable created
  */
 MantidTable::MantidTable(ScriptingEnv *env,
-                         Mantid::API::ITableWorkspace_sptr ws,
+                         const Mantid::API::ITableWorkspace_sptr &ws,
                          const QString &label, ApplicationWindow *parent,
                          bool transpose)
     : Table(env,
diff --git a/MantidPlot/src/Mantid/MantidTable.h b/MantidPlot/src/Mantid/MantidTable.h
index 030ff75a945..a88a12b6612 100644
--- a/MantidPlot/src/Mantid/MantidTable.h
+++ b/MantidPlot/src/Mantid/MantidTable.h
@@ -17,7 +17,7 @@
 class MantidTable : public Table, public MantidQt::API::WorkspaceObserver {
   Q_OBJECT
 public:
-  MantidTable(ScriptingEnv *env, Mantid::API::ITableWorkspace_sptr ws,
+  MantidTable(ScriptingEnv *env, const Mantid::API::ITableWorkspace_sptr &ws,
               const QString &label, ApplicationWindow *parent,
               bool transpose = false);
 
diff --git a/MantidPlot/src/Mantid/MantidUI.cpp b/MantidPlot/src/Mantid/MantidUI.cpp
index b1ffb8be465..8f6158ce4c5 100644
--- a/MantidPlot/src/Mantid/MantidUI.cpp
+++ b/MantidPlot/src/Mantid/MantidUI.cpp
@@ -1716,7 +1716,7 @@ void MantidUI::executeAlgorithm(Mantid::API::IAlgorithm_sptr alg) {
  * This creates an algorithm dialog (the default property entry thingie).
  */
 MantidQt::API::AlgorithmDialog *
-MantidUI::createAlgorithmDialog(Mantid::API::IAlgorithm_sptr alg) {
+MantidUI::createAlgorithmDialog(const Mantid::API::IAlgorithm_sptr &alg) {
   QHash<QString, QString> presets;
   QStringList enabled;
 
@@ -1759,7 +1759,7 @@ MantidUI::createAlgorithmDialog(Mantid::API::IAlgorithm_sptr alg) {
  * @param algorithm :: A pointer to the algorithm instance
  */
 QString MantidUI::findInputWorkspaceProperty(
-    Mantid::API::IAlgorithm_sptr algorithm) const {
+    const Mantid::API::IAlgorithm_sptr &algorithm) const {
   // Iterate through the properties and find the first input one
   std::vector<Mantid::Kernel::Property *> props = algorithm->getProperties();
   std::vector<Mantid::Kernel::Property *>::const_iterator pend = props.end();
@@ -2974,7 +2974,7 @@ MultiLayer *MantidUI::createGraphFromTable(Table *t, int type) {
 */
 void MantidUI::setUpBinGraph(
     MultiLayer *ml, const QString &Name,
-    Mantid::API::MatrixWorkspace_const_sptr workspace) {
+    const Mantid::API::MatrixWorkspace_const_sptr &workspace) {
   Graph *g = ml->activeGraph();
   g->setTitle(tr("Workspace ") + Name);
   QString xtitle;
@@ -3742,7 +3742,8 @@ MultiLayer *MantidUI::plotSubplots(const QStringList &wsNames,
 }
 
 Table *MantidUI::createTableFromBins(
-    const QString &wsName, Mantid::API::MatrixWorkspace_const_sptr workspace,
+    const QString &wsName,
+    const Mantid::API::MatrixWorkspace_const_sptr &workspace,
     const QList<int> &bins, bool errs, int fromRow, int toRow) {
   if (bins.empty())
     return nullptr;
diff --git a/MantidPlot/src/Mantid/MantidUI.h b/MantidPlot/src/Mantid/MantidUI.h
index d2a5c67199f..a19385119f6 100644
--- a/MantidPlot/src/Mantid/MantidUI.h
+++ b/MantidPlot/src/Mantid/MantidUI.h
@@ -310,15 +310,17 @@ public slots:
       bool errs = true);
 
   // Set properties of a 1d graph which plots data from a workspace
-  static void setUpBinGraph(MultiLayer *ml, const QString &wsName,
-                            Mantid::API::MatrixWorkspace_const_sptr workspace);
+  static void
+  setUpBinGraph(MultiLayer *ml, const QString &wsName,
+                const Mantid::API::MatrixWorkspace_const_sptr &workspace);
 
   // Copy to a Table Y-values (and Err-values if errs==true) of bins with
   // indeces from i0 to i1 (inclusive) from a workspace
-  Table *createTableFromBins(const QString &wsName,
-                             Mantid::API::MatrixWorkspace_const_sptr workspace,
-                             const QList<int> &bins, bool errs = true,
-                             int fromRow = -1, int toRow = -1);
+  Table *
+  createTableFromBins(const QString &wsName,
+                      const Mantid::API::MatrixWorkspace_const_sptr &workspace,
+                      const QList<int> &bins, bool errs = true,
+                      int fromRow = -1, int toRow = -1);
 
   // Copies selected columns (time bins) in a MantidMatrix to a Table
   Table *createTableFromSelectedColumns(MantidMatrix *m, bool errs);
@@ -499,8 +501,8 @@ public slots:
   void executeAlgorithm(Mantid::API::IAlgorithm_sptr alg) override;
 
   // Find the name of the first input workspace for an algorithm
-  QString
-  findInputWorkspaceProperty(Mantid::API::IAlgorithm_sptr algorithm) const;
+  QString findInputWorkspaceProperty(
+      const Mantid::API::IAlgorithm_sptr &algorithm) const;
   // Show Qt critical error message box
   void showCritical(const QString &) override;
   // Show the dialog monitoring currently running algorithms
@@ -595,7 +597,7 @@ private:
 
   /// This creates an algorithm dialog.
   MantidQt::API::AlgorithmDialog *
-  createAlgorithmDialog(Mantid::API::IAlgorithm_sptr alg);
+  createAlgorithmDialog(const Mantid::API::IAlgorithm_sptr &alg);
 
   /// This method accepts user inputs and executes loadraw/load nexus
   /// algorithm
diff --git a/MantidPlot/src/Mantid/PeakPickerTool.cpp b/MantidPlot/src/Mantid/PeakPickerTool.cpp
index d39062b4a90..7dec8b965a9 100644
--- a/MantidPlot/src/Mantid/PeakPickerTool.cpp
+++ b/MantidPlot/src/Mantid/PeakPickerTool.cpp
@@ -316,8 +316,8 @@ bool PeakPickerTool::eventFilter(QObject *obj, QEvent *event) {
   return QwtPlotPicker::eventFilter(obj, event);
 }
 
-void PeakPickerTool::windowStateChanged(Qt::WindowStates,
-                                        Qt::WindowStates newState) {
+void PeakPickerTool::windowStateChanged(const Qt::WindowStates &,
+                                        const Qt::WindowStates &newState) {
   (void)newState;
 }
 
diff --git a/MantidPlot/src/Mantid/PeakPickerTool.h b/MantidPlot/src/Mantid/PeakPickerTool.h
index 7f8de38db61..bf1b5bae9c4 100644
--- a/MantidPlot/src/Mantid/PeakPickerTool.h
+++ b/MantidPlot/src/Mantid/PeakPickerTool.h
@@ -81,7 +81,8 @@ public:
   bool isInitialized() const { return m_init; }
 
 public slots:
-  void windowStateChanged(Qt::WindowStates oldState, Qt::WindowStates newState);
+  void windowStateChanged(const Qt::WindowStates &oldState,
+                          const Qt::WindowStates &newState);
 
 signals:
   void peakChanged();
diff --git a/MantidPlot/src/Mantid/SampleLogDialogBase.cpp b/MantidPlot/src/Mantid/SampleLogDialogBase.cpp
index cafe18ff040..d9d150c0e26 100644
--- a/MantidPlot/src/Mantid/SampleLogDialogBase.cpp
+++ b/MantidPlot/src/Mantid/SampleLogDialogBase.cpp
@@ -50,7 +50,7 @@ using namespace Mantid::Kernel;
  */
 SampleLogDialogBase::SampleLogDialogBase(const QString &wsname,
                                          QWidget *parentContainer,
-                                         Qt::WFlags flags,
+                                         const Qt::WFlags &flags,
                                          size_t experimentInfoIndex)
     : QDialog(parentContainer, flags), m_tree(new QTreeWidget()),
       m_parentContainer(parentContainer), m_wsname(wsname.toStdString()),
diff --git a/MantidPlot/src/Mantid/SampleLogDialogBase.h b/MantidPlot/src/Mantid/SampleLogDialogBase.h
index e2c155e764a..216f180f856 100644
--- a/MantidPlot/src/Mantid/SampleLogDialogBase.h
+++ b/MantidPlot/src/Mantid/SampleLogDialogBase.h
@@ -47,7 +47,7 @@ class SampleLogDialogBase : public QDialog {
 public:
   /// Constructor
   SampleLogDialogBase(const QString &wsname, QWidget *parentContainer,
-                      Qt::WFlags flags = nullptr,
+                      const Qt::WFlags &flags = nullptr,
                       size_t experimentInfoIndex = 0);
 
   /// Virtual Destructor for derived classes
diff --git a/MantidPlot/src/Matrix.cpp b/MantidPlot/src/Matrix.cpp
index 6d96fad55cd..79de07d76ef 100644
--- a/MantidPlot/src/Matrix.cpp
+++ b/MantidPlot/src/Matrix.cpp
@@ -76,7 +76,7 @@ using namespace Mantid;
 using namespace MantidQt::API;
 
 Matrix::Matrix(ScriptingEnv *env, const QString &label, QWidget *parent,
-               const QString &name, Qt::WFlags f)
+               const QString &name, const Qt::WFlags &f)
     : MdiSubWindow(parent, label, name, f), Scripted(env),
       d_matrix_model(nullptr), m_bk_color(), d_stack(nullptr),
       d_table_view(nullptr), imageLabel(nullptr), formula_str(), txt_format(),
@@ -91,7 +91,7 @@ Matrix::Matrix(ScriptingEnv *env, const QString &label, QWidget *parent,
 }
 
 Matrix::Matrix(ScriptingEnv *env, int r, int c, const QString &label,
-               QWidget *parent, const QString &name, Qt::WFlags f)
+               QWidget *parent, const QString &name, const Qt::WFlags &f)
     : MdiSubWindow(parent, label, name, f), Scripted(env),
       d_matrix_model(nullptr), m_bk_color(), d_stack(nullptr),
       d_table_view(nullptr), imageLabel(nullptr), formula_str(), txt_format(),
@@ -107,7 +107,7 @@ Matrix::Matrix(ScriptingEnv *env, int r, int c, const QString &label,
 }
 
 Matrix::Matrix(ScriptingEnv *env, const QImage &image, const QString &label,
-               QWidget *parent, const QString &name, Qt::WFlags f)
+               QWidget *parent, const QString &name, const Qt::WFlags &f)
     : MdiSubWindow(parent, label, name, f), Scripted(env),
       d_matrix_model(nullptr), m_bk_color(), d_stack(nullptr),
       d_table_view(nullptr), imageLabel(nullptr), formula_str(),
diff --git a/MantidPlot/src/Matrix.h b/MantidPlot/src/Matrix.h
index 5d15ee80410..7713504f713 100644
--- a/MantidPlot/src/Matrix.h
+++ b/MantidPlot/src/Matrix.h
@@ -65,7 +65,7 @@ class Matrix : public MdiSubWindow, public Scripted {
 
 protected:
   Matrix(ScriptingEnv *env, const QString &label, QWidget *parent,
-         const QString &name = QString(), Qt::WFlags f = nullptr);
+         const QString &name = QString(), const Qt::WFlags &f = nullptr);
 
 public:
   /**
@@ -81,10 +81,10 @@ public:
    * @param f :: window flags
    */
   Matrix(ScriptingEnv *env, int r, int c, const QString &label, QWidget *parent,
-         const QString &name = QString(), Qt::WFlags f = nullptr);
+         const QString &name = QString(), const Qt::WFlags &f = nullptr);
   Matrix(ScriptingEnv *env, const QImage &image, const QString &label,
          QWidget *parent, const QString &name = QString(),
-         Qt::WFlags f = nullptr);
+         const Qt::WFlags &f = nullptr);
   ~Matrix() override;
 
   enum Operation {
diff --git a/MantidPlot/src/MatrixDialog.cpp b/MantidPlot/src/MatrixDialog.cpp
index d5322f40157..fdcf06258d9 100644
--- a/MantidPlot/src/MatrixDialog.cpp
+++ b/MantidPlot/src/MatrixDialog.cpp
@@ -26,7 +26,7 @@
 #include <QPushButton>
 #include <QSpinBox>
 
-MatrixDialog::MatrixDialog(QWidget *parent, Qt::WFlags fl)
+MatrixDialog::MatrixDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl), d_matrix(nullptr) {
   setWindowTitle(tr("MantidPlot - Matrix Properties"));
 
diff --git a/MantidPlot/src/MatrixDialog.h b/MantidPlot/src/MatrixDialog.h
index 13c7a1bf229..9a14b47ffd1 100644
--- a/MantidPlot/src/MatrixDialog.h
+++ b/MantidPlot/src/MatrixDialog.h
@@ -34,7 +34,7 @@ public:
    * @param parent :: parent widget
    * @param fl :: window flags
    */
-  MatrixDialog(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  MatrixDialog(QWidget *parent = nullptr, const Qt::WFlags &fl = nullptr);
   void setMatrix(Matrix *m);
 
 private slots:
diff --git a/MantidPlot/src/MatrixSizeDialog.cpp b/MantidPlot/src/MatrixSizeDialog.cpp
index 8e1f39838be..3993bd3b396 100644
--- a/MantidPlot/src/MatrixSizeDialog.cpp
+++ b/MantidPlot/src/MatrixSizeDialog.cpp
@@ -26,7 +26,8 @@
 #include <QPushButton>
 #include <QSpinBox>
 
-MatrixSizeDialog::MatrixSizeDialog(Matrix *m, QWidget *parent, Qt::WFlags fl)
+MatrixSizeDialog::MatrixSizeDialog(Matrix *m, QWidget *parent,
+                                   const Qt::WFlags &fl)
     : QDialog(parent, fl), d_matrix(m) {
   setWindowTitle(tr("MantidPlot - Matrix Dimensions"));
 
diff --git a/MantidPlot/src/MatrixSizeDialog.h b/MantidPlot/src/MatrixSizeDialog.h
index 6bcb69b329a..2fdb1eb92ba 100644
--- a/MantidPlot/src/MatrixSizeDialog.h
+++ b/MantidPlot/src/MatrixSizeDialog.h
@@ -36,7 +36,7 @@ public:
    * @param fl :: window flags
    */
   MatrixSizeDialog(Matrix *m, QWidget *parent = nullptr,
-                   Qt::WFlags fl = nullptr);
+                   const Qt::WFlags &fl = nullptr);
 
 private slots:
   //! Accept changes and quit
diff --git a/MantidPlot/src/MatrixValuesDialog.cpp b/MantidPlot/src/MatrixValuesDialog.cpp
index 1f5925bd761..a4cd794e38f 100644
--- a/MantidPlot/src/MatrixValuesDialog.cpp
+++ b/MantidPlot/src/MatrixValuesDialog.cpp
@@ -47,7 +47,7 @@
 #endif
 
 MatrixValuesDialog::MatrixValuesDialog(ScriptingEnv *env, QWidget *parent,
-                                       Qt::WFlags fl)
+                                       const Qt::WFlags &fl)
     : QDialog(parent, fl), Scripted(env), matrix(nullptr) {
   setObjectName("MatrixValuesDialog");
   setWindowTitle(tr("MantidPlot - Set Matrix Values"));
diff --git a/MantidPlot/src/MatrixValuesDialog.h b/MantidPlot/src/MatrixValuesDialog.h
index 4db565ffb01..ea5e401346f 100644
--- a/MantidPlot/src/MatrixValuesDialog.h
+++ b/MantidPlot/src/MatrixValuesDialog.h
@@ -50,7 +50,7 @@ class MatrixValuesDialog : public QDialog, public Scripted {
 
 public:
   MatrixValuesDialog(ScriptingEnv *env, QWidget *parent = nullptr,
-                     Qt::WFlags fl = nullptr);
+                     const Qt::WFlags &fl = nullptr);
   void setMatrix(Matrix *m);
 
 private slots:
diff --git a/MantidPlot/src/MdPlottingCmapsProvider.cpp b/MantidPlot/src/MdPlottingCmapsProvider.cpp
index 15de0dfbd9d..f2075d55506 100644
--- a/MantidPlot/src/MdPlottingCmapsProvider.cpp
+++ b/MantidPlot/src/MdPlottingCmapsProvider.cpp
@@ -90,7 +90,7 @@ void MdPlottingCmapsProvider::getColorMapsForVSI(QStringList &colorMapNames) {
 
 void MdPlottingCmapsProvider::appendAllFileNamesForFileType(
     QStringList &colorMapNames, QStringList &colorMapFiles,
-    QString colorMapDirectory, QString fileType) {
+    const QString &colorMapDirectory, const QString &fileType) {
   QDir directory(colorMapDirectory);
 
   QStringList filter(QString("*.%1").arg(fileType));
@@ -105,7 +105,7 @@ void MdPlottingCmapsProvider::appendAllFileNamesForFileType(
 
 std::vector<int>
 MdPlottingCmapsProvider::getSliceViewerIndicesForCommonColorMaps(
-    QStringList colorMapNamesSliceViewer, QStringList colorMapNamesVsi) {
+    QStringList colorMapNamesSliceViewer, const QStringList &colorMapNamesVsi) {
   int index = 0;
 
   std::vector<int> indexVector;
diff --git a/MantidPlot/src/MdPlottingCmapsProvider.h b/MantidPlot/src/MdPlottingCmapsProvider.h
index 152b292a4b2..7c8a40e8532 100644
--- a/MantidPlot/src/MdPlottingCmapsProvider.h
+++ b/MantidPlot/src/MdPlottingCmapsProvider.h
@@ -52,8 +52,8 @@ private:
    */
   void appendAllFileNamesForFileType(QStringList &colorMapNames,
                                      QStringList &colorMapFiles,
-                                     QString colorMapDirectory,
-                                     QString fileType);
+                                     const QString &colorMapDirectory,
+                                     const QString &fileType);
 
   /**
    * Compare the colormap names of the Slice Viewer and the VSI and extract all
@@ -65,5 +65,5 @@ private:
    */
   std::vector<int>
   getSliceViewerIndicesForCommonColorMaps(QStringList colorMapNamesSliceViewer,
-                                          QStringList colorMapNamesVsi);
+                                          const QStringList &colorMapNamesVsi);
 };
diff --git a/MantidPlot/src/MdiSubWindow.cpp b/MantidPlot/src/MdiSubWindow.cpp
index fd422b069e7..5d1f5ef9b7a 100644
--- a/MantidPlot/src/MdiSubWindow.cpp
+++ b/MantidPlot/src/MdiSubWindow.cpp
@@ -52,7 +52,7 @@ using std::string;
 using namespace Mantid;
 
 MdiSubWindow::MdiSubWindow(QWidget *parent, const QString &label,
-                           const QString &name, Qt::WFlags f)
+                           const QString &name, const Qt::WFlags &f)
     : MdiSubWindowParent_t(parent, f),
       d_app(static_cast<ApplicationWindow *>(parent)),
       d_folder(d_app->currentFolder()), d_label(label), d_status(Normal),
@@ -70,7 +70,7 @@ MdiSubWindow::MdiSubWindow()
       d_min_restore_size(QSize()) {}
 
 void MdiSubWindow::init(QWidget *parent, const QString &label,
-                        const QString &name, Qt::WFlags flags) {
+                        const QString &name, const Qt::WFlags &flags) {
   setParent(parent);
   setObjectName(name);
   setName(name);
diff --git a/MantidPlot/src/MdiSubWindow.h b/MantidPlot/src/MdiSubWindow.h
index 87c7330c641..b2575cf0a8b 100644
--- a/MantidPlot/src/MdiSubWindow.h
+++ b/MantidPlot/src/MdiSubWindow.h
@@ -49,7 +49,7 @@ class Folder;
 class MdiSubWindowParent_t : public QFrame {
   Q_OBJECT
 public:
-  MdiSubWindowParent_t(QWidget *parent, Qt::WFlags f = nullptr)
+  MdiSubWindowParent_t(QWidget *parent, const Qt::WFlags &f = nullptr)
       : QFrame(parent, f), m_widget(nullptr) {}
   void setWidget(QWidget *w) {
     if (w == nullptr) { // removing widget
@@ -124,13 +124,13 @@ public:
    * \sa setCaptionPolicy(), captionPolicy()
    */
   MdiSubWindow(QWidget *parent, const QString &label = QString(),
-               const QString &name = QString(), Qt::WFlags f = nullptr);
+               const QString &name = QString(), const Qt::WFlags &f = nullptr);
 
   MdiSubWindow();
 
   /// Setup the window without constructor
   void init(QWidget *parent, const QString &label, const QString &name,
-            Qt::WFlags flags);
+            const Qt::WFlags &flags);
 
   //! Possible window captions.
   enum CaptionPolicy {
diff --git a/MantidPlot/src/MultiLayer.cpp b/MantidPlot/src/MultiLayer.cpp
index 13ea8f39184..f9e07ea5f81 100644
--- a/MantidPlot/src/MultiLayer.cpp
+++ b/MantidPlot/src/MultiLayer.cpp
@@ -113,7 +113,8 @@ void LayerButton::mouseDoubleClickEvent(QMouseEvent *) {
 }
 
 MultiLayer::MultiLayer(QWidget *parent, int layers, int rows, int cols,
-                       const QString &label, const char *name, Qt::WFlags f)
+                       const QString &label, const char *name,
+                       const Qt::WFlags &f)
     : MdiSubWindow(parent, label, name, f), active_graph(nullptr), d_cols(cols),
       d_rows(rows), graph_width(500), graph_height(400), colsSpace(5),
       rowsSpace(5), left_margin(5), right_margin(5), top_margin(5),
diff --git a/MantidPlot/src/MultiLayer.h b/MantidPlot/src/MultiLayer.h
index ad453f12b18..b0ce909fd86 100644
--- a/MantidPlot/src/MultiLayer.h
+++ b/MantidPlot/src/MultiLayer.h
@@ -82,7 +82,7 @@ class MultiLayer : public MdiSubWindow {
 public:
   MultiLayer(QWidget *parent, int layers = 1, int rows = 1, int cols = 1,
              const QString &label = "", const char *name = nullptr,
-             Qt::WFlags f = nullptr);
+             const Qt::WFlags &f = nullptr);
   ~MultiLayer() override;
 
   /// Get the window type as a string
diff --git a/MantidPlot/src/Note.cpp b/MantidPlot/src/Note.cpp
index 51dd908bec7..ca70a44a87a 100644
--- a/MantidPlot/src/Note.cpp
+++ b/MantidPlot/src/Note.cpp
@@ -50,7 +50,7 @@ DECLARE_WINDOW(Note)
 using namespace Mantid;
 
 Note::Note(const QString &label, QWidget *parent, const QString &name,
-           Qt::WFlags f)
+           const Qt::WFlags &f)
     : MdiSubWindow(parent, label, name, f) {
   te = new QTextEdit(this);
   te->setObjectName(name);
diff --git a/MantidPlot/src/Note.h b/MantidPlot/src/Note.h
index d338954d356..e724c86c9ae 100644
--- a/MantidPlot/src/Note.h
+++ b/MantidPlot/src/Note.h
@@ -45,7 +45,7 @@ class Note : public MdiSubWindow {
 
 public:
   Note(const QString &label, QWidget *parent, const QString &name = QString(),
-       Qt::WFlags f = nullptr);
+       const Qt::WFlags &f = nullptr);
   ~Note() override{};
 
   static MantidQt::API::IProjectSerialisable *
diff --git a/MantidPlot/src/Plot3DDialog.cpp b/MantidPlot/src/Plot3DDialog.cpp
index ec764b88452..eedff175817 100644
--- a/MantidPlot/src/Plot3DDialog.cpp
+++ b/MantidPlot/src/Plot3DDialog.cpp
@@ -46,7 +46,7 @@
 
 using Mantid::Kernel::ConfigService;
 
-Plot3DDialog::Plot3DDialog(QWidget *parent, Qt::WFlags fl)
+Plot3DDialog::Plot3DDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl) {
   setObjectName("Plot3DDialog");
   setWindowTitle(tr("MantidPlot - Surface Plot Options"));
diff --git a/MantidPlot/src/Plot3DDialog.h b/MantidPlot/src/Plot3DDialog.h
index 66480698266..f8a6a179edf 100644
--- a/MantidPlot/src/Plot3DDialog.h
+++ b/MantidPlot/src/Plot3DDialog.h
@@ -41,7 +41,7 @@ class Plot3DDialog : public QDialog {
   Q_OBJECT
 
 public:
-  Plot3DDialog(QWidget *parent, Qt::WFlags fl = nullptr);
+  Plot3DDialog(QWidget *parent, const Qt::WFlags &fl = nullptr);
   void setPlot(Graph3D *);
 
   void showTitleTab();
diff --git a/MantidPlot/src/PlotDialog.cpp b/MantidPlot/src/PlotDialog.cpp
index 933f04a338a..5ca24067fa4 100644
--- a/MantidPlot/src/PlotDialog.cpp
+++ b/MantidPlot/src/PlotDialog.cpp
@@ -75,7 +75,7 @@ using Mantid::Kernel::ConfigService;
 using namespace MantidQt::API;
 
 PlotDialog::PlotDialog(bool showExtended, ApplicationWindow *app,
-                       MultiLayer *ml, Qt::WFlags fl)
+                       MultiLayer *ml, const Qt::WFlags &fl)
     : QDialog(ml, fl), d_app(app), d_ml(nullptr) {
   setObjectName("PlotDialog");
   setWindowTitle(tr("MantidPlot - Plot details"));
diff --git a/MantidPlot/src/PlotDialog.h b/MantidPlot/src/PlotDialog.h
index beb8d8a62a2..a1d7a417519 100644
--- a/MantidPlot/src/PlotDialog.h
+++ b/MantidPlot/src/PlotDialog.h
@@ -69,7 +69,7 @@ class PlotDialog : public QDialog {
 
 public:
   PlotDialog(bool showExtended, ApplicationWindow *app, MultiLayer *ml,
-             Qt::WFlags fl = nullptr);
+             const Qt::WFlags &fl = nullptr);
   void initFonts(const QFont &titlefont, const QFont &axesfont,
                  const QFont &numbersfont, const QFont &legendfont);
   void insertColumnsList(const QStringList &names) { columnNames = names; };
diff --git a/MantidPlot/src/PlotWizard.cpp b/MantidPlot/src/PlotWizard.cpp
index e181c6d1780..4d7db635cb4 100644
--- a/MantidPlot/src/PlotWizard.cpp
+++ b/MantidPlot/src/PlotWizard.cpp
@@ -37,7 +37,8 @@
 #include <QGroupBox>
 #include <QListWidget>
 
-PlotWizard::PlotWizard(QWidget *parent, Qt::WFlags fl) : QDialog(parent, fl) {
+PlotWizard::PlotWizard(QWidget *parent, const Qt::WFlags &fl)
+    : QDialog(parent, fl) {
   setWindowTitle(tr("MantidPlot - Select Columns to Plot"));
 
   setSizeGripEnabled(true);
diff --git a/MantidPlot/src/PlotWizard.h b/MantidPlot/src/PlotWizard.h
index e7e69ff2ef4..cb68e8867ed 100644
--- a/MantidPlot/src/PlotWizard.h
+++ b/MantidPlot/src/PlotWizard.h
@@ -46,7 +46,7 @@ public:
    * @param parent :: parent widget
    * @param fl :: Qt window flags
    */
-  PlotWizard(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  PlotWizard(QWidget *parent = nullptr, const Qt::WFlags &fl = nullptr);
 
 private:
   //! Button "Plot"
diff --git a/MantidPlot/src/PolynomFitDialog.cpp b/MantidPlot/src/PolynomFitDialog.cpp
index c06057a3290..8d950fcfdac 100644
--- a/MantidPlot/src/PolynomFitDialog.cpp
+++ b/MantidPlot/src/PolynomFitDialog.cpp
@@ -38,7 +38,7 @@
 #include <QMessageBox>
 #include <QSpinBox>
 
-PolynomFitDialog::PolynomFitDialog(QWidget *parent, Qt::WFlags fl)
+PolynomFitDialog::PolynomFitDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl), graph(nullptr) {
   setObjectName("PolynomFitDialog");
   setWindowTitle(tr("MantidPlot - Polynomial Fit Options"));
diff --git a/MantidPlot/src/PolynomFitDialog.h b/MantidPlot/src/PolynomFitDialog.h
index 148607e92d5..7a1d51c1daf 100644
--- a/MantidPlot/src/PolynomFitDialog.h
+++ b/MantidPlot/src/PolynomFitDialog.h
@@ -44,7 +44,7 @@ class PolynomFitDialog : public QDialog {
   Q_OBJECT
 
 public:
-  PolynomFitDialog(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  PolynomFitDialog(QWidget *parent = nullptr, const Qt::WFlags &fl = nullptr);
 
 public slots:
   void fit();
diff --git a/MantidPlot/src/Processes.cpp b/MantidPlot/src/Processes.cpp
index 392770cefb9..92723188e4c 100644
--- a/MantidPlot/src/Processes.cpp
+++ b/MantidPlot/src/Processes.cpp
@@ -24,7 +24,7 @@
 
 namespace {
 
-bool isOtherInstance(int64_t otherPID, QString otherExeName) {
+bool isOtherInstance(int64_t otherPID, const QString &otherExeName) {
   static const int64_t ourPID(QCoreApplication::applicationPid());
   if (otherPID == ourPID)
     return false;
diff --git a/MantidPlot/src/ProjectRecovery.cpp b/MantidPlot/src/ProjectRecovery.cpp
index 5085c402c69..7007e0d5a7b 100644
--- a/MantidPlot/src/ProjectRecovery.cpp
+++ b/MantidPlot/src/ProjectRecovery.cpp
@@ -339,7 +339,8 @@ bool ProjectRecovery::checkForRecovery() const noexcept {
   }
 }
 
-bool ProjectRecovery::clearAllCheckpoints(Poco::Path path) const noexcept {
+bool ProjectRecovery::clearAllCheckpoints(const Poco::Path &path) const
+    noexcept {
   try {
     Poco::File(path).remove(true);
     return true;
diff --git a/MantidPlot/src/ProjectRecovery.h b/MantidPlot/src/ProjectRecovery.h
index cca98b0ce4e..bc323123d21 100644
--- a/MantidPlot/src/ProjectRecovery.h
+++ b/MantidPlot/src/ProjectRecovery.h
@@ -47,7 +47,7 @@ public:
   bool checkForRecovery() const noexcept;
 
   /// Clears all checkpoints in the existing folder at the given path
-  bool clearAllCheckpoints(Poco::Path path) const noexcept;
+  bool clearAllCheckpoints(const Poco::Path &path) const noexcept;
 
   /// Clears all checkpoints in the existing folder at the given path
   bool clearAllUnusedCheckpoints() const noexcept;
diff --git a/MantidPlot/src/ProjectSerialiser.cpp b/MantidPlot/src/ProjectSerialiser.cpp
index cbd97ac9b4e..3cfbb334e7c 100644
--- a/MantidPlot/src/ProjectSerialiser.cpp
+++ b/MantidPlot/src/ProjectSerialiser.cpp
@@ -220,7 +220,7 @@ bool ProjectSerialiser::save(const QString &projectName, bool compress,
  * 		folder. (Default True)
  * @return True is loading was successful, otherwise false
  */
-bool ProjectSerialiser::load(std::string filepath, const int fileVersion,
+bool ProjectSerialiser::load(const std::string &filepath, const int fileVersion,
                              const bool isTopLevel) {
   // We have to accept std::string to maintain Python compatibility
   auto qfilePath = QString::fromStdString(filepath);
diff --git a/MantidPlot/src/ProjectSerialiser.h b/MantidPlot/src/ProjectSerialiser.h
index 36b3b6d6fa9..7ef131461b2 100644
--- a/MantidPlot/src/ProjectSerialiser.h
+++ b/MantidPlot/src/ProjectSerialiser.h
@@ -59,7 +59,7 @@ public:
   bool save(const QString &projectName, bool compress = false,
             bool saveAll = true);
   /// Load a project file from disk
-  bool load(std::string filepath, const int fileVersion,
+  bool load(const std::string &filepath, const int fileVersion,
             const bool isTopLevel = true);
   /// Open the script window and load scripts from string
   void openScriptWindow(const QStringList &files);
diff --git a/MantidPlot/src/RenameWindowDialog.cpp b/MantidPlot/src/RenameWindowDialog.cpp
index e717cf0ec27..0fde8040217 100644
--- a/MantidPlot/src/RenameWindowDialog.cpp
+++ b/MantidPlot/src/RenameWindowDialog.cpp
@@ -37,7 +37,7 @@
 #include <QMessageBox>
 #include <QRadioButton>
 
-RenameWindowDialog::RenameWindowDialog(QWidget *parent, Qt::WFlags fl)
+RenameWindowDialog::RenameWindowDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl) {
   setWindowTitle(tr("MantidPlot - Rename Window"));
 
diff --git a/MantidPlot/src/RenameWindowDialog.h b/MantidPlot/src/RenameWindowDialog.h
index 2307e1af7f3..87efc06339d 100644
--- a/MantidPlot/src/RenameWindowDialog.h
+++ b/MantidPlot/src/RenameWindowDialog.h
@@ -47,7 +47,7 @@ class RenameWindowDialog : public QDialog {
   Q_OBJECT
 
 public:
-  RenameWindowDialog(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  RenameWindowDialog(QWidget *parent = nullptr, const Qt::WFlags &fl = nullptr);
 
 private:
   QPushButton *buttonOk;
diff --git a/MantidPlot/src/ScriptingLangDialog.cpp b/MantidPlot/src/ScriptingLangDialog.cpp
index 58308238c79..4ee342dd39c 100644
--- a/MantidPlot/src/ScriptingLangDialog.cpp
+++ b/MantidPlot/src/ScriptingLangDialog.cpp
@@ -37,7 +37,7 @@
 
 ScriptingLangDialog::ScriptingLangDialog(ScriptingEnv *env,
                                          ApplicationWindow *parent,
-                                         Qt::WFlags fl)
+                                         const Qt::WFlags &fl)
     : QDialog(parent, fl), Scripted(env) {
   setWindowTitle(tr("MantidPlot - Select scripting language"));
 
diff --git a/MantidPlot/src/ScriptingLangDialog.h b/MantidPlot/src/ScriptingLangDialog.h
index 1dc8dba2cdd..780c6ba9861 100644
--- a/MantidPlot/src/ScriptingLangDialog.h
+++ b/MantidPlot/src/ScriptingLangDialog.h
@@ -43,7 +43,7 @@ class ScriptingLangDialog : public QDialog, public Scripted {
 
 public:
   ScriptingLangDialog(ScriptingEnv *env, ApplicationWindow *parent,
-                      Qt::WFlags fl = nullptr);
+                      const Qt::WFlags &fl = nullptr);
 
 public slots:
   void updateLangList();
diff --git a/MantidPlot/src/ScriptingWindow.cpp b/MantidPlot/src/ScriptingWindow.cpp
index 2288aa92471..77a54092acc 100644
--- a/MantidPlot/src/ScriptingWindow.cpp
+++ b/MantidPlot/src/ScriptingWindow.cpp
@@ -61,7 +61,7 @@ Mantid::Kernel::Logger g_log("ScriptingWindow");
  * @param flags :: Window flags passed to the base class
  */
 ScriptingWindow::ScriptingWindow(ScriptingEnv *env, bool capturePrint,
-                                 QWidget *parent, Qt::WindowFlags flags)
+                                 QWidget *parent, const Qt::WindowFlags &flags)
     : QMainWindow(parent, flags), m_acceptClose(false) {
   Q_UNUSED(capturePrint);
   setObjectName("MantidScriptWindow");
diff --git a/MantidPlot/src/ScriptingWindow.h b/MantidPlot/src/ScriptingWindow.h
index 65c5c861c5b..59000667824 100644
--- a/MantidPlot/src/ScriptingWindow.h
+++ b/MantidPlot/src/ScriptingWindow.h
@@ -40,7 +40,8 @@ class ScriptingWindow : public QMainWindow {
 public:
   /// Constructor
   ScriptingWindow(ScriptingEnv *env, bool capturePrint = true,
-                  QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr);
+                  QWidget *parent = nullptr,
+                  const Qt::WindowFlags &flags = nullptr);
   /// Destructor
   ~ScriptingWindow() override;
   /// Override the closeEvent
diff --git a/MantidPlot/src/SendToProgramDialog.cpp b/MantidPlot/src/SendToProgramDialog.cpp
index 2902f85d2e6..dd727971776 100644
--- a/MantidPlot/src/SendToProgramDialog.cpp
+++ b/MantidPlot/src/SendToProgramDialog.cpp
@@ -31,7 +31,7 @@ using namespace MantidQt::API;
 /**
  * Constructor when adding a new program to the send to list
  */
-SendToProgramDialog::SendToProgramDialog(QWidget *parent, Qt::WFlags fl)
+SendToProgramDialog::SendToProgramDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl), validName(false), validTarget(false),
       validSaveUsing(false) {
   m_uiform.setupUi(this);
@@ -61,8 +61,9 @@ SendToProgramDialog::SendToProgramDialog(QWidget *parent, Qt::WFlags fl)
  * Constructor when editing a program settings
  */
 SendToProgramDialog::SendToProgramDialog(
-    QWidget *parent, QString programName,
-    std::map<std::string, std::string> programKeysAndDetails, Qt::WFlags fl)
+    QWidget *parent, const QString &programName,
+    std::map<std::string, std::string> programKeysAndDetails,
+    const Qt::WFlags &fl)
     : QDialog(parent, fl), validName(true), validTarget(true),
       validSaveUsing(true) {
   m_uiform.setupUi(this);
diff --git a/MantidPlot/src/SendToProgramDialog.h b/MantidPlot/src/SendToProgramDialog.h
index 19fe0936f91..1e16fc996ab 100644
--- a/MantidPlot/src/SendToProgramDialog.h
+++ b/MantidPlot/src/SendToProgramDialog.h
@@ -26,10 +26,10 @@ class SendToProgramDialog : public QDialog {
   Q_OBJECT
 
 public:
-  SendToProgramDialog(QWidget *parent, Qt::WFlags fl = nullptr);
-  SendToProgramDialog(QWidget *parent, QString programName,
+  SendToProgramDialog(QWidget *parent, const Qt::WFlags &fl = nullptr);
+  SendToProgramDialog(QWidget *parent, const QString &programName,
                       std::map<std::string, std::string> programKeysAndDetails,
-                      Qt::WFlags fl = nullptr);
+                      const Qt::WFlags &fl = nullptr);
   std::pair<std::string, std::map<std::string, std::string>>
   getSettings() const;
 
diff --git a/MantidPlot/src/SetColValuesDialog.cpp b/MantidPlot/src/SetColValuesDialog.cpp
index a0495866420..969f46337c3 100644
--- a/MantidPlot/src/SetColValuesDialog.cpp
+++ b/MantidPlot/src/SetColValuesDialog.cpp
@@ -50,7 +50,7 @@
 #endif
 
 SetColValuesDialog::SetColValuesDialog(ScriptingEnv *env, Table *t,
-                                       Qt::WFlags fl)
+                                       const Qt::WFlags &fl)
     : QDialog(t, fl), Scripted(env) {
   setObjectName("SetColValuesDialog");
   setWindowTitle(tr("MantidPlot - Set column values"));
diff --git a/MantidPlot/src/SetColValuesDialog.h b/MantidPlot/src/SetColValuesDialog.h
index 9732f19ff59..65be95aec42 100644
--- a/MantidPlot/src/SetColValuesDialog.h
+++ b/MantidPlot/src/SetColValuesDialog.h
@@ -52,7 +52,8 @@ class SetColValuesDialog : public QDialog, public Scripted {
   Q_OBJECT
 
 public:
-  SetColValuesDialog(ScriptingEnv *env, Table *t, Qt::WFlags fl = nullptr);
+  SetColValuesDialog(ScriptingEnv *env, Table *t,
+                     const Qt::WFlags &fl = nullptr);
 
 private slots:
   bool apply();
diff --git a/MantidPlot/src/SmoothCurveDialog.cpp b/MantidPlot/src/SmoothCurveDialog.cpp
index 1881bb953b8..83d941b1166 100644
--- a/MantidPlot/src/SmoothCurveDialog.cpp
+++ b/MantidPlot/src/SmoothCurveDialog.cpp
@@ -42,7 +42,8 @@
 #include <QPushButton>
 #include <QSpinBox>
 
-SmoothCurveDialog::SmoothCurveDialog(int method, QWidget *parent, Qt::WFlags fl)
+SmoothCurveDialog::SmoothCurveDialog(int method, QWidget *parent,
+                                     const Qt::WFlags &fl)
     : QDialog(parent, fl), graph(nullptr), boxPointsLeft(nullptr),
       boxPointsRight(nullptr), boxOrder(nullptr) {
   smooth_method = method;
diff --git a/MantidPlot/src/SmoothCurveDialog.h b/MantidPlot/src/SmoothCurveDialog.h
index 644f417a1fa..e5e9048ce28 100644
--- a/MantidPlot/src/SmoothCurveDialog.h
+++ b/MantidPlot/src/SmoothCurveDialog.h
@@ -43,7 +43,7 @@ class SmoothCurveDialog : public QDialog {
 
 public:
   SmoothCurveDialog(int method, QWidget *parent = nullptr,
-                    Qt::WFlags fl = nullptr);
+                    const Qt::WFlags &fl = nullptr);
 
 public slots:
   void setGraph(Graph *g);
diff --git a/MantidPlot/src/SortDialog.cpp b/MantidPlot/src/SortDialog.cpp
index 4914069e850..8e422cbcc3d 100644
--- a/MantidPlot/src/SortDialog.cpp
+++ b/MantidPlot/src/SortDialog.cpp
@@ -36,7 +36,8 @@
 #include <QLayout>
 #include <QPushButton>
 
-SortDialog::SortDialog(QWidget *parent, Qt::WFlags fl) : QDialog(parent, fl) {
+SortDialog::SortDialog(QWidget *parent, const Qt::WFlags &fl)
+    : QDialog(parent, fl) {
   setWindowTitle(tr("MantidPlot - Sorting Options"));
   setSizeGripEnabled(true);
 
diff --git a/MantidPlot/src/SortDialog.h b/MantidPlot/src/SortDialog.h
index 42ce2a3e622..6773e9bb1fd 100644
--- a/MantidPlot/src/SortDialog.h
+++ b/MantidPlot/src/SortDialog.h
@@ -39,7 +39,7 @@ class SortDialog : public QDialog {
   Q_OBJECT
 
 public:
-  SortDialog(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  SortDialog(QWidget *parent = nullptr, const Qt::WFlags &fl = nullptr);
   void insertColumnsList(const QStringList &cols);
 
 private slots:
diff --git a/MantidPlot/src/Spectrogram.cpp b/MantidPlot/src/Spectrogram.cpp
index 3d60e8bc389..8c02a539d93 100644
--- a/MantidPlot/src/Spectrogram.cpp
+++ b/MantidPlot/src/Spectrogram.cpp
@@ -49,6 +49,7 @@
 #include "MantidQtWidgets/Common/TSVSerialiser.h"
 
 #include <numeric>
+#include <utility>
 
 Spectrogram::Spectrogram()
     : QObject(), QwtPlotSpectrogram(), d_color_map_pen(false),
@@ -694,7 +695,7 @@ void Spectrogram::loadSettings() {
  * This method saves the selectcolrmap file name to membervaraible
  */
 void Spectrogram::setColorMapFileName(QString colormapName) {
-  mCurrentColorMap = colormapName;
+  mCurrentColorMap = std::move(colormapName);
 }
 QwtDoubleRect Spectrogram::boundingRect() const {
   return d_matrix ? d_matrix->boundingRect() : data().boundingRect();
@@ -707,7 +708,7 @@ double Spectrogram::getMinPositiveValue() const {
 }
 
 void Spectrogram::setContourPenList(QList<QPen> lst) {
-  d_pen_list = lst;
+  d_pen_list = std::move(lst);
   setDefaultContourPen(Qt::NoPen);
   d_color_map_pen = false;
 }
diff --git a/MantidPlot/src/SurfaceDialog.cpp b/MantidPlot/src/SurfaceDialog.cpp
index dcbef03d769..812bde0ca58 100644
--- a/MantidPlot/src/SurfaceDialog.cpp
+++ b/MantidPlot/src/SurfaceDialog.cpp
@@ -34,7 +34,7 @@
 #include <QSpinBox>
 #include <QStackedWidget>
 
-SurfaceDialog::SurfaceDialog(QWidget *parent, Qt::WFlags fl)
+SurfaceDialog::SurfaceDialog(QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl) {
   setObjectName("SurfaceDialog");
   setWindowTitle(tr("MantidPlot - Define surface plot"));
diff --git a/MantidPlot/src/SurfaceDialog.h b/MantidPlot/src/SurfaceDialog.h
index f14ae164915..239a4ae7737 100644
--- a/MantidPlot/src/SurfaceDialog.h
+++ b/MantidPlot/src/SurfaceDialog.h
@@ -32,7 +32,7 @@ class SurfaceDialog : public QDialog {
   Q_OBJECT
 
 public:
-  SurfaceDialog(QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  SurfaceDialog(QWidget *parent = nullptr, const Qt::WFlags &fl = nullptr);
 
 public slots:
   void accept() override;
diff --git a/MantidPlot/src/Table.cpp b/MantidPlot/src/Table.cpp
index 77a64b210d3..606c439cc61 100644
--- a/MantidPlot/src/Table.cpp
+++ b/MantidPlot/src/Table.cpp
@@ -73,7 +73,7 @@ using namespace Mantid;
 using namespace MantidQt::API;
 
 Table::Table(ScriptingEnv *env, int rows, int cols, const QString &label,
-             QWidget *parent, const QString &name, Qt::WFlags f)
+             QWidget *parent, const QString &name, const Qt::WFlags &f)
     : MdiSubWindow(parent, label, name, f), Scripted(env) {
   selectedCol = -1;
   d_saved_cells = nullptr;
@@ -2002,7 +2002,7 @@ void Table::loadHeader(QStringList header) {
   setHeaderColType();
 }
 
-void Table::setHeader(QStringList header) {
+void Table::setHeader(const QStringList &header) {
   col_label = header;
   setHeaderColType();
 }
@@ -3267,7 +3267,7 @@ void Table::recordSelection() {
  * @param alignment :: [input] Alignment flags to give the cell
  */
 void Table::setTextAlignment(int row, int col,
-                             QFlags<Qt::AlignmentFlag> alignment) {
+                             const QFlags<Qt::AlignmentFlag> &alignment) {
   auto *cell = d_table->item(row, col);
   if (cell) {
     cell->setTextAlignment(alignment);
diff --git a/MantidPlot/src/Table.h b/MantidPlot/src/Table.h
index e81b3bc6795..434bb77f1c2 100644
--- a/MantidPlot/src/Table.h
+++ b/MantidPlot/src/Table.h
@@ -33,6 +33,9 @@
 
 #include <QTableWidget>
 #include <QVarLengthArray>
+#include <utility>
+
+#include <utility>
 
 #include "Graph.h"
 #include "MdiSubWindow.h"
@@ -116,7 +119,7 @@ public:
   };
 
   Table(ScriptingEnv *env, int r, int c, const QString &label, QWidget *parent,
-        const QString &name = QString(), Qt::WFlags f = nullptr);
+        const QString &name = QString(), const Qt::WFlags &f = nullptr);
 
   int topSelectedRow() const { return d_table->topSelectedRow(); }
   int bottomSelectedRow() const { return d_table->bottomSelectedRow(); }
@@ -160,13 +163,14 @@ public slots:
                                   bool rightColumns = false);
   QList<int> plotDesignations() { return col_plot_type; };
 
-  void setHeader(QStringList header);
+  void setHeader(const QStringList &header);
   void loadHeader(QStringList header);
   void setHeaderColType();
   void setText(int row, int col, const QString &text);
   void setRandomValues();
   void setAscValues();
-  void setTextAlignment(int row, int col, QFlags<Qt::AlignmentFlag> alignment);
+  void setTextAlignment(int row, int col,
+                        const QFlags<Qt::AlignmentFlag> &alignment);
 
   virtual void cellEdited(int, int col);
   void moveCurrentCell();
@@ -339,7 +343,7 @@ public slots:
   int columnType(int col) { return colTypes[col]; };
 
   QList<int> columnTypes() { return colTypes; };
-  void setColumnTypes(QList<int> ctl) { colTypes = ctl; };
+  void setColumnTypes(QList<int> ctl) { colTypes = std::move(std::move(ctl)); };
   void setColumnTypes(const QStringList &ctl);
   void setColumnType(int col, ColType val) { colTypes[col] = val; }
 
diff --git a/MantidPlot/src/TableDialog.cpp b/MantidPlot/src/TableDialog.cpp
index 546de53ec27..b7a10b34342 100644
--- a/MantidPlot/src/TableDialog.cpp
+++ b/MantidPlot/src/TableDialog.cpp
@@ -45,7 +45,8 @@
 #include <QSpinBox>
 #include <QTextEdit>
 
-TableDialog::TableDialog(Table *t, Qt::WFlags fl) : QDialog(t, fl), d_table(t) {
+TableDialog::TableDialog(Table *t, const Qt::WFlags &fl)
+    : QDialog(t, fl), d_table(t) {
   setObjectName("TableDialog");
   setWindowTitle(tr("MantidPlot - Column options"));
   setSizeGripEnabled(true);
diff --git a/MantidPlot/src/TableDialog.h b/MantidPlot/src/TableDialog.h
index 0ddef50ab45..5fc8b09dcc8 100644
--- a/MantidPlot/src/TableDialog.h
+++ b/MantidPlot/src/TableDialog.h
@@ -44,7 +44,7 @@ class TableDialog : public QDialog {
   Q_OBJECT
 
 public:
-  TableDialog(Table *t, Qt::WFlags fl = nullptr);
+  TableDialog(Table *t, const Qt::WFlags &fl = nullptr);
 
 private slots:
   void prevColumn();
diff --git a/MantidPlot/src/TableStatistics.cpp b/MantidPlot/src/TableStatistics.cpp
index 98e09f7a1b0..fc6bbb93f3e 100644
--- a/MantidPlot/src/TableStatistics.cpp
+++ b/MantidPlot/src/TableStatistics.cpp
@@ -47,7 +47,7 @@ DECLARE_WINDOW(TableStatistics)
 using namespace Mantid;
 
 TableStatistics::TableStatistics(ScriptingEnv *env, QWidget *parent,
-                                 Table *base, Type t, QList<int> targets)
+                                 Table *base, Type t, const QList<int> &targets)
     : Table(env, 1, 1, "", parent, ""), d_base(base), d_type(t),
       d_targets(targets) {
 
diff --git a/MantidPlot/src/TableStatistics.h b/MantidPlot/src/TableStatistics.h
index 0877b0e7be6..f489cc3db1f 100644
--- a/MantidPlot/src/TableStatistics.h
+++ b/MantidPlot/src/TableStatistics.h
@@ -43,7 +43,7 @@ public:
   //! supported statistics types
   enum Type { row, column };
   TableStatistics(ScriptingEnv *env, QWidget *parent, Table *base, Type,
-                  QList<int> targets);
+                  const QList<int> &targets);
   //! return the type of statistics
   Type type() const { return d_type; }
   //! return the base table of which statistics are displayed
diff --git a/MantidPlot/src/TextDialog.cpp b/MantidPlot/src/TextDialog.cpp
index 62a2da5fb0e..255bf8398db 100644
--- a/MantidPlot/src/TextDialog.cpp
+++ b/MantidPlot/src/TextDialog.cpp
@@ -47,7 +47,7 @@
 
 #include <qwt_scale_widget.h>
 
-TextDialog::TextDialog(TextType type, QWidget *parent, Qt::WFlags fl)
+TextDialog::TextDialog(TextType type, QWidget *parent, const Qt::WFlags &fl)
     : QDialog(parent, fl) {
   setAttribute(Qt::WA_DeleteOnClose);
   setWindowTitle(tr("MantidPlot - Text options"));
diff --git a/MantidPlot/src/TextDialog.h b/MantidPlot/src/TextDialog.h
index 28b7fecf68e..59bbbd53dd3 100644
--- a/MantidPlot/src/TextDialog.h
+++ b/MantidPlot/src/TextDialog.h
@@ -62,7 +62,8 @@ public:
    * @param parent :: parent widget
    * @param fl :: window flags
    */
-  TextDialog(TextType type, QWidget *parent = nullptr, Qt::WFlags fl = nullptr);
+  TextDialog(TextType type, QWidget *parent = nullptr,
+             const Qt::WFlags &fl = nullptr);
 
   //! Return axis label alignment
   /**
diff --git a/MantidPlot/src/TextFileIO.cpp b/MantidPlot/src/TextFileIO.cpp
index 64df4906e6a..3e0085c4f12 100644
--- a/MantidPlot/src/TextFileIO.cpp
+++ b/MantidPlot/src/TextFileIO.cpp
@@ -16,7 +16,8 @@
 /**
  * Construct an object with a list of file filters
  */
-TextFileIO::TextFileIO(QStringList fileFilters) : m_filters(fileFilters) {}
+TextFileIO::TextFileIO(const QStringList &fileFilters)
+    : m_filters(fileFilters) {}
 
 /**
  * Save to a file
diff --git a/MantidPlot/src/TextFileIO.h b/MantidPlot/src/TextFileIO.h
index edb217ce5e6..1c4b36c6beb 100644
--- a/MantidPlot/src/TextFileIO.h
+++ b/MantidPlot/src/TextFileIO.h
@@ -16,7 +16,7 @@
 class TextFileIO {
 public:
   /// Construct the object with a list of file filters
-  explicit TextFileIO(QStringList fileFilters = QStringList());
+  explicit TextFileIO(const QStringList &fileFilters = QStringList());
 
   /// Save to a file
   bool save(const QString &txt, const QString &filename) const;
diff --git a/MantidPlot/src/TiledWindow.cpp b/MantidPlot/src/TiledWindow.cpp
index 1661270ade1..46925af3808 100644
--- a/MantidPlot/src/TiledWindow.cpp
+++ b/MantidPlot/src/TiledWindow.cpp
@@ -215,7 +215,7 @@ InnerWidget *getInnerWidget(QWidget *w) {
  */
 TiledWindow::TiledWindow(QWidget *parent, const QString &label,
                          const QString &name, int nrows, int ncols,
-                         Qt::WFlags f)
+                         const Qt::WFlags &f)
     : MdiSubWindow(parent, label, name, f), m_scrollArea(nullptr),
       m_layout(nullptr), m_buttonPressed(false) {
   connect(this, SIGNAL(dropAtPositionQueued(MdiSubWindow *, QPoint, bool)),
diff --git a/MantidPlot/src/TiledWindow.h b/MantidPlot/src/TiledWindow.h
index d4ce70a50d8..49df22a9e90 100644
--- a/MantidPlot/src/TiledWindow.h
+++ b/MantidPlot/src/TiledWindow.h
@@ -30,7 +30,7 @@ class TiledWindow : public MdiSubWindow {
 public:
   TiledWindow(QWidget *parent, const QString &label,
               const QString &name = QString(), int nrows = 1, int ncols = 1,
-              Qt::WFlags f = nullptr);
+              const Qt::WFlags &f = nullptr);
 
   /// Populate a menu with actions
   void populateMenu(QMenu *menu);
diff --git a/MantidPlot/src/lib/include/ExtensibleFileDialog.h b/MantidPlot/src/lib/include/ExtensibleFileDialog.h
index 0dcea4e15f3..6162c67f713 100644
--- a/MantidPlot/src/lib/include/ExtensibleFileDialog.h
+++ b/MantidPlot/src/lib/include/ExtensibleFileDialog.h
@@ -54,9 +54,10 @@ public:
    * \param extended flag: show/hide the advanced options on start-up
    * \param flags window flags
    */
-  ExtensibleFileDialog(QWidget *parent = nullptr, bool extended = true,
-                       Qt::WFlags flags = Qt::WindowCloseButtonHint |
-                                          Qt::WindowType::WindowTitleHint);
+  ExtensibleFileDialog(
+      QWidget *parent = nullptr, bool extended = true,
+      const Qt::WFlags &flags = Qt::WindowCloseButtonHint |
+                                Qt::WindowType::WindowTitleHint);
   //! Set the extension widget to be displayed when the user presses the toggle
   // button.
   void setExtensionWidget(QWidget *extension);
diff --git a/MantidPlot/src/lib/include/SymbolDialog.h b/MantidPlot/src/lib/include/SymbolDialog.h
index 659cc9c3095..e8aaf0f03a1 100644
--- a/MantidPlot/src/lib/include/SymbolDialog.h
+++ b/MantidPlot/src/lib/include/SymbolDialog.h
@@ -62,7 +62,7 @@ public:
    * \param fl window flags
    */
   SymbolDialog(CharSet charSet, QWidget *parent = nullptr,
-               Qt::WFlags fl = nullptr);
+               const Qt::WFlags &fl = nullptr);
 
 private:
   //! Show lowercase Greek characters
diff --git a/MantidPlot/src/lib/src/ExtensibleFileDialog.cpp b/MantidPlot/src/lib/src/ExtensibleFileDialog.cpp
index 71a0cecd62f..4a189d27500 100644
--- a/MantidPlot/src/lib/src/ExtensibleFileDialog.cpp
+++ b/MantidPlot/src/lib/src/ExtensibleFileDialog.cpp
@@ -35,7 +35,7 @@
 #include <QUrl>
 
 ExtensibleFileDialog::ExtensibleFileDialog(QWidget *parent, bool extended,
-                                           Qt::WFlags flags)
+                                           const Qt::WFlags &flags)
     : QFileDialog(parent, flags) {
   d_extension = nullptr;
   d_extension_row = 0;
diff --git a/MantidPlot/src/lib/src/SymbolDialog.cpp b/MantidPlot/src/lib/src/SymbolDialog.cpp
index 812744badd6..3029e085474 100644
--- a/MantidPlot/src/lib/src/SymbolDialog.cpp
+++ b/MantidPlot/src/lib/src/SymbolDialog.cpp
@@ -38,7 +38,8 @@
 #include <QSizePolicy>
 #include <QTextCodec>
 
-SymbolDialog::SymbolDialog(CharSet charSet, QWidget *parent, Qt::WFlags fl)
+SymbolDialog::SymbolDialog(CharSet charSet, QWidget *parent,
+                           const Qt::WFlags &fl)
     : QDialog(parent, fl) {
   setAttribute(Qt::WA_DeleteOnClose);
   setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
diff --git a/MantidPlot/src/origin/OPJFile.h b/MantidPlot/src/origin/OPJFile.h
index 7bbecb120a7..61aa4550ec6 100644
--- a/MantidPlot/src/origin/OPJFile.h
+++ b/MantidPlot/src/origin/OPJFile.h
@@ -37,6 +37,8 @@
 
 #include "tree.hh"
 #include <string>
+#include <utility>
+
 #include <vector>
 
 struct rect {
@@ -67,8 +69,8 @@ struct originWindow {
 
   originWindow(std::string _name = "", std::string _label = "",
                bool _bHidden = false)
-      : name(_name), label(_label), objectID(0), bHidden(_bHidden),
-        state(Normal), title(Both), creation_date(0.0),
+      : name(std::move(_name)), label(std::move(_label)), objectID(0),
+        bHidden(_bHidden), state(Normal), title(Both), creation_date(0.0),
         modification_date(0.0){};
 };
 struct originData {
@@ -97,9 +99,10 @@ struct spreadColumn {
   int index;
   std::vector<originData> odata;
   spreadColumn(std::string _name = "", int _index = 0)
-      : name(_name), type(NONE), value_type(0), value_type_specification(0),
-        significant_digits(6), decimal_places(6), numeric_display_type(0),
-        command(""), comment(""), width(8), index(_index){};
+      : name(std::move(_name)), type(NONE), value_type(0),
+        value_type_specification(0), significant_digits(6), decimal_places(6),
+        numeric_display_type(0), command(""), comment(""), width(8),
+        index(_index){};
 };
 
 struct spreadSheet : public originWindow {
@@ -108,8 +111,8 @@ struct spreadSheet : public originWindow {
   bool bMultisheet;
   std::vector<spreadColumn> column;
   spreadSheet(std::string _name = "")
-      : originWindow(_name), maxRows(0), bLoose(true), bMultisheet(false),
-        column(){};
+      : originWindow(std::move(_name)), maxRows(0), bLoose(true),
+        bMultisheet(false), column(){};
 };
 
 struct excel : public originWindow {
@@ -118,8 +121,8 @@ struct excel : public originWindow {
   std::vector<spreadSheet> sheet;
   excel(std::string _name = "", std::string _label = "", int _maxRows = 0,
         bool _bHidden = false, bool _bLoose = true)
-      : originWindow(_name, _label, _bHidden), maxRows(_maxRows),
-        bLoose(_bLoose){};
+      : originWindow(std::move(_name), std::move(_label), _bHidden),
+        maxRows(_maxRows), bLoose(_bLoose){};
 };
 
 struct matrix : public originWindow {
@@ -139,7 +142,7 @@ struct matrix : public originWindow {
   HeaderViewType header;
   std::vector<double> data;
   matrix(std::string _name = "", int _index = 0)
-      : originWindow(_name), nr_rows(0), nr_cols(0),
+      : originWindow(std::move(_name)), nr_rows(0), nr_cols(0),
         value_type_specification(0), significant_digits(6), decimal_places(6),
         numeric_display_type(0), command(""), width(8), index(_index),
         view(DataView), header(ColumnRow){};
@@ -154,8 +157,8 @@ struct function {
   int points;
   int index;
   function(std::string _name = "", int _index = 0)
-      : name(_name), type(0), formula(""), begin(0.0), end(0.0), points(0),
-        index(_index){};
+      : name(std::move(_name)), type(0), formula(""), begin(0.0), end(0.0),
+        points(0), index(_index){};
 };
 
 struct text {
@@ -414,12 +417,13 @@ struct graph : public originWindow {
   unsigned short width;
   unsigned short height;
 
-  graph(std::string _name = "") : originWindow(_name), width(0), height(0){};
+  graph(std::string _name = "")
+      : originWindow(std::move(_name)), width(0), height(0){};
 };
 
 struct note : public originWindow {
   std::string text;
-  note(std::string _name = "") : originWindow(_name){};
+  note(std::string _name = "") : originWindow(std::move(_name)){};
 };
 
 struct projectNode {
@@ -430,7 +434,7 @@ struct projectNode {
 
   projectNode(std::string _name = "", int _type = 0,
               double _creation_date = 0.0, double _modification_date = 0.0)
-      : type(_type), name(_name), creation_date(_creation_date),
+      : type(_type), name(std::move(_name)), creation_date(_creation_date),
         modification_date(_modification_date){};
 };
 
diff --git a/buildconfig/CMake/CppCheck_Suppressions.txt.in b/buildconfig/CMake/CppCheck_Suppressions.txt.in
index 39acb57ee21..9f17522e55d 100644
--- a/buildconfig/CMake/CppCheck_Suppressions.txt.in
+++ b/buildconfig/CMake/CppCheck_Suppressions.txt.in
@@ -3,3 +3,6 @@
 //      as different build servers have different starts to the file path
 // Example:
 // memsetClassFloat:/Users/builder/Jenkins/workspace/cppcheck-1.72/
+
+// Hide warnings about using explicit keyword constructors as we have "too many"
+noExplicitConstructor
\ No newline at end of file
diff --git a/qt/icons/inc/MantidQtIcons/CharIconEngine.h b/qt/icons/inc/MantidQtIcons/CharIconEngine.h
index efd7962da46..9002cae11d9 100644
--- a/qt/icons/inc/MantidQtIcons/CharIconEngine.h
+++ b/qt/icons/inc/MantidQtIcons/CharIconEngine.h
@@ -35,7 +35,7 @@ class CharIconPainter;
 class EXPORT_OPT_MANTIDQT_ICONS CharIconEngine : public QIconEngine {
 public:
   CharIconEngine(IconicFont *iconic, CharIconPainter *painter,
-                 QList<QHash<QString, QVariant>> options);
+                 const QList<QHash<QString, QVariant>> &options);
   void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode,
              QIcon::State state) override;
   QPixmap pixmap(const QSize &size, QIcon::Mode mode,
diff --git a/qt/icons/src/CharIconEngine.cpp b/qt/icons/src/CharIconEngine.cpp
index adbd38b437a..40fa6670bfd 100644
--- a/qt/icons/src/CharIconEngine.cpp
+++ b/qt/icons/src/CharIconEngine.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidQtIcons/CharIconEngine.h"
 #include "MantidQtIcons/CharIconPainter.h"
 
@@ -11,8 +13,8 @@ namespace MantidQt {
 namespace Icons {
 
 CharIconEngine::CharIconEngine(IconicFont *iconic, CharIconPainter *painter,
-                               QList<QHash<QString, QVariant>> options)
-    : m_iconic(iconic), m_painter(painter), m_options(options) {}
+                               const QList<QHash<QString, QVariant>> &options)
+    : m_iconic(iconic), m_painter(painter), m_options(std::move(options)) {}
 
 void CharIconEngine::paint(QPainter *painter, const QRect &rect,
                            QIcon::Mode mode, QIcon::State state) {
diff --git a/qt/icons/src/Icon.cpp b/qt/icons/src/Icon.cpp
index 1ef2f925b68..0bc0293ad12 100644
--- a/qt/icons/src/Icon.cpp
+++ b/qt/icons/src/Icon.cpp
@@ -31,7 +31,7 @@ MantidQt::Icons::IconicFont &iconFontInstance() {
 // https://stackoverflow.com/questions/4169988/easiest-way-to-parse-json-in-qt-4-7
 // specifically in the answer by user2243820 on April 4th 2013 at 8:10
 
-QHash<QString, QVariant> decodeInner(QScriptValue object) {
+QHash<QString, QVariant> decodeInner(const QScriptValue &object) {
   QHash<QString, QVariant> map;
   QScriptValueIterator it(object);
   while (it.hasNext()) {
diff --git a/qt/scientific_interfaces/Direct/ALFCustomInstrumentView.cpp b/qt/scientific_interfaces/Direct/ALFCustomInstrumentView.cpp
index 5481fdba619..916da826070 100644
--- a/qt/scientific_interfaces/Direct/ALFCustomInstrumentView.cpp
+++ b/qt/scientific_interfaces/Direct/ALFCustomInstrumentView.cpp
@@ -11,6 +11,7 @@
 #include <QSizePolicy>
 #include <QSpacerItem>
 #include <QVBoxLayout>
+#include <utility>
 
 namespace MantidQt {
 namespace CustomInterfaces {
@@ -90,8 +91,8 @@ void ALFCustomInstrumentView::setupAnalysisPane(
   BaseCustomInstrumentView::setupInstrumentAnalysisSplitters(analysis);
 }
 
-void ALFCustomInstrumentView::addSpectrum(std::string wsName) {
-  m_analysisPane->addSpectrum(wsName);
+void ALFCustomInstrumentView::addSpectrum(const std::string &wsName) {
+  m_analysisPane->addSpectrum(std::move(wsName));
 }
 
 } // namespace CustomInterfaces
diff --git a/qt/scientific_interfaces/Direct/ALFCustomInstrumentView.h b/qt/scientific_interfaces/Direct/ALFCustomInstrumentView.h
index 99d71e6ef74..5eec9fbc802 100644
--- a/qt/scientific_interfaces/Direct/ALFCustomInstrumentView.h
+++ b/qt/scientific_interfaces/Direct/ALFCustomInstrumentView.h
@@ -35,7 +35,7 @@ public:
                       &binders) override;
 
   void addObserver(std::tuple<std::string, Observer *> &listener) override;
-  void addSpectrum(std::string wsName);
+  void addSpectrum(const std::string &wsName);
   void setupAnalysisPane(MantidWidgets::PlotFitAnalysisPaneView *analysis);
 
 public slots:
diff --git a/qt/scientific_interfaces/DynamicPDF/DPDFFitControl.cpp b/qt/scientific_interfaces/DynamicPDF/DPDFFitControl.cpp
index b381d9a24b9..6a49d01388e 100644
--- a/qt/scientific_interfaces/DynamicPDF/DPDFFitControl.cpp
+++ b/qt/scientific_interfaces/DynamicPDF/DPDFFitControl.cpp
@@ -23,6 +23,7 @@
 #include <QPushButton>
 #include <QSettings>
 #include <QSignalMapper>
+#include <utility>
 
 namespace {
 Mantid::Kernel::Logger g_log("DynamicPDF");
@@ -312,7 +313,7 @@ void FitControl::fitIndividual(const bool &isEvaluation) {
  * @param fun A function from which to retrieve the parameters
  */
 void FitControl::updateFunctionBrowser(Mantid::API::IFunction_sptr fun) {
-  m_functionBrowser->setFunction(fun);
+  m_functionBrowser->setFunction(std::move(fun));
 }
 
 /*
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingModel.cpp b/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingModel.cpp
new file mode 100644
index 00000000000..24e3c22e00b
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingModel.cpp
@@ -0,0 +1,609 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "EnggDiffFittingModel.h"
+
+#include "MantidAPI/AlgorithmManager.h"
+#include "MantidAPI/AnalysisDataService.h"
+#include "MantidAPI/ITableWorkspace_fwd.h"
+#include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/TableRow.h"
+#include "MantidAPI/WorkspaceFactory.h"
+#include "MantidAPI/WorkspaceGroup.h"
+#include "MantidKernel/PropertyWithValue.h"
+
+#include <algorithm>
+#include <numeric>
+
+using namespace Mantid;
+
+namespace { // helpers
+
+bool isDigit(const std::string &text) {
+  return std::all_of(text.cbegin(), text.cend(), ::isdigit);
+}
+
+} // anonymous namespace
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+void EnggDiffFittingModel::addFocusedWorkspace(
+    const RunLabel &runLabel, const API::MatrixWorkspace_sptr &ws,
+    const std::string &filename) {
+  m_focusedWorkspaceMap.add(runLabel, ws);
+  m_wsFilenameMap.add(runLabel, filename);
+}
+
+void EnggDiffFittingModel::addFitResults(
+    const RunLabel &runLabel, const Mantid::API::ITableWorkspace_sptr &ws) {
+  m_fitParamsMap.add(runLabel, ws);
+}
+
+const std::string &
+EnggDiffFittingModel::getWorkspaceFilename(const RunLabel &runLabel) const {
+  return m_wsFilenameMap.get(runLabel);
+}
+
+Mantid::API::ITableWorkspace_sptr
+EnggDiffFittingModel::getFitResults(const RunLabel &runLabel) const {
+  return m_fitParamsMap.get(runLabel);
+}
+
+namespace {
+
+template <size_t S, typename T>
+void removeFromRunMapAndADS(const RunLabel &runLabel, RunMap<S, T> &map,
+                            Mantid::API::AnalysisDataServiceImpl &ADS) {
+  if (map.contains(runLabel)) {
+    const auto &name = map.get(runLabel)->getName();
+    if (ADS.doesExist(name)) {
+      ADS.remove(name);
+    }
+    map.remove(runLabel);
+  }
+}
+
+} // anonymous namespace
+
+void EnggDiffFittingModel::removeRun(const RunLabel &runLabel) {
+  m_wsFilenameMap.remove(runLabel);
+
+  auto &ADS = Mantid::API::AnalysisDataService::Instance();
+  removeFromRunMapAndADS(runLabel, m_focusedWorkspaceMap, ADS);
+  removeFromRunMapAndADS(runLabel, m_fittedPeaksMap, ADS);
+  removeFromRunMapAndADS(runLabel, m_alignedWorkspaceMap, ADS);
+  removeFromRunMapAndADS(runLabel, m_fitParamsMap, ADS);
+}
+
+void EnggDiffFittingModel::setDifcTzero(
+    const RunLabel &runLabel,
+    const std::vector<GSASCalibrationParms> &calibParams) {
+  auto ws = getFocusedWorkspace(runLabel);
+  auto &run = ws->mutableRun();
+  const std::string units = "none";
+
+  if (calibParams.empty()) {
+    run.addProperty<double>("difc", DEFAULT_DIFC, units, true);
+    run.addProperty<double>("difa", DEFAULT_DIFA, units, true);
+    run.addProperty<double>("tzero", DEFAULT_TZERO, units, true);
+  } else {
+    GSASCalibrationParms params(0, 0.0, 0.0, 0.0);
+    const auto found = std::find_if(calibParams.cbegin(), calibParams.cend(),
+                                    [&runLabel](const auto &paramSet) {
+                                      return paramSet.bankid == runLabel.bank;
+                                    });
+    if (found != calibParams.cend()) {
+      params = *found;
+    }
+    if (params.difc == 0) {
+      params = calibParams.front();
+    }
+
+    run.addProperty<double>("difc", params.difc, units, true);
+    run.addProperty<double>("difa", params.difa, units, false);
+    run.addProperty<double>("tzero", params.tzero, units, false);
+  }
+}
+
+void EnggDiffFittingModel::enggFitPeaks(const RunLabel &runLabel,
+                                        const std::string &expectedPeaks) {
+  const auto ws = getFocusedWorkspace(runLabel);
+  auto enggFitPeaksAlg =
+      Mantid::API::AlgorithmManager::Instance().create("EnggFitPeaks");
+
+  enggFitPeaksAlg->initialize();
+  enggFitPeaksAlg->setProperty("InputWorkspace", ws);
+  if (!expectedPeaks.empty()) {
+    enggFitPeaksAlg->setProperty("ExpectedPeaks", expectedPeaks);
+  }
+  enggFitPeaksAlg->setProperty("FittedPeaks", FIT_RESULTS_TABLE_NAME);
+  enggFitPeaksAlg->execute();
+
+  API::AnalysisDataServiceImpl &ADS = API::AnalysisDataService::Instance();
+  const auto fitResultsTable =
+      ADS.retrieveWS<API::ITableWorkspace>(FIT_RESULTS_TABLE_NAME);
+  addFitResults(runLabel, fitResultsTable);
+}
+
+void EnggDiffFittingModel::saveFitResultsToHDF5(
+    const std::vector<RunLabel> &runLabels, const std::string &filename) const {
+  std::vector<std::string> inputWorkspaces;
+  inputWorkspaces.reserve(runLabels.size());
+  std::vector<std::string> runNumbers;
+  runNumbers.reserve(runLabels.size());
+  std::vector<long> bankIDs;
+  bankIDs.reserve(runLabels.size());
+
+  for (const auto &runLabel : runLabels) {
+    const auto ws = getFitResults(runLabel);
+    const auto clonedWSName = "enggggui_fit_params_" + runLabel.runNumber +
+                              "_" + std::to_string(runLabel.bank);
+    cloneWorkspace(ws, clonedWSName);
+    inputWorkspaces.emplace_back(clonedWSName);
+    runNumbers.emplace_back(runLabel.runNumber);
+    bankIDs.emplace_back(static_cast<long>(runLabel.bank));
+  }
+
+  auto saveAlg = Mantid::API::AlgorithmManager::Instance().create(
+      "EnggSaveSinglePeakFitResultsToHDF5");
+  saveAlg->initialize();
+  saveAlg->setProperty("InputWorkspaces", inputWorkspaces);
+  saveAlg->setProperty("RunNumbers", runNumbers);
+  saveAlg->setProperty("BankIDs", bankIDs);
+  saveAlg->setProperty("Filename", filename);
+  saveAlg->execute();
+
+  auto &ADS = API::AnalysisDataService::Instance();
+  for (const auto &wsName : inputWorkspaces) {
+    ADS.remove(wsName);
+  }
+}
+
+void EnggDiffFittingModel::createFittedPeaksWS(const RunLabel &runLabel) {
+  const auto fitFunctionParams = getFitResults(runLabel);
+  const auto focusedWS = getFocusedWorkspace(runLabel);
+
+  const size_t numberOfPeaks = fitFunctionParams->rowCount();
+
+  for (size_t i = 0; i < numberOfPeaks; ++i) {
+    const auto functionDescription = createFunctionString(fitFunctionParams, i);
+    double startX, endX;
+    std::tie(startX, endX) = getStartAndEndXFromFitParams(fitFunctionParams, i);
+
+    const std::string singlePeakWSName =
+        "__engggui_fitting_single_peak_" + std::to_string(i);
+
+    evaluateFunction(functionDescription, focusedWS, singlePeakWSName, startX,
+                     endX);
+
+    cropWorkspace(singlePeakWSName, singlePeakWSName, 1, 1);
+
+    rebinToFocusedWorkspace(singlePeakWSName, runLabel, singlePeakWSName);
+
+    if (i == 0) {
+      cloneWorkspace(focusedWS, FITTED_PEAKS_WS_NAME);
+      setDataToClonedWS(singlePeakWSName, FITTED_PEAKS_WS_NAME);
+    } else {
+      const std::string clonedWSName =
+          "__engggui_cloned_peaks_" + std::to_string(i);
+      cloneWorkspace(focusedWS, clonedWSName);
+      setDataToClonedWS(singlePeakWSName, clonedWSName);
+
+      appendSpectra(FITTED_PEAKS_WS_NAME, clonedWSName);
+    }
+  }
+
+  const std::string alignedWSName = FOCUSED_WS_NAME + "_d";
+  cloneWorkspace(focusedWS, alignedWSName);
+  alignDetectors(alignedWSName, alignedWSName);
+
+  alignDetectors(FITTED_PEAKS_WS_NAME, FITTED_PEAKS_WS_NAME);
+
+  const auto &ADS = Mantid::API::AnalysisDataService::Instance();
+
+  const auto fittedPeaksWS =
+      ADS.retrieveWS<Mantid::API::MatrixWorkspace>(FITTED_PEAKS_WS_NAME);
+  m_fittedPeaksMap.add(runLabel, fittedPeaksWS);
+
+  const auto alignedFocusedWS =
+      ADS.retrieveWS<Mantid::API::MatrixWorkspace>(alignedWSName);
+  m_alignedWorkspaceMap.add(runLabel, alignedFocusedWS);
+}
+
+size_t EnggDiffFittingModel::getNumFocusedWorkspaces() const {
+  return m_focusedWorkspaceMap.size();
+}
+
+bool EnggDiffFittingModel::hasFittedPeaksForRun(
+    const RunLabel &runLabel) const {
+  return m_fittedPeaksMap.contains(runLabel);
+}
+
+Mantid::API::MatrixWorkspace_sptr
+EnggDiffFittingModel::getAlignedWorkspace(const RunLabel &runLabel) const {
+  return m_alignedWorkspaceMap.get(runLabel);
+}
+
+Mantid::API::MatrixWorkspace_sptr
+EnggDiffFittingModel::getFittedPeaksWS(const RunLabel &runLabel) const {
+  return m_fittedPeaksMap.get(runLabel);
+}
+
+void EnggDiffFittingModel::evaluateFunction(
+    const std::string &function,
+    const Mantid::API::MatrixWorkspace_sptr &inputWS,
+    const std::string &outputWSName, const double startX, const double endX) {
+
+  auto evalFunctionAlg =
+      Mantid::API::AlgorithmManager::Instance().create("EvaluateFunction");
+  evalFunctionAlg->initialize();
+  evalFunctionAlg->setProperty("Function", function);
+  evalFunctionAlg->setProperty("InputWorkspace", inputWS);
+  evalFunctionAlg->setProperty("OutputWorkspace", outputWSName);
+  evalFunctionAlg->setProperty("StartX", startX);
+  evalFunctionAlg->setProperty("EndX", endX);
+  evalFunctionAlg->execute();
+}
+
+void EnggDiffFittingModel::cropWorkspace(const std::string &inputWSName,
+                                         const std::string &outputWSName,
+                                         const int startWSIndex,
+                                         const int endWSIndex) {
+  auto cropWSAlg =
+      Mantid::API::AlgorithmManager::Instance().create("CropWorkspace");
+  cropWSAlg->initialize();
+  cropWSAlg->setProperty("InputWorkspace", inputWSName);
+  cropWSAlg->setProperty("OutputWorkspace", outputWSName);
+  cropWSAlg->setProperty("StartWorkspaceIndex", startWSIndex);
+  cropWSAlg->setProperty("EndWorkspaceIndex", endWSIndex);
+  cropWSAlg->execute();
+}
+
+void EnggDiffFittingModel::rebinToFocusedWorkspace(
+    const std::string &wsToRebinName, const RunLabel &runLabelToMatch,
+    const std::string &outputWSName) {
+  auto rebinToWSAlg =
+      Mantid::API::AlgorithmManager::Instance().create("RebinToWorkspace");
+
+  rebinToWSAlg->initialize();
+  rebinToWSAlg->setProperty("WorkspaceToRebin", wsToRebinName);
+
+  const auto wsToMatch = getFocusedWorkspace(runLabelToMatch);
+  rebinToWSAlg->setProperty("WorkspaceToMatch", wsToMatch);
+  rebinToWSAlg->setProperty("OutputWorkspace", outputWSName);
+  rebinToWSAlg->execute();
+}
+
+void EnggDiffFittingModel::cloneWorkspace(
+    const Mantid::API::MatrixWorkspace_sptr &inputWorkspace,
+    const std::string &outputWSName) const {
+  auto cloneWSAlg =
+      Mantid::API::AlgorithmManager::Instance().create("CloneWorkspace");
+  cloneWSAlg->initialize();
+  cloneWSAlg->setProperty("InputWorkspace", inputWorkspace);
+  cloneWSAlg->setProperty("OutputWorkspace", outputWSName);
+  cloneWSAlg->execute();
+}
+
+void EnggDiffFittingModel::cloneWorkspace(
+    const Mantid::API::ITableWorkspace_sptr &inputWorkspace,
+    const std::string &outputWSName) const {
+  auto cloneWSAlg =
+      Mantid::API::AlgorithmManager::Instance().create("CloneWorkspace");
+  cloneWSAlg->initialize();
+  cloneWSAlg->setProperty("InputWorkspace", inputWorkspace);
+  cloneWSAlg->setProperty("OutputWorkspace", outputWSName);
+  cloneWSAlg->execute();
+}
+
+void EnggDiffFittingModel::setDataToClonedWS(const std::string &wsToCopyName,
+                                             const std::string &targetWSName) {
+  auto &ADS = Mantid::API::AnalysisDataService::Instance();
+  auto wsToCopy = ADS.retrieveWS<Mantid::API::MatrixWorkspace>(wsToCopyName);
+  auto currentClonedWS =
+      ADS.retrieveWS<Mantid::API::MatrixWorkspace>(targetWSName);
+  currentClonedWS->mutableY(0) = wsToCopy->y(0);
+  currentClonedWS->mutableE(0) = wsToCopy->e(0);
+}
+
+void EnggDiffFittingModel::appendSpectra(const std::string &ws1Name,
+                                         const std::string &ws2Name) const {
+  auto appendSpectraAlg =
+      Mantid::API::AlgorithmManager::Instance().create("AppendSpectra");
+
+  appendSpectraAlg->initialize();
+  appendSpectraAlg->setProperty("InputWorkspace1", ws1Name);
+  appendSpectraAlg->setProperty("InputWorkspace2", ws2Name);
+  appendSpectraAlg->setProperty("OutputWorkspace", ws1Name);
+  appendSpectraAlg->execute();
+}
+
+std::tuple<double, double, double> EnggDiffFittingModel::getDifcDifaTzero(
+    const Mantid::API::MatrixWorkspace_const_sptr &ws) {
+  const auto run = ws->run();
+
+  const auto difc = run.getPropertyValueAsType<double>("difc");
+  const auto difa = run.getPropertyValueAsType<double>("difa");
+  const auto tzero = run.getPropertyValueAsType<double>("tzero");
+
+  return std::tuple<double, double, double>(difc, difa, tzero);
+}
+
+Mantid::API::ITableWorkspace_sptr
+EnggDiffFittingModel::createCalibrationParamsTable(
+    const Mantid::API::MatrixWorkspace_const_sptr &inputWS) {
+  double difc, difa, tzero;
+  std::tie(difc, difa, tzero) = getDifcDifaTzero(inputWS);
+
+  auto calibrationParamsTable =
+      Mantid::API::WorkspaceFactory::Instance().createTable();
+
+  calibrationParamsTable->addColumn("int", "detid");
+  calibrationParamsTable->addColumn("double", "difc");
+  calibrationParamsTable->addColumn("double", "difa");
+  calibrationParamsTable->addColumn("double", "tzero");
+
+  Mantid::API::TableRow row = calibrationParamsTable->appendRow();
+  const auto &spectrum = inputWS->getSpectrum(0);
+
+  Mantid::detid_t detID = *(spectrum.getDetectorIDs().cbegin());
+  row << detID << difc << difa << tzero;
+  return calibrationParamsTable;
+}
+
+void EnggDiffFittingModel::convertFromDistribution(
+    const Mantid::API::MatrixWorkspace_sptr &inputWS) {
+  auto convertFromDistAlg = Mantid::API::AlgorithmManager::Instance().create(
+      "ConvertFromDistribution");
+  convertFromDistAlg->initialize();
+  convertFromDistAlg->setProperty("Workspace", inputWS);
+  convertFromDistAlg->execute();
+}
+
+void EnggDiffFittingModel::alignDetectors(const std::string &inputWSName,
+                                          const std::string &outputWSName) {
+  const auto &ADS = Mantid::API::AnalysisDataService::Instance();
+  const auto inputWS =
+      ADS.retrieveWS<Mantid::API::MatrixWorkspace>(inputWSName);
+  alignDetectors(inputWS, outputWSName);
+}
+
+void EnggDiffFittingModel::alignDetectors(
+    const Mantid::API::MatrixWorkspace_sptr &inputWS,
+    const std::string &outputWSName) {
+  const auto calibrationParamsTable = createCalibrationParamsTable(inputWS);
+
+  if (inputWS->isDistribution()) {
+    convertFromDistribution(inputWS);
+  }
+
+  auto alignDetAlg =
+      Mantid::API::AlgorithmManager::Instance().create("AlignDetectors");
+  alignDetAlg->initialize();
+  alignDetAlg->setProperty("InputWorkspace", inputWS);
+  alignDetAlg->setProperty("OutputWorkspace", outputWSName);
+  alignDetAlg->setProperty("CalibrationWorkspace", calibrationParamsTable);
+  alignDetAlg->execute();
+}
+
+void EnggDiffFittingModel::loadWorkspace(const std::string &filename,
+                                         const std::string &wsName) {
+  auto loadAlg = API::AlgorithmManager::Instance().create("Load");
+  loadAlg->setProperty("Filename", filename);
+  loadAlg->setProperty("OutputWorkspace", wsName);
+  loadAlg->execute();
+}
+
+void EnggDiffFittingModel::renameWorkspace(const API::Workspace_sptr &inputWS,
+                                           const std::string &newName) const {
+  auto renameAlg = API::AlgorithmManager::Instance().create("RenameWorkspace");
+  renameAlg->setProperty("InputWorkspace", inputWS);
+  renameAlg->setProperty("OutputWorkspace", newName);
+  renameAlg->execute();
+}
+
+void EnggDiffFittingModel::groupWorkspaces(
+    const std::vector<std::string> &workspaceNames,
+    const std::string &outputWSName) {
+  auto groupAlg = API::AlgorithmManager::Instance().create("GroupWorkspaces");
+  groupAlg->setProperty("InputWorkspaces", workspaceNames);
+  groupAlg->setProperty("OutputWorkspace", outputWSName);
+  groupAlg->execute();
+}
+
+API::MatrixWorkspace_sptr
+EnggDiffFittingModel::getFocusedWorkspace(const RunLabel &runLabel) const {
+  return m_focusedWorkspaceMap.get(runLabel);
+}
+
+void EnggDiffFittingModel::mergeTables(
+    const API::ITableWorkspace_sptr &tableToCopy,
+    const API::ITableWorkspace_sptr &targetTable) const {
+  for (size_t i = 0; i < tableToCopy->rowCount(); ++i) {
+    API::TableRow rowToCopy = tableToCopy->getRow(i);
+    API::TableRow newRow = targetTable->appendRow();
+
+    for (size_t j = 0; j < tableToCopy->columnCount(); ++j) {
+      double valueToCopy;
+      rowToCopy >> valueToCopy;
+      newRow << valueToCopy;
+    }
+  }
+}
+
+void EnggDiffFittingModel::addAllFitResultsToADS() const {
+  auto fitParamsTable = Mantid::API::WorkspaceFactory::Instance().createTable();
+  renameWorkspace(fitParamsTable, FIT_RESULTS_TABLE_NAME);
+
+  const auto runLabels = getRunLabels();
+
+  for (const auto &runLabel : runLabels) {
+    const auto singleWSFitResults = getFitResults(runLabel);
+
+    if (runLabel == *runLabels.begin()) {
+      // First element - copy column headings over
+      const auto columnHeaders = singleWSFitResults->getColumnNames();
+      for (const auto &header : columnHeaders) {
+        fitParamsTable->addColumn("double", header);
+      }
+    }
+    mergeTables(singleWSFitResults, fitParamsTable);
+  }
+}
+
+void EnggDiffFittingModel::addAllFittedPeaksToADS() const {
+  const auto runLabels = getRunLabels();
+  if (runLabels.size() < 1) {
+    return;
+  }
+  const auto firstWSLabel = runLabels[0];
+  auto fittedPeaksWS = getFittedPeaksWS(firstWSLabel);
+  cloneWorkspace(fittedPeaksWS, FITTED_PEAKS_WS_NAME);
+
+  for (size_t i = 1; i < runLabels.size(); ++i) {
+    auto wsToAppend = getFittedPeaksWS(runLabels[i]);
+    appendSpectra(FITTED_PEAKS_WS_NAME, wsToAppend->getName());
+  }
+}
+
+namespace {
+
+std::string stripWSNameFromFilename(const std::string &fullyQualifiedFilename) {
+  std::vector<std::string> directories;
+  boost::split(directories, fullyQualifiedFilename, boost::is_any_of("\\/"));
+  const std::string filename = directories.back();
+  std::vector<std::string> filenameSegments;
+  boost::split(filenameSegments, filename, boost::is_any_of("."));
+  return filenameSegments[0];
+}
+} // namespace
+
+void EnggDiffFittingModel::loadWorkspaces(const std::string &filenamesString) {
+  std::vector<std::string> filenames;
+  boost::split(filenames, filenamesString, boost::is_any_of(","));
+
+  std::vector<RunLabel> collectedRunLabels;
+
+  for (const auto &filename : filenames) {
+    // Set ws name to filename first, in case we need to guess bank ID from it
+    const std::string temporaryWSName = stripWSNameFromFilename(filename);
+    loadWorkspace(filename, temporaryWSName);
+
+    API::AnalysisDataServiceImpl &ADS = API::AnalysisDataService::Instance();
+    auto ws_test = ADS.retrieveWS<API::Workspace>(temporaryWSName);
+    const auto ws = boost::dynamic_pointer_cast<API::MatrixWorkspace>(ws_test);
+    if (!ws) {
+      throw std::invalid_argument("Workspace is not a matrix workspace.");
+    }
+    const auto bank = guessBankID(ws);
+    const auto runNumber = std::to_string(ws->getRunNumber());
+    RunLabel runLabel(runNumber, bank);
+
+    addFocusedWorkspace(runLabel, ws, filename);
+    collectedRunLabels.emplace_back(runLabel);
+  }
+
+  if (collectedRunLabels.size() == 1) {
+    auto ws = getFocusedWorkspace(collectedRunLabels[0]);
+    renameWorkspace(ws, FOCUSED_WS_NAME);
+  } else {
+    std::vector<std::string> workspaceNames;
+    std::transform(collectedRunLabels.begin(), collectedRunLabels.end(),
+                   std::back_inserter(workspaceNames),
+                   [&](const RunLabel &runLabel) {
+                     return getFocusedWorkspace(runLabel)->getName();
+                   });
+    groupWorkspaces(workspaceNames, FOCUSED_WS_NAME);
+  }
+}
+
+std::vector<RunLabel> EnggDiffFittingModel::getRunLabels() const {
+  return m_focusedWorkspaceMap.getRunLabels();
+}
+
+size_t EnggDiffFittingModel::guessBankID(
+    const API::MatrixWorkspace_const_sptr &ws) const {
+  const static std::string bankIDName = "bankid";
+  if (ws->run().hasProperty(bankIDName)) {
+    const auto log = dynamic_cast<Kernel::PropertyWithValue<int> *>(
+        ws->run().getLogData(bankIDName));
+    return boost::lexical_cast<size_t>(log->value());
+  }
+
+  // couldn't get it from sample logs - try using the old naming convention
+  const std::string name = ws->getName();
+  std::vector<std::string> chunks;
+  boost::split(chunks, name, boost::is_any_of("_"));
+  if (!chunks.empty()) {
+    const bool isNum = isDigit(chunks.back());
+    if (isNum) {
+      try {
+        return boost::lexical_cast<size_t>(chunks.back());
+      } catch (boost::exception &) {
+        // If we get a bad cast or something goes wrong then
+        // the file is probably not what we were expecting
+        // so throw a runtime error
+        throw std::runtime_error(
+            "Failed to fit file: The data was not what is expected. "
+            "Does the file contain a focused workspace?");
+      }
+    }
+  }
+
+  throw std::runtime_error("Could not guess run number from input workspace. "
+                           "Are you sure it has been focused correctly?");
+}
+
+std::string EnggDiffFittingModel::createFunctionString(
+    const Mantid::API::ITableWorkspace_sptr &fitFunctionParams,
+    const size_t row) {
+  const auto A0 = fitFunctionParams->cell<double>(row, size_t(1));
+  const auto A1 = fitFunctionParams->cell<double>(row, size_t(3));
+  const auto I = fitFunctionParams->cell<double>(row, size_t(13));
+  const auto A = fitFunctionParams->cell<double>(row, size_t(7));
+  const auto B = fitFunctionParams->cell<double>(row, size_t(9));
+  const auto X0 = fitFunctionParams->cell<double>(row, size_t(5));
+  const auto S = fitFunctionParams->cell<double>(row, size_t(11));
+
+  const std::string function =
+      "name=LinearBackground,A0=" + boost::lexical_cast<std::string>(A0) +
+      ",A1=" + boost::lexical_cast<std::string>(A1) +
+      ";name=BackToBackExponential,I=" + boost::lexical_cast<std::string>(I) +
+      ",A=" + boost::lexical_cast<std::string>(A) +
+      ",B=" + boost::lexical_cast<std::string>(B) +
+      ",X0=" + boost::lexical_cast<std::string>(X0) +
+      ",S=" + boost::lexical_cast<std::string>(S);
+  return function;
+}
+
+std::pair<double, double> EnggDiffFittingModel::getStartAndEndXFromFitParams(
+    const Mantid::API::ITableWorkspace_sptr &fitFunctionParams,
+    const size_t row) {
+  const auto X0 = fitFunctionParams->cell<double>(row, size_t(5));
+  const auto S = fitFunctionParams->cell<double>(row, size_t(11));
+  const double windowLeft = 9;
+  const double windowRight = 12;
+
+  const auto startX = X0 - (windowLeft * S);
+  const auto endX = X0 + (windowRight * S);
+  return std::pair<double, double>(startX, endX);
+}
+
+const std::string EnggDiffFittingModel::FOCUSED_WS_NAME =
+    "engggui_fitting_focused_ws";
+const std::string EnggDiffFittingModel::FIT_RESULTS_TABLE_NAME =
+    "engggui_fitting_fitpeaks_params";
+const std::string EnggDiffFittingModel::FITTED_PEAKS_WS_NAME =
+    "engggui_fitting_single_peaks";
+
+const double EnggDiffFittingModel::DEFAULT_DIFA = 0.0;
+const double EnggDiffFittingModel::DEFAULT_DIFC = 18400.0;
+const double EnggDiffFittingModel::DEFAULT_TZERO = 4.0;
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingModel.h b/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingModel.h
new file mode 100644
index 00000000000..73d8b5f3f80
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingModel.h
@@ -0,0 +1,152 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "DllConfig.h"
+#include "IEnggDiffFittingModel.h"
+#include "IEnggDiffractionCalibration.h"
+#include "RunMap.h"
+
+#include <array>
+#include <unordered_map>
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+class MANTIDQT_ENGGDIFFRACTION_DLL EnggDiffFittingModel
+    : public IEnggDiffFittingModel {
+
+public:
+  Mantid::API::MatrixWorkspace_sptr
+  getFocusedWorkspace(const RunLabel &runLabel) const override;
+
+  Mantid::API::MatrixWorkspace_sptr
+  getAlignedWorkspace(const RunLabel &runLabel) const override;
+
+  Mantid::API::MatrixWorkspace_sptr
+  getFittedPeaksWS(const RunLabel &runLabel) const override;
+
+  Mantid::API::ITableWorkspace_sptr
+  getFitResults(const RunLabel &runLabel) const override;
+
+  const std::string &
+  getWorkspaceFilename(const RunLabel &runLabel) const override;
+
+  void removeRun(const RunLabel &runLabel) override;
+
+  void loadWorkspaces(const std::string &filenames) override;
+
+  std::vector<RunLabel> getRunLabels() const override;
+
+  void
+  setDifcTzero(const RunLabel &runLabel,
+               const std::vector<GSASCalibrationParms> &calibParams) override;
+
+  void enggFitPeaks(const RunLabel &runLabel,
+                    const std::string &expectedPeaks) override;
+
+  void saveFitResultsToHDF5(const std::vector<RunLabel> &runLabels,
+                            const std::string &filename) const override;
+
+  void createFittedPeaksWS(const RunLabel &runLabel) override;
+
+  size_t getNumFocusedWorkspaces() const override;
+
+  void addAllFitResultsToADS() const override;
+
+  void addAllFittedPeaksToADS() const override;
+
+  bool hasFittedPeaksForRun(const RunLabel &runLabel) const override;
+
+protected:
+  void addFocusedWorkspace(const RunLabel &runLabel,
+                           const Mantid::API::MatrixWorkspace_sptr &ws,
+                           const std::string &filename);
+
+  void addFitResults(const RunLabel &runLabel,
+                     const Mantid::API::ITableWorkspace_sptr &ws);
+
+  void mergeTables(const Mantid::API::ITableWorkspace_sptr &tableToCopy,
+                   const Mantid::API::ITableWorkspace_sptr &targetTable) const;
+
+private:
+  static const size_t MAX_BANKS = 3;
+  static const double DEFAULT_DIFC;
+  static const double DEFAULT_DIFA;
+  static const double DEFAULT_TZERO;
+  static const std::string FOCUSED_WS_NAME;
+  static const std::string FIT_RESULTS_TABLE_NAME;
+  static const std::string FITTED_PEAKS_WS_NAME;
+
+  RunMap<MAX_BANKS, Mantid::API::MatrixWorkspace_sptr> m_focusedWorkspaceMap;
+  RunMap<MAX_BANKS, std::string> m_wsFilenameMap;
+  RunMap<MAX_BANKS, Mantid::API::ITableWorkspace_sptr> m_fitParamsMap;
+  RunMap<MAX_BANKS, Mantid::API::MatrixWorkspace_sptr> m_fittedPeaksMap;
+  RunMap<MAX_BANKS, Mantid::API::MatrixWorkspace_sptr> m_alignedWorkspaceMap;
+
+  std::string createFunctionString(
+      const Mantid::API::ITableWorkspace_sptr &fitFunctionParams,
+      const size_t row);
+
+  std::pair<double, double> getStartAndEndXFromFitParams(
+      const Mantid::API::ITableWorkspace_sptr &fitFunctionParams,
+      const size_t row);
+
+  void evaluateFunction(const std::string &function,
+                        const Mantid::API::MatrixWorkspace_sptr &inputWS,
+                        const std::string &outputWSName, const double startX,
+                        const double endX);
+
+  void cropWorkspace(const std::string &inputWSName,
+                     const std::string &outputWSName, const int startWSIndex,
+                     const int endWSIndex);
+
+  void rebinToFocusedWorkspace(const std::string &wsToRebinName,
+                               const RunLabel &runLabelToMatch,
+                               const std::string &outputWSName);
+
+  void cloneWorkspace(const Mantid::API::MatrixWorkspace_sptr &inputWorkspace,
+                      const std::string &outputWSName) const;
+
+  void cloneWorkspace(const Mantid::API::ITableWorkspace_sptr &inputWorkspace,
+                      const std::string &outputWSName) const;
+
+  void setDataToClonedWS(const std::string &wsToCopyName,
+                         const std::string &targetWSName);
+
+  void appendSpectra(const std::string &ws1Name,
+                     const std::string &ws2Name) const;
+
+  std::tuple<double, double, double>
+  getDifcDifaTzero(const Mantid::API::MatrixWorkspace_const_sptr &ws);
+
+  Mantid::API::ITableWorkspace_sptr createCalibrationParamsTable(
+      const Mantid::API::MatrixWorkspace_const_sptr &inputWS);
+
+  void
+  convertFromDistribution(const Mantid::API::MatrixWorkspace_sptr &inputWS);
+
+  void alignDetectors(const std::string &inputWSName,
+                      const std::string &outputWSName);
+
+  void alignDetectors(const Mantid::API::MatrixWorkspace_sptr &inputWS,
+                      const std::string &outputWSName);
+
+  void loadWorkspace(const std::string &filename, const std::string &wsName);
+
+  void renameWorkspace(const Mantid::API::Workspace_sptr &inputWS,
+                       const std::string &newName) const;
+
+  void groupWorkspaces(const std::vector<std::string> &workspaceNames,
+                       const std::string &outputWSName);
+
+  size_t
+  guessBankID(const Mantid::API::MatrixWorkspace_const_sptr & /*ws*/) const;
+};
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingPresenter.cpp b/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingPresenter.cpp
new file mode 100644
index 00000000000..6d24969f6b5
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingPresenter.cpp
@@ -0,0 +1,745 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "EnggDiffFittingPresenter.h"
+#include "EnggDiffFittingPresWorker.h"
+#include "IEnggDiffFittingModel.h"
+#include "MantidAPI/Algorithm.h"
+#include "MantidAPI/Axis.h"
+#include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/WorkspaceFactory.h"
+#include "MantidQtWidgets/Plotting/Qwt/QwtHelper.h"
+
+#include <boost/algorithm/string.hpp>
+#include <boost/lexical_cast.hpp>
+#include <cctype>
+#include <fstream>
+#include <utility>
+
+#include <Poco/DirectoryIterator.h>
+#include <Poco/File.h>
+
+using namespace Mantid::API;
+using namespace MantidQt::CustomInterfaces;
+
+namespace MantidQt {
+namespace QwtHelper = API::QwtHelper;
+namespace CustomInterfaces {
+
+namespace {
+Mantid::Kernel::Logger g_log("EngineeringDiffractionGUI");
+
+RunLabel runLabelFromListWidgetLabel(const std::string &listLabel) {
+  const size_t underscorePosition = listLabel.find_first_of("_");
+  const auto runNumber = listLabel.substr(0, underscorePosition);
+  const auto bank = listLabel.substr(underscorePosition + 1);
+
+  return RunLabel(runNumber, std::atoi(bank.c_str()));
+}
+
+std::string listWidgetLabelFromRunLabel(const RunLabel &runLabel) {
+  return runLabel.runNumber + "_" + std::to_string(runLabel.bank);
+}
+
+// Remove commas at the start and end of the string,
+// as well as any adjacent to another (eg ,, gets corrected to ,)
+std::string stripExtraCommas(std::string &expectedPeaks) {
+  if (!expectedPeaks.empty()) {
+
+    g_log.debug() << "Validating the expected peak list.\n";
+
+    const auto comma = ',';
+
+    for (size_t i = 0; i < expectedPeaks.size() - 1; i++) {
+      size_t j = i + 1;
+
+      if (expectedPeaks[i] == comma && expectedPeaks[i] == expectedPeaks[j]) {
+        expectedPeaks.erase(j, 1);
+        i--;
+
+      } else {
+        ++j;
+      }
+    }
+
+    size_t strLength = expectedPeaks.length() - 1;
+    if (expectedPeaks.at(0) == ',') {
+      expectedPeaks.erase(0, 1);
+      strLength -= 1;
+    }
+
+    if (expectedPeaks.at(strLength) == ',') {
+      expectedPeaks.erase(strLength, 1);
+    }
+  }
+  return expectedPeaks;
+}
+
+std::string generateXAxisLabel(const Mantid::Kernel::Unit_const_sptr &unit) {
+  std::string label = unit->unitID();
+  if (label == "TOF") {
+    label += " (us)";
+  } else if (label == "dSpacing") {
+    label += " (A)";
+  }
+  return label;
+}
+} // namespace
+
+/**
+ * Constructs a presenter for a fitting tab/widget view, which has a
+ * handle on the current calibration (produced and updated elsewhere).
+ *
+ * @param view the view that is attached to this presenter
+ * @param model the model that is attached to this presenter
+ * @param mainCalib provides the current calibration parameters/status
+ * @param mainParam provides current params and functions
+ */
+EnggDiffFittingPresenter::EnggDiffFittingPresenter(
+    IEnggDiffFittingView *view, std::unique_ptr<IEnggDiffFittingModel> model,
+    boost::shared_ptr<IEnggDiffractionCalibration> mainCalib,
+    boost::shared_ptr<IEnggDiffractionParam> mainParam)
+    : m_fittingFinishedOK(false), m_workerThread(nullptr),
+      m_mainCalib(std::move(mainCalib)), m_mainParam(std::move(mainParam)),
+      m_view(view), m_model(std::move(model)), m_viewHasClosed(false) {}
+
+EnggDiffFittingPresenter::~EnggDiffFittingPresenter() { cleanup(); }
+
+/**
+ * Close open sessions, kill threads etc., for a graceful window
+ * close/destruction
+ */
+void EnggDiffFittingPresenter::cleanup() {
+  // m_model->cleanup();
+
+  // this may still be running
+  if (m_workerThread) {
+    if (m_workerThread->isRunning()) {
+      g_log.notice() << "A fitting process is currently running, shutting "
+                        "it down immediately...\n";
+      m_workerThread->wait(10);
+    }
+    delete m_workerThread;
+    m_workerThread = nullptr;
+  }
+}
+
+void EnggDiffFittingPresenter::notify(
+    IEnggDiffFittingPresenter::Notification notif) {
+
+  // Check the view is valid - QT can send multiple notification
+  // signals in any order at any time. This means that it is possible
+  // to receive a shutdown signal and subsequently an input example
+  // for example. As we can't guarantee the state of the viewer
+  // after calling shutdown instead we shouldn't do anything after
+  if (m_viewHasClosed) {
+    return;
+  }
+
+  switch (notif) {
+
+  case IEnggDiffFittingPresenter::Start:
+    processStart();
+    break;
+
+  case IEnggDiffFittingPresenter::Load:
+    processLoad();
+    break;
+
+  case IEnggDiffFittingPresenter::FitPeaks:
+    processFitPeaks();
+    break;
+
+  case IEnggDiffFittingPresenter::FitAllPeaks:
+    processFitAllPeaks();
+    break;
+
+  case IEnggDiffFittingPresenter::addPeaks:
+    addPeakToList();
+    break;
+
+  case IEnggDiffFittingPresenter::browsePeaks:
+    browsePeaksToFit();
+    break;
+
+  case IEnggDiffFittingPresenter::savePeaks:
+    savePeakList();
+    break;
+
+  case IEnggDiffFittingPresenter::ShutDown:
+    processShutDown();
+    break;
+
+  case IEnggDiffFittingPresenter::LogMsg:
+    processLogMsg();
+    break;
+
+  case IEnggDiffFittingPresenter::selectRun:
+    processSelectRun();
+    break;
+
+  case IEnggDiffFittingPresenter::updatePlotFittedPeaks:
+    processUpdatePlotFitPeaks();
+    break;
+
+  case IEnggDiffFittingPresenter::removeRun:
+    processRemoveRun();
+    break;
+  }
+}
+
+std::vector<GSASCalibrationParms>
+EnggDiffFittingPresenter::currentCalibration() const {
+  return m_mainCalib->currentCalibration();
+}
+
+Poco::Path
+EnggDiffFittingPresenter::outFilesUserDir(const std::string &addToDir) const {
+  return m_mainParam->outFilesUserDir(addToDir);
+}
+
+std::string EnggDiffFittingPresenter::userHDFRunFilename(
+    const std::string &runNumber) const {
+  return m_mainParam->userHDFRunFilename(runNumber);
+}
+
+std::string EnggDiffFittingPresenter::userHDFMultiRunFilename(
+    const std::vector<RunLabel> &runLabels) const {
+  return m_mainParam->userHDFMultiRunFilename(runLabels);
+}
+
+void EnggDiffFittingPresenter::startAsyncFittingWorker(
+    const std::vector<RunLabel> &runLabels, const std::string &expectedPeaks) {
+
+  delete m_workerThread;
+  m_workerThread = new QThread(this);
+  EnggDiffFittingWorker *worker =
+      new EnggDiffFittingWorker(this, runLabels, expectedPeaks);
+  worker->moveToThread(m_workerThread);
+
+  connect(m_workerThread, SIGNAL(started()), worker, SLOT(fitting()));
+  connect(worker, SIGNAL(finished()), this, SLOT(fittingFinished()));
+  // early delete of thread and worker
+  connect(m_workerThread, SIGNAL(finished()), m_workerThread,
+          SLOT(deleteLater()), Qt::DirectConnection);
+  connect(worker, SIGNAL(finished()), worker, SLOT(deleteLater()));
+  m_workerThread->start();
+}
+
+/**
+ * Takes a full file path as a string and attempts to get the base name
+ * of the file at that location and return it
+ *
+ * @param filePath The full path to get the basename of
+ *
+ * @return The base name (without ext) of the file
+ */
+std::string EnggDiffFittingPresenter::getBaseNameFromStr(
+    const std::string &filePath) const {
+  Poco::Path pocoPath = filePath;
+  return pocoPath.getBaseName();
+}
+
+void EnggDiffFittingPresenter::fittingFinished() {
+  if (!m_view)
+    return;
+
+  if (m_fittingFinishedOK) {
+
+    g_log.notice() << "The single peak fitting finished - the output "
+                      "workspace is ready.\n";
+
+    m_view->showStatus("Single peak fitting process finished. Ready");
+
+    if (!m_view->listWidgetHasSelectedRow()) {
+      m_view->setFittingListWidgetCurrentRow(0);
+    }
+
+    m_model->addAllFitResultsToADS();
+    m_model->addAllFittedPeaksToADS();
+
+    try {
+      // should now plot the focused workspace when single peak fitting
+      // process fails
+      plotAlignedWorkspace(m_view->plotFittedPeaksEnabled());
+
+    } catch (std::runtime_error &re) {
+      g_log.error() << "Unable to finish the plotting of the graph for "
+                       "engggui_fitting_focused_fitpeaks workspace. Error "
+                       "description: " +
+                           static_cast<std::string>(re.what()) +
+                           " Please check also the log message for detail.";
+    }
+    g_log.notice() << "EnggDiffraction GUI: plotting of peaks for single peak "
+                      "fits has completed. \n";
+
+    if (m_workerThread) {
+      delete m_workerThread;
+      m_workerThread = nullptr;
+    }
+
+  } else {
+    // Fitting failed log and tidy up
+    g_log.warning() << "The single peak fitting did not finish correctly. "
+                       "Please check a focused file was selected.";
+    if (m_workerThread) {
+      delete m_workerThread;
+      m_workerThread = nullptr;
+    }
+
+    m_view->showStatus(
+        "Single peak fitting process did not complete successfully");
+  }
+  // enable the GUI
+  m_view->enableFitAllButton(m_model->getNumFocusedWorkspaces() > 1);
+  m_view->enableCalibrateFocusFitUserActions(true);
+}
+
+void EnggDiffFittingPresenter::processSelectRun() { updatePlot(); }
+
+void EnggDiffFittingPresenter::processStart() {}
+
+void EnggDiffFittingPresenter::processLoad() {
+  const std::string filenames = m_view->getFocusedFileNames();
+  if (filenames.empty()) {
+    m_view->userWarning("No file selected", "Please enter filename(s) to load");
+    return;
+  }
+
+  try {
+    m_model->loadWorkspaces(filenames);
+  } catch (Poco::PathSyntaxException &ex) {
+    warnFileNotFound(ex);
+    return;
+  } catch (std::invalid_argument &ex) {
+    warnFileNotFound(ex);
+    return;
+  } catch (std::runtime_error &ex) {
+    warnFileNotFound(ex);
+    return;
+  }
+
+  const auto runLabels = m_model->getRunLabels();
+  std::vector<std::string> listWidgetLabels;
+  std::transform(runLabels.begin(), runLabels.end(),
+                 std::back_inserter(listWidgetLabels),
+                 [](const RunLabel &runLabel) {
+                   return listWidgetLabelFromRunLabel(runLabel);
+                 });
+  m_view->enableFittingListWidget(true);
+  m_view->updateFittingListWidget(listWidgetLabels);
+
+  m_view->enableFitAllButton(m_model->getNumFocusedWorkspaces() > 1);
+}
+
+void EnggDiffFittingPresenter::processShutDown() {
+  m_viewHasClosed = true;
+  m_view->saveSettings();
+  cleanup();
+}
+
+void EnggDiffFittingPresenter::processLogMsg() {
+  std::vector<std::string> msgs = m_view->logMsgs();
+  for (const auto &msg : msgs) {
+    g_log.information() << msg << '\n';
+  }
+}
+
+void EnggDiffFittingPresenter::processUpdatePlotFitPeaks() { updatePlot(); }
+
+void EnggDiffFittingPresenter::processRemoveRun() {
+  const auto workspaceLabel = m_view->getFittingListWidgetCurrentValue();
+
+  if (workspaceLabel) {
+    const auto runLabel = runLabelFromListWidgetLabel(*workspaceLabel);
+    m_model->removeRun(runLabel);
+
+    const auto runLabels = m_model->getRunLabels();
+    std::vector<std::string> listWidgetLabels;
+    std::transform(runLabels.begin(), runLabels.end(),
+                   std::back_inserter(listWidgetLabels),
+                   [](const RunLabel &runLabel) {
+                     return listWidgetLabelFromRunLabel(runLabel);
+                   });
+    m_view->updateFittingListWidget(listWidgetLabels);
+  } else {
+    m_view->userWarning("No run selected",
+                        "Tried to remove run but no run was selected.\n"
+                        "Please select a run and try again");
+  }
+}
+
+void EnggDiffFittingPresenter::processFitAllPeaks() {
+  std::string fittingPeaks = m_view->getExpectedPeaksInput();
+
+  const std::string normalisedPeakCentres = stripExtraCommas(fittingPeaks);
+  m_view->setPeakList(normalisedPeakCentres);
+
+  const auto runLabels = m_model->getRunLabels();
+
+  g_log.debug() << "Focused files found are: " << normalisedPeakCentres << '\n';
+  for (const auto &runLabel : runLabels) {
+    g_log.debug() << listWidgetLabelFromRunLabel(runLabel) << '\n';
+  }
+
+  if (!runLabels.empty()) {
+
+    for (const auto &runLabel : runLabels) {
+      try {
+        validateFittingInputs(m_model->getWorkspaceFilename(runLabel),
+                              normalisedPeakCentres);
+      } catch (std::invalid_argument &ia) {
+        m_view->userWarning("Error in the inputs required for fitting",
+                            ia.what());
+        return;
+      }
+    }
+
+    g_log.notice() << "EnggDiffraction GUI: starting new multi-run "
+                   << "single peak fits. This may take some seconds...\n";
+    m_view->showStatus("Fitting multi-run single peaks...");
+
+    // disable GUI to avoid any double threads
+    m_view->enableCalibrateFocusFitUserActions(false);
+    m_view->enableFitAllButton(false);
+
+    startAsyncFittingWorker(runLabels, normalisedPeakCentres);
+  } else {
+    m_view->userWarning("Error in the inputs required for fitting",
+                        "No runs were loaded for fitting");
+  }
+}
+
+void EnggDiffFittingPresenter::processFitPeaks() {
+  const auto listLabel = m_view->getFittingListWidgetCurrentValue();
+
+  if (!listLabel) {
+    m_view->userWarning("No run selected",
+                        "Please select a run to fit from the list");
+    return;
+  }
+
+  const auto runLabel = runLabelFromListWidgetLabel(*listLabel);
+  std::string fittingPeaks = m_view->getExpectedPeaksInput();
+
+  const std::string normalisedPeakCentres = stripExtraCommas(fittingPeaks);
+  m_view->setPeakList(normalisedPeakCentres);
+
+  g_log.debug() << "the expected peaks are: " << normalisedPeakCentres << '\n';
+
+  const auto filename = m_model->getWorkspaceFilename(runLabel);
+  try {
+    validateFittingInputs(filename, normalisedPeakCentres);
+  } catch (std::invalid_argument &ia) {
+    m_view->userWarning("Error in the inputs required for fitting", ia.what());
+    return;
+  }
+
+  // disable so that user is forced to select file again
+  // otherwise empty vector will be passed
+  m_view->enableFitAllButton(false);
+
+  const std::string outWSName = "engggui_fitting_fit_peak_ws";
+  g_log.notice() << "EnggDiffraction GUI: starting new "
+                 << "single peak fits into workspace '" << outWSName
+                 << "'. This may take some seconds... \n";
+
+  m_view->showStatus("Fitting single peaks...");
+  // disable GUI to avoid any double threads
+  m_view->enableCalibrateFocusFitUserActions(false);
+
+  startAsyncFittingWorker({runLabel}, normalisedPeakCentres);
+}
+
+void EnggDiffFittingPresenter::validateFittingInputs(
+    const std::string &focusedRunFilename, const std::string &expectedPeaks) {
+  if (focusedRunFilename.empty()) {
+    throw std::invalid_argument(
+        "Focused run filename cannot be empty and must be a valid file");
+  }
+
+  Poco::File file(focusedRunFilename);
+  if (!file.exists()) {
+    throw std::invalid_argument("The focused workspace file for single peak "
+                                "fitting could not be found: " +
+                                focusedRunFilename);
+  }
+
+  if (expectedPeaks.empty()) {
+    g_log.warning() << "Expected peaks were not passed, via fitting interface, "
+                       "the default list of "
+                       "expected peaks will be utilised instead.\n";
+  }
+  bool contains_non_digits =
+      expectedPeaks.find_first_not_of("0123456789,. ") != std::string::npos;
+  if (contains_non_digits) {
+    throw std::invalid_argument("The expected peaks provided " + expectedPeaks +
+                                " is invalid, "
+                                "fitting process failed. Please try again!");
+  }
+}
+
+void EnggDiffFittingPresenter::doFitting(const std::vector<RunLabel> &runLabels,
+                                         const std::string &expectedPeaks) {
+  m_fittingFinishedOK = false;
+
+  for (const auto &runLabel : runLabels) {
+    g_log.notice() << "EnggDiffraction GUI: starting new fitting with run "
+                   << runLabel.runNumber << " and bank " << runLabel.bank
+                   << ". This may take a few seconds... \n";
+
+    // apply calibration to the focused workspace
+    m_model->setDifcTzero(runLabel, currentCalibration());
+
+    // run the algorithm EnggFitPeaks with workspace loaded above
+    // requires unit in Time of Flight
+    try {
+      m_model->enggFitPeaks(runLabel, expectedPeaks);
+    } catch (const std::runtime_error &exc) {
+      g_log.error() << "Could not run the algorithm EnggFitPeaks successfully."
+                    << exc.what();
+      // A userError should be used for this message once the threading has been
+      // looked into
+      return;
+    } catch (const Mantid::API::Algorithm::CancelException &) {
+      g_log.error() << "Fit terminated by user.\n";
+      return;
+    }
+
+    const auto outFilename = userHDFRunFilename(runLabel.runNumber);
+    m_model->saveFitResultsToHDF5({runLabel}, outFilename);
+
+    m_model->createFittedPeaksWS(runLabel);
+  }
+
+  if (runLabels.size() > 1) {
+    m_model->saveFitResultsToHDF5(runLabels,
+                                  userHDFMultiRunFilename(runLabels));
+  }
+  m_fittingFinishedOK = true;
+}
+
+void EnggDiffFittingPresenter::browsePeaksToFit() {
+  try {
+    const auto &userDir = outFilesUserDir("");
+    std::string path = m_view->getOpenFile(userDir.toString());
+    if (path.empty()) {
+      return;
+    }
+
+    m_view->setPreviousDir(path);
+    std::string peaksData = readPeaksFile(path);
+    m_view->setPeakList(peaksData);
+
+  } catch (std::runtime_error &re) {
+    m_view->userWarning(
+        "Unable to import the peaks from a file: ",
+        "File corrupted or could not be opened. Please try again" +
+            static_cast<std::string>(re.what()) + '\n');
+    return;
+  }
+}
+
+void EnggDiffFittingPresenter::addPeakToList() {
+
+  if (m_view->peakPickerEnabled()) {
+    auto peakCentre = m_view->getPeakCentre();
+
+    std::stringstream stream;
+    stream << std::fixed << std::setprecision(4) << peakCentre;
+    auto strPeakCentre = stream.str();
+
+    auto curExpPeaksList = m_view->getExpectedPeaksInput();
+
+    std::string comma = ",";
+
+    if (!curExpPeaksList.empty()) {
+      // when further peak added to list
+
+      std::string lastTwoChr =
+          curExpPeaksList.substr(curExpPeaksList.size() - 2);
+      auto lastChr = curExpPeaksList.back();
+      if (lastChr == ',' || lastTwoChr == ", ") {
+        curExpPeaksList.append(strPeakCentre);
+      } else {
+        curExpPeaksList.append(comma + strPeakCentre);
+      }
+      m_view->setPeakList(curExpPeaksList);
+    } else {
+      // when new peak given when list is empty
+      curExpPeaksList.append(strPeakCentre);
+      curExpPeaksList.append(comma);
+      m_view->setPeakList(curExpPeaksList);
+    }
+  }
+}
+
+void EnggDiffFittingPresenter::savePeakList() {
+  try {
+    const auto &userDir = outFilesUserDir("");
+    const auto &path = m_view->getSaveFile(userDir.toString());
+
+    if (path.empty()) {
+      return;
+    }
+
+    fittingWriteFile(path);
+  } catch (std::runtime_error &re) {
+    m_view->userWarning(
+        "Unable to save the peaks file: ",
+        "Invalid file path or could not be saved. Error description : " +
+            static_cast<std::string>(re.what()) + '\n');
+    return;
+  }
+}
+
+std::string
+EnggDiffFittingPresenter::readPeaksFile(const std::string &fileDir) {
+  std::string fileData = "";
+  std::string line;
+  std::string comma = ", ";
+
+  std::ifstream peakFile(fileDir);
+
+  if (peakFile.is_open()) {
+    while (std::getline(peakFile, line)) {
+      fileData += line;
+      if (!peakFile.eof())
+        fileData += comma;
+    }
+    peakFile.close();
+  }
+
+  else
+    fileData = "";
+
+  return fileData;
+}
+
+void EnggDiffFittingPresenter::fittingWriteFile(const std::string &fileDir) {
+  std::ofstream outfile(fileDir.c_str());
+  if (!outfile) {
+    m_view->userWarning("File not found",
+                        "File " + fileDir +
+                            " , could not be found. Please try again!");
+  } else {
+    auto expPeaks = m_view->getExpectedPeaksInput();
+    outfile << expPeaks;
+  }
+}
+
+void EnggDiffFittingPresenter::updatePlot() {
+  const auto listLabel = m_view->getFittingListWidgetCurrentValue();
+  if (listLabel) {
+    const auto runLabel = runLabelFromListWidgetLabel(*listLabel);
+
+    const bool fitResultsExist = m_model->hasFittedPeaksForRun(runLabel);
+    const bool plotFittedPeaksEnabled = m_view->plotFittedPeaksEnabled();
+
+    if (fitResultsExist) {
+      plotAlignedWorkspace(plotFittedPeaksEnabled);
+    } else {
+      if (plotFittedPeaksEnabled) {
+        m_view->userWarning("Cannot plot fitted peaks",
+                            "Cannot plot fitted peaks, as none have been "
+                            "generated by a fit. Plotting focused workspace "
+                            "instead.");
+      }
+      const auto ws = m_model->getFocusedWorkspace(runLabel);
+      plotFocusedFile(false, ws);
+    }
+  }
+}
+
+bool EnggDiffFittingPresenter::isDigit(const std::string &text) const {
+  return std::all_of(text.cbegin(), text.cend(), ::isdigit);
+}
+
+void EnggDiffFittingPresenter::warnFileNotFound(const std::exception &ex) {
+  m_view->showStatus("Error while loading focused run");
+  m_view->userWarning("Invalid file selected",
+                      "Mantid could not load the selected file, "
+                      "or was unable to get necessary information."
+                      "See the logger for more information");
+  g_log.error("Failed to load file. Error message: ");
+  g_log.error(ex.what());
+}
+
+void EnggDiffFittingPresenter::plotFocusedFile(
+    bool plotSinglePeaks, const MatrixWorkspace_sptr &focusedPeaksWS) {
+
+  try {
+    auto focusedData = QwtHelper::curveDataFromWs(focusedPeaksWS);
+
+    // Check that the number of curves to plot isn't excessive
+    // lets cap it at 20 to begin with - this number could need
+    // raising but each curve creates about ~5 calls on the stack
+    // so keep the limit low. This will stop users using unfocused
+    // files which have 200+ curves to plot and will "freeze" Mantid
+    constexpr int maxCurves = 20;
+
+    if (focusedData.size() > maxCurves) {
+      throw std::invalid_argument("Too many curves to plot."
+                                  " Is this a focused file?");
+    }
+
+    m_view->setDataVector(
+        focusedData, true, plotSinglePeaks,
+        generateXAxisLabel(focusedPeaksWS->getAxis(0)->unit()));
+
+  } catch (std::runtime_error &re) {
+    g_log.error()
+        << "Unable to plot focused workspace on the canvas. "
+        << "Error description: " << re.what()
+        << " Please check also the previous log messages for details.";
+
+    m_view->showStatus("Error while plotting the peaks fitted");
+    throw;
+  }
+}
+
+void EnggDiffFittingPresenter::plotAlignedWorkspace(
+    const bool plotFittedPeaks) {
+  try {
+
+    // detaches previous plots from canvas
+    m_view->resetCanvas();
+
+    const auto listLabel = m_view->getFittingListWidgetCurrentValue();
+    if (!listLabel) {
+      m_view->userWarning("Invalid run number or bank",
+                          "Tried to plot a focused file which does not exist");
+      return;
+    }
+
+    const auto runLabel = runLabelFromListWidgetLabel(*listLabel);
+    const auto ws = m_model->getAlignedWorkspace(runLabel);
+
+    // plots focused workspace
+    plotFocusedFile(m_fittingFinishedOK, ws);
+
+    if (plotFittedPeaks) {
+      g_log.debug() << "single peaks fitting being plotted now.\n";
+      auto singlePeaksWS = m_model->getFittedPeaksWS(runLabel);
+      auto singlePeaksData = QwtHelper::curveDataFromWs(singlePeaksWS);
+      m_view->setDataVector(singlePeaksData, false, true,
+                            generateXAxisLabel(ws->getAxis(0)->unit()));
+      m_view->showStatus("Peaks fitted successfully");
+    }
+  } catch (const std::runtime_error &) {
+    g_log.error()
+        << "Unable to finish of the plotting of the graph for "
+           "engggui_fitting_focused_fitpeaks  workspace. Error "
+           "description. Please check also the log message for detail.";
+
+    m_view->showStatus("Error while plotting the peaks fitted");
+    throw;
+  }
+}
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingPresenter.h b/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingPresenter.h
new file mode 100644
index 00000000000..79acf0ae5fe
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingPresenter.h
@@ -0,0 +1,142 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2016 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "DllConfig.h"
+#include "IEnggDiffFittingModel.h"
+#include "IEnggDiffFittingPresenter.h"
+#include "IEnggDiffFittingView.h"
+#include "IEnggDiffractionCalibration.h"
+#include "IEnggDiffractionParam.h"
+
+#include <string>
+#include <vector>
+
+#include <QObject>
+
+class QThread;
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+/**
+Presenter for the fitting tab/widget of the enggineering diffraction
+GUI (presenter as in the MVP Model-View-Presenter pattern).
+*/
+// needs to be dll-exported for the tests
+class MANTIDQT_ENGGDIFFRACTION_DLL EnggDiffFittingPresenter
+    : public QObject,
+      public IEnggDiffFittingPresenter,
+      public IEnggDiffractionCalibration,
+      public IEnggDiffractionParam {
+  // Q_OBJECT for 'connect' with thread/worker
+  Q_OBJECT
+
+public:
+  EnggDiffFittingPresenter(
+      IEnggDiffFittingView *view, std::unique_ptr<IEnggDiffFittingModel> model,
+      boost::shared_ptr<IEnggDiffractionCalibration> mainCalib,
+      boost::shared_ptr<IEnggDiffractionParam> mainParam);
+  ~EnggDiffFittingPresenter() override;
+
+  void notify(IEnggDiffFittingPresenter::Notification notif) override;
+
+  /// From the IEnggDiffractionCalibration interface
+  //@{
+  std::vector<GSASCalibrationParms> currentCalibration() const override;
+  //@}
+
+  /// From the IEnggDiffractionCalibration interface
+  //@{
+  Poco::Path outFilesUserDir(const std::string &addToDir) const override;
+  //@}
+
+  std::string userHDFRunFilename(const std::string &runNumber) const override;
+  std::string userHDFMultiRunFilename(
+      const std::vector<RunLabel> &runLabels) const override;
+
+  /// the fitting hard work that a worker / thread will run
+  void doFitting(const std::vector<RunLabel> &runLabels,
+                 const std::string &expectedPeaks);
+
+  void plotFocusedFile(bool plotSinglePeaks,
+                       const Mantid::API::MatrixWorkspace_sptr &focusedPeaksWS);
+
+  void plotAlignedWorkspace(const bool plotFittedPeaks);
+
+protected:
+  void processStart();
+  void processLoad();
+  void processFitPeaks();
+  void processFitAllPeaks();
+  void processShutDown();
+  void processLogMsg();
+  void processUpdatePlotFitPeaks();
+  void processRemoveRun();
+
+  /// clean shut down of model, view, etc.
+  void cleanup();
+
+protected slots:
+
+  void fittingFinished();
+
+private:
+  void updatePlot();
+
+  bool isDigit(const std::string &text) const;
+
+  void warnFileNotFound(const std::exception &ex);
+
+  // Methods related single peak fits
+  virtual void startAsyncFittingWorker(const std::vector<RunLabel> &runLabels,
+                                       const std::string &expectedPeaks);
+
+  std::string getBaseNameFromStr(const std::string &filePath) const;
+
+  void validateFittingInputs(const std::string &focusedRunNo,
+                             const std::string &expectedPeaks);
+
+  void browsePeaksToFit();
+
+  void addPeakToList();
+
+  void savePeakList();
+
+  std::string readPeaksFile(const std::string &fileDir);
+
+  void fittingWriteFile(const std::string &fileDir);
+
+  // Holds the previous user input so we can short circuit further checks
+  std::string m_previousInput;
+
+  /// true if the last fitting completed successfully
+  bool m_fittingFinishedOK;
+
+  QThread *m_workerThread;
+
+  /// interface for the 'current' calibration
+  boost::shared_ptr<IEnggDiffractionCalibration> m_mainCalib;
+
+  /// interface for the 'current' calibration
+  boost::shared_ptr<IEnggDiffractionParam> m_mainParam;
+
+  /// Associated view for this presenter (MVP pattern)
+  IEnggDiffFittingView *const m_view;
+
+  /// Associated model for this presenter
+  std::unique_ptr<IEnggDiffFittingModel> m_model;
+
+  /// Holds if the view is in the process of being closed
+  bool m_viewHasClosed;
+
+  /// Handle the user selecting a different run to plot
+  void processSelectRun();
+};
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
\ No newline at end of file
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingViewQtWidget.cpp b/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingViewQtWidget.cpp
new file mode 100644
index 00000000000..f2a1dc1100a
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffFittingViewQtWidget.cpp
@@ -0,0 +1,577 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "EnggDiffFittingViewQtWidget.h"
+#include "EnggDiffFittingModel.h"
+#include "EnggDiffFittingPresenter.h"
+#include "MantidAPI/FunctionFactory.h"
+#include "MantidAPI/IPeakFunction.h"
+
+#include "MantidQtWidgets/Common/AlgorithmInputHistory.h"
+#include "MantidQtWidgets/Plotting/Qwt/PeakPicker.h"
+
+#include <array>
+#include <iomanip>
+#include <random>
+#include <sstream>
+
+#include <boost/algorithm/string.hpp>
+#include <boost/make_shared.hpp>
+
+#include <Poco/Path.h>
+
+#include <QEvent>
+#include <QFileDialog>
+#include <QHelpEvent>
+#include <QSettings>
+#include <utility>
+
+#include <qwt_plot_curve.h>
+#include <qwt_plot_zoomer.h>
+#include <qwt_symbol.h>
+
+using namespace Mantid::API;
+using namespace MantidQt::CustomInterfaces;
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+const std::string EnggDiffFittingViewQtWidget::g_settingsGroup =
+    "CustomInterfaces/EnggDiffraction/FittingView";
+
+const std::string EnggDiffFittingViewQtWidget::g_peaksListExt =
+    "Peaks list File: CSV "
+    "(*.csv *.txt);;"
+    "Other extensions/all files (*)";
+
+std::vector<std::string> EnggDiffFittingViewQtWidget::m_fitting_runno_dir_vec;
+
+EnggDiffFittingViewQtWidget::EnggDiffFittingViewQtWidget(
+    QWidget * /*parent*/, boost::shared_ptr<IEnggDiffractionUserMsg> mainMsg,
+    boost::shared_ptr<IEnggDiffractionSettings> mainSettings,
+    boost::shared_ptr<IEnggDiffractionCalibration> mainCalib,
+    boost::shared_ptr<IEnggDiffractionParam> mainParam,
+    boost::shared_ptr<IEnggDiffractionPythonRunner> mainPythonRunner,
+    boost::shared_ptr<IEnggDiffractionParam> fileSettings)
+    : IEnggDiffFittingView(), m_fittedDataVector(),
+      m_fileSettings(std::move(fileSettings)),
+      m_mainMsgProvider(std::move(mainMsg)),
+      m_mainSettings(std::move(mainSettings)),
+      m_mainPythonRunner(std::move(mainPythonRunner)),
+      m_presenter(boost::make_shared<EnggDiffFittingPresenter>(
+          this, std::make_unique<EnggDiffFittingModel>(), mainCalib,
+          mainParam)) {
+
+  initLayout();
+  m_presenter->notify(IEnggDiffFittingPresenter::Start);
+}
+
+EnggDiffFittingViewQtWidget::~EnggDiffFittingViewQtWidget() {
+  m_presenter->notify(IEnggDiffFittingPresenter::ShutDown);
+
+  for (auto curves : m_focusedDataVector) {
+    curves->detach();
+    delete curves;
+  }
+
+  for (auto curves : m_fittedDataVector) {
+    curves->detach();
+    delete curves;
+  }
+}
+
+void EnggDiffFittingViewQtWidget::initLayout() {
+  m_ui.setupUi(this);
+
+  readSettings();
+  doSetup();
+}
+
+void EnggDiffFittingViewQtWidget::doSetup() {
+  connect(m_ui.pushButton_fitting_browse_run_num, SIGNAL(released()), this,
+          SLOT(browseFitFocusedRun()));
+
+  connect(m_ui.lineEdit_pushButton_run_num, SIGNAL(returnPressed()), this,
+          SLOT(loadClicked()));
+
+  connect(m_ui.pushButton_fitting_browse_peaks, SIGNAL(released()), this,
+          SLOT(browseClicked()));
+
+  connect(m_ui.pushButton_load, SIGNAL(released()), this, SLOT(loadClicked()));
+
+  connect(m_ui.pushButton_fit, SIGNAL(released()), this, SLOT(fitClicked()));
+
+  connect(m_ui.pushButton_fit_all, SIGNAL(released()), this,
+          SLOT(fitAllClicked()));
+
+  // add peak by clicking the button
+  connect(m_ui.pushButton_select_peak, SIGNAL(released()), SLOT(setPeakPick()));
+
+  connect(m_ui.pushButton_add_peak, SIGNAL(released()), SLOT(addClicked()));
+
+  connect(m_ui.pushButton_save_peak_list, SIGNAL(released()),
+          SLOT(saveClicked()));
+
+  connect(m_ui.pushButton_clear_peak_list, SIGNAL(released()),
+          SLOT(clearPeakList()));
+
+  connect(m_ui.pushButton_plot_separate_window, SIGNAL(released()),
+          SLOT(plotSeparateWindow()));
+
+  connect(m_ui.listWidget_fitting_run_num,
+          SIGNAL(itemClicked(QListWidgetItem *)), this,
+          SLOT(listWidget_fitting_run_num_clicked(QListWidgetItem *)));
+
+  connect(m_ui.checkBox_plotFittedPeaks, SIGNAL(stateChanged(int)), this,
+          SLOT(plotFittedPeaksStateChanged()));
+
+  // Tool-tip button
+  connect(m_ui.pushButton_tooltip, SIGNAL(released()), SLOT(showToolTipHelp()));
+
+  // Remove run button
+  connect(m_ui.pushButton_remove_run, SIGNAL(released()), this,
+          SLOT(removeRunClicked()));
+
+  m_ui.dataPlot->setCanvasBackground(Qt::white);
+  m_ui.dataPlot->setAxisTitle(QwtPlot::xBottom, "d-Spacing (A)");
+  m_ui.dataPlot->setAxisTitle(QwtPlot::yLeft, "Counts (us)^-1");
+  QFont font("MS Shell Dlg 2", 8);
+  m_ui.dataPlot->setAxisFont(QwtPlot::xBottom, font);
+  m_ui.dataPlot->setAxisFont(QwtPlot::yLeft, font);
+
+  // constructor of the peakPicker
+  // XXX: Being a QwtPlotItem, should get deleted when m_ui.plot gets deleted
+  // (auto-delete option)
+  m_peakPicker = new MantidWidgets::PeakPicker(m_ui.dataPlot, Qt::red);
+  setPeakPickerEnabled(false);
+
+  m_zoomTool =
+      new QwtPlotZoomer(QwtPlot::xBottom, QwtPlot::yLeft,
+                        QwtPicker::DragSelection | QwtPicker::CornerToCorner,
+                        QwtPicker::AlwaysOff, m_ui.dataPlot->canvas());
+  m_zoomTool->setRubberBandPen(QPen(Qt::black));
+  setZoomTool(false);
+}
+
+void EnggDiffFittingViewQtWidget::readSettings() {
+  QSettings qs;
+  qs.beginGroup(QString::fromStdString(g_settingsGroup));
+
+  // user params
+  m_ui.lineEdit_pushButton_run_num->setText(
+      qs.value("user-params-fitting-focused-file", "").toString());
+  m_ui.lineEdit_fitting_peaks->setText(
+      qs.value("user-params-fitting-peaks-to-fit", "").toString());
+
+  qs.endGroup();
+}
+
+void EnggDiffFittingViewQtWidget::saveSettings() const {
+  QSettings qs;
+  qs.beginGroup(QString::fromStdString(g_settingsGroup));
+
+  qs.setValue("user-params-fitting-focused-file",
+              m_ui.lineEdit_pushButton_run_num->text());
+  qs.setValue("user-params-fitting-peaks-to-fit",
+              m_ui.lineEdit_fitting_peaks->text());
+
+  qs.endGroup();
+}
+
+void EnggDiffFittingViewQtWidget::enable(bool enable) {
+  m_ui.pushButton_fitting_browse_run_num->setEnabled(enable);
+  m_ui.pushButton_load->setEnabled(enable);
+  m_ui.lineEdit_pushButton_run_num->setEnabled(enable);
+  m_ui.pushButton_fitting_browse_peaks->setEnabled(enable);
+  m_ui.lineEdit_fitting_peaks->setEnabled(enable);
+  m_ui.pushButton_fit->setEnabled(enable);
+  m_ui.pushButton_clear_peak_list->setEnabled(enable);
+  m_ui.pushButton_save_peak_list->setEnabled(enable);
+  m_ui.groupBox_fititng_preview->setEnabled(enable);
+}
+
+void EnggDiffFittingViewQtWidget::showStatus(const std::string &sts) {
+  m_mainMsgProvider->showStatus(sts);
+}
+
+void EnggDiffFittingViewQtWidget::userWarning(const std::string &err,
+                                              const std::string &description) {
+  m_mainMsgProvider->userWarning(err, description);
+}
+
+void EnggDiffFittingViewQtWidget::userError(const std::string &err,
+                                            const std::string &description) {
+  m_mainMsgProvider->userError(err, description);
+}
+
+void EnggDiffFittingViewQtWidget::enableCalibrateFocusFitUserActions(
+    bool enable) {
+  m_mainMsgProvider->enableCalibrateFocusFitUserActions(enable);
+}
+
+EnggDiffCalibSettings
+EnggDiffFittingViewQtWidget::currentCalibSettings() const {
+  return m_mainSettings->currentCalibSettings();
+}
+
+std::string
+EnggDiffFittingViewQtWidget::enggRunPythonCode(const std::string &pyCode) {
+  return m_mainPythonRunner->enggRunPythonCode(pyCode);
+}
+
+void EnggDiffFittingViewQtWidget::loadClicked() {
+  m_presenter->notify(IEnggDiffFittingPresenter::Load);
+}
+
+void EnggDiffFittingViewQtWidget::fitClicked() {
+  m_presenter->notify(IEnggDiffFittingPresenter::FitPeaks);
+}
+
+void EnggDiffFittingViewQtWidget::fitAllClicked() {
+  m_presenter->notify(IEnggDiffFittingPresenter::FitAllPeaks);
+}
+
+void EnggDiffFittingViewQtWidget::addClicked() {
+  m_presenter->notify(IEnggDiffFittingPresenter::addPeaks);
+}
+
+void EnggDiffFittingViewQtWidget::browseClicked() {
+  m_presenter->notify(IEnggDiffFittingPresenter::browsePeaks);
+}
+
+void EnggDiffFittingViewQtWidget::saveClicked() {
+  m_presenter->notify(IEnggDiffFittingPresenter::savePeaks);
+}
+
+void EnggDiffFittingViewQtWidget::plotFittedPeaksStateChanged() {
+  m_presenter->notify(IEnggDiffFittingPresenter::updatePlotFittedPeaks);
+}
+
+void EnggDiffFittingViewQtWidget::listWidget_fitting_run_num_clicked(
+    QListWidgetItem *) {
+  m_presenter->notify(IEnggDiffFittingPresenter::selectRun);
+}
+
+void EnggDiffFittingViewQtWidget::removeRunClicked() {
+  m_presenter->notify(IEnggDiffFittingPresenter::removeRun);
+}
+
+void EnggDiffFittingViewQtWidget::resetCanvas() {
+  // clear vector and detach curves to avoid plot crash
+  // when only plotting focused workspace
+  for (auto curves : m_fittedDataVector) {
+    if (curves) {
+      curves->detach();
+      delete curves;
+    }
+  }
+
+  if (m_fittedDataVector.size() > 0)
+    m_fittedDataVector.clear();
+
+  // set it as false as there will be no valid workspace to plot
+  m_ui.pushButton_plot_separate_window->setEnabled(false);
+}
+
+void EnggDiffFittingViewQtWidget::setDataVector(
+    std::vector<boost::shared_ptr<QwtData>> &data, bool focused,
+    bool plotSinglePeaks, const std::string &xAxisLabel) {
+
+  if (!plotSinglePeaks) {
+    // clear vector and detach curves to avoid plot crash
+    resetCanvas();
+  }
+  m_ui.dataPlot->setAxisTitle(QwtPlot::xBottom, xAxisLabel.c_str());
+
+  // when only plotting focused workspace
+  if (focused) {
+    dataCurvesFactory(data, m_focusedDataVector, focused);
+  } else {
+    dataCurvesFactory(data, m_fittedDataVector, focused);
+  }
+}
+
+void EnggDiffFittingViewQtWidget::dataCurvesFactory(
+    std::vector<boost::shared_ptr<QwtData>> &data,
+    std::vector<QwtPlotCurve *> &dataVector, bool focused) {
+
+  // clear vector
+  for (auto curves : dataVector) {
+    if (curves) {
+      curves->detach();
+      delete curves;
+    }
+  }
+
+  if (dataVector.size() > 0)
+    dataVector.clear();
+  resetView();
+
+  // dark colours could be removed so that the coloured peaks stand out more
+  const std::array<QColor, 16> QPenList{
+      {Qt::white, Qt::red, Qt::darkRed, Qt::green, Qt::darkGreen, Qt::blue,
+       Qt::darkBlue, Qt::cyan, Qt::darkCyan, Qt::magenta, Qt::darkMagenta,
+       Qt::yellow, Qt::darkYellow, Qt::gray, Qt::lightGray, Qt::black}};
+
+  std::mt19937 gen;
+  std::uniform_int_distribution<std::size_t> dis(0, QPenList.size() - 1);
+
+  for (size_t i = 0; i < data.size(); i++) {
+    auto *peak = data[i].get();
+
+    QwtPlotCurve *dataCurve = new QwtPlotCurve();
+    if (!focused) {
+      dataCurve->setStyle(QwtPlotCurve::Lines);
+      auto randIndex = dis(gen);
+      dataCurve->setPen(QPen(QPenList[randIndex], 2));
+
+      // only set enabled when single peak workspace plotted
+      m_ui.pushButton_plot_separate_window->setEnabled(true);
+    } else {
+      dataCurve->setStyle(QwtPlotCurve::NoCurve);
+      // focused workspace in bg set as darkGrey crosses insted of line
+      dataCurve->setSymbol(QwtSymbol(QwtSymbol::XCross, QBrush(),
+                                     QPen(Qt::darkGray, 1), QSize(3, 3)));
+    }
+    dataCurve->setRenderHint(QwtPlotItem::RenderAntialiased, true);
+
+    dataVector.emplace_back(dataCurve);
+
+    dataVector[i]->setData(*peak);
+    dataVector[i]->attach(m_ui.dataPlot);
+  }
+
+  m_ui.dataPlot->replot();
+  m_zoomTool->setZoomBase();
+  // enable zoom & select peak btn after the plotting on graph
+  setZoomTool(true);
+  m_ui.pushButton_select_peak->setEnabled(true);
+  data.clear();
+}
+
+void EnggDiffFittingViewQtWidget::setPeakPickerEnabled(bool enabled) {
+  m_peakPicker->setEnabled(enabled);
+  m_peakPicker->setVisible(enabled);
+  m_ui.dataPlot->replot(); // PeakPicker might get hidden/shown
+  m_ui.pushButton_add_peak->setEnabled(enabled);
+  if (enabled) {
+    QString btnText = "Reset Peak Selector";
+    m_ui.pushButton_select_peak->setText(btnText);
+  }
+}
+
+void EnggDiffFittingViewQtWidget::setPeakPicker(
+    const IPeakFunction_const_sptr &peak) {
+  m_peakPicker->setPeak(peak);
+  m_ui.dataPlot->replot();
+}
+
+double EnggDiffFittingViewQtWidget::getPeakCentre() const {
+  auto peak = m_peakPicker->peak();
+  auto centre = peak->centre();
+  return centre;
+}
+
+bool EnggDiffFittingViewQtWidget::peakPickerEnabled() const {
+  return m_peakPicker->isEnabled();
+}
+
+void EnggDiffFittingViewQtWidget::setZoomTool(bool enabled) {
+  m_zoomTool->setEnabled(enabled);
+}
+
+void EnggDiffFittingViewQtWidget::resetView() {
+  // Resets the view to a sensible default
+  // Auto scale the axis
+  m_ui.dataPlot->setAxisAutoScale(QwtPlot::xBottom);
+  m_ui.dataPlot->setAxisAutoScale(QwtPlot::yLeft);
+
+  // Set this as the default zoom level
+  m_zoomTool->setZoomBase(true);
+}
+
+std::string EnggDiffFittingViewQtWidget::getPreviousDir() const {
+
+  QString prevPath =
+      MantidQt::API::AlgorithmInputHistory::Instance().getPreviousDirectory();
+
+  return prevPath.toStdString();
+}
+
+void EnggDiffFittingViewQtWidget::setPreviousDir(const std::string &path) {
+  QString qPath = QString::fromStdString(path);
+  MantidQt::API::AlgorithmInputHistory::Instance().setPreviousDirectory(qPath);
+}
+
+std::string
+EnggDiffFittingViewQtWidget::getOpenFile(const std::string &prevPath) {
+
+  QString path(QFileDialog::getOpenFileName(
+      this, tr("Open Peaks To Fit"), QString::fromStdString(prevPath),
+      QString::fromStdString(g_peaksListExt)));
+
+  return path.toStdString();
+}
+
+std::string
+EnggDiffFittingViewQtWidget::getSaveFile(const std::string &prevPath) {
+
+  QString path(QFileDialog::getSaveFileName(
+      this, tr("Save Expected Peaks List"), QString::fromStdString(prevPath),
+      QString::fromStdString(g_peaksListExt)));
+
+  return path.toStdString();
+}
+
+void EnggDiffFittingViewQtWidget::browseFitFocusedRun() {
+  const auto &focusDir = m_fileSettings->outFilesUserDir("Focus").toString();
+  std::string nexusFormat = "Nexus file with calibration table: NXS, NEXUS"
+                            "(*.nxs *.nexus);;";
+
+  QStringList paths(QFileDialog::getOpenFileNames(
+      this, tr("Open Focused File "), QString::fromStdString(focusDir),
+      QString::fromStdString(nexusFormat)));
+
+  if (paths.isEmpty()) {
+    return;
+  }
+
+  setFocusedFileNames(paths.join(",").toStdString());
+}
+
+void EnggDiffFittingViewQtWidget::setFocusedFileNames(
+    const std::string &paths) {
+  m_ui.lineEdit_pushButton_run_num->setText(QString::fromStdString(paths));
+}
+
+std::string EnggDiffFittingViewQtWidget::getFocusedFileNames() const {
+  return m_ui.lineEdit_pushButton_run_num->text().toStdString();
+}
+
+void EnggDiffFittingViewQtWidget::enableFitAllButton(bool enable) const {
+  m_ui.pushButton_fit_all->setEnabled(enable);
+}
+
+void EnggDiffFittingViewQtWidget::clearFittingListWidget() const {
+  m_ui.listWidget_fitting_run_num->clear();
+}
+
+void EnggDiffFittingViewQtWidget::enableFittingListWidget(bool enable) const {
+  m_ui.listWidget_fitting_run_num->setEnabled(enable);
+}
+
+int EnggDiffFittingViewQtWidget::getFittingListWidgetCurrentRow() const {
+  return m_ui.listWidget_fitting_run_num->currentRow();
+}
+
+boost::optional<std::string>
+EnggDiffFittingViewQtWidget::getFittingListWidgetCurrentValue() const {
+  if (listWidgetHasSelectedRow()) {
+    return m_ui.listWidget_fitting_run_num->currentItem()->text().toStdString();
+  }
+  return boost::none;
+}
+
+bool EnggDiffFittingViewQtWidget::listWidgetHasSelectedRow() const {
+  return m_ui.listWidget_fitting_run_num->selectedItems().size() != 0;
+}
+
+void EnggDiffFittingViewQtWidget::updateFittingListWidget(
+    const std::vector<std::string> &rows) {
+  clearFittingListWidget();
+
+  for (const auto &rowLabel : rows) {
+    this->addRunNoItem(rowLabel);
+  }
+}
+
+void EnggDiffFittingViewQtWidget::setFittingListWidgetCurrentRow(
+    int idx) const {
+  m_ui.listWidget_fitting_run_num->setCurrentRow(idx);
+}
+
+bool EnggDiffFittingViewQtWidget::plotFittedPeaksEnabled() const {
+  return m_ui.checkBox_plotFittedPeaks->isChecked();
+}
+
+void EnggDiffFittingViewQtWidget::plotSeparateWindow() {
+  std::string pyCode =
+
+      "fitting_single_peaks_twin_ws = \"__engggui_fitting_single_peaks_twin\"\n"
+      "if (mtd.doesExist(fitting_single_peaks_twin_ws)):\n"
+      " DeleteWorkspace(fitting_single_peaks_twin_ws)\n"
+
+      "single_peak_ws = CloneWorkspace(InputWorkspace = "
+      "\"engggui_fitting_single_peaks\", OutputWorkspace = "
+      "fitting_single_peaks_twin_ws)\n"
+      "tot_spec = single_peak_ws.getNumberHistograms()\n"
+
+      "spec_list = []\n"
+      "for i in range(0, tot_spec):\n"
+      " spec_list.append(i)\n"
+
+      "fitting_plot = plotSpectrum(single_peak_ws, spec_list).activeLayer()\n"
+      "fitting_plot.setTitle(\"Engg GUI Single Peaks Fitting Workspace\")\n";
+
+  std::string status = m_mainPythonRunner->enggRunPythonCode(pyCode);
+  m_logMsgs.emplace_back("Plotted output focused data, with status string " +
+                         status);
+  m_presenter->notify(IEnggDiffFittingPresenter::LogMsg);
+}
+
+void EnggDiffFittingViewQtWidget::showToolTipHelp() {
+  // We need a the mouse click position relative to the widget
+  // and relative to the screen. We will set the mouse click position
+  // relative to widget to 0 as the global position of the mouse
+  // is what is considered when the tool tip is displayed
+  const QPoint relWidgetPosition(0, 0);
+  const QPoint mousePos = QCursor::pos();
+  // Now fire the generated event to show a tool tip at the cursor
+  QEvent *toolTipEvent =
+      new QHelpEvent(QEvent::ToolTip, relWidgetPosition, mousePos);
+  QCoreApplication::sendEvent(m_ui.pushButton_tooltip, toolTipEvent);
+}
+
+std::string EnggDiffFittingViewQtWidget::getExpectedPeaksInput() const {
+
+  return m_ui.lineEdit_fitting_peaks->text().toStdString();
+}
+
+void EnggDiffFittingViewQtWidget::setPeakList(
+    const std::string &peakList) const {
+  m_ui.lineEdit_fitting_peaks->setText(QString::fromStdString(peakList));
+}
+
+void EnggDiffFittingViewQtWidget::addRunNoItem(std::string runNo) {
+  m_ui.listWidget_fitting_run_num->addItem(QString::fromStdString(runNo));
+}
+
+std::vector<std::string> EnggDiffFittingViewQtWidget::getFittingRunNumVec() {
+  return m_fitting_runno_dir_vec;
+}
+
+void EnggDiffFittingViewQtWidget::setFittingRunNumVec(
+    std::vector<std::string> assignVec) {
+  // holds all the directories required
+  m_fitting_runno_dir_vec.clear();
+  m_fitting_runno_dir_vec = assignVec;
+}
+
+void EnggDiffFittingViewQtWidget::setPeakPick() {
+  auto bk2bk =
+      FunctionFactory::Instance().createFunction("BackToBackExponential");
+  auto bk2bkFunc = boost::dynamic_pointer_cast<IPeakFunction>(bk2bk);
+  // set the peak to BackToBackExponential function
+  setPeakPicker(bk2bkFunc);
+  setPeakPickerEnabled(true);
+}
+
+void EnggDiffFittingViewQtWidget::clearPeakList() {
+  m_ui.lineEdit_fitting_peaks->clear();
+}
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingModel.cpp b/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingModel.cpp
new file mode 100644
index 00000000000..8a3b71e7e04
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingModel.cpp
@@ -0,0 +1,353 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "EnggDiffGSASFittingModel.h"
+
+#include "MantidAPI/AlgorithmManager.h"
+#include "MantidAPI/AnalysisDataService.h"
+#include "MantidAPI/MatrixWorkspace.h"
+#include "MantidQtWidgets/Common/MantidAlgorithmMetatype.h"
+
+#include <boost/algorithm/string/join.hpp>
+#include <utility>
+
+using namespace Mantid;
+
+namespace {
+
+std::string stripWSNameFromFilename(const std::string &fullyQualifiedFilename) {
+  std::vector<std::string> directories;
+  boost::split(directories, fullyQualifiedFilename, boost::is_any_of("\\/"));
+  const std::string filename = directories.back();
+  std::vector<std::string> filenameSegments;
+  boost::split(filenameSegments, filename, boost::is_any_of("."));
+  return filenameSegments[0];
+}
+
+std::string refinementMethodToString(
+    const MantidQt::CustomInterfaces::GSASRefinementMethod &method) {
+  switch (method) {
+  case MantidQt::CustomInterfaces::GSASRefinementMethod::PAWLEY:
+    return "Pawley refinement";
+  case MantidQt::CustomInterfaces::GSASRefinementMethod::RIETVELD:
+    return "Rietveld refinement";
+  default:
+    throw std::invalid_argument(
+        "Invalid refinement method: please contact the development team");
+  }
+}
+
+} // anonymous namespace
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+EnggDiffGSASFittingModel::EnggDiffGSASFittingModel() {
+  qRegisterMetaType<
+      MantidQt::CustomInterfaces::GSASIIRefineFitPeaksOutputProperties>(
+      "GSASIIRefineFitPeaksOutputProperties");
+  qRegisterMetaType<Mantid::API::IAlgorithm_sptr>("IAlgorithm_sptr");
+  qRegisterMetaType<std::vector<GSASIIRefineFitPeaksOutputProperties>>(
+      "std::vector<GSASIIRefineFitPeaksOutputProperties>");
+}
+
+EnggDiffGSASFittingModel::~EnggDiffGSASFittingModel() {
+  if (m_workerThread) {
+    if (m_workerThread->isRunning()) {
+      m_workerThread->wait(10);
+    }
+  }
+}
+
+void EnggDiffGSASFittingModel::addFitResultsToMaps(
+    const RunLabel &runLabel, const double rwp, const double sigma,
+    const double gamma, const API::ITableWorkspace_sptr &latticeParams) {
+  addRwp(runLabel, rwp);
+  addSigma(runLabel, sigma);
+  addGamma(runLabel, gamma);
+  addLatticeParams(runLabel, latticeParams);
+}
+
+void EnggDiffGSASFittingModel::addLatticeParams(
+    const RunLabel &runLabel, const API::ITableWorkspace_sptr &table) {
+  m_latticeParamsMap.add(runLabel, table);
+}
+
+void EnggDiffGSASFittingModel::addGamma(const RunLabel &runLabel,
+                                        const double gamma) {
+  m_gammaMap.add(runLabel, gamma);
+}
+
+void EnggDiffGSASFittingModel::addRwp(const RunLabel &runLabel,
+                                      const double rwp) {
+  m_rwpMap.add(runLabel, rwp);
+}
+
+void EnggDiffGSASFittingModel::addSigma(const RunLabel &runLabel,
+                                        const double sigma) {
+  m_sigmaMap.add(runLabel, sigma);
+}
+
+namespace {
+
+std::string generateFittedPeaksWSName(const RunLabel &runLabel) {
+  return runLabel.runNumber + "_" + std::to_string(runLabel.bank) +
+         "_gsasii_fitted_peaks";
+}
+
+std::string generateLatticeParamsName(const RunLabel &runLabel) {
+  return runLabel.runNumber + "_" + std::to_string(runLabel.bank) +
+         "_lattice_params";
+}
+} // namespace
+
+std::pair<API::IAlgorithm_sptr, GSASIIRefineFitPeaksOutputProperties>
+EnggDiffGSASFittingModel::doGSASRefinementAlgorithm(
+    const GSASIIRefineFitPeaksParameters &params) {
+  auto gsasAlg =
+      API::AlgorithmManager::Instance().create("GSASIIRefineFitPeaks");
+
+  gsasAlg->setProperty("RefinementMethod",
+                       refinementMethodToString(params.refinementMethod));
+  gsasAlg->setProperty("InputWorkspace", params.inputWorkspace);
+  gsasAlg->setProperty("InstrumentFile", params.instParamsFile);
+  gsasAlg->setProperty("PhaseInfoFiles",
+                       boost::algorithm::join(params.phaseFiles, ","));
+  gsasAlg->setProperty("PathToGSASII", params.gsasHome);
+
+  if (params.dMin) {
+    gsasAlg->setProperty("PawleyDMin", *(params.dMin));
+  }
+  if (params.negativeWeight) {
+    gsasAlg->setProperty("PawleyNegativeWeight", *(params.negativeWeight));
+  }
+  if (params.xMin) {
+    gsasAlg->setProperty("XMin", *(params.xMin));
+  }
+  if (params.xMax) {
+    gsasAlg->setProperty("XMax", *(params.xMax));
+  }
+  gsasAlg->setProperty("RefineSigma", params.refineSigma);
+  gsasAlg->setProperty("RefineGamma", params.refineGamma);
+
+  const auto outputWSName = generateFittedPeaksWSName(params.runLabel);
+  const auto latticeParamsName = generateLatticeParamsName(params.runLabel);
+  gsasAlg->setProperty("OutputWorkspace", outputWSName);
+  gsasAlg->setProperty("LatticeParameters", latticeParamsName);
+  gsasAlg->setProperty("SaveGSASIIProjectFile", params.gsasProjectFile);
+  gsasAlg->execute();
+
+  const double rwp = gsasAlg->getProperty("Rwp");
+  const double sigma = gsasAlg->getProperty("Sigma");
+  const double gamma = gsasAlg->getProperty("Gamma");
+
+  API::AnalysisDataServiceImpl &ADS = API::AnalysisDataService::Instance();
+  const auto fittedPeaks = ADS.retrieveWS<API::MatrixWorkspace>(outputWSName);
+  const auto latticeParams =
+      ADS.retrieveWS<API::ITableWorkspace>(latticeParamsName);
+  return std::make_pair(gsasAlg, GSASIIRefineFitPeaksOutputProperties(
+                                     rwp, sigma, gamma, fittedPeaks,
+                                     latticeParams, params.runLabel));
+}
+
+void EnggDiffGSASFittingModel::doRefinements(
+    const std::vector<GSASIIRefineFitPeaksParameters> &params) {
+  m_workerThread = std::make_unique<QThread>(this);
+  EnggDiffGSASFittingWorker *worker =
+      new EnggDiffGSASFittingWorker(this, params);
+  worker->moveToThread(m_workerThread.get());
+
+  connect(m_workerThread.get(), SIGNAL(started()), worker,
+          SLOT(doRefinements()));
+  connect(worker,
+          SIGNAL(refinementSuccessful(Mantid::API::IAlgorithm_sptr,
+                                      GSASIIRefineFitPeaksOutputProperties)),
+          this,
+          SLOT(processRefinementSuccessful(
+              Mantid::API::IAlgorithm_sptr,
+              const GSASIIRefineFitPeaksOutputProperties &)));
+  connect(worker,
+          SIGNAL(refinementsComplete(
+              Mantid::API::IAlgorithm_sptr,
+              std::vector<GSASIIRefineFitPeaksOutputProperties>)),
+          this,
+          SLOT(processRefinementsComplete(
+              Mantid::API::IAlgorithm_sptr,
+              const std::vector<GSASIIRefineFitPeaksOutputProperties> &)));
+  connect(worker, SIGNAL(refinementFailed(const std::string &)), this,
+          SLOT(processRefinementFailed(const std::string &)));
+  connect(worker, SIGNAL(refinementCancelled()), this,
+          SLOT(processRefinementCancelled()));
+  connect(m_workerThread.get(), SIGNAL(finished()), m_workerThread.get(),
+          SLOT(deleteLater()));
+  connect(worker,
+          SIGNAL(refinementSuccessful(Mantid::API::IAlgorithm_sptr,
+                                      GSASIIRefineFitPeaksOutputProperties)),
+          worker, SLOT(deleteLater()));
+  connect(worker, SIGNAL(refinementFailed(const std::string &)), worker,
+          SLOT(deleteLater()));
+  m_workerThread->start();
+}
+
+boost::optional<API::ITableWorkspace_sptr>
+EnggDiffGSASFittingModel::getLatticeParams(const RunLabel &runLabel) const {
+  return getFromRunMapOptional(m_latticeParamsMap, runLabel);
+}
+
+boost::optional<double>
+EnggDiffGSASFittingModel::getGamma(const RunLabel &runLabel) const {
+  return getFromRunMapOptional(m_gammaMap, runLabel);
+}
+
+boost::optional<double>
+EnggDiffGSASFittingModel::getRwp(const RunLabel &runLabel) const {
+  return getFromRunMapOptional(m_rwpMap, runLabel);
+}
+
+boost::optional<double>
+EnggDiffGSASFittingModel::getSigma(const RunLabel &runLabel) const {
+  return getFromRunMapOptional(m_sigmaMap, runLabel);
+}
+
+bool EnggDiffGSASFittingModel::hasFitResultsForRun(
+    const RunLabel &runLabel) const {
+  return m_rwpMap.contains(runLabel) && m_sigmaMap.contains(runLabel) &&
+         m_gammaMap.contains(runLabel);
+}
+
+Mantid::API::MatrixWorkspace_sptr
+EnggDiffGSASFittingModel::loadFocusedRun(const std::string &filename) const {
+  const auto wsName = stripWSNameFromFilename(filename);
+
+  auto loadAlg = API::AlgorithmManager::Instance().create("Load");
+  loadAlg->setProperty("Filename", filename);
+  loadAlg->setProperty("OutputWorkspace", wsName);
+  loadAlg->execute();
+
+  API::AnalysisDataServiceImpl &ADS = API::AnalysisDataService::Instance();
+  auto wsTest = ADS.retrieveWS<API::Workspace>(wsName);
+  const auto ws = boost::dynamic_pointer_cast<API::MatrixWorkspace>(wsTest);
+  if (!ws) {
+    throw std::invalid_argument(
+        "Invalid Workspace loaded, are you sure it has been focused?");
+  }
+  return ws;
+}
+
+void EnggDiffGSASFittingModel::processRefinementsComplete(
+    Mantid::API::IAlgorithm_sptr alg,
+    const std::vector<GSASIIRefineFitPeaksOutputProperties>
+        &refinementResultSets) {
+  m_observer->notifyRefinementsComplete(std::move(alg), refinementResultSets);
+}
+
+void EnggDiffGSASFittingModel::processRefinementFailed(
+    const std::string &failureMessage) {
+  if (m_observer) {
+    m_observer->notifyRefinementFailed(failureMessage);
+  }
+}
+
+void EnggDiffGSASFittingModel::processRefinementSuccessful(
+    API::IAlgorithm_sptr successfulAlgorithm,
+    const GSASIIRefineFitPeaksOutputProperties &refinementResults) {
+  addFitResultsToMaps(refinementResults.runLabel, refinementResults.rwp,
+                      refinementResults.sigma, refinementResults.gamma,
+                      refinementResults.latticeParamsWS);
+  if (m_observer) {
+    m_observer->notifyRefinementSuccessful(std::move(successfulAlgorithm),
+                                           refinementResults);
+  }
+}
+
+void EnggDiffGSASFittingModel::processRefinementCancelled() {
+  if (m_observer) {
+    m_observer->notifyRefinementCancelled();
+  }
+}
+
+void EnggDiffGSASFittingModel::saveRefinementResultsToHDF5(
+    const Mantid::API::IAlgorithm_sptr successfulAlg,
+    const std::vector<GSASIIRefineFitPeaksOutputProperties>
+        &refinementResultSets,
+    const std::string &filename) const {
+  auto saveAlg = API::AlgorithmManager::Instance().create(
+      "EnggSaveGSASIIFitResultsToHDF5");
+
+  const auto numRuns = refinementResultSets.size();
+  std::vector<std::string> latticeParamWSNames;
+  latticeParamWSNames.reserve(numRuns);
+  std::vector<std::string> runNumbers;
+  runNumbers.reserve(numRuns);
+  std::vector<long> bankIDs;
+  bankIDs.reserve(numRuns);
+  std::vector<double> sigmas;
+  sigmas.reserve(numRuns);
+  std::vector<double> gammas;
+  gammas.reserve(numRuns);
+  std::vector<double> rwps;
+  rwps.reserve(numRuns);
+
+  const bool refineSigma = successfulAlg->getProperty("RefineSigma");
+  saveAlg->setProperty("RefineSigma", refineSigma);
+  const bool refineGamma = successfulAlg->getProperty("RefineGamma");
+  saveAlg->setProperty("RefineGamma", refineGamma);
+
+  for (const auto &refinementResults : refinementResultSets) {
+    const auto &runLabel = refinementResults.runLabel;
+    const auto latticeParams = *getLatticeParams(runLabel);
+
+    latticeParamWSNames.emplace_back(latticeParams->getName());
+    runNumbers.emplace_back(runLabel.runNumber);
+    bankIDs.emplace_back(static_cast<long>(runLabel.bank));
+    rwps.emplace_back(refinementResults.rwp);
+
+    if (refineSigma) {
+      sigmas.emplace_back(refinementResults.sigma);
+    }
+    if (refineGamma) {
+      gammas.emplace_back(refinementResults.gamma);
+    }
+  }
+
+  saveAlg->setProperty("LatticeParamWorkspaces", latticeParamWSNames);
+  saveAlg->setProperty("BankIDs", bankIDs);
+  saveAlg->setProperty("RunNumbers", runNumbers);
+
+  const std::string refinementMethod =
+      successfulAlg->getProperty("RefinementMethod");
+  saveAlg->setProperty("RefinementMethod", refinementMethod);
+  saveAlg->setProperty("XMin", successfulAlg->getPropertyValue("XMin"));
+  saveAlg->setProperty("XMax", successfulAlg->getPropertyValue("XMax"));
+
+  if (refinementMethod == "Pawley refinement") {
+    saveAlg->setProperty("PawleyDMin",
+                         successfulAlg->getPropertyValue("PawleyDMin"));
+    saveAlg->setProperty(
+        "PawleyNegativeWeight",
+        successfulAlg->getPropertyValue("PawleyNegativeWeight"));
+  }
+
+  if (refineSigma) {
+    saveAlg->setProperty("Sigma", sigmas);
+  }
+
+  if (refineGamma) {
+    saveAlg->setProperty("Gamma", gammas);
+  }
+
+  saveAlg->setProperty("Rwp", rwps);
+  saveAlg->setProperty("Filename", filename);
+  saveAlg->execute();
+}
+
+void EnggDiffGSASFittingModel::setObserver(
+    boost::shared_ptr<IEnggDiffGSASFittingObserver> observer) {
+  m_observer = observer;
+}
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingModel.h b/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingModel.h
new file mode 100644
index 00000000000..b8efb449f66
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingModel.h
@@ -0,0 +1,132 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "DllConfig.h"
+#include "EnggDiffGSASFittingWorker.h"
+#include "GSASIIRefineFitPeaksOutputProperties.h"
+#include "IEnggDiffGSASFittingModel.h"
+#include "IEnggDiffGSASFittingObserver.h"
+#include "RunMap.h"
+
+#include "MantidAPI/IAlgorithm_fwd.h"
+
+#include <QObject>
+#include <QThread>
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+class MANTIDQT_ENGGDIFFRACTION_DLL EnggDiffGSASFittingModel
+    : public QObject, // Must be a QObject to run GSASIIRefineFitPeaksWorker
+                      // asynchronously
+      public IEnggDiffGSASFittingModel {
+  Q_OBJECT
+
+  friend void EnggDiffGSASFittingWorker::doRefinements();
+
+public:
+  EnggDiffGSASFittingModel();
+
+  ~EnggDiffGSASFittingModel();
+
+  void setObserver(
+      boost::shared_ptr<IEnggDiffGSASFittingObserver> observer) override;
+
+  void doRefinements(
+      const std::vector<GSASIIRefineFitPeaksParameters> &params) override;
+
+  boost::optional<Mantid::API::ITableWorkspace_sptr>
+  getLatticeParams(const RunLabel &runLabel) const override;
+
+  boost::optional<double> getGamma(const RunLabel &runLabel) const override;
+
+  boost::optional<double> getRwp(const RunLabel &runLabel) const override;
+
+  boost::optional<double> getSigma(const RunLabel &runLabel) const override;
+
+  bool hasFitResultsForRun(const RunLabel &runLabel) const override;
+
+  Mantid::API::MatrixWorkspace_sptr
+  loadFocusedRun(const std::string &filename) const override;
+
+  void saveRefinementResultsToHDF5(
+      const Mantid::API::IAlgorithm_sptr successfulAlgorithm,
+      const std::vector<GSASIIRefineFitPeaksOutputProperties>
+          &refinementResultSets,
+      const std::string &filename) const override;
+
+protected:
+  /// The following methods are marked as protected so that they can be exposed
+  /// by a helper class in the tests
+
+  /// Add a lattice parameter table to the map
+  void addLatticeParams(const RunLabel &runLabel,
+                        const Mantid::API::ITableWorkspace_sptr &table);
+
+  /// Add a gamma value to the gamma map
+  void addGamma(const RunLabel &runLabel, const double gamma);
+
+  /// Add an rwp value to the rwp map
+  void addRwp(const RunLabel &runLabel, const double rwp);
+
+  /// Add a sigma value to the sigma map
+  void addSigma(const RunLabel &runLabel, const double sigma);
+
+protected slots:
+  void processRefinementsComplete(
+      Mantid::API::IAlgorithm_sptr alg,
+      const std::vector<GSASIIRefineFitPeaksOutputProperties>
+          &refinementResultSets);
+
+  void processRefinementFailed(const std::string &failureMessage);
+
+  void processRefinementSuccessful(
+      Mantid::API::IAlgorithm_sptr successfulAlgorithm,
+      const GSASIIRefineFitPeaksOutputProperties &refinementResults);
+
+  void processRefinementCancelled();
+
+private:
+  static constexpr double DEFAULT_PAWLEY_DMIN = 1;
+  static constexpr double DEFAULT_PAWLEY_NEGATIVE_WEIGHT = 0;
+  static const size_t MAX_BANKS = 3;
+
+  RunMap<MAX_BANKS, double> m_gammaMap;
+  RunMap<MAX_BANKS, Mantid::API::ITableWorkspace_sptr> m_latticeParamsMap;
+  RunMap<MAX_BANKS, double> m_rwpMap;
+  RunMap<MAX_BANKS, double> m_sigmaMap;
+
+  boost::shared_ptr<IEnggDiffGSASFittingObserver> m_observer;
+
+  std::unique_ptr<QThread> m_workerThread;
+
+  /// Add Rwp, sigma, gamma and lattice params table to their
+  /// respective RunMaps
+  void
+  addFitResultsToMaps(const RunLabel &runLabel, const double rwp,
+                      const double sigma, const double gamma,
+                      const Mantid::API::ITableWorkspace_sptr &latticeParams);
+
+  void deleteWorkerThread();
+
+  /// Run GSASIIRefineFitPeaks
+  std::pair<Mantid::API::IAlgorithm_sptr, GSASIIRefineFitPeaksOutputProperties>
+  doGSASRefinementAlgorithm(const GSASIIRefineFitPeaksParameters &params);
+
+  template <typename T>
+  boost::optional<T> getFromRunMapOptional(const RunMap<MAX_BANKS, T> &map,
+                                           const RunLabel &runLabel) const {
+    if (map.contains(runLabel)) {
+      return map.get(runLabel);
+    }
+    return boost::none;
+  }
+};
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingPresenter.cpp b/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingPresenter.cpp
new file mode 100644
index 00000000000..7c536da040a
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingPresenter.cpp
@@ -0,0 +1,301 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "EnggDiffGSASFittingPresenter.h"
+
+#include <utility>
+
+#include "EnggDiffGSASRefinementMethod.h"
+#include "MantidQtWidgets/Plotting/Qwt/QwtHelper.h"
+
+namespace {
+
+std::string addRunNumberToGSASIIProjectFile(
+    const std::string &filename,
+    const MantidQt::CustomInterfaces::RunLabel &runLabel) {
+  const auto dotPosition = filename.find_last_of(".");
+  return filename.substr(0, dotPosition) + "_" + runLabel.runNumber + "_" +
+         std::to_string(runLabel.bank) +
+         filename.substr(dotPosition, filename.length());
+}
+
+} // anonymous namespace
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+EnggDiffGSASFittingPresenter::EnggDiffGSASFittingPresenter(
+    std::unique_ptr<IEnggDiffGSASFittingModel> model,
+    IEnggDiffGSASFittingView *view,
+    boost::shared_ptr<IEnggDiffMultiRunFittingWidgetPresenter> multiRunWidget,
+    boost::shared_ptr<IEnggDiffractionParam> mainSettings)
+    : m_model(std::move(model)), m_multiRunWidget(std::move(multiRunWidget)),
+      m_mainSettings(std::move(mainSettings)), m_view(view),
+      m_viewHasClosed(false) {}
+
+EnggDiffGSASFittingPresenter::~EnggDiffGSASFittingPresenter() {}
+
+void EnggDiffGSASFittingPresenter::notify(
+    IEnggDiffGSASFittingPresenter::Notification notif) {
+
+  if (m_viewHasClosed) {
+    return;
+  }
+
+  switch (notif) {
+
+  case IEnggDiffGSASFittingPresenter::DoRefinement:
+    processDoRefinement();
+    break;
+
+  case IEnggDiffGSASFittingPresenter::LoadRun:
+    processLoadRun();
+    break;
+
+  case IEnggDiffGSASFittingPresenter::RefineAll:
+    processRefineAll();
+    break;
+
+  case IEnggDiffGSASFittingPresenter::SelectRun:
+    processSelectRun();
+    break;
+
+  case IEnggDiffGSASFittingPresenter::Start:
+    processStart();
+    break;
+
+  case IEnggDiffGSASFittingPresenter::ShutDown:
+    processShutDown();
+    break;
+  }
+}
+
+std::vector<GSASIIRefineFitPeaksParameters>
+EnggDiffGSASFittingPresenter::collectAllInputParameters() const {
+  const auto runLabels = m_multiRunWidget->getAllRunLabels();
+  std::vector<GSASIIRefineFitPeaksParameters> inputParams;
+  std::vector<std::string> GSASIIProjectFiles;
+  inputParams.reserve(runLabels.size());
+
+  const auto refinementMethod = m_view->getRefinementMethod();
+  const auto instParamFile = m_view->getInstrumentFileName();
+  const auto phaseFiles = m_view->getPhaseFileNames();
+  const auto pathToGSASII = m_view->getPathToGSASII();
+  const auto GSASIIProjectFile = m_view->getGSASIIProjectPath();
+  if (runLabels.size() == 1) {
+    GSASIIProjectFiles = std::vector<std::string>({GSASIIProjectFile});
+  } else {
+    GSASIIProjectFiles.reserve(runLabels.size());
+    for (const auto &runLabel : runLabels) {
+      GSASIIProjectFiles.emplace_back(
+          addRunNumberToGSASIIProjectFile(GSASIIProjectFile, runLabel));
+    }
+  }
+
+  const auto dMin = m_view->getPawleyDMin();
+  const auto negativeWeight = m_view->getPawleyNegativeWeight();
+  const auto xMin = m_view->getXMin();
+  const auto xMax = m_view->getXMax();
+  const auto refineSigma = m_view->getRefineSigma();
+  const auto refineGamma = m_view->getRefineGamma();
+
+  for (size_t i = 0; i < runLabels.size(); i++) {
+    const auto &runLabel = runLabels[i];
+    const auto inputWS = *(m_multiRunWidget->getFocusedRun(runLabel));
+
+    inputParams.emplace_back(inputWS, runLabel, refinementMethod, instParamFile,
+                             phaseFiles, pathToGSASII, GSASIIProjectFiles[i],
+                             dMin, negativeWeight, xMin, xMax, refineSigma,
+                             refineGamma);
+  }
+  return inputParams;
+}
+
+GSASIIRefineFitPeaksParameters
+EnggDiffGSASFittingPresenter::collectInputParameters(
+    const RunLabel &runLabel,
+    const Mantid::API::MatrixWorkspace_sptr &inputWS) const {
+  const auto refinementMethod = m_view->getRefinementMethod();
+  const auto instParamFile = m_view->getInstrumentFileName();
+  const auto phaseFiles = m_view->getPhaseFileNames();
+  const auto pathToGSASII = m_view->getPathToGSASII();
+  const auto GSASIIProjectFile = m_view->getGSASIIProjectPath();
+
+  const auto dMin = m_view->getPawleyDMin();
+  const auto negativeWeight = m_view->getPawleyNegativeWeight();
+  const auto xMin = m_view->getXMin();
+  const auto xMax = m_view->getXMax();
+  const auto refineSigma = m_view->getRefineSigma();
+  const auto refineGamma = m_view->getRefineGamma();
+
+  return GSASIIRefineFitPeaksParameters(inputWS, runLabel, refinementMethod,
+                                        instParamFile, phaseFiles, pathToGSASII,
+                                        GSASIIProjectFile, dMin, negativeWeight,
+                                        xMin, xMax, refineSigma, refineGamma);
+}
+
+void EnggDiffGSASFittingPresenter::displayFitResults(const RunLabel &runLabel) {
+  const auto latticeParams = m_model->getLatticeParams(runLabel);
+  const auto rwp = m_model->getRwp(runLabel);
+  const auto sigma = m_model->getSigma(runLabel);
+  const auto gamma = m_model->getGamma(runLabel);
+
+  if (!latticeParams || !rwp || !sigma || !gamma) {
+    m_view->userError("Invalid run identifier",
+                      "Unexpectedly tried to display fit results for invalid "
+                      "run, run number = " +
+                          runLabel.runNumber +
+                          ", bank ID = " + std::to_string(runLabel.bank) +
+                          ". Please contact the development team");
+    return;
+  }
+
+  m_view->displayLatticeParams(*latticeParams);
+  m_view->displayRwp(*rwp);
+  m_view->displaySigma(*sigma);
+  m_view->displayGamma(*gamma);
+}
+
+void EnggDiffGSASFittingPresenter::doRefinements(
+    const std::vector<GSASIIRefineFitPeaksParameters> &params) {
+  m_model->doRefinements(params);
+}
+
+void EnggDiffGSASFittingPresenter::notifyRefinementsComplete(
+    Mantid::API::IAlgorithm_sptr alg,
+    const std::vector<GSASIIRefineFitPeaksOutputProperties>
+        &refinementResultSets) {
+  if (!m_viewHasClosed) {
+    const auto numRuns = refinementResultSets.size();
+
+    if (numRuns > 1) {
+      std::vector<RunLabel> runLabels;
+      runLabels.reserve(numRuns);
+      for (const auto &refinementResults : refinementResultSets) {
+        runLabels.emplace_back(refinementResults.runLabel);
+      }
+      m_model->saveRefinementResultsToHDF5(
+          alg, refinementResultSets,
+          m_mainSettings->userHDFMultiRunFilename(runLabels));
+    }
+
+    m_view->setEnabled(true);
+    m_view->showStatus("Ready");
+  }
+}
+
+void EnggDiffGSASFittingPresenter::notifyRefinementCancelled() {
+  if (!m_viewHasClosed) {
+    m_view->setEnabled(true);
+    m_view->showStatus("Ready");
+  }
+}
+
+void EnggDiffGSASFittingPresenter::notifyRefinementFailed(
+    const std::string &failureMessage) {
+  if (!m_viewHasClosed) {
+    m_view->setEnabled(true);
+    m_view->userWarning("Refinement failed", failureMessage);
+    m_view->showStatus("Refinement failed");
+  }
+}
+
+void EnggDiffGSASFittingPresenter::notifyRefinementSuccessful(
+    const Mantid::API::IAlgorithm_sptr successfulAlgorithm,
+    const GSASIIRefineFitPeaksOutputProperties &refinementResults) {
+  if (!m_viewHasClosed) {
+    m_view->showStatus("Saving refinement results");
+    const auto filename = m_mainSettings->userHDFRunFilename(
+        refinementResults.runLabel.runNumber);
+
+    try {
+      m_model->saveRefinementResultsToHDF5(successfulAlgorithm,
+                                           {refinementResults}, filename);
+    } catch (std::exception &e) {
+      m_view->userWarning(
+          "Could not save refinement results",
+          std::string("Refinement was successful but saving results to "
+                      "HDF5 failed for the following reason:\n") +
+              e.what());
+    }
+    m_view->setEnabled(true);
+    m_view->showStatus("Ready");
+
+    m_multiRunWidget->addFittedPeaks(refinementResults.runLabel,
+                                     refinementResults.fittedPeaksWS);
+    displayFitResults(refinementResults.runLabel);
+  }
+}
+
+void EnggDiffGSASFittingPresenter::processDoRefinement() {
+  const auto runLabel = m_multiRunWidget->getSelectedRunLabel();
+  if (!runLabel) {
+    m_view->userWarning("No run selected",
+                        "Please select a run to do refinement on");
+    return;
+  }
+
+  const auto inputWSOptional = m_multiRunWidget->getFocusedRun(*runLabel);
+  if (!inputWSOptional) {
+    m_view->userError(
+        "Invalid run selected for refinement",
+        "Tried to run refinement on invalid focused run, run number " +
+            runLabel->runNumber + " and bank ID " +
+            std::to_string(runLabel->bank) +
+            ". Please contact the development team with this message");
+    return;
+  }
+
+  m_view->showStatus("Refining run");
+  const auto refinementParams =
+      collectInputParameters(*runLabel, *inputWSOptional);
+
+  m_view->setEnabled(false);
+  doRefinements({refinementParams});
+}
+
+void EnggDiffGSASFittingPresenter::processLoadRun() {
+  const auto focusedFileNames = m_view->getFocusedFileNames();
+
+  try {
+    for (const auto fileName : focusedFileNames) {
+      const auto focusedRun = m_model->loadFocusedRun(fileName);
+      m_multiRunWidget->addFocusedRun(focusedRun);
+    }
+  } catch (const std::exception &ex) {
+    m_view->userWarning("Could not load file", ex.what());
+  }
+}
+
+void EnggDiffGSASFittingPresenter::processRefineAll() {
+  const auto refinementParams = collectAllInputParameters();
+  if (refinementParams.size() == 0) {
+    m_view->userWarning("No runs loaded",
+                        "Please load at least one run before refining");
+    return;
+  }
+  m_view->showStatus("Refining run");
+  m_view->setEnabled(false);
+  doRefinements(refinementParams);
+}
+
+void EnggDiffGSASFittingPresenter::processSelectRun() {
+  const auto runLabel = m_multiRunWidget->getSelectedRunLabel();
+  if (runLabel && m_model->hasFitResultsForRun(*runLabel)) {
+    displayFitResults(*runLabel);
+  }
+}
+
+void EnggDiffGSASFittingPresenter::processStart() {
+  auto addMultiRunWidget = m_multiRunWidget->getWidgetAdder();
+  (*addMultiRunWidget)(*m_view);
+  m_view->showStatus("Ready");
+}
+
+void EnggDiffGSASFittingPresenter::processShutDown() { m_viewHasClosed = true; }
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingPresenter.h b/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingPresenter.h
new file mode 100644
index 00000000000..6b0c9308265
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingPresenter.h
@@ -0,0 +1,100 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "DllConfig.h"
+#include "GSASIIRefineFitPeaksOutputProperties.h"
+#include "IEnggDiffGSASFittingModel.h"
+#include "IEnggDiffGSASFittingPresenter.h"
+#include "IEnggDiffGSASFittingView.h"
+#include "IEnggDiffMultiRunFittingWidgetPresenter.h"
+#include "IEnggDiffractionParam.h"
+
+#include "MantidAPI/MatrixWorkspace_fwd.h"
+
+#include <boost/shared_ptr.hpp>
+#include <memory>
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+// needs to be dll-exported for the tests
+class MANTIDQT_ENGGDIFFRACTION_DLL EnggDiffGSASFittingPresenter
+    : public IEnggDiffGSASFittingPresenter {
+
+public:
+  EnggDiffGSASFittingPresenter(
+      std::unique_ptr<IEnggDiffGSASFittingModel> model,
+      IEnggDiffGSASFittingView *view,
+      boost::shared_ptr<IEnggDiffMultiRunFittingWidgetPresenter> multiRunWidget,
+      boost::shared_ptr<IEnggDiffractionParam> mainSettings);
+
+  EnggDiffGSASFittingPresenter(EnggDiffGSASFittingPresenter &&other) = default;
+
+  EnggDiffGSASFittingPresenter &
+  operator=(EnggDiffGSASFittingPresenter &&other) = default;
+
+  ~EnggDiffGSASFittingPresenter() override;
+
+  void notify(IEnggDiffGSASFittingPresenter::Notification notif) override;
+
+  void notifyRefinementsComplete(
+      Mantid::API::IAlgorithm_sptr alg,
+      const std::vector<GSASIIRefineFitPeaksOutputProperties>
+          &refinementResultSets) override;
+
+  void notifyRefinementSuccessful(
+      const Mantid::API::IAlgorithm_sptr successfulAlgorithm,
+      const GSASIIRefineFitPeaksOutputProperties &refinementResults) override;
+
+  void notifyRefinementFailed(const std::string &failureMessage) override;
+
+  void notifyRefinementCancelled() override;
+
+private:
+  void processDoRefinement();
+  void processLoadRun();
+  void processRefineAll();
+  void processSelectRun();
+  void processShutDown();
+  void processStart();
+
+  /// Collect GSASIIRefineFitPeaks parameters for all runs loaded in
+  std::vector<GSASIIRefineFitPeaksParameters> collectAllInputParameters() const;
+
+  /// Collect GSASIIRefineFitPeaks input parameters for a given run from the
+  /// presenter's various children
+  GSASIIRefineFitPeaksParameters
+  collectInputParameters(const RunLabel &runLabel,
+                         const Mantid::API::MatrixWorkspace_sptr &ws) const;
+
+  /**
+   Perform refinements on a number of runs
+   @param params Input parameters for each run to pass to GSASIIRefineFitPeaks
+   */
+  void doRefinements(const std::vector<GSASIIRefineFitPeaksParameters> &params);
+
+  /**
+   Overplot fitted peaks for a run, and display lattice parameters and Rwp in
+   the view
+   @param runLabel Run number and bank ID of the run to display
+  */
+  void displayFitResults(const RunLabel &runLabel);
+
+  std::unique_ptr<IEnggDiffGSASFittingModel> m_model;
+
+  boost::shared_ptr<IEnggDiffMultiRunFittingWidgetPresenter> m_multiRunWidget;
+
+  boost::shared_ptr<IEnggDiffractionParam> m_mainSettings;
+
+  IEnggDiffGSASFittingView *m_view;
+
+  bool m_viewHasClosed;
+};
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingViewQtWidget.cpp b/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingViewQtWidget.cpp
new file mode 100644
index 00000000000..c3f88619fe0
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingViewQtWidget.cpp
@@ -0,0 +1,389 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "EnggDiffGSASFittingViewQtWidget.h"
+#include "EnggDiffGSASFittingModel.h"
+#include "EnggDiffGSASFittingPresenter.h"
+#include "EnggDiffMultiRunFittingQtWidget.h"
+#include "EnggDiffMultiRunFittingWidgetModel.h"
+#include "EnggDiffMultiRunFittingWidgetPresenter.h"
+
+#include "MantidAPI/TableRow.h"
+
+#include <QFileDialog>
+#include <QSettings>
+#include <boost/make_shared.hpp>
+#include <utility>
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+EnggDiffGSASFittingViewQtWidget::EnggDiffGSASFittingViewQtWidget(
+    boost::shared_ptr<IEnggDiffractionUserMsg> userMessageProvider,
+    const boost::shared_ptr<IEnggDiffractionPythonRunner> &pythonRunner,
+    boost::shared_ptr<IEnggDiffractionParam> mainSettings)
+    : m_userMessageProvider(std::move(userMessageProvider)) {
+
+  auto multiRunWidgetModel =
+      std::make_unique<EnggDiffMultiRunFittingWidgetModel>();
+  m_multiRunWidgetView =
+      std::make_unique<EnggDiffMultiRunFittingQtWidget>(pythonRunner);
+
+  auto multiRunWidgetPresenter =
+      boost::make_shared<EnggDiffMultiRunFittingWidgetPresenter>(
+          std::move(multiRunWidgetModel), m_multiRunWidgetView.get());
+
+  m_multiRunWidgetView->setPresenter(multiRunWidgetPresenter);
+  m_multiRunWidgetView->setMessageProvider(m_userMessageProvider);
+
+  setupUI();
+
+  auto model = std::make_unique<EnggDiffGSASFittingModel>();
+  auto *model_ptr = model.get();
+  m_presenter = boost::make_shared<EnggDiffGSASFittingPresenter>(
+      std::move(model), this, multiRunWidgetPresenter, mainSettings);
+  model_ptr->setObserver(m_presenter);
+  m_presenter->notify(IEnggDiffGSASFittingPresenter::Start);
+}
+
+EnggDiffGSASFittingViewQtWidget::~EnggDiffGSASFittingViewQtWidget() {
+  QSettings settings(tr(SETTINGS_NAME));
+  const auto gsasHome = m_ui.lineEdit_gsasHome->text();
+  settings.setValue(tr(GSAS_HOME_SETTING_NAME), gsasHome);
+
+  m_presenter->notify(IEnggDiffGSASFittingPresenter::ShutDown);
+}
+
+void EnggDiffGSASFittingViewQtWidget::addWidget(
+    IEnggDiffMultiRunFittingWidgetView *widget) {
+  auto *qWidget = dynamic_cast<QWidget *>(widget);
+  m_ui.gridLayout_multiRunWidget->addWidget(qWidget, 0, 0);
+}
+
+void EnggDiffGSASFittingViewQtWidget::browseFocusedRun() {
+  const auto filenames(
+      QFileDialog::getOpenFileNames(this, tr("Find focused run files")));
+  setFocusedRunFileNames(filenames);
+}
+
+void EnggDiffGSASFittingViewQtWidget::browseGSASHome() {
+  auto directoryName(QFileDialog::getExistingDirectory(
+      this, tr("GSAS-II installation directory")));
+  m_ui.lineEdit_gsasHome->setText(directoryName);
+}
+
+void EnggDiffGSASFittingViewQtWidget::browseGSASProj() {
+  auto filename(QFileDialog::getSaveFileName(
+      this, tr("Output GSAS-II project file"), "", "GSAS-II Project (*.gpx)"));
+  if (!filename.endsWith(".gpx")) {
+    filename.append(".gpx");
+  }
+  m_ui.lineEdit_gsasProjPath->setText(filename);
+}
+
+void EnggDiffGSASFittingViewQtWidget::browseInstParams() {
+  const auto filename(
+      QFileDialog::getOpenFileName(this, tr("Instrument parameter file"), "",
+                                   "Instrument parameter file (*.par *.prm)"));
+  m_ui.lineEdit_instParamsFile->setText(filename);
+}
+
+void EnggDiffGSASFittingViewQtWidget::browsePhaseFiles() {
+  const auto filenames(QFileDialog::getOpenFileNames(
+      this, tr("Phase files"), "", "Phase files (*.cif)"));
+  m_ui.lineEdit_phaseFiles->setText(filenames.join(tr(",")));
+}
+
+void EnggDiffGSASFittingViewQtWidget::disableLoadIfInputEmpty() {
+  setLoadEnabled(!runFileLineEditEmpty());
+}
+
+void EnggDiffGSASFittingViewQtWidget::displayLatticeParams(
+    const Mantid::API::ITableWorkspace_sptr latticeParams) const {
+  double length_a, length_b, length_c, angle_alpha, angle_beta, angle_gamma;
+  Mantid::API::TableRow row = latticeParams->getFirstRow();
+  row >> length_a >> length_b >> length_c >> angle_alpha >> angle_beta >>
+      angle_gamma;
+  m_ui.lineEdit_latticeParamA->setText(QString::number(length_a));
+  m_ui.lineEdit_latticeParamB->setText(QString::number(length_b));
+  m_ui.lineEdit_latticeParamC->setText(QString::number(length_c));
+  m_ui.lineEdit_latticeParamAlpha->setText(QString::number(angle_alpha));
+  m_ui.lineEdit_latticeParamBeta->setText(QString::number(angle_beta));
+  m_ui.lineEdit_latticeParamGamma->setText(QString::number(angle_gamma));
+}
+
+void EnggDiffGSASFittingViewQtWidget::displayGamma(const double gamma) const {
+  m_ui.lineEdit_gamma->setText(QString::number(gamma));
+}
+
+void EnggDiffGSASFittingViewQtWidget::displayRwp(const double rwp) const {
+  m_ui.lineEdit_rwp->setText(QString::number(rwp));
+}
+
+void EnggDiffGSASFittingViewQtWidget::displaySigma(const double sigma) const {
+  m_ui.lineEdit_sigma->setText(QString::number(sigma));
+}
+
+void EnggDiffGSASFittingViewQtWidget::doRefinement() {
+  m_presenter->notify(IEnggDiffGSASFittingPresenter::DoRefinement);
+}
+
+std::vector<std::string>
+EnggDiffGSASFittingViewQtWidget::getFocusedFileNames() const {
+  const auto filenamesQStringList = m_ui.lineEdit_runFile->text().split(",");
+  std::vector<std::string> filenames;
+  filenames.reserve(filenamesQStringList.size());
+  for (const auto &filenameQString : filenamesQStringList) {
+    filenames.emplace_back(filenameQString.toStdString());
+  }
+  return filenames;
+}
+
+std::string EnggDiffGSASFittingViewQtWidget::getGSASIIProjectPath() const {
+  return m_ui.lineEdit_gsasProjPath->text().toStdString();
+}
+
+std::string EnggDiffGSASFittingViewQtWidget::getInstrumentFileName() const {
+  return m_ui.lineEdit_instParamsFile->text().toStdString();
+}
+
+std::string EnggDiffGSASFittingViewQtWidget::getPathToGSASII() const {
+  return m_ui.lineEdit_gsasHome->text().toStdString();
+}
+
+boost::optional<double> EnggDiffGSASFittingViewQtWidget::getPawleyDMin() const {
+  const auto pawleyDMinString = m_ui.lineEdit_pawleyDMin->text();
+  if (pawleyDMinString.isEmpty()) {
+    return boost::none;
+  }
+
+  bool conversionSuccessful(false);
+  const auto pawleyDMin = pawleyDMinString.toDouble(&conversionSuccessful);
+  if (!conversionSuccessful) {
+    userWarning("Invalid Pawley DMin", "Invalid entry for Pawley DMin \"" +
+                                           pawleyDMinString.toStdString() +
+                                           "\". Using default");
+    return boost::none;
+  }
+
+  return pawleyDMin;
+}
+
+boost::optional<double>
+EnggDiffGSASFittingViewQtWidget::getPawleyNegativeWeight() const {
+  const auto pawleyNegWeightString = m_ui.lineEdit_pawleyNegativeWeight->text();
+  if (pawleyNegWeightString.isEmpty()) {
+    return boost::none;
+  }
+
+  bool conversionSuccessful(false);
+  const auto pawleyNegWeight =
+      pawleyNegWeightString.toDouble(&conversionSuccessful);
+  if (!conversionSuccessful) {
+    userWarning("Invalid Pawley negative weight",
+                "Invalid entry for negative weight \"" +
+                    pawleyNegWeightString.toStdString() + "\". Using default");
+    return boost::none;
+  }
+
+  return pawleyNegWeight;
+}
+
+std::vector<std::string>
+EnggDiffGSASFittingViewQtWidget::getPhaseFileNames() const {
+  std::vector<std::string> fileNameStrings;
+  const auto fileNameQStrings = m_ui.lineEdit_phaseFiles->text().split(",");
+  fileNameStrings.reserve(fileNameQStrings.size());
+  for (const auto &fileNameQString : fileNameQStrings) {
+    fileNameStrings.emplace_back(fileNameQString.toStdString());
+  }
+  return fileNameStrings;
+}
+
+bool EnggDiffGSASFittingViewQtWidget::getRefineGamma() const {
+  return m_ui.checkBox_refineGamma->isChecked();
+}
+
+bool EnggDiffGSASFittingViewQtWidget::getRefineSigma() const {
+  return m_ui.checkBox_refineSigma->isChecked();
+}
+
+GSASRefinementMethod
+EnggDiffGSASFittingViewQtWidget::getRefinementMethod() const {
+  const auto refinementMethod =
+      m_ui.comboBox_refinementMethod->currentText().toStdString();
+  if (refinementMethod == "Pawley") {
+    return GSASRefinementMethod::PAWLEY;
+  } else if (refinementMethod == "Rietveld") {
+    return GSASRefinementMethod::RIETVELD;
+  } else {
+    userError("Unexpected refinement method",
+              "Unexpected refinement method \"" + refinementMethod +
+                  "\" selected. Please contact development team with this "
+                  "message. If you choose to continue, Pawley will be used");
+    return GSASRefinementMethod::PAWLEY;
+  }
+}
+
+boost::optional<double> EnggDiffGSASFittingViewQtWidget::getXMax() const {
+  const auto xMaxString = m_ui.lineEdit_xMax->text();
+  if (xMaxString.isEmpty()) {
+    return boost::none;
+  }
+
+  bool conversionSuccessful(false);
+  const auto xMax = xMaxString.toDouble(&conversionSuccessful);
+  if (!conversionSuccessful) {
+    userWarning("Invalid XMax", "Invalid entry for XMax \"" +
+                                    xMaxString.toStdString() +
+                                    "\". Using default");
+    return boost::none;
+  }
+
+  return xMax;
+}
+
+boost::optional<double> EnggDiffGSASFittingViewQtWidget::getXMin() const {
+  const auto xMinString = m_ui.lineEdit_xMin->text();
+  if (xMinString.isEmpty()) {
+    return boost::none;
+  }
+
+  bool conversionSuccessful(false);
+  const auto xMin = xMinString.toDouble(&conversionSuccessful);
+  if (!conversionSuccessful) {
+    userWarning("Invalid XMin", "Invalid entry for XMin \"" +
+                                    xMinString.toStdString() +
+                                    "\". Using default");
+    return boost::none;
+  }
+
+  return xMin;
+}
+
+void EnggDiffGSASFittingViewQtWidget::loadFocusedRun() {
+  m_presenter->notify(IEnggDiffGSASFittingPresenter::LoadRun);
+}
+
+void EnggDiffGSASFittingViewQtWidget::refineAll() {
+  m_presenter->notify(IEnggDiffGSASFittingPresenter::RefineAll);
+}
+
+bool EnggDiffGSASFittingViewQtWidget::runFileLineEditEmpty() const {
+  return m_ui.lineEdit_runFile->text().isEmpty();
+}
+
+void EnggDiffGSASFittingViewQtWidget::selectRun() {
+  m_presenter->notify(IEnggDiffGSASFittingPresenter::SelectRun);
+}
+
+void EnggDiffGSASFittingViewQtWidget::setEnabled(const bool enabled) {
+  m_ui.lineEdit_runFile->setEnabled(enabled);
+  m_ui.pushButton_browseRunFile->setEnabled(enabled);
+  setLoadEnabled(enabled && !runFileLineEditEmpty());
+
+  m_ui.lineEdit_instParamsFile->setEnabled(enabled);
+  m_ui.pushButton_browseInstParams->setEnabled(enabled);
+
+  m_ui.lineEdit_phaseFiles->setEnabled(enabled);
+  m_ui.pushButton_browsePhaseFiles->setEnabled(enabled);
+
+  m_ui.lineEdit_gsasProjPath->setEnabled(enabled);
+  m_ui.pushButton_gsasProjPath->setEnabled(enabled);
+
+  m_ui.lineEdit_gsasHome->setEnabled(enabled);
+  m_ui.pushButton_browseGSASHome->setEnabled(enabled);
+
+  m_ui.comboBox_refinementMethod->setEnabled(enabled);
+
+  m_ui.lineEdit_pawleyDMin->setEnabled(enabled);
+  m_ui.lineEdit_pawleyNegativeWeight->setEnabled(enabled);
+
+  m_ui.lineEdit_xMin->setEnabled(enabled);
+  m_ui.lineEdit_xMax->setEnabled(enabled);
+
+  m_ui.checkBox_refineSigma->setEnabled(enabled);
+  m_ui.checkBox_refineGamma->setEnabled(enabled);
+
+  m_ui.pushButton_doRefinement->setEnabled(enabled);
+  m_ui.pushButton_refineAll->setEnabled(enabled);
+
+  m_multiRunWidgetView->setEnabled(enabled);
+}
+
+void EnggDiffGSASFittingViewQtWidget::setFocusedRunFileNames(
+    const QStringList &filenames) {
+  m_ui.lineEdit_runFile->setText(filenames.join(tr(",")));
+}
+
+void EnggDiffGSASFittingViewQtWidget::setLoadEnabled(const bool enabled) {
+  if (enabled) {
+    m_ui.pushButton_loadRun->setEnabled(true);
+    m_ui.pushButton_loadRun->setToolTip(tr("Load focused run file"));
+  } else {
+    m_ui.pushButton_loadRun->setEnabled(false);
+    m_ui.pushButton_loadRun->setToolTip(
+        tr("Please specify a file to load via the browse menu or by typing the "
+           "full path to the file in the text field"));
+  }
+}
+
+void EnggDiffGSASFittingViewQtWidget::setupUI() {
+  m_ui.setupUi(this);
+  connect(m_ui.pushButton_browseRunFile, SIGNAL(clicked()), this,
+          SLOT(browseFocusedRun()));
+  connect(m_ui.pushButton_loadRun, SIGNAL(clicked()), this,
+          SLOT(loadFocusedRun()));
+  connect(m_ui.lineEdit_runFile, SIGNAL(textChanged(const QString &)), this,
+          SLOT(disableLoadIfInputEmpty()));
+
+  connect(m_ui.pushButton_browseInstParams, SIGNAL(clicked()), this,
+          SLOT(browseInstParams()));
+  connect(m_ui.pushButton_browsePhaseFiles, SIGNAL(clicked()), this,
+          SLOT(browsePhaseFiles()));
+  connect(m_ui.pushButton_gsasProjPath, SIGNAL(clicked()), this,
+          SLOT(browseGSASProj()));
+  connect(m_ui.pushButton_browseGSASHome, SIGNAL(clicked()), this,
+          SLOT(browseGSASHome()));
+
+  connect(m_ui.pushButton_doRefinement, SIGNAL(clicked()), this,
+          SLOT(doRefinement()));
+  connect(m_ui.pushButton_refineAll, SIGNAL(clicked()), this,
+          SLOT(refineAll()));
+
+  connect(m_multiRunWidgetView.get(), SIGNAL(runSelected()), this,
+          SLOT(selectRun()));
+
+  QSettings settings(tr(SETTINGS_NAME));
+  if (settings.contains(tr(GSAS_HOME_SETTING_NAME))) {
+    m_ui.lineEdit_gsasHome->setText(
+        settings.value(tr(GSAS_HOME_SETTING_NAME)).toString());
+  }
+}
+
+void EnggDiffGSASFittingViewQtWidget::showStatus(
+    const std::string &status) const {
+  m_userMessageProvider->showStatus(status);
+}
+
+void EnggDiffGSASFittingViewQtWidget::userError(
+    const std::string &errorTitle, const std::string &errorDescription) const {
+  m_userMessageProvider->userError(errorTitle, errorDescription);
+}
+
+void EnggDiffGSASFittingViewQtWidget::userWarning(
+    const std::string &warningTitle,
+    const std::string &warningDescription) const {
+  m_userMessageProvider->userWarning(warningTitle, warningDescription);
+}
+
+const char EnggDiffGSASFittingViewQtWidget::GSAS_HOME_SETTING_NAME[] =
+    "GSAS_HOME";
+const char EnggDiffGSASFittingViewQtWidget::SETTINGS_NAME[] =
+    "EnggGUIGSASTabSettings";
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingViewQtWidget.h b/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingViewQtWidget.h
new file mode 100644
index 00000000000..e8807d63291
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffGSASFittingViewQtWidget.h
@@ -0,0 +1,118 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "DllConfig.h"
+#include "EnggDiffMultiRunFittingQtWidget.h"
+#include "IEnggDiffGSASFittingPresenter.h"
+#include "IEnggDiffGSASFittingView.h"
+#include "IEnggDiffractionParam.h"
+#include "IEnggDiffractionPythonRunner.h"
+#include "IEnggDiffractionUserMsg.h"
+
+#include <boost/shared_ptr.hpp>
+#include <qwt_plot_curve.h>
+#include <qwt_plot_zoomer.h>
+
+#include "ui_EnggDiffractionQtTabGSAS.h"
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+class MANTIDQT_ENGGDIFFRACTION_DLL EnggDiffGSASFittingViewQtWidget
+    : public QWidget,
+      public IEnggDiffGSASFittingView {
+  Q_OBJECT
+
+public:
+  EnggDiffGSASFittingViewQtWidget(
+      boost::shared_ptr<IEnggDiffractionUserMsg> userMessageProvider,
+      const boost::shared_ptr<IEnggDiffractionPythonRunner> &pythonRunner,
+      boost::shared_ptr<IEnggDiffractionParam> mainSettings);
+
+  ~EnggDiffGSASFittingViewQtWidget() override;
+
+  void addWidget(IEnggDiffMultiRunFittingWidgetView *widget) override;
+
+  void displayLatticeParams(
+      const Mantid::API::ITableWorkspace_sptr latticeParams) const override;
+
+  void displayGamma(const double gamma) const override;
+
+  void displayRwp(const double rwp) const override;
+
+  void displaySigma(const double sigma) const override;
+
+  std::vector<std::string> getFocusedFileNames() const override;
+
+  std::string getGSASIIProjectPath() const override;
+
+  std::string getInstrumentFileName() const override;
+
+  std::string getPathToGSASII() const override;
+
+  boost::optional<double> getPawleyDMin() const override;
+
+  boost::optional<double> getPawleyNegativeWeight() const override;
+
+  std::vector<std::string> getPhaseFileNames() const override;
+
+  GSASRefinementMethod getRefinementMethod() const override;
+
+  bool getRefineGamma() const override;
+
+  bool getRefineSigma() const override;
+
+  boost::optional<double> getXMax() const override;
+
+  boost::optional<double> getXMin() const override;
+
+  void setEnabled(const bool enabled) override;
+
+  void showStatus(const std::string &status) const override;
+
+  void userError(const std::string &errorTitle,
+                 const std::string &errorDescription) const override;
+
+  void userWarning(const std::string &warningTitle,
+                   const std::string &warningDescription) const override;
+
+private slots:
+  void browseFocusedRun();
+  void browseGSASHome();
+  void browseGSASProj();
+  void browseInstParams();
+  void browsePhaseFiles();
+  void disableLoadIfInputEmpty();
+  void doRefinement();
+  void loadFocusedRun();
+  void refineAll();
+  void selectRun();
+
+private:
+  bool runFileLineEditEmpty() const;
+
+  void setLoadEnabled(const bool enabled);
+
+  static const char GSAS_HOME_SETTING_NAME[];
+  static const char SETTINGS_NAME[];
+
+  boost::shared_ptr<EnggDiffMultiRunFittingQtWidget> m_multiRunWidgetView;
+
+  boost::shared_ptr<IEnggDiffGSASFittingPresenter> m_presenter;
+
+  Ui::EnggDiffractionQtTabGSAS m_ui;
+
+  boost::shared_ptr<IEnggDiffractionUserMsg> m_userMessageProvider;
+
+  void setFocusedRunFileNames(const QStringList &filenames);
+
+  void setupUI();
+};
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffMultiRunFittingQtWidget.cpp b/qt/scientific_interfaces/EnggDiffraction/EnggDiffMultiRunFittingQtWidget.cpp
new file mode 100644
index 00000000000..fc14fa9b51e
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffMultiRunFittingQtWidget.cpp
@@ -0,0 +1,255 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "EnggDiffMultiRunFittingQtWidget.h"
+
+#include <utility>
+
+namespace {
+
+MantidQt::CustomInterfaces::RunLabel
+parseListWidgetItem(const QString &listWidgetItem) {
+  const auto pieces = listWidgetItem.split("_");
+  if (pieces.size() != 2) {
+    throw std::runtime_error(
+        "Unexpected run label: \"" + listWidgetItem.toStdString() +
+        "\". Please contact the development team with this message");
+  }
+  return MantidQt::CustomInterfaces::RunLabel(pieces[0].toStdString(),
+                                              pieces[1].toUInt());
+}
+
+} // anonymous namespace
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+EnggDiffMultiRunFittingQtWidget::EnggDiffMultiRunFittingQtWidget(
+    boost::shared_ptr<IEnggDiffractionPythonRunner> pythonRunner)
+    : m_pythonRunner(std::move(pythonRunner)) {
+  setupUI();
+
+  m_zoomTool = std::make_unique<QwtPlotZoomer>(
+      QwtPlot::xBottom, QwtPlot::yLeft,
+      QwtPicker::DragSelection | QwtPicker::CornerToCorner,
+      QwtPicker::AlwaysOff, m_ui.plotArea->canvas());
+  m_zoomTool->setRubberBandPen(QPen(Qt::black));
+  m_zoomTool->setEnabled(false);
+}
+
+EnggDiffMultiRunFittingQtWidget::~EnggDiffMultiRunFittingQtWidget() {
+  cleanUpPlot();
+}
+
+void EnggDiffMultiRunFittingQtWidget::cleanUpPlot() {
+  for (auto &curve : m_focusedRunCurves) {
+    curve->detach();
+  }
+  m_focusedRunCurves.clear();
+  for (auto &curve : m_fittedPeaksCurves) {
+    curve->detach();
+  }
+  m_fittedPeaksCurves.clear();
+}
+
+std::vector<RunLabel> EnggDiffMultiRunFittingQtWidget::getAllRunLabels() const {
+  std::vector<RunLabel> runLabels;
+  runLabels.reserve(m_ui.listWidget_runLabels->count());
+
+  for (int i = 0; i < m_ui.listWidget_runLabels->count(); i++) {
+    const auto currentLabel = m_ui.listWidget_runLabels->item(i)->text();
+    runLabels.emplace_back(parseListWidgetItem(currentLabel));
+  }
+  return runLabels;
+}
+
+boost::optional<RunLabel>
+EnggDiffMultiRunFittingQtWidget::getSelectedRunLabel() const {
+  if (hasSelectedRunLabel()) {
+    const auto currentLabel = m_ui.listWidget_runLabels->currentItem()->text();
+    return parseListWidgetItem(currentLabel);
+  } else {
+    return boost::none;
+  }
+}
+
+void EnggDiffMultiRunFittingQtWidget::reportNoRunSelectedForPlot() {
+  userError("No run selected",
+            "Please select a run from the list before plotting");
+}
+
+void EnggDiffMultiRunFittingQtWidget::reportPlotInvalidFittedPeaks(
+    const RunLabel &runLabel) {
+  userError("Invalid fitted peaks identifier",
+            "Tried to plot invalid fitted peaks, run number " +
+                runLabel.runNumber + " and bank ID " +
+                std::to_string(runLabel.bank) +
+                ". Please contact the development team with this message");
+}
+
+void EnggDiffMultiRunFittingQtWidget::reportPlotInvalidFocusedRun(
+    const RunLabel &runLabel) {
+  userError("Invalid focused run identifier",
+            "Tried to plot invalid focused run, run number " +
+                runLabel.runNumber + " and bank ID " +
+                std::to_string(runLabel.bank) +
+                ". Please contact the development team with this message");
+}
+
+bool EnggDiffMultiRunFittingQtWidget::hasSelectedRunLabel() const {
+  return m_ui.listWidget_runLabels->selectedItems().size() != 0;
+}
+
+void EnggDiffMultiRunFittingQtWidget::plotFittedPeaksStateChanged() {
+  m_presenter->notify(IEnggDiffMultiRunFittingWidgetPresenter::Notification::
+                          PlotPeaksStateChanged);
+}
+
+void EnggDiffMultiRunFittingQtWidget::plotFittedPeaks(
+    const std::vector<boost::shared_ptr<QwtData>> &curves) {
+  for (const auto &curve : curves) {
+    auto plotCurve = std::make_unique<QwtPlotCurve>();
+
+    plotCurve->setPen(QColor(Qt::red));
+    plotCurve->setData(*curve);
+    plotCurve->attach(m_ui.plotArea);
+    m_fittedPeaksCurves.emplace_back(std::move(plotCurve));
+  }
+  m_ui.plotArea->replot();
+  m_zoomTool->setZoomBase();
+  m_zoomTool->setEnabled(true);
+}
+
+void EnggDiffMultiRunFittingQtWidget::processPlotToSeparateWindow() {
+  m_presenter->notify(IEnggDiffMultiRunFittingWidgetPresenter::Notification::
+                          PlotToSeparateWindow);
+}
+
+void EnggDiffMultiRunFittingQtWidget::plotFocusedRun(
+    const std::vector<boost::shared_ptr<QwtData>> &curves) {
+  for (const auto &curve : curves) {
+    auto plotCurve = std::make_unique<QwtPlotCurve>();
+
+    plotCurve->setData(*curve);
+    plotCurve->attach(m_ui.plotArea);
+    m_focusedRunCurves.emplace_back(std::move(plotCurve));
+  }
+  m_ui.plotArea->replot();
+  m_zoomTool->setZoomBase();
+  m_zoomTool->setEnabled(true);
+}
+
+void EnggDiffMultiRunFittingQtWidget::plotToSeparateWindow(
+    const std::string &focusedRunName,
+    const boost::optional<std::string> fittedPeaksName) {
+
+  std::string plotCode = "ws1 = \"" + focusedRunName + "\"\n";
+
+  plotCode += "workspaceToPlot = \"engg_gui_separate_plot_ws\"\n"
+
+              "if (mtd.doesExist(workspaceToPlot)):\n"
+              "    DeleteWorkspace(workspaceToPlot)\n"
+
+              "ExtractSingleSpectrum(InputWorkspace=ws1, WorkspaceIndex=0, "
+              "OutputWorkspace=workspaceToPlot)\n"
+
+              "spectra_to_plot = [0]\n";
+
+  if (fittedPeaksName) {
+    plotCode += "ws2 = \"" + *fittedPeaksName + "\"\n";
+    plotCode +=
+        "ws2_spectrum = ExtractSingleSpectrum(InputWorkspace=ws2, "
+        "WorkspaceIndex=0, StoreInADS=False)\n"
+
+        "AppendSpectra(InputWorkspace1=workspaceToPlot, "
+        "InputWorkspace2=ws2_spectrum, OutputWorkspace=workspaceToPlot)\n"
+
+        "DeleteWorkspace(ws2_spectrum)\n"
+        "spectra_to_plot = [0, 1]\n";
+  }
+
+  plotCode +=
+      "plot = plotSpectrum(workspaceToPlot, spectra_to_plot).activeLayer()\n"
+      "plot.setTitle(\"Engg GUI Fitting Workspaces\")\n";
+  m_pythonRunner->enggRunPythonCode(plotCode);
+}
+
+void EnggDiffMultiRunFittingQtWidget::processRemoveRun() {
+  emit removeRunClicked();
+  m_presenter->notify(
+      IEnggDiffMultiRunFittingWidgetPresenter::Notification::RemoveRun);
+}
+
+void EnggDiffMultiRunFittingQtWidget::processSelectRun() {
+  emit runSelected();
+  m_presenter->notify(
+      IEnggDiffMultiRunFittingWidgetPresenter::Notification::SelectRun);
+}
+
+void EnggDiffMultiRunFittingQtWidget::resetCanvas() {
+  cleanUpPlot();
+  m_ui.plotArea->replot();
+  resetPlotZoomLevel();
+}
+
+void EnggDiffMultiRunFittingQtWidget::resetPlotZoomLevel() {
+  m_ui.plotArea->setAxisAutoScale(QwtPlot::xBottom);
+  m_ui.plotArea->setAxisAutoScale(QwtPlot::yLeft);
+  m_zoomTool->setZoomBase(true);
+}
+
+void EnggDiffMultiRunFittingQtWidget::setEnabled(const bool enabled) {
+  m_ui.listWidget_runLabels->setEnabled(enabled);
+  m_ui.pushButton_removeRun->setEnabled(enabled);
+  m_ui.pushButton_plotToSeparateWindow->setEnabled(enabled);
+  m_ui.checkBox_plotFittedPeaks->setEnabled(enabled);
+  m_zoomTool->setEnabled(enabled);
+}
+
+void EnggDiffMultiRunFittingQtWidget::setMessageProvider(
+    boost::shared_ptr<IEnggDiffractionUserMsg> messageProvider) {
+  m_userMessageProvider = messageProvider;
+}
+
+void EnggDiffMultiRunFittingQtWidget::setPresenter(
+    boost::shared_ptr<IEnggDiffMultiRunFittingWidgetPresenter> presenter) {
+  m_presenter = presenter;
+}
+
+void EnggDiffMultiRunFittingQtWidget::setupUI() {
+  m_ui.setupUi(this);
+
+  connect(m_ui.listWidget_runLabels, SIGNAL(itemSelectionChanged()), this,
+          SLOT(processSelectRun()));
+  connect(m_ui.checkBox_plotFittedPeaks, SIGNAL(stateChanged(int)), this,
+          SLOT(plotFittedPeaksStateChanged()));
+  connect(m_ui.pushButton_removeRun, SIGNAL(clicked()), this,
+          SLOT(processRemoveRun()));
+  connect(m_ui.pushButton_plotToSeparateWindow, SIGNAL(clicked()), this,
+          SLOT(processPlotToSeparateWindow()));
+}
+
+bool EnggDiffMultiRunFittingQtWidget::showFitResultsSelected() const {
+  return m_ui.checkBox_plotFittedPeaks->isChecked();
+}
+
+void EnggDiffMultiRunFittingQtWidget::updateRunList(
+    const std::vector<RunLabel> &runLabels) {
+  m_ui.listWidget_runLabels->clear();
+  for (const auto &runLabel : runLabels) {
+    const auto labelStr = QString(runLabel.runNumber.c_str()) + tr("_") +
+                          QString::number(runLabel.bank);
+    m_ui.listWidget_runLabels->addItem(labelStr);
+  }
+}
+
+void EnggDiffMultiRunFittingQtWidget::userError(
+    const std::string &errorTitle, const std::string &errorDescription) {
+  m_userMessageProvider->userError(errorTitle, errorDescription);
+}
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffMultiRunFittingWidgetPresenter.cpp b/qt/scientific_interfaces/EnggDiffraction/EnggDiffMultiRunFittingWidgetPresenter.cpp
new file mode 100644
index 00000000000..721de6b05ca
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffMultiRunFittingWidgetPresenter.cpp
@@ -0,0 +1,227 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "EnggDiffMultiRunFittingWidgetPresenter.h"
+#include "EnggDiffMultiRunFittingWidgetAdder.h"
+
+#include "MantidAPI/AnalysisDataService.h"
+#include "MantidAPI/Run.h"
+
+#include "MantidQtWidgets/Plotting/Qwt/QwtHelper.h"
+
+#include <boost/algorithm/string.hpp>
+#include <cctype>
+
+namespace {
+
+bool isDigit(const std::string &text) {
+  return std::all_of(text.cbegin(), text.cend(), isdigit);
+}
+
+std::string
+generateFittedPeaksName(const MantidQt::CustomInterfaces::RunLabel &runLabel) {
+  return runLabel.runNumber + "_" + std::to_string(runLabel.bank) +
+         "_fitted_peaks_external_plot";
+}
+
+std::string
+generateFocusedRunName(const MantidQt::CustomInterfaces::RunLabel &runLabel) {
+  return runLabel.runNumber + "_" + std::to_string(runLabel.bank) +
+         "_external_plot";
+}
+
+size_t guessBankID(const Mantid::API::MatrixWorkspace_const_sptr &ws) {
+  const static std::string bankIDName = "bankid";
+  if (ws->run().hasProperty(bankIDName)) {
+    const auto log = dynamic_cast<Mantid::Kernel::PropertyWithValue<int> *>(
+        ws->run().getLogData(bankIDName));
+    return boost::lexical_cast<size_t>(log->value());
+  }
+
+  // couldn't get it from sample logs - try using the old naming convention
+  const std::string name = ws->getName();
+  std::vector<std::string> chunks;
+  boost::split(chunks, name, boost::is_any_of("_"));
+  if (!chunks.empty()) {
+    const bool isNum = isDigit(chunks.back());
+    if (isNum) {
+      try {
+        return boost::lexical_cast<size_t>(chunks.back());
+      } catch (boost::exception &) {
+        // If we get a bad cast or something goes wrong then
+        // the file is probably not what we were expecting
+        // so throw a runtime error
+        throw std::runtime_error(
+            "Failed to fit file: The data was not what is expected. "
+            "Does the file contain a focused workspace?");
+      }
+    }
+  }
+
+  throw std::runtime_error("Could not guess run number from input workspace. "
+                           "Are you sure it has been focused correctly?");
+}
+} // anonymous namespace
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+EnggDiffMultiRunFittingWidgetPresenter::EnggDiffMultiRunFittingWidgetPresenter(
+    std::unique_ptr<IEnggDiffMultiRunFittingWidgetModel> model,
+    IEnggDiffMultiRunFittingWidgetView *view)
+    : m_model(std::move(model)), m_view(view) {}
+
+void EnggDiffMultiRunFittingWidgetPresenter::addFittedPeaks(
+    const RunLabel &runLabel, const Mantid::API::MatrixWorkspace_sptr ws) {
+  m_model->addFittedPeaks(runLabel, ws);
+  updatePlot(runLabel);
+}
+
+void EnggDiffMultiRunFittingWidgetPresenter::addFocusedRun(
+    const Mantid::API::MatrixWorkspace_sptr ws) {
+  const auto runNumber = std::to_string(ws->getRunNumber());
+  const auto bankID = guessBankID(ws);
+
+  m_model->addFocusedRun(RunLabel(runNumber, bankID), ws);
+  m_view->updateRunList(m_model->getAllWorkspaceLabels());
+}
+
+void EnggDiffMultiRunFittingWidgetPresenter::displayFitResults(
+    const RunLabel &runLabel) {
+  const auto fittedPeaks = m_model->getFittedPeaks(runLabel);
+  if (!fittedPeaks) {
+    m_view->reportPlotInvalidFittedPeaks(runLabel);
+  } else {
+    const auto plottablePeaks = API::QwtHelper::curveDataFromWs(*fittedPeaks);
+    m_view->plotFittedPeaks(plottablePeaks);
+  }
+}
+
+std::vector<RunLabel>
+EnggDiffMultiRunFittingWidgetPresenter::getAllRunLabels() const {
+  return m_view->getAllRunLabels();
+}
+
+std::unique_ptr<IEnggDiffMultiRunFittingWidgetAdder>
+EnggDiffMultiRunFittingWidgetPresenter::getWidgetAdder() const {
+  return std::make_unique<EnggDiffMultiRunFittingWidgetAdder>(m_view);
+}
+
+boost::optional<Mantid::API::MatrixWorkspace_sptr>
+EnggDiffMultiRunFittingWidgetPresenter::getFittedPeaks(
+    const RunLabel &runLabel) const {
+  return m_model->getFittedPeaks(runLabel);
+}
+
+boost::optional<Mantid::API::MatrixWorkspace_sptr>
+EnggDiffMultiRunFittingWidgetPresenter::getFocusedRun(
+    const RunLabel &runLabel) const {
+  return m_model->getFocusedRun(runLabel);
+}
+
+boost::optional<RunLabel>
+EnggDiffMultiRunFittingWidgetPresenter::getSelectedRunLabel() const {
+  return m_view->getSelectedRunLabel();
+}
+
+void EnggDiffMultiRunFittingWidgetPresenter::notify(
+    IEnggDiffMultiRunFittingWidgetPresenter::Notification notif) {
+  switch (notif) {
+  case Notification::PlotPeaksStateChanged:
+    processPlotPeaksStateChanged();
+    break;
+
+  case Notification::PlotToSeparateWindow:
+    processPlotToSeparateWindow();
+    break;
+
+  case Notification::RemoveRun:
+    processRemoveRun();
+    break;
+
+  case Notification::SelectRun:
+    processSelectRun();
+    break;
+  }
+}
+
+void EnggDiffMultiRunFittingWidgetPresenter::processPlotPeaksStateChanged() {
+  const auto runLabel = getSelectedRunLabel();
+  if (runLabel) {
+    updatePlot(*runLabel);
+  }
+}
+
+void EnggDiffMultiRunFittingWidgetPresenter::processPlotToSeparateWindow() {
+  const auto runLabel = m_view->getSelectedRunLabel();
+  if (!runLabel) {
+    m_view->reportNoRunSelectedForPlot();
+    return;
+  }
+
+  const auto focusedRun = m_model->getFocusedRun(*runLabel);
+  if (!focusedRun) {
+    m_view->reportPlotInvalidFocusedRun(*runLabel);
+    return;
+  }
+
+  auto &ADS = Mantid::API::AnalysisDataService::Instance();
+  const auto focusedRunName = generateFocusedRunName(*runLabel);
+  ADS.add(focusedRunName, *focusedRun);
+
+  boost::optional<std::string> fittedPeaksName = boost::none;
+  if (m_view->showFitResultsSelected() &&
+      m_model->hasFittedPeaksForRun(*runLabel)) {
+    fittedPeaksName = generateFittedPeaksName(*runLabel);
+    const auto fittedPeaks = m_model->getFittedPeaks(*runLabel);
+    ADS.add(*fittedPeaksName, *fittedPeaks);
+  }
+
+  m_view->plotToSeparateWindow(focusedRunName, fittedPeaksName);
+
+  ADS.remove(focusedRunName);
+  if (fittedPeaksName) {
+    ADS.remove(*fittedPeaksName);
+  }
+}
+
+void EnggDiffMultiRunFittingWidgetPresenter::processRemoveRun() {
+  const auto runLabel = getSelectedRunLabel();
+  if (runLabel) {
+    m_model->removeRun(*runLabel);
+    m_view->updateRunList(m_model->getAllWorkspaceLabels());
+    m_view->resetCanvas();
+  }
+}
+
+void EnggDiffMultiRunFittingWidgetPresenter::processSelectRun() {
+  const auto runLabel = getSelectedRunLabel();
+  if (runLabel) {
+    updatePlot(*runLabel);
+  }
+}
+
+void EnggDiffMultiRunFittingWidgetPresenter::updatePlot(
+    const RunLabel &runLabel) {
+  const auto focusedRun = m_model->getFocusedRun(runLabel);
+
+  if (!focusedRun) {
+    m_view->reportPlotInvalidFocusedRun(runLabel);
+  } else {
+    const auto plottableCurve = API::QwtHelper::curveDataFromWs(*focusedRun);
+
+    m_view->resetCanvas();
+    m_view->plotFocusedRun(plottableCurve);
+
+    if (m_model->hasFittedPeaksForRun(runLabel) &&
+        m_view->showFitResultsSelected()) {
+      displayFitResults(runLabel);
+    }
+  }
+}
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffractionPresenter.cpp b/qt/scientific_interfaces/EnggDiffraction/EnggDiffractionPresenter.cpp
new file mode 100644
index 00000000000..1ff4eceb0d8
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffractionPresenter.cpp
@@ -0,0 +1,2899 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "EnggDiffractionPresenter.h"
+#include "EnggDiffractionPresWorker.h"
+#include "EnggVanadiumCorrectionsModel.h"
+#include "IEnggDiffractionView.h"
+#include "MantidAPI/AlgorithmManager.h"
+#include "MantidAPI/AnalysisDataService.h"
+#include "MantidAPI/ITableWorkspace.h"
+#include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/TableRow.h"
+#include "MantidKernel/Property.h"
+#include "MantidKernel/StringTokenizer.h"
+#include "MantidQtWidgets/Common/PythonRunner.h"
+
+#include <algorithm>
+#include <cctype>
+#include <fstream>
+
+#include <boost/lexical_cast.hpp>
+
+#include <Poco/File.h>
+#include <Poco/Path.h>
+
+#include <QThread>
+
+using namespace Mantid::API;
+using namespace MantidQt::CustomInterfaces;
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+namespace {
+Mantid::Kernel::Logger g_log("EngineeringDiffractionGUI");
+}
+
+const std::string EnggDiffractionPresenter::g_runNumberErrorStr =
+    " cannot be empty, must be an integer number, valid ENGINX run number/s "
+    "or "
+    "valid directory/directories.";
+
+// discouraged at the moment
+const bool EnggDiffractionPresenter::g_askUserCalibFilename = false;
+
+const std::string EnggDiffractionPresenter::g_calibBanksParms =
+    "engggui_calibration_banks_parameters";
+
+int EnggDiffractionPresenter::g_croppedCounter = 0;
+int EnggDiffractionPresenter::g_plottingCounter = 0;
+bool EnggDiffractionPresenter::g_abortThread = false;
+std::string EnggDiffractionPresenter::g_lastValidRun = "";
+std::string EnggDiffractionPresenter::g_calibCropIdentifier = "SpectrumNumbers";
+std::string EnggDiffractionPresenter::g_sumOfFilesFocus = "";
+
+EnggDiffractionPresenter::EnggDiffractionPresenter(IEnggDiffractionView *view)
+    : m_workerThread(nullptr), m_calibFinishedOK(false),
+      m_focusFinishedOK(false), m_rebinningFinishedOK(false), m_view(view),
+      m_viewHasClosed(false),
+      m_vanadiumCorrectionsModel(
+          boost::make_shared<EnggVanadiumCorrectionsModel>(
+              m_view->currentCalibSettings(), m_view->currentInstrument())) {
+  if (!m_view) {
+    throw std::runtime_error(
+        "Severe inconsistency found. Presenter created "
+        "with an empty/null view (Engineering diffraction interface). "
+        "Cannot continue.");
+  }
+
+  m_currentInst = m_view->currentInstrument();
+}
+
+EnggDiffractionPresenter::~EnggDiffractionPresenter() { cleanup(); }
+
+/**
+ * Close open sessions, kill threads etc., save settings, etc. for a
+ * graceful window close/destruction
+ */
+void EnggDiffractionPresenter::cleanup() {
+  // m_model->cleanup();
+
+  // this may still be running
+  if (m_workerThread) {
+    if (m_workerThread->isRunning()) {
+      g_log.notice() << "A calibration process is currently running, shutting "
+                        "it down immediately...\n";
+      m_workerThread->wait(10);
+    }
+    delete m_workerThread;
+    m_workerThread = nullptr;
+  }
+
+  // Remove the workspace which is loaded when the interface starts
+  auto &ADS = Mantid::API::AnalysisDataService::Instance();
+  if (ADS.doesExist(g_calibBanksParms)) {
+    ADS.remove(g_calibBanksParms);
+  }
+}
+
+void EnggDiffractionPresenter::notify(
+    IEnggDiffractionPresenter::Notification notif) {
+
+  // Check the view is valid - QT can send multiple notification
+  // signals in any order at any time. This means that it is possible
+  // to receive a shutdown signal and subsequently an input example
+  // for example. As we can't guarantee the state of the viewer
+  // after calling shutdown instead we shouldn't do anything after
+  if (m_viewHasClosed) {
+    return;
+  }
+
+  switch (notif) {
+
+  case IEnggDiffractionPresenter::Start:
+    processStart();
+    break;
+
+  case IEnggDiffractionPresenter::LoadExistingCalib:
+    processLoadExistingCalib();
+    break;
+
+  case IEnggDiffractionPresenter::CalcCalib:
+    processCalcCalib();
+    break;
+
+  case IEnggDiffractionPresenter::CropCalib:
+    ProcessCropCalib();
+    break;
+
+  case IEnggDiffractionPresenter::FocusRun:
+    processFocusBasic();
+    break;
+
+  case IEnggDiffractionPresenter::FocusCropped:
+    processFocusCropped();
+    break;
+
+  case IEnggDiffractionPresenter::FocusTexture:
+    processFocusTexture();
+    break;
+
+  case IEnggDiffractionPresenter::ResetFocus:
+    processResetFocus();
+    break;
+
+  case IEnggDiffractionPresenter::RebinTime:
+    processRebinTime();
+    break;
+
+  case IEnggDiffractionPresenter::RebinMultiperiod:
+    processRebinMultiperiod();
+    break;
+
+  case IEnggDiffractionPresenter::LogMsg:
+    processLogMsg();
+    break;
+
+  case IEnggDiffractionPresenter::InstrumentChange:
+    processInstChange();
+    break;
+
+  case IEnggDiffractionPresenter::RBNumberChange:
+    processRBNumberChange();
+    break;
+
+  case IEnggDiffractionPresenter::ShutDown:
+    processShutDown();
+    break;
+
+  case IEnggDiffractionPresenter::StopFocus:
+    processStopFocus();
+    break;
+  }
+}
+
+void EnggDiffractionPresenter::processStart() { m_view->showStatus("Ready"); }
+
+void EnggDiffractionPresenter::processLoadExistingCalib() {
+  const std::string fname = m_view->askExistingCalibFilename();
+  if (fname.empty()) {
+    return;
+  }
+
+  updateNewCalib(fname);
+}
+
+/**
+ * Grab a calibration from a (GSAS calibration) file
+ * (.prm/.par/.iparm) and set/use it as current calibration.
+ *
+ * @param fname name/path of the calibration file
+ */
+
+void EnggDiffractionPresenter::updateNewCalib(const std::string &fname) {
+
+  Poco::Path pocoPath;
+  const bool pathValid = pocoPath.tryParse(fname);
+
+  if (!pathValid || fname.empty() || pocoPath.isDirectory()) {
+    // Log that we couldn't open the file - its probably and invalid
+    // path which will be regenerated
+    g_log.warning("Could not open GSAS calibration file: " + fname);
+    return;
+  }
+
+  std::string instName, vanNo, ceriaNo;
+  try {
+    parseCalibrateFilename(fname, instName, vanNo, ceriaNo);
+  } catch (std::invalid_argument &ia) {
+    m_view->userWarning("Invalid calibration filename : " + fname, ia.what());
+    return;
+  }
+
+  try {
+    grabCalibParms(fname, vanNo, ceriaNo);
+    updateCalibParmsTable();
+    m_view->newCalibLoaded(vanNo, ceriaNo, fname);
+  } catch (std::runtime_error &rexc) {
+    m_view->userWarning("Problem while updating calibration.", rexc.what());
+  }
+}
+
+/**
+ * Get from a calibration file (GSAS instrument parameters file) the
+ * DIFC, DIFA, TZERO calibration parameters used for units
+ * conversions. Normally this is used on the ...all_banks.prm file
+ * which has the parameters for every bank included in the calibration
+ * process.
+ *
+ * @param fname name of the calibration/GSAS iparm file
+ * @param vanNo output param to hold the vanadium run
+ * @param ceriaNo output param to hold the ceria run
+ */
+void EnggDiffractionPresenter::grabCalibParms(const std::string &fname,
+                                              std::string &vanNo,
+                                              std::string &ceriaNo) {
+  std::vector<GSASCalibrationParms> parms;
+
+  // To grab the bank indices, lines like "INS   BANK     2"
+  // To grab the difc,difa,tzero parameters, lines like:
+  // "INS  2 ICONS  18388.00    0.00    -6.76"
+  try {
+    std::ifstream prmFile(fname);
+    std::string line;
+    int opts = Mantid::Kernel::StringTokenizer::TOK_TRIM +
+               Mantid::Kernel::StringTokenizer::TOK_IGNORE_EMPTY;
+    while (std::getline(prmFile, line)) {
+      if (line.find("ICONS") != std::string::npos) {
+        Mantid::Kernel::StringTokenizer tokenizer(line, " ", opts);
+        const size_t numElems = 6;
+        if (tokenizer.count() == numElems) {
+          try {
+            size_t bid = boost::lexical_cast<size_t>(tokenizer[1]);
+            double difc = boost::lexical_cast<double>(tokenizer[3]);
+            double difa = boost::lexical_cast<double>(tokenizer[4]);
+            double tzero = boost::lexical_cast<double>(tokenizer[5]);
+            parms.emplace_back(GSASCalibrationParms(bid, difc, difa, tzero));
+          } catch (std::runtime_error &rexc) {
+            g_log.warning()
+                << "Error when trying to extract parameters from this line:  "
+                << line
+                << ". This calibration file may not load correctly. "
+                   "Error details: "
+                << rexc.what() << '\n';
+          }
+        } else {
+          g_log.warning() << "Could not parse correctly a parameters "
+                             "definition line in this calibration file    ("
+                          << fname << "). Did not find  " << numElems
+                          << " elements as expected. The calibration may not "
+                             "load correctly\n";
+        }
+      } else if (line.find("CALIB") != std::string::npos) {
+        Mantid::Kernel::StringTokenizer tokenizer(line, " ", opts);
+        ceriaNo = tokenizer[2];
+        vanNo = tokenizer[3];
+      }
+    }
+
+  } catch (std::runtime_error &rexc) {
+    g_log.error()
+        << "Error while loading calibration / GSAS IPARM file (" << fname
+        << "). Could not parse the file. Please check its contents. Details: "
+        << rexc.what() << '\n';
+  }
+
+  m_currentCalibParms = parms;
+}
+
+/**
+ * Puts in a table workspace, visible in the ADS, the per-bank
+ * calibration parameters for the current calibration.
+ */
+void EnggDiffractionPresenter::updateCalibParmsTable() {
+  if (m_currentCalibParms.empty()) {
+    return;
+  }
+
+  ITableWorkspace_sptr parmsTbl;
+  AnalysisDataServiceImpl &ADS = Mantid::API::AnalysisDataService::Instance();
+  if (ADS.doesExist(g_calibBanksParms)) {
+    parmsTbl = ADS.retrieveWS<ITableWorkspace>(g_calibBanksParms);
+    parmsTbl->setRowCount(0);
+  } else {
+    auto alg = Mantid::API::AlgorithmManager::Instance().createUnmanaged(
+        "CreateEmptyTableWorkspace");
+    alg->initialize();
+    alg->setPropertyValue("OutputWorkspace", g_calibBanksParms);
+    alg->execute();
+
+    parmsTbl = ADS.retrieveWS<ITableWorkspace>(g_calibBanksParms);
+    parmsTbl->addColumn("int", "bankid");
+    parmsTbl->addColumn("double", "difc");
+    parmsTbl->addColumn("double", "difa");
+    parmsTbl->addColumn("double", "tzero");
+  }
+
+  for (const auto &parms : m_currentCalibParms) {
+    // ADS.remove(FocusedFitPeaksTableName);
+    TableRow row = parmsTbl->appendRow();
+    row << static_cast<int>(parms.bankid) << parms.difc << parms.difa
+        << parms.tzero;
+  }
+}
+
+void EnggDiffractionPresenter::processCalcCalib() {
+  const std::string vanNo = isValidRunNumber(m_view->newVanadiumNo());
+  const std::string ceriaNo = isValidRunNumber(m_view->newCeriaNo());
+  try {
+    inputChecksBeforeCalibrate(vanNo, ceriaNo);
+  } catch (std::invalid_argument &ia) {
+    m_view->userWarning("Error in the inputs required for calibrate",
+                        ia.what());
+    return;
+  }
+  g_log.notice() << "EnggDiffraction GUI: starting new calibration. This may "
+                    "take a few seconds... \n";
+
+  const std::string outFilename = outputCalibFilename(vanNo, ceriaNo);
+
+  m_view->showStatus("Calculating calibration...");
+  m_view->enableCalibrateFocusFitUserActions(false);
+  // alternatively, this would be GUI-blocking:
+  // doNewCalibration(outFilename, vanNo, ceriaNo, "");
+  // calibrationFinished();
+  startAsyncCalibWorker(outFilename, vanNo, ceriaNo, "");
+}
+
+void EnggDiffractionPresenter::ProcessCropCalib() {
+  const std::string vanNo = isValidRunNumber(m_view->newVanadiumNo());
+  const std::string ceriaNo = isValidRunNumber(m_view->newCeriaNo());
+  int specNoNum = m_view->currentCropCalibBankName();
+  enum BankMode { SPECNOS = 0, NORTH = 1, SOUTH = 2 };
+
+  try {
+    inputChecksBeforeCalibrate(vanNo, ceriaNo);
+    if (m_view->currentCalibSpecNos().empty() &&
+        specNoNum == BankMode::SPECNOS) {
+      throw std::invalid_argument(
+          "The Spectrum Numbers field cannot be empty, must be a "
+          "valid range or a Bank Name can be selected instead.");
+    }
+  } catch (std::invalid_argument &ia) {
+    m_view->userWarning("Error in the inputs required for cropped calibration",
+                        ia.what());
+    return;
+  }
+
+  g_log.notice()
+      << "EnggDiffraction GUI: starting cropped calibration. This may "
+         "take a few seconds... \n";
+
+  const std::string outFilename = outputCalibFilename(vanNo, ceriaNo);
+
+  std::string specNo = "";
+  if (specNoNum == BankMode::NORTH) {
+    specNo = "North";
+    g_calibCropIdentifier = "Bank";
+
+  } else if (specNoNum == BankMode::SOUTH) {
+    specNo = "South";
+    g_calibCropIdentifier = "Bank";
+
+  } else if (specNoNum == BankMode::SPECNOS) {
+    g_calibCropIdentifier = "SpectrumNumbers";
+    specNo = m_view->currentCalibSpecNos();
+  }
+
+  m_view->showStatus("Calculating cropped calibration...");
+  m_view->enableCalibrateFocusFitUserActions(false);
+  startAsyncCalibWorker(outFilename, vanNo, ceriaNo, specNo);
+}
+
+void EnggDiffractionPresenter::processFocusBasic() {
+  std::vector<std::string> multi_RunNo =
+      isValidMultiRunNumber(m_view->focusingRunNo());
+  const std::vector<bool> banks = m_view->focusingBanks();
+
+  // reset global values
+  g_abortThread = false;
+  g_sumOfFilesFocus = "";
+  g_plottingCounter = 0;
+
+  // check if valid run number provided before focusin
+  try {
+    inputChecksBeforeFocusBasic(multi_RunNo, banks);
+  } catch (std::invalid_argument &ia) {
+    m_view->userWarning("Error in the inputs required to focus a run",
+                        ia.what());
+    return;
+  }
+
+  int focusMode = m_view->currentMultiRunMode();
+  if (focusMode == 0) {
+    g_log.debug() << " focus mode selected Individual Run Files Separately \n";
+
+    // start focusing
+    startFocusing(multi_RunNo, banks, "", "");
+
+  } else if (focusMode == 1) {
+    g_log.debug() << " focus mode selected Focus Sum Of Files \n";
+    g_sumOfFilesFocus = "basic";
+    std::vector<std::string> firstRun;
+    firstRun.emplace_back(multi_RunNo[0]);
+
+    // to avoid multiple loops, use firstRun instead as the
+    // multi-run number is not required for sumOfFiles
+    startFocusing(firstRun, banks, "", "");
+  }
+}
+
+void EnggDiffractionPresenter::processFocusCropped() {
+  const std::vector<std::string> multi_RunNo =
+      isValidMultiRunNumber(m_view->focusingCroppedRunNo());
+  const std::vector<bool> banks = m_view->focusingBanks();
+  const std::string specNos = m_view->focusingCroppedSpectrumNos();
+
+  // reset global values
+  g_abortThread = false;
+  g_sumOfFilesFocus = "";
+  g_plottingCounter = 0;
+
+  // check if valid run number provided before focusin
+  try {
+    inputChecksBeforeFocusCropped(multi_RunNo, banks, specNos);
+  } catch (std::invalid_argument &ia) {
+    m_view->userWarning(
+        "Error in the inputs required to focus a run (in cropped mode)",
+        ia.what());
+    return;
+  }
+
+  int focusMode = m_view->currentMultiRunMode();
+  if (focusMode == 0) {
+    g_log.debug() << " focus mode selected Individual Run Files Separately \n";
+
+    startFocusing(multi_RunNo, banks, specNos, "");
+
+  } else if (focusMode == 1) {
+    g_log.debug() << " focus mode selected Focus Sum Of Files \n";
+    g_sumOfFilesFocus = "cropped";
+    std::vector<std::string> firstRun{multi_RunNo[0]};
+
+    // to avoid multiple loops, use firstRun instead as the
+    // multi-run number is not required for sumOfFiles
+    startFocusing(firstRun, banks, specNos, "");
+  }
+}
+
+void EnggDiffractionPresenter::processFocusTexture() {
+  const std::vector<std::string> multi_RunNo =
+      isValidMultiRunNumber(m_view->focusingTextureRunNo());
+  const std::string dgFile = m_view->focusingTextureGroupingFile();
+
+  // reset global values
+  g_abortThread = false;
+  g_sumOfFilesFocus = "";
+  g_plottingCounter = 0;
+
+  // check if valid run number provided before focusing
+  try {
+    inputChecksBeforeFocusTexture(multi_RunNo, dgFile);
+  } catch (std::invalid_argument &ia) {
+    m_view->userWarning(
+        "Error in the inputs required to focus a run (in texture mode)",
+        ia.what());
+    return;
+  }
+
+  int focusMode = m_view->currentMultiRunMode();
+  if (focusMode == 0) {
+    g_log.debug() << " focus mode selected Individual Run Files Separately \n";
+    startFocusing(multi_RunNo, std::vector<bool>(), "", dgFile);
+
+  } else if (focusMode == 1) {
+    g_log.debug() << " focus mode selected Focus Sum Of Files \n";
+    g_sumOfFilesFocus = "texture";
+    std::vector<std::string> firstRun{multi_RunNo[0]};
+
+    // to avoid multiple loops, use firstRun instead as the
+    // multi-run number is not required for sumOfFiles
+    startFocusing(firstRun, std::vector<bool>(), "", dgFile);
+  }
+}
+
+/**
+ * Starts a focusing worker, for different modes depending on the
+ * inputs provided. Assumes that the inputs have been checked by the
+ * respective specific processFocus methods (for normal, cropped,
+ * texture, etc. focusing).
+ *
+ * @param multi_RunNo vector of run/file number to focus
+ * @param banks banks to include in the focusing, processed one at a time
+ *
+ * @param specNos list of spectra to use when focusing. If not empty
+ * this implies focusing in cropped mode.
+ *
+ * @param dgFile detector grouping file to define banks (texture). If
+ * not empty, this implies focusing in texture mode.
+ */
+void EnggDiffractionPresenter::startFocusing(
+    const std::vector<std::string> &multi_RunNo, const std::vector<bool> &banks,
+    const std::string &specNos, const std::string &dgFile) {
+
+  std::string optMsg = "";
+  if (!specNos.empty()) {
+    optMsg = " (cropped)";
+  } else if (!dgFile.empty()) {
+    optMsg = " (texture)";
+  }
+  g_log.notice() << "EnggDiffraction GUI: starting new focusing" << optMsg
+                 << ". This may take some seconds... \n";
+
+  m_view->showStatus("Focusing...");
+  m_view->enableCalibrateFocusFitUserActions(false);
+  startAsyncFocusWorker(multi_RunNo, banks, specNos, dgFile);
+}
+
+void EnggDiffractionPresenter::processResetFocus() { m_view->resetFocus(); }
+
+void EnggDiffractionPresenter::processRebinTime() {
+
+  const std::string runNo = isValidRunNumber(m_view->currentPreprocRunNo());
+  double bin = m_view->rebinningTimeBin();
+
+  try {
+    inputChecksBeforeRebinTime(runNo, bin);
+  } catch (std::invalid_argument &ia) {
+    m_view->userWarning(
+        "Error in the inputs required to pre-process (rebin) a run", ia.what());
+    return;
+  }
+
+  const std::string outWSName = "engggui_preproc_time_ws";
+  g_log.notice() << "EnggDiffraction GUI: starting new pre-processing "
+                    "(re-binning) with a TOF bin into workspace '" +
+                        outWSName +
+                        "'. This "
+                        "may take some seconds... \n";
+
+  m_view->showStatus("Rebinning by time...");
+  m_view->enableCalibrateFocusFitUserActions(false);
+  startAsyncRebinningTimeWorker(runNo, bin, outWSName);
+}
+
+void EnggDiffractionPresenter::processRebinMultiperiod() {
+  const std::string runNo = isValidRunNumber(m_view->currentPreprocRunNo());
+  size_t nperiods = m_view->rebinningPulsesNumberPeriods();
+  double timeStep = m_view->rebinningPulsesTime();
+
+  try {
+    inputChecksBeforeRebinPulses(runNo, nperiods, timeStep);
+  } catch (std::invalid_argument &ia) {
+    m_view->userWarning("Error in the inputs required to pre-process (rebin) a "
+                        "run by pulse times",
+                        ia.what());
+    return;
+  }
+  const std::string outWSName = "engggui_preproc_by_pulse_time_ws";
+  g_log.notice() << "EnggDiffraction GUI: starting new pre-processing "
+                    "(re-binning) by pulse times into workspace '" +
+                        outWSName +
+                        "'. This "
+                        "may take some seconds... \n";
+
+  m_view->showStatus("Rebinning by pulses...");
+  m_view->enableCalibrateFocusFitUserActions(false);
+  startAsyncRebinningPulsesWorker(runNo, nperiods, timeStep, outWSName);
+}
+
+void EnggDiffractionPresenter::processLogMsg() {
+  std::vector<std::string> msgs = m_view->logMsgs();
+  for (const auto &msg : msgs) {
+    g_log.information() << msg << '\n';
+  }
+}
+
+void EnggDiffractionPresenter::processInstChange() {
+  m_currentInst = m_view->currentInstrument();
+  m_view->updateTabsInstrument(m_currentInst);
+}
+
+void EnggDiffractionPresenter::processRBNumberChange() {
+  const std::string rbn = m_view->getRBNumber();
+  auto valid = validateRBNumber(rbn);
+  m_view->enableTabs(valid);
+  m_view->showInvalidRBNumber(valid);
+  if (!valid) {
+    m_view->showStatus("Valid RB number required");
+  } else {
+    m_view->showStatus("Ready");
+  }
+}
+
+void EnggDiffractionPresenter::processShutDown() {
+  // Set that the view has closed in case QT attempts to fire another
+  // signal whilst we are shutting down. This stops notify before
+  // it hits the switch statement as the view could be in any state.
+  m_viewHasClosed = true;
+  m_view->showStatus("Closing...");
+  m_view->saveSettings();
+  cleanup();
+}
+
+void EnggDiffractionPresenter::processStopFocus() {
+  if (m_workerThread) {
+    if (m_workerThread->isRunning()) {
+      g_log.notice() << "A focus process is currently running, shutting "
+                        "it down as soon as possible...\n";
+
+      g_abortThread = true;
+      g_log.warning() << "Focus Stop has been clicked, please wait until "
+                         "current focus run process has been completed. \n";
+    }
+  }
+}
+
+/**
+ * Check if an RB number is valid to work with it (retrieve data,
+ * calibrate, focus, etc.). For now this will accept any non-empty
+ * string. Later on we might be more strict about valid RB numbers /
+ * experiment IDs.
+ *
+ * @param rbn RB number as given by the user
+ */
+bool EnggDiffractionPresenter::validateRBNumber(const std::string &rbn) const {
+  return !rbn.empty();
+}
+
+/**
+ * Checks if the provided run number is valid and if a directory is
+ * provided it will convert it to a run number. It also records the
+ * paths the user has browsed to.
+ *
+ * @param userPaths the input/directory given by the user via the "browse"
+ * button
+ *
+ * @return run_number 6 character string of a run number
+ */
+std::string EnggDiffractionPresenter::isValidRunNumber(
+    const std::vector<std::string> &userPaths) {
+
+  std::string run_number;
+  if (userPaths.empty() || userPaths.front().empty()) {
+    return run_number;
+  }
+  return userPaths[0];
+}
+
+/**
+ * Checks if the provided run number is valid and if a directory is provided
+ *
+ * @param paths takes the input/paths of the user
+ *
+ * @return vector of string multi_run_number, 6 character string of a run number
+ */
+std::vector<std::string> EnggDiffractionPresenter::isValidMultiRunNumber(
+    const std::vector<std::string> &paths) {
+
+  std::vector<std::string> multi_run_number;
+  if (paths.empty() || paths.front().empty())
+    return multi_run_number;
+  return paths;
+}
+
+/**
+ * Does several checks on the current inputs and settings. This should
+ * be done before starting any calibration work. The message return
+ * should in principle be shown to the user as a visible message
+ * (pop-up, error log, etc.)
+ *
+ * @param newVanNo number of the Vanadium run for the new calibration
+ * @param newCeriaNo number of the Ceria run for the new calibration
+ *
+ * @throws std::invalid_argument with an informative message.
+ */
+void EnggDiffractionPresenter::inputChecksBeforeCalibrate(
+    const std::string &newVanNo, const std::string &newCeriaNo) {
+  if (newVanNo.empty()) {
+    throw std::invalid_argument("The Vanadium number" + g_runNumberErrorStr);
+  }
+  if (newCeriaNo.empty()) {
+    throw std::invalid_argument("The Ceria number" + g_runNumberErrorStr);
+  }
+
+  const auto &cs = m_view->currentCalibSettings();
+  const auto &pixelCalib = cs.m_pixelCalibFilename;
+  if (pixelCalib.empty()) {
+    throw std::invalid_argument(
+        "You need to set a pixel (full) calibration in settings.");
+  }
+  const auto &templGSAS = cs.m_templateGSAS_PRM;
+  if (templGSAS.empty()) {
+    throw std::invalid_argument(
+        "You need to set a template calibration file for GSAS in settings.");
+  }
+}
+
+/**
+ * What should be the name of the output GSAS calibration file, given
+ * the Vanadium and Ceria runs
+ *
+ * @param vanNo number of the Vanadium run, which is normally part of the name
+ * @param ceriaNo number of the Ceria run, which is normally part of the name
+ * @param bankName bank name when generating a file for an individual
+ * bank. Leave empty to use a generic name for all banks
+ *
+ * @return filename (without the full path)
+ */
+std::string
+EnggDiffractionPresenter::outputCalibFilename(const std::string &vanNo,
+                                              const std::string &ceriaNo,
+                                              const std::string &bankName) {
+  std::string outFilename = "";
+  const std::string sugg =
+      buildCalibrateSuggestedFilename(vanNo, ceriaNo, bankName);
+  if (!g_askUserCalibFilename) {
+    outFilename = sugg;
+  } else {
+    outFilename = m_view->askNewCalibrationFilename(sugg);
+    if (!outFilename.empty()) {
+      // make sure it follows the rules
+      try {
+        std::string inst, van, ceria;
+        parseCalibrateFilename(outFilename, inst, van, ceria);
+      } catch (std::invalid_argument &ia) {
+        m_view->userWarning(
+            "Invalid output calibration filename: " + outFilename, ia.what());
+        outFilename = "";
+      }
+    }
+  }
+
+  return outFilename;
+}
+
+/**
+ * Parses the name of a calibration file and guesses the instrument,
+ * vanadium and ceria run numbers, assuming that the name has been
+ * build with buildCalibrateSuggestedFilename().
+ *
+ * @todo this is currently based on the filename. This method should
+ * do a basic sanity check that the file is actually a calibration
+ * file (IPARM file for GSAS), and get the numbers from the file not
+ * from the name of the file. Leaving this as a TODO for now, as the
+ * file template and contents are still subject to change.
+ *
+ * @param path full path to a calibration file
+ * @param instName instrument used in the file
+ * @param vanNo number of the Vanadium run used for this calibration file
+ * @param ceriaNo number of the Ceria run
+ *
+ * @throws invalid_argument with an informative message if tha name does
+ * not look correct (does not follow the conventions).
+ */
+void EnggDiffractionPresenter::parseCalibrateFilename(const std::string &path,
+                                                      std::string &instName,
+                                                      std::string &vanNo,
+                                                      std::string &ceriaNo) {
+  instName = "";
+  vanNo = "";
+  ceriaNo = "";
+
+  Poco::Path fullPath(path);
+  const std::string &filename = fullPath.getFileName();
+  if (filename.empty()) {
+    return;
+  }
+
+  const std::string explMsg =
+      "Expected a file name like 'INSTR_vanNo_ceriaNo_....par', "
+      "where INSTR is the instrument name and vanNo and ceriaNo are the "
+      "numbers of the Vanadium and calibration sample (Ceria, CeO2) runs.";
+  std::vector<std::string> parts;
+  boost::split(parts, filename, boost::is_any_of("_"));
+  if (parts.size() < 4) {
+    throw std::invalid_argument(
+        "Failed to find at least the 4 required parts of the file name.\n\n" +
+        explMsg);
+  }
+
+  // check the rules on the file name
+  if (m_currentInst != parts[0]) {
+    throw std::invalid_argument("The first component of the file name is not "
+                                "the expected instrument name: " +
+                                m_currentInst + ".\n\n" + explMsg);
+  }
+
+  instName = parts[0];
+}
+
+/**
+ * Start the calibration work without blocking the GUI. This uses
+ * connect for Qt signals/slots so that it runs well with the Qt event
+ * loop. Because of that this class needs to be a Q_OBJECT.
+ *
+ * @param outFilename name for the output GSAS calibration file
+ * @param vanNo vanadium run number
+ * @param ceriaNo ceria run number
+ * @param specNos SpecNos or bank name to be passed
+ */
+void EnggDiffractionPresenter::startAsyncCalibWorker(
+    const std::string &outFilename, const std::string &vanNo,
+    const std::string &ceriaNo, const std::string &specNos) {
+  delete m_workerThread;
+  m_workerThread = new QThread(this);
+  auto *worker = new EnggDiffWorker(this, outFilename, vanNo, ceriaNo, specNos);
+  worker->moveToThread(m_workerThread);
+
+  connect(m_workerThread, SIGNAL(started()), worker, SLOT(calibrate()));
+  connect(worker, SIGNAL(finished()), this, SLOT(calibrationFinished()));
+  // early delete of thread and worker
+  connect(m_workerThread, SIGNAL(finished()), m_workerThread,
+          SLOT(deleteLater()), Qt::DirectConnection);
+  connect(worker, SIGNAL(finished()), worker, SLOT(deleteLater()));
+  m_workerThread->start();
+}
+
+/**
+ * Calculate a new calibration. This is what threads/workers should
+ * use to run the calculations in response to the user clicking
+ * 'calibrate' or similar.
+ *
+ * @param outFilename name for the output GSAS calibration file
+ * @param vanNo vanadium run number
+ * @param ceriaNo ceria run number
+ * @param specNos SpecNos or bank name to be passed
+ */
+void EnggDiffractionPresenter::doNewCalibration(const std::string &outFilename,
+                                                const std::string &vanNo,
+                                                const std::string &ceriaNo,
+                                                const std::string &specNos) {
+  g_log.notice() << "Generating new calibration file: " << outFilename << '\n';
+
+  EnggDiffCalibSettings cs = m_view->currentCalibSettings();
+  Mantid::Kernel::ConfigServiceImpl &conf =
+      Mantid::Kernel::ConfigService::Instance();
+  const std::vector<std::string> tmpDirs = conf.getDataSearchDirs();
+  // in principle, the run files will be found from 'DirRaw', and the
+  // pre-calculated Vanadium corrections from 'DirCalib'
+  if (!cs.m_inputDirCalib.empty() && Poco::File(cs.m_inputDirCalib).exists()) {
+    conf.appendDataSearchDir(cs.m_inputDirCalib);
+  }
+  if (!cs.m_inputDirRaw.empty() && Poco::File(cs.m_inputDirRaw).exists())
+    conf.appendDataSearchDir(cs.m_inputDirRaw);
+  for (const auto &browsed : m_browsedToPaths) {
+    conf.appendDataSearchDir(browsed);
+  }
+
+  try {
+    m_calibFinishedOK = true;
+    doCalib(cs, vanNo, ceriaNo, outFilename, specNos);
+  } catch (std::runtime_error &rexc) {
+    m_calibFinishedOK = false;
+    m_calibError = "The calibration calculations failed. One of the "
+                   "algorithms did not execute correctly. See log messages for "
+                   "further details.";
+    g_log.error()
+        << "The calibration calculations failed. One of the "
+           "algorithms did not execute correctly. See log messages for "
+           "further details. Error: " +
+               std::string(rexc.what())
+        << '\n';
+  } catch (std::invalid_argument &iaexc) {
+    m_calibFinishedOK = false;
+    m_calibError = "The calibration calculations failed. Some input properties "
+                   "were not valid. See log messages for details. \n Error: " +
+                   std::string(iaexc.what());
+    g_log.error()
+        << "The calibration calculations failed. Some input properties "
+           "were not valid. See log messages for details. \n";
+  } catch (Mantid::API::Algorithm::CancelException &) {
+    m_calibFinishedOK = false;
+    m_cancelled = true;
+    g_log.warning() << "Execution cancelled by user. \n";
+  }
+  // restore normal data search paths
+  conf.setDataSearchDirs(tmpDirs);
+}
+
+/**
+ * Method to call when the calibration work has finished, either from
+ * a separate thread or not (as in this presenter's' test).
+ */
+void EnggDiffractionPresenter::calibrationFinished() {
+  if (!m_view)
+    return;
+
+  m_view->enableCalibrateFocusFitUserActions(true);
+  if (!m_calibFinishedOK) {
+    if (!m_cancelled) {
+      m_view->userWarning("Calibration Error", m_calibError);
+    }
+    m_cancelled = false;
+
+    m_view->showStatus("Calibration didn't finish succesfully. Ready");
+  } else {
+    const std::string vanNo = isValidRunNumber(m_view->newVanadiumNo());
+
+    const std::string ceriaNo = isValidRunNumber(m_view->newCeriaNo());
+    updateCalibParmsTable();
+    m_view->newCalibLoaded(vanNo, ceriaNo, m_calibFullPath);
+    g_log.notice()
+        << "Calibration finished and ready as 'current calibration'.\n";
+    m_view->showStatus("Calibration finished succesfully. Ready");
+  }
+  if (m_workerThread) {
+    delete m_workerThread;
+    m_workerThread = nullptr;
+  }
+}
+
+/**
+ * Build a suggested name for a new calibration, by appending instrument name,
+ * relevant run numbers, etc., like: ENGINX_241391_236516_all_banks.par
+ *
+ * @param vanNo number of the Vanadium run
+ * @param ceriaNo number of the Ceria run
+ * @param bankName bank name when generating a file for an individual
+ * bank. Leave empty to use a generic name for all banks
+ *
+ * @return Suggested name for a new calibration file, following
+ * ENGIN-X practices
+ */
+std::string EnggDiffractionPresenter::buildCalibrateSuggestedFilename(
+    const std::string &vanNo, const std::string &ceriaNo,
+    const std::string &bankName) const {
+  // default and only one supported instrument for now
+  std::string instStr = m_currentInst;
+  std::string nameAppendix = "_all_banks";
+  if (!bankName.empty()) {
+    nameAppendix = "_" + bankName;
+  }
+
+  // default extension for calibration files
+  const std::string calibExt = ".prm";
+  std::string vanFilename = Poco::Path(vanNo).getBaseName();
+  std::string ceriaFilename = Poco::Path(ceriaNo).getBaseName();
+  std::string vanRun =
+      vanFilename.substr(vanFilename.find(instStr) + instStr.size());
+  std::string ceriaRun =
+      ceriaFilename.substr(ceriaFilename.find(instStr) + instStr.size());
+  vanRun.erase(0, std::min(vanRun.find_first_not_of('0'), vanRun.size() - 1));
+  ceriaRun.erase(
+      0, std::min(ceriaRun.find_first_not_of('0'), ceriaRun.size() - 1));
+  std::string sugg =
+      instStr + "_" + vanRun + "_" + ceriaRun + nameAppendix + calibExt;
+
+  return sugg;
+}
+
+std::vector<GSASCalibrationParms>
+EnggDiffractionPresenter::currentCalibration() const {
+  return m_currentCalibParms;
+}
+
+/**
+ * Calculate a calibration, responding the the "new calibration"
+ * action/button.
+ *
+ * @param cs user settings
+ * @param vanNo Vanadium run number
+ * @param ceriaNo Ceria run number
+ * @param outFilename output filename chosen by the user
+ * @param specNos SpecNos or bank name to be passed
+ */
+void EnggDiffractionPresenter::doCalib(const EnggDiffCalibSettings &cs,
+                                       const std::string &vanNo,
+                                       const std::string &ceriaNo,
+                                       const std::string &outFilename,
+                                       const std::string &specNos) {
+  if (cs.m_inputDirCalib.empty()) {
+    m_calibError =
+        "No calibration directory selected. Please select a calibration "
+        "directory in Settings. This will be used to "
+        "cache Vanadium calibration data";
+    g_log.warning("No calibration directory selected. Please select a "
+                  "calibration directory in Settings. This will be used to "
+                  "cache Vanadium calibration data");
+    // This should be a userWarning once the threading problem has been dealt
+    // with
+    m_calibFinishedOK = false;
+    return;
+  }
+
+  // TODO: the settings tab should emit a signal when these are changed, on
+  // which the vanadium corrections model should be updated automatically
+  m_vanadiumCorrectionsModel->setCalibSettings(cs);
+  m_vanadiumCorrectionsModel->setCurrentInstrument(m_view->currentInstrument());
+  const auto vanadiumCorrectionWorkspaces =
+      m_vanadiumCorrectionsModel->fetchCorrectionWorkspaces(vanNo);
+  const auto &vanIntegWS = vanadiumCorrectionWorkspaces.first;
+  const auto &vanCurvesWS = vanadiumCorrectionWorkspaces.second;
+
+  MatrixWorkspace_sptr ceriaWS;
+  try {
+    auto load = Mantid::API::AlgorithmManager::Instance().create("Load");
+    load->initialize();
+    load->setPropertyValue("Filename", ceriaNo);
+    const std::string ceriaWSName = "engggui_calibration_sample_ws";
+    load->setPropertyValue("OutputWorkspace", ceriaWSName);
+    load->execute();
+
+    AnalysisDataServiceImpl &ADS = Mantid::API::AnalysisDataService::Instance();
+    ceriaWS = ADS.retrieveWS<MatrixWorkspace>(ceriaWSName);
+  } catch (std::runtime_error &re) {
+    g_log.error()
+        << "Error while loading calibration sample data. "
+           "Could not run the algorithm Load succesfully for the "
+           "calibration "
+           "sample (run number: " +
+               ceriaNo + "). Error description: " + re.what() +
+               " Please check also the previous log messages for details.";
+    throw;
+  }
+
+  // Bank 1 and 2 - ENGIN-X
+  // bank 1 - loops once & used for cropped calibration
+  // bank 2 - loops twice, one with each bank & used for new calibration
+  std::vector<double> difa, difc, tzero;
+  // for the names of the output files
+  std::vector<std::string> bankNames;
+
+  bool specNumUsed = specNos != "";
+  // TODO: this needs sanitizing, it should be simpler
+  if (specNumUsed) {
+    constexpr size_t bankNo1 = 1;
+
+    difa.resize(bankNo1);
+    difc.resize(bankNo1);
+    tzero.resize(bankNo1);
+    int selection = m_view->currentCropCalibBankName();
+    if (0 == selection) {
+      // user selected "custom" name
+      const std::string customName = m_view->currentCalibCustomisedBankName();
+      if (customName.empty()) {
+        bankNames.emplace_back("cropped");
+      } else {
+        bankNames.emplace_back(customName);
+      }
+    } else if (1 == selection) {
+      bankNames.emplace_back("North");
+    } else {
+      bankNames.emplace_back("South");
+    }
+  } else {
+    constexpr size_t bankNo2 = 2;
+
+    difa.resize(bankNo2);
+    difc.resize(bankNo2);
+    tzero.resize(bankNo2);
+    bankNames = {"North", "South"};
+  }
+
+  for (size_t i = 0; i < difc.size(); i++) {
+    auto alg =
+        Mantid::API::AlgorithmManager::Instance().create("EnggCalibrate");
+
+    alg->initialize();
+    alg->setProperty("InputWorkspace", ceriaWS);
+    alg->setProperty("VanIntegrationWorkspace", vanIntegWS);
+    alg->setProperty("VanCurvesWorkspace", vanCurvesWS);
+    if (specNumUsed) {
+      alg->setPropertyValue(g_calibCropIdentifier,
+                            boost::lexical_cast<std::string>(specNos));
+    } else {
+      alg->setPropertyValue("Bank", boost::lexical_cast<std::string>(i + 1));
+    }
+    const std::string outFitParamsTblName =
+        outFitParamsTblNameGenerator(specNos, i);
+    alg->setPropertyValue("FittedPeaks", outFitParamsTblName);
+    alg->setPropertyValue("OutputParametersTableName", outFitParamsTblName);
+    alg->execute();
+    if (!alg->isExecuted()) {
+      g_log.error() << "Error in calibration. ",
+          "Could not run the algorithm EnggCalibrate successfully for bank " +
+              boost::lexical_cast<std::string>(i);
+      throw std::runtime_error("EnggCalibrate failed");
+    }
+
+    difa[i] = alg->getProperty("DIFA");
+    difc[i] = alg->getProperty("DIFC");
+    tzero[i] = alg->getProperty("TZERO");
+
+    g_log.information() << " * Bank " << i + 1 << " calibrated, "
+                        << "difa: " << difa[i] << ", difc: " << difc[i]
+                        << ", zero: " << tzero[i] << '\n';
+  }
+
+  // Creates appropriate output directory
+  const std::string calibrationComp = "Calibration";
+  const Poco::Path userCalSaveDir = outFilesUserDir(calibrationComp);
+  const Poco::Path generalCalSaveDir = outFilesGeneralDir(calibrationComp);
+
+  // Use poco to append filename so it is OS independent
+  std::string userCalFullPath =
+      appendToPath(userCalSaveDir.toString(), outFilename);
+  std::string generalCalFullPath =
+      appendToPath(generalCalSaveDir.toString(), outFilename);
+
+  // Double horror: 1st use a python script
+  // 2nd: because runPythonCode does this by emitting a signal that goes to
+  // MantidPlot, it has to be done in the view (which is a UserSubWindow).
+  // First write the all banks parameters file
+  m_calibFullPath = generalCalSaveDir.toString();
+  writeOutCalibFile(userCalFullPath, difa, difc, tzero, bankNames, ceriaNo,
+                    vanNo);
+  writeOutCalibFile(generalCalFullPath, difa, difc, tzero, bankNames, ceriaNo,
+                    vanNo);
+
+  m_currentCalibParms.clear();
+
+  // Then write one individual file per bank, using different templates and the
+  // specific bank name as suffix
+  for (size_t bankIdx = 0; bankIdx < difc.size(); ++bankIdx) {
+    // Need to use van number not file name here else it will be
+    // "ENGINX_ENGINX12345_ENGINX12345...." as out name
+    const std::string bankFilename = buildCalibrateSuggestedFilename(
+        vanNo, ceriaNo, "bank_" + bankNames[bankIdx]);
+
+    // Regenerate both full paths for each bank now
+    userCalFullPath = appendToPath(userCalSaveDir.toString(), bankFilename);
+    generalCalFullPath =
+        appendToPath(generalCalSaveDir.toString(), bankFilename);
+
+    std::string templateFile = "template_ENGINX_241391_236516_North_bank.prm";
+    if (1 == bankIdx) {
+      templateFile = "template_ENGINX_241391_236516_South_bank.prm";
+    }
+
+    writeOutCalibFile(userCalFullPath, {difa[bankIdx]}, {difc[bankIdx]},
+                      {tzero[bankIdx]}, {bankNames[bankIdx]}, ceriaNo, vanNo,
+                      templateFile);
+    writeOutCalibFile(generalCalFullPath, {difa[bankIdx]}, {difc[bankIdx]},
+                      {tzero[bankIdx]}, {bankNames[bankIdx]}, ceriaNo, vanNo,
+                      templateFile);
+
+    m_currentCalibParms.emplace_back(GSASCalibrationParms(
+        bankIdx, difc[bankIdx], difa[bankIdx], tzero[bankIdx]));
+    if (1 == difc.size()) {
+      // it is a  single bank or cropped calibration, so take its specific name
+      m_calibFullPath = generalCalFullPath;
+    }
+  }
+  g_log.notice() << "Calibration file written as " << generalCalFullPath << '\n'
+                 << "And: " << userCalFullPath;
+
+  // plots the calibrated workspaces.
+  g_plottingCounter++;
+  plotCalibWorkspace(difa, difc, tzero, specNos);
+}
+
+/**
+ * Appends the current instrument as a filename prefix for numeric
+ * only inputs of the Vanadium run so Load can find the file
+ *
+ * @param vanNo The user input for the vanadium run
+ * @param outVanName The fixed filename for the vanadium run
+ */
+void EnggDiffractionPresenter::appendCalibInstPrefix(
+    const std::string &vanNo, std::string &outVanName) const {
+  // Use a single non numeric digit so we are guaranteed to skip
+  // generating cerium file names
+  const std::string cer = "-";
+  std::string outCerName;
+  appendCalibInstPrefix(vanNo, cer, outVanName, outCerName);
+}
+
+/**
+ * Appends the current instrument as a filename prefix for numeric
+ * only inputs of both the Vanadium and Cerium Oxide runs so Load
+ * can find the files.
+ *
+ * @param vanNo The user input for the vanadium run
+ * @param cerNo The user input for the cerium run
+ * @param outVanName The fixed filename for the vanadium run
+ * @param outCerName The fixed filename for the cerium run
+ */
+void EnggDiffractionPresenter::appendCalibInstPrefix(
+    const std::string &vanNo, const std::string &cerNo, std::string &outVanName,
+    std::string &outCerName) const {
+
+  // Load uses the default instrument if we don't give it the name of the
+  // instrument as a prefix (m_currentInst), when one isn't set or is set
+  // incorrectly, we prepend the name of the instrument to the vanadium number
+  // so that load can find the file and not cause a crash in Mantid
+  // Vanadium file
+  if (std::all_of(vanNo.begin(), vanNo.end(), ::isdigit)) {
+    // This only has digits - append prefix
+    outVanName = m_currentInst + vanNo;
+  }
+
+  // Cerium file
+  if (std::all_of(cerNo.begin(), cerNo.end(), ::isdigit)) {
+    // All digits - append inst prefix
+    outCerName = m_currentInst + cerNo;
+  }
+}
+
+/**
+ * Perform checks specific to normal/basic run focusing in addition to
+ * the general checks for any focusing (as done by
+ * inputChecksBeforeFocus() which is called from this method). Use
+ * always before running 'Focus'
+ *
+ * @param multi_RunNo vector of run number to focus
+ * @param banks which banks to consider in the focusing
+ *
+ * @throws std::invalid_argument with an informative message.
+ */
+void EnggDiffractionPresenter::inputChecksBeforeFocusBasic(
+    const std::vector<std::string> &multi_RunNo,
+    const std::vector<bool> &banks) {
+  if (multi_RunNo.size() == 0) {
+    const std::string msg = "The sample run number" + g_runNumberErrorStr;
+    throw std::invalid_argument(msg);
+  }
+
+  inputChecksBanks(banks);
+
+  inputChecksBeforeFocus();
+}
+
+/**
+ * Perform checks specific to focusing in "cropped" mode, in addition
+ * to the general checks for any focusing (as done by
+ * inputChecksBeforeFocus() which is called from this method). Use
+ * always before running 'FocusCropped'
+ *
+ * @param multi_RunNo vector of run number to focus
+ * @param banks which banks to consider in the focusing
+ * @param specNos list of spectra (as usual csv list of spectra in Mantid)
+ *
+ * @throws std::invalid_argument with an informative message.
+ */
+void EnggDiffractionPresenter::inputChecksBeforeFocusCropped(
+    const std::vector<std::string> &multi_RunNo, const std::vector<bool> &banks,
+    const std::string &specNos) {
+  if (multi_RunNo.size() == 0) {
+    throw std::invalid_argument("To focus cropped the sample run number" +
+                                g_runNumberErrorStr);
+  }
+
+  if (specNos.empty()) {
+    throw std::invalid_argument(
+        "The Spectrum Numbers field cannot be empty when "
+        "focusing in 'cropped' mode.");
+  }
+
+  inputChecksBanks(banks);
+
+  inputChecksBeforeFocus();
+}
+
+/**
+ * Perform checks specific to focusing in "texture" mode, in addition
+ * to the general checks for any focusing (as done by
+ * inputChecksBeforeFocus() which is called from this method). Use
+ * always before running 'FocusCropped'
+ *
+ * @param multi_RunNo vector of run number to focus
+ * @param dgFile file with detector grouping info
+ *
+ * @throws std::invalid_argument with an informative message.
+ */
+void EnggDiffractionPresenter::inputChecksBeforeFocusTexture(
+    const std::vector<std::string> &multi_RunNo, const std::string &dgFile) {
+  if (multi_RunNo.size() == 0) {
+    throw std::invalid_argument("To focus texture banks the sample run number" +
+                                g_runNumberErrorStr);
+  }
+
+  if (dgFile.empty()) {
+    throw std::invalid_argument("A detector grouping file needs to be "
+                                "specified when focusing texture banks.");
+  }
+  Poco::File dgf(dgFile);
+  if (!dgf.exists()) {
+    throw std::invalid_argument(
+        "The detector grouping file coult not be found: " + dgFile);
+  }
+
+  inputChecksBeforeFocus();
+}
+
+void EnggDiffractionPresenter::inputChecksBanks(
+    const std::vector<bool> &banks) {
+  if (0 == banks.size()) {
+    const std::string msg =
+        "Error in specification of banks found when starting the "
+        "focusing process. Cannot continue.";
+    g_log.error() << msg << '\n';
+    throw std::invalid_argument(msg);
+  }
+  if (banks.end() == std::find(banks.begin(), banks.end(), true)) {
+    const std::string msg =
+        "EnggDiffraction GUI: not focusing, as none of the banks "
+        "have been selected. You probably forgot to select at least one.";
+    g_log.warning() << msg << '\n';
+    throw std::invalid_argument(msg);
+  }
+}
+
+/**
+ * Performs several checks on the current focusing inputs and
+ * settings. This should be done before starting any focus work. The
+ * message return should be shown to the user as a visible message
+ * (pop-up, error log, etc.)
+ *
+ * @throws std::invalid_argument with an informative message.
+ */
+void EnggDiffractionPresenter::inputChecksBeforeFocus() {
+  EnggDiffCalibSettings cs = m_view->currentCalibSettings();
+  const std::string pixelCalib = cs.m_pixelCalibFilename;
+  if (pixelCalib.empty()) {
+    throw std::invalid_argument(
+        "You need to set a pixel (full) calibration in settings.");
+  }
+}
+
+/**
+ * Builds the names of the output focused files (one per bank), given
+ * the sample run number and which banks should be focused.
+ *
+ * @param runNo number of the run for which we want a focused output
+ * file name
+ *
+ * @param banks for every bank, (true/false) to consider it or not for
+ * the focusing
+ *
+ * @return filenames (without the full path)
+ */
+std::vector<std::string>
+EnggDiffractionPresenter::outputFocusFilenames(const std::string &runNo,
+                                               const std::vector<bool> &banks) {
+  const std::string instStr = m_view->currentInstrument();
+  const std::string runNumber = Poco::Path(runNo).getBaseName();
+  std::vector<std::string> res;
+  res.reserve(banks.size());
+  const auto instrumentPresent = runNumber.find(instStr);
+  std::string runName =
+      (instrumentPresent != std::string::npos)
+          ? runNumber.substr(instrumentPresent + instStr.size())
+          : runNumber;
+
+  std::string prefix = instStr + "_" +
+                       runName.erase(0, std::min(runName.find_first_not_of('0'),
+                                                 runName.size() - 1)) +
+                       "_focused_bank_";
+
+  for (size_t b = 1; b <= banks.size(); b++) {
+    res.emplace_back(prefix + boost::lexical_cast<std::string>(b) + ".nxs");
+  }
+  return res;
+}
+
+std::string
+EnggDiffractionPresenter::outputFocusCroppedFilename(const std::string &runNo) {
+  const std::string instStr = m_view->currentInstrument();
+  const std::string runNumber = Poco::Path(runNo).getBaseName();
+  const auto instrumentPresent = runNumber.find(instStr);
+  std::string runName =
+      (instrumentPresent != std::string::npos)
+          ? runNumber.substr(instrumentPresent + instStr.size())
+          : runNumber;
+  return instStr + "_" +
+         runName.erase(
+             0, std::min(runName.find_first_not_of('0'), runName.size() - 1)) +
+         "_focused_cropped.nxs";
+}
+
+std::vector<std::string> EnggDiffractionPresenter::sumOfFilesLoadVec() {
+  std::vector<std::string> multi_RunNo;
+
+  if (g_sumOfFilesFocus == "basic")
+    multi_RunNo = isValidMultiRunNumber(m_view->focusingRunNo());
+  else if (g_sumOfFilesFocus == "cropped")
+    multi_RunNo = isValidMultiRunNumber(m_view->focusingCroppedRunNo());
+  else if (g_sumOfFilesFocus == "texture")
+    multi_RunNo = isValidMultiRunNumber(m_view->focusingTextureRunNo());
+
+  return multi_RunNo;
+}
+
+std::vector<std::string> EnggDiffractionPresenter::outputFocusTextureFilenames(
+    const std::string &runNo, const std::vector<size_t> &bankIDs) {
+  const std::string instStr = m_view->currentInstrument();
+  const std::string runNumber = Poco::Path(runNo).getBaseName();
+  const std::string runName =
+      runNumber.substr(runNumber.find(instStr) + instStr.size());
+  std::vector<std::string> res;
+  res.reserve(bankIDs.size());
+  std::string prefix = instStr + "_" + runName + "_focused_texture_bank_";
+  for (auto bankID : bankIDs) {
+    res.emplace_back(prefix + boost::lexical_cast<std::string>(bankID) +
+                     ".nxs");
+  }
+
+  return res;
+}
+
+/**
+ * Start the focusing algorithm(s) without blocking the GUI. This is
+ * based on Qt connect / signals-slots so that it goes in sync with
+ * the Qt event loop. For that reason this class needs to be a
+ * Q_OBJECT.
+ *
+ * @param multi_RunNo input vector of run number
+ * @param banks instrument bank to focus
+ * @param specNos list of spectra (as usual csv list of spectra in Mantid)
+ * @param dgFile detector grouping file name
+ */
+void EnggDiffractionPresenter::startAsyncFocusWorker(
+    const std::vector<std::string> &multi_RunNo, const std::vector<bool> &banks,
+    const std::string &dgFile, const std::string &specNos) {
+
+  delete m_workerThread;
+  m_workerThread = new QThread(this);
+  EnggDiffWorker *worker =
+      new EnggDiffWorker(this, multi_RunNo, banks, dgFile, specNos);
+  worker->moveToThread(m_workerThread);
+  connect(m_workerThread, SIGNAL(started()), worker, SLOT(focus()));
+  connect(worker, SIGNAL(finished()), this, SLOT(focusingFinished()));
+  // early delete of thread and worker
+  connect(m_workerThread, SIGNAL(finished()), m_workerThread,
+          SLOT(deleteLater()), Qt::DirectConnection);
+  connect(worker, SIGNAL(finished()), worker, SLOT(deleteLater()));
+  m_workerThread->start();
+}
+
+/**
+ * Produce a new focused output file. This is what threads/workers
+ * should use to run the calculations required to process a 'focus'
+ * push or similar from the user.
+ *
+ * @param runNo input run number
+ *
+ * @param specNos list of spectra to use when focusing. Not empty
+ * implies focusing in cropped mode.
+ *
+ * @param dgFile detector grouping file to define banks (texture). Not
+ * empty implies focusing in texture mode.
+ *
+ * @param banks for every bank, (true/false) to consider it or not for
+ * the focusing
+ */
+void EnggDiffractionPresenter::doFocusRun(const std::string &runNo,
+                                          const std::vector<bool> &banks,
+                                          const std::string &specNos,
+                                          const std::string &dgFile) {
+
+  if (g_abortThread) {
+    return;
+  }
+
+  // to track last valid run
+  g_lastValidRun = runNo;
+
+  g_log.notice() << "Generating new focusing workspace(s) and file(s)";
+
+  // TODO: this is almost 100% common with doNewCalibrate() - refactor
+  EnggDiffCalibSettings cs = m_view->currentCalibSettings();
+  Mantid::Kernel::ConfigServiceImpl &conf =
+      Mantid::Kernel::ConfigService::Instance();
+  const std::vector<std::string> tmpDirs = conf.getDataSearchDirs();
+  // in principle, the run files will be found from 'DirRaw', and the
+  // pre-calculated Vanadium corrections from 'DirCalib'
+  if (!cs.m_inputDirCalib.empty() && Poco::File(cs.m_inputDirCalib).exists()) {
+    conf.appendDataSearchDir(cs.m_inputDirCalib);
+  }
+  if (!cs.m_inputDirRaw.empty() && Poco::File(cs.m_inputDirRaw).exists()) {
+    conf.appendDataSearchDir(cs.m_inputDirRaw);
+  }
+  for (const auto &browsed : m_browsedToPaths) {
+    conf.appendDataSearchDir(browsed);
+  }
+
+  // Prepare special inputs for "texture" focusing
+  std::vector<size_t> bankIDs;
+  std::vector<std::string> effectiveFilenames;
+  std::vector<std::string> specs;
+  if (!specNos.empty()) {
+    // Cropped focusing
+    // just to iterate once, but there's no real bank here
+    bankIDs.emplace_back(0);
+    specs.emplace_back(specNos); // one spectrum Nos list given by the user
+    effectiveFilenames.emplace_back(outputFocusCroppedFilename(runNo));
+  } else {
+    if (dgFile.empty()) {
+      // Basic/normal focusing
+      for (size_t bidx = 0; bidx < banks.size(); bidx++) {
+        if (banks[bidx]) {
+          bankIDs.emplace_back(bidx + 1);
+          specs.emplace_back("");
+          effectiveFilenames = outputFocusFilenames(runNo, banks);
+        }
+      }
+    } else {
+      // texture focusing
+      try {
+        loadDetectorGroupingCSV(dgFile, bankIDs, specs);
+      } catch (std::runtime_error &re) {
+        g_log.error() << "Error loading detector grouping file: " + dgFile +
+                             ". Detailed error: " + re.what()
+                      << '\n';
+        bankIDs.clear();
+        specs.clear();
+      }
+      effectiveFilenames = outputFocusTextureFilenames(runNo, bankIDs);
+    }
+  }
+
+  // focus all requested banks
+  for (size_t idx = 0; idx < bankIDs.size(); idx++) {
+    g_log.notice() << "Generating new focused file (bank " +
+                          boost::lexical_cast<std::string>(bankIDs[idx]) +
+                          ") for run " + runNo + " into: "
+                   << effectiveFilenames[idx] << '\n';
+    try {
+
+      doFocusing(cs, runNo, bankIDs[idx], specs[idx], dgFile);
+      m_focusFinishedOK = true;
+    } catch (std::runtime_error &rexc) {
+      m_focusFinishedOK = false;
+      g_log.error() << "The focusing calculations failed. One of the algorithms"
+                       "did not execute correctly. See log messages for "
+                       "further details. Error: " +
+                           std::string(rexc.what())
+                    << '\n';
+    } catch (std::invalid_argument &ia) {
+      m_focusFinishedOK = false;
+      g_log.error() << "The focusing failed. Some input properties "
+                       "were not valid. "
+                       "See log messages for details. Error: "
+                    << ia.what() << '\n';
+    } catch (const Mantid::API::Algorithm::CancelException &) {
+      m_focusFinishedOK = false;
+      g_log.error() << "Focus terminated by user.\n";
+    }
+  }
+
+  // restore initial data search paths
+  conf.setDataSearchDirs(tmpDirs);
+}
+
+void EnggDiffractionPresenter::loadDetectorGroupingCSV(
+    const std::string &dgFile, std::vector<size_t> &bankIDs,
+    std::vector<std::string> &specs) {
+  const char commentChar = '#';
+  const std::string delim = ",";
+
+  std::ifstream file(dgFile.c_str());
+  if (!file.is_open()) {
+    throw std::runtime_error("Failed to open file.");
+  }
+
+  bankIDs.clear();
+  specs.clear();
+  std::string line;
+  for (size_t li = 1; getline(file, line); li++) {
+    if (line.empty() || commentChar == line[0])
+      continue;
+
+    auto delimPos = line.find_first_of(delim);
+    if (std::string::npos == delimPos) {
+      throw std::runtime_error(
+          "In file '" + dgFile +
+          "', wrong format in line: " + boost::lexical_cast<std::string>(li) +
+          " which does not contain any delimiters (comma, etc.)");
+    }
+
+    try {
+      const std::string bstr = line.substr(0, delimPos);
+      const std::string spec = line.substr(delimPos + 1, std::string::npos);
+
+      if (bstr.empty()) {
+        throw std::runtime_error(
+            "In file '" + dgFile + "', wrong format in line: " +
+            boost::lexical_cast<std::string>(li) + ", the bank ID is empty!");
+      }
+      if (spec.empty()) {
+        throw std::runtime_error(
+            "In file '" + dgFile +
+            "', wrong format in line: " + boost::lexical_cast<std::string>(li) +
+            ", the list of spectrum Nos is empty!");
+      }
+
+      size_t bankID = boost::lexical_cast<size_t>(bstr);
+      bankIDs.emplace_back(bankID);
+      specs.emplace_back(spec);
+    } catch (std::runtime_error &re) {
+      throw std::runtime_error(
+          "In file '" + dgFile +
+          "', issue found when trying to interpret line: " +
+          boost::lexical_cast<std::string>(li) +
+          ". Error description: " + re.what());
+    }
+  }
+}
+
+/**
+ * Method (Qt slot) to call when the focusing work has finished,
+ * possibly from a separate thread but sometimes not (as in this
+ * presenter class' test).
+ */
+void EnggDiffractionPresenter::focusingFinished() {
+  if (!m_view)
+    return;
+
+  if (!m_focusFinishedOK) {
+    g_log.warning() << "The focusing did not finish correctly. Check previous "
+                       "log messages for details\n";
+    m_view->showStatus("Focusing didn't finish succesfully. Ready");
+  } else {
+    g_log.notice() << "Focusing finished - focused run(s) are ready.\n";
+    m_view->showStatus("Focusing finished succesfully. Ready");
+  }
+  if (m_workerThread) {
+    delete m_workerThread;
+    m_workerThread = nullptr;
+  }
+
+  m_view->enableCalibrateFocusFitUserActions(true);
+
+  // display warning and information to the users regarding Stop Focus
+  if (g_abortThread) {
+    // will get the last number in the list
+    const std::string last_RunNo = isValidRunNumber(m_view->focusingRunNo());
+    if (last_RunNo != g_lastValidRun) {
+      g_log.warning() << "Focussing process has been stopped, last successful "
+                         "run: "
+                      << g_lastValidRun << '\n';
+      m_view->showStatus("Focusing stopped. Ready");
+    }
+  }
+}
+
+/**
+ * Focuses a run, produces a focused workspace, and saves it into a
+ * file.
+ *
+ * @param cs user settings for calibration (this does not calibrate but
+ * uses calibration input files such as vanadium runs
+ *
+ * @param runLabel run number of the run to focus
+ *
+ * @param bank the Bank ID to focus
+ *
+ * @param specNos string specifying a list of spectra (for "cropped"
+ * focusing or "texture" focusing), only considered if not empty
+ *
+ * @param dgFile detector grouping file name. If not empty implies
+ * texture focusing
+ */
+void EnggDiffractionPresenter::doFocusing(const EnggDiffCalibSettings &cs,
+                                          const std::string &runLabel,
+                                          const size_t bank,
+                                          const std::string &specNos,
+                                          const std::string &dgFile) {
+  MatrixWorkspace_sptr inWS;
+
+  m_vanadiumCorrectionsModel->setCalibSettings(cs);
+  m_vanadiumCorrectionsModel->setCurrentInstrument(m_view->currentInstrument());
+  const auto vanadiumCorrectionWorkspaces =
+      m_vanadiumCorrectionsModel->fetchCorrectionWorkspaces(
+          m_view->currentVanadiumNo());
+  const auto &vanIntegWS = vanadiumCorrectionWorkspaces.first;
+  const auto &vanCurvesWS = vanadiumCorrectionWorkspaces.second;
+
+  const std::string inWSName = "engggui_focusing_input_ws";
+  const std::string instStr = m_view->currentInstrument();
+  std::vector<std::string> multi_RunNo = sumOfFilesLoadVec();
+  std::string loadInput = "";
+
+  for (size_t i = 0; i < multi_RunNo.size(); i++) {
+    // if last run number in list
+    if (i + 1 == multi_RunNo.size())
+      loadInput += multi_RunNo[i];
+    else
+      loadInput += multi_RunNo[i] + '+';
+  }
+
+  // if its not empty the global variable is set for sumOfFiles
+  if (!g_sumOfFilesFocus.empty()) {
+
+    try {
+      auto load =
+          Mantid::API::AlgorithmManager::Instance().createUnmanaged("Load");
+      load->initialize();
+      load->setPropertyValue("Filename", loadInput);
+
+      load->setPropertyValue("OutputWorkspace", inWSName);
+      load->execute();
+
+      AnalysisDataServiceImpl &ADS =
+          Mantid::API::AnalysisDataService::Instance();
+      inWS = ADS.retrieveWS<MatrixWorkspace>(inWSName);
+    } catch (std::runtime_error &re) {
+      g_log.error()
+          << "Error while loading files provided. "
+             "Could not run the algorithm Load succesfully for the focus "
+             "(run number provided. Error description:"
+             "Please check also the previous log messages for details." +
+                 static_cast<std::string>(re.what());
+      throw;
+    }
+
+    if (multi_RunNo.size() == 1) {
+      g_log.notice() << "Only single file has been listed, the Sum Of Files"
+                        "cannot not be processed\n";
+    } else {
+      g_log.notice()
+          << "Load alogirthm has successfully merged the files provided\n";
+    }
+
+  } else {
+    try {
+      auto load = Mantid::API::AlgorithmManager::Instance().create("Load");
+      load->initialize();
+      load->setPropertyValue("Filename", runLabel);
+      load->setPropertyValue("OutputWorkspace", inWSName);
+      load->execute();
+
+      AnalysisDataServiceImpl &ADS =
+          Mantid::API::AnalysisDataService::Instance();
+      inWS = ADS.retrieveWS<MatrixWorkspace>(inWSName);
+    } catch (std::runtime_error &re) {
+      g_log.error() << "Error while loading sample data for focusing. "
+                       "Could not run the algorithm Load succesfully for "
+                       "the focusing "
+                       "sample (run number: " +
+                           runLabel + "). Error description: " + re.what() +
+                           " Please check also the previous log messages "
+                           "for details.";
+      throw;
+    }
+  }
+  const auto bankString = std::to_string(bank);
+  std::string outWSName;
+  if (!dgFile.empty()) {
+    // doing focus "texture"
+    outWSName = "engggui_focusing_output_ws_texture_bank_" + bankString;
+  } else if (specNos.empty()) {
+    // doing focus "normal" / by banks
+    outWSName = "engggui_focusing_output_ws_bank_" + bankString;
+  } else {
+    // doing focus "cropped"
+    outWSName = "engggui_focusing_output_ws_cropped";
+  }
+  try {
+    auto alg = Mantid::API::AlgorithmManager::Instance().create("EnggFocus");
+    alg->initialize();
+    alg->setProperty("InputWorkspace", inWSName);
+    alg->setProperty("OutputWorkspace", outWSName);
+    alg->setProperty("VanIntegrationWorkspace", vanIntegWS);
+    alg->setProperty("VanCurvesWorkspace", vanCurvesWS);
+    // cropped / normal focusing
+    if (specNos.empty()) {
+      alg->setPropertyValue("Bank", bankString);
+    } else {
+      alg->setPropertyValue("SpectrumNumbers", specNos);
+    }
+    // TODO: use detector positions (from calibrate full) when available
+    // alg->setProperty(DetectorPositions, TableWorkspace)
+    alg->execute();
+    g_plottingCounter++;
+    plotFocusedWorkspace(outWSName);
+
+  } catch (std::runtime_error &re) {
+    g_log.error() << "Error in calibration. ",
+        "Could not run the algorithm EnggCalibrate successfully for bank " +
+            bankString + ". Error description: " + re.what() +
+            " Please check also the log messages for details.";
+    throw;
+  }
+  g_log.notice() << "Produced focused workspace: " << outWSName << '\n';
+
+  const bool saveOutputFiles = m_view->saveFocusedOutputFiles();
+  if (saveOutputFiles) {
+    try {
+      const auto runNo =
+          runLabel.substr(runLabel.rfind(instStr) + instStr.size());
+      RunLabel label(runNo, bank);
+      saveFocusedXYE(label, outWSName);
+      saveGSS(label, outWSName);
+      saveOpenGenie(label, outWSName);
+      saveNexus(label, outWSName);
+      exportSampleLogsToHDF5(outWSName, userHDFRunFilename(runNo));
+    } catch (std::runtime_error &re) {
+      g_log.error() << "Error saving focused data. ",
+          "There was an error while saving focused data. "
+          "Error Description: " +
+              std::string(re.what()) +
+              "Please check log messages for more details.";
+      throw;
+    }
+  }
+}
+
+/**
+ * Loads a workspace to pre-process (rebin, etc.). The workspace
+ * loaded can be a MatrixWorkspace or a group of MatrixWorkspace (for
+ * multiperiod data).
+ *
+ * @param runNo run number to search for the file with 'Load'.
+ */
+Workspace_sptr
+EnggDiffractionPresenter::loadToPreproc(const std::string &runNo) {
+  const std::string instStr = m_view->currentInstrument();
+  Workspace_sptr inWS;
+
+  // this is required when file is selected via browse button
+  const auto MultiRunNoDir = m_view->currentPreprocRunNo();
+  const auto runNoDir = MultiRunNoDir[0];
+
+  try {
+    auto load =
+        Mantid::API::AlgorithmManager::Instance().createUnmanaged("Load");
+    load->initialize();
+    if (Poco::File(runNoDir).exists()) {
+      load->setPropertyValue("Filename", runNoDir);
+    } else {
+      load->setPropertyValue("Filename", instStr + runNo);
+    }
+    const std::string inWSName = "engggui_preproc_input_ws";
+    load->setPropertyValue("OutputWorkspace", inWSName);
+
+    load->execute();
+
+    auto &ADS = Mantid::API::AnalysisDataService::Instance();
+    inWS = ADS.retrieveWS<Workspace>(inWSName);
+  } catch (std::runtime_error &re) {
+    g_log.error()
+        << "Error while loading run data to pre-process. "
+           "Could not run the algorithm Load succesfully for the run "
+           "number: " +
+               runNo + "). Error description: " + re.what() +
+               " Please check also the previous log messages for details.";
+    throw;
+  }
+
+  return inWS;
+}
+
+void EnggDiffractionPresenter::doRebinningTime(const std::string &runNo,
+                                               double bin,
+                                               const std::string &outWSName) {
+
+  // Runs something like:
+  // Rebin(InputWorkspace='ws_runNo', outputWorkspace=outWSName,Params=bin)
+
+  m_rebinningFinishedOK = false;
+  const Workspace_sptr inWS = loadToPreproc(runNo);
+  if (!inWS)
+    g_log.error()
+        << "Error: could not load the input workspace for rebinning.\n";
+
+  const std::string rebinName = "Rebin";
+  try {
+    auto alg =
+        Mantid::API::AlgorithmManager::Instance().createUnmanaged(rebinName);
+    alg->initialize();
+    alg->setPropertyValue("InputWorkspace", inWS->getName());
+    alg->setPropertyValue("OutputWorkspace", outWSName);
+    alg->setProperty("Params", boost::lexical_cast<std::string>(bin));
+
+    alg->execute();
+  } catch (std::invalid_argument &ia) {
+    g_log.error() << "Error when rebinning with a regular bin width in time. "
+                     "There was an error in the inputs to the algorithm " +
+                         rebinName + ". Error description: " + ia.what() +
+                         ".\n";
+    return;
+  } catch (std::runtime_error &re) {
+    g_log.error() << "Error when rebinning with a regular bin width in time. "
+                     "Coult not run the algorithm " +
+                         rebinName +
+                         " successfully. Error description: " + re.what() +
+                         ".\n";
+    return;
+  }
+
+  // succesful completion
+  m_rebinningFinishedOK = true;
+}
+
+void EnggDiffractionPresenter::inputChecksBeforeRebin(
+    const std::string &runNo) {
+  if (runNo.empty()) {
+    throw std::invalid_argument("The run to pre-process" + g_runNumberErrorStr);
+  }
+}
+
+void EnggDiffractionPresenter::inputChecksBeforeRebinTime(
+    const std::string &runNo, double bin) {
+  inputChecksBeforeRebin(runNo);
+
+  if (bin <= 0) {
+    throw std::invalid_argument("The bin width must be strictly positive");
+  }
+}
+
+/**
+ * Starts the Rebin algorithm(s) without blocking the GUI. This is
+ * based on Qt connect / signals-slots so that it goes in sync with
+ * the Qt event loop. For that reason this class needs to be a
+ * Q_OBJECT.
+ *
+ * @param runNo run number(s)
+ * @param bin bin width parameter for Rebin
+ * @param outWSName name for the output workspace produced here
+ */
+void EnggDiffractionPresenter::startAsyncRebinningTimeWorker(
+    const std::string &runNo, double bin, const std::string &outWSName) {
+
+  delete m_workerThread;
+  m_workerThread = new QThread(this);
+  auto *worker = new EnggDiffWorker(this, runNo, bin, outWSName);
+  worker->moveToThread(m_workerThread);
+
+  connect(m_workerThread, SIGNAL(started()), worker, SLOT(rebinTime()));
+  connect(worker, SIGNAL(finished()), this, SLOT(rebinningFinished()));
+  // early delete of thread and worker
+  connect(m_workerThread, SIGNAL(finished()), m_workerThread,
+          SLOT(deleteLater()), Qt::DirectConnection);
+  connect(worker, SIGNAL(finished()), worker, SLOT(deleteLater()));
+  m_workerThread->start();
+}
+
+void EnggDiffractionPresenter::inputChecksBeforeRebinPulses(
+    const std::string &runNo, size_t nperiods, double timeStep) {
+  inputChecksBeforeRebin(runNo);
+
+  if (0 == nperiods) {
+    throw std::invalid_argument("The number of periods has been set to 0 so "
+                                "none of the periods will be processed");
+  }
+
+  if (timeStep <= 0) {
+    throw std::invalid_argument(
+        "The bin or step for the time axis must be strictly positive");
+  }
+}
+
+void EnggDiffractionPresenter::doRebinningPulses(const std::string &runNo,
+                                                 size_t nperiods,
+                                                 double timeStep,
+                                                 const std::string &outWSName) {
+  // TOOD: not clear what will be the role of this parameter for now
+  UNUSED_ARG(nperiods);
+
+  // Runs something like:
+  // RebinByPulseTimes(InputWorkspace='ws_runNo', outputWorkspace=outWSName,
+  //                   Params=timeStepstep)
+
+  m_rebinningFinishedOK = false;
+  const Workspace_sptr inWS = loadToPreproc(runNo);
+  if (!inWS)
+    g_log.error()
+        << "Error: could not load the input workspace for rebinning.\n";
+
+  const std::string rebinName = "RebinByPulseTimes";
+  try {
+    auto alg =
+        Mantid::API::AlgorithmManager::Instance().createUnmanaged(rebinName);
+    alg->initialize();
+    alg->setPropertyValue("InputWorkspace", inWS->getName());
+    alg->setPropertyValue("OutputWorkspace", outWSName);
+    alg->setProperty("Params", boost::lexical_cast<std::string>(timeStep));
+
+    alg->execute();
+  } catch (std::invalid_argument &ia) {
+    g_log.error() << "Error when rebinning by pulse times. "
+                     "There was an error in the inputs to the algorithm " +
+                         rebinName + ". Error description: " + ia.what() +
+                         ".\n";
+    return;
+  } catch (std::runtime_error &re) {
+    g_log.error() << "Error when rebinning by pulse times. "
+                     "Coult not run the algorithm " +
+                         rebinName +
+                         " successfully. Error description: " + re.what() +
+                         ".\n";
+    return;
+  }
+
+  // successful execution
+  m_rebinningFinishedOK = true;
+}
+
+/**
+ * Starts the Rebin (by pulses) algorithm(s) without blocking the
+ * GUI. This is based on Qt connect / signals-slots so that it goes in
+ * sync with the Qt event loop. For that reason this class needs to be
+ * a Q_OBJECT.
+ *
+ * @param runNo run number(s)
+ * @param nperiods max number of periods to process
+ * @param timeStep bin width parameter for the x (time) axis
+ * @param outWSName name for the output workspace produced here
+ */
+void EnggDiffractionPresenter::startAsyncRebinningPulsesWorker(
+    const std::string &runNo, size_t nperiods, double timeStep,
+    const std::string &outWSName) {
+
+  delete m_workerThread;
+  m_workerThread = new QThread(this);
+  auto *worker = new EnggDiffWorker(this, runNo, nperiods, timeStep, outWSName);
+  worker->moveToThread(m_workerThread);
+
+  connect(m_workerThread, SIGNAL(started()), worker, SLOT(rebinPulses()));
+  connect(worker, SIGNAL(finished()), this, SLOT(rebinningFinished()));
+  // early delete of thread and worker
+  connect(m_workerThread, SIGNAL(finished()), m_workerThread,
+          SLOT(deleteLater()), Qt::DirectConnection);
+  connect(worker, SIGNAL(finished()), worker, SLOT(deleteLater()));
+  m_workerThread->start();
+}
+
+/**
+ * Method (Qt slot) to call when the rebin work has finished,
+ * possibly from a separate thread but sometimes not (as in this
+ * presenter class' test).
+ */
+void EnggDiffractionPresenter::rebinningFinished() {
+  if (!m_view)
+    return;
+
+  if (!m_rebinningFinishedOK) {
+    g_log.warning() << "The pre-processing (re-binning) did not finish "
+                       "correctly. Check previous log messages for details\n";
+    m_view->showStatus("Rebinning didn't finish succesfully. Ready");
+  } else {
+    g_log.notice() << "Pre-processing (re-binning) finished - the output "
+                      "workspace is ready.\n";
+    m_view->showStatus("Rebinning finished succesfully. Ready");
+  }
+  if (m_workerThread) {
+    delete m_workerThread;
+    m_workerThread = nullptr;
+  }
+
+  m_view->enableCalibrateFocusFitUserActions(true);
+}
+
+/**
+ * Checks the plot type selected and applies the appropriate
+ * python function to apply during first bank and second bank
+ *
+ * @param outWSName title of the focused workspace
+ */
+void EnggDiffractionPresenter::plotFocusedWorkspace(
+    const std::string &outWSName) {
+  const bool plotFocusedWS = m_view->focusedOutWorkspace();
+  enum PlotMode { REPLACING = 0, WATERFALL = 1, MULTIPLE = 2 };
+
+  int plotType = m_view->currentPlotType();
+
+  if (plotFocusedWS) {
+    if (plotType == PlotMode::REPLACING) {
+      if (g_plottingCounter == 1)
+        m_view->plotFocusedSpectrum(outWSName);
+      else
+        m_view->plotReplacingWindow(outWSName, "0", "0");
+
+    } else if (plotType == PlotMode::WATERFALL) {
+      if (g_plottingCounter == 1)
+        m_view->plotFocusedSpectrum(outWSName);
+      else
+        m_view->plotWaterfallSpectrum(outWSName);
+
+    } else if (plotType == PlotMode::MULTIPLE) {
+      m_view->plotFocusedSpectrum(outWSName);
+    }
+  }
+}
+
+/**
+ * Check if the plot calibration check-box is ticked
+ * python script is passed on to mantid python window
+ * which plots the workspaces with customisation
+ *
+ * @param difa vector of double passed on to py script
+ * @param difc vector of double passed on to py script
+ * @param tzero vector of double to plot graph
+ * @param specNos string carrying cropped calib info
+ */
+void EnggDiffractionPresenter::plotCalibWorkspace(
+    const std::vector<double> &difa, const std::vector<double> &difc,
+    const std::vector<double> &tzero, const std::string &specNos) {
+  const bool plotCalibWS = m_view->plotCalibWorkspace();
+  if (plotCalibWS) {
+    std::string pyCode = vanadiumCurvesPlotFactory();
+    m_view->plotCalibOutput(pyCode);
+
+    // Get the Customised Bank Name text-ield string from qt
+    std::string CustomisedBankName = m_view->currentCalibCustomisedBankName();
+    if (CustomisedBankName.empty())
+      CustomisedBankName = "cropped";
+    const std::string pythonCode =
+        TOFFitWorkspaceFactory(difa, difc, tzero, specNos, CustomisedBankName) +
+        plotTOFWorkspace(CustomisedBankName);
+    m_view->plotCalibOutput(pythonCode);
+  }
+}
+
+/**
+ * Convert the generated output files and saves them in
+ * FocusedXYE format
+ *
+ * @param runLabel run number and bank ID of the workspace to save
+ * @param inputWorkspace title of the focused workspace
+ */
+void EnggDiffractionPresenter::saveFocusedXYE(
+    const RunLabel &runLabel, const std::string &inputWorkspace) {
+
+  // Generates the file name in the appropriate format
+  std::string fullFilename =
+      outFileNameFactory(inputWorkspace, runLabel, ".dat");
+
+  const std::string focusingComp = "Focus";
+  // Creates appropriate directory
+  auto saveDir = outFilesUserDir(focusingComp);
+
+  // append the full file name in the end
+  saveDir.append(fullFilename);
+
+  try {
+    g_log.debug() << "Going to save focused output into OpenGenie file: "
+                  << fullFilename << '\n';
+    auto alg = Mantid::API::AlgorithmManager::Instance().createUnmanaged(
+        "SaveFocusedXYE");
+    alg->initialize();
+    alg->setProperty("InputWorkspace", inputWorkspace);
+    const std::string filename(saveDir.toString());
+    alg->setPropertyValue("Filename", filename);
+    alg->setProperty("SplitFiles", false);
+    alg->setPropertyValue("StartAtBankNumber", std::to_string(runLabel.bank));
+    alg->execute();
+  } catch (std::runtime_error &re) {
+    g_log.error() << "Error in saving FocusedXYE format file. ",
+        "Could not run the algorithm SaveFocusXYE succesfully for "
+        "workspace " +
+            inputWorkspace + ". Error description: " + re.what() +
+            " Please check also the log messages for details.";
+    throw;
+  }
+  g_log.notice() << "Saved focused workspace as file: " << saveDir.toString()
+                 << '\n';
+  copyToGeneral(saveDir, focusingComp);
+}
+
+/**
+ * Convert the generated output files and saves them in
+ * GSS format
+ *
+ * @param runLabel run number and bank ID the workspace to save
+ * @param inputWorkspace title of the focused workspace
+ */
+void EnggDiffractionPresenter::saveGSS(const RunLabel &runLabel,
+                                       const std::string &inputWorkspace) {
+
+  // Generates the file name in the appropriate format
+  std::string fullFilename =
+      outFileNameFactory(inputWorkspace, runLabel, ".gss");
+
+  const std::string focusingComp = "Focus";
+  // Creates appropriate directory
+  auto saveDir = outFilesUserDir(focusingComp);
+
+  // append the full file name in the end
+  saveDir.append(fullFilename);
+
+  try {
+    g_log.debug() << "Going to save focused output into OpenGenie file: "
+                  << fullFilename << '\n';
+    auto alg =
+        Mantid::API::AlgorithmManager::Instance().createUnmanaged("SaveGSS");
+    alg->initialize();
+    alg->setProperty("InputWorkspace", inputWorkspace);
+    std::string filename(saveDir.toString());
+    alg->setPropertyValue("Filename", filename);
+    alg->setProperty("SplitFiles", false);
+    alg->setPropertyValue("Bank", std::to_string(runLabel.bank));
+    alg->execute();
+  } catch (std::runtime_error &re) {
+    g_log.error() << "Error in saving GSS format file. ",
+        "Could not run the algorithm saveGSS succesfully for "
+        "workspace " +
+            inputWorkspace + ". Error description: " + re.what() +
+            " Please check also the log messages for details.";
+    throw;
+  }
+  g_log.notice() << "Saved focused workspace as file: " << saveDir.toString()
+                 << '\n';
+  copyToGeneral(saveDir, focusingComp);
+}
+
+void EnggDiffractionPresenter::saveNexus(const RunLabel &runLabel,
+                                         const std::string &inputWorkspace) {
+  const auto filename = outFileNameFactory(inputWorkspace, runLabel, ".nxs");
+  auto saveDirectory = outFilesUserDir("Focus");
+  saveDirectory.append(filename);
+  const auto fullOutFileName = saveDirectory.toString();
+
+  try {
+    g_log.debug() << "Going to save focused output into OpenGenie file: "
+                  << fullOutFileName << "\n";
+    auto alg =
+        Mantid::API::AlgorithmManager::Instance().createUnmanaged("SaveNexus");
+    alg->initialize();
+    alg->setProperty("InputWorkspace", inputWorkspace);
+    alg->setProperty("Filename", fullOutFileName);
+    alg->execute();
+  } catch (std::runtime_error &re) {
+    g_log.error() << "Error in save NXS format file. Could not run the "
+                     "algorithm SaveNexus successfully for workspace "
+                  << inputWorkspace << ". Error description: " << re.what()
+                  << ". Please also check the log message for details.";
+    throw;
+  }
+  g_log.notice() << "Saved focused workspace as file: " << fullOutFileName
+                 << "\n";
+  copyToGeneral(saveDirectory, "Focus");
+}
+
+/**
+ * Convert the generated output files and saves them in
+ * OpenGenie format
+ *
+ * @param runLabel run number and bank ID of the workspace to save
+ * @param inputWorkspace title of the focused workspace
+ */
+void EnggDiffractionPresenter::saveOpenGenie(
+    const RunLabel &runLabel, const std::string &inputWorkspace) {
+
+  // Generates the file name in the appropriate format
+  std::string fullFilename =
+      outFileNameFactory(inputWorkspace, runLabel, ".his");
+
+  std::string comp;
+  Poco::Path saveDir;
+  if (inputWorkspace.std::string::find("curves") != std::string::npos ||
+      inputWorkspace.std::string::find("intgration") != std::string::npos) {
+    // Creates appropriate directory
+    comp = "Calibration";
+    saveDir = outFilesUserDir(comp);
+  } else {
+    // Creates appropriate directory
+    comp = "Focus";
+    saveDir = outFilesUserDir(comp);
+  }
+
+  // append the full file name in the end
+  saveDir.append(fullFilename);
+
+  try {
+    g_log.debug() << "Going to save focused output into OpenGenie file: "
+                  << fullFilename << '\n';
+    auto alg = Mantid::API::AlgorithmManager::Instance().createUnmanaged(
+        "SaveOpenGenieAscii");
+    alg->initialize();
+    alg->setProperty("InputWorkspace", inputWorkspace);
+    std::string filename(saveDir.toString());
+    alg->setPropertyValue("Filename", filename);
+    alg->setPropertyValue("OpenGenieFormat", "ENGIN-X Format");
+    alg->execute();
+  } catch (std::runtime_error &re) {
+    g_log.error() << "Error in saving OpenGenie format file. ",
+        "Could not run the algorithm SaveOpenGenieAscii succesfully for "
+        "workspace " +
+            inputWorkspace + ". Error description: " + re.what() +
+            " Please check also the log messages for details.";
+    throw;
+  }
+  g_log.notice() << "Saves OpenGenieAscii (.his) file written as: "
+                 << saveDir.toString() << '\n';
+  copyToGeneral(saveDir, comp);
+}
+
+void EnggDiffractionPresenter::exportSampleLogsToHDF5(
+    const std::string &inputWorkspace, const std::string &filename) const {
+  auto saveAlg = Mantid::API::AlgorithmManager::Instance().create(
+      "ExportSampleLogsToHDF5");
+  saveAlg->initialize();
+  saveAlg->setProperty("InputWorkspace", inputWorkspace);
+  saveAlg->setProperty("Filename", filename);
+  saveAlg->setProperty("Blacklist", "bankid");
+  saveAlg->execute();
+}
+
+/**
+ * Generates the required file name of the output files
+ *
+ * @param inputWorkspace title of the focused workspace
+ * @param runLabel run number and bank ID of the workspace to save
+ * @param format the format of the file to be saved as
+ */
+std::string
+EnggDiffractionPresenter::outFileNameFactory(const std::string &inputWorkspace,
+                                             const RunLabel &runLabel,
+                                             const std::string &format) {
+  std::string fullFilename;
+
+  const auto runNo = runLabel.runNumber;
+  const auto bank = std::to_string(runLabel.bank);
+
+  // calibration output files
+  if (inputWorkspace.std::string::find("curves") != std::string::npos) {
+    fullFilename =
+        "ob+" + m_currentInst + "_" + runNo + "_" + bank + "_bank" + format;
+
+    // focus output files
+  } else if (inputWorkspace.std::string::find("texture") != std::string::npos) {
+    fullFilename = m_currentInst + "_" + runNo + "_texture_" + bank + format;
+  } else if (inputWorkspace.std::string::find("cropped") != std::string::npos) {
+    fullFilename = m_currentInst + "_" + runNo + "_cropped_" +
+                   boost::lexical_cast<std::string>(g_croppedCounter) + format;
+    g_croppedCounter++;
+  } else {
+    fullFilename = m_currentInst + "_" + runNo + "_bank_" + bank + format;
+  }
+  return fullFilename;
+}
+
+std::string EnggDiffractionPresenter::vanadiumCurvesPlotFactory() {
+  std::string pyCode =
+
+      "van_curve_twin_ws = \"__engggui_vanadium_curves_twin_ws\"\n"
+
+      "if(mtd.doesExist(van_curve_twin_ws)):\n"
+      " DeleteWorkspace(van_curve_twin_ws)\n"
+
+      "CloneWorkspace(InputWorkspace = \"engggui_vanadium_curves\", "
+      "OutputWorkspace = van_curve_twin_ws)\n"
+
+      "van_curves_ws = workspace(van_curve_twin_ws)\n"
+      "for i in range(1, 3):\n"
+      " if (i == 1):\n"
+      "  curve_plot_bank_1 = plotSpectrum(van_curves_ws, [0, 1, "
+      "2]).activeLayer()\n"
+      "  curve_plot_bank_1.setTitle(\"Engg GUI Vanadium Curves Bank 1\")\n"
+
+      " if (i == 2):\n"
+      "  curve_plot_bank_2 = plotSpectrum(van_curves_ws, [3, 4, "
+      "5]).activeLayer()\n"
+      "  curve_plot_bank_2.setTitle(\"Engg GUI Vanadium Curves Bank 2\")\n";
+
+  return pyCode;
+}
+
+/**
+ * Generates the workspace with difc/zero according to the selected bank
+ *
+ * @param difa vector containing constants difa value of each bank
+ * @param difc vector containing constants difc value of each bank
+ * @param tzero vector containing constants tzero value of each bank
+ * @param specNo used to set range for Calibration Cropped
+ * @param customisedBankName used to set the file and workspace name
+ *
+ * @return string with a python script
+ */
+std::string EnggDiffractionPresenter::TOFFitWorkspaceFactory(
+    const std::vector<double> &difa, const std::vector<double> &difc,
+    const std::vector<double> &tzero, const std::string &specNo,
+    const std::string &customisedBankName) const {
+
+  auto bank1 = size_t(0);
+  auto bank2 = size_t(1);
+  std::string pyRange;
+  std::string plotSpecNum = "False";
+
+  // sets the range to plot appropriate graph for the particular bank
+  if (specNo == "North") {
+    // only enable script to plot bank 1
+    pyRange = "1, 2";
+  } else if (specNo == "South") {
+    // only enables python script to plot bank 2
+    // as bank 2 data will be located in difc[0] & tzero[0] - refactor
+    pyRange = "2, 3";
+    bank2 = size_t(0);
+  } else if (specNo != "") {
+    pyRange = "1, 2";
+    plotSpecNum = "True";
+  } else {
+    // enables python script to plot bank 1 & 2
+    pyRange = "1, 3";
+  }
+
+  std::string pyCode =
+      "plotSpecNum = " + plotSpecNum +
+      "\n"
+      "for i in range(" +
+      pyRange +
+      "):\n"
+
+      " if (plotSpecNum == False):\n"
+      "  bank_ws = workspace(\"engggui_calibration_bank_\" + str(i))\n"
+      " else:\n"
+      "  bank_ws = workspace(\"engggui_calibration_bank_" +
+      customisedBankName +
+      "\")\n"
+
+      " xVal = []\n"
+      " yVal = []\n"
+      " y2Val = []\n"
+
+      " if (i == 1):\n"
+      "  difa=" +
+      boost::lexical_cast<std::string>(difa[bank1]) + "\n" +
+      "  difc=" + boost::lexical_cast<std::string>(difc[bank1]) + "\n" +
+      "  tzero=" + boost::lexical_cast<std::string>(tzero[bank1]) + "\n" +
+      " else:\n"
+
+      "  difa=" +
+      boost::lexical_cast<std::string>(difa[bank2]) + "\n" +
+      "  difc=" + boost::lexical_cast<std::string>(difc[bank2]) + "\n" +
+      "  tzero=" + boost::lexical_cast<std::string>(tzero[bank2]) + "\n" +
+
+      " for irow in range(0, bank_ws.rowCount()):\n"
+      "  xVal.append(bank_ws.cell(irow, 0))\n"
+      "  yVal.append(bank_ws.cell(irow, 5))\n"
+
+      "  y2Val.append(pow(xVal[irow], 2) * difa + xVal[irow] * difc + tzero)\n"
+
+      " ws1 = CreateWorkspace(DataX=xVal, DataY=yVal, UnitX=\"Expected "
+      "Peaks "
+      " Centre(dSpacing, A)\", YUnitLabel = \"Fitted Peaks Centre(TOF, "
+      "us)\")\n"
+      " ws2 = CreateWorkspace(DataX=xVal, DataY=y2Val)\n";
+  return pyCode;
+}
+
+/**
+* Plot the workspace with difc/zero acordding to selected bank
+*
+* @param customisedBankName used to set the file and workspace name
+*
+* @return string with a python script which will merge with
+*
+
+*/
+std::string EnggDiffractionPresenter::plotTOFWorkspace(
+    const std::string &customisedBankName) const {
+  std::string pyCode =
+      // plotSpecNum is true when SpectrumNos being used
+      " if (plotSpecNum == False):\n"
+      "  output_ws = \"engggui_difc_zero_peaks_bank_\" + str(i)\n"
+      " else:\n"
+      "  output_ws = \"engggui_difc_zero_peaks_" +
+      customisedBankName +
+      "\"\n"
+
+      // delete workspace if exists within ADS already
+      " if(mtd.doesExist(output_ws)):\n"
+      "  DeleteWorkspace(output_ws)\n"
+
+      // append workspace with peaks data for Peaks Fitted
+      // and Difc/TZero Straight line
+      " AppendSpectra(ws1, ws2, OutputWorkspace=output_ws)\n"
+      " DeleteWorkspace(ws1)\n"
+      " DeleteWorkspace(ws2)\n"
+
+      " if (plotSpecNum == False):\n"
+      "  DifcZero = \"engggui_difc_zero_peaks_bank_\" + str(i)\n"
+      " else:\n"
+      "  DifcZero = \"engggui_difc_zero_peaks_" +
+      customisedBankName +
+      "\"\n"
+
+      " DifcZeroWs = workspace(DifcZero)\n"
+      " DifcZeroPlot = plotSpectrum(DifcZeroWs, [0, 1]).activeLayer()\n"
+
+      " if (plotSpecNum == False):\n"
+      "  DifcZeroPlot.setTitle(\"Engg Gui Difc Zero Peaks Bank \" + "
+      "str(i))\n"
+      " else:\n"
+      "  DifcZeroPlot.setTitle(\"Engg Gui Difc Zero Peaks " +
+      customisedBankName +
+      "\")\n"
+
+      // set the legend title
+      " DifcZeroPlot.setCurveTitle(0, \"Peaks Fitted\")\n"
+      " DifcZeroPlot.setCurveTitle(1, \"DifC/TZero Fitted Straight Line\")\n"
+      " DifcZeroPlot.setAxisTitle(Layer.Bottom, \"Expected Peaks "
+      "Centre(dSpacing, "
+      " A)\")\n"
+      " DifcZeroPlot.setCurveLineStyle(0, QtCore.Qt.DotLine)\n";
+
+  return pyCode;
+}
+
+/**
+ * Generates appropriate names for table workspaces
+ *
+ * @param specNos SpecNos or bank name to be passed
+ * @param bank_i current loop of the bank during calibration
+ */
+std::string EnggDiffractionPresenter::outFitParamsTblNameGenerator(
+    const std::string &specNos, const size_t bank_i) const {
+  std::string outFitParamsTblName;
+  bool specNumUsed = specNos != "";
+
+  if (specNumUsed) {
+    if (specNos == "North")
+      outFitParamsTblName = "engggui_calibration_bank_1";
+    else if (specNos == "South")
+      outFitParamsTblName = "engggui_calibration_bank_2";
+    else {
+      // Get the Customised Bank Name text-ield string from qt
+      std::string CustomisedBankName = m_view->currentCalibCustomisedBankName();
+
+      if (CustomisedBankName.empty())
+        outFitParamsTblName = "engggui_calibration_bank_cropped";
+      else
+        outFitParamsTblName = "engggui_calibration_bank_" + CustomisedBankName;
+    }
+  } else {
+    outFitParamsTblName = "engggui_calibration_bank_" +
+                          boost::lexical_cast<std::string>(bank_i + 1);
+  }
+  return outFitParamsTblName;
+}
+
+/**
+ * Produces a path to the output directory where files are going to be
+ * written for a specific user + RB number / experiment ID. It creates
+ * the output directory if not found, and checks if it is ok and readable.
+ *
+ * @param addToDir adds a component to a specific directory for
+ * focusing, calibration or other files, for example "Calibration" or
+ * "Focus"
+ */
+Poco::Path
+EnggDiffractionPresenter::outFilesUserDir(const std::string &addToDir) const {
+  std::string rbn = m_view->getRBNumber();
+  Poco::Path dir = outFilesRootDir();
+
+  try {
+    dir.append("User");
+    dir.append(rbn);
+    dir.append(addToDir);
+
+    Poco::File dirFile(dir);
+    if (!dirFile.exists()) {
+      dirFile.createDirectories();
+    }
+  } catch (Poco::FileAccessDeniedException &e) {
+    g_log.error() << "Error caused by file access/permission, path to user "
+                     "directory: "
+                  << dir.toString() << ". Error details: " << e.what() << '\n';
+  } catch (std::runtime_error &re) {
+    g_log.error() << "Error while finding/creating a user path: "
+                  << dir.toString() << ". Error details: " << re.what() << '\n';
+  }
+  return dir;
+}
+
+std::string EnggDiffractionPresenter::userHDFRunFilename(
+    const std::string &runNumber) const {
+  auto userOutputDir = outFilesUserDir("Runs");
+  userOutputDir.append(runNumber + ".hdf5");
+  return userOutputDir.toString();
+}
+
+std::string EnggDiffractionPresenter::userHDFMultiRunFilename(
+    const std::vector<RunLabel> &runLabels) const {
+  const auto &begin = runLabels.cbegin();
+  const auto &end = runLabels.cend();
+  const auto minLabel = std::min_element(begin, end);
+  const auto maxLabel = std::max_element(begin, end);
+  auto userOutputDir = outFilesUserDir("Runs");
+  userOutputDir.append((minLabel->runNumber) + "_" + (maxLabel->runNumber) +
+                       ".hdf5");
+  return userOutputDir.toString();
+}
+
+/**
+ * Produces a path to the output directory where files are going to be
+ * written for a specific user + RB number / experiment ID. It creates
+ * the output directory if not found. See outFilesUserDir() for the
+ * sibling method that produces user/rb number-specific directories.
+ *
+ * @param addComponent path component to add to the root of general
+ * files, for example "Calibration" or "Focus"
+ */
+Poco::Path
+EnggDiffractionPresenter::outFilesGeneralDir(const std::string &addComponent) {
+  Poco::Path dir = outFilesRootDir();
+
+  try {
+
+    dir.append(addComponent);
+
+    Poco::File dirFile(dir);
+    if (!dirFile.exists()) {
+      dirFile.createDirectories();
+    }
+  } catch (Poco::FileAccessDeniedException &e) {
+    g_log.error() << "Error caused by file access/permission, path to "
+                     "general directory: "
+                  << dir.toString() << ". Error details: " << e.what() << '\n';
+  } catch (std::runtime_error &re) {
+    g_log.error() << "Error while finding/creating a general path: "
+                  << dir.toString() << ". Error details: " << re.what() << '\n';
+  }
+  return dir;
+}
+
+/**
+ * Produces the root path where output files are going to be written.
+ */
+Poco::Path EnggDiffractionPresenter::outFilesRootDir() const {
+  // TODO decide whether to move into settings or use mantid's default directory
+  // after discussion with users
+  const std::string rootDir = "EnginX_Mantid";
+  Poco::Path dir;
+
+  try {
+// takes to the root of directory according to the platform
+#ifdef _WIN32
+    const std::string ROOT_DRIVE = "C:/";
+    dir.assign(ROOT_DRIVE);
+#else
+    dir = Poco::Path().home();
+#endif
+    dir.append(rootDir);
+
+    Poco::File dirFile(dir);
+    if (!dirFile.exists()) {
+      dirFile.createDirectories();
+      g_log.notice() << "Creating output directory root for the first time: "
+                     << dir.toString() << '\n';
+    }
+
+  } catch (Poco::FileAccessDeniedException &e) {
+    g_log.error() << "Error, access/permission denied for root directory: "
+                  << dir.toString()
+                  << ". This is a severe error. The interface will not behave "
+                     "correctly when generating files. Error details: "
+                  << e.what() << '\n';
+  } catch (std::runtime_error &re) {
+    g_log.error() << "Error while finding/creating the root directory: "
+                  << dir.toString()
+                  << ". This is a severe error. Details: " << re.what() << '\n';
+  }
+
+  return dir;
+}
+
+/*
+ * Provides a small wrapper function that appends the given string
+ * to the given path in an OS independent manner and returns the
+ * resulting path as a string.
+ *
+ * @param currentPath The path to be appended to
+ * @param toAppend The string to append to the path (note '/' or '\\'
+ * characters should not be included
+ *
+ * @return String with the two parts of the path appended
+ */
+std::string
+EnggDiffractionPresenter::appendToPath(const std::string &currentPath,
+                                       const std::string &toAppend) const {
+  // Uses poco to handle to operation to ensure OS independence
+  Poco::Path newPath(currentPath);
+  newPath.append(toAppend);
+  return newPath.toString();
+}
+
+/**
+ * Copy files to the general directories. Normally files are produced
+ * in the user/RB number specific directories and then can be copied
+ * to the general/all directories using this method.
+ *
+ * @param source path to the file to copy
+ *
+ * @param pathComp path component to use for the copy file in the
+ * general directories, for example "Calibration" or "Focus"
+ */
+void EnggDiffractionPresenter::copyToGeneral(const Poco::Path &source,
+                                             const std::string &pathComp) {
+  Poco::File file(source);
+  if (!file.exists() || !file.canRead()) {
+    g_log.warning() << "Cannot copy the file " << source.toString()
+                    << " to the general/all users directories because it "
+                       "cannot be read.\n";
+    return;
+  }
+
+  auto destDir = outFilesGeneralDir(pathComp);
+  try {
+    Poco::File destDirFile(destDir);
+    if (!destDirFile.exists()) {
+      destDirFile.createDirectories();
+    }
+  } catch (std::runtime_error &rexc) {
+    g_log.error() << "Could not create output directory for the general/all "
+                     "files. Cannot copy the user files there:  "
+                  << destDir.toString() << ". Error details: " << rexc.what()
+                  << '\n';
+
+    return;
+  }
+
+  try {
+    file.copyTo(destDir.toString());
+  } catch (std::runtime_error &rexc) {
+    g_log.error() << " Could not copy the file '" << file.path() << "' to "
+                  << destDir.toString() << ". Error details: " << rexc.what()
+                  << '\n';
+  }
+
+  g_log.information() << "Copied file '" << source.toString()
+                      << "'to general/all directory: " << destDir.toString()
+                      << '\n';
+}
+
+/**
+ * Copy files to the user/RB number directories.
+ *
+ * @param source path to the file to copy
+ *
+ * @param pathComp path component to use for the copy file in the
+ * general directories, for example "Calibration" or "Focus"
+ */
+void EnggDiffractionPresenter::copyToUser(const Poco::Path &source,
+                                          const std::string &pathComp) {
+  Poco::File file(source);
+  if (!file.exists() || !file.canRead()) {
+    g_log.warning() << "Cannot copy the file " << source.toString()
+                    << " to the user directories because it cannot be read.\n";
+    return;
+  }
+
+  auto destDir = outFilesUserDir(pathComp);
+  try {
+    Poco::File destDirFile(destDir);
+    if (!destDirFile.exists()) {
+      destDirFile.createDirectories();
+    }
+  } catch (std::runtime_error &rexc) {
+    g_log.error() << "Could not create output directory for the user "
+                     "files. Cannot copy the user files there:  "
+                  << destDir.toString() << ". Error details: " << rexc.what()
+                  << '\n';
+
+    return;
+  }
+
+  try {
+    file.copyTo(destDir.toString());
+  } catch (std::runtime_error &rexc) {
+    g_log.error() << " Could not copy the file '" << file.path() << "' to "
+                  << destDir.toString() << ". Error details: " << rexc.what()
+                  << '\n';
+  }
+
+  g_log.information() << "Copied file '" << source.toString()
+                      << "'to user directory: " << destDir.toString() << '\n';
+}
+
+/**
+ * Copies a file from a third location to the standard user/RB number
+ * and the general/all directories. This just uses copyToUser() and
+ * copyToGeneral().
+ *
+ * @param fullFilename full path to the origin file
+ */
+void EnggDiffractionPresenter::copyFocusedToUserAndAll(
+    const std::string &fullFilename) {
+  // The files are saved by SaveNexus in the Settings/Focusing output folder.
+  // Then they need to go to the user and 'all' directories.
+  // The "Settings/Focusing output folder" may go away in the future
+  Poco::Path nxsPath(fullFilename);
+  const std::string focusingComp = "Focus";
+  auto saveDir = outFilesUserDir(focusingComp);
+  Poco::Path outFullPath(saveDir);
+  outFullPath.append(nxsPath.getFileName());
+  copyToUser(nxsPath, focusingComp);
+  copyToGeneral(nxsPath, focusingComp);
+}
+
+/**
+ * To write the calibration/instrument parameter for GSAS.
+ *
+ * @param outFilename name of the output .par/.prm/.iparm file for GSAS
+ * @param difa list of GSAS DIFA values to include in the file
+ * @param difc list of GSAS DIFC values to include in the file
+ * @param tzero list of GSAS TZERO values to include in the file
+ * @param bankNames list of bank names corresponding the the difc/tzero
+ *
+ * @param ceriaNo ceria/calibration run number, to be replaced in the
+ * template file
+ *
+ * @param vanNo vanadium run number, to be replaced in the template file
+ *
+ * @param templateFile a template file where to replace the difc/zero
+ * values. An empty default implies using an "all-banks" template.
+ */
+void EnggDiffractionPresenter::writeOutCalibFile(
+    const std::string &outFilename, const std::vector<double> &difa,
+    const std::vector<double> &difc, const std::vector<double> &tzero,
+    const std::vector<std::string> &bankNames, const std::string &ceriaNo,
+    const std::string &vanNo, const std::string &templateFile) {
+  // TODO: this is horrible and should be changed to avoid running
+  // Python code. Update this as soon as we have a more stable way of
+  // generating IPARM/PRM files.
+
+  // Writes a file doing this:
+  // write_ENGINX_GSAS_iparam_file(output_file, difa, difc, zero,
+  // ceria_run=241391, vanadium_run=236516, template_file=None):
+
+  // this replace is to prevent issues with network drives on windows:
+  const std::string safeOutFname =
+      boost::replace_all_copy(outFilename, "\\", "/");
+  std::string pyCode = "import EnggUtils\n";
+  pyCode += "import os\n";
+  // normalize apparently not needed after the replace, but to be double-safe:
+  pyCode += "GSAS_iparm_fname = os.path.normpath('" + safeOutFname + "')\n";
+  pyCode += "bank_names = []\n";
+  pyCode += "ceria_number = \"" + ceriaNo + "\"\n";
+  pyCode += "van_number = \"" + vanNo + "\"\n";
+  pyCode += "Difas = []\n";
+  pyCode += "Difcs = []\n";
+  pyCode += "Zeros = []\n";
+  std::string templateFileVal = "None";
+  if (!templateFile.empty()) {
+    templateFileVal = "'" + templateFile + "'";
+  }
+  pyCode += "template_file = " + templateFileVal + "\n";
+  for (size_t i = 0; i < difc.size(); ++i) {
+    pyCode += "bank_names.append('" + bankNames[i] + "')\n";
+    pyCode +=
+        "Difas.append(" + boost::lexical_cast<std::string>(difa[i]) + ")\n";
+    pyCode +=
+        "Difcs.append(" + boost::lexical_cast<std::string>(difc[i]) + ")\n";
+    pyCode +=
+        "Zeros.append(" + boost::lexical_cast<std::string>(tzero[i]) + ")\n";
+  }
+  pyCode +=
+      "EnggUtils.write_ENGINX_GSAS_iparam_file(output_file=GSAS_iparm_fname, "
+      "bank_names=bank_names, difa=Difas, difc=Difcs, tzero=Zeros, "
+      "ceria_run=ceria_number, "
+      "vanadium_run=van_number, template_file=template_file) \n";
+
+  const auto status = m_view->enggRunPythonCode(pyCode);
+  g_log.information() << "Saved output calibration file via Python. Status: "
+                      << status << '\n';
+}
+
+/**
+ * Note down a directory that needs to be added to the data search
+ * path when looking for run files. This simply uses a vector and adds
+ * all the paths, as the ConfigService will take care of duplicates,
+ * invalid directories, etc.
+ *
+ * @param filename (full) path to a file
+ */
+void EnggDiffractionPresenter::recordPathBrowsedTo(
+    const std::string &filename) {
+
+  Poco::File file(filename);
+  if (!file.exists() || !file.isFile())
+    return;
+
+  Poco::Path path(filename);
+  Poco::File directory(path.parent());
+  if (!directory.exists() || !directory.isDirectory())
+    return;
+
+  m_browsedToPaths.emplace_back(directory.path());
+}
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffractionPresenter.h b/qt/scientific_interfaces/EnggDiffraction/EnggDiffractionPresenter.h
new file mode 100644
index 00000000000..ab7f699f238
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffractionPresenter.h
@@ -0,0 +1,354 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "DllConfig.h"
+#include "IEnggDiffractionCalibration.h"
+#include "IEnggDiffractionParam.h"
+#include "IEnggDiffractionPresenter.h"
+#include "IEnggDiffractionView.h"
+#include "IEnggVanadiumCorrectionsModel.h"
+#include "MantidAPI/ITableWorkspace_fwd.h"
+#include "MantidAPI/MatrixWorkspace_fwd.h"
+#include "MantidAPI/Workspace_fwd.h"
+
+#include <boost/scoped_ptr.hpp>
+
+#include <QObject>
+
+namespace Poco {
+class Path;
+}
+
+class QThread;
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+/**
+Presenter for the Enggineering Diffraction GUI (presenter as in the
+MVP Model-View-Presenter pattern). In principle, in a strict MVP
+setup, signals from the model should always be handled through this
+presenter and never go directly to the view, and viceversa.
+*/
+// needs to be dll-exported for the tests
+class MANTIDQT_ENGGDIFFRACTION_DLL EnggDiffractionPresenter
+    : public QObject,
+      public IEnggDiffractionPresenter,
+      public IEnggDiffractionCalibration,
+      public IEnggDiffractionParam {
+  // Q_OBJECT for 'connect' with thread/worker
+  Q_OBJECT
+
+public:
+  EnggDiffractionPresenter(IEnggDiffractionView *view);
+  ~EnggDiffractionPresenter() override;
+
+  void notify(IEnggDiffractionPresenter::Notification notif) override;
+
+  /// the calibration hard work that a worker / thread will run
+  void doNewCalibration(const std::string &outFilename,
+                        const std::string &vanNo, const std::string &ceriaNo,
+                        const std::string &specNos);
+
+  /// the focusing hard work that a worker / thread will run
+  void doFocusRun(const std::string &runNo, const std::vector<bool> &banks,
+                  const std::string &specNos, const std::string &dgFile);
+
+  /// checks if its a valid run number returns string
+  std::string isValidRunNumber(const std::vector<std::string> &dir);
+
+  /// checks if its a valid run number inside vector and returns a vector;
+  /// used for mutli-run focusing, and other multi-run file selections
+  std::vector<std::string>
+  isValidMultiRunNumber(const std::vector<std::string> &dir);
+
+  /// pre-processing re-binning with Rebin, for a worker/thread
+  void doRebinningTime(const std::string &runNo, double bin,
+                       const std::string &outWSName);
+
+  /// pre-processing re-binning with RebinByPulseTimes, for a worker/thread
+  void doRebinningPulses(const std::string &runNo, size_t nperiods, double bin,
+                         const std::string &outWSName);
+
+protected:
+  void initialize();
+
+  /// clean shut down of model, view, etc.
+  void cleanup();
+
+  void processStart();
+  void processLoadExistingCalib();
+  void processCalcCalib();
+  void ProcessCropCalib();
+  void processFocusBasic();
+  void processFocusCropped();
+  void processFocusTexture();
+  void processResetFocus();
+  void processRebinTime();
+  void processRebinMultiperiod();
+  void processLogMsg();
+  void processInstChange();
+  void processRBNumberChange();
+  void processShutDown();
+  void processStopFocus();
+
+  std::vector<std::string> outputFocusFilenames(const std::string &runNo,
+                                                const std::vector<bool> &banks);
+
+  std::string outputFocusCroppedFilename(const std::string &runNo);
+
+protected slots:
+  void calibrationFinished();
+  void focusingFinished();
+  void rebinningFinished();
+
+private:
+  bool validateRBNumber(const std::string &rbn) const;
+
+  /// @name Calibration related private methods
+  //@{
+  void inputChecksBeforeCalibrate(const std::string &newVanNo,
+                                  const std::string &newCeriaNo);
+
+  std::string outputCalibFilename(const std::string &vanNo,
+                                  const std::string &ceriaNo,
+                                  const std::string &bankName = "");
+
+  void updateNewCalib(const std::string &fname);
+
+  void parseCalibrateFilename(const std::string &path, std::string &instName,
+                              std::string &vanNo, std::string &ceriaNo);
+
+  void grabCalibParms(const std::string &fname, std::string &vanNo,
+                      std::string &ceriaNo);
+
+  void updateCalibParmsTable();
+
+  // this may need to be mocked up in tests
+  virtual void startAsyncCalibWorker(const std::string &outFilename,
+                                     const std::string &vanNo,
+                                     const std::string &ceriaNo,
+                                     const std::string &specNos);
+
+  void doCalib(const EnggDiffCalibSettings &cs, const std::string &vanNo,
+               const std::string &ceriaNo, const std::string &outFilename,
+               const std::string &specNos);
+
+  void appendCalibInstPrefix(const std::string &vanNo,
+                             std::string &outVanName) const;
+
+  void appendCalibInstPrefix(const std::string &vanNo, const std::string &cerNo,
+                             std::string &outVanName,
+                             std::string &outCerName) const;
+
+  std::string
+  buildCalibrateSuggestedFilename(const std::string &vanNo,
+                                  const std::string &ceriaNo,
+                                  const std::string &bankName = "") const;
+
+  std::vector<GSASCalibrationParms> currentCalibration() const override;
+  //@}
+
+  /// @name Focusing related private methods
+  //@{
+  /// this may also need to be mocked up in tests
+  void startFocusing(const std::vector<std::string> &multi_runNo,
+                     const std::vector<bool> &banks,
+                     const std::string &specNos = "",
+                     const std::string &dgFile = "");
+
+  virtual void
+  startAsyncFocusWorker(const std::vector<std::string> &multi_RunNo,
+                        const std::vector<bool> &banks,
+                        const std::string &specNos, const std::string &dgFile);
+
+  void inputChecksBeforeFocusBasic(const std::vector<std::string> &multi_RunNo,
+                                   const std::vector<bool> &banks);
+  void
+  inputChecksBeforeFocusCropped(const std::vector<std::string> &multi_RunNo,
+                                const std::vector<bool> &banks,
+                                const std::string &specNos);
+  void
+  inputChecksBeforeFocusTexture(const std::vector<std::string> &multi_RunNo,
+                                const std::string &dgfile);
+  void inputChecksBeforeFocus();
+  void inputChecksBanks(const std::vector<bool> &banks);
+
+  std::vector<std::string> sumOfFilesLoadVec();
+
+  std::vector<std::string>
+  outputFocusTextureFilenames(const std::string &runNo,
+                              const std::vector<size_t> &bankIDs);
+
+  void loadDetectorGroupingCSV(const std::string &dgFile,
+                               std::vector<size_t> &bankIDs,
+                               std::vector<std::string> &specs);
+
+  void doFocusing(const EnggDiffCalibSettings &cs, const std::string &runLabel,
+                  const size_t bank, const std::string &specNos,
+                  const std::string &dgFile);
+
+  /// @name Methods related to pre-processing / re-binning
+  //@{
+  void inputChecksBeforeRebin(const std::string &runNo);
+
+  void inputChecksBeforeRebinTime(const std::string &runNo, double bin);
+
+  void inputChecksBeforeRebinPulses(const std::string &runNo, size_t nperiods,
+                                    double timeStep);
+
+  Mantid::API::Workspace_sptr loadToPreproc(const std::string &runNo);
+
+  virtual void startAsyncRebinningTimeWorker(const std::string &runNo,
+                                             double bin,
+                                             const std::string &outWSName);
+
+  virtual void startAsyncRebinningPulsesWorker(const std::string &runNo,
+                                               size_t nperiods, double timeStep,
+                                               const std::string &outWSName);
+  //@}
+
+  // plots workspace according to the user selection
+  void plotFocusedWorkspace(const std::string &outWSName);
+
+  void plotCalibWorkspace(const std::vector<double> &difa,
+                          const std::vector<double> &difc,
+                          const std::vector<double> &tzero,
+                          const std::string &specNos);
+
+  // algorithms to save the generated workspace
+  void saveGSS(const RunLabel &runLabel, const std::string &inputWorkspace);
+  void saveFocusedXYE(const RunLabel &runLabel,
+                      const std::string &inputWorkspace);
+  void saveNexus(const RunLabel &runLabel, const std::string &inputWorkspace);
+  void saveOpenGenie(const RunLabel &runLabel,
+                     const std::string &inputWorkspace);
+  void exportSampleLogsToHDF5(const std::string &inputWorkspace,
+                              const std::string &filename) const;
+
+  // generates the required file name of the output files
+  std::string outFileNameFactory(const std::string &inputWorkspace,
+                                 const RunLabel &runLabel,
+                                 const std::string &format);
+
+  // returns a directory as a path, creating it if not found, and checking
+  // errors
+  Poco::Path outFilesUserDir(const std::string &addToDir) const override;
+  std::string userHDFRunFilename(const std::string &runNumber) const override;
+  std::string userHDFMultiRunFilename(
+      const std::vector<RunLabel> &runLabels) const override;
+  Poco::Path outFilesGeneralDir(const std::string &addComponent);
+  Poco::Path outFilesRootDir() const;
+
+  std::string appendToPath(const std::string &path,
+                           const std::string &toAppend) const;
+
+  /// convenience methods to copy files to different destinations
+  void copyToGeneral(const Poco::Path &source, const std::string &pathComp);
+  void copyToUser(const Poco::Path &source, const std::string &pathComp);
+  void copyFocusedToUserAndAll(const std::string &fullFilename);
+
+  // generates appropriate names for table workspaces
+  std::string outFitParamsTblNameGenerator(const std::string &specNos,
+                                           size_t bank_i) const;
+
+  // generates the pycode string which can be passed to view
+  std::string vanadiumCurvesPlotFactory();
+
+  std::string TOFFitWorkspaceFactory(
+      const std::vector<double> &difa, const std::vector<double> &difc,
+      const std::vector<double> &tzero, const std::string &specNo,
+      const std::string &customisedBankName) const;
+
+  std::string plotTOFWorkspace(const std::string &customisedBankName) const;
+
+  void writeOutCalibFile(const std::string &outFilename,
+                         const std::vector<double> &difa,
+                         const std::vector<double> &difc,
+                         const std::vector<double> &tzero,
+                         const std::vector<std::string> &bankNames,
+                         const std::string &ceriaNo, const std::string &vanNo,
+                         const std::string &templateFile = "");
+
+  /// keep track of the paths the user "browses to", to add them in
+  /// the file search path
+  void recordPathBrowsedTo(const std::string &filename);
+
+  /// paths the user has "browsed to", to add them to the search path
+  std::vector<std::string> m_browsedToPaths;
+
+  /// string to use for invalid run number error message
+  const static std::string g_runNumberErrorStr;
+
+  // for the GSAS parameters (difc, difa, tzero) of the banks
+  static const std::string g_calibBanksParms;
+
+  /// whether to allow users to give the output calibration filename
+  const static bool g_askUserCalibFilename;
+
+  /// whether to break the thread
+  static bool g_abortThread;
+
+  /// whether to run Sum Of Files & which focus run number to use
+  static std::string g_sumOfFilesFocus;
+
+  /// saves the last valid run number
+  static std::string g_lastValidRun;
+
+  /// bank name used or SpecNos for cropped calibration
+  static std::string g_calibCropIdentifier;
+
+  QThread *m_workerThread;
+
+  /// true if the last thing ran was cancelled
+  bool m_cancelled;
+
+  /// true if the last calibration completed successfully
+  bool m_calibFinishedOK;
+
+  /// error that caused the calibration to fail
+  std::string m_calibError;
+  /// path where the calibration has been produced (par/prm file)
+  std::string m_calibFullPath;
+
+  /// The current calibration parameters (used for units conversion). It should
+  /// be updated when a new calibration is done or re-loading an existing one
+  std::vector<GSASCalibrationParms> m_currentCalibParms;
+
+  /// true if the last focusing completed successfully
+  bool m_focusFinishedOK;
+  /// error that caused the focus to fail
+  std::string m_focusError;
+  /// true if the last pre-processing/re-binning completed successfully
+  bool m_rebinningFinishedOK;
+
+  /// Counter for the cropped output files
+  static int g_croppedCounter;
+
+  /// counter for the plotting workspace
+  static int g_plottingCounter;
+
+  /// Associated view for this presenter (MVP pattern)
+  IEnggDiffractionView *const m_view;
+
+  /// Tracks if the view has started to shut down following a close signal
+  bool m_viewHasClosed;
+
+  /// Associated model for this presenter (MVP pattern)
+  // const boost::scoped_ptr<EnggDiffractionModel> m_model;
+
+  /// the current selected instrument
+  std::string m_currentInst = "";
+
+  /// Model for calculating the vanadium corrections workspaces for focus and
+  /// calib
+  boost::shared_ptr<IEnggVanadiumCorrectionsModel> m_vanadiumCorrectionsModel;
+};
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
\ No newline at end of file
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffractionViewQtGUI.cpp b/qt/scientific_interfaces/EnggDiffraction/EnggDiffractionViewQtGUI.cpp
new file mode 100644
index 00000000000..d8abce02b5e
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffractionViewQtGUI.cpp
@@ -0,0 +1,1105 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "EnggDiffractionViewQtGUI.h"
+#include "EnggDiffractionPresenter.h"
+#include "MantidKernel/ConfigService.h"
+#include "MantidQtWidgets/Common/AlgorithmInputHistory.h"
+#include "MantidQtWidgets/Common/AlgorithmRunner.h"
+#include "MantidQtWidgets/Common/HelpWindow.h"
+#include "MantidQtWidgets/Common/MWRunFiles.h"
+
+#include <Poco/DirectoryIterator.h>
+#include <Poco/Path.h>
+
+#include <QCheckBox>
+#include <QCloseEvent>
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QSettings>
+
+using namespace Mantid::API;
+using namespace MantidQt::CustomInterfaces;
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+// Add this class to the list of specialised dialogs in this namespace
+// Hidden for release of 5.0 to be removed as a maintainance issue.
+// DECLARE_SUBWINDOW(EnggDiffractionViewQtGUI)
+
+const double EnggDiffractionViewQtGUI::g_defaultRebinWidth = -0.0005;
+
+int EnggDiffractionViewQtGUI::g_currentType = 0;
+int EnggDiffractionViewQtGUI::g_currentRunMode = 0;
+int EnggDiffractionViewQtGUI::g_currentCropCalibBankName = 0;
+
+const std::string EnggDiffractionViewQtGUI::g_iparmExtStr =
+    "GSAS instrument parameters, IPARM file: PRM, PAR, IPAR, IPARAM "
+    "(*.prm *.par *.ipar *.iparam);;"
+    "Other extensions/all files (*)";
+
+const std::string EnggDiffractionViewQtGUI::g_pixelCalibExt =
+    "Comma separated values text file with calibration table, CSV"
+    "(*.csv);;"
+    "Nexus file with calibration table: NXS, NEXUS"
+    "(*.nxs *.nexus);;"
+    "Supported formats: CSV, NXS "
+    "(*.csv *.nxs *.nexus);;"
+    "Other extensions/all files (*)";
+
+const std::string EnggDiffractionViewQtGUI::g_DetGrpExtStr =
+    "Detector Grouping File: CSV "
+    "(*.csv *.txt);;"
+    "Other extensions/all files (*)";
+
+const std::string EnggDiffractionViewQtGUI::g_settingsGroup =
+    "CustomInterfaces/EnggDiffractionView";
+
+/**
+ * Default constructor.
+ *
+ * @param parent Parent window (most likely the Mantid main app window).
+ */
+EnggDiffractionViewQtGUI::EnggDiffractionViewQtGUI(QWidget *parent)
+    : UserSubWindow(parent), IEnggDiffractionView(), m_fittingWidget(nullptr),
+      m_currentInst("ENGINX"), m_splashMsg(nullptr), m_presenter(nullptr) {}
+
+void EnggDiffractionViewQtGUI::initLayout() {
+  // setup container ui
+  m_ui.setupUi(this);
+
+  // presenter that knows how to handle a IEnggDiffractionView should
+  // take care of all the logic. Note that the view needs to know the
+  // concrete presenter
+  auto fullPres = boost::make_shared<EnggDiffractionPresenter>(this);
+  m_presenter = fullPres;
+
+  // add tab contents and set up their ui's
+  QWidget *wCalib = new QWidget(m_ui.tabMain);
+  m_uiTabCalib.setupUi(wCalib);
+  m_ui.tabMain->addTab(wCalib, QString("Calibration"));
+
+  QWidget *wFocus = new QWidget(m_ui.tabMain);
+  m_uiTabFocus.setupUi(wFocus);
+  m_ui.tabMain->addTab(wFocus, QString("Focus"));
+
+  QWidget *wPreproc = new QWidget(m_ui.tabMain);
+  m_uiTabPreproc.setupUi(wPreproc);
+  m_ui.tabMain->addTab(wPreproc, QString("Pre-processing"));
+
+  // This is created from a QWidget* -> use null-deleter to prevent double-free
+  // with Qt
+  boost::shared_ptr<EnggDiffractionViewQtGUI> sharedView(
+      this, [](EnggDiffractionViewQtGUI * /*unused*/) {});
+  m_fittingWidget =
+      new EnggDiffFittingViewQtWidget(m_ui.tabMain, sharedView, sharedView,
+                                      fullPres, fullPres, sharedView, fullPres);
+  m_ui.tabMain->addTab(m_fittingWidget, QString("Fitting"));
+
+  m_gsasWidget =
+      new EnggDiffGSASFittingViewQtWidget(sharedView, sharedView, fullPres);
+  m_ui.tabMain->addTab(m_gsasWidget, QString("GSAS-II Refinement"));
+
+  QWidget *wSettings = new QWidget(m_ui.tabMain);
+  m_uiTabSettings.setupUi(wSettings);
+  m_ui.tabMain->addTab(wSettings, QString("Settings"));
+
+  QComboBox *inst = m_ui.comboBox_instrument;
+  m_currentInst = inst->currentText().toStdString();
+
+  setPrefix(m_currentInst);
+  // An initial check on the RB number will enable the tabs after all
+  // the widgets and connections are set up
+  enableTabs(false);
+
+  readSettings();
+
+  // basic UI setup, connect signals, etc.
+  doSetupGeneralWidgets();
+  doSetupTabCalib();
+  doSetupTabFocus();
+  doSetupTabPreproc();
+  doSetupTabSettings();
+
+  m_presenter->notify(IEnggDiffractionPresenter::Start);
+  // We need to delay the RB-number check for the pop-up (splash message)
+  // as it will be shown very early (before the interface
+  // window itself is shown) and that will cause a crash in Qt code on
+  // some platforms (windows 10, and 7 sometimes).
+  // so perform the check in the showEvent method to check on start up
+}
+
+void EnggDiffractionViewQtGUI::doSetupTabCalib() {
+  // Some recent available runs as defaults. This (as well as the
+  // empty defaults just above) should probably be made persistent -
+  // and encapsulated into a CalibrationParameters or similar
+  // class/structure
+  const std::string vanadiumRun = "236516";
+  const std::string ceriaRun = "241391";
+  if (m_uiTabCalib.MWRunFiles_new_vanadium_num->getUserInput()
+          .toString()
+          .isEmpty()) {
+    m_uiTabCalib.MWRunFiles_new_vanadium_num->setFileTextWithoutSearch(
+        QString::fromStdString(vanadiumRun));
+  }
+  if (m_uiTabCalib.MWRunFiles_new_ceria_num->getUserInput()
+          .toString()
+          .isEmpty()) {
+    m_uiTabCalib.MWRunFiles_new_ceria_num->setFileTextWithoutSearch(
+        QString::fromStdString(ceriaRun));
+  }
+
+  // push button signals/slots
+  connect(m_uiTabCalib.pushButton_load_calib, SIGNAL(released()), this,
+          SLOT(loadCalibrationClicked()));
+
+  connect(m_uiTabCalib.pushButton_new_calib, SIGNAL(released()), this,
+          SLOT(calibrateClicked()));
+
+  connect(m_uiTabCalib.pushButton_new_cropped_calib, SIGNAL(released()), this,
+          SLOT(CroppedCalibrateClicked()));
+
+  connect(m_uiTabCalib.comboBox_calib_cropped_bank_name,
+          SIGNAL(currentIndexChanged(int)), this,
+          SLOT(calibspecNoChanged(int)));
+
+  connect(m_uiTabCalib.comboBox_calib_cropped_bank_name,
+          SIGNAL(currentIndexChanged(int)), this, SLOT(enableSpecNos()));
+
+  enableCalibrateFocusFitUserActions(true);
+}
+
+void EnggDiffractionViewQtGUI::doSetupTabFocus() {
+
+  connect(m_uiTabFocus.pushButton_focus, SIGNAL(released()), this,
+          SLOT(focusClicked()));
+
+  connect(m_uiTabFocus.pushButton_focus_cropped, SIGNAL(released()), this,
+          SLOT(focusCroppedClicked()));
+
+  connect(m_uiTabFocus.pushButton_texture_browse_grouping_file,
+          SIGNAL(released()), this, SLOT(browseTextureDetGroupingFile()));
+
+  connect(m_uiTabFocus.pushButton_focus_texture, SIGNAL(released()), this,
+          SLOT(focusTextureClicked()));
+
+  connect(m_uiTabFocus.pushButton_reset, SIGNAL(released()), this,
+          SLOT(focusResetClicked()));
+
+  connect(m_uiTabFocus.pushButton_stop_focus, SIGNAL(released()), this,
+          SLOT(focusStopClicked()));
+
+  connect(m_uiTabFocus.comboBox_PlotData, SIGNAL(currentIndexChanged(int)),
+          this, SLOT(plotRepChanged(int)));
+
+  connect(m_uiTabFocus.comboBox_Multi_Runs, SIGNAL(currentIndexChanged(int)),
+          this, SLOT(multiRunModeChanged(int)));
+
+  connect(m_uiTabFocus.checkBox_plot_focused_ws, SIGNAL(clicked()), this,
+          SLOT(plotFocusStatus()));
+}
+
+void EnggDiffractionViewQtGUI::doSetupTabPreproc() {
+  connect(m_uiTabPreproc.pushButton_rebin_time, SIGNAL(released()), this,
+          SLOT(rebinTimeClicked()));
+
+  connect(m_uiTabPreproc.pushButton_rebin_multiperiod, SIGNAL(released()), this,
+          SLOT(rebinMultiperiodClicked()));
+}
+
+void EnggDiffractionViewQtGUI::doSetupTabSettings() {
+  // line edits that display paths and the like
+  m_uiTabSettings.lineEdit_input_dir_calib->setText(
+      QString::fromStdString(m_calibSettings.m_inputDirCalib));
+  m_uiTabSettings.lineEdit_input_dir_raw->setText(
+      QString::fromStdString(m_calibSettings.m_inputDirRaw));
+  m_uiTabSettings.lineEdit_pixel_calib_filename->setText(
+      QString::fromStdString(m_calibSettings.m_pixelCalibFilename));
+  m_uiTabSettings.lineEdit_template_gsas_prm->setText(
+      QString::fromStdString(m_calibSettings.m_templateGSAS_PRM));
+  m_calibSettings.m_forceRecalcOverwrite = false;
+  m_uiTabSettings.checkBox_force_recalculate_overwrite->setChecked(
+      m_calibSettings.m_forceRecalcOverwrite);
+
+  // push button signals/slots
+  connect(m_uiTabSettings.pushButton_browse_input_dir_calib, SIGNAL(released()),
+          this, SLOT(browseInputDirCalib()));
+
+  connect(m_uiTabSettings.pushButton_browse_input_dir_raw, SIGNAL(released()),
+          this, SLOT(browseInputDirRaw()));
+
+  connect(m_uiTabSettings.pushButton_browse_pixel_calib_filename,
+          SIGNAL(released()), this, SLOT(browsePixelCalibFilename()));
+
+  connect(m_uiTabSettings.pushButton_browse_template_gsas_prm,
+          SIGNAL(released()), this, SLOT(browseTemplateGSAS_PRM()));
+
+  connect(m_uiTabSettings.checkBox_force_recalculate_overwrite,
+          SIGNAL(stateChanged(int)), this,
+          SLOT(forceRecalculateStateChanged()));
+}
+
+void EnggDiffractionViewQtGUI::doSetupGeneralWidgets() {
+  doSetupSplashMsg();
+
+  // don't show the re-size corner
+  m_ui.statusbar->setSizeGripEnabled(false);
+
+  // change instrument
+  connect(m_ui.comboBox_instrument, SIGNAL(currentIndexChanged(int)), this,
+          SLOT(instrumentChanged(int)));
+  connect(m_ui.pushButton_help, SIGNAL(released()), this, SLOT(openHelpWin()));
+  // note connection to the parent window, otherwise an empty frame window
+  // may remain open and visible after this close
+  if (this->parent()) {
+    connect(m_ui.pushButton_close, SIGNAL(released()), this->parent(),
+            SLOT(close()));
+  }
+
+  connect(m_ui.lineEdit_RBNumber, SIGNAL(editingFinished()), this,
+          SLOT(RBNumberChanged()));
+}
+
+void EnggDiffractionViewQtGUI::doSetupSplashMsg() {
+  if (m_splashMsg)
+    delete m_splashMsg;
+
+  m_splashMsg = new QMessageBox(this);
+  m_splashMsg->setIcon(QMessageBox::Information);
+  m_splashMsg->setStandardButtons(QMessageBox::NoButton);
+  m_splashMsg->setWindowTitle("Setting up");
+  m_splashMsg->setText("Setting up the interface!");
+  m_splashMsg->setWindowFlags(Qt::SplashScreen | Qt::FramelessWindowHint |
+                              Qt::X11BypassWindowManagerHint);
+  m_splashMsg->setWindowModality(Qt::NonModal);
+  // we don't want to show now: m_splashMsg->show();
+}
+
+void EnggDiffractionViewQtGUI::readSettings() {
+  QSettings qs;
+  qs.beginGroup(QString::fromStdString(g_settingsGroup));
+
+  m_ui.lineEdit_RBNumber->setText(
+      qs.value("user-params-RBNumber", "").toString());
+
+  m_uiTabCalib.lineEdit_current_vanadium_num->setText(
+      qs.value("user-params-current-vanadium-num", "").toString());
+  m_uiTabCalib.lineEdit_current_ceria_num->setText(
+      qs.value("user-params-current-ceria-num", "").toString());
+  QString calibFname = qs.value("current-calib-filename", "").toString();
+  m_uiTabCalib.lineEdit_current_calib_filename->setText(calibFname);
+
+  m_uiTabCalib.MWRunFiles_new_vanadium_num->setUserInput(
+      qs.value("user-params-new-vanadium-num", "").toString());
+  m_uiTabCalib.MWRunFiles_new_ceria_num->setUserInput(
+      qs.value("user-params-new-ceria-num", "").toString());
+
+  m_uiTabCalib.groupBox_calib_cropped->setChecked(
+      qs.value("user-params-calib-cropped-group-checkbox", false).toBool());
+
+  m_uiTabCalib.comboBox_calib_cropped_bank_name->setCurrentIndex(0);
+
+  m_uiTabCalib.lineEdit_cropped_spec_nos->setText(
+      qs.value("user-params-calib-cropped-spectrum-nos", "").toString());
+
+  m_uiTabCalib.lineEdit_cropped_customise_bank_name->setText(
+      qs.value("user-params-calib-cropped-customise-name", "cropped")
+          .toString());
+
+  m_uiTabCalib.checkBox_PlotData_Calib->setChecked(
+      qs.value("user-param-calib-plot-data", true).toBool());
+
+  // user params - focusing
+  m_uiTabFocus.MWRunFiles_run_num->setUserInput(
+      qs.value("user-params-focus-runno", "").toString());
+
+  qs.beginReadArray("user-params-focus-bank_i");
+  qs.setArrayIndex(0);
+  m_uiTabFocus.checkBox_focus_bank1->setChecked(
+      qs.value("value", true).toBool());
+  qs.setArrayIndex(1);
+  m_uiTabFocus.checkBox_focus_bank2->setChecked(
+      qs.value("value", true).toBool());
+  qs.endArray();
+
+  m_uiTabFocus.MWRunFiles_cropped_run_num->setUserInput(
+      qs.value("user-params-focus-cropped-runno", "").toString());
+
+  m_uiTabFocus.lineEdit_cropped_spec_nos->setText(
+      qs.value("user-params-focus-cropped-spectrum-nos", "").toString());
+
+  m_uiTabFocus.MWRunFiles_texture_run_num->setUserInput(
+      qs.value("user-params-focus-texture-runno", "").toString());
+
+  m_uiTabFocus.lineEdit_texture_grouping_file->setText(
+      qs.value("user-params-focus-texture-detector-grouping-file", "")
+          .toString());
+
+  m_uiTabFocus.groupBox_cropped->setChecked(
+      qs.value("user-params-focus-cropped-group-checkbox", false).toBool());
+
+  m_uiTabFocus.groupBox_texture->setChecked(
+      qs.value("user-params-focus-texture-group-checkbox", false).toBool());
+
+  m_uiTabFocus.checkBox_plot_focused_ws->setChecked(
+      qs.value("user-params-focus-plot-focused-ws", true).toBool());
+
+  m_uiTabFocus.checkBox_save_output_files->setChecked(
+      qs.value("user-params-focus-save-output-files", true).toBool());
+
+  m_uiTabFocus.comboBox_PlotData->setCurrentIndex(
+      qs.value("user-params-focus-plot-type", 0).toInt());
+
+  m_uiTabFocus.comboBox_Multi_Runs->setCurrentIndex(
+      qs.value("user-params-multiple-runs-focus-mode", 0).toInt());
+
+  // pre-processing (re-binning)
+  m_uiTabPreproc.MWRunFiles_preproc_run_num->setUserInput(
+      qs.value("user-params-preproc-runno", "").toString());
+
+  m_uiTabPreproc.doubleSpinBox_time_bin->setValue(
+      qs.value("user-params-time-bin", 0.1).toDouble());
+
+  m_uiTabPreproc.spinBox_nperiods->setValue(
+      qs.value("user-params-nperiods", 2).toInt());
+
+  m_uiTabPreproc.doubleSpinBox_step_time->setValue(
+      qs.value("user-params-step-time", 1).toDouble());
+
+  // settings
+  QString lastPath =
+      MantidQt::API::AlgorithmInputHistory::Instance().getPreviousDirectory();
+  // TODO: as this is growing, it should become << >> operators on
+  // EnggDiffCalibSettings
+  m_calibSettings.m_inputDirCalib =
+      qs.value("input-dir-calib-files", lastPath).toString().toStdString();
+
+  m_calibSettings.m_inputDirRaw =
+      qs.value("input-dir-raw-files", lastPath).toString().toStdString();
+
+  const std::string fullCalib = guessDefaultFullCalibrationPath();
+  m_calibSettings.m_pixelCalibFilename =
+      qs.value("pixel-calib-filename", QString::fromStdString(fullCalib))
+          .toString()
+          .toStdString();
+
+  // 'advanced' block
+  m_calibSettings.m_forceRecalcOverwrite =
+      qs.value("force-recalc-overwrite", false).toBool();
+
+  const std::string templ = guessGSASTemplatePath();
+  m_calibSettings.m_templateGSAS_PRM =
+      qs.value("template-gsas-prm", QString::fromStdString(templ))
+          .toString()
+          .toStdString();
+
+  m_calibSettings.m_rebinCalibrate =
+      qs.value("rebin-calib", g_defaultRebinWidth).toFloat();
+
+  m_ui.tabMain->setCurrentIndex(qs.value("selected-tab-index").toInt());
+
+  restoreGeometry(qs.value("interface-win-geometry").toByteArray());
+  qs.endGroup();
+}
+
+void EnggDiffractionViewQtGUI::saveSettings() const {
+  QSettings qs;
+  qs.beginGroup(QString::fromStdString(g_settingsGroup));
+
+  qs.setValue("user-params-RBNumber", m_ui.lineEdit_RBNumber->text());
+
+  qs.setValue("user-params-current-vanadium-num",
+              m_uiTabCalib.lineEdit_current_vanadium_num->text());
+  qs.setValue("user-params-current-ceria-num",
+              m_uiTabCalib.lineEdit_current_ceria_num->text());
+  qs.setValue("current-calib-filename",
+              m_uiTabCalib.lineEdit_current_calib_filename->text());
+
+  qs.setValue("user-params-new-vanadium-num", "");
+  qs.setValue("user-params-new-ceria-num", "");
+
+  qs.setValue("user-params-calib-cropped-group-checkbox",
+              m_uiTabCalib.groupBox_calib_cropped->isChecked());
+
+  qs.setValue("user-params-calib-cropped-spectrum-nos",
+              m_uiTabCalib.lineEdit_cropped_spec_nos->text());
+
+  qs.setValue("user-params-calib-cropped-customise-name",
+              m_uiTabCalib.lineEdit_cropped_customise_bank_name->text());
+
+  qs.setValue("user-param-calib-plot-data",
+              m_uiTabCalib.checkBox_PlotData_Calib->isChecked());
+
+  // user params - focusing
+  qs.setValue("user-params-focus-runno",
+              m_uiTabFocus.MWRunFiles_run_num->getText());
+
+  qs.beginWriteArray("user-params-focus-bank_i");
+  qs.setArrayIndex(0);
+  qs.setValue("value", m_uiTabFocus.checkBox_focus_bank1->isChecked());
+  qs.setArrayIndex(1);
+  qs.setValue("value", m_uiTabFocus.checkBox_focus_bank2->isChecked());
+  qs.endArray();
+
+  qs.setValue("user-params-focus-cropped-runno",
+              m_uiTabFocus.MWRunFiles_cropped_run_num->getText());
+  qs.setValue("user-params-focus-cropped-spectrum-nos",
+              m_uiTabFocus.lineEdit_cropped_spec_nos->text());
+
+  qs.setValue("user-params-focus-texture-runno",
+              m_uiTabFocus.MWRunFiles_texture_run_num->getText());
+  qs.setValue("user-params-focus-texture-detector-grouping-file",
+              m_uiTabFocus.lineEdit_texture_grouping_file->text());
+
+  qs.setValue("user-params-focus-cropped-group-checkbox",
+              m_uiTabFocus.groupBox_cropped->isChecked());
+
+  qs.setValue("user-params-focus-texture-group-checkbox",
+              m_uiTabFocus.groupBox_texture->isChecked());
+
+  qs.setValue("user-params-focus-plot-focused-ws",
+              m_uiTabFocus.checkBox_plot_focused_ws->isChecked());
+
+  qs.setValue("user-params-focus-save-output-files",
+              m_uiTabFocus.checkBox_plot_focused_ws->isChecked());
+
+  qs.setValue("user-params-focus-plot-type",
+              m_uiTabFocus.comboBox_PlotData->currentIndex());
+
+  qs.setValue("user-params-multiple-runs-focus-mode",
+              m_uiTabFocus.comboBox_Multi_Runs->currentIndex());
+
+  // pre-processing (re-binning)
+  qs.setValue("user-params-preproc-runno",
+              m_uiTabPreproc.MWRunFiles_preproc_run_num->getText());
+
+  qs.setValue("user-params-time-bin",
+              m_uiTabPreproc.doubleSpinBox_time_bin->value());
+
+  qs.setValue("user-params-nperiods", m_uiTabPreproc.spinBox_nperiods->value());
+
+  qs.value("user-params-step-time",
+           m_uiTabPreproc.doubleSpinBox_step_time->value());
+
+  // TODO: this should become << >> operators on EnggDiffCalibSettings
+  qs.setValue("input-dir-calib-files",
+              QString::fromStdString(m_calibSettings.m_inputDirCalib));
+  qs.setValue("input-dir-raw-files",
+              QString::fromStdString(m_calibSettings.m_inputDirRaw));
+  qs.setValue("pixel-calib-filename",
+              QString::fromStdString(m_calibSettings.m_pixelCalibFilename));
+  // 'advanced' block
+  qs.setValue("force-recalc-overwrite", m_calibSettings.m_forceRecalcOverwrite);
+  qs.setValue("template-gsas-prm",
+              QString::fromStdString(m_calibSettings.m_templateGSAS_PRM));
+  qs.setValue("rebin-calib", m_calibSettings.m_rebinCalibrate);
+
+  qs.setValue("selected-tab-index", m_ui.tabMain->currentIndex());
+
+  qs.setValue("interface-win-geometry", saveGeometry());
+  qs.endGroup();
+}
+
+std::string EnggDiffractionViewQtGUI::guessGSASTemplatePath() const {
+  // Inside the mantid installation target directory:
+  // scripts/Engineering/template_ENGINX_241391_236516_North_and_South_banks.par
+  Poco::Path templ =
+      Mantid::Kernel::ConfigService::Instance().getInstrumentDirectory();
+  templ = templ.makeParent();
+  templ.append("scripts");
+  templ.append("Engineering");
+  templ.append("template_ENGINX_241391_236516_North_and_South_banks.par");
+  return templ.toString();
+}
+
+std::string EnggDiffractionViewQtGUI::guessDefaultFullCalibrationPath() const {
+  // Inside the mantid installation target directory:
+  // scripts/Engineering/ENGINX_full_pixel_calibration_vana194547_ceria193749.csv
+  Poco::Path templ =
+      Mantid::Kernel::ConfigService::Instance().getInstrumentDirectory();
+  templ = templ.makeParent();
+  templ.append("scripts");
+  templ.append("Engineering");
+  templ.append("calib");
+  templ.append("ENGINX_full_pixel_calibration_vana194547_ceria193749.csv");
+  return templ.toString();
+}
+
+void EnggDiffractionViewQtGUI::splashMessage(bool visible,
+                                             const std::string &shortMsg,
+                                             const std::string &description) {
+  if (!m_splashMsg)
+    return;
+
+  m_splashMsg->setWindowTitle(QString::fromStdString(shortMsg));
+  m_splashMsg->setText(QString::fromStdString(description));
+  // when showing the message, force it to show up centered
+  if (visible) {
+    const auto pos = this->mapToGlobal(rect().center());
+    m_splashMsg->move(pos.x() - m_splashMsg->width() / 2,
+                      pos.y() - m_splashMsg->height() / 2);
+  }
+  m_splashMsg->setVisible(visible);
+}
+
+void EnggDiffractionViewQtGUI::showStatus(const std::string &sts) {
+  m_ui.statusbar->showMessage(QString::fromStdString(sts));
+}
+
+void EnggDiffractionViewQtGUI::userWarning(const std::string &err,
+                                           const std::string &description) {
+  QMessageBox::warning(this, QString::fromStdString(err),
+                       QString::fromStdString(description), QMessageBox::Ok,
+                       QMessageBox::Ok);
+}
+
+void EnggDiffractionViewQtGUI::userError(const std::string &err,
+                                         const std::string &description) {
+  QMessageBox::critical(this, QString::fromStdString(err),
+                        QString::fromStdString(description), QMessageBox::Ok,
+                        QMessageBox::Ok);
+}
+
+std::string EnggDiffractionViewQtGUI::askNewCalibrationFilename(
+    const std::string &suggestedFname) {
+  // append dir (basename) + filename
+  QString prevPath = QString::fromStdString(m_calibSettings.m_inputDirCalib);
+  if (prevPath.isEmpty()) {
+    prevPath =
+        MantidQt::API::AlgorithmInputHistory::Instance().getPreviousDirectory();
+  }
+  QDir path(prevPath);
+  QString suggestion = path.filePath(QString::fromStdString(suggestedFname));
+  QString choice = QFileDialog::getSaveFileName(
+      this, tr("Please select the name of the calibration file"), suggestion,
+      QString::fromStdString(g_iparmExtStr));
+
+  return choice.toStdString();
+}
+
+std::string EnggDiffractionViewQtGUI::getRBNumber() const {
+  return m_ui.lineEdit_RBNumber->text().toStdString();
+}
+
+std::string EnggDiffractionViewQtGUI::currentVanadiumNo() const {
+  return m_uiTabCalib.lineEdit_current_vanadium_num->text().toStdString();
+}
+
+std::string EnggDiffractionViewQtGUI::currentCeriaNo() const {
+  return m_uiTabCalib.lineEdit_current_ceria_num->text().toStdString();
+}
+
+std::vector<std::string> EnggDiffractionViewQtGUI::newVanadiumNo() const {
+  return qListToVector(m_uiTabCalib.MWRunFiles_new_vanadium_num->getFilenames(),
+                       m_uiTabCalib.MWRunFiles_new_vanadium_num->isValid());
+}
+
+std::vector<std::string> EnggDiffractionViewQtGUI::newCeriaNo() const {
+  return qListToVector(m_uiTabCalib.MWRunFiles_new_ceria_num->getFilenames(),
+                       m_uiTabCalib.MWRunFiles_new_ceria_num->isValid());
+}
+
+std::string EnggDiffractionViewQtGUI::currentCalibFile() const {
+  return m_uiTabCalib.lineEdit_current_calib_filename->text().toStdString();
+}
+
+void EnggDiffractionViewQtGUI::newCalibLoaded(const std::string &vanadiumNo,
+                                              const std::string &ceriaNo,
+                                              const std::string &fname) {
+
+  m_uiTabCalib.lineEdit_current_vanadium_num->setText(
+      QString::fromStdString(vanadiumNo));
+  m_uiTabCalib.lineEdit_current_ceria_num->setText(
+      QString::fromStdString(ceriaNo));
+  m_uiTabCalib.lineEdit_current_calib_filename->setText(
+      QString::fromStdString(fname));
+
+  if (!fname.empty()) {
+    MantidQt::API::AlgorithmInputHistory::Instance().setPreviousDirectory(
+        QString::fromStdString(fname));
+  }
+}
+
+void EnggDiffractionViewQtGUI::enableCalibrateFocusFitUserActions(bool enable) {
+  // calibrate
+  m_uiTabCalib.groupBox_make_new_calib->setEnabled(enable);
+  m_uiTabCalib.groupBox_current_calib->setEnabled(enable);
+  m_uiTabCalib.groupBox_calib_cropped->setEnabled(enable);
+  m_uiTabCalib.pushButton_new_cropped_calib->setEnabled(enable);
+  m_ui.pushButton_close->setEnabled(enable);
+  m_uiTabCalib.checkBox_PlotData_Calib->setEnabled(enable);
+
+  // focus
+  m_uiTabFocus.MWRunFiles_run_num->setEnabled(enable);
+  m_uiTabFocus.pushButton_focus->setEnabled(enable);
+
+  m_uiTabFocus.groupBox_cropped->setEnabled(enable);
+  m_uiTabFocus.groupBox_texture->setEnabled(enable);
+
+  // Disable all focus output options except graph plotting
+  m_uiTabFocus.checkBox_plot_focused_ws->setEnabled(enable);
+  m_uiTabFocus.checkBox_save_output_files->setEnabled(enable);
+  m_uiTabFocus.comboBox_Multi_Runs->setEnabled(enable);
+
+  m_uiTabFocus.pushButton_stop_focus->setDisabled(enable);
+  m_uiTabFocus.pushButton_reset->setEnabled(enable);
+
+  // pre-processing
+  m_uiTabPreproc.MWRunFiles_preproc_run_num->setEnabled(enable);
+  m_uiTabPreproc.pushButton_rebin_time->setEnabled(enable);
+  m_uiTabPreproc.pushButton_rebin_multiperiod->setEnabled(enable);
+
+  // fitting
+  m_fittingWidget->enable(enable);
+  m_gsasWidget->setEnabled(enable);
+}
+
+void EnggDiffractionViewQtGUI::enableTabs(bool enable) {
+  for (int ti = 0; ti < m_ui.tabMain->count(); ++ti) {
+    m_ui.tabMain->setTabEnabled(ti, enable);
+  }
+}
+
+std::vector<std::string> EnggDiffractionViewQtGUI::currentPreprocRunNo() const {
+  return qListToVector(
+      m_uiTabPreproc.MWRunFiles_preproc_run_num->getFilenames(),
+      m_uiTabPreproc.MWRunFiles_preproc_run_num->isValid());
+}
+
+double EnggDiffractionViewQtGUI::rebinningTimeBin() const {
+  return m_uiTabPreproc.doubleSpinBox_time_bin->value();
+}
+
+size_t EnggDiffractionViewQtGUI::rebinningPulsesNumberPeriods() const {
+  return m_uiTabPreproc.spinBox_nperiods->value();
+}
+
+double EnggDiffractionViewQtGUI::rebinningPulsesTime() const {
+  return m_uiTabPreproc.doubleSpinBox_step_time->value();
+}
+
+void EnggDiffractionViewQtGUI::plotFocusedSpectrum(const std::string &wsName) {
+  std::string pyCode =
+      "win=plotSpectrum('" + wsName + "', 0, error_bars=False, type=0)";
+
+  std::string status =
+      runPythonCode(QString::fromStdString(pyCode), false).toStdString();
+  m_logMsgs.emplace_back("Plotted output focused data, with status string " +
+                         status);
+  m_presenter->notify(IEnggDiffractionPresenter::LogMsg);
+}
+
+void EnggDiffractionViewQtGUI::plotWaterfallSpectrum(
+    const std::string &wsName) {
+  // parameter of list ?
+  std::string pyCode =
+      "plotSpectrum('" + wsName +
+      "', 0, error_bars=False, type=0, waterfall=True, window=win)";
+  std::string status =
+      runPythonCode(QString::fromStdString(pyCode), false).toStdString();
+  m_logMsgs.emplace_back("Plotted output focused data, with status string " +
+                         status);
+  m_presenter->notify(IEnggDiffractionPresenter::LogMsg);
+}
+
+void EnggDiffractionViewQtGUI::plotReplacingWindow(const std::string &wsName,
+                                                   const std::string &spectrum,
+                                                   const std::string &type) {
+  std::string pyCode = "win=plotSpectrum('" + wsName + "', " + spectrum +
+                       ", error_bars=False, type=" + type +
+                       ", window=win, clearWindow=True)";
+  std::string status =
+      runPythonCode(QString::fromStdString(pyCode), false).toStdString();
+
+  m_logMsgs.emplace_back("Plotted output focused data, with status string " +
+                         status);
+  m_presenter->notify(IEnggDiffractionPresenter::LogMsg);
+}
+
+void EnggDiffractionViewQtGUI::plotCalibOutput(const std::string &pyCode) {
+
+  std::string status =
+      runPythonCode(QString::fromStdString(pyCode), false).toStdString();
+
+  m_logMsgs.emplace_back(
+      "Plotted output calibration vanadium curves, with status string " +
+      status);
+  m_presenter->notify(IEnggDiffractionPresenter::LogMsg);
+}
+
+void EnggDiffractionViewQtGUI::resetFocus() {
+  m_uiTabFocus.MWRunFiles_run_num->setUserInput("");
+  m_uiTabFocus.checkBox_focus_bank1->setChecked(true);
+  m_uiTabFocus.checkBox_focus_bank2->setChecked(true);
+
+  m_uiTabFocus.MWRunFiles_cropped_run_num->setUserInput("");
+  m_uiTabFocus.lineEdit_cropped_spec_nos->setText("");
+
+  m_uiTabFocus.groupBox_cropped->setChecked(false);
+  m_uiTabFocus.groupBox_texture->setChecked(false);
+
+  m_uiTabFocus.MWRunFiles_run_num->setUserInput("");
+  m_uiTabFocus.lineEdit_texture_grouping_file->setText("");
+}
+
+std::string
+EnggDiffractionViewQtGUI::enggRunPythonCode(const std::string &pyCode) {
+  std::string status =
+      runPythonCode(QString::fromStdString(pyCode), false).toStdString();
+
+  return status;
+}
+
+std::string EnggDiffractionViewQtGUI::askExistingCalibFilename() {
+  QString prevPath = QString::fromStdString(m_calibSettings.m_inputDirCalib);
+  if (prevPath.isEmpty()) {
+    prevPath =
+        MantidQt::API::AlgorithmInputHistory::Instance().getPreviousDirectory();
+  }
+
+  QString filename =
+      QFileDialog::getOpenFileName(this, tr("Open calibration file"), prevPath,
+                                   QString::fromStdString(g_iparmExtStr));
+
+  if (!filename.isEmpty()) {
+    MantidQt::API::AlgorithmInputHistory::Instance().setPreviousDirectory(
+        filename);
+  }
+
+  return filename.toStdString();
+}
+
+void EnggDiffractionViewQtGUI::loadCalibrationClicked() {
+  m_presenter->notify(IEnggDiffractionPresenter::LoadExistingCalib);
+}
+
+void EnggDiffractionViewQtGUI::calibrateClicked() {
+  m_presenter->notify(IEnggDiffractionPresenter::CalcCalib);
+}
+
+void EnggDiffractionViewQtGUI::CroppedCalibrateClicked() {
+  m_presenter->notify(IEnggDiffractionPresenter::CropCalib);
+}
+
+void EnggDiffractionViewQtGUI::focusClicked() {
+  m_presenter->notify(IEnggDiffractionPresenter::FocusRun);
+}
+
+void EnggDiffractionViewQtGUI::focusCroppedClicked() {
+  m_presenter->notify(IEnggDiffractionPresenter::FocusCropped);
+}
+
+void EnggDiffractionViewQtGUI::focusTextureClicked() {
+  m_presenter->notify(IEnggDiffractionPresenter::FocusTexture);
+}
+
+void EnggDiffractionViewQtGUI::focusResetClicked() {
+  m_presenter->notify(IEnggDiffractionPresenter::ResetFocus);
+}
+
+void EnggDiffractionViewQtGUI::focusStopClicked() {
+  m_presenter->notify(IEnggDiffractionPresenter::StopFocus);
+}
+
+void EnggDiffractionViewQtGUI::rebinTimeClicked() {
+  m_presenter->notify(IEnggDiffractionPresenter::RebinTime);
+}
+
+void EnggDiffractionViewQtGUI::rebinMultiperiodClicked() {
+  m_presenter->notify(IEnggDiffractionPresenter::RebinMultiperiod);
+}
+
+void EnggDiffractionViewQtGUI::browseInputDirCalib() {
+  QString prevPath = QString::fromStdString(m_calibSettings.m_inputDirCalib);
+  if (prevPath.isEmpty()) {
+    prevPath =
+        MantidQt::API::AlgorithmInputHistory::Instance().getPreviousDirectory();
+  }
+  QString dir = QFileDialog::getExistingDirectory(
+      this, tr("Open Directory"), prevPath,
+      QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
+
+  if (dir.isEmpty()) {
+    return;
+  }
+
+  MantidQt::API::AlgorithmInputHistory::Instance().setPreviousDirectory(dir);
+  m_calibSettings.m_inputDirCalib = dir.toStdString();
+  m_uiTabSettings.lineEdit_input_dir_calib->setText(
+      QString::fromStdString(m_calibSettings.m_inputDirCalib));
+}
+
+void EnggDiffractionViewQtGUI::browseInputDirRaw() {
+  QString prevPath = QString::fromStdString(m_calibSettings.m_inputDirRaw);
+  if (prevPath.isEmpty()) {
+    prevPath =
+        MantidQt::API::AlgorithmInputHistory::Instance().getPreviousDirectory();
+  }
+  QString dir = QFileDialog::getExistingDirectory(
+      this, tr("Open Directory"), prevPath,
+      QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
+
+  if (dir.isEmpty()) {
+    return;
+  }
+
+  MantidQt::API::AlgorithmInputHistory::Instance().setPreviousDirectory(dir);
+  m_calibSettings.m_inputDirRaw = dir.toStdString();
+  m_uiTabSettings.lineEdit_input_dir_raw->setText(
+      QString::fromStdString(m_calibSettings.m_inputDirRaw));
+}
+
+void EnggDiffractionViewQtGUI::browsePixelCalibFilename() {
+  QString prevPath = QString::fromStdString(m_calibSettings.m_inputDirCalib);
+  if (prevPath.isEmpty()) {
+    prevPath =
+        MantidQt::API::AlgorithmInputHistory::Instance().getPreviousDirectory();
+  }
+
+  QString filename = QFileDialog::getOpenFileName(
+      this, tr("Open pixel calibration (full calibration) file"), prevPath,
+      QString::fromStdString(g_pixelCalibExt));
+
+  if (filename.isEmpty()) {
+    return;
+  }
+
+  m_calibSettings.m_pixelCalibFilename = filename.toStdString();
+  m_uiTabSettings.lineEdit_pixel_calib_filename->setText(
+      QString::fromStdString(m_calibSettings.m_pixelCalibFilename));
+}
+
+void EnggDiffractionViewQtGUI::browseTemplateGSAS_PRM() {
+
+  QString prevPath = QString::fromStdString(m_calibSettings.m_templateGSAS_PRM);
+  QString path(QFileDialog::getOpenFileName(
+      this, tr("Open GSAS IPAR template file"), prevPath,
+      QString::fromStdString(g_iparmExtStr)));
+
+  if (path.isEmpty()) {
+    return;
+  }
+
+  m_calibSettings.m_templateGSAS_PRM = path.toStdString();
+  m_uiTabSettings.lineEdit_template_gsas_prm->setText(
+      QString::fromStdString(m_calibSettings.m_templateGSAS_PRM));
+}
+
+void EnggDiffractionViewQtGUI::forceRecalculateStateChanged() {
+  m_calibSettings.m_forceRecalcOverwrite =
+      m_uiTabSettings.checkBox_force_recalculate_overwrite->isChecked();
+}
+
+void EnggDiffractionViewQtGUI::browseTextureDetGroupingFile() {
+  QString prevPath = QString::fromStdString(m_calibSettings.m_inputDirRaw);
+  if (prevPath.isEmpty()) {
+    prevPath =
+        MantidQt::API::AlgorithmInputHistory::Instance().getPreviousDirectory();
+  }
+
+  QString path(QFileDialog::getOpenFileName(
+      this, tr("Open detector grouping file"), prevPath,
+      QString::fromStdString(g_DetGrpExtStr)));
+
+  if (path.isEmpty()) {
+    return;
+  }
+
+  MantidQt::API::AlgorithmInputHistory::Instance().setPreviousDirectory(path);
+  m_uiTabFocus.lineEdit_texture_grouping_file->setText(path);
+}
+
+std::vector<std::string> EnggDiffractionViewQtGUI::focusingRunNo() const {
+  return qListToVector(m_uiTabFocus.MWRunFiles_run_num->getFilenames(),
+                       m_uiTabFocus.MWRunFiles_run_num->isValid());
+}
+
+std::vector<std::string>
+EnggDiffractionViewQtGUI::focusingCroppedRunNo() const {
+  return qListToVector(m_uiTabFocus.MWRunFiles_cropped_run_num->getFilenames(),
+                       m_uiTabFocus.MWRunFiles_cropped_run_num->isValid());
+}
+
+std::vector<std::string>
+EnggDiffractionViewQtGUI::focusingTextureRunNo() const {
+  return qListToVector(m_uiTabFocus.MWRunFiles_texture_run_num->getFilenames(),
+                       m_uiTabFocus.MWRunFiles_texture_run_num->isValid());
+}
+
+std::vector<std::string>
+EnggDiffractionViewQtGUI::qListToVector(const QStringList &list,
+                                        bool validator) const {
+  std::vector<std::string> vec;
+  if (validator) {
+    foreach (const QString &str, list) { vec.emplace_back(str.toStdString()); }
+  }
+
+  return vec;
+}
+
+std::vector<bool> EnggDiffractionViewQtGUI::focusingBanks() const {
+  std::vector<bool> res;
+  res.emplace_back(m_uiTabFocus.checkBox_focus_bank1->isChecked());
+  res.emplace_back(m_uiTabFocus.checkBox_focus_bank2->isChecked());
+  return res;
+}
+
+std::string EnggDiffractionViewQtGUI::focusingCroppedSpectrumNos() const {
+  return m_uiTabFocus.lineEdit_cropped_spec_nos->text().toStdString();
+}
+
+std::string EnggDiffractionViewQtGUI::focusingTextureGroupingFile() const {
+  return m_uiTabFocus.lineEdit_texture_grouping_file->text().toStdString();
+}
+
+bool EnggDiffractionViewQtGUI::focusedOutWorkspace() const {
+  return m_uiTabFocus.checkBox_plot_focused_ws->checkState();
+}
+
+bool EnggDiffractionViewQtGUI::plotCalibWorkspace() const {
+  return m_uiTabCalib.checkBox_PlotData_Calib->checkState();
+}
+
+bool EnggDiffractionViewQtGUI::saveFocusedOutputFiles() const {
+  return m_uiTabFocus.checkBox_save_output_files->checkState();
+}
+
+void MantidQt::CustomInterfaces::EnggDiffractionViewQtGUI::showInvalidRBNumber(
+    const bool rbNumberIsValid) {
+  m_ui.label_invalidRBNumber->setVisible(!rbNumberIsValid);
+}
+
+void EnggDiffractionViewQtGUI::plotFocusStatus() {
+  if (focusedOutWorkspace()) {
+    m_uiTabFocus.comboBox_PlotData->setEnabled(true);
+  } else {
+    m_uiTabFocus.comboBox_PlotData->setEnabled(false);
+  }
+}
+
+void EnggDiffractionViewQtGUI::calibspecNoChanged(int /*idx*/) {
+  QComboBox *BankName = m_uiTabCalib.comboBox_calib_cropped_bank_name;
+  if (!BankName)
+    return;
+  g_currentCropCalibBankName = BankName->currentIndex();
+}
+
+void EnggDiffractionViewQtGUI::enableSpecNos() {
+  if (g_currentCropCalibBankName == 0) {
+    m_uiTabCalib.lineEdit_cropped_spec_nos->setEnabled(true);
+    m_uiTabCalib.lineEdit_cropped_customise_bank_name->setEnabled(true);
+  } else {
+    m_uiTabCalib.lineEdit_cropped_spec_nos->setDisabled(true);
+    m_uiTabCalib.lineEdit_cropped_customise_bank_name->setDisabled(true);
+  }
+}
+
+std::string EnggDiffractionViewQtGUI::currentCalibSpecNos() const {
+  return m_uiTabCalib.lineEdit_cropped_spec_nos->text().toStdString();
+}
+
+std::string EnggDiffractionViewQtGUI::currentCalibCustomisedBankName() const {
+  return m_uiTabCalib.lineEdit_cropped_customise_bank_name->text()
+      .toStdString();
+}
+
+void EnggDiffractionViewQtGUI::multiRunModeChanged(int /*idx*/) {
+  QComboBox *plotType = m_uiTabFocus.comboBox_Multi_Runs;
+  if (!plotType)
+    return;
+  g_currentRunMode = plotType->currentIndex();
+}
+
+void EnggDiffractionViewQtGUI::plotRepChanged(int /*idx*/) {
+  QComboBox *plotType = m_uiTabFocus.comboBox_PlotData;
+  if (!plotType)
+    return;
+  g_currentType = plotType->currentIndex();
+}
+
+void EnggDiffractionViewQtGUI::instrumentChanged(int /*idx*/) {
+  QComboBox *inst = m_ui.comboBox_instrument;
+  if (!inst)
+    return;
+  m_currentInst = inst->currentText().toStdString();
+  m_presenter->notify(IEnggDiffractionPresenter::InstrumentChange);
+}
+
+void EnggDiffractionViewQtGUI::RBNumberChanged() {
+  m_presenter->notify(IEnggDiffractionPresenter::RBNumberChange);
+}
+
+void EnggDiffractionViewQtGUI::userSelectInstrument(const QString &prefix) {
+  // Set file browsing to current instrument
+  setPrefix(prefix.toStdString());
+}
+
+void EnggDiffractionViewQtGUI::setPrefix(const std::string &prefix) {
+  QString prefixInput = QString::fromStdString(prefix);
+  // focus tab
+  m_uiTabFocus.MWRunFiles_run_num->setInstrumentOverride(prefixInput);
+  m_uiTabFocus.MWRunFiles_texture_run_num->setInstrumentOverride(prefixInput);
+
+  // calibration tab
+  m_uiTabCalib.MWRunFiles_new_ceria_num->setInstrumentOverride(prefixInput);
+  m_uiTabCalib.MWRunFiles_new_vanadium_num->setInstrumentOverride(prefixInput);
+
+  // rebin tab
+  m_uiTabPreproc.MWRunFiles_preproc_run_num->setInstrumentOverride(prefixInput);
+}
+
+void EnggDiffractionViewQtGUI::showEvent(QShowEvent * /*unused*/) {
+  // make sure that the RB number is checked on interface startup/show
+  m_presenter->notify(IEnggDiffractionPresenter::RBNumberChange);
+}
+
+void EnggDiffractionViewQtGUI::closeEvent(QCloseEvent *event) {
+  int answer = QMessageBox::AcceptRole;
+
+  QMessageBox msgBox;
+  if (false /* TODO: get this from user settings if eventually used */) {
+    msgBox.setWindowTitle("Close the engineering diffraction interface");
+    // with something like this, we'd have layout issues:
+    // msgBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes);
+    // msgBox.setDefaultButton(QMessageBox::Yes);
+    msgBox.setIconPixmap(QPixmap(":/win/unknown.png"));
+    QCheckBox confirmCheckBox("Always ask for confirmation", &msgBox);
+    confirmCheckBox.setCheckState(Qt::Checked);
+    msgBox.layout()->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding));
+    msgBox.layout()->addWidget(&confirmCheckBox);
+    QPushButton *bYes = msgBox.addButton("Yes", QMessageBox::YesRole);
+    bYes->setIcon(style()->standardIcon(QStyle::SP_DialogYesButton));
+    QPushButton *bNo = msgBox.addButton("No", QMessageBox::NoRole);
+    bNo->setIcon(style()->standardIcon(QStyle::SP_DialogNoButton));
+    msgBox.setDefaultButton(bNo);
+    msgBox.setText("You are about to close this interface");
+    msgBox.setInformativeText("Are you sure?");
+    answer = msgBox.exec();
+  }
+
+  if (answer == QMessageBox::AcceptRole && m_ui.pushButton_close->isEnabled()) {
+    m_presenter->notify(IEnggDiffractionPresenter::ShutDown);
+    delete m_splashMsg;
+    m_splashMsg = nullptr;
+    event->accept();
+  } else {
+    event->ignore();
+  }
+}
+
+void EnggDiffractionViewQtGUI::openHelpWin() {
+  MantidQt::API::HelpWindow::showCustomInterface(
+      nullptr, QString("Engineering Diffraction"));
+}
+
+void EnggDiffractionViewQtGUI::updateTabsInstrument(
+    const std::string &newInstrument) {
+  m_fittingWidget->setCurrentInstrument(newInstrument);
+}
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggDiffractionViewQtGUI.h b/qt/scientific_interfaces/EnggDiffraction/EnggDiffractionViewQtGUI.h
new file mode 100644
index 00000000000..a189152fb8d
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggDiffractionViewQtGUI.h
@@ -0,0 +1,301 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "DllConfig.h"
+#include "EnggDiffFittingViewQtWidget.h"
+#include "EnggDiffGSASFittingViewQtWidget.h"
+#include "IEnggDiffractionPresenter.h"
+#include "IEnggDiffractionView.h"
+#include "MantidAPI/IPeakFunction.h"
+#include "MantidQtWidgets/Common/UserSubWindow.h"
+#include "MantidQtWidgets/Plotting/Qwt/PeakPicker.h"
+
+#include "ui_EnggDiffractionQtGUI.h"
+#include "ui_EnggDiffractionQtTabCalib.h"
+#include "ui_EnggDiffractionQtTabFocus.h"
+#include "ui_EnggDiffractionQtTabPreproc.h"
+#include "ui_EnggDiffractionQtTabSettings.h"
+
+// Qt classes forward declarations
+class QMessageBox;
+class QMutex;
+
+class QwtPlotCurve;
+class QwtPlotZoomer;
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+/**
+Qt-based view of the Engineering Diffraction (EnggDiffraction)
+GUI. Provides a concrete view for the graphical interface for Engg
+functionality in Mantid. This view is Qt-based and it is probably the
+only one that will be implemented in a foreseeable horizon. The
+interface of this class is given by IEnggDiffractionView so that it
+fits in the MVP (Model-View-Presenter) design of this GUI.
+*/
+class MANTIDQT_ENGGDIFFRACTION_DLL EnggDiffractionViewQtGUI
+    : public MantidQt::API::UserSubWindow,
+      public IEnggDiffractionView {
+  Q_OBJECT
+
+public:
+  /// Default Constructor
+  EnggDiffractionViewQtGUI(QWidget *parent = nullptr);
+  /// Interface name
+  static std::string name() { return "Engineering Diffraction (Old)"; }
+  /// This interface's categories.
+  static QString categoryInfo() { return "Diffraction"; }
+
+  void splashMessage(bool visible, const std::string &shortMsg,
+                     const std::string &description) override;
+
+  void showStatus(const std::string &sts) override;
+
+  void userWarning(const std::string &warn,
+                   const std::string &description) override;
+
+  void userError(const std::string &err,
+                 const std::string &description) override;
+
+  std::string
+  askNewCalibrationFilename(const std::string &suggestedFname) override;
+
+  std::string askExistingCalibFilename() override;
+
+  std::vector<std::string> logMsgs() const override { return m_logMsgs; }
+
+  std::string getRBNumber() const override;
+
+  EnggDiffCalibSettings currentCalibSettings() const override {
+    return m_calibSettings;
+  }
+
+  std::string currentInstrument() const override { return m_currentInst; }
+
+  std::string currentVanadiumNo() const override;
+
+  std::string currentCeriaNo() const override;
+
+  std::string currentCalibFile() const override;
+
+  std::vector<std::string> newVanadiumNo() const override;
+
+  std::vector<std::string> newCeriaNo() const override;
+
+  int currentCropCalibBankName() const override {
+    return g_currentCropCalibBankName;
+  }
+
+  std::string currentCalibSpecNos() const override;
+
+  std::string currentCalibCustomisedBankName() const override;
+
+  void newCalibLoaded(const std::string &vanadiumNo, const std::string &ceriaNo,
+                      const std::string &fname) override;
+
+  std::string enggRunPythonCode(const std::string &pyCode) override;
+
+  void enableTabs(bool enable) override;
+
+  void enableCalibrateFocusFitUserActions(bool enable) override;
+
+  std::vector<std::string> focusingRunNo() const override;
+
+  std::vector<std::string> focusingCroppedRunNo() const override;
+
+  std::vector<std::string> focusingTextureRunNo() const override;
+
+  std::vector<bool> focusingBanks() const override;
+
+  std::string focusingCroppedSpectrumNos() const override;
+
+  std::string focusingTextureGroupingFile() const override;
+
+  bool focusedOutWorkspace() const override;
+
+  bool plotCalibWorkspace() const override;
+
+  void resetFocus() override;
+
+  std::vector<std::string> currentPreprocRunNo() const override;
+
+  double rebinningTimeBin() const override;
+
+  size_t rebinningPulsesNumberPeriods() const override;
+
+  double rebinningPulsesTime() const override;
+
+  void plotFocusedSpectrum(const std::string &wsName) override;
+
+  void plotWaterfallSpectrum(const std::string &wsName) override;
+
+  void plotReplacingWindow(const std::string &wsName,
+                           const std::string &spectrum,
+                           const std::string &type) override;
+
+  void plotCalibOutput(const std::string &pyCode) override;
+
+  bool saveFocusedOutputFiles() const override;
+
+  void showInvalidRBNumber(const bool rbNumberIsValid) override;
+
+  int currentPlotType() const override { return g_currentType; }
+
+  int currentMultiRunMode() const override { return g_currentRunMode; }
+
+  void updateTabsInstrument(const std::string &newInstrument) override;
+
+signals:
+  void getBanks();
+  void setBank();
+
+private slots:
+  /// for buttons, do calibrate, focus, event->histo rebin, and similar
+  void loadCalibrationClicked();
+  void calibrateClicked();
+  void CroppedCalibrateClicked();
+  void focusClicked();
+  void focusCroppedClicked();
+  void focusTextureClicked();
+  void focusStopClicked();
+  void rebinTimeClicked();
+  void rebinMultiperiodClicked();
+
+  // slots of the settings tab/section of the interface
+  void browseInputDirCalib();
+  void browseInputDirRaw();
+  void browsePixelCalibFilename();
+  void browseTemplateGSAS_PRM();
+  void forceRecalculateStateChanged();
+
+  // slots for the focusing options
+  void browseTextureDetGroupingFile();
+  void focusResetClicked();
+
+  // slots of the calibration tab/section of the interface
+
+  // slots of the general part of the interface
+  void instrumentChanged(int idx);
+
+  void RBNumberChanged();
+
+  // slot of the cropped calibration part of the interface
+  void calibspecNoChanged(int idx);
+
+  // slots of the focus part of the interface
+  void plotRepChanged(int idx);
+
+  // slot of the multi-run mode for focus
+  void multiRunModeChanged(int idx);
+
+  // slots of plot spectrum check box status
+  void plotFocusStatus();
+
+  // enables the text field when appropriate bank name is selected
+  void enableSpecNos();
+
+  // show the standard Mantid help window with this interface's help
+  void openHelpWin();
+
+private:
+  /// Setup the interface (tab UI)
+  void initLayout() override;
+  void doSetupGeneralWidgets();
+  void doSetupSplashMsg();
+  void doSetupTabCalib();
+  void doSetupTabFocus();
+  void doSetupTabPreproc();
+  void doSetupTabSettings();
+
+  std::string guessGSASTemplatePath() const;
+  std::string guessDefaultFullCalibrationPath() const;
+
+  /// Load default interface settings for each tab, normally on startup
+  void readSettings();
+  /// save settings (before closing)
+  void saveSettings() const override;
+
+  // when the interface is shown
+  void showEvent(QShowEvent * /*unused*/) override;
+
+  // window (custom interface) close
+  void closeEvent(QCloseEvent *ev) override;
+
+  // path/name for the persistent settings group of this interface
+  const static std::string g_settingsGroup;
+
+  // here the view puts messages before notifying the presenter to show them
+  std::vector<std::string> m_logMsgs;
+
+  /// Interface definition with widgets for the main interface window
+  Ui::EnggDiffractionQtGUI m_ui;
+  // And its sections/tabs. Note that for compactness they're called simply
+  // 'tabs'
+  // but they could be separate dialogs, widgets, etc.
+  Ui::EnggDiffractionQtTabCalib m_uiTabCalib;
+  Ui::EnggDiffractionQtTabFocus m_uiTabFocus;
+  Ui::EnggDiffractionQtTabPreproc m_uiTabPreproc;
+  // Ui::EnggDiffractionQtTabFitting m_uiTabFitting;
+  EnggDiffFittingViewQtWidget *m_fittingWidget;
+  EnggDiffGSASFittingViewQtWidget *m_gsasWidget;
+  Ui::EnggDiffractionQtTabSettings m_uiTabSettings;
+
+  /// converts QList to a vector
+  std::vector<std::string> qListToVector(const QStringList &list,
+                                         bool validator) const;
+
+  /// instrument selected (ENGIN-X, etc.)
+  std::string m_currentInst;
+
+  /// User select instrument
+  void userSelectInstrument(const QString &prefix);
+
+  /// setting the instrument prefix ahead of the run number
+  void setPrefix(const std::string &prefix);
+
+  // TODO: The values of these three next static members (bank name,
+  // type, run mode) can be obtained from widgets when requested/required.  They
+  // shouldn't need to be cached in data members. Remove them.
+
+  // current bank number used for cropped calibration
+  int static g_currentCropCalibBankName;
+
+  // plot data representation type selected
+  int static g_currentType;
+
+  // multi-run focus mode type selected
+  int static g_currentRunMode;
+
+  /// calibration settings - from/to the 'settings' tab
+  EnggDiffCalibSettings m_calibSettings;
+
+  /// To show important non-modal messages
+  QMessageBox *m_splashMsg;
+
+  /// This is in principle the only settings for 'focus'
+  std::string m_focusDir;
+
+  /// for the 'Rebin' parameter of some Engg* algorithms
+  static const double g_defaultRebinWidth;
+
+  /// supported file extensions string for IPARM files (for the open
+  /// file dialogs)
+  static const std::string g_iparmExtStr;
+  /// supported file extensions string for the pixel (full) claibration
+  static const std::string g_pixelCalibExt;
+  /// supported/suggested file extensions for the detector groups file
+  /// (focusing)
+  static const std::string g_DetGrpExtStr;
+
+  /// presenter as in the model-view-presenter
+  boost::shared_ptr<IEnggDiffractionPresenter> m_presenter;
+};
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggVanadiumCorrectionsModel.cpp b/qt/scientific_interfaces/EnggDiffraction/EnggVanadiumCorrectionsModel.cpp
new file mode 100644
index 00000000000..4a853ba2605
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggVanadiumCorrectionsModel.cpp
@@ -0,0 +1,196 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "EnggVanadiumCorrectionsModel.h"
+
+#include "MantidAPI/AlgorithmManager.h"
+#include "MantidAPI/AnalysisDataService.h"
+#include "MantidAPI/MatrixWorkspace.h"
+
+#include <Poco/File.h>
+#include <Poco/Path.h>
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+EnggVanadiumCorrectionsModel::EnggVanadiumCorrectionsModel(
+    const EnggDiffCalibSettings &calibSettings,
+    const std::string &currentInstrument)
+    : m_calibSettings(calibSettings), m_currentInstrument(currentInstrument) {}
+
+const std::string EnggVanadiumCorrectionsModel::CURVES_WORKSPACE_NAME =
+    "engggui_vanadium_curves";
+
+const std::string EnggVanadiumCorrectionsModel::INTEGRATED_WORKSPACE_NAME =
+    "engggui_vanadium_integration";
+
+const std::string EnggVanadiumCorrectionsModel::VANADIUM_INPUT_WORKSPACE_NAME =
+    "engggui_vanadium_ws";
+
+std::pair<Mantid::API::ITableWorkspace_sptr, Mantid::API::MatrixWorkspace_sptr>
+EnggVanadiumCorrectionsModel::calculateCorrectionWorkspaces(
+    const std::string &vanadiumRunNumber) const {
+  const auto vanadiumWS =
+      loadMatrixWorkspace(vanadiumRunNumber, VANADIUM_INPUT_WORKSPACE_NAME);
+
+  auto enggVanadiumCorrections =
+      Mantid::API::AlgorithmManager::Instance().create(
+          "EnggVanadiumCorrections");
+  enggVanadiumCorrections->initialize();
+  enggVanadiumCorrections->setPropertyValue("VanadiumWorkspace",
+                                            VANADIUM_INPUT_WORKSPACE_NAME);
+  enggVanadiumCorrections->setPropertyValue("OutIntegrationWorkspace",
+                                            INTEGRATED_WORKSPACE_NAME);
+  enggVanadiumCorrections->setPropertyValue("OutCurvesWorkspace",
+                                            CURVES_WORKSPACE_NAME);
+  enggVanadiumCorrections->execute();
+
+  auto &ADS = Mantid::API::AnalysisDataService::Instance();
+
+  ADS.remove(VANADIUM_INPUT_WORKSPACE_NAME);
+  const auto integratedWorkspace =
+      ADS.retrieveWS<Mantid::API::ITableWorkspace>(INTEGRATED_WORKSPACE_NAME);
+  const auto curvesWorkspace =
+      ADS.retrieveWS<Mantid::API::MatrixWorkspace>(CURVES_WORKSPACE_NAME);
+  return std::make_pair(integratedWorkspace, curvesWorkspace);
+}
+
+std::pair<Mantid::API::ITableWorkspace_sptr, Mantid::API::MatrixWorkspace_sptr>
+EnggVanadiumCorrectionsModel::fetchCorrectionWorkspaces(
+    const std::string &vanadiumRunNumber) const {
+  const auto cachedCurvesWorkspace =
+      fetchCachedCurvesWorkspace(vanadiumRunNumber);
+  const auto cachedIntegratedWorkspace =
+      fetchCachedIntegratedWorkspace(vanadiumRunNumber);
+
+  if (cachedCurvesWorkspace && cachedIntegratedWorkspace &&
+      !m_calibSettings.m_forceRecalcOverwrite) {
+    return std::make_pair(cachedIntegratedWorkspace, cachedCurvesWorkspace);
+  } else {
+    const auto correctionWorkspaces =
+        calculateCorrectionWorkspaces(vanadiumRunNumber);
+    saveCorrectionsToCache(vanadiumRunNumber, correctionWorkspaces.second,
+                           correctionWorkspaces.first);
+    return correctionWorkspaces;
+  }
+}
+
+Mantid::API::MatrixWorkspace_sptr
+EnggVanadiumCorrectionsModel::fetchCachedCurvesWorkspace(
+    const std::string &vanadiumRunNumber) const {
+  const auto filename = generateCurvesFilename(vanadiumRunNumber);
+  const Poco::File inputFile(filename);
+  if (inputFile.exists()) {
+    return loadMatrixWorkspace(filename, CURVES_WORKSPACE_NAME);
+  }
+
+  return nullptr;
+}
+
+Mantid::API::ITableWorkspace_sptr
+EnggVanadiumCorrectionsModel::fetchCachedIntegratedWorkspace(
+    const std::string &vanadiumRunNumber) const {
+  const auto filename = generateIntegratedFilename(vanadiumRunNumber);
+  const Poco::File inputFile(filename);
+  if (inputFile.exists()) {
+    return loadTableWorkspace(filename, INTEGRATED_WORKSPACE_NAME);
+  }
+
+  return nullptr;
+}
+
+std::string EnggVanadiumCorrectionsModel::generateCurvesFilename(
+    const std::string &vanadiumRunNumber) const {
+  const static std::string filenameSuffix =
+      "_precalculated_vanadium_run_bank_curves.nxs";
+
+  const auto normalisedRunName = Poco::Path(vanadiumRunNumber).getBaseName();
+  const auto curvesFilename = normalisedRunName + filenameSuffix;
+
+  Poco::Path inputDir(m_calibSettings.m_inputDirCalib);
+  inputDir.append(curvesFilename);
+  return inputDir.toString();
+}
+
+std::string EnggVanadiumCorrectionsModel::generateIntegratedFilename(
+    const std::string &vanadiumRunNumber) const {
+  const static std::string filenameSuffix =
+      "_precalculated_vanadium_run_integration.nxs";
+
+  const auto normalisedRunName = Poco::Path(vanadiumRunNumber).getBaseName();
+  const auto integratedFilename = normalisedRunName + filenameSuffix;
+
+  Poco::Path inputDir(m_calibSettings.m_inputDirCalib);
+  inputDir.append(integratedFilename);
+  return inputDir.toString();
+}
+
+std::string EnggVanadiumCorrectionsModel::generateVanadiumRunName(
+    const std::string &vanadiumRunNumber) const {
+  constexpr static size_t normalisedRunNumberLength = 8;
+  return m_currentInstrument +
+         std::string(normalisedRunNumberLength - vanadiumRunNumber.length(),
+                     '0') +
+         vanadiumRunNumber;
+}
+
+Mantid::API::MatrixWorkspace_sptr
+EnggVanadiumCorrectionsModel::loadMatrixWorkspace(
+    const std::string &filename, const std::string &workspaceName) const {
+  auto load = Mantid::API::AlgorithmManager::Instance().create("Load");
+  load->initialize();
+  load->setPropertyValue("Filename", filename);
+  load->setPropertyValue("OutputWorkspace", workspaceName);
+  load->execute();
+  return Mantid::API::AnalysisDataService::Instance()
+      .retrieveWS<Mantid::API::MatrixWorkspace>(workspaceName);
+}
+
+Mantid::API::ITableWorkspace_sptr
+EnggVanadiumCorrectionsModel::loadTableWorkspace(
+    const std::string &filename, const std::string &workspaceName) const {
+  auto load = Mantid::API::AlgorithmManager::Instance().create("Load");
+  load->initialize();
+  load->setPropertyValue("Filename", filename);
+  load->setPropertyValue("OutputWorkspace", workspaceName);
+  load->execute();
+  return Mantid::API::AnalysisDataService::Instance()
+      .retrieveWS<Mantid::API::ITableWorkspace>(workspaceName);
+}
+
+void EnggVanadiumCorrectionsModel::saveCorrectionsToCache(
+    const std::string &runNumber,
+    const Mantid::API::MatrixWorkspace_sptr &curvesWorkspace,
+    const Mantid::API::ITableWorkspace_sptr &integratedWorkspace) const {
+  const auto curvesFilename = generateCurvesFilename(runNumber);
+  saveNexus(curvesFilename, curvesWorkspace);
+
+  const auto integratedFilename = generateIntegratedFilename(runNumber);
+  saveNexus(integratedFilename, integratedWorkspace);
+}
+
+void EnggVanadiumCorrectionsModel::saveNexus(
+    const std::string &filename,
+    const Mantid::API::Workspace_sptr &workspace) const {
+  auto save = Mantid::API::AlgorithmManager::Instance().create("SaveNexus");
+  save->initialize();
+  save->setProperty("InputWorkspace", workspace);
+  save->setProperty("Filename", filename);
+  save->execute();
+}
+
+void EnggVanadiumCorrectionsModel::setCalibSettings(
+    const EnggDiffCalibSettings &calibSettings) {
+  m_calibSettings = calibSettings;
+}
+
+void EnggVanadiumCorrectionsModel::setCurrentInstrument(
+    const std::string &currentInstrument) {
+  m_currentInstrument = currentInstrument;
+}
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/EnggVanadiumCorrectionsModel.h b/qt/scientific_interfaces/EnggDiffraction/EnggVanadiumCorrectionsModel.h
new file mode 100644
index 00000000000..e448801a74e
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/EnggVanadiumCorrectionsModel.h
@@ -0,0 +1,83 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "DllConfig.h"
+#include "IEnggVanadiumCorrectionsModel.h"
+
+#include <Poco/Path.h>
+#include <boost/optional.hpp>
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+class MANTIDQT_ENGGDIFFRACTION_DLL EnggVanadiumCorrectionsModel
+    : public IEnggVanadiumCorrectionsModel {
+
+public:
+  EnggVanadiumCorrectionsModel(const EnggDiffCalibSettings &calibSettings,
+                               const std::string &currentInstrument);
+
+  std::pair<Mantid::API::ITableWorkspace_sptr,
+            Mantid::API::MatrixWorkspace_sptr>
+  fetchCorrectionWorkspaces(
+      const std::string &vanadiumRunNumber) const override;
+
+  void setCalibSettings(const EnggDiffCalibSettings &calibSettings) override;
+
+  void setCurrentInstrument(const std::string &currentInstrument) override;
+
+protected:
+  const static std::string CURVES_WORKSPACE_NAME;
+
+  const static std::string INTEGRATED_WORKSPACE_NAME;
+
+private:
+  const static std::string VANADIUM_INPUT_WORKSPACE_NAME;
+
+  virtual std::pair<Mantid::API::ITableWorkspace_sptr,
+                    Mantid::API::MatrixWorkspace_sptr>
+  calculateCorrectionWorkspaces(const std::string &vanadiumRunNumber) const;
+
+  Mantid::API::MatrixWorkspace_sptr
+  fetchCachedCurvesWorkspace(const std::string &vanadiumRunNumber) const;
+
+  Mantid::API::ITableWorkspace_sptr
+  fetchCachedIntegratedWorkspace(const std::string &vanadiumRunNumber) const;
+
+  std::string
+  generateCurvesFilename(const std::string &vanadiumRunNumber) const;
+
+  std::string
+  generateIntegratedFilename(const std::string &vanadiumRunNumber) const;
+
+  std::string
+  generateVanadiumRunName(const std::string &vanadiumRunNumber) const;
+
+  Mantid::API::MatrixWorkspace_sptr
+  loadMatrixWorkspace(const std::string &filename,
+                      const std::string &workspaceName) const;
+
+  Mantid::API::ITableWorkspace_sptr
+  loadTableWorkspace(const std::string &filename,
+                     const std::string &workspaceName) const;
+
+  void saveCorrectionsToCache(
+      const std::string &runNumber,
+      const Mantid::API::MatrixWorkspace_sptr &curvesWorkspace,
+      const Mantid::API::ITableWorkspace_sptr &integratedWorkspace) const;
+
+  void saveNexus(const std::string &filename,
+                 const Mantid::API::Workspace_sptr &workspace) const;
+
+  EnggDiffCalibSettings m_calibSettings;
+
+  std::string m_currentInstrument;
+};
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksOutputProperties.cpp b/qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksOutputProperties.cpp
new file mode 100644
index 00000000000..64bf41193da
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksOutputProperties.cpp
@@ -0,0 +1,34 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "GSASIIRefineFitPeaksOutputProperties.h"
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+GSASIIRefineFitPeaksOutputProperties::GSASIIRefineFitPeaksOutputProperties(
+    const double _rwp, const double _sigma, const double _gamma,
+    const Mantid::API::MatrixWorkspace_sptr &_fittedPeaksWS,
+    const Mantid::API::ITableWorkspace_sptr &_latticeParamsWS,
+    const RunLabel &_runLabel)
+    : rwp(_rwp), sigma(_sigma), gamma(_gamma), fittedPeaksWS(_fittedPeaksWS),
+      latticeParamsWS(_latticeParamsWS), runLabel(_runLabel) {}
+
+bool operator==(const GSASIIRefineFitPeaksOutputProperties &lhs,
+                const GSASIIRefineFitPeaksOutputProperties &rhs) {
+  return lhs.rwp == rhs.rwp && lhs.sigma == rhs.sigma &&
+         lhs.gamma == rhs.gamma && lhs.fittedPeaksWS == rhs.fittedPeaksWS &&
+         lhs.latticeParamsWS == rhs.latticeParamsWS &&
+         lhs.runLabel == rhs.runLabel;
+}
+
+bool operator!=(const GSASIIRefineFitPeaksOutputProperties &lhs,
+                const GSASIIRefineFitPeaksOutputProperties &rhs) {
+  return !(lhs == rhs);
+}
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksOutputProperties.h b/qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksOutputProperties.h
new file mode 100644
index 00000000000..435cf4b170a
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksOutputProperties.h
@@ -0,0 +1,49 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "DllConfig.h"
+#include "RunLabel.h"
+
+#include "MantidAPI/ITableWorkspace.h"
+#include "MantidAPI/MatrixWorkspace_fwd.h"
+
+#include <QMetaType>
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+struct MANTIDQT_ENGGDIFFRACTION_DLL GSASIIRefineFitPeaksOutputProperties {
+  GSASIIRefineFitPeaksOutputProperties(
+      const double _rwp, const double _sigma, const double _gamma,
+      const Mantid::API::MatrixWorkspace_sptr &_fittedPeaksWS,
+      const Mantid::API::ITableWorkspace_sptr &_latticeParamsWS,
+      const RunLabel &_runLabel);
+
+  GSASIIRefineFitPeaksOutputProperties() = default;
+
+  double rwp;
+  double sigma;
+  double gamma;
+  Mantid::API::MatrixWorkspace_sptr fittedPeaksWS;
+  Mantid::API::ITableWorkspace_sptr latticeParamsWS;
+  RunLabel runLabel;
+};
+
+MANTIDQT_ENGGDIFFRACTION_DLL bool
+operator==(const GSASIIRefineFitPeaksOutputProperties &lhs,
+           const GSASIIRefineFitPeaksOutputProperties &rhs);
+
+MANTIDQT_ENGGDIFFRACTION_DLL bool
+operator!=(const GSASIIRefineFitPeaksOutputProperties &lhs,
+           const GSASIIRefineFitPeaksOutputProperties &rhs);
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
+
+Q_DECLARE_METATYPE(
+    MantidQt::CustomInterfaces::GSASIIRefineFitPeaksOutputProperties)
diff --git a/qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksParameters.cpp b/qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksParameters.cpp
new file mode 100644
index 00000000000..370d025fc80
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksParameters.cpp
@@ -0,0 +1,47 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#include "GSASIIRefineFitPeaksParameters.h"
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+GSASIIRefineFitPeaksParameters::GSASIIRefineFitPeaksParameters(
+    const Mantid::API::MatrixWorkspace_sptr &_inputWorkspace,
+    const RunLabel &_runLabel, const GSASRefinementMethod &_refinementMethod,
+    const std::string &_instParamsFile,
+    const std::vector<std::string> &_phaseFiles, const std::string &_gsasHome,
+    const std::string &_gsasProjectFile, const boost::optional<double> &_dMin,
+    const boost::optional<double> &_negativeWeight,
+    const boost::optional<double> &_xMin, const boost::optional<double> &_xMax,
+    const bool _refineSigma, const bool _refineGamma)
+    : inputWorkspace(_inputWorkspace), runLabel(_runLabel),
+      refinementMethod(_refinementMethod), instParamsFile(_instParamsFile),
+      phaseFiles(_phaseFiles), gsasHome(_gsasHome),
+      gsasProjectFile(_gsasProjectFile), dMin(_dMin),
+      negativeWeight(_negativeWeight), xMin(_xMin), xMax(_xMax),
+      refineSigma(_refineSigma), refineGamma(_refineGamma) {}
+
+bool operator==(const GSASIIRefineFitPeaksParameters &lhs,
+                const GSASIIRefineFitPeaksParameters &rhs) {
+  return lhs.inputWorkspace == rhs.inputWorkspace &&
+         lhs.runLabel == rhs.runLabel &&
+         lhs.refinementMethod == rhs.refinementMethod &&
+         lhs.instParamsFile == rhs.instParamsFile &&
+         lhs.phaseFiles == rhs.phaseFiles && lhs.gsasHome == rhs.gsasHome &&
+         lhs.gsasProjectFile == rhs.gsasProjectFile && lhs.dMin == rhs.dMin &&
+         lhs.negativeWeight == rhs.negativeWeight && lhs.xMin == rhs.xMin &&
+         lhs.xMax == rhs.xMax && lhs.refineSigma == rhs.refineSigma &&
+         lhs.refineGamma == rhs.refineGamma;
+}
+
+bool operator!=(const GSASIIRefineFitPeaksParameters &lhs,
+                const GSASIIRefineFitPeaksParameters &rhs) {
+  return !(lhs == rhs);
+}
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksParameters.h b/qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksParameters.h
new file mode 100644
index 00000000000..d3ef97805f6
--- /dev/null
+++ b/qt/scientific_interfaces/EnggDiffraction/GSASIIRefineFitPeaksParameters.h
@@ -0,0 +1,59 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "DllConfig.h"
+#include "EnggDiffGSASRefinementMethod.h"
+#include "RunLabel.h"
+
+#include "MantidAPI/MatrixWorkspace.h"
+
+#include <boost/optional.hpp>
+#include <vector>
+
+namespace MantidQt {
+namespace CustomInterfaces {
+
+struct MANTIDQT_ENGGDIFFRACTION_DLL GSASIIRefineFitPeaksParameters {
+  GSASIIRefineFitPeaksParameters(
+      const Mantid::API::MatrixWorkspace_sptr &_inputWorkspace,
+      const RunLabel &_runLabel, const GSASRefinementMethod &_refinementMethod,
+      const std::string &_instParamsFile,
+      const std::vector<std::string> &_phaseFiles, const std::string &_gsasHome,
+      const std::string &_gsasProjectFile, const boost::optional<double> &_dMin,
+      const boost::optional<double> &_negativeWeight,
+      const boost::optional<double> &_xMin,
+      const boost::optional<double> &_xMax, const bool _refineSigma,
+      const bool _refineGamma);
+
+  const Mantid::API::MatrixWorkspace_sptr inputWorkspace;
+  const RunLabel runLabel;
+  const GSASRefinementMethod refinementMethod;
+  const std::string instParamsFile;
+  const std::vector<std::string> phaseFiles;
+  const std::string gsasHome;
+  const std::string gsasProjectFile;
+
+  const boost::optional<double> dMin;
+  const boost::optional<double> negativeWeight;
+  const boost::optional<double> xMin;
+  const boost::optional<double> xMax;
+
+  const bool refineSigma;
+  const bool refineGamma;
+};
+
+MANTIDQT_ENGGDIFFRACTION_DLL bool
+operator==(const GSASIIRefineFitPeaksParameters &lhs,
+           const GSASIIRefineFitPeaksParameters &rhs);
+
+MANTIDQT_ENGGDIFFRACTION_DLL bool
+operator!=(const GSASIIRefineFitPeaksParameters &lhs,
+           const GSASIIRefineFitPeaksParameters &rhs);
+
+} // namespace CustomInterfaces
+} // namespace MantidQt
diff --git a/qt/scientific_interfaces/General/DataComparison.cpp b/qt/scientific_interfaces/General/DataComparison.cpp
index b328b1ef313..8eaa1ccad12 100644
--- a/qt/scientific_interfaces/General/DataComparison.cpp
+++ b/qt/scientific_interfaces/General/DataComparison.cpp
@@ -139,7 +139,7 @@ void DataComparison::addData() {
  *
  * @param ws Pointer to workspace to add.
  */
-void DataComparison::addDataItem(Workspace_const_sptr ws) {
+void DataComparison::addDataItem(const Workspace_const_sptr &ws) {
   // Check that the workspace is the correct type
   MatrixWorkspace_const_sptr matrixWs =
       boost::dynamic_pointer_cast<const MatrixWorkspace>(ws);
@@ -212,7 +212,7 @@ void DataComparison::addDataItem(Workspace_const_sptr ws) {
  *
  * @param ws Pointer to the workspace
  */
-bool DataComparison::containsWorkspace(MatrixWorkspace_const_sptr ws) {
+bool DataComparison::containsWorkspace(const MatrixWorkspace_const_sptr &ws) {
   QString testWsName = QString::fromStdString(ws->getName());
 
   int numRows = m_uiForm.twCurrentData->rowCount();
diff --git a/qt/scientific_interfaces/General/DataComparison.h b/qt/scientific_interfaces/General/DataComparison.h
index 8e40d12b61a..b7893dae28c 100644
--- a/qt/scientific_interfaces/General/DataComparison.h
+++ b/qt/scientific_interfaces/General/DataComparison.h
@@ -37,7 +37,7 @@ public:
   explicit DataComparison(QWidget *parent = nullptr);
 
   /// Tests if a workspace is shown in the UI
-  bool containsWorkspace(Mantid::API::MatrixWorkspace_const_sptr ws);
+  bool containsWorkspace(const Mantid::API::MatrixWorkspace_const_sptr &ws);
 
 private slots:
   /// Add selected data to plot
@@ -72,7 +72,7 @@ private:
   /// Initialize the layout
   void initLayout() override;
   /// Adds a workspace to the data table
-  void addDataItem(Mantid::API::Workspace_const_sptr ws);
+  void addDataItem(const Mantid::API::Workspace_const_sptr &ws);
   /// Normalises spectra offsets in table
   void normaliseSpectraOffsets();
   /// Gets an initial curve colour for a new workspace
diff --git a/qt/scientific_interfaces/General/MantidEV.cpp b/qt/scientific_interfaces/General/MantidEV.cpp
index fe65cb68999..88506b13206 100644
--- a/qt/scientific_interfaces/General/MantidEV.cpp
+++ b/qt/scientific_interfaces/General/MantidEV.cpp
@@ -1833,7 +1833,7 @@ void MantidEV::errorMessage(const std::string &message) {
  *
  *  @return true if a double was extacted from the string.
  */
-bool MantidEV::getDouble(std::string str, double &value) {
+bool MantidEV::getDouble(const std::string &str, double &value) {
   std::istringstream strs(str);
   if (strs >> value) {
     return true;
@@ -2260,7 +2260,7 @@ void MantidEV::loadSettings(const std::string &filename) {
  * @param ledt     pointer to the QLineEdit component whose state
  *                 is to be restored.
  */
-void MantidEV::restore(QSettings *state, QString name, QLineEdit *ledt) {
+void MantidEV::restore(QSettings *state, const QString &name, QLineEdit *ledt) {
   // NOTE: If state was not saved yet, we don't want to change the
   // default value, so we only change the text if it's non-empty
   QString sText = state->value(name, "").toString();
@@ -2278,7 +2278,8 @@ void MantidEV::restore(QSettings *state, QString name, QLineEdit *ledt) {
  * @param btn      pointer to the QCheckbox or QRadioButton component
  *                 whose state is to be restored.
  */
-void MantidEV::restore(QSettings *state, QString name, QAbstractButton *btn) {
+void MantidEV::restore(QSettings *state, const QString &name,
+                       QAbstractButton *btn) {
   btn->setChecked(state->value(name, false).toBool());
 }
 
@@ -2290,7 +2291,7 @@ void MantidEV::restore(QSettings *state, QString name, QAbstractButton *btn) {
  * @param cmbx     pointer to the QComboBox component whose state is
  *                 to be restored.
  */
-void MantidEV::restore(QSettings *state, QString name, QComboBox *cmbx) {
+void MantidEV::restore(QSettings *state, const QString &name, QComboBox *cmbx) {
   // NOTE: If state was not saved yet, we don't want to change the
   // default value, so we only change the selected item if the index
   // has been set to a valid value.
diff --git a/qt/scientific_interfaces/General/MantidEV.h b/qt/scientific_interfaces/General/MantidEV.h
index 5818a94f5f1..ca678fdcb11 100644
--- a/qt/scientific_interfaces/General/MantidEV.h
+++ b/qt/scientific_interfaces/General/MantidEV.h
@@ -363,7 +363,7 @@ private:
   void errorMessage(const std::string &message);
 
   /// Utility method to parse a double value in a string
-  bool getDouble(std::string str, double &value);
+  bool getDouble(const std::string &str, double &value);
 
   /// Utility method to get a double value from a QtLineEdit widget
   bool getDouble(QLineEdit *ledt, double &value);
@@ -393,13 +393,13 @@ private:
   void loadSettings(const std::string &filename);
 
   /// Restore the value of the QLineEdit component from QSettings
-  void restore(QSettings *state, QString name, QLineEdit *ledt);
+  void restore(QSettings *state, const QString &name, QLineEdit *ledt);
 
   /// Restore the value of the QCheckbox or QRadioButton from QSettings
-  void restore(QSettings *state, QString name, QAbstractButton *btn);
+  void restore(QSettings *state, const QString &name, QAbstractButton *btn);
 
   /// Restore the value of a QComboBox from QSettings
-  void restore(QSettings *state, QString name, QComboBox *cmbx);
+  void restore(QSettings *state, const QString &name, QComboBox *cmbx);
 
   Ui::MantidEV m_uiForm; /// The form generated by Qt Designer
 
diff --git a/qt/scientific_interfaces/General/StepScan.cpp b/qt/scientific_interfaces/General/StepScan.cpp
index 0af5bf2a9fa..0731b285020 100644
--- a/qt/scientific_interfaces/General/StepScan.cpp
+++ b/qt/scientific_interfaces/General/StepScan.cpp
@@ -248,7 +248,8 @@ void StepScan::loadFileComplete(bool error) {
 namespace {
 class ScopedStatusText {
 public:
-  ScopedStatusText(QLabel *label, QString labelText) : status_label(label) {
+  ScopedStatusText(QLabel *label, const QString &labelText)
+      : status_label(label) {
     status_label->setText("<i><font color='darkblue'>" + labelText +
                           "</font></i>");
   }
@@ -549,7 +550,7 @@ void StepScan::runStepScanAlg() {
   generateCurve(m_uiForm.plotVariable->currentText());
 }
 
-bool StepScan::runStepScanAlgLive(std::string stepScanProperties) {
+bool StepScan::runStepScanAlgLive(const std::string &stepScanProperties) {
   // First stop the currently running live algorithm
   IAlgorithm_const_sptr oldMonitorLiveData =
       m_uiForm.mWRunFiles->stopLiveAlgorithm();
diff --git a/qt/scientific_interfaces/General/StepScan.h b/qt/scientific_interfaces/General/StepScan.h
index 5e713baae37..b44c224b5af 100644
--- a/qt/scientific_interfaces/General/StepScan.h
+++ b/qt/scientific_interfaces/General/StepScan.h
@@ -45,7 +45,7 @@ private slots:
   void expandPlotVarCombobox(const Mantid::API::MatrixWorkspace_const_sptr &ws);
   void fillNormalizationCombobox();
   void runStepScanAlg();
-  bool runStepScanAlgLive(std::string stepScanProperties);
+  bool runStepScanAlgLive(const std::string &stepScanProperties);
 
   void updateForNormalizationChange();
   void generateCurve(const QString &var);
diff --git a/qt/scientific_interfaces/ISISReflectometry/Common/GetInstrumentParameter.cpp b/qt/scientific_interfaces/ISISReflectometry/Common/GetInstrumentParameter.cpp
index 998b086eaac..ef4d6a8ac6c 100644
--- a/qt/scientific_interfaces/ISISReflectometry/Common/GetInstrumentParameter.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/Common/GetInstrumentParameter.cpp
@@ -10,7 +10,7 @@ namespace CustomInterfaces {
 namespace ISISReflectometry {
 
 std::vector<std::string> InstrumentParameter<std::string>::get(
-    Mantid::Geometry::Instrument_const_sptr instrument,
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
     std::string const &parameterName) {
   try {
     return instrument->getStringParameter(parameterName);
@@ -20,7 +20,7 @@ std::vector<std::string> InstrumentParameter<std::string>::get(
 }
 
 std::vector<int> InstrumentParameter<int>::get(
-    Mantid::Geometry::Instrument_const_sptr instrument,
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
     std::string const &parameterName) {
   try {
     return instrument->getIntParameter(parameterName);
@@ -30,7 +30,7 @@ std::vector<int> InstrumentParameter<int>::get(
 }
 
 std::vector<bool> InstrumentParameter<bool>::get(
-    Mantid::Geometry::Instrument_const_sptr instrument,
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
     std::string const &parameterName) {
   try {
     return instrument->getBoolParameter(parameterName);
@@ -40,7 +40,7 @@ std::vector<bool> InstrumentParameter<bool>::get(
 }
 
 std::vector<double> InstrumentParameter<double>::get(
-    Mantid::Geometry::Instrument_const_sptr instrument,
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
     std::string const &parameterName) {
   try {
     return instrument->getNumberParameter(parameterName);
diff --git a/qt/scientific_interfaces/ISISReflectometry/Common/GetInstrumentParameter.h b/qt/scientific_interfaces/ISISReflectometry/Common/GetInstrumentParameter.h
index dc31f2ea2da..d10c16bc5b2 100644
--- a/qt/scientific_interfaces/ISISReflectometry/Common/GetInstrumentParameter.h
+++ b/qt/scientific_interfaces/ISISReflectometry/Common/GetInstrumentParameter.h
@@ -17,28 +17,28 @@ template <typename T> class InstrumentParameter;
 template <> class InstrumentParameter<std::string> {
 public:
   static std::vector<std::string>
-  get(Mantid::Geometry::Instrument_const_sptr instrument,
+  get(const Mantid::Geometry::Instrument_const_sptr &instrument,
       std::string const &parameterName);
 };
 
 template <> class InstrumentParameter<double> {
 public:
   static std::vector<double>
-  get(Mantid::Geometry::Instrument_const_sptr instrument,
+  get(const Mantid::Geometry::Instrument_const_sptr &instrument,
       std::string const &parameterName);
 };
 
 template <> class InstrumentParameter<int> {
 public:
   static std::vector<int>
-  get(Mantid::Geometry::Instrument_const_sptr instrument,
+  get(const Mantid::Geometry::Instrument_const_sptr &instrument,
       std::string const &parameterName);
 };
 
 template <> class InstrumentParameter<bool> {
 public:
   static std::vector<bool>
-  get(Mantid::Geometry::Instrument_const_sptr instrument,
+  get(const Mantid::Geometry::Instrument_const_sptr &instrument,
       std::string const &parameterName);
 };
 
@@ -73,7 +73,7 @@ template <typename T1, typename T2>
 class InstrumentParameter<boost::variant<T1, T2>> {
 public:
   static boost::variant<std::vector<T1>, std::vector<T2>>
-  get(Mantid::Geometry::Instrument_const_sptr instrument,
+  get(const Mantid::Geometry::Instrument_const_sptr &instrument,
       std::string const &parameterName) {
     try {
       return InstrumentParameter<T1>::get(instrument, parameterName);
@@ -106,7 +106,7 @@ class InstrumentParameter<boost::variant<T1, T2, T3, Ts...>> {
 public:
   static boost::variant<std::vector<T1>, std::vector<T2>, std::vector<T3>,
                         std::vector<Ts>...>
-  get(Mantid::Geometry::Instrument_const_sptr instrument,
+  get(const Mantid::Geometry::Instrument_const_sptr &instrument,
       std::string const &parameterName) {
     try {
       return InstrumentParameter<T1>::get(instrument, parameterName);
@@ -124,8 +124,9 @@ public:
 };
 
 template <typename T>
-auto getInstrumentParameter(Mantid::Geometry::Instrument_const_sptr instrument,
-                            std::string const &parameterName)
+auto getInstrumentParameter(
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
+    std::string const &parameterName)
     -> decltype(InstrumentParameter<T>::get(
         std::declval<Mantid::Geometry::Instrument_const_sptr>(),
         std::declval<std::string const &>())) {
diff --git a/qt/scientific_interfaces/ISISReflectometry/Common/OptionDefaults.cpp b/qt/scientific_interfaces/ISISReflectometry/Common/OptionDefaults.cpp
index f75d7957cf1..7e06d2d8a23 100644
--- a/qt/scientific_interfaces/ISISReflectometry/Common/OptionDefaults.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/Common/OptionDefaults.cpp
@@ -5,6 +5,9 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "OptionDefaults.h"
+
+#include <utility>
+
 #include "MantidAPI/AlgorithmManager.h"
 
 namespace MantidQt {
@@ -13,7 +16,7 @@ namespace ISISReflectometry {
 
 OptionDefaults::OptionDefaults(
     Mantid::Geometry::Instrument_const_sptr instrument)
-    : m_instrument(instrument) {
+    : m_instrument(std::move(instrument)) {
   // Get the algorithm for which we'll take defaults if available
   m_algorithm = Mantid::API::AlgorithmManager::Instance().createUnmanaged(
       "ReflectometryReductionOneAuto");
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/AlgorithmProperties.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/AlgorithmProperties.cpp
index c83da7f4101..c4376c478c3 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/AlgorithmProperties.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/AlgorithmProperties.cpp
@@ -65,7 +65,7 @@ void updateFromMap(AlgorithmRuntimeProps &properties,
     update(kvp.first, kvp.second, properties);
   }
 }
-std::string getOutputWorkspace(IAlgorithm_sptr algorithm,
+std::string getOutputWorkspace(const IAlgorithm_sptr &algorithm,
                                std::string const &property) {
   auto const workspaceName = algorithm->getPropertyValue(property);
   return workspaceName;
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/AlgorithmProperties.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/AlgorithmProperties.h
index 4761c175603..5ed98adf3a7 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/AlgorithmProperties.h
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/AlgorithmProperties.h
@@ -47,7 +47,7 @@ void update(std::string const &property, boost::optional<double> const &value,
 void updateFromMap(AlgorithmRuntimeProps &properties,
                    std::map<std::string, std::string> const &parameterMap);
 
-std::string getOutputWorkspace(Mantid::API::IAlgorithm_sptr algorithm,
+std::string getOutputWorkspace(const Mantid::API::IAlgorithm_sptr &algorithm,
                                std::string const &property);
 
 template <typename VALUE_TYPE>
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchJobAlgorithm.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchJobAlgorithm.cpp
index fe526791206..8e2a949474d 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchJobAlgorithm.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchJobAlgorithm.cpp
@@ -5,6 +5,9 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "BatchJobAlgorithm.h"
+
+#include <utility>
+
 #include "MantidAPI/IAlgorithm.h"
 
 namespace MantidQt {
@@ -18,8 +21,8 @@ BatchJobAlgorithm::BatchJobAlgorithm(
     Mantid::API::IAlgorithm_sptr algorithm,
     MantidQt::API::ConfiguredAlgorithm::AlgorithmRuntimeProps properties,
     UpdateFunction updateFunction, Item *item)
-    : ConfiguredAlgorithm(algorithm, properties), m_item(item),
-      m_updateFunction(updateFunction) {}
+    : ConfiguredAlgorithm(std::move(algorithm), std::move(properties)),
+      m_item(item), m_updateFunction(updateFunction) {}
 
 Item *BatchJobAlgorithm::item() { return m_item; }
 
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchJobAlgorithm.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchJobAlgorithm.h
index dc9aaff17ea..4799ae993fd 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchJobAlgorithm.h
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/BatchJobAlgorithm.h
@@ -23,7 +23,7 @@ class MANTIDQT_ISISREFLECTOMETRY_DLL BatchJobAlgorithm
     : public IBatchJobAlgorithm,
       public MantidQt::API::ConfiguredAlgorithm {
 public:
-  using UpdateFunction = void (*)(Mantid::API::IAlgorithm_sptr algorithm,
+  using UpdateFunction = void (*)(const Mantid::API::IAlgorithm_sptr &algorithm,
                                   Item &item);
 
   BatchJobAlgorithm(
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/GroupProcessingAlgorithm.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/GroupProcessingAlgorithm.cpp
index 10d4cf321f3..168134898f8 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/GroupProcessingAlgorithm.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/GroupProcessingAlgorithm.cpp
@@ -5,6 +5,9 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "GroupProcessingAlgorithm.h"
+
+#include <utility>
+
 #include "../../Reduction/Batch.h"
 #include "../../Reduction/Group.h"
 #include "AlgorithmProperties.h"
@@ -58,9 +61,10 @@ void updateWorkspaceProperties(AlgorithmRuntimeProps &properties,
   AlgorithmProperties::update("OutputWorkspace", outputName, properties);
 }
 
-void updateGroupFromOutputProperties(IAlgorithm_sptr algorithm, Item &group) {
-  auto const stitched =
-      AlgorithmProperties::getOutputWorkspace(algorithm, "OutputWorkspace");
+void updateGroupFromOutputProperties(const IAlgorithm_sptr &algorithm,
+                                     Item &group) {
+  auto const stitched = AlgorithmProperties::getOutputWorkspace(
+      std::move(algorithm), "OutputWorkspace");
   group.setOutputNames(std::vector<std::string>{stitched});
 }
 
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/QtBatchView.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/QtBatchView.cpp
index cf2ffff5a62..a9c9a13c6e4 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/QtBatchView.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/QtBatchView.cpp
@@ -14,6 +14,7 @@
 
 #include <QMessageBox>
 #include <QMetaType>
+#include <utility>
 
 namespace MantidQt {
 namespace CustomInterfaces {
@@ -105,17 +106,17 @@ void QtBatchView::onBatchComplete(bool error) {
 void QtBatchView::onBatchCancelled() { m_notifyee->notifyBatchCancelled(); }
 
 void QtBatchView::onAlgorithmStarted(API::IConfiguredAlgorithm_sptr algorithm) {
-  m_notifyee->notifyAlgorithmStarted(algorithm);
+  m_notifyee->notifyAlgorithmStarted(std::move(algorithm));
 }
 
 void QtBatchView::onAlgorithmComplete(
     API::IConfiguredAlgorithm_sptr algorithm) {
-  m_notifyee->notifyAlgorithmComplete(algorithm);
+  m_notifyee->notifyAlgorithmComplete(std::move(algorithm));
 }
 
 void QtBatchView::onAlgorithmError(API::IConfiguredAlgorithm_sptr algorithm,
-                                   std::string message) {
-  m_notifyee->notifyAlgorithmError(algorithm, message);
+                                   const std::string &message) {
+  m_notifyee->notifyAlgorithmError(std::move(algorithm), message);
 }
 
 std::unique_ptr<QtRunsView> QtBatchView::createRunsTab() {
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/QtBatchView.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/QtBatchView.h
index 9ecf75f9016..a97d90a15de 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/QtBatchView.h
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/QtBatchView.h
@@ -47,7 +47,7 @@ private slots:
   void onAlgorithmStarted(MantidQt::API::IConfiguredAlgorithm_sptr algorithm);
   void onAlgorithmComplete(MantidQt::API::IConfiguredAlgorithm_sptr algorithm);
   void onAlgorithmError(MantidQt::API::IConfiguredAlgorithm_sptr algorithm,
-                        std::string errorMessage);
+                        const std::string &errorMessage);
 
 private:
   void initLayout();
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/RowProcessingAlgorithm.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/RowProcessingAlgorithm.cpp
index e02d207771a..ad82098a4f1 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/RowProcessingAlgorithm.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Batch/RowProcessingAlgorithm.cpp
@@ -242,13 +242,14 @@ void updateEventProperties(AlgorithmRuntimeProps &properties,
   boost::apply_visitor(UpdateEventPropertiesVisitor(properties), slicing);
 }
 
-boost::optional<double> getDouble(IAlgorithm_sptr algorithm,
+boost::optional<double> getDouble(const IAlgorithm_sptr &algorithm,
                                   std::string const &property) {
   double result = algorithm->getProperty(property);
   return result;
 }
 
-void updateRowFromOutputProperties(IAlgorithm_sptr algorithm, Item &item) {
+void updateRowFromOutputProperties(const IAlgorithm_sptr &algorithm,
+                                   Item &item) {
   auto &row = dynamic_cast<Row &>(item);
 
   auto const iVsLam = AlgorithmProperties::getOutputWorkspace(
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentOptionDefaults.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentOptionDefaults.cpp
index 025d0812238..94441e5f3d4 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentOptionDefaults.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentOptionDefaults.cpp
@@ -5,6 +5,9 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "ExperimentOptionDefaults.h"
+
+#include <utility>
+
 #include "Common/OptionDefaults.h"
 #include "MantidAPI/AlgorithmManager.h"
 #include "PerThetaDefaultsTableValidator.h"
@@ -24,7 +27,7 @@ std::string stringValueOrEmpty(boost::optional<double> value) {
 
 Experiment
 getExperimentDefaults(Mantid::Geometry::Instrument_const_sptr instrument) {
-  auto defaults = OptionDefaults(instrument);
+  auto defaults = OptionDefaults(std::move(instrument));
 
   auto analysisMode = analysisModeFromString(defaults.getStringOrDefault(
       "AnalysisMode", "AnalysisMode", "PointDetectorAnalysis"));
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/PerThetaDefaultsTableValidationError.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/PerThetaDefaultsTableValidationError.cpp
index b939c91d707..b47755f1c0c 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/PerThetaDefaultsTableValidationError.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/PerThetaDefaultsTableValidationError.cpp
@@ -5,6 +5,9 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "PerThetaDefaultsTableValidationError.h"
+
+#include <utility>
+
 #include "ThetaValuesValidationError.h"
 namespace MantidQt {
 namespace CustomInterfaces {
@@ -15,7 +18,7 @@ PerThetaDefaultsTableValidationError::PerThetaDefaultsTableValidationError(
     std::vector<InvalidDefaultsError> validationErrors,
     boost::optional<ThetaValuesValidationError> fullTableError)
     : m_validationErrors(std::move(validationErrors)),
-      m_fullTableError(fullTableError) {}
+      m_fullTableError(std::move(fullTableError)) {}
 
 std::vector<InvalidDefaultsError> const &
 PerThetaDefaultsTableValidationError::errors() const {
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.cpp
index 4acf28d3cb1..bf8ae9f8a01 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.cpp
@@ -11,6 +11,7 @@
 #include <QMessageBox>
 #include <QScrollBar>
 #include <boost/algorithm/string/join.hpp>
+#include <utility>
 
 namespace MantidQt {
 namespace CustomInterfaces {
@@ -46,7 +47,7 @@ void showAsValid(QLineEdit &lineEdit) {
  * @param parent :: [input] The parent of this widget
  */
 QtExperimentView::QtExperimentView(
-    Mantid::API::IAlgorithm_sptr algorithmForTooltips, QWidget *parent)
+    const Mantid::API::IAlgorithm_sptr &algorithmForTooltips, QWidget *parent)
     : QWidget(parent), m_stitchEdit(nullptr), m_deleteShortcut(),
       m_notifyee(nullptr), m_columnToolTips() {
   initLayout(algorithmForTooltips);
@@ -98,7 +99,7 @@ void QtExperimentView::initLayout(
                                                  m_ui.optionsTable);
   connect(m_deleteShortcut.get(), SIGNAL(activated()), this,
           SLOT(onRemovePerThetaDefaultsRequested()));
-  initOptionsTable(algorithmForTooltips);
+  initOptionsTable(std::move(algorithmForTooltips));
   initFloodControls();
 
   auto blacklist =
@@ -116,7 +117,8 @@ void QtExperimentView::initLayout(
 }
 
 void QtExperimentView::initializeTableColumns(
-    QTableWidget &table, Mantid::API::IAlgorithm_sptr algorithmForTooltips) {
+    QTableWidget &table,
+    const Mantid::API::IAlgorithm_sptr &algorithmForTooltips) {
   for (auto column = 0; column < table.columnCount(); ++column) {
     // Get the tooltip for this column based on the algorithm property
     auto const propertyName = PerThetaDefaults::ColumnPropertyName[column];
@@ -159,14 +161,14 @@ void QtExperimentView::initializeTableRow(
 }
 
 void QtExperimentView::initOptionsTable(
-    Mantid::API::IAlgorithm_sptr algorithmForTooltips) {
+    const Mantid::API::IAlgorithm_sptr &algorithmForTooltips) {
   auto table = m_ui.optionsTable;
 
   // Set angle and scale columns to a small width so everything fits
   table->resizeColumnsToContents();
   table->setColumnCount(PerThetaDefaults::OPTIONS_TABLE_COLUMN_COUNT);
   table->setRowCount(1);
-  initializeTableColumns(*table, algorithmForTooltips);
+  initializeTableColumns(*table, std::move(algorithmForTooltips));
   initializeTableItems(*table);
 
   auto header = table->horizontalHeader();
@@ -254,13 +256,13 @@ void QtExperimentView::disableAll() { setEnabledStateForAllWidgets(false); }
 void QtExperimentView::enableAll() { setEnabledStateForAllWidgets(true); }
 
 void QtExperimentView::registerSettingsWidgets(
-    Mantid::API::IAlgorithm_sptr alg) {
-  registerExperimentSettingsWidgets(alg);
+    const Mantid::API::IAlgorithm_sptr &alg) {
+  registerExperimentSettingsWidgets(std::move(alg));
   connectExperimentSettingsWidgets();
 }
 
 void QtExperimentView::registerExperimentSettingsWidgets(
-    Mantid::API::IAlgorithm_sptr alg) {
+    const Mantid::API::IAlgorithm_sptr &alg) {
   registerSettingWidget(*m_ui.analysisModeComboBox, "AnalysisMode", alg);
   registerSettingWidget(*m_ui.startOverlapEdit, "StartOverlap", alg);
   registerSettingWidget(*m_ui.endOverlapEdit, "EndOverlap", alg);
@@ -341,15 +343,15 @@ void QtExperimentView::disableIncludePartialBins() {
 }
 
 template <typename Widget>
-void QtExperimentView::registerSettingWidget(Widget &widget,
-                                             std::string const &propertyName,
-                                             Mantid::API::IAlgorithm_sptr alg) {
+void QtExperimentView::registerSettingWidget(
+    Widget &widget, std::string const &propertyName,
+    const Mantid::API::IAlgorithm_sptr &alg) {
   setToolTipAsPropertyDocumentation(widget, propertyName, alg);
 }
 
 void QtExperimentView::setToolTipAsPropertyDocumentation(
     QWidget &widget, std::string const &propertyName,
-    Mantid::API::IAlgorithm_sptr alg) {
+    const Mantid::API::IAlgorithm_sptr &alg) {
   widget.setToolTip(QString::fromStdString(
       alg->getPointerToProperty(propertyName)->documentation()));
 }
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.h
index 386b2e3cd9c..285ffe9cf06 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.h
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.h
@@ -25,7 +25,7 @@ class MANTIDQT_ISISREFLECTOMETRY_DLL QtExperimentView : public QWidget,
                                                         public IExperimentView {
   Q_OBJECT
 public:
-  QtExperimentView(Mantid::API::IAlgorithm_sptr algorithmForTooltips,
+  QtExperimentView(const Mantid::API::IAlgorithm_sptr &algorithmForTooltips,
                    QWidget *parent = nullptr);
   void subscribe(ExperimentViewSubscriber *notifyee) override;
   void connectExperimentSettingsWidgets() override;
@@ -114,9 +114,9 @@ public slots:
   void onPerAngleDefaultsChanged(int row, int column);
 
 private:
-  void
-  initializeTableColumns(QTableWidget &table,
-                         Mantid::API::IAlgorithm_sptr algorithmForTooltips);
+  void initializeTableColumns(
+      QTableWidget &table,
+      const Mantid::API::IAlgorithm_sptr &algorithmForTooltips);
   void initializeTableItems(QTableWidget &table);
   void initializeTableRow(QTableWidget &table, int row);
   void initializeTableRow(QTableWidget &table, int row,
@@ -127,17 +127,20 @@ private:
 
   /// Initialise the interface
   void initLayout(Mantid::API::IAlgorithm_sptr algorithmForTooltips);
-  void initOptionsTable(Mantid::API::IAlgorithm_sptr algorithmForTooltips);
+  void
+  initOptionsTable(const Mantid::API::IAlgorithm_sptr &algorithmForTooltips);
   void initFloodControls();
-  void registerSettingsWidgets(Mantid::API::IAlgorithm_sptr alg);
-  void registerExperimentSettingsWidgets(Mantid::API::IAlgorithm_sptr alg);
-  void setToolTipAsPropertyDocumentation(QWidget &widget,
-                                         std::string const &propertyName,
-                                         Mantid::API::IAlgorithm_sptr alg);
+  void registerSettingsWidgets(const Mantid::API::IAlgorithm_sptr &alg);
+  void
+  registerExperimentSettingsWidgets(const Mantid::API::IAlgorithm_sptr &alg);
+  void
+  setToolTipAsPropertyDocumentation(QWidget &widget,
+                                    std::string const &propertyName,
+                                    const Mantid::API::IAlgorithm_sptr &alg);
 
   template <typename Widget>
   void registerSettingWidget(Widget &widget, std::string const &propertyName,
-                             Mantid::API::IAlgorithm_sptr alg);
+                             const Mantid::API::IAlgorithm_sptr &alg);
   void connectSettingsChange(QLineEdit &edit);
   void connectSettingsChange(QComboBox &edit);
   void connectSettingsChange(QCheckBox &edit);
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentOptionDefaults.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentOptionDefaults.cpp
index d1a7f3eed32..73d3c4b5ecf 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentOptionDefaults.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/InstrumentOptionDefaults.cpp
@@ -5,6 +5,9 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "InstrumentOptionDefaults.h"
+
+#include <utility>
+
 #include "Common/OptionDefaults.h"
 #include "MantidAPI/AlgorithmManager.h"
 #include "Reduction/Instrument.h"
@@ -19,7 +22,7 @@ Mantid::Kernel::Logger g_log("Reflectometry GUI");
 
 Instrument
 getInstrumentDefaults(Mantid::Geometry::Instrument_const_sptr instrument) {
-  auto defaults = OptionDefaults(instrument);
+  auto defaults = OptionDefaults(std::move(instrument));
 
   auto wavelengthRange =
       RangeInLambda(defaults.getValue<double>("WavelengthMin", "LambdaMin"),
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/QtInstrumentView.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/QtInstrumentView.cpp
index a527c694704..7fd4fac9f4b 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/QtInstrumentView.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/QtInstrumentView.cpp
@@ -10,6 +10,7 @@
 #include <QMessageBox>
 #include <QScrollBar>
 #include <boost/algorithm/string/join.hpp>
+#include <utility>
 
 namespace MantidQt {
 namespace CustomInterfaces {
@@ -36,7 +37,7 @@ QtInstrumentView::QtInstrumentView(
     Mantid::API::IAlgorithm_sptr algorithmForTooltips, QWidget *parent)
     : QWidget(parent) {
   initLayout();
-  registerSettingsWidgets(algorithmForTooltips);
+  registerSettingsWidgets(std::move(algorithmForTooltips));
 }
 
 void QtInstrumentView::subscribe(InstrumentViewSubscriber *notifyee) {
@@ -132,12 +133,12 @@ void QtInstrumentView::disableDetectorCorrectionType() {
 }
 
 void QtInstrumentView::registerSettingsWidgets(
-    Mantid::API::IAlgorithm_sptr alg) {
-  registerInstrumentSettingsWidgets(alg);
+    const Mantid::API::IAlgorithm_sptr &alg) {
+  registerInstrumentSettingsWidgets(std::move(alg));
 }
 
 void QtInstrumentView::registerInstrumentSettingsWidgets(
-    Mantid::API::IAlgorithm_sptr alg) {
+    const Mantid::API::IAlgorithm_sptr &alg) {
   registerSettingWidget(*m_ui.intMonCheckBox, "NormalizeByIntegratedMonitors",
                         alg);
   registerSettingWidget(*m_ui.monIntMinEdit, "MonitorIntegrationWavelengthMin",
@@ -184,16 +185,16 @@ void QtInstrumentView::disconnectInstrumentSettingsWidgets() {
 }
 
 template <typename Widget>
-void QtInstrumentView::registerSettingWidget(Widget &widget,
-                                             std::string const &propertyName,
-                                             Mantid::API::IAlgorithm_sptr alg) {
+void QtInstrumentView::registerSettingWidget(
+    Widget &widget, std::string const &propertyName,
+    const Mantid::API::IAlgorithm_sptr &alg) {
   connectSettingsChange(widget);
   setToolTipAsPropertyDocumentation(widget, propertyName, alg);
 }
 
 void QtInstrumentView::setToolTipAsPropertyDocumentation(
     QWidget &widget, std::string const &propertyName,
-    Mantid::API::IAlgorithm_sptr alg) {
+    const Mantid::API::IAlgorithm_sptr &alg) {
   widget.setToolTip(QString::fromStdString(
       alg->getPointerToProperty(propertyName)->documentation()));
 }
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/QtInstrumentView.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/QtInstrumentView.h
index 52cd2512122..6735bcf0fff 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/QtInstrumentView.h
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Instrument/QtInstrumentView.h
@@ -77,15 +77,17 @@ private:
 
   /// Initialise the interface
   void initLayout();
-  void registerSettingsWidgets(Mantid::API::IAlgorithm_sptr alg);
-  void registerInstrumentSettingsWidgets(Mantid::API::IAlgorithm_sptr alg);
-  void setToolTipAsPropertyDocumentation(QWidget &widget,
-                                         std::string const &propertyName,
-                                         Mantid::API::IAlgorithm_sptr alg);
+  void registerSettingsWidgets(const Mantid::API::IAlgorithm_sptr &alg);
+  void
+  registerInstrumentSettingsWidgets(const Mantid::API::IAlgorithm_sptr &alg);
+  void
+  setToolTipAsPropertyDocumentation(QWidget &widget,
+                                    std::string const &propertyName,
+                                    const Mantid::API::IAlgorithm_sptr &alg);
 
   template <typename Widget>
   void registerSettingWidget(Widget &widget, std::string const &propertyName,
-                             Mantid::API::IAlgorithm_sptr alg);
+                             const Mantid::API::IAlgorithm_sptr &alg);
   void connectSettingsChange(QLineEdit &edit);
   void connectSettingsChange(QComboBox &edit);
   void connectSettingsChange(QCheckBox &edit);
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/QtCatalogSearcher.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/QtCatalogSearcher.cpp
index d6facb1a02f..a270d106334 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/QtCatalogSearcher.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/QtCatalogSearcher.cpp
@@ -21,7 +21,8 @@ namespace CustomInterfaces {
 namespace ISISReflectometry {
 
 namespace { // unnamed
-void removeResultsWithoutFilenameExtension(ITableWorkspace_sptr results) {
+void removeResultsWithoutFilenameExtension(
+    const ITableWorkspace_sptr &results) {
   std::set<size_t> toRemove;
   for (size_t i = 0; i < results->rowCount(); ++i) {
     std::string &run = results->String(i, 0);
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/QtRunsView.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/QtRunsView.cpp
index d654e5187db..2ac57dcdbe5 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/QtRunsView.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/QtRunsView.cpp
@@ -27,7 +27,8 @@ using namespace MantidQt::Icons;
  * @param parent :: The parent of this view
  * @param makeRunsTableView :: The factory for the RunsTableView.
  */
-QtRunsView::QtRunsView(QWidget *parent, RunsTableViewFactory makeRunsTableView)
+QtRunsView::QtRunsView(QWidget *parent,
+                       const RunsTableViewFactory &makeRunsTableView)
     : MantidWidget(parent), m_notifyee(nullptr), m_timerNotifyee(nullptr),
       m_searchNotifyee(nullptr), m_searchModel(),
       m_tableView(makeRunsTableView()), m_timer() {
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/QtRunsView.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/QtRunsView.h
index a9b16bbe383..9f50d4c262b 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/QtRunsView.h
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Runs/QtRunsView.h
@@ -33,7 +33,7 @@ class MANTIDQT_ISISREFLECTOMETRY_DLL QtRunsView
       public IRunsView {
   Q_OBJECT
 public:
-  QtRunsView(QWidget *parent, RunsTableViewFactory makeView);
+  QtRunsView(QWidget *parent, const RunsTableViewFactory &makeView);
 
   void subscribe(RunsViewSubscriber *notifyee) override;
   void subscribeTimer(RunsViewTimerSubscriber *notifyee) override;
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/RunsTable/RegexRowFilter.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/RunsTable/RegexRowFilter.cpp
index b242bc70f8c..a6b08d7016a 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/RunsTable/RegexRowFilter.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/RunsTable/RegexRowFilter.cpp
@@ -13,7 +13,7 @@ namespace ISISReflectometry {
 using MantidQt::MantidWidgets::Batch::IJobTreeView;
 using MantidQt::MantidWidgets::Batch::RowLocation;
 
-RegexFilter::RegexFilter(boost::regex regex, IJobTreeView const &view,
+RegexFilter::RegexFilter(const boost::regex &regex, IJobTreeView const &view,
                          ReductionJobs const &jobs)
     : m_filter(std::move(regex)), m_view(view), m_jobs(jobs) {}
 
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/RunsTable/RegexRowFilter.h b/qt/scientific_interfaces/ISISReflectometry/GUI/RunsTable/RegexRowFilter.h
index c95a22ef720..6c5e4564314 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/RunsTable/RegexRowFilter.h
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/RunsTable/RegexRowFilter.h
@@ -19,7 +19,7 @@ namespace ISISReflectometry {
 
 class RegexFilter : public MantidQt::MantidWidgets::Batch::RowPredicate {
 public:
-  RegexFilter(boost::regex regex,
+  RegexFilter(const boost::regex &regex,
               MantidQt::MantidWidgets::Batch::IJobTreeView const &view,
               ReductionJobs const &jobs);
   bool rowMeetsCriteria(
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Save/AsciiSaver.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Save/AsciiSaver.cpp
index cd0148060e3..80c8a48e4d1 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Save/AsciiSaver.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Save/AsciiSaver.cpp
@@ -11,6 +11,9 @@
 #include "MantidAPI/WorkspaceGroup.h"
 #include <Poco/File.h>
 #include <Poco/Path.h>
+
+#include <utility>
+
 namespace MantidQt {
 namespace CustomInterfaces {
 namespace ISISReflectometry {
@@ -65,7 +68,7 @@ bool AsciiSaver::isValidSaveDirectory(std::string const &path) const {
 
 namespace {
 template <typename T>
-void setPropertyIfSupported(Mantid::API::IAlgorithm_sptr alg,
+void setPropertyIfSupported(const Mantid::API::IAlgorithm_sptr &alg,
                             std::string const &propertyName, T const &value) {
   if (alg->existsProperty(propertyName))
     alg->setProperty(propertyName, value);
@@ -93,7 +96,7 @@ AsciiSaver::workspace(std::string const &workspaceName) const {
 
 Mantid::API::IAlgorithm_sptr
 AsciiSaver::setUpSaveAlgorithm(std::string const &saveDirectory,
-                               Mantid::API::Workspace_sptr workspace,
+                               const Mantid::API::Workspace_sptr &workspace,
                                std::vector<std::string> const &logParameters,
                                FileFormatOptions const &fileFormat) const {
   auto saveAlg = algorithmForFormat(fileFormat.format());
@@ -112,12 +115,12 @@ AsciiSaver::setUpSaveAlgorithm(std::string const &saveDirectory,
   return saveAlg;
 }
 
-void AsciiSaver::save(Mantid::API::Workspace_sptr workspace,
+void AsciiSaver::save(const Mantid::API::Workspace_sptr &workspace,
                       std::string const &saveDirectory,
                       std::vector<std::string> const &logParameters,
                       FileFormatOptions const &fileFormat) const {
-  auto alg =
-      setUpSaveAlgorithm(saveDirectory, workspace, logParameters, fileFormat);
+  auto alg = setUpSaveAlgorithm(saveDirectory, std::move(workspace),
+                                logParameters, fileFormat);
   alg->execute();
 }
 
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Save/AsciiSaver.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Save/AsciiSaver.h
index 1f028e4b52a..695674e61ef 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Save/AsciiSaver.h
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Save/AsciiSaver.h
@@ -28,7 +28,7 @@ public:
 private:
   Mantid::API::IAlgorithm_sptr
   setUpSaveAlgorithm(std::string const &saveDirectory,
-                     Mantid::API::Workspace_sptr workspace,
+                     const Mantid::API::Workspace_sptr &workspace,
                      std::vector<std::string> const &logParameters,
                      FileFormatOptions const &fileFormat) const;
 
@@ -38,7 +38,7 @@ private:
                                std::string const &extension) const;
 
   Mantid::API::Workspace_sptr workspace(std::string const &workspaceName) const;
-  void save(Mantid::API::Workspace_sptr workspace,
+  void save(const Mantid::API::Workspace_sptr &workspace,
             std::string const &saveDirectory,
             std::vector<std::string> const &logParameters,
             FileFormatOptions const &fileFormat) const;
diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Save/SavePresenter.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Save/SavePresenter.cpp
index add0b4c9e07..1c6e779087e 100644
--- a/qt/scientific_interfaces/ISISReflectometry/GUI/Save/SavePresenter.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Save/SavePresenter.cpp
@@ -135,7 +135,7 @@ void SavePresenter::filterWorkspaceNames() {
       boost::regex rgx(filter);
       it = std::copy_if(
           wsNames.begin(), wsNames.end(), validNames.begin(),
-          [rgx](std::string s) { return boost::regex_search(s, rgx); });
+          [rgx](const std::string &s) { return boost::regex_search(s, rgx); });
       m_view->showFilterEditValid();
     } catch (boost::regex_error &) {
       m_view->showFilterEditInvalid();
@@ -143,7 +143,7 @@ void SavePresenter::filterWorkspaceNames() {
   } else {
     // Otherwise simply add names where the filter string is found in
     it = std::copy_if(wsNames.begin(), wsNames.end(), validNames.begin(),
-                      [filter](std::string s) {
+                      [filter](const std::string &s) {
                         return s.find(filter) != std::string::npos;
                       });
   }
diff --git a/qt/scientific_interfaces/ISISReflectometry/Reduction/FloodCorrections.cpp b/qt/scientific_interfaces/ISISReflectometry/Reduction/FloodCorrections.cpp
index 4f5b0503d67..aba3620fb54 100644
--- a/qt/scientific_interfaces/ISISReflectometry/Reduction/FloodCorrections.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/Reduction/FloodCorrections.cpp
@@ -5,13 +5,16 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "FloodCorrections.h"
+
+#include <utility>
+
 namespace MantidQt {
 namespace CustomInterfaces {
 namespace ISISReflectometry {
 
 FloodCorrections::FloodCorrections(FloodCorrectionType correctionType,
                                    boost::optional<std::string> workspace)
-    : m_correctionType(correctionType), m_workspace(workspace) {}
+    : m_correctionType(correctionType), m_workspace(std::move(workspace)) {}
 
 FloodCorrectionType FloodCorrections::correctionType() const {
   return m_correctionType;
diff --git a/qt/scientific_interfaces/ISISReflectometry/Reduction/MonitorCorrections.cpp b/qt/scientific_interfaces/ISISReflectometry/Reduction/MonitorCorrections.cpp
index d4efc4bfca5..a4b931cb839 100644
--- a/qt/scientific_interfaces/ISISReflectometry/Reduction/MonitorCorrections.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/Reduction/MonitorCorrections.cpp
@@ -5,6 +5,9 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "MonitorCorrections.h"
+
+#include <utility>
+
 namespace MantidQt {
 namespace CustomInterfaces {
 namespace ISISReflectometry {
@@ -14,7 +17,8 @@ MonitorCorrections::MonitorCorrections(
     boost::optional<RangeInLambda> backgroundRange,
     boost::optional<RangeInLambda> integralRange)
     : m_monitorIndex(monitorIndex), m_integrate(integrate),
-      m_backgroundRange(backgroundRange), m_integralRange(integralRange) {}
+      m_backgroundRange(std::move(backgroundRange)),
+      m_integralRange(std::move(integralRange)) {}
 
 size_t MonitorCorrections::monitorIndex() const { return m_monitorIndex; }
 
diff --git a/qt/scientific_interfaces/ISISReflectometry/Reduction/RangeInQ.cpp b/qt/scientific_interfaces/ISISReflectometry/Reduction/RangeInQ.cpp
index 83d975eb033..b629cdcb190 100644
--- a/qt/scientific_interfaces/ISISReflectometry/Reduction/RangeInQ.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/Reduction/RangeInQ.cpp
@@ -6,13 +6,15 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "RangeInQ.h"
 #include <cassert>
+#include <utility>
+
 namespace MantidQt {
 namespace CustomInterfaces {
 namespace ISISReflectometry {
 
 RangeInQ::RangeInQ(boost::optional<double> min, boost::optional<double> step,
                    boost::optional<double> max)
-    : m_min(min), m_step(step), m_max(max) {
+    : m_min(std::move(min)), m_step(std::move(step)), m_max(std::move(max)) {
   assert(!(m_min.is_initialized() && m_max.is_initialized() && m_max < m_min));
 }
 
diff --git a/qt/scientific_interfaces/ISISReflectometry/Reduction/ReductionJobs.cpp b/qt/scientific_interfaces/ISISReflectometry/Reduction/ReductionJobs.cpp
index 656088bcba8..a3d92ecaeb7 100644
--- a/qt/scientific_interfaces/ISISReflectometry/Reduction/ReductionJobs.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/Reduction/ReductionJobs.cpp
@@ -288,7 +288,7 @@ ReductionJobs::getItemWithOutputWorkspaceOrNone(std::string const &wsName) {
 }
 
 Group const &ReductionJobs::getGroupFromPath(
-    const MantidWidgets::Batch::RowLocation rowLocation) const {
+    const MantidWidgets::Batch::RowLocation &rowLocation) const {
   if (isGroupLocation(rowLocation)) {
     return groups()[groupOf(rowLocation)];
   } else {
@@ -297,7 +297,7 @@ Group const &ReductionJobs::getGroupFromPath(
 }
 
 boost::optional<Row> const &ReductionJobs::getRowFromPath(
-    const MantidWidgets::Batch::RowLocation rowLocation) const {
+    const MantidWidgets::Batch::RowLocation &rowLocation) const {
   if (isRowLocation(rowLocation)) {
     return groups()[groupOf(rowLocation)].rows()[rowOf(rowLocation)];
   } else {
@@ -306,7 +306,7 @@ boost::optional<Row> const &ReductionJobs::getRowFromPath(
 }
 
 bool ReductionJobs::validItemAtPath(
-    const MantidWidgets::Batch::RowLocation rowLocation) const {
+    const MantidWidgets::Batch::RowLocation &rowLocation) const {
   if (isGroupLocation(rowLocation))
     return true;
 
@@ -314,7 +314,7 @@ bool ReductionJobs::validItemAtPath(
 }
 
 Item const &ReductionJobs::getItemFromPath(
-    const MantidWidgets::Batch::RowLocation rowLocation) const {
+    const MantidWidgets::Batch::RowLocation &rowLocation) const {
   if (isGroupLocation(rowLocation)) {
     return getGroupFromPath(rowLocation);
   } else {
diff --git a/qt/scientific_interfaces/ISISReflectometry/Reduction/ReductionJobs.h b/qt/scientific_interfaces/ISISReflectometry/Reduction/ReductionJobs.h
index 3f2c4ea7a69..030fb2033b2 100644
--- a/qt/scientific_interfaces/ISISReflectometry/Reduction/ReductionJobs.h
+++ b/qt/scientific_interfaces/ISISReflectometry/Reduction/ReductionJobs.h
@@ -47,13 +47,13 @@ public:
   getItemWithOutputWorkspaceOrNone(std::string const &wsName);
 
   bool
-  validItemAtPath(const MantidWidgets::Batch::RowLocation rowLocation) const;
+  validItemAtPath(const MantidWidgets::Batch::RowLocation &rowLocation) const;
   Group const &
-  getGroupFromPath(const MantidWidgets::Batch::RowLocation path) const;
+  getGroupFromPath(const MantidWidgets::Batch::RowLocation &path) const;
   boost::optional<Row> const &
-  getRowFromPath(const MantidWidgets::Batch::RowLocation path) const;
+  getRowFromPath(const MantidWidgets::Batch::RowLocation &path) const;
   Item const &
-  getItemFromPath(const MantidWidgets::Batch::RowLocation path) const;
+  getItemFromPath(const MantidWidgets::Batch::RowLocation &path) const;
 
 private:
   std::vector<Group> m_groups;
diff --git a/qt/scientific_interfaces/ISISReflectometry/Reduction/ReductionWorkspaces.cpp b/qt/scientific_interfaces/ISISReflectometry/Reduction/ReductionWorkspaces.cpp
index 414351f7c11..fff3cc9003e 100644
--- a/qt/scientific_interfaces/ISISReflectometry/Reduction/ReductionWorkspaces.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/Reduction/ReductionWorkspaces.cpp
@@ -5,6 +5,9 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "ReductionWorkspaces.h"
+
+#include <utility>
+
 #include "Common/Map.h"
 
 namespace MantidQt {
@@ -16,7 +19,7 @@ ReductionWorkspaces::ReductionWorkspaces(
     // cppcheck-suppress passedByValue
     TransmissionRunPair transmissionRuns)
     : m_inputRunNumbers(std::move(inputRunNumbers)),
-      m_transmissionRuns(transmissionRuns), m_iVsLambda(), m_iVsQ(),
+      m_transmissionRuns(std::move(transmissionRuns)), m_iVsLambda(), m_iVsQ(),
       m_iVsQBinned() {}
 
 std::vector<std::string> const &ReductionWorkspaces::inputRunNumbers() const {
diff --git a/qt/scientific_interfaces/ISISReflectometry/Reduction/ValidatePerThetaDefaults.cpp b/qt/scientific_interfaces/ISISReflectometry/Reduction/ValidatePerThetaDefaults.cpp
index f48a38c25fc..812ef2fdcab 100644
--- a/qt/scientific_interfaces/ISISReflectometry/Reduction/ValidatePerThetaDefaults.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/Reduction/ValidatePerThetaDefaults.cpp
@@ -28,7 +28,7 @@ public:
     return boost::none;
   }
 
-  boost::optional<T> operator()(std::vector<int> errorColumns) const {
+  boost::optional<T> operator()(const std::vector<int> &errorColumns) const {
     std::transform(errorColumns.cbegin(), errorColumns.cend(),
                    std::back_inserter(m_invalidParams),
                    [this](int column) -> int { return m_baseColumn + column; });
diff --git a/qt/scientific_interfaces/ISISReflectometry/Reduction/ValidateRow.cpp b/qt/scientific_interfaces/ISISReflectometry/Reduction/ValidateRow.cpp
index 1e08a461995..02edeee301e 100644
--- a/qt/scientific_interfaces/ISISReflectometry/Reduction/ValidateRow.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/Reduction/ValidateRow.cpp
@@ -44,7 +44,7 @@ public:
     return boost::none;
   }
 
-  boost::optional<T> operator()(std::vector<int> errorColumns) const {
+  boost::optional<T> operator()(const std::vector<int> &errorColumns) const {
     std::transform(errorColumns.cbegin(), errorColumns.cend(),
                    std::back_inserter(m_invalidParams),
                    [this](int column) -> int { return m_baseColumn + column; });
diff --git a/qt/scientific_interfaces/ISISReflectometry/TestHelpers/ModelCreationHelper.cpp b/qt/scientific_interfaces/ISISReflectometry/TestHelpers/ModelCreationHelper.cpp
index 5b0c880b253..27dc770b73f 100644
--- a/qt/scientific_interfaces/ISISReflectometry/TestHelpers/ModelCreationHelper.cpp
+++ b/qt/scientific_interfaces/ISISReflectometry/TestHelpers/ModelCreationHelper.cpp
@@ -5,6 +5,9 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "ModelCreationHelper.h"
+
+#include <utility>
+
 #include "../../ISISReflectometry/Reduction/Batch.h"
 
 namespace MantidQt {
@@ -55,7 +58,8 @@ Row makeRow(std::string const &run, double theta, std::string const &trans1,
             boost::optional<double> scale,
             ReductionOptionsMap const &optionsMap) {
   return Row({run}, theta, TransmissionRunPair({trans1, trans2}),
-             RangeInQ(qMin, qMax, qStep), scale, optionsMap,
+             RangeInQ(std::move(qMin), std::move(qMax), std::move(qStep)),
+             std::move(scale), optionsMap,
              ReductionWorkspaces({run}, TransmissionRunPair({trans1, trans2})));
 }
 
diff --git a/qt/scientific_interfaces/ISISSANS/SANSAddFiles.cpp b/qt/scientific_interfaces/ISISSANS/SANSAddFiles.cpp
index f11b53d9ef6..7f050f86aac 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSAddFiles.cpp
+++ b/qt/scientific_interfaces/ISISSANS/SANSAddFiles.cpp
@@ -175,7 +175,7 @@ QListWidgetItem *SANSAddFiles::insertListFront(const QString &text) {
  *  that users see
  *  @param dir :: full path of the output directory
  */
-void SANSAddFiles::setOutDir(std::string dir) {
+void SANSAddFiles::setOutDir(const std::string &dir) {
   m_outDir = QString::fromStdString(dir);
   m_SANSForm->summedPath_lb->setText(OUT_MSG + m_outDir);
 }
@@ -521,8 +521,10 @@ bool SANSAddFiles::checkValidityTimeShiftsForAddedEventFiles() {
  * @param lineEditText :: text for the line edit field
  * @param enabled :: if the input should be enabled.
  */
-void SANSAddFiles::setHistogramUiLogic(QString label, QString toolTip,
-                                       QString lineEditText, bool enabled) {
+void SANSAddFiles::setHistogramUiLogic(const QString &label,
+                                       const QString &toolTip,
+                                       const QString &lineEditText,
+                                       bool enabled) {
   // Line edit field
   m_SANSForm->eventToHistBinning->setText(lineEditText);
   m_SANSForm->eventToHistBinning->setToolTip(toolTip);
diff --git a/qt/scientific_interfaces/ISISSANS/SANSAddFiles.h b/qt/scientific_interfaces/ISISSANS/SANSAddFiles.h
index a03ad3a03f2..ad16cc7c93d 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSAddFiles.h
+++ b/qt/scientific_interfaces/ISISSANS/SANSAddFiles.h
@@ -55,8 +55,8 @@ private:
   /// Text for tooltip for save event data
   QString m_saveEventDataToolTip;
   /// Set the bin field
-  void setHistogramUiLogic(QString label, QString toolTip, QString lineEditText,
-                           bool enabled);
+  void setHistogramUiLogic(const QString &label, const QString &toolTip,
+                           const QString &lineEditText, bool enabled);
   /// Set the histo gram input enabled or disabled
   void setInputEnabled(bool enabled);
   /// Create Python string list
@@ -69,7 +69,7 @@ private:
   QListWidgetItem *insertListFront(const QString &text);
   void
   changeOutputDir(Mantid::Kernel::ConfigValChangeNotification_ptr pDirInfo);
-  void setOutDir(std::string dir);
+  void setOutDir(const std::string &dir);
   bool checkValidityTimeShiftsForAddedEventFiles();
 
 private slots:
diff --git a/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionSettings.cpp b/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionSettings.cpp
index 59929314117..e0aeb2f9f73 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionSettings.cpp
+++ b/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionSettings.cpp
@@ -9,7 +9,8 @@
 namespace MantidQt {
 namespace CustomInterfaces {
 SANSBackgroundCorrectionSettings::SANSBackgroundCorrectionSettings(
-    QString runNumber, bool useMean, bool useMon, QString monNumber)
+    const QString &runNumber, bool useMean, bool useMon,
+    const QString &monNumber)
     : m_runNumber(runNumber), m_useMean(useMean), m_useMon(useMon),
       m_monNumber(monNumber) {
   hasValidSettings();
diff --git a/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionSettings.h b/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionSettings.h
index 4614ee57d50..546b9a0b9d8 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionSettings.h
+++ b/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionSettings.h
@@ -19,8 +19,8 @@ the SANSBackgroundCorrectionWidget
 */
 class MANTIDQT_ISISSANS_DLL SANSBackgroundCorrectionSettings {
 public:
-  SANSBackgroundCorrectionSettings(QString runNumber, bool useMean, bool useMon,
-                                   QString monNumber);
+  SANSBackgroundCorrectionSettings(const QString &runNumber, bool useMean,
+                                   bool useMon, const QString &monNumber);
 
   bool hasValidSettings();
 
diff --git a/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionWidget.cpp b/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionWidget.cpp
index c9905f1a266..2120d89456d 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionWidget.cpp
+++ b/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionWidget.cpp
@@ -16,7 +16,8 @@ namespace {
 Mantid::Kernel::Logger g_log("SANSBackgroundCorrectionWidget");
 
 bool hasRunNumber(
-    MantidQt::CustomInterfaces::SANSBackgroundCorrectionSettings setting) {
+    const MantidQt::CustomInterfaces::SANSBackgroundCorrectionSettings
+        &setting) {
   auto hasNumber = true;
   if (setting.getRunNumber().isEmpty()) {
     hasNumber = false;
@@ -49,7 +50,7 @@ SANSBackgroundCorrectionWidget::SANSBackgroundCorrectionWidget(QWidget *parent)
  * want
  */
 void SANSBackgroundCorrectionWidget::setDarkRunSettingForTimeDetectors(
-    SANSBackgroundCorrectionSettings setting) {
+    const SANSBackgroundCorrectionSettings &setting) {
 
   if (!hasRunNumber(setting)) {
     return;
@@ -73,7 +74,7 @@ void SANSBackgroundCorrectionWidget::setDarkRunSettingForTimeDetectors(
  * want
  */
 void SANSBackgroundCorrectionWidget::setDarkRunSettingForTimeMonitors(
-    SANSBackgroundCorrectionSettings setting) {
+    const SANSBackgroundCorrectionSettings &setting) {
   if (!hasRunNumber(setting)) {
     return;
   }
@@ -97,7 +98,7 @@ void SANSBackgroundCorrectionWidget::setDarkRunSettingForTimeMonitors(
  * want
  */
 void SANSBackgroundCorrectionWidget::setDarkRunSettingForUampDetectors(
-    SANSBackgroundCorrectionSettings setting) {
+    const SANSBackgroundCorrectionSettings &setting) {
   if (!hasRunNumber(setting)) {
     return;
   }
@@ -118,7 +119,7 @@ void SANSBackgroundCorrectionWidget::setDarkRunSettingForUampDetectors(
  * want
  */
 void SANSBackgroundCorrectionWidget::setDarkRunSettingForUampMonitors(
-    SANSBackgroundCorrectionSettings setting) {
+    const SANSBackgroundCorrectionSettings &setting) {
   if (!hasRunNumber(setting)) {
     return;
   }
diff --git a/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionWidget.h b/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionWidget.h
index 52df3b2bd1c..dfe8a3550d2 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionWidget.h
+++ b/qt/scientific_interfaces/ISISSANS/SANSBackgroundCorrectionWidget.h
@@ -25,18 +25,18 @@ class MANTIDQT_ISISSANS_DLL SANSBackgroundCorrectionWidget : public QWidget {
 public:
   SANSBackgroundCorrectionWidget(QWidget *parent = nullptr);
 
-  void
-  setDarkRunSettingForTimeDetectors(SANSBackgroundCorrectionSettings setting);
+  void setDarkRunSettingForTimeDetectors(
+      const SANSBackgroundCorrectionSettings &setting);
   SANSBackgroundCorrectionSettings getDarkRunSettingForTimeDetectors();
-  void
-  setDarkRunSettingForUampDetectors(SANSBackgroundCorrectionSettings setting);
+  void setDarkRunSettingForUampDetectors(
+      const SANSBackgroundCorrectionSettings &setting);
   SANSBackgroundCorrectionSettings getDarkRunSettingForUampDetectors();
 
-  void
-  setDarkRunSettingForTimeMonitors(SANSBackgroundCorrectionSettings setting);
+  void setDarkRunSettingForTimeMonitors(
+      const SANSBackgroundCorrectionSettings &setting);
   SANSBackgroundCorrectionSettings getDarkRunSettingForTimeMonitors();
-  void
-  setDarkRunSettingForUampMonitors(SANSBackgroundCorrectionSettings setting);
+  void setDarkRunSettingForUampMonitors(
+      const SANSBackgroundCorrectionSettings &setting);
   SANSBackgroundCorrectionSettings getDarkRunSettingForUampMonitors();
 
   void resetEntries();
diff --git a/qt/scientific_interfaces/ISISSANS/SANSDiagnostics.cpp b/qt/scientific_interfaces/ISISSANS/SANSDiagnostics.cpp
index 16083b0dcfa..a315af1582f 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSDiagnostics.cpp
+++ b/qt/scientific_interfaces/ISISSANS/SANSDiagnostics.cpp
@@ -1185,7 +1185,7 @@ void SANSDiagnostics::saveSettings() {
  * @param orientation - orientation of the detector
  */
 bool SANSDiagnostics::executeSumRowColumn(
-    const std::vector<unsigned int> &values, const QString ipws,
+    const std::vector<unsigned int> &values, const QString &ipws,
     const QString &opws, const QString &orientation) {
   if (values.empty()) {
     return false;
@@ -1229,7 +1229,7 @@ bool SANSDiagnostics::executeSumRowColumn(
  * @param hvMin minimum value of
  * @param hvMax
  */
-bool SANSDiagnostics::runsumRowColumn(const QString ipwsName,
+bool SANSDiagnostics::runsumRowColumn(const QString &ipwsName,
                                       const QString &opwsName,
                                       const QString &orientation,
                                       const QString &hvMin,
@@ -1431,8 +1431,8 @@ void SANSDiagnostics::enableMaskFileControls() {
  * @returns an output workspace name
  */
 QString SANSDiagnostics::createOutputWorkspaceName(
-    QString originalWorkspaceName, QString detectorName,
-    QString integrationType, QString min, QString max) {
+    const QString &originalWorkspaceName, const QString &detectorName,
+    const QString &integrationType, const QString &min, const QString &max) {
   // Get run number from the loaded workspace
   boost::optional<int> runNumber = boost::none;
   try {
diff --git a/qt/scientific_interfaces/ISISSANS/SANSDiagnostics.h b/qt/scientific_interfaces/ISISSANS/SANSDiagnostics.h
index d305c4723f2..f3ab468401a 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSDiagnostics.h
+++ b/qt/scientific_interfaces/ISISSANS/SANSDiagnostics.h
@@ -80,7 +80,7 @@ private:
   void setToolTips();
   /// execute sumrowcolumn algorithm
   bool executeSumRowColumn(const std::vector<unsigned int> &values,
-                           const QString ipws, const QString &op,
+                           const QString &ipws, const QString &op,
                            const QString &orientation);
   /// load the settings from the registry
   void loadSettings();
@@ -99,7 +99,7 @@ private:
   bool runLoadAlgorithm(const QString &fileName, const QString &specMin = "-1",
                         const QString &specMax = "-1");
   /// returns sumrowcolumn script
-  bool runsumRowColumn(const QString ipwsName, const QString &opwsName,
+  bool runsumRowColumn(const QString &ipwsName, const QString &opwsName,
                        const QString &orientation, const QString &hvMin,
                        const QString &hvMax);
   // get rectangular detector details
@@ -173,10 +173,10 @@ private:
   void HVMinHVMaxStringValues(const int minVal, const int maxVal,
                               QString &hvMin, QString &hvMax);
   /// Create the name for the outputworkspace
-  QString createOutputWorkspaceName(QString originalWorkspaceName,
-                                    QString detectorName,
-                                    QString integrationType, QString min,
-                                    QString max);
+  QString createOutputWorkspaceName(const QString &originalWorkspaceName,
+                                    const QString &detectorName,
+                                    const QString &integrationType,
+                                    const QString &min, const QString &max);
 
 private:
   QString m_dataDir;       ///< default data search directory
diff --git a/qt/scientific_interfaces/ISISSANS/SANSEventSlicing.cpp b/qt/scientific_interfaces/ISISSANS/SANSEventSlicing.cpp
index 7c37701d140..e9f824dd02e 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSEventSlicing.cpp
+++ b/qt/scientific_interfaces/ISISSANS/SANSEventSlicing.cpp
@@ -148,7 +148,8 @@ SANSEventSlicing::runSliceEvent(const QString &code) {
   return values2ChargeAndTime(result);
 }
 
-void SANSEventSlicing::raiseWarning(QString title, QString message) {
+void SANSEventSlicing::raiseWarning(const QString &title,
+                                    const QString &message) {
   QMessageBox::warning(this, title, message);
 }
 
diff --git a/qt/scientific_interfaces/ISISSANS/SANSEventSlicing.h b/qt/scientific_interfaces/ISISSANS/SANSEventSlicing.h
index 67434d6b236..446f138a5ee 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSEventSlicing.h
+++ b/qt/scientific_interfaces/ISISSANS/SANSEventSlicing.h
@@ -39,7 +39,7 @@ private:
   ChargeAndTime runSliceEvent(const QString &code2run);
   void checkPythonOutput(const QString &result);
   ChargeAndTime values2ChargeAndTime(const QString &input);
-  void raiseWarning(QString title, QString message);
+  void raiseWarning(const QString &title, const QString &message);
 
 protected:
   void showEvent(QShowEvent * /*unused*/) override;
diff --git a/qt/scientific_interfaces/ISISSANS/SANSPlotSpecial.cpp b/qt/scientific_interfaces/ISISSANS/SANSPlotSpecial.cpp
index fd1591ea4ee..d4094c00dc4 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSPlotSpecial.cpp
+++ b/qt/scientific_interfaces/ISISSANS/SANSPlotSpecial.cpp
@@ -474,7 +474,7 @@ void SANSPlotSpecial::setupTable() {
 
 QwtPlotCurve *SANSPlotSpecial::plotMiniplot(
     QwtPlotCurve *curve,
-    boost::shared_ptr<Mantid::API::MatrixWorkspace> workspace,
+    const boost::shared_ptr<Mantid::API::MatrixWorkspace> &workspace,
     size_t workspaceIndex) {
   bool data = (curve == m_dataCurve);
 
diff --git a/qt/scientific_interfaces/ISISSANS/SANSPlotSpecial.h b/qt/scientific_interfaces/ISISSANS/SANSPlotSpecial.h
index 131e69decbc..abcddc324ee 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSPlotSpecial.h
+++ b/qt/scientific_interfaces/ISISSANS/SANSPlotSpecial.h
@@ -100,7 +100,7 @@ private:
   void createTransforms();
   QwtPlotCurve *
   plotMiniplot(QwtPlotCurve *curve,
-               boost::shared_ptr<Mantid::API::MatrixWorkspace> workspace,
+               const boost::shared_ptr<Mantid::API::MatrixWorkspace> &workspace,
                size_t workspaceIndex = 0);
 
   void deriveGuinierSpheres();
diff --git a/qt/scientific_interfaces/ISISSANS/SANSRunWindow.cpp b/qt/scientific_interfaces/ISISSANS/SANSRunWindow.cpp
index acd8be43bda..f882baace11 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSRunWindow.cpp
+++ b/qt/scientific_interfaces/ISISSANS/SANSRunWindow.cpp
@@ -45,6 +45,7 @@
 #include <boost/tuple/tuple.hpp>
 
 #include <cmath>
+#include <utility>
 
 using Mantid::detid_t;
 
@@ -159,7 +160,7 @@ QString convertBoolToPythonBoolString(bool input) {
  * @param input: the python string representation
  * @returns a true or false
  */
-bool convertPythonBoolStringToBool(QString input) {
+bool convertPythonBoolStringToBool(const QString &input) {
   bool value = false;
   if (input ==
       MantidQt::CustomInterfaces::SANSConstants::getPythonTrueKeyword()) {
@@ -173,7 +174,8 @@ bool convertPythonBoolStringToBool(QString input) {
 }
 
 void setTransmissionOnSaveCommand(
-    QString &saveCommand, Mantid::API::MatrixWorkspace_sptr matrix_workspace,
+    QString &saveCommand,
+    const Mantid::API::MatrixWorkspace_sptr &matrix_workspace,
     const QString &detectorSelection) {
   if (matrix_workspace->getInstrument()->getName() == "SANS2D")
     saveCommand += "'front-detector, rear-detector'";
@@ -1461,7 +1463,7 @@ void SANSRunWindow::appendRowToMaskTable(const QString &type,
  * @param lsdb :: The result of the sample-detector bank 2 distance
  */
 void SANSRunWindow::componentLOQDistances(
-    boost::shared_ptr<const Mantid::API::MatrixWorkspace> workspace,
+    const boost::shared_ptr<const Mantid::API::MatrixWorkspace> &workspace,
     double &lms, double &lsda, double &lsdb) {
   Instrument_const_sptr instr = workspace->getInstrument();
   if (!instr)
@@ -1882,7 +1884,7 @@ void SANSRunWindow::setGeometryDetails() {
  * @param wscode :: 0 for sample, 1 for can, others not defined
  */
 void SANSRunWindow::setSANS2DGeometry(
-    boost::shared_ptr<const Mantid::API::MatrixWorkspace> workspace,
+    const boost::shared_ptr<const Mantid::API::MatrixWorkspace> &workspace,
     int wscode) {
   const double unitconv = 1000.;
   const double distance = workspace->spectrumInfo().l1() * unitconv;
@@ -1934,11 +1936,11 @@ void SANSRunWindow::setSANS2DGeometry(
  * @param wscode :: ?????
  */
 void SANSRunWindow::setLOQGeometry(
-    boost::shared_ptr<const Mantid::API::MatrixWorkspace> workspace,
+    const boost::shared_ptr<const Mantid::API::MatrixWorkspace> &workspace,
     int wscode) {
   double dist_ms(0.0), dist_mdb(0.0), dist_hab(0.0);
   // Sample
-  componentLOQDistances(workspace, dist_ms, dist_mdb, dist_hab);
+  componentLOQDistances(std::move(workspace), dist_ms, dist_mdb, dist_hab);
 
   QHash<QString, QLabel *> &labels = m_loq_detlabels[wscode];
   QLabel *detlabel = labels.value("moderator-sample");
@@ -3687,7 +3689,7 @@ void SANSRunWindow::fillDetectNames(QComboBox *output) {
  *  @throw NotFoundError if a workspace can't be returned
  */
 Mantid::API::MatrixWorkspace_sptr
-SANSRunWindow::getGroupMember(Mantid::API::Workspace_const_sptr in,
+SANSRunWindow::getGroupMember(const Mantid::API::Workspace_const_sptr &in,
                               const int member) const {
   Mantid::API::WorkspaceGroup_const_sptr group =
       boost::dynamic_pointer_cast<const Mantid::API::WorkspaceGroup>(in);
@@ -3820,7 +3822,7 @@ void SANSRunWindow::cleanup() {
  * @param csv_line :: Add a line of csv text to the grid
  * @param separator :: An optional separator, default = ","
  */
-int SANSRunWindow::addBatchLine(QString csv_line, QString separator) {
+int SANSRunWindow::addBatchLine(const QString &csv_line, QString separator) {
   // Try to detect separator if one is not specified
   if (separator.isEmpty()) {
     if (csv_line.contains(",")) {
@@ -4688,7 +4690,7 @@ bool SANSRunWindow::areSettingsValid(States type) {
 void SANSRunWindow::checkWaveLengthAndQValues(bool &isValid, QString &message,
                                               QLineEdit *min, QLineEdit *max,
                                               QComboBox *selection,
-                                              QString type) {
+                                              const QString &type) {
   auto min_value = min->text().simplified().toDouble();
   auto max_value = max->text().simplified().toDouble();
 
@@ -4834,7 +4836,7 @@ void SANSRunWindow::retrieveQResolutionAperture() {
  * @param command: the python command to execute
  * @returns either a length (string) in mm or an empty string
  */
-QString SANSRunWindow::retrieveQResolutionGeometry(QString command) {
+QString SANSRunWindow::retrieveQResolutionGeometry(const QString &command) {
   QString result(runPythonCode(command, false));
   result = result.simplified();
   if (result == m_constants.getPythonEmptyKeyword()) {
@@ -4864,9 +4866,10 @@ void SANSRunWindow::setupQResolutionCircularAperture() {
  * @param h2: the height of the second aperture
  * @param w2: the width of the second aperture
  */
-void SANSRunWindow::setupQResolutionRectangularAperture(QString h1, QString w1,
-                                                        QString h2,
-                                                        QString w2) {
+void SANSRunWindow::setupQResolutionRectangularAperture(const QString &h1,
+                                                        const QString &w1,
+                                                        const QString &h2,
+                                                        const QString &w2) {
   // Set the QResolution Aperture
   setQResolutionApertureType(QResoluationAperture::RECTANGULAR, "H1 [mm]",
                              "H2 [mm]", h1, h2,
@@ -4914,9 +4917,9 @@ void SANSRunWindow::setupQResolutionRectangularAperture() {
  * @param w1W2Disabled: if the w1W2Inputs should be disabled
  */
 void SANSRunWindow::setQResolutionApertureType(
-    QResoluationAperture apertureType, QString a1H1Label, QString a2H2Label,
-    QString a1H1, QString a2H2, QString toolTipA1H1, QString toolTipA2H2,
-    bool w1W2Disabled) {
+    QResoluationAperture apertureType, const QString &a1H1Label,
+    const QString &a2H2Label, const QString &a1H1, const QString &a2H2,
+    const QString &toolTipA1H1, const QString &toolTipA2H2, bool w1W2Disabled) {
   // Set the labels
   m_uiForm.q_resolution_a1_h1_label->setText(a1H1Label);
   m_uiForm.q_resolution_a2_h2_label->setText(a2H2Label);
@@ -5012,7 +5015,7 @@ void SANSRunWindow::writeQResolutionSettingsToPythonScript(
  * @param py_code: the code segment to which we want to append
  */
 void SANSRunWindow::writeQResolutionSettingsToPythonScriptSingleEntry(
-    QString value, QString code_entry, const QString lineEnding,
+    const QString &value, const QString &code_entry, const QString &lineEnding,
     QString &py_code) const {
   if (!value.isEmpty()) {
     py_code += code_entry + value + lineEnding;
@@ -5125,7 +5128,8 @@ SANSRunWindow::retrieveBackgroundCorrectionSetting(bool isTime, bool isMon) {
   std::map<QString, QString> commandMap = {
       {"run_number", ""}, {"is_mean", ""}, {"is_mon", ""}, {"mon_number", ""}};
 
-  auto createPythonScript = [](bool isTime, bool isMon, QString component) {
+  auto createPythonScript = [](bool isTime, bool isMon,
+                               const QString &component) {
     return "i.get_background_correction(is_time = " +
            convertBoolToPythonBoolString(isTime) +
            ", is_mon=" + convertBoolToPythonBoolString(isMon) +
@@ -5185,7 +5189,7 @@ void SANSRunWindow::writeBackgroundCorrectionToPythonScript(
  */
 void SANSRunWindow::addBackgroundCorrectionToPythonScript(
     QString &pythonCode,
-    MantidQt::CustomInterfaces::SANSBackgroundCorrectionSettings setting,
+    const MantidQt::CustomInterfaces::SANSBackgroundCorrectionSettings &setting,
     bool isTimeBased) {
 
   QString newSetting =
diff --git a/qt/scientific_interfaces/ISISSANS/SANSRunWindow.h b/qt/scientific_interfaces/ISISSANS/SANSRunWindow.h
index 426533cd319..096cfd76365 100644
--- a/qt/scientific_interfaces/ISISSANS/SANSRunWindow.h
+++ b/qt/scientific_interfaces/ISISSANS/SANSRunWindow.h
@@ -149,14 +149,15 @@ private:
   QString readSampleObjectGUIChanges();
   /// Get the component distances
   void componentLOQDistances(
-      boost::shared_ptr<const Mantid::API::MatrixWorkspace> workspace,
+      const boost::shared_ptr<const Mantid::API::MatrixWorkspace> &workspace,
       double &lms, double &lsda, double &lsdb);
   /// Enable/disable user interaction
   void setProcessingState(const States action);
   /// Check for workspace name in the AnalysisDataService
   bool workspaceExists(const QString &ws_name) const;
   Mantid::API::MatrixWorkspace_sptr
-  getGroupMember(Mantid::API::Workspace_const_sptr in, const int member) const;
+  getGroupMember(const Mantid::API::Workspace_const_sptr &in,
+                 const int member) const;
   /// Construct a QStringList of the currently loaded workspaces
   QStringList currentWorkspaceList() const;
   /// Is the user file loaded
@@ -168,11 +169,11 @@ private:
   void setGeometryDetails();
   /// Set the SANS2D geometry
   void setSANS2DGeometry(
-      boost::shared_ptr<const Mantid::API::MatrixWorkspace> workspace,
+      const boost::shared_ptr<const Mantid::API::MatrixWorkspace> &workspace,
       int wscode);
   /// Set LOQ geometry
   void setLOQGeometry(
-      boost::shared_ptr<const Mantid::API::MatrixWorkspace> workspace,
+      const boost::shared_ptr<const Mantid::API::MatrixWorkspace> &workspace,
       int wscode);
   /// Mark an error on a label
   void markError(QLabel *label);
@@ -207,7 +208,7 @@ private:
   bool browseForFile(const QString &box_title, QLineEdit *file_field,
                      QString file_filter = QString());
   /// Add a csv line to the batch grid
-  int addBatchLine(QString csv_line, QString separator = "");
+  int addBatchLine(const QString &csv_line, QString separator = "");
   /// Save the batch file
   QString saveBatchGrid(const QString &filename = "");
   /// Check that the workspace can have the zero errors removed
@@ -445,7 +446,7 @@ private:
   /// Check setting for wavelengths and Q values
   void checkWaveLengthAndQValues(bool &isValid, QString &message,
                                  QLineEdit *min, QLineEdit *max,
-                                 QComboBox *selection, QString type);
+                                 QComboBox *selection, const QString &type);
   /// Checks if the save settings are valid for a particular workspace
   bool areSaveSettingsValid(const QString &workspaceName);
   /// Update the beam center fields
@@ -458,26 +459,29 @@ private:
   /// correct setting and displays it
   void retrieveQResolutionAperture();
   /// General getter for aperture settings of Q Resolution
-  QString retrieveQResolutionGeometry(QString command);
+  QString retrieveQResolutionGeometry(const QString &command);
   /// Write the QResolution GUI changes to a python script
   void writeQResolutionSettingsToPythonScript(QString &pythonCode);
   /// Write single line for Q Resolution
   void writeQResolutionSettingsToPythonScriptSingleEntry(
-      QString value, QString code_entry, const QString lineEnding,
-      QString &py_code) const;
+      const QString &value, const QString &code_entry,
+      const QString &lineEnding, QString &py_code) const;
   /// Sets the cirucular aperture, ie labels and populates the values with what
   /// is available from the user file
   void setupQResolutionCircularAperture();
   /// Sets the rectuanular aperture
-  void setupQResolutionRectangularAperture(QString h1, QString w1, QString h2,
-                                           QString w2);
+  void setupQResolutionRectangularAperture(const QString &h1, const QString &w1,
+                                           const QString &h2,
+                                           const QString &w2);
   /// Set the rectangular aperture
   void setupQResolutionRectangularAperture();
   /// Set the aperture type
   void setQResolutionApertureType(QResoluationAperture apertureType,
-                                  QString a1H1Label, QString a2H2Label,
-                                  QString a1H1, QString a2H2,
-                                  QString toolTipA1H1, QString toolTipA2H2,
+                                  const QString &a1H1Label,
+                                  const QString &a2H2Label, const QString &a1H1,
+                                  const QString &a2H2,
+                                  const QString &toolTipA1H1,
+                                  const QString &toolTipA2H2,
                                   bool w1W2Disabled);
   /// Initialize the QResolution settings
   void initQResolutionSettings();
@@ -494,7 +498,8 @@ private:
   /// Generic addition of background correction to python script
   void addBackgroundCorrectionToPythonScript(
       QString &pythonCode,
-      MantidQt::CustomInterfaces::SANSBackgroundCorrectionSettings setting,
+      const MantidQt::CustomInterfaces::SANSBackgroundCorrectionSettings
+          &setting,
       bool isTimeBased);
   /// Check if the user file has a valid user file extension
   bool hasUserFileValidFileExtension();
diff --git a/qt/scientific_interfaces/Indirect/AbsorptionCorrections.cpp b/qt/scientific_interfaces/Indirect/AbsorptionCorrections.cpp
index 4eb769e3248..a3e6cbf5d13 100644
--- a/qt/scientific_interfaces/Indirect/AbsorptionCorrections.cpp
+++ b/qt/scientific_interfaces/Indirect/AbsorptionCorrections.cpp
@@ -47,7 +47,7 @@ std::string extractFirstOf(std::string const &str,
   return str;
 }
 
-void setYAxisLabels(WorkspaceGroup_sptr group, std::string const &unit,
+void setYAxisLabels(const WorkspaceGroup_sptr &group, std::string const &unit,
                     std::string const &axisLabel) {
   for (auto const &workspace : *group) {
     auto matrixWs = boost::dynamic_pointer_cast<MatrixWorkspace>(workspace);
@@ -56,7 +56,8 @@ void setYAxisLabels(WorkspaceGroup_sptr group, std::string const &unit,
   }
 }
 
-void convertSpectrumAxis(MatrixWorkspace_sptr workspace, double eFixed = 0.0) {
+void convertSpectrumAxis(const MatrixWorkspace_sptr &workspace,
+                         double eFixed = 0.0) {
   auto convertAlg = AlgorithmManager::Instance().create("ConvertSpectrumAxis");
   convertAlg->initialize();
   convertAlg->setProperty("InputWorkspace", workspace);
@@ -68,7 +69,7 @@ void convertSpectrumAxis(MatrixWorkspace_sptr workspace, double eFixed = 0.0) {
   convertAlg->execute();
 }
 
-MatrixWorkspace_sptr convertUnits(MatrixWorkspace_sptr workspace,
+MatrixWorkspace_sptr convertUnits(const MatrixWorkspace_sptr &workspace,
                                   std::string const &target) {
   auto convertAlg = AlgorithmManager::Instance().create("ConvertUnits");
   convertAlg->initialize();
@@ -95,7 +96,7 @@ groupWorkspaces(std::vector<std::string> const &workspaceNames) {
   return groupAlg->getProperty("OutputWorkspace");
 }
 
-WorkspaceGroup_sptr convertUnits(WorkspaceGroup_sptr workspaceGroup,
+WorkspaceGroup_sptr convertUnits(const WorkspaceGroup_sptr &workspaceGroup,
                                  std::string const &target) {
   std::vector<std::string> convertedNames;
   convertedNames.reserve(workspaceGroup->size());
@@ -299,8 +300,8 @@ void AbsorptionCorrections::run() {
  * @param alg Algorithm to set properties of
  * @param shape Sample shape
  */
-void AbsorptionCorrections::addShapeSpecificSampleOptions(IAlgorithm_sptr alg,
-                                                          QString shape) {
+void AbsorptionCorrections::addShapeSpecificSampleOptions(
+    const IAlgorithm_sptr &alg, const QString &shape) {
 
   if (shape == "FlatPlate") {
     double const sampleHeight = m_uiForm.spFlatSampleHeight->value();
@@ -342,8 +343,8 @@ void AbsorptionCorrections::addShapeSpecificSampleOptions(IAlgorithm_sptr alg,
  * @param alg Algorithm to set properties of
  * @param shape Sample shape
  */
-void AbsorptionCorrections::addShapeSpecificCanOptions(IAlgorithm_sptr alg,
-                                                       QString const &shape) {
+void AbsorptionCorrections::addShapeSpecificCanOptions(
+    const IAlgorithm_sptr &alg, QString const &shape) {
   if (shape == "FlatPlate") {
     double const canFrontThickness = m_uiForm.spFlatCanFrontThickness->value();
     alg->setProperty("ContainerFrontThickness", canFrontThickness);
@@ -470,7 +471,7 @@ void AbsorptionCorrections::processWavelengthWorkspace() {
 }
 
 void AbsorptionCorrections::convertSpectrumAxes(
-    WorkspaceGroup_sptr correctionsWs) {
+    const WorkspaceGroup_sptr &correctionsWs) {
   auto const sampleWsName =
       m_uiForm.dsSampleInput->getCurrentDataName().toStdString();
   convertSpectrumAxes(correctionsWs, getADSMatrixWorkspace(sampleWsName));
@@ -478,7 +479,8 @@ void AbsorptionCorrections::convertSpectrumAxes(
 }
 
 void AbsorptionCorrections::convertSpectrumAxes(
-    WorkspaceGroup_sptr correctionsGroup, MatrixWorkspace_sptr sample) {
+    const WorkspaceGroup_sptr &correctionsGroup,
+    const MatrixWorkspace_sptr &sample) {
   for (auto const &workspace : *correctionsGroup) {
     auto const correction =
         boost::dynamic_pointer_cast<MatrixWorkspace>(workspace);
@@ -486,8 +488,9 @@ void AbsorptionCorrections::convertSpectrumAxes(
   }
 }
 
-void AbsorptionCorrections::convertSpectrumAxes(MatrixWorkspace_sptr correction,
-                                                MatrixWorkspace_sptr sample) {
+void AbsorptionCorrections::convertSpectrumAxes(
+    const MatrixWorkspace_sptr &correction,
+    const MatrixWorkspace_sptr &sample) {
   if (correction && sample && getEMode(sample) == "Indirect") {
     try {
       convertSpectrumAxis(correction, getEFixed(correction));
@@ -523,7 +526,7 @@ void AbsorptionCorrections::getParameterDefaults(QString const &dataName) {
 }
 
 void AbsorptionCorrections::getParameterDefaults(
-    Instrument_const_sptr instrument) {
+    const Instrument_const_sptr &instrument) {
   setBeamWidthValue(instrument, "Workflow.beam-width");
   setBeamHeightValue(instrument, "Workflow.beam-height");
   setWavelengthsValue(instrument, "Workflow.absorption-wavelengths");
@@ -533,7 +536,7 @@ void AbsorptionCorrections::getParameterDefaults(
 }
 
 void AbsorptionCorrections::setBeamWidthValue(
-    Instrument_const_sptr instrument,
+    const Instrument_const_sptr &instrument,
     std::string const &beamWidthParamName) const {
   if (instrument->hasParameter(beamWidthParamName)) {
     auto const beamWidth = QString::fromStdString(
@@ -544,7 +547,7 @@ void AbsorptionCorrections::setBeamWidthValue(
 }
 
 void AbsorptionCorrections::setBeamHeightValue(
-    Instrument_const_sptr instrument,
+    const Instrument_const_sptr &instrument,
     std::string const &beamHeightParamName) const {
   if (instrument->hasParameter(beamHeightParamName)) {
     auto const beamHeight = QString::fromStdString(
@@ -555,7 +558,7 @@ void AbsorptionCorrections::setBeamHeightValue(
 }
 
 void AbsorptionCorrections::setWavelengthsValue(
-    Instrument_const_sptr instrument,
+    const Instrument_const_sptr &instrument,
     std::string const &wavelengthsParamName) const {
   if (instrument->hasParameter(wavelengthsParamName)) {
     auto const wavelengths = QString::fromStdString(
@@ -566,7 +569,7 @@ void AbsorptionCorrections::setWavelengthsValue(
 }
 
 void AbsorptionCorrections::setEventsValue(
-    Instrument_const_sptr instrument,
+    const Instrument_const_sptr &instrument,
     std::string const &eventsParamName) const {
   if (instrument->hasParameter(eventsParamName)) {
     auto const events = QString::fromStdString(
@@ -577,7 +580,7 @@ void AbsorptionCorrections::setEventsValue(
 }
 
 void AbsorptionCorrections::setInterpolationValue(
-    Instrument_const_sptr instrument,
+    const Instrument_const_sptr &instrument,
     std::string const &interpolationParamName) const {
   if (instrument->hasParameter(interpolationParamName)) {
     auto const interpolation = QString::fromStdString(
@@ -589,7 +592,7 @@ void AbsorptionCorrections::setInterpolationValue(
 }
 
 void AbsorptionCorrections::setMaxAttemptsValue(
-    Instrument_const_sptr instrument,
+    const Instrument_const_sptr &instrument,
     std::string const &maxAttemptsParamName) const {
   if (instrument->hasParameter(maxAttemptsParamName)) {
     auto const maxScatterAttempts = QString::fromStdString(
diff --git a/qt/scientific_interfaces/Indirect/AbsorptionCorrections.h b/qt/scientific_interfaces/Indirect/AbsorptionCorrections.h
index 330a2fdb9cf..fbac43c0866 100644
--- a/qt/scientific_interfaces/Indirect/AbsorptionCorrections.h
+++ b/qt/scientific_interfaces/Indirect/AbsorptionCorrections.h
@@ -51,31 +51,39 @@ private:
   void setFileExtensionsByName(bool filter) override;
 
   void addSaveWorkspace(std::string const &wsName);
-  void addShapeSpecificSampleOptions(Mantid::API::IAlgorithm_sptr alg,
-                                     QString shape);
-  void addShapeSpecificCanOptions(Mantid::API::IAlgorithm_sptr alg,
+  void addShapeSpecificSampleOptions(const Mantid::API::IAlgorithm_sptr &alg,
+                                     const QString &shape);
+  void addShapeSpecificCanOptions(const Mantid::API::IAlgorithm_sptr &alg,
                                   QString const &shape);
 
   void processWavelengthWorkspace();
-  void convertSpectrumAxes(Mantid::API::WorkspaceGroup_sptr correctionsWs);
-  void convertSpectrumAxes(Mantid::API::WorkspaceGroup_sptr correctionsGroup,
-                           Mantid::API::MatrixWorkspace_sptr sample);
-  void convertSpectrumAxes(Mantid::API::MatrixWorkspace_sptr correction,
-                           Mantid::API::MatrixWorkspace_sptr sample);
-
-  void getParameterDefaults(Mantid::Geometry::Instrument_const_sptr instrument);
-  void setBeamWidthValue(Mantid::Geometry::Instrument_const_sptr instrument,
-                         std::string const &beamWidthParamName) const;
-  void setBeamHeightValue(Mantid::Geometry::Instrument_const_sptr instrument,
-                          std::string const &beamHeightParamName) const;
-  void setWavelengthsValue(Mantid::Geometry::Instrument_const_sptr instrument,
-                           std::string const &wavelengthsParamName) const;
-  void setEventsValue(Mantid::Geometry::Instrument_const_sptr instrument,
+  void
+  convertSpectrumAxes(const Mantid::API::WorkspaceGroup_sptr &correctionsWs);
+  void
+  convertSpectrumAxes(const Mantid::API::WorkspaceGroup_sptr &correctionsGroup,
+                      const Mantid::API::MatrixWorkspace_sptr &sample);
+  void convertSpectrumAxes(const Mantid::API::MatrixWorkspace_sptr &correction,
+                           const Mantid::API::MatrixWorkspace_sptr &sample);
+
+  void getParameterDefaults(
+      const Mantid::Geometry::Instrument_const_sptr &instrument);
+  void
+  setBeamWidthValue(const Mantid::Geometry::Instrument_const_sptr &instrument,
+                    std::string const &beamWidthParamName) const;
+  void
+  setBeamHeightValue(const Mantid::Geometry::Instrument_const_sptr &instrument,
+                     std::string const &beamHeightParamName) const;
+  void
+  setWavelengthsValue(const Mantid::Geometry::Instrument_const_sptr &instrument,
+                      std::string const &wavelengthsParamName) const;
+  void setEventsValue(const Mantid::Geometry::Instrument_const_sptr &instrument,
                       std::string const &eventsParamName) const;
-  void setInterpolationValue(Mantid::Geometry::Instrument_const_sptr instrument,
-                             std::string const &interpolationParamName) const;
-  void setMaxAttemptsValue(Mantid::Geometry::Instrument_const_sptr instrument,
-                           std::string const &maxAttemptsParamName) const;
+  void setInterpolationValue(
+      const Mantid::Geometry::Instrument_const_sptr &instrument,
+      std::string const &interpolationParamName) const;
+  void
+  setMaxAttemptsValue(const Mantid::Geometry::Instrument_const_sptr &instrument,
+                      std::string const &maxAttemptsParamName) const;
 
   void setComboBoxOptions(QComboBox *combobox,
                           std::vector<std::string> const &options);
diff --git a/qt/scientific_interfaces/Indirect/ApplyAbsorptionCorrections.cpp b/qt/scientific_interfaces/Indirect/ApplyAbsorptionCorrections.cpp
index 86940d28ec0..ba1fb9b74c6 100644
--- a/qt/scientific_interfaces/Indirect/ApplyAbsorptionCorrections.cpp
+++ b/qt/scientific_interfaces/Indirect/ApplyAbsorptionCorrections.cpp
@@ -15,6 +15,7 @@
 #include "MantidQtWidgets/Common/SignalBlocker.h"
 
 #include <QStringList>
+#include <utility>
 
 using namespace IndirectDataValidationHelper;
 using namespace Mantid::API;
@@ -370,9 +371,9 @@ void ApplyAbsorptionCorrections::run() {
  * @param toMatch Name of the workspace to match
  */
 void ApplyAbsorptionCorrections::addInterpolationStep(
-    MatrixWorkspace_sptr toInterpolate, std::string toMatch) {
+    const MatrixWorkspace_sptr &toInterpolate, std::string toMatch) {
   API::BatchAlgorithmRunner::AlgorithmRuntimeProps interpolationProps;
-  interpolationProps["WorkspaceToMatch"] = toMatch;
+  interpolationProps["WorkspaceToMatch"] = std::move(toMatch);
 
   IAlgorithm_sptr interpolationAlg =
       AlgorithmManager::Instance().create("SplineInterpolation");
diff --git a/qt/scientific_interfaces/Indirect/ApplyAbsorptionCorrections.h b/qt/scientific_interfaces/Indirect/ApplyAbsorptionCorrections.h
index 30335c7cc61..13420b73c8f 100644
--- a/qt/scientific_interfaces/Indirect/ApplyAbsorptionCorrections.h
+++ b/qt/scientific_interfaces/Indirect/ApplyAbsorptionCorrections.h
@@ -47,8 +47,9 @@ private:
   void loadSettings(const QSettings &settings) override;
   void setFileExtensionsByName(bool filter) override;
 
-  void addInterpolationStep(Mantid::API::MatrixWorkspace_sptr toInterpolate,
-                            std::string toMatch);
+  void
+  addInterpolationStep(const Mantid::API::MatrixWorkspace_sptr &toInterpolate,
+                       std::string toMatch);
   void plotInPreview(const QString &curveName,
                      Mantid::API::MatrixWorkspace_sptr &ws,
                      const QColor &curveColor);
diff --git a/qt/scientific_interfaces/Indirect/CalculatePaalmanPings.cpp b/qt/scientific_interfaces/Indirect/CalculatePaalmanPings.cpp
index 3e6ed6cd386..01166a226eb 100644
--- a/qt/scientific_interfaces/Indirect/CalculatePaalmanPings.cpp
+++ b/qt/scientific_interfaces/Indirect/CalculatePaalmanPings.cpp
@@ -572,7 +572,7 @@ void CalculatePaalmanPings::getBeamWidthFromWorkspace(const QString &wsName) {
  *                      boost::none.
  */
 boost::optional<double> CalculatePaalmanPings::getInstrumentParameter(
-    Mantid::Geometry::Instrument_const_sptr instrument,
+    const Mantid::Geometry::Instrument_const_sptr &instrument,
     const std::string &parameterName) {
 
   if (instrument->hasParameter(parameterName)) {
@@ -589,8 +589,8 @@ boost::optional<double> CalculatePaalmanPings::getInstrumentParameter(
  * @param alg Algorithm to set properties of
  * @param shape Sample shape
  */
-void CalculatePaalmanPings::addShapeSpecificSampleOptions(IAlgorithm_sptr alg,
-                                                          QString shape) {
+void CalculatePaalmanPings::addShapeSpecificSampleOptions(
+    const IAlgorithm_sptr &alg, const QString &shape) {
   if (shape == "FlatPlate") {
     const auto sampleThickness = m_uiForm.spFlatSampleThickness->value();
     alg->setProperty("SampleThickness", sampleThickness);
@@ -635,8 +635,8 @@ void CalculatePaalmanPings::addShapeSpecificSampleOptions(IAlgorithm_sptr alg,
  * @param alg Algorithm to set properties of
  * @param shape Sample shape
  */
-void CalculatePaalmanPings::addShapeSpecificCanOptions(IAlgorithm_sptr alg,
-                                                       QString shape) {
+void CalculatePaalmanPings::addShapeSpecificCanOptions(
+    const IAlgorithm_sptr &alg, const QString &shape) {
   if (shape == "FlatPlate") {
     const auto canFrontThickness = m_uiForm.spFlatCanFrontThickness->value();
     alg->setProperty("CanFrontThickness", canFrontThickness);
diff --git a/qt/scientific_interfaces/Indirect/CalculatePaalmanPings.h b/qt/scientific_interfaces/Indirect/CalculatePaalmanPings.h
index dda97d5a3b2..907f9490186 100644
--- a/qt/scientific_interfaces/Indirect/CalculatePaalmanPings.h
+++ b/qt/scientific_interfaces/Indirect/CalculatePaalmanPings.h
@@ -51,10 +51,10 @@ private:
 
   bool doValidation(bool silent = false);
 
-  void addShapeSpecificSampleOptions(Mantid::API::IAlgorithm_sptr alg,
-                                     QString shape);
-  void addShapeSpecificCanOptions(Mantid::API::IAlgorithm_sptr alg,
-                                  QString shape);
+  void addShapeSpecificSampleOptions(const Mantid::API::IAlgorithm_sptr &alg,
+                                     const QString &shape);
+  void addShapeSpecificCanOptions(const Mantid::API::IAlgorithm_sptr &alg,
+                                  const QString &shape);
 
   void setComboBoxOptions(QComboBox *combobox,
                           std::vector<std::string> const &options);
@@ -71,9 +71,9 @@ private:
   void setButtonsEnabled(bool enabled);
   void setRunIsRunning(bool running);
 
-  boost::optional<double>
-  getInstrumentParameter(Mantid::Geometry::Instrument_const_sptr instrument,
-                         const std::string &parameterName);
+  boost::optional<double> getInstrumentParameter(
+      const Mantid::Geometry::Instrument_const_sptr &instrument,
+      const std::string &parameterName);
 
   Ui::CalculatePaalmanPings m_uiForm;
 
diff --git a/qt/scientific_interfaces/Indirect/ContainerSubtraction.cpp b/qt/scientific_interfaces/Indirect/ContainerSubtraction.cpp
index 65bf7a458ad..d917718b4a2 100644
--- a/qt/scientific_interfaces/Indirect/ContainerSubtraction.cpp
+++ b/qt/scientific_interfaces/Indirect/ContainerSubtraction.cpp
@@ -5,6 +5,9 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "ContainerSubtraction.h"
+
+#include <utility>
+
 #include "MantidQtWidgets/Common/UserInputValidator.h"
 
 #include "MantidAPI/Axis.h"
@@ -58,12 +61,12 @@ ContainerSubtraction::~ContainerSubtraction() {
 
 void ContainerSubtraction::setTransformedContainer(
     MatrixWorkspace_sptr workspace, const std::string &name) {
-  m_transformedContainerWS = workspace;
+  m_transformedContainerWS = std::move(workspace);
   AnalysisDataService::Instance().addOrReplace(name, m_transformedContainerWS);
 }
 
 void ContainerSubtraction::setTransformedContainer(
-    MatrixWorkspace_sptr workspace) {
+    const MatrixWorkspace_sptr &workspace) {
   m_transformedContainerWS = workspace;
   AnalysisDataService::Instance().addOrReplace(workspace->getName(),
                                                m_transformedContainerWS);
@@ -456,46 +459,48 @@ MatrixWorkspace_sptr ContainerSubtraction::requestRebinToSample(
 }
 
 MatrixWorkspace_sptr
-ContainerSubtraction::shiftWorkspace(MatrixWorkspace_sptr workspace,
+ContainerSubtraction::shiftWorkspace(const MatrixWorkspace_sptr &workspace,
                                      double shiftValue) const {
-  auto shiftAlg = shiftAlgorithm(workspace, shiftValue);
+  auto shiftAlg = shiftAlgorithm(std::move(workspace), shiftValue);
   shiftAlg->execute();
   return shiftAlg->getProperty("OutputWorkspace");
 }
 
 MatrixWorkspace_sptr
-ContainerSubtraction::scaleWorkspace(MatrixWorkspace_sptr workspace,
+ContainerSubtraction::scaleWorkspace(const MatrixWorkspace_sptr &workspace,
                                      double scaleValue) const {
-  auto scaleAlg = scaleAlgorithm(workspace, scaleValue);
+  auto scaleAlg = scaleAlgorithm(std::move(workspace), scaleValue);
   scaleAlg->execute();
   return scaleAlg->getProperty("OutputWorkspace");
 }
 
-MatrixWorkspace_sptr
-ContainerSubtraction::minusWorkspace(MatrixWorkspace_sptr lhsWorkspace,
-                                     MatrixWorkspace_sptr rhsWorkspace) const {
-  auto minusAlg = minusAlgorithm(lhsWorkspace, rhsWorkspace);
+MatrixWorkspace_sptr ContainerSubtraction::minusWorkspace(
+    const MatrixWorkspace_sptr &lhsWorkspace,
+    const MatrixWorkspace_sptr &rhsWorkspace) const {
+  auto minusAlg =
+      minusAlgorithm(std::move(lhsWorkspace), std::move(rhsWorkspace));
   minusAlg->execute();
   return minusAlg->getProperty("OutputWorkspace");
 }
 
 MatrixWorkspace_sptr ContainerSubtraction::rebinToWorkspace(
-    MatrixWorkspace_sptr workspaceToRebin,
-    MatrixWorkspace_sptr workspaceToMatch) const {
-  auto rebinAlg = rebinToWorkspaceAlgorithm(workspaceToRebin, workspaceToMatch);
+    const MatrixWorkspace_sptr &workspaceToRebin,
+    const MatrixWorkspace_sptr &workspaceToMatch) const {
+  auto rebinAlg = rebinToWorkspaceAlgorithm(std::move(workspaceToRebin),
+                                            std::move(workspaceToMatch));
   rebinAlg->execute();
   return rebinAlg->getProperty("OutputWorkspace");
 }
 
-MatrixWorkspace_sptr
-ContainerSubtraction::convertToHistogram(MatrixWorkspace_sptr workspace) const {
-  auto convertAlg = convertToHistogramAlgorithm(workspace);
+MatrixWorkspace_sptr ContainerSubtraction::convertToHistogram(
+    const MatrixWorkspace_sptr &workspace) const {
+  auto convertAlg = convertToHistogramAlgorithm(std::move(workspace));
   convertAlg->execute();
   return convertAlg->getProperty("OutputWorkspace");
 }
 
 IAlgorithm_sptr
-ContainerSubtraction::shiftAlgorithm(MatrixWorkspace_sptr workspace,
+ContainerSubtraction::shiftAlgorithm(const MatrixWorkspace_sptr &workspace,
                                      double shiftValue) const {
   IAlgorithm_sptr shift = AlgorithmManager::Instance().create("ScaleX");
   shift->initialize();
@@ -509,7 +514,7 @@ ContainerSubtraction::shiftAlgorithm(MatrixWorkspace_sptr workspace,
 }
 
 IAlgorithm_sptr
-ContainerSubtraction::scaleAlgorithm(MatrixWorkspace_sptr workspace,
+ContainerSubtraction::scaleAlgorithm(const MatrixWorkspace_sptr &workspace,
                                      double scaleValue) const {
   IAlgorithm_sptr scale = AlgorithmManager::Instance().create("Scale");
   scale->initialize();
@@ -522,9 +527,9 @@ ContainerSubtraction::scaleAlgorithm(MatrixWorkspace_sptr workspace,
   return scale;
 }
 
-IAlgorithm_sptr
-ContainerSubtraction::minusAlgorithm(MatrixWorkspace_sptr lhsWorkspace,
-                                     MatrixWorkspace_sptr rhsWorkspace) const {
+IAlgorithm_sptr ContainerSubtraction::minusAlgorithm(
+    const MatrixWorkspace_sptr &lhsWorkspace,
+    const MatrixWorkspace_sptr &rhsWorkspace) const {
   IAlgorithm_sptr minus = AlgorithmManager::Instance().create("Minus");
   minus->initialize();
   minus->setChild(true);
@@ -536,8 +541,8 @@ ContainerSubtraction::minusAlgorithm(MatrixWorkspace_sptr lhsWorkspace,
 }
 
 IAlgorithm_sptr ContainerSubtraction::rebinToWorkspaceAlgorithm(
-    MatrixWorkspace_sptr workspaceToRebin,
-    MatrixWorkspace_sptr workspaceToMatch) const {
+    const MatrixWorkspace_sptr &workspaceToRebin,
+    const MatrixWorkspace_sptr &workspaceToMatch) const {
   IAlgorithm_sptr rebin =
       AlgorithmManager::Instance().create("RebinToWorkspace");
   rebin->initialize();
@@ -550,7 +555,7 @@ IAlgorithm_sptr ContainerSubtraction::rebinToWorkspaceAlgorithm(
 }
 
 IAlgorithm_sptr ContainerSubtraction::convertToHistogramAlgorithm(
-    MatrixWorkspace_sptr workspace) const {
+    const MatrixWorkspace_sptr &workspace) const {
   IAlgorithm_sptr convert =
       AlgorithmManager::Instance().create("ConvertToHistogram");
   convert->initialize();
@@ -562,7 +567,7 @@ IAlgorithm_sptr ContainerSubtraction::convertToHistogramAlgorithm(
 }
 
 IAlgorithm_sptr ContainerSubtraction::addSampleLogAlgorithm(
-    MatrixWorkspace_sptr workspace, const std::string &name,
+    const MatrixWorkspace_sptr &workspace, const std::string &name,
     const std::string &type, const std::string &value) const {
   IAlgorithm_sptr shiftLog =
       AlgorithmManager::Instance().create("AddSampleLog");
diff --git a/qt/scientific_interfaces/Indirect/ContainerSubtraction.h b/qt/scientific_interfaces/Indirect/ContainerSubtraction.h
index 2a8a230b3ba..2821e893d53 100644
--- a/qt/scientific_interfaces/Indirect/ContainerSubtraction.h
+++ b/qt/scientific_interfaces/Indirect/ContainerSubtraction.h
@@ -20,7 +20,8 @@ public:
 
   void setTransformedContainer(Mantid::API::MatrixWorkspace_sptr workspace,
                                const std::string &name);
-  void setTransformedContainer(Mantid::API::MatrixWorkspace_sptr workspace);
+  void
+  setTransformedContainer(const Mantid::API::MatrixWorkspace_sptr &workspace);
 
 private slots:
   /// Handles a new sample being loaded
@@ -57,36 +58,36 @@ private:
   requestRebinToSample(Mantid::API::MatrixWorkspace_sptr workspace) const;
 
   Mantid::API::MatrixWorkspace_sptr
-  shiftWorkspace(Mantid::API::MatrixWorkspace_sptr workspace,
+  shiftWorkspace(const Mantid::API::MatrixWorkspace_sptr &workspace,
                  double shiftValue) const;
   Mantid::API::MatrixWorkspace_sptr
-  scaleWorkspace(Mantid::API::MatrixWorkspace_sptr workspace,
+  scaleWorkspace(const Mantid::API::MatrixWorkspace_sptr &workspace,
                  double scaleValue) const;
   Mantid::API::MatrixWorkspace_sptr
-  minusWorkspace(Mantid::API::MatrixWorkspace_sptr lhsWorkspace,
-                 Mantid::API::MatrixWorkspace_sptr rhsWorkspace) const;
+  minusWorkspace(const Mantid::API::MatrixWorkspace_sptr &lhsWorkspace,
+                 const Mantid::API::MatrixWorkspace_sptr &rhsWorkspace) const;
+  Mantid::API::MatrixWorkspace_sptr rebinToWorkspace(
+      const Mantid::API::MatrixWorkspace_sptr &workspaceToRebin,
+      const Mantid::API::MatrixWorkspace_sptr &workspaceToMatch) const;
   Mantid::API::MatrixWorkspace_sptr
-  rebinToWorkspace(Mantid::API::MatrixWorkspace_sptr workspaceToRebin,
-                   Mantid::API::MatrixWorkspace_sptr workspaceToMatch) const;
-  Mantid::API::MatrixWorkspace_sptr
-  convertToHistogram(Mantid::API::MatrixWorkspace_sptr workspace) const;
+  convertToHistogram(const Mantid::API::MatrixWorkspace_sptr &workspace) const;
 
   Mantid::API::IAlgorithm_sptr
-  shiftAlgorithm(Mantid::API::MatrixWorkspace_sptr workspace,
+  shiftAlgorithm(const Mantid::API::MatrixWorkspace_sptr &workspace,
                  double shiftValue) const;
   Mantid::API::IAlgorithm_sptr
-  scaleAlgorithm(Mantid::API::MatrixWorkspace_sptr workspace,
+  scaleAlgorithm(const Mantid::API::MatrixWorkspace_sptr &workspace,
                  double scaleValue) const;
   Mantid::API::IAlgorithm_sptr
-  minusAlgorithm(Mantid::API::MatrixWorkspace_sptr lhsWorkspace,
-                 Mantid::API::MatrixWorkspace_sptr rhsWorkspace) const;
+  minusAlgorithm(const Mantid::API::MatrixWorkspace_sptr &lhsWorkspace,
+                 const Mantid::API::MatrixWorkspace_sptr &rhsWorkspace) const;
   Mantid::API::IAlgorithm_sptr rebinToWorkspaceAlgorithm(
-      Mantid::API::MatrixWorkspace_sptr workspaceToRebin,
-      Mantid::API::MatrixWorkspace_sptr workspaceToMatch) const;
+      const Mantid::API::MatrixWorkspace_sptr &workspaceToRebin,
+      const Mantid::API::MatrixWorkspace_sptr &workspaceToMatch) const;
   Mantid::API::IAlgorithm_sptr convertToHistogramAlgorithm(
-      Mantid::API::MatrixWorkspace_sptr workspace) const;
+      const Mantid::API::MatrixWorkspace_sptr &workspace) const;
   Mantid::API::IAlgorithm_sptr
-  addSampleLogAlgorithm(Mantid::API::MatrixWorkspace_sptr workspace,
+  addSampleLogAlgorithm(const Mantid::API::MatrixWorkspace_sptr &workspace,
                         const std::string &name, const std::string &type,
                         const std::string &value) const;
 
diff --git a/qt/scientific_interfaces/Indirect/ConvFitAddWorkspaceDialog.cpp b/qt/scientific_interfaces/Indirect/ConvFitAddWorkspaceDialog.cpp
index ddfc5f93878..16f7e273429 100644
--- a/qt/scientific_interfaces/Indirect/ConvFitAddWorkspaceDialog.cpp
+++ b/qt/scientific_interfaces/Indirect/ConvFitAddWorkspaceDialog.cpp
@@ -11,6 +11,7 @@
 #include "MantidQtWidgets/Common/SignalBlocker.h"
 
 #include <boost/optional.hpp>
+#include <utility>
 
 namespace {
 using namespace Mantid::API;
@@ -27,7 +28,8 @@ bool validWorkspace(std::string const &name) {
   return !name.empty() && doesExistInADS(name);
 }
 
-boost::optional<std::size_t> maximumIndex(MatrixWorkspace_sptr workspace) {
+boost::optional<std::size_t>
+maximumIndex(const MatrixWorkspace_sptr &workspace) {
   if (workspace) {
     const auto numberOfHistograms = workspace->getNumberHistograms();
     if (numberOfHistograms > 0)
@@ -36,8 +38,8 @@ boost::optional<std::size_t> maximumIndex(MatrixWorkspace_sptr workspace) {
   return boost::none;
 }
 
-QString getIndexString(MatrixWorkspace_sptr workspace) {
-  const auto maximum = maximumIndex(workspace);
+QString getIndexString(const MatrixWorkspace_sptr &workspace) {
+  const auto maximum = maximumIndex(std::move(workspace));
   if (maximum)
     return QString("0-%1").arg(*maximum);
   return "";
diff --git a/qt/scientific_interfaces/Indirect/ConvFitModel.cpp b/qt/scientific_interfaces/Indirect/ConvFitModel.cpp
index 2c10111356b..8e2af45fa01 100644
--- a/qt/scientific_interfaces/Indirect/ConvFitModel.cpp
+++ b/qt/scientific_interfaces/Indirect/ConvFitModel.cpp
@@ -14,6 +14,7 @@
 #include <boost/algorithm/string/join.hpp>
 
 #include <stdexcept>
+#include <utility>
 
 using namespace Mantid::API;
 
@@ -38,7 +39,7 @@ IAlgorithm_sptr loadParameterFileAlgorithm(std::string const &workspaceName,
 }
 
 void readAnalyserFromFile(const std::string &analyser,
-                          MatrixWorkspace_sptr workspace) {
+                          const MatrixWorkspace_sptr &workspace) {
   auto const instrument = workspace->getInstrument();
   auto const idfDirectory = Mantid::Kernel::ConfigService::Instance().getString(
       "instrumentDefinition.directory");
@@ -57,7 +58,7 @@ void readAnalyserFromFile(const std::string &analyser,
 }
 
 Mantid::Geometry::IComponent_const_sptr
-getAnalyser(MatrixWorkspace_sptr workspace) {
+getAnalyser(const MatrixWorkspace_sptr &workspace) {
   auto const instrument = workspace->getInstrument();
   auto const analysers = instrument->getStringParameter("analyser");
 
@@ -79,7 +80,8 @@ getAnalyser(MatrixWorkspace_sptr workspace) {
   return instrument->getComponentByName(analysers[0]);
 }
 
-boost::optional<double> instrumentResolution(MatrixWorkspace_sptr workspace) {
+boost::optional<double>
+instrumentResolution(const MatrixWorkspace_sptr &workspace) {
   try {
     auto const analyser = getAnalyser(workspace);
     if (analyser && analyser->hasParameter("resolution"))
@@ -101,7 +103,7 @@ boost::optional<double> instrumentResolution(MatrixWorkspace_sptr workspace) {
   }
 }
 
-MatrixWorkspace_sptr cloneWorkspace(MatrixWorkspace_sptr inputWS,
+MatrixWorkspace_sptr cloneWorkspace(const MatrixWorkspace_sptr &inputWS,
                                     std::string const &outputName) {
   auto cloneAlg = AlgorithmManager::Instance().create("CloneWorkspace");
   cloneAlg->setLogging(false);
@@ -112,8 +114,8 @@ MatrixWorkspace_sptr cloneWorkspace(MatrixWorkspace_sptr inputWS,
   return getADSMatrixWorkspace(outputName);
 }
 
-MatrixWorkspace_sptr appendWorkspace(MatrixWorkspace_sptr leftWS,
-                                     MatrixWorkspace_sptr rightWS,
+MatrixWorkspace_sptr appendWorkspace(const MatrixWorkspace_sptr &leftWS,
+                                     const MatrixWorkspace_sptr &rightWS,
                                      int numHistograms,
                                      std::string const &outputName) {
   auto appendAlg = AlgorithmManager::Instance().create("AppendSpectra");
@@ -144,7 +146,7 @@ void deleteWorkspace(std::string const &workspaceName) {
   deleter->execute();
 }
 
-void extendResolutionWorkspace(MatrixWorkspace_sptr resolution,
+void extendResolutionWorkspace(const MatrixWorkspace_sptr &resolution,
                                std::size_t numberOfHistograms,
                                std::string const &outputName) {
   const auto resolutionNumHist = resolution->getNumberHistograms();
@@ -257,7 +259,7 @@ constructParameterNameChanges(const IFunction &model,
   }
 }
 
-IAlgorithm_sptr addSampleLogAlgorithm(Workspace_sptr workspace,
+IAlgorithm_sptr addSampleLogAlgorithm(const Workspace_sptr &workspace,
                                       const std::string &name,
                                       const std::string &text,
                                       const std::string &type) {
@@ -273,7 +275,8 @@ IAlgorithm_sptr addSampleLogAlgorithm(Workspace_sptr workspace,
 struct AddSampleLogRunner {
   AddSampleLogRunner(Workspace_sptr resultWorkspace,
                      WorkspaceGroup_sptr resultGroup)
-      : m_resultWorkspace(resultWorkspace), m_resultGroup(resultGroup) {}
+      : m_resultWorkspace(std::move(resultWorkspace)),
+        m_resultGroup(std::move(resultGroup)) {}
 
   void operator()(const std::string &name, const std::string &text,
                   const std::string &type) {
@@ -291,15 +294,15 @@ getNames(const MantidQt::CustomInterfaces::IDA::ResolutionCollectionType
              &workspaces) {
   std::vector<std::string> names;
   names.reserve(workspaces.size().value);
-  std::transform(workspaces.begin(), workspaces.end(),
-                 std::back_inserter(names),
-                 [](boost::weak_ptr<Mantid::API::MatrixWorkspace> workspace) {
-                   return workspace.lock()->getName();
-                 });
+  std::transform(
+      workspaces.begin(), workspaces.end(), std::back_inserter(names),
+      [](const boost::weak_ptr<Mantid::API::MatrixWorkspace> &workspace) {
+        return workspace.lock()->getName();
+      });
   return names;
 }
 
-void setResolutionAttribute(CompositeFunction_sptr convolutionModel,
+void setResolutionAttribute(const CompositeFunction_sptr &convolutionModel,
                             const IFunction::Attribute &attr) {
   if (convolutionModel->name() == "Convolution")
     convolutionModel->getFunction(0)->setAttribute("Workspace", attr);
@@ -425,7 +428,7 @@ void ConvFitModel::setResolution(const std::string &name,
     throw std::runtime_error("A valid resolution file needs to be selected.");
 }
 
-void ConvFitModel::setResolution(MatrixWorkspace_sptr resolution,
+void ConvFitModel::setResolution(const MatrixWorkspace_sptr &resolution,
                                  TableDatasetIndex index) {
   if (m_resolution.size() > index)
     m_resolution[index] = resolution;
@@ -556,7 +559,7 @@ void ConvFitModel::addOutput(IndirectFitOutput *fitOutput,
 void ConvFitModel::setParameterNameChanges(
     const IFunction &model, boost::optional<std::size_t> backgroundIndex) {
   m_parameterNameChanges = constructParameterNameChanges(
-      model, backgroundIndex, m_temperature.is_initialized());
+      model, std::move(backgroundIndex), m_temperature.is_initialized());
 }
 
 std::vector<std::pair<std::string, int>>
diff --git a/qt/scientific_interfaces/Indirect/ConvFitModel.h b/qt/scientific_interfaces/Indirect/ConvFitModel.h
index 7779f692642..c1e01b72876 100644
--- a/qt/scientific_interfaces/Indirect/ConvFitModel.h
+++ b/qt/scientific_interfaces/Indirect/ConvFitModel.h
@@ -41,7 +41,7 @@ public:
                     const Spectra &spectra) override;
   void removeWorkspace(TableDatasetIndex index) override;
   void setResolution(const std::string &name, TableDatasetIndex index);
-  void setResolution(Mantid::API::MatrixWorkspace_sptr resolution,
+  void setResolution(const Mantid::API::MatrixWorkspace_sptr &resolution,
                      TableDatasetIndex index);
   void setFitTypeString(const std::string &fitType);
 
diff --git a/qt/scientific_interfaces/Indirect/CorrectionsTab.cpp b/qt/scientific_interfaces/Indirect/CorrectionsTab.cpp
index 20f11e3de5e..4e0918d4721 100644
--- a/qt/scientific_interfaces/Indirect/CorrectionsTab.cpp
+++ b/qt/scientific_interfaces/Indirect/CorrectionsTab.cpp
@@ -74,7 +74,8 @@ void CorrectionsTab::inputChanged() { validate(); }
  * @throws std::runtime_error if one of the workspaces is an invalid pointer
  */
 bool CorrectionsTab::checkWorkspaceBinningMatches(
-    MatrixWorkspace_const_sptr left, MatrixWorkspace_const_sptr right) {
+    const MatrixWorkspace_const_sptr &left,
+    const MatrixWorkspace_const_sptr &right) {
   if (left && right) // check the workspaces actually point to something first
   {
     const auto &leftX = left->x(0);
@@ -100,7 +101,7 @@ bool CorrectionsTab::checkWorkspaceBinningMatches(
  * @return Name of output workspace
  */
 boost::optional<std::string> CorrectionsTab::addConvertUnitsStep(
-    MatrixWorkspace_sptr ws, std::string const &unitID,
+    const MatrixWorkspace_sptr &ws, std::string const &unitID,
     std::string const &suffix, std::string eMode, double eFixed) {
   std::string outputName = ws->getName();
 
diff --git a/qt/scientific_interfaces/Indirect/CorrectionsTab.h b/qt/scientific_interfaces/Indirect/CorrectionsTab.h
index c26de73e64e..665934445bc 100644
--- a/qt/scientific_interfaces/Indirect/CorrectionsTab.h
+++ b/qt/scientific_interfaces/Indirect/CorrectionsTab.h
@@ -84,12 +84,12 @@ public:
 
 protected:
   /// Check the binning between two workspaces match
-  bool
-  checkWorkspaceBinningMatches(Mantid::API::MatrixWorkspace_const_sptr left,
-                               Mantid::API::MatrixWorkspace_const_sptr right);
+  bool checkWorkspaceBinningMatches(
+      const Mantid::API::MatrixWorkspace_const_sptr &left,
+      const Mantid::API::MatrixWorkspace_const_sptr &right);
   /// Adds a unit conversion step to the algorithm queue
   boost::optional<std::string>
-  addConvertUnitsStep(Mantid::API::MatrixWorkspace_sptr ws,
+  addConvertUnitsStep(const Mantid::API::MatrixWorkspace_sptr &ws,
                       const std::string &unitID,
                       const std::string &suffix = "UNIT",
                       std::string eMode = "", double eFixed = 0.0);
diff --git a/qt/scientific_interfaces/Indirect/Elwin.cpp b/qt/scientific_interfaces/Indirect/Elwin.cpp
index d25764868d2..93bece3aef0 100644
--- a/qt/scientific_interfaces/Indirect/Elwin.cpp
+++ b/qt/scientific_interfaces/Indirect/Elwin.cpp
@@ -384,8 +384,9 @@ void Elwin::setFileExtensionsByName(bool filter) {
                                                   : getExtensions(tabName));
 }
 
-void Elwin::setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws,
-                                 const QPair<double, double> &range) {
+void Elwin::setDefaultResolution(
+    const Mantid::API::MatrixWorkspace_const_sptr &ws,
+    const QPair<double, double> &range) {
   auto inst = ws->getInstrument();
   auto analyser = inst->getStringParameter("analyser");
 
@@ -414,7 +415,8 @@ void Elwin::setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws,
   }
 }
 
-void Elwin::setDefaultSampleLog(Mantid::API::MatrixWorkspace_const_sptr ws) {
+void Elwin::setDefaultSampleLog(
+    const Mantid::API::MatrixWorkspace_const_sptr &ws) {
   auto inst = ws->getInstrument();
   // Set sample environment log name
   auto log = inst->getStringParameter("Workflow.SE-log");
diff --git a/qt/scientific_interfaces/Indirect/Elwin.h b/qt/scientific_interfaces/Indirect/Elwin.h
index 0c66b5b6805..40a87b96c83 100644
--- a/qt/scientific_interfaces/Indirect/Elwin.h
+++ b/qt/scientific_interfaces/Indirect/Elwin.h
@@ -40,9 +40,9 @@ private:
   void loadSettings(const QSettings &settings) override;
   void setFileExtensionsByName(bool filter) override;
   void setBrowserWorkspace() override{};
-  void setDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws,
+  void setDefaultResolution(const Mantid::API::MatrixWorkspace_const_sptr &ws,
                             const QPair<double, double> &range);
-  void setDefaultSampleLog(Mantid::API::MatrixWorkspace_const_sptr ws);
+  void setDefaultSampleLog(const Mantid::API::MatrixWorkspace_const_sptr &ws);
 
   void checkForELTWorkspace();
 
diff --git a/qt/scientific_interfaces/Indirect/ILLEnergyTransfer.cpp b/qt/scientific_interfaces/Indirect/ILLEnergyTransfer.cpp
index bb56ecc89ac..6da405dd977 100644
--- a/qt/scientific_interfaces/Indirect/ILLEnergyTransfer.cpp
+++ b/qt/scientific_interfaces/Indirect/ILLEnergyTransfer.cpp
@@ -386,8 +386,8 @@ void ILLEnergyTransfer::setRunEnabled(bool enabled) {
 
 void ILLEnergyTransfer::updateRunButton(bool enabled,
                                         std::string const &enableOutputButtons,
-                                        QString const message,
-                                        QString const tooltip) {
+                                        QString const &message,
+                                        QString const &tooltip) {
   UNUSED_ARG(enableOutputButtons);
   setRunEnabled(enabled);
   m_uiForm.pbRun->setText(message);
diff --git a/qt/scientific_interfaces/Indirect/ILLEnergyTransfer.h b/qt/scientific_interfaces/Indirect/ILLEnergyTransfer.h
index c7f253575a4..3ac3e459575 100644
--- a/qt/scientific_interfaces/Indirect/ILLEnergyTransfer.h
+++ b/qt/scientific_interfaces/Indirect/ILLEnergyTransfer.h
@@ -39,8 +39,8 @@ private slots:
   void setRunEnabled(bool enabled);
   void updateRunButton(bool enabled = true,
                        std::string const &enableOutputButtons = "unchanged",
-                       QString const message = "Run",
-                       QString const tooltip = "");
+                       QString const &message = "Run",
+                       QString const &tooltip = "");
 
 private:
   Ui::ILLEnergyTransfer m_uiForm;
diff --git a/qt/scientific_interfaces/Indirect/ISISCalibration.cpp b/qt/scientific_interfaces/Indirect/ISISCalibration.cpp
index d4b0a47ae26..fb906d2b395 100644
--- a/qt/scientific_interfaces/Indirect/ISISCalibration.cpp
+++ b/qt/scientific_interfaces/Indirect/ISISCalibration.cpp
@@ -522,7 +522,8 @@ void ISISCalibration::calPlotEnergy() {
  *
  * @param ws :: Mantid workspace containing the loaded instrument
  */
-void ISISCalibration::calSetDefaultResolution(MatrixWorkspace_const_sptr ws) {
+void ISISCalibration::calSetDefaultResolution(
+    const MatrixWorkspace_const_sptr &ws) {
   auto inst = ws->getInstrument();
   auto analyser = inst->getStringParameter("analyser");
 
@@ -816,8 +817,8 @@ void ISISCalibration::setSaveEnabled(bool enabled) {
 
 void ISISCalibration::updateRunButton(bool enabled,
                                       std::string const &enableOutputButtons,
-                                      QString const message,
-                                      QString const tooltip) {
+                                      QString const &message,
+                                      QString const &tooltip) {
   setRunEnabled(enabled);
   m_uiForm.pbRun->setText(message);
   m_uiForm.pbRun->setToolTip(tooltip);
diff --git a/qt/scientific_interfaces/Indirect/ISISCalibration.h b/qt/scientific_interfaces/Indirect/ISISCalibration.h
index 945cce87117..1aa3634d6c2 100644
--- a/qt/scientific_interfaces/Indirect/ISISCalibration.h
+++ b/qt/scientific_interfaces/Indirect/ISISCalibration.h
@@ -56,7 +56,8 @@ private slots:
   void calMinChanged(double /*val*/);
   void calMaxChanged(double /*val*/);
   void calUpdateRS(QtProperty * /*prop*/, double /*val*/);
-  void calSetDefaultResolution(Mantid::API::MatrixWorkspace_const_sptr ws);
+  void
+  calSetDefaultResolution(const Mantid::API::MatrixWorkspace_const_sptr &ws);
   void resCheck(bool state); ///< handles checking/unchecking of "Create RES
   /// File" checkbox
   void setDefaultInstDetails();
@@ -73,8 +74,8 @@ private slots:
   void setSaveEnabled(bool enabled);
   void updateRunButton(bool enabled = true,
                        std::string const &enableOutputButtons = "unchanged",
-                       QString const message = "Run",
-                       QString const tooltip = "");
+                       QString const &message = "Run",
+                       QString const &tooltip = "");
 
 private:
   void setDefaultInstDetails(QMap<QString, QString> const &instrumentDetails);
diff --git a/qt/scientific_interfaces/Indirect/ISISDiagnostics.cpp b/qt/scientific_interfaces/Indirect/ISISDiagnostics.cpp
index a238b385ee1..df670758704 100644
--- a/qt/scientific_interfaces/Indirect/ISISDiagnostics.cpp
+++ b/qt/scientific_interfaces/Indirect/ISISDiagnostics.cpp
@@ -561,8 +561,8 @@ void ISISDiagnostics::setSaveEnabled(bool enabled) {
 
 void ISISDiagnostics::updateRunButton(bool enabled,
                                       std::string const &enableOutputButtons,
-                                      QString const message,
-                                      QString const tooltip) {
+                                      QString const &message,
+                                      QString const &tooltip) {
   setRunEnabled(enabled);
   m_uiForm.pbRun->setText(message);
   m_uiForm.pbRun->setToolTip(tooltip);
diff --git a/qt/scientific_interfaces/Indirect/ISISDiagnostics.h b/qt/scientific_interfaces/Indirect/ISISDiagnostics.h
index e40fd3f1f68..05cb96df8ed 100644
--- a/qt/scientific_interfaces/Indirect/ISISDiagnostics.h
+++ b/qt/scientific_interfaces/Indirect/ISISDiagnostics.h
@@ -69,8 +69,8 @@ private slots:
   void setSaveEnabled(bool enabled);
   void updateRunButton(bool enabled = true,
                        std::string const &enableOutputButtons = "unchanged",
-                       QString const message = "Run",
-                       QString const tooltip = "");
+                       QString const &message = "Run",
+                       QString const &tooltip = "");
 
 private:
   void setDefaultInstDetails(QMap<QString, QString> const &instrumentDetails);
diff --git a/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.cpp b/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.cpp
index 24c5e4b661d..71bf58cb7d6 100644
--- a/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.cpp
+++ b/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.cpp
@@ -115,7 +115,7 @@ void deleteWorkspace(std::string const &name) {
   deleter->execute();
 }
 
-double getSampleLog(MatrixWorkspace_const_sptr workspace,
+double getSampleLog(const MatrixWorkspace_const_sptr &workspace,
                     std::string const &logName, double const &defaultValue) {
   try {
     return workspace->getLogAsSingleValue(logName);
@@ -124,7 +124,7 @@ double getSampleLog(MatrixWorkspace_const_sptr workspace,
   }
 }
 
-double getSampleLog(MatrixWorkspace_const_sptr workspace,
+double getSampleLog(const MatrixWorkspace_const_sptr &workspace,
                     std::vector<std::string> const &logNames,
                     double const &defaultValue) {
   double value(defaultValue);
@@ -1014,8 +1014,8 @@ void ISISEnergyTransfer::setSaveEnabled(bool enable) {
 
 void ISISEnergyTransfer::updateRunButton(bool enabled,
                                          std::string const &enableOutputButtons,
-                                         QString const message,
-                                         QString const tooltip) {
+                                         QString const &message,
+                                         QString const &tooltip) {
   setRunEnabled(enabled);
   m_uiForm.pbRun->setText(message);
   m_uiForm.pbRun->setToolTip(tooltip);
diff --git a/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.h b/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.h
index c0b547acf0c..3dfcca5b659 100644
--- a/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.h
+++ b/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.h
@@ -60,8 +60,8 @@ private slots:
 
   void updateRunButton(bool enabled = true,
                        std::string const &enableOutputButtons = "unchanged",
-                       QString const message = "Run",
-                       QString const tooltip = "");
+                       QString const &message = "Run",
+                       QString const &tooltip = "");
 
 private:
   void setInstrumentDefault(QMap<QString, QString> const &instDetails);
diff --git a/qt/scientific_interfaces/Indirect/IndirectAddWorkspaceDialog.cpp b/qt/scientific_interfaces/Indirect/IndirectAddWorkspaceDialog.cpp
index 3fe56ac1f40..9917de6f816 100644
--- a/qt/scientific_interfaces/Indirect/IndirectAddWorkspaceDialog.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectAddWorkspaceDialog.cpp
@@ -10,6 +10,7 @@
 #include "MantidAPI/MatrixWorkspace.h"
 
 #include <boost/optional.hpp>
+#include <utility>
 
 namespace {
 using namespace Mantid::API;
@@ -26,7 +27,8 @@ bool validWorkspace(std::string const &name) {
   return !name.empty() && doesExistInADS(name);
 }
 
-boost::optional<std::size_t> maximumIndex(MatrixWorkspace_sptr workspace) {
+boost::optional<std::size_t>
+maximumIndex(const MatrixWorkspace_sptr &workspace) {
   if (workspace) {
     const auto numberOfHistograms = workspace->getNumberHistograms();
     if (numberOfHistograms > 0)
@@ -35,8 +37,8 @@ boost::optional<std::size_t> maximumIndex(MatrixWorkspace_sptr workspace) {
   return boost::none;
 }
 
-QString getIndexString(MatrixWorkspace_sptr workspace) {
-  const auto maximum = maximumIndex(workspace);
+QString getIndexString(const MatrixWorkspace_sptr &workspace) {
+  const auto maximum = maximumIndex(std::move(workspace));
   if (maximum) {
     if (*maximum > 0)
       return QString("0-%1").arg(*maximum);
diff --git a/qt/scientific_interfaces/Indirect/IndirectDataAnalysisTab.cpp b/qt/scientific_interfaces/Indirect/IndirectDataAnalysisTab.cpp
index a1709e90c81..ff799657800 100644
--- a/qt/scientific_interfaces/Indirect/IndirectDataAnalysisTab.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectDataAnalysisTab.cpp
@@ -15,6 +15,7 @@
 
 #include <QSettings>
 #include <QString>
+#include <utility>
 
 using namespace Mantid::API;
 
@@ -92,7 +93,7 @@ MatrixWorkspace_sptr IndirectDataAnalysisTab::inputWorkspace() const {
  */
 void IndirectDataAnalysisTab::setInputWorkspace(
     MatrixWorkspace_sptr inputWorkspace) {
-  m_inputWorkspace = inputWorkspace;
+  m_inputWorkspace = std::move(inputWorkspace);
 }
 
 /**
@@ -113,7 +114,7 @@ MatrixWorkspace_sptr IndirectDataAnalysisTab::previewPlotWorkspace() {
  * @param previewPlotWorkspace The workspace to set.
  */
 void IndirectDataAnalysisTab::setPreviewPlotWorkspace(
-    MatrixWorkspace_sptr previewPlotWorkspace) {
+    const MatrixWorkspace_sptr &previewPlotWorkspace) {
   m_previewPlotWorkspace = previewPlotWorkspace;
 }
 
@@ -262,7 +263,7 @@ void IndirectDataAnalysisTab::updatePlot(
  * @param diffPreviewPlot   The difference preview plot.
  */
 void IndirectDataAnalysisTab::updatePlot(
-    WorkspaceGroup_sptr outputWS, size_t index,
+    const WorkspaceGroup_sptr &outputWS, size_t index,
     MantidQt::MantidWidgets::PreviewPlot *fitPreviewPlot,
     MantidQt::MantidWidgets::PreviewPlot *diffPreviewPlot) {
   // Check whether the specified index is within the bounds of the
@@ -318,7 +319,7 @@ void IndirectDataAnalysisTab::updatePlot(
  * @param diffPreviewPlot   The difference preview plot.
  */
 void IndirectDataAnalysisTab::updatePlot(
-    WorkspaceGroup_sptr outputWS,
+    const WorkspaceGroup_sptr &outputWS,
     MantidQt::MantidWidgets::PreviewPlot *fitPreviewPlot,
     MantidQt::MantidWidgets::PreviewPlot *diffPreviewPlot) {
   if (outputWS && selectedSpectrum() >= minimumSpectrum() &&
@@ -339,7 +340,7 @@ void IndirectDataAnalysisTab::updatePlot(
  * @param diffPreviewPlot   The difference preview plot.
  */
 void IndirectDataAnalysisTab::updatePlot(
-    MatrixWorkspace_sptr outputWS,
+    const MatrixWorkspace_sptr &outputWS,
     MantidQt::MantidWidgets::PreviewPlot *fitPreviewPlot,
     MantidQt::MantidWidgets::PreviewPlot *diffPreviewPlot) {
   fitPreviewPlot->clear();
diff --git a/qt/scientific_interfaces/Indirect/IndirectDataAnalysisTab.h b/qt/scientific_interfaces/Indirect/IndirectDataAnalysisTab.h
index 9c2b956c77f..beb59db18d8 100644
--- a/qt/scientific_interfaces/Indirect/IndirectDataAnalysisTab.h
+++ b/qt/scientific_interfaces/Indirect/IndirectDataAnalysisTab.h
@@ -90,7 +90,7 @@ protected:
 
   /// Set preview plot workspace
   void setPreviewPlotWorkspace(
-      Mantid::API::MatrixWorkspace_sptr previewPlotWorkspace);
+      const Mantid::API::MatrixWorkspace_sptr &previewPlotWorkspace);
 
   /// Retrieve the selected spectrum
   int selectedSpectrum() const;
@@ -110,11 +110,12 @@ protected:
                   MantidQt::MantidWidgets::PreviewPlot *fitPreviewPlot,
                   MantidQt::MantidWidgets::PreviewPlot *diffPreviewPlot);
 
-  void updatePlot(Mantid::API::WorkspaceGroup_sptr workspaceGroup, size_t index,
+  void updatePlot(const Mantid::API::WorkspaceGroup_sptr &workspaceGroup,
+                  size_t index,
                   MantidQt::MantidWidgets::PreviewPlot *fitPreviewPlot,
                   MantidQt::MantidWidgets::PreviewPlot *diffPreviewPlot);
 
-  void updatePlot(Mantid::API::WorkspaceGroup_sptr outputWS,
+  void updatePlot(const Mantid::API::WorkspaceGroup_sptr &outputWS,
                   MantidQt::MantidWidgets::PreviewPlot *fitPreviewPlot,
                   MantidQt::MantidWidgets::PreviewPlot *diffPreviewPlot);
 
@@ -122,7 +123,7 @@ protected:
                   MantidQt::MantidWidgets::PreviewPlot *fitPreviewPlot,
                   MantidQt::MantidWidgets::PreviewPlot *diffPreviewPlot);
 
-  void updatePlot(Mantid::API::MatrixWorkspace_sptr outputWS,
+  void updatePlot(const Mantid::API::MatrixWorkspace_sptr &outputWS,
                   MantidQt::MantidWidgets::PreviewPlot *fitPreviewPlot,
                   MantidQt::MantidWidgets::PreviewPlot *diffPreviewPlot);
 
diff --git a/qt/scientific_interfaces/Indirect/IndirectDataReduction.cpp b/qt/scientific_interfaces/Indirect/IndirectDataReduction.cpp
index e785ece295a..61b659e0704 100644
--- a/qt/scientific_interfaces/Indirect/IndirectDataReduction.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectDataReduction.cpp
@@ -316,7 +316,8 @@ void IndirectDataReduction::loadInstrumentDetails() {
  * @return Value as QString
  */
 QString IndirectDataReduction::getInstrumentParameterFrom(
-    Mantid::Geometry::IComponent_const_sptr comp, std::string param) {
+    const Mantid::Geometry::IComponent_const_sptr &comp,
+    const std::string &param) {
   QString value;
 
   if (!comp->hasParameter(param)) {
@@ -445,7 +446,7 @@ void IndirectDataReduction::saveSettings() {
  *
  * @param facility Name of facility
  */
-void IndirectDataReduction::filterUiForFacility(QString facility) {
+void IndirectDataReduction::filterUiForFacility(const QString &facility) {
   g_log.information() << "Facility selected: " << facility.toStdString()
                       << '\n';
   QStringList enabledTabs;
diff --git a/qt/scientific_interfaces/Indirect/IndirectDataReduction.h b/qt/scientific_interfaces/Indirect/IndirectDataReduction.h
index 9cd0cbfbba9..582b93441d3 100644
--- a/qt/scientific_interfaces/Indirect/IndirectDataReduction.h
+++ b/qt/scientific_interfaces/Indirect/IndirectDataReduction.h
@@ -69,7 +69,7 @@ signals:
 
 private slots:
   /// Shows/hides tabs based on facility
-  void filterUiForFacility(QString facility);
+  void filterUiForFacility(const QString &facility);
 
   /// Exports the current tab algorithms as a Python script
   void exportTabPython();
@@ -89,9 +89,9 @@ private:
 
   void loadInstrumentDetails();
 
-  QString
-  getInstrumentParameterFrom(Mantid::Geometry::IComponent_const_sptr comp,
-                             std::string param);
+  QString getInstrumentParameterFrom(
+      const Mantid::Geometry::IComponent_const_sptr &comp,
+      const std::string &param);
 
   void readSettings();
   void saveSettings();
diff --git a/qt/scientific_interfaces/Indirect/IndirectDiffractionReduction.cpp b/qt/scientific_interfaces/Indirect/IndirectDiffractionReduction.cpp
index e40aa619cc1..6ae644b2f73 100644
--- a/qt/scientific_interfaces/Indirect/IndirectDiffractionReduction.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectDiffractionReduction.cpp
@@ -354,8 +354,8 @@ IAlgorithm_sptr IndirectDiffractionReduction::convertUnitsAlgorithm(
  * @param instName Name of the instrument
  * @param mode Mode instrument is operating in (diffspec/diffonly)
  */
-void IndirectDiffractionReduction::runGenericReduction(QString instName,
-                                                       QString mode) {
+void IndirectDiffractionReduction::runGenericReduction(const QString &instName,
+                                                       const QString &mode) {
 
   QString rebinStart = "";
   QString rebinWidth = "";
diff --git a/qt/scientific_interfaces/Indirect/IndirectDiffractionReduction.h b/qt/scientific_interfaces/Indirect/IndirectDiffractionReduction.h
index 03c119a5a6f..8e9e8aafd85 100644
--- a/qt/scientific_interfaces/Indirect/IndirectDiffractionReduction.h
+++ b/qt/scientific_interfaces/Indirect/IndirectDiffractionReduction.h
@@ -79,7 +79,7 @@ private:
   loadInstrument(const std::string &instrumentName,
                  const std::string &reflection = "");
 
-  void runGenericReduction(QString instName, QString mode);
+  void runGenericReduction(const QString &instName, const QString &mode);
   void connectRunButtonValidation(const MantidQt::API::MWRunFiles *file_field);
   void runOSIRISdiffonlyReduction();
   void createGroupingWorkspace(const std::string &outputWsName);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.cpp b/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.cpp
index d87a94d8b5f..4c4793df70b 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.cpp
@@ -19,6 +19,7 @@
 #include <QtCore>
 
 #include <algorithm>
+#include <utility>
 
 /// Logger
 Mantid::Kernel::Logger g_log("IndirectFitAnalysisTab");
@@ -643,7 +644,7 @@ void IndirectFitAnalysisTab::setEditResultVisible(bool visible) {
 }
 
 void IndirectFitAnalysisTab::setAlgorithmProperties(
-    IAlgorithm_sptr fitAlgorithm) const {
+    const IAlgorithm_sptr &fitAlgorithm) const {
   fitAlgorithm->setProperty("Minimizer", m_fitPropertyBrowser->minimizer(true));
   fitAlgorithm->setProperty("MaxIterations",
                             m_fitPropertyBrowser->maxIterations());
@@ -674,14 +675,14 @@ void IndirectFitAnalysisTab::setAlgorithmProperties(
 void IndirectFitAnalysisTab::runFitAlgorithm(IAlgorithm_sptr fitAlgorithm) {
   connect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this,
           SLOT(updateFitOutput(bool)));
-  setupFit(fitAlgorithm);
+  setupFit(std::move(fitAlgorithm));
   m_batchAlgoRunner->executeBatchAsync();
 }
 
 void IndirectFitAnalysisTab::runSingleFit(IAlgorithm_sptr fitAlgorithm) {
   connect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this,
           SLOT(updateSingleFitOutput(bool)));
-  setupFit(fitAlgorithm);
+  setupFit(std::move(fitAlgorithm));
   m_batchAlgoRunner->executeBatchAsync();
 }
 
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.h b/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.h
index d18221f9fcb..001d4335225 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTab.h
@@ -71,7 +71,8 @@ protected:
   void setSampleSuffixes(std::string const &tab, bool filter);
   void setResolutionSuffixes(std::string const &tab, bool filter);
 
-  void setAlgorithmProperties(Mantid::API::IAlgorithm_sptr fitAlgorithm) const;
+  void setAlgorithmProperties(
+      const Mantid::API::IAlgorithm_sptr &fitAlgorithm) const;
   void runFitAlgorithm(Mantid::API::IAlgorithm_sptr fitAlgorithm);
   void runSingleFit(Mantid::API::IAlgorithm_sptr fitAlgorithm);
   virtual void setupFit(Mantid::API::IAlgorithm_sptr fitAlgorithm);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTabLegacy.cpp b/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTabLegacy.cpp
index bc22a7f659a..02d0163c5e8 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTabLegacy.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTabLegacy.cpp
@@ -21,6 +21,7 @@
 #include <QtCore>
 
 #include <algorithm>
+#include <utility>
 
 using namespace Mantid::API;
 
@@ -37,7 +38,7 @@ WorkspaceGroup_sptr getADSGroupWorkspace(std::string const &workspaceName) {
 }
 
 void updateParameters(
-    IFunction_sptr function,
+    const IFunction_sptr &function,
     std::unordered_map<std::string, ParameterValueLegacy> const &parameters) {
   for (auto i = 0u; i < function->nParams(); ++i) {
     auto const value = parameters.find(function->parameterName(i));
@@ -50,7 +51,8 @@ void updateParameters(
 }
 
 void updateAttributes(
-    IFunction_sptr function, std::vector<std::string> const &attributeNames,
+    const IFunction_sptr &function,
+    std::vector<std::string> const &attributeNames,
     std::unordered_map<std::string, IFunction::Attribute> const &attributes) {
   for (const auto &attributeName : attributeNames) {
     auto const value = attributes.find(attributeName);
@@ -807,17 +809,19 @@ void IndirectFitAnalysisTabLegacy::updateAttributeValues() {
  * @param attributeNames  The attributes to update
  */
 void IndirectFitAnalysisTabLegacy::updateAttributeValues(
-    IFunction_sptr function, std::vector<std::string> const &attributeNames) {
+    const IFunction_sptr &function,
+    std::vector<std::string> const &attributeNames) {
   auto const attributes = getAttributes(function, attributeNames);
   if (!attributes.empty())
     updateAttributeValues(function, attributeNames, attributes);
 }
 
 void IndirectFitAnalysisTabLegacy::updateAttributeValues(
-    IFunction_sptr fitFunction, std::vector<std::string> const &attributeNames,
+    const IFunction_sptr &fitFunction,
+    std::vector<std::string> const &attributeNames,
     std::unordered_map<std::string, IFunction::Attribute> const &attributes) {
   try {
-    updateAttributes(fitFunction, attributeNames, attributes);
+    updateAttributes(std::move(fitFunction), attributeNames, attributes);
     updateFitBrowserAttributeValues();
   } catch (const std::runtime_error &) {
     showMessageBox("An unexpected error occured:\n The setting of attribute "
@@ -1067,7 +1071,7 @@ void IndirectFitAnalysisTabLegacy::setEditResultVisible(bool visible) {
 }
 
 void IndirectFitAnalysisTabLegacy::setAlgorithmProperties(
-    IAlgorithm_sptr fitAlgorithm) const {
+    const IAlgorithm_sptr &fitAlgorithm) const {
   fitAlgorithm->setProperty("Minimizer", m_fitPropertyBrowser->minimizer(true));
   fitAlgorithm->setProperty("MaxIterations",
                             m_fitPropertyBrowser->maxIterations());
@@ -1094,14 +1098,14 @@ void IndirectFitAnalysisTabLegacy::runFitAlgorithm(
     IAlgorithm_sptr fitAlgorithm) {
   connect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this,
           SLOT(updateFitOutput(bool)));
-  setupFit(fitAlgorithm);
+  setupFit(std::move(fitAlgorithm));
   m_batchAlgoRunner->executeBatchAsync();
 }
 
 void IndirectFitAnalysisTabLegacy::runSingleFit(IAlgorithm_sptr fitAlgorithm) {
   connect(m_batchAlgoRunner, SIGNAL(batchComplete(bool)), this,
           SLOT(updateSingleFitOutput(bool)));
-  setupFit(fitAlgorithm);
+  setupFit(std::move(fitAlgorithm));
   m_batchAlgoRunner->executeBatchAsync();
 }
 
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTabLegacy.h b/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTabLegacy.h
index afcd92bf527..0deb72aedee 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTabLegacy.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitAnalysisTabLegacy.h
@@ -131,7 +131,8 @@ protected:
   void setResolutionWSSuffixes(const QStringList &suffices);
   void setResolutionFBSuffixes(const QStringList &suffices);
 
-  void setAlgorithmProperties(Mantid::API::IAlgorithm_sptr fitAlgorithm) const;
+  void setAlgorithmProperties(
+      const Mantid::API::IAlgorithm_sptr &fitAlgorithm) const;
   void runFitAlgorithm(Mantid::API::IAlgorithm_sptr fitAlgorithm);
   void runSingleFit(Mantid::API::IAlgorithm_sptr fitAlgorithm);
   virtual void setupFit(Mantid::API::IAlgorithm_sptr fitAlgorithm);
@@ -176,10 +177,10 @@ protected slots:
   void executeFit();
 
   void updateAttributeValues();
-  void updateAttributeValues(Mantid::API::IFunction_sptr function,
+  void updateAttributeValues(const Mantid::API::IFunction_sptr &function,
                              std::vector<std::string> const &attributeNames);
   void updateAttributeValues(
-      Mantid::API::IFunction_sptr function,
+      const Mantid::API::IFunction_sptr &function,
       std::vector<std::string> const &attributeNames,
       std::unordered_map<std::string, Mantid::API::IFunction::Attribute> const
           &attributes);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitData.cpp b/qt/scientific_interfaces/Indirect/IndirectFitData.cpp
index f81b02c69a2..d3cddcda476 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitData.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitData.cpp
@@ -29,7 +29,7 @@ using namespace Mantid::Kernel::Strings;
  * them.
  * @param workspace workspace possibly containing Q values.
  */
-std::vector<double> extractQValues(const MatrixWorkspace_sptr workspace,
+std::vector<double> extractQValues(const MatrixWorkspace_sptr &workspace,
                                    const Spectra &spectra) {
   std::vector<double> qs;
   // Check if the vertical axis has units of momentum transfer, then extract Q
@@ -143,7 +143,7 @@ tryPassFormatArgument(boost::basic_format<char> &formatString,
   }
 }
 
-std::pair<double, double> getBinRange(MatrixWorkspace_sptr workspace) {
+std::pair<double, double> getBinRange(const MatrixWorkspace_sptr &workspace) {
   return std::make_pair(workspace->x(0).front(), workspace->x(0).back());
 }
 
@@ -296,7 +296,7 @@ void Spectra::checkContinuous() {
   }
 }
 
-IndirectFitData::IndirectFitData(MatrixWorkspace_sptr workspace,
+IndirectFitData::IndirectFitData(const MatrixWorkspace_sptr &workspace,
                                  const Spectra &spectra)
     : m_workspace(workspace), m_spectra(Spectra("")) {
   setSpectra(spectra);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitData.h b/qt/scientific_interfaces/Indirect/IndirectFitData.h
index 58913cc934b..41f44de2b63 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitData.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitData.h
@@ -108,7 +108,7 @@ std::vector<T> vectorFromString(const std::string &listString) {
 */
 class MANTIDQT_INDIRECT_DLL IndirectFitData {
 public:
-  IndirectFitData(Mantid::API::MatrixWorkspace_sptr workspace,
+  IndirectFitData(const Mantid::API::MatrixWorkspace_sptr &workspace,
                   const Spectra &spectra);
 
   std::string displayName(const std::string &formatString,
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitDataLegacy.cpp b/qt/scientific_interfaces/Indirect/IndirectFitDataLegacy.cpp
index f8735143ada..f54ed01a18d 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitDataLegacy.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitDataLegacy.cpp
@@ -12,6 +12,7 @@
 #include <boost/format.hpp>
 
 #include <sstream>
+#include <utility>
 
 using namespace Mantid::API;
 
@@ -227,7 +228,7 @@ tryPassFormatArgument(boost::basic_format<char> &formatString,
   }
 }
 
-std::pair<double, double> getBinRange(MatrixWorkspace_sptr workspace) {
+std::pair<double, double> getBinRange(const MatrixWorkspace_sptr &workspace) {
   return std::make_pair(workspace->x(0).front(), workspace->x(0).back());
 }
 
@@ -275,7 +276,8 @@ namespace IDA {
 
 IndirectFitDataLegacy::IndirectFitDataLegacy(MatrixWorkspace_sptr workspace,
                                              const SpectraLegacy &spectra)
-    : m_workspace(workspace), m_spectra(DiscontinuousSpectra<std::size_t>("")) {
+    : m_workspace(std::move(workspace)),
+      m_spectra(DiscontinuousSpectra<std::size_t>("")) {
   setSpectra(spectra);
 }
 
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitDataPresenter.cpp b/qt/scientific_interfaces/Indirect/IndirectFitDataPresenter.cpp
index 2d926e32acb..0c6eb63abff 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitDataPresenter.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitDataPresenter.cpp
@@ -5,6 +5,9 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "IndirectFitDataPresenter.h"
+
+#include <utility>
+
 #include "IndirectAddWorkspaceDialog.h"
 
 namespace MantidQt {
@@ -208,8 +211,8 @@ void IndirectFitDataPresenter::replaceHandle(const std::string &workspaceName,
 
 DataForParameterEstimationCollection
 IndirectFitDataPresenter::getDataForParameterEstimation(
-    EstimationDataSelector selector) const {
-  return m_model->getDataForParameterEstimation(selector);
+    const EstimationDataSelector &selector) const {
+  return m_model->getDataForParameterEstimation(std::move(selector));
 }
 
 void IndirectFitDataPresenter::selectReplacedWorkspace(
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitDataPresenter.h b/qt/scientific_interfaces/Indirect/IndirectFitDataPresenter.h
index 9240d202177..ae5f9d668e0 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitDataPresenter.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitDataPresenter.h
@@ -58,7 +58,7 @@ public:
   void replaceHandle(const std::string &workspaceName,
                      const Workspace_sptr &workspace) override;
   DataForParameterEstimationCollection
-  getDataForParameterEstimation(EstimationDataSelector selector) const;
+  getDataForParameterEstimation(const EstimationDataSelector &selector) const;
 
 public slots:
   void updateSpectraInTable(TableDatasetIndex dataIndex);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitOutput.cpp b/qt/scientific_interfaces/Indirect/IndirectFitOutput.cpp
index 2e78f0e3a46..f471023b4a0 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitOutput.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitOutput.cpp
@@ -14,6 +14,7 @@
 #include <boost/functional/hash.hpp>
 
 #include <unordered_set>
+#include <utility>
 
 using namespace Mantid::API;
 using IDAWorkspaceIndex = MantidQt::CustomInterfaces::IDA::WorkspaceIndex;
@@ -23,7 +24,7 @@ using namespace MantidQt::CustomInterfaces::IDA;
 
 struct TableRowExtractor {
   explicit TableRowExtractor(ITableWorkspace_sptr table)
-      : m_table(table), m_columns(m_table->getColumnNames()) {
+      : m_table(std::move(table)), m_columns(m_table->getColumnNames()) {
     m_chiIndex = std::find(m_columns.begin(), m_columns.end(), "Chi_squared") -
                  m_columns.begin();
   }
@@ -74,7 +75,7 @@ void extractParametersFromTable(
     const FitDataIterator &fitDataEnd,
     std::unordered_map<IndirectFitData const *, ParameterValuesNew>
         &parameters) {
-  TableRowExtractor extractRowFromTable(tableWs);
+  TableRowExtractor extractRowFromTable(std::move(tableWs));
   IDAWorkspaceIndex index;
   for (auto fitData = fitDataBegin; fitData < fitDataEnd; ++fitData) {
     auto &values = parameters[fitData->get()];
@@ -116,8 +117,9 @@ Map mapKeys(const Map &map, const KeyMap &keyMap) {
   return newMap;
 }
 
-MatrixWorkspace_sptr getMatrixWorkspaceFromGroup(WorkspaceGroup_sptr group,
-                                                 std::size_t index) {
+MatrixWorkspace_sptr
+getMatrixWorkspaceFromGroup(const WorkspaceGroup_sptr &group,
+                            std::size_t index) {
   if (group->size() > index)
     return boost::dynamic_pointer_cast<MatrixWorkspace>(group->getItem(index));
   return nullptr;
@@ -131,7 +133,7 @@ std::vector<std::string> getAxisLabels(TextAxis const *axis) {
   return labels;
 }
 
-std::vector<std::string> getAxisLabels(MatrixWorkspace_sptr workspace,
+std::vector<std::string> getAxisLabels(const MatrixWorkspace_sptr &workspace,
                                        std::size_t index) {
   auto axis = dynamic_cast<TextAxis *>(workspace->getAxis(index));
   if (axis)
@@ -166,12 +168,12 @@ void renameWorkspace(std::string const &name, std::string const &newName) {
   renamer->execute();
 }
 
-void renameResult(Workspace_sptr resultWorkspace,
+void renameResult(const Workspace_sptr &resultWorkspace,
                   const std::string &workspaceName) {
   renameWorkspace(resultWorkspace->getName(), workspaceName + "_Result");
 }
 
-void renameResult(Workspace_sptr resultWorkspace,
+void renameResult(const Workspace_sptr &resultWorkspace,
                   IndirectFitData const *fitData) {
   const auto name = resultWorkspace->getName();
   const auto newName = constructResultName(name, fitData);
@@ -179,13 +181,13 @@ void renameResult(Workspace_sptr resultWorkspace,
     renameWorkspace(name, newName);
 }
 
-void renameResult(WorkspaceGroup_sptr resultWorkspace,
+void renameResult(const WorkspaceGroup_sptr &resultWorkspace,
                   IndirectFitData const *fitData) {
   for (auto const &workspace : *resultWorkspace)
     renameResult(workspace, fitData);
 }
 
-void renameResultWithoutSpectra(WorkspaceGroup_sptr resultWorkspace,
+void renameResultWithoutSpectra(const WorkspaceGroup_sptr &resultWorkspace,
                                 const FitDataIterator &fitDataBegin,
                                 const FitDataIterator &fitDataEnd) {
   std::size_t index = 0;
@@ -200,7 +202,7 @@ void renameResultWithoutSpectra(WorkspaceGroup_sptr resultWorkspace,
   }
 }
 
-void renameResultWithSpectra(WorkspaceGroup_sptr resultWorkspace,
+void renameResultWithSpectra(const WorkspaceGroup_sptr &resultWorkspace,
                              const FitDataIterator &fitDataBegin,
                              const FitDataIterator &fitDataEnd) {
   std::size_t index = 0;
@@ -208,7 +210,7 @@ void renameResultWithSpectra(WorkspaceGroup_sptr resultWorkspace,
     renameResult(resultWorkspace->getItem(index++), it->get());
 }
 
-void renameResult(WorkspaceGroup_sptr resultWorkspace,
+void renameResult(const WorkspaceGroup_sptr &resultWorkspace,
                   const FitDataIterator &fitDataBegin,
                   const FitDataIterator &fitDataEnd) {
   if (static_cast<int>(resultWorkspace->size()) >= fitDataEnd - fitDataBegin)
@@ -238,25 +240,26 @@ namespace MantidQt {
 namespace CustomInterfaces {
 namespace IDA {
 
-IndirectFitOutput::IndirectFitOutput(WorkspaceGroup_sptr resultGroup,
+IndirectFitOutput::IndirectFitOutput(const WorkspaceGroup_sptr &resultGroup,
                                      ITableWorkspace_sptr parameterTable,
-                                     WorkspaceGroup_sptr resultWorkspace,
+                                     const WorkspaceGroup_sptr &resultWorkspace,
                                      const FitDataIterator &fitDataBegin,
                                      const FitDataIterator &fitDataEnd)
     : m_resultGroup(resultGroup), m_resultWorkspace(resultWorkspace),
       m_parameters(), m_outputResultLocations() {
-  addOutput(resultGroup, parameterTable, resultWorkspace, fitDataBegin,
-            fitDataEnd);
+  addOutput(resultGroup, std::move(parameterTable), resultWorkspace,
+            fitDataBegin, fitDataEnd);
 }
 
-IndirectFitOutput::IndirectFitOutput(WorkspaceGroup_sptr resultGroup,
+IndirectFitOutput::IndirectFitOutput(const WorkspaceGroup_sptr &resultGroup,
                                      ITableWorkspace_sptr parameterTable,
-                                     WorkspaceGroup_sptr resultWorkspace,
+                                     const WorkspaceGroup_sptr &resultWorkspace,
                                      IndirectFitData const *fitData,
                                      WorkspaceIndex spectrum) {
   m_parameters[fitData] = ParameterValuesNew();
   m_outputResultLocations[fitData] = ResultLocationsNew();
-  addOutput(resultGroup, parameterTable, resultWorkspace, fitData, spectrum);
+  addOutput(std::move(resultGroup), std::move(parameterTable),
+            std::move(resultWorkspace), fitData, spectrum);
 }
 
 bool IndirectFitOutput::isSpectrumFit(IndirectFitData const *fitData,
@@ -322,24 +325,24 @@ void IndirectFitOutput::mapParameterNames(
   parameters = mapKeys(parameters, parameterNameChanges);
 }
 
-void IndirectFitOutput::addOutput(WorkspaceGroup_sptr resultGroup,
+void IndirectFitOutput::addOutput(const WorkspaceGroup_sptr &resultGroup,
                                   ITableWorkspace_sptr parameterTable,
-                                  WorkspaceGroup_sptr resultWorkspace,
+                                  const WorkspaceGroup_sptr &resultWorkspace,
                                   const FitDataIterator &fitDataBegin,
                                   const FitDataIterator &fitDataEnd) {
-  updateParameters(parameterTable, fitDataBegin, fitDataEnd);
+  updateParameters(std::move(parameterTable), fitDataBegin, fitDataEnd);
   updateFitResults(resultGroup, fitDataBegin, fitDataEnd);
   renameResult(resultWorkspace, fitDataBegin, fitDataEnd);
   m_resultWorkspace = resultWorkspace;
   m_resultGroup = resultGroup;
 }
 
-void IndirectFitOutput::addOutput(WorkspaceGroup_sptr resultGroup,
+void IndirectFitOutput::addOutput(const WorkspaceGroup_sptr &resultGroup,
                                   ITableWorkspace_sptr parameterTable,
-                                  WorkspaceGroup_sptr resultWorkspace,
+                                  const WorkspaceGroup_sptr &resultWorkspace,
                                   IndirectFitData const *fitData,
                                   WorkspaceIndex spectrum) {
-  TableRowExtractor extractRowFromTable(parameterTable);
+  TableRowExtractor extractRowFromTable(std::move(parameterTable));
   m_parameters[fitData][spectrum] = extractRowFromTable(WorkspaceIndex{0});
   m_outputResultLocations[fitData][spectrum] =
       ResultLocationNew(resultGroup, WorkspaceGroupIndex{0});
@@ -353,7 +356,7 @@ void IndirectFitOutput::removeOutput(IndirectFitData const *fitData) {
   m_outputResultLocations.erase(fitData);
 }
 
-void IndirectFitOutput::updateFitResults(WorkspaceGroup_sptr resultGroup,
+void IndirectFitOutput::updateFitResults(const WorkspaceGroup_sptr &resultGroup,
                                          const FitDataIterator &fitDataBegin,
                                          const FitDataIterator &fitDataEnd) {
   if (numberOfSpectraIn(fitDataBegin, fitDataEnd).value <=
@@ -366,12 +369,12 @@ void IndirectFitOutput::updateFitResults(WorkspaceGroup_sptr resultGroup,
 void IndirectFitOutput::updateParameters(ITableWorkspace_sptr parameterTable,
                                          const FitDataIterator &fitDataBegin,
                                          const FitDataIterator &fitDataEnd) {
-  extractParametersFromTable(parameterTable, fitDataBegin, fitDataEnd,
-                             m_parameters);
+  extractParametersFromTable(std::move(parameterTable), fitDataBegin,
+                             fitDataEnd, m_parameters);
 }
 
 void IndirectFitOutput::updateFitResultsFromUnstructured(
-    WorkspaceGroup_sptr resultGroup, const FitDataIterator &fitDataBegin,
+    const WorkspaceGroup_sptr &resultGroup, const FitDataIterator &fitDataBegin,
     const FitDataIterator &fitDataEnd) {
   std::unordered_map<MatrixWorkspace *,
                      std::map<WorkspaceIndex, WorkspaceGroupIndex>>
@@ -396,7 +399,7 @@ void IndirectFitOutput::updateFitResultsFromUnstructured(
 }
 
 void IndirectFitOutput::updateFitResultsFromStructured(
-    WorkspaceGroup_sptr resultGroup, const FitDataIterator &fitDataBegin,
+    const WorkspaceGroup_sptr &resultGroup, const FitDataIterator &fitDataBegin,
     const FitDataIterator &fitDataEnd) {
   WorkspaceGroupIndex index;
   for (auto fitData = fitDataBegin; fitData < fitDataEnd; ++fitData) {
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitOutput.h b/qt/scientific_interfaces/Indirect/IndirectFitOutput.h
index 9bf1c957377..92bc19a0612 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitOutput.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitOutput.h
@@ -30,7 +30,7 @@ struct ParameterValue {
 
 struct ResultLocationNew {
   ResultLocationNew() = default;
-  ResultLocationNew(Mantid::API::WorkspaceGroup_sptr group,
+  ResultLocationNew(const Mantid::API::WorkspaceGroup_sptr &group,
                     WorkspaceGroupIndex i)
       : result(group), index(i) {}
   boost::weak_ptr<Mantid::API::WorkspaceGroup> result;
@@ -51,15 +51,15 @@ using FitDataIterator =
 */
 class MANTIDQT_INDIRECT_DLL IndirectFitOutput {
 public:
-  IndirectFitOutput(Mantid::API::WorkspaceGroup_sptr resultGroup,
+  IndirectFitOutput(const Mantid::API::WorkspaceGroup_sptr &resultGroup,
                     Mantid::API::ITableWorkspace_sptr parameterTable,
-                    Mantid::API::WorkspaceGroup_sptr resultWorkspace,
+                    const Mantid::API::WorkspaceGroup_sptr &resultWorkspace,
                     const FitDataIterator &fitDataBegin,
                     const FitDataIterator &fitDataEnd);
 
-  IndirectFitOutput(Mantid::API::WorkspaceGroup_sptr resultGroup,
+  IndirectFitOutput(const Mantid::API::WorkspaceGroup_sptr &resultGroup,
                     Mantid::API::ITableWorkspace_sptr parameterTable,
-                    Mantid::API::WorkspaceGroup_sptr resultWorkspace,
+                    const Mantid::API::WorkspaceGroup_sptr &resultWorkspace,
                     IndirectFitData const *fitData, WorkspaceIndex spectrum);
 
   bool isSpectrumFit(IndirectFitData const *fitData,
@@ -85,33 +85,31 @@ public:
       const std::unordered_map<std::string, std::string> &parameterNameChanges,
       IndirectFitData const *fitData, WorkspaceIndex spectrum);
 
-  void addOutput(Mantid::API::WorkspaceGroup_sptr resultGroup,
+  void addOutput(const Mantid::API::WorkspaceGroup_sptr &resultGroup,
                  Mantid::API::ITableWorkspace_sptr parameterTable,
-                 Mantid::API::WorkspaceGroup_sptr resultWorkspace,
+                 const Mantid::API::WorkspaceGroup_sptr &resultWorkspace,
                  const FitDataIterator &fitDataBegin,
                  const FitDataIterator &fitDataEnd);
-  void addOutput(Mantid::API::WorkspaceGroup_sptr resultGroup,
+  void addOutput(const Mantid::API::WorkspaceGroup_sptr &resultGroup,
                  Mantid::API::ITableWorkspace_sptr parameterTable,
-                 Mantid::API::WorkspaceGroup_sptr resultWorkspace,
+                 const Mantid::API::WorkspaceGroup_sptr &resultWorkspace,
                  IndirectFitData const *fitData, WorkspaceIndex spectrum);
 
   void removeOutput(IndirectFitData const *fitData);
 
 private:
-  void updateFitResults(Mantid::API::WorkspaceGroup_sptr resultGroup,
+  void updateFitResults(const Mantid::API::WorkspaceGroup_sptr &resultGroup,
                         const FitDataIterator &fitDataBegin,
                         const FitDataIterator &fitDataEnd);
   void updateParameters(Mantid::API::ITableWorkspace_sptr parameterTable,
                         const FitDataIterator &fitDataBegin,
                         const FitDataIterator &fitDataEnd);
-  void
-  updateFitResultsFromUnstructured(Mantid::API::WorkspaceGroup_sptr resultGroup,
-                                   const FitDataIterator &fitDataBegin,
-                                   const FitDataIterator &fitDataEnd);
-  void
-  updateFitResultsFromStructured(Mantid::API::WorkspaceGroup_sptr resultGroup,
-                                 const FitDataIterator &fitDataBegin,
-                                 const FitDataIterator &fitDataEnd);
+  void updateFitResultsFromUnstructured(
+      const Mantid::API::WorkspaceGroup_sptr &resultGroup,
+      const FitDataIterator &fitDataBegin, const FitDataIterator &fitDataEnd);
+  void updateFitResultsFromStructured(
+      const Mantid::API::WorkspaceGroup_sptr &resultGroup,
+      const FitDataIterator &fitDataBegin, const FitDataIterator &fitDataEnd);
 
   boost::weak_ptr<Mantid::API::WorkspaceGroup> m_resultGroup;
   boost::weak_ptr<Mantid::API::WorkspaceGroup> m_resultWorkspace;
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitOutputLegacy.cpp b/qt/scientific_interfaces/Indirect/IndirectFitOutputLegacy.cpp
index 66f8d682659..0fce2d58734 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitOutputLegacy.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitOutputLegacy.cpp
@@ -14,6 +14,7 @@
 #include <boost/functional/hash.hpp>
 
 #include <unordered_set>
+#include <utility>
 
 using namespace Mantid::API;
 
@@ -22,7 +23,7 @@ using namespace MantidQt::CustomInterfaces::IDA;
 
 struct TableRowExtractor {
   explicit TableRowExtractor(ITableWorkspace_sptr table)
-      : m_table(table), m_columns(m_table->getColumnNames()) {
+      : m_table(std::move(table)), m_columns(m_table->getColumnNames()) {
     m_chiIndex = std::find(m_columns.begin(), m_columns.end(), "Chi_squared") -
                  m_columns.begin();
   }
@@ -74,7 +75,7 @@ void extractParametersFromTable(
     const FitDataIteratorLegacy &fitDataEnd,
     std::unordered_map<IndirectFitDataLegacy const *, ParameterValues>
         &parameters) {
-  TableRowExtractor extractRowFromTable(tableWs);
+  TableRowExtractor extractRowFromTable(std::move(tableWs));
   auto extract = [&](IndirectFitDataLegacy const *inputData) {
     auto &values = extractOrAddDefault(parameters, inputData);
     return [&](std::size_t index, std::size_t spectrum) {
@@ -115,8 +116,9 @@ Map mapKeys(const Map &map, const KeyMap &keyMap) {
   return newMap;
 }
 
-MatrixWorkspace_sptr getMatrixWorkspaceFromGroup(WorkspaceGroup_sptr group,
-                                                 std::size_t index) {
+MatrixWorkspace_sptr
+getMatrixWorkspaceFromGroup(const WorkspaceGroup_sptr &group,
+                            std::size_t index) {
   if (group->size() > index)
     return boost::dynamic_pointer_cast<MatrixWorkspace>(group->getItem(index));
   return nullptr;
@@ -130,7 +132,7 @@ std::vector<std::string> getAxisLabels(TextAxis const *axis) {
   return labels;
 }
 
-std::vector<std::string> getAxisLabels(MatrixWorkspace_sptr workspace,
+std::vector<std::string> getAxisLabels(const MatrixWorkspace_sptr &workspace,
                                        std::size_t index) {
   auto axis = dynamic_cast<TextAxis *>(workspace->getAxis(index));
   if (axis)
@@ -165,12 +167,12 @@ void renameWorkspace(std::string const &name, std::string const &newName) {
   renamer->execute();
 }
 
-void renameResult(Workspace_sptr resultWorkspace,
+void renameResult(const Workspace_sptr &resultWorkspace,
                   const std::string &workspaceName) {
   renameWorkspace(resultWorkspace->getName(), workspaceName + "_Result");
 }
 
-void renameResult(Workspace_sptr resultWorkspace,
+void renameResult(const Workspace_sptr &resultWorkspace,
                   IndirectFitDataLegacy const *fitData) {
   const auto name = resultWorkspace->getName();
   const auto newName = constructResultName(name, fitData);
@@ -178,13 +180,13 @@ void renameResult(Workspace_sptr resultWorkspace,
     renameWorkspace(name, newName);
 }
 
-void renameResult(WorkspaceGroup_sptr resultWorkspace,
+void renameResult(const WorkspaceGroup_sptr &resultWorkspace,
                   IndirectFitDataLegacy const *fitData) {
   for (auto const &workspace : *resultWorkspace)
     renameResult(workspace, fitData);
 }
 
-void renameResultWithoutSpectra(WorkspaceGroup_sptr resultWorkspace,
+void renameResultWithoutSpectra(const WorkspaceGroup_sptr &resultWorkspace,
                                 const FitDataIteratorLegacy &fitDataBegin,
                                 const FitDataIteratorLegacy &fitDataEnd) {
   std::size_t index = 0;
@@ -199,7 +201,7 @@ void renameResultWithoutSpectra(WorkspaceGroup_sptr resultWorkspace,
   }
 }
 
-void renameResultWithSpectra(WorkspaceGroup_sptr resultWorkspace,
+void renameResultWithSpectra(const WorkspaceGroup_sptr &resultWorkspace,
                              const FitDataIteratorLegacy &fitDataBegin,
                              const FitDataIteratorLegacy &fitDataEnd) {
   std::size_t index = 0;
@@ -207,7 +209,7 @@ void renameResultWithSpectra(WorkspaceGroup_sptr resultWorkspace,
     renameResult(resultWorkspace->getItem(index++), it->get());
 }
 
-void renameResult(WorkspaceGroup_sptr resultWorkspace,
+void renameResult(const WorkspaceGroup_sptr &resultWorkspace,
                   const FitDataIteratorLegacy &fitDataBegin,
                   const FitDataIteratorLegacy &fitDataEnd) {
   if (static_cast<int>(resultWorkspace->size()) >= fitDataEnd - fitDataBegin)
@@ -230,7 +232,7 @@ public:
       WorkspaceGroup_sptr resultGroup, ResultLocations &locations,
       std::unordered_map<std::size_t, std::size_t> &defaultPositions,
       std::size_t &index)
-      : m_resultGroup(resultGroup), m_locations(locations),
+      : m_resultGroup(std::move(resultGroup)), m_locations(locations),
         m_defaultPositions(defaultPositions), m_index(index) {}
 
   void operator()(std::size_t spectrum) const {
@@ -264,23 +266,24 @@ namespace CustomInterfaces {
 namespace IDA {
 
 IndirectFitOutputLegacy::IndirectFitOutputLegacy(
-    WorkspaceGroup_sptr resultGroup, ITableWorkspace_sptr parameterTable,
-    WorkspaceGroup_sptr resultWorkspace,
+    const WorkspaceGroup_sptr &resultGroup, ITableWorkspace_sptr parameterTable,
+    const WorkspaceGroup_sptr &resultWorkspace,
     const FitDataIteratorLegacy &fitDataBegin,
     const FitDataIteratorLegacy &fitDataEnd)
     : m_resultGroup(resultGroup), m_resultWorkspace(resultWorkspace),
       m_parameters(), m_outputResultLocations() {
-  addOutput(resultGroup, parameterTable, resultWorkspace, fitDataBegin,
-            fitDataEnd);
+  addOutput(resultGroup, std::move(parameterTable), resultWorkspace,
+            fitDataBegin, fitDataEnd);
 }
 
 IndirectFitOutputLegacy::IndirectFitOutputLegacy(
-    WorkspaceGroup_sptr resultGroup, ITableWorkspace_sptr parameterTable,
-    WorkspaceGroup_sptr resultWorkspace, IndirectFitDataLegacy const *fitData,
-    std::size_t spectrum) {
+    const WorkspaceGroup_sptr &resultGroup, ITableWorkspace_sptr parameterTable,
+    const WorkspaceGroup_sptr &resultWorkspace,
+    IndirectFitDataLegacy const *fitData, std::size_t spectrum) {
   m_parameters[fitData] = ParameterValues();
   m_outputResultLocations[fitData] = ResultLocations();
-  addOutput(resultGroup, parameterTable, resultWorkspace, fitData, spectrum);
+  addOutput(std::move(resultGroup), std::move(parameterTable),
+            std::move(resultWorkspace), fitData, spectrum);
 }
 
 bool IndirectFitOutputLegacy::isSpectrumFit(
@@ -349,23 +352,22 @@ void IndirectFitOutputLegacy::mapParameterNames(
 }
 
 void IndirectFitOutputLegacy::addOutput(
-    WorkspaceGroup_sptr resultGroup, ITableWorkspace_sptr parameterTable,
-    WorkspaceGroup_sptr resultWorkspace,
+    const WorkspaceGroup_sptr &resultGroup, ITableWorkspace_sptr parameterTable,
+    const WorkspaceGroup_sptr &resultWorkspace,
     const FitDataIteratorLegacy &fitDataBegin,
     const FitDataIteratorLegacy &fitDataEnd) {
-  updateParameters(parameterTable, fitDataBegin, fitDataEnd);
+  updateParameters(std::move(parameterTable), fitDataBegin, fitDataEnd);
   updateFitResults(resultGroup, fitDataBegin, fitDataEnd);
   renameResult(resultWorkspace, fitDataBegin, fitDataEnd);
   m_resultWorkspace = resultWorkspace;
   m_resultGroup = resultGroup;
 }
 
-void IndirectFitOutputLegacy::addOutput(WorkspaceGroup_sptr resultGroup,
-                                        ITableWorkspace_sptr parameterTable,
-                                        WorkspaceGroup_sptr resultWorkspace,
-                                        IndirectFitDataLegacy const *fitData,
-                                        std::size_t spectrum) {
-  TableRowExtractor extractRowFromTable(parameterTable);
+void IndirectFitOutputLegacy::addOutput(
+    const WorkspaceGroup_sptr &resultGroup, ITableWorkspace_sptr parameterTable,
+    const WorkspaceGroup_sptr &resultWorkspace,
+    IndirectFitDataLegacy const *fitData, std::size_t spectrum) {
+  TableRowExtractor extractRowFromTable(std::move(parameterTable));
   m_parameters[fitData][spectrum] = extractRowFromTable(0);
   m_outputResultLocations[fitData][spectrum] = ResultLocation(resultGroup, 0);
   renameResult(resultWorkspace, fitData);
@@ -380,7 +382,8 @@ void IndirectFitOutputLegacy::removeOutput(
 }
 
 void IndirectFitOutputLegacy::updateFitResults(
-    WorkspaceGroup_sptr resultGroup, const FitDataIteratorLegacy &fitDataBegin,
+    const WorkspaceGroup_sptr &resultGroup,
+    const FitDataIteratorLegacy &fitDataBegin,
     const FitDataIteratorLegacy &fitDataEnd) {
   if (numberOfSpectraIn(fitDataBegin, fitDataEnd) <= resultGroup->size())
     updateFitResultsFromStructured(resultGroup, fitDataBegin, fitDataEnd);
@@ -392,8 +395,8 @@ void IndirectFitOutputLegacy::updateParameters(
     ITableWorkspace_sptr parameterTable,
     const FitDataIteratorLegacy &fitDataBegin,
     const FitDataIteratorLegacy &fitDataEnd) {
-  extractParametersFromTable(parameterTable, fitDataBegin, fitDataEnd,
-                             m_parameters);
+  extractParametersFromTable(std::move(parameterTable), fitDataBegin,
+                             fitDataEnd, m_parameters);
 }
 
 void IndirectFitOutputLegacy::updateFitResultsFromUnstructured(
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitOutputLegacy.h b/qt/scientific_interfaces/Indirect/IndirectFitOutputLegacy.h
index 58bc119c27f..7dc61035373 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitOutputLegacy.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitOutputLegacy.h
@@ -30,7 +30,7 @@ struct ParameterValueLegacy {
 
 struct ResultLocation {
   ResultLocation() : result(), index(0) {}
-  ResultLocation(Mantid::API::WorkspaceGroup_sptr group, std::size_t i)
+  ResultLocation(const Mantid::API::WorkspaceGroup_sptr &group, std::size_t i)
       : result(group), index(i) {}
   boost::weak_ptr<Mantid::API::WorkspaceGroup> result;
   std::size_t index;
@@ -51,17 +51,18 @@ using FitDataIteratorLegacy =
 */
 class MANTIDQT_INDIRECT_DLL IndirectFitOutputLegacy {
 public:
-  IndirectFitOutputLegacy(Mantid::API::WorkspaceGroup_sptr resultGroup,
-                          Mantid::API::ITableWorkspace_sptr parameterTable,
-                          Mantid::API::WorkspaceGroup_sptr resultWorkspace,
-                          const FitDataIteratorLegacy &fitDataBegin,
-                          const FitDataIteratorLegacy &fitDataEnd);
-
-  IndirectFitOutputLegacy(Mantid::API::WorkspaceGroup_sptr resultGroup,
-                          Mantid::API::ITableWorkspace_sptr parameterTable,
-                          Mantid::API::WorkspaceGroup_sptr resultWorkspace,
-                          IndirectFitDataLegacy const *fitData,
-                          std::size_t spectrum);
+  IndirectFitOutputLegacy(
+      const Mantid::API::WorkspaceGroup_sptr &resultGroup,
+      Mantid::API::ITableWorkspace_sptr parameterTable,
+      const Mantid::API::WorkspaceGroup_sptr &resultWorkspace,
+      const FitDataIteratorLegacy &fitDataBegin,
+      const FitDataIteratorLegacy &fitDataEnd);
+
+  IndirectFitOutputLegacy(
+      const Mantid::API::WorkspaceGroup_sptr &resultGroup,
+      Mantid::API::ITableWorkspace_sptr parameterTable,
+      const Mantid::API::WorkspaceGroup_sptr &resultWorkspace,
+      IndirectFitDataLegacy const *fitData, std::size_t spectrum);
 
   bool isSpectrumFit(IndirectFitDataLegacy const *fitData,
                      std::size_t spectrum) const;
@@ -88,20 +89,20 @@ public:
       const std::unordered_map<std::string, std::string> &parameterNameChanges,
       IndirectFitDataLegacy const *fitData, std::size_t spectrum);
 
-  void addOutput(Mantid::API::WorkspaceGroup_sptr resultGroup,
+  void addOutput(const Mantid::API::WorkspaceGroup_sptr &resultGroup,
                  Mantid::API::ITableWorkspace_sptr parameterTable,
-                 Mantid::API::WorkspaceGroup_sptr resultWorkspace,
+                 const Mantid::API::WorkspaceGroup_sptr &resultWorkspace,
                  const FitDataIteratorLegacy &fitDataBegin,
                  const FitDataIteratorLegacy &fitDataEnd);
-  void addOutput(Mantid::API::WorkspaceGroup_sptr resultGroup,
+  void addOutput(const Mantid::API::WorkspaceGroup_sptr &resultGroup,
                  Mantid::API::ITableWorkspace_sptr parameterTable,
-                 Mantid::API::WorkspaceGroup_sptr resultWorkspace,
+                 const Mantid::API::WorkspaceGroup_sptr &resultWorkspace,
                  IndirectFitDataLegacy const *fitData, std::size_t spectrum);
 
   void removeOutput(IndirectFitDataLegacy const *fitData);
 
 private:
-  void updateFitResults(Mantid::API::WorkspaceGroup_sptr resultGroup,
+  void updateFitResults(const Mantid::API::WorkspaceGroup_sptr &resultGroup,
                         const FitDataIteratorLegacy &fitDataBegin,
                         const FitDataIteratorLegacy &fitDataEnd);
   void updateParameters(Mantid::API::ITableWorkspace_sptr parameterTable,
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitOutputOptionsModel.cpp b/qt/scientific_interfaces/Indirect/IndirectFitOutputOptionsModel.cpp
index ae7f7ab60b9..d946dbe86ba 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitOutputOptionsModel.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitOutputOptionsModel.cpp
@@ -6,6 +6,8 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "IndirectFitOutputOptionsModel.h"
 
+#include <utility>
+
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/Axis.h"
@@ -20,11 +22,11 @@ std::string noWorkspaceErrorMessage(std::string const &process) {
   return "The " + process + " of a workspace failed:\n\n No workspace found";
 }
 
-MatrixWorkspace_sptr convertToMatrixWorkspace(Workspace_sptr workspace) {
+MatrixWorkspace_sptr convertToMatrixWorkspace(const Workspace_sptr &workspace) {
   return boost::dynamic_pointer_cast<MatrixWorkspace>(workspace);
 }
 
-WorkspaceGroup_sptr convertToGroupWorkspace(Workspace_sptr workspace) {
+WorkspaceGroup_sptr convertToGroupWorkspace(const Workspace_sptr &workspace) {
   return boost::dynamic_pointer_cast<WorkspaceGroup>(workspace);
 }
 
@@ -50,7 +52,7 @@ std::unordered_map<std::string, std::size_t> extractAxisLabels(Axis *axis) {
 }
 
 std::unordered_map<std::string, std::size_t>
-extractAxisLabels(MatrixWorkspace_const_sptr workspace,
+extractAxisLabels(const MatrixWorkspace_const_sptr &workspace,
                   std::size_t const &axisIndex) {
   auto const axis = workspace->getAxis(axisIndex);
   if (axis->isText())
@@ -67,18 +69,20 @@ std::vector<std::string> extractParameterNames(Axis *axis) {
   return parameters;
 }
 
-std::vector<std::string> extractParameterNames(MatrixWorkspace_sptr workspace) {
+std::vector<std::string>
+extractParameterNames(const MatrixWorkspace_sptr &workspace) {
   auto const axis = workspace->getAxis(1);
   if (axis->isText())
     return extractParameterNames(axis);
   return std::vector<std::string>();
 }
 
-std::vector<std::string> extractParameterNames(Workspace_sptr workspace) {
-  return extractParameterNames(convertToMatrixWorkspace(workspace));
+std::vector<std::string>
+extractParameterNames(const Workspace_sptr &workspace) {
+  return extractParameterNames(convertToMatrixWorkspace(std::move(workspace)));
 }
 
-IAlgorithm_sptr saveNexusProcessedAlgorithm(Workspace_sptr workspace,
+IAlgorithm_sptr saveNexusProcessedAlgorithm(const Workspace_sptr &workspace,
                                             std::string const &filename) {
   auto saveAlg = AlgorithmManager::Instance().create("SaveNexusProcessed");
   saveAlg->setProperty("InputWorkspace", workspace);
@@ -86,23 +90,24 @@ IAlgorithm_sptr saveNexusProcessedAlgorithm(Workspace_sptr workspace,
   return saveAlg;
 }
 
-void saveWorkspace(Workspace_sptr workspace) {
+void saveWorkspace(const Workspace_sptr &workspace) {
   auto const filename = Mantid::Kernel::ConfigService::Instance().getString(
                             "defaultsave.directory") +
                         workspace->getName() + ".nxs";
   saveNexusProcessedAlgorithm(workspace, filename)->execute();
 }
 
-void saveWorkspacesInGroup(WorkspaceGroup_const_sptr group) {
+void saveWorkspacesInGroup(const WorkspaceGroup_const_sptr &group) {
   for (auto const workspace : *group)
     saveWorkspace(workspace);
 }
 
-bool workspaceIsPlottable(MatrixWorkspace_const_sptr workspace) {
+bool workspaceIsPlottable(const MatrixWorkspace_const_sptr &workspace) {
   return workspace->y(0).size() > 1;
 }
 
-bool containsPlottableWorkspace(WorkspaceGroup_const_sptr groupWorkspace) {
+bool containsPlottableWorkspace(
+    const WorkspaceGroup_const_sptr &groupWorkspace) {
   return std::any_of(groupWorkspace->begin(), groupWorkspace->end(),
                      [](auto const &workspace) {
                        return workspaceIsPlottable(
@@ -126,8 +131,8 @@ validateInputs(std::string const &inputWorkspaceName,
   return errors;
 }
 
-IAlgorithm_sptr replaceAlgorithm(MatrixWorkspace_sptr inputWorkspace,
-                                 MatrixWorkspace_sptr singleFitWorkspace,
+IAlgorithm_sptr replaceAlgorithm(const MatrixWorkspace_sptr &inputWorkspace,
+                                 const MatrixWorkspace_sptr &singleFitWorkspace,
                                  std::string const &outputName) {
   auto replaceAlg =
       AlgorithmManager::Instance().create("IndirectReplaceFitResult");
@@ -159,7 +164,7 @@ std::vector<std::string> filterByEndSuffix(std::vector<std::string> &strings,
 }
 
 bool doesGroupContain(std::string const &groupName,
-                      MatrixWorkspace_sptr workspace) {
+                      const MatrixWorkspace_sptr &workspace) {
   auto const adsWorkspace = getADSWorkspace(groupName);
   if (adsWorkspace->isGroup()) {
     auto const group =
@@ -180,7 +185,9 @@ std::string filterByContents(std::vector<std::string> &strings,
 std::string findGroupWorkspaceContaining(MatrixWorkspace_sptr workspace) {
   auto workspaceNames = AnalysisDataService::Instance().getObjectNames();
   auto resultGroups = filterByEndSuffix(workspaceNames, "_Results");
-  return !resultGroups.empty() ? filterByContents(resultGroups, workspace) : "";
+  return !resultGroups.empty()
+             ? filterByContents(resultGroups, std::move(workspace))
+             : "";
 }
 
 } // namespace
@@ -247,7 +254,8 @@ void IndirectFitOutputOptionsModel::plotResult(std::string const &plotType) {
 }
 
 void IndirectFitOutputOptionsModel::plotResult(
-    WorkspaceGroup_const_sptr groupWorkspace, std::string const &plotType) {
+    const WorkspaceGroup_const_sptr &groupWorkspace,
+    std::string const &plotType) {
   if (plotType == "All")
     plotAll(groupWorkspace);
   else
@@ -255,19 +263,19 @@ void IndirectFitOutputOptionsModel::plotResult(
 }
 
 void IndirectFitOutputOptionsModel::plotAll(
-    WorkspaceGroup_const_sptr groupWorkspace) {
+    const WorkspaceGroup_const_sptr &groupWorkspace) {
   for (auto const &workspace : *groupWorkspace)
     plotAll(convertToMatrixWorkspace(workspace));
 }
 
 void IndirectFitOutputOptionsModel::plotAll(
-    MatrixWorkspace_const_sptr workspace) {
+    const MatrixWorkspace_const_sptr &workspace) {
   if (workspaceIsPlottable(workspace))
     plotAllSpectra(workspace);
 }
 
 void IndirectFitOutputOptionsModel::plotAllSpectra(
-    MatrixWorkspace_const_sptr workspace) {
+    const MatrixWorkspace_const_sptr &workspace) {
   for (auto index = 0u; index < workspace->getNumberHistograms(); ++index) {
     auto const plotInfo = std::make_pair(workspace->getName(), index);
     m_spectraToPlot.emplace_back(plotInfo);
@@ -275,19 +283,20 @@ void IndirectFitOutputOptionsModel::plotAllSpectra(
 }
 
 void IndirectFitOutputOptionsModel::plotParameter(
-    WorkspaceGroup_const_sptr groupWorkspace, std::string const &parameter) {
+    const WorkspaceGroup_const_sptr &groupWorkspace,
+    std::string const &parameter) {
   for (auto const &workspace : *groupWorkspace)
     plotParameter(convertToMatrixWorkspace(workspace), parameter);
 }
 
 void IndirectFitOutputOptionsModel::plotParameter(
-    MatrixWorkspace_const_sptr workspace, std::string const &parameter) {
+    const MatrixWorkspace_const_sptr &workspace, std::string const &parameter) {
   if (workspaceIsPlottable(workspace))
     plotParameterSpectrum(workspace, parameter);
 }
 
 void IndirectFitOutputOptionsModel::plotParameterSpectrum(
-    MatrixWorkspace_const_sptr workspace, std::string const &parameter) {
+    const MatrixWorkspace_const_sptr &workspace, std::string const &parameter) {
   auto const parameters = extractAxisLabels(workspace, 1);
   auto const iter = parameters.find(parameter);
   if (iter != parameters.end()) {
@@ -306,7 +315,7 @@ void IndirectFitOutputOptionsModel::plotPDF(std::string const &workspaceName,
 }
 
 void IndirectFitOutputOptionsModel::plotPDF(
-    MatrixWorkspace_const_sptr workspace, std::string const &plotType) {
+    const MatrixWorkspace_const_sptr &workspace, std::string const &plotType) {
   if (plotType == "All")
     plotAll(workspace);
   else
@@ -353,16 +362,17 @@ void IndirectFitOutputOptionsModel::replaceFitResult(
 }
 
 void IndirectFitOutputOptionsModel::replaceFitResult(
-    MatrixWorkspace_sptr inputWorkspace,
-    MatrixWorkspace_sptr singleFitWorkspace, std::string const &outputName) {
-  auto const replaceAlg =
-      replaceAlgorithm(inputWorkspace, singleFitWorkspace, outputName);
+    const MatrixWorkspace_sptr &inputWorkspace,
+    const MatrixWorkspace_sptr &singleFitWorkspace,
+    std::string const &outputName) {
+  auto const replaceAlg = replaceAlgorithm(
+      std::move(inputWorkspace), std::move(singleFitWorkspace), outputName);
   replaceAlg->execute();
   setOutputAsResultWorkspace(replaceAlg);
 }
 
 void IndirectFitOutputOptionsModel::setOutputAsResultWorkspace(
-    IAlgorithm_sptr algorithm) {
+    const IAlgorithm_sptr &algorithm) {
   auto const outputName = algorithm->getPropertyValue("OutputWorkspace");
   auto const output = getADSMatrixWorkspace(outputName);
   setResultWorkspace(findGroupWorkspaceContaining(output));
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitOutputOptionsModel.h b/qt/scientific_interfaces/Indirect/IndirectFitOutputOptionsModel.h
index 70f9c115426..958fc3823a1 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitOutputOptionsModel.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitOutputOptionsModel.h
@@ -59,25 +59,29 @@ public:
                         std::string const &outputName) override;
 
 private:
-  void plotResult(Mantid::API::WorkspaceGroup_const_sptr groupWorkspace,
+  void plotResult(const Mantid::API::WorkspaceGroup_const_sptr &groupWorkspace,
                   std::string const &plotType);
-  void plotAll(Mantid::API::WorkspaceGroup_const_sptr groupWorkspace);
-  void plotAll(Mantid::API::MatrixWorkspace_const_sptr workspace);
-  void plotAllSpectra(Mantid::API::MatrixWorkspace_const_sptr workspace);
-  void plotParameter(Mantid::API::WorkspaceGroup_const_sptr groupWorkspace,
-                     std::string const &parameter);
-  void plotParameter(Mantid::API::MatrixWorkspace_const_sptr workspace,
+  void plotAll(const Mantid::API::WorkspaceGroup_const_sptr &groupWorkspace);
+  void plotAll(const Mantid::API::MatrixWorkspace_const_sptr &workspace);
+  void plotAllSpectra(const Mantid::API::MatrixWorkspace_const_sptr &workspace);
+  void
+  plotParameter(const Mantid::API::WorkspaceGroup_const_sptr &groupWorkspace,
+                std::string const &parameter);
+  void plotParameter(const Mantid::API::MatrixWorkspace_const_sptr &workspace,
                      std::string const &parameter);
-  void plotParameterSpectrum(Mantid::API::MatrixWorkspace_const_sptr workspace,
-                             std::string const &parameter);
+  void plotParameterSpectrum(
+      const Mantid::API::MatrixWorkspace_const_sptr &workspace,
+      std::string const &parameter);
 
-  void plotPDF(Mantid::API::MatrixWorkspace_const_sptr workspace,
+  void plotPDF(const Mantid::API::MatrixWorkspace_const_sptr &workspace,
                std::string const &plotType);
 
-  void replaceFitResult(Mantid::API::MatrixWorkspace_sptr inputWorkspace,
-                        Mantid::API::MatrixWorkspace_sptr singleFitWorkspace,
-                        std::string const &outputName);
-  void setOutputAsResultWorkspace(Mantid::API::IAlgorithm_sptr algorithm);
+  void
+  replaceFitResult(const Mantid::API::MatrixWorkspace_sptr &inputWorkspace,
+                   const Mantid::API::MatrixWorkspace_sptr &singleFitWorkspace,
+                   std::string const &outputName);
+  void
+  setOutputAsResultWorkspace(const Mantid::API::IAlgorithm_sptr &algorithm);
   void setResultWorkspace(std::string const &groupName);
 
   Mantid::API::WorkspaceGroup_sptr m_resultGroup;
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitOutputOptionsPresenter.cpp b/qt/scientific_interfaces/Indirect/IndirectFitOutputOptionsPresenter.cpp
index 9cb4003e07f..01a58541e88 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitOutputOptionsPresenter.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitOutputOptionsPresenter.cpp
@@ -6,6 +6,8 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "IndirectFitOutputOptionsPresenter.h"
 
+#include <utility>
+
 using namespace Mantid::API;
 
 namespace MantidQt {
@@ -56,12 +58,12 @@ void IndirectFitOutputOptionsPresenter::setAvailablePlotOptions(
 
 void IndirectFitOutputOptionsPresenter::setResultWorkspace(
     WorkspaceGroup_sptr groupWorkspace) {
-  m_model->setResultWorkspace(groupWorkspace);
+  m_model->setResultWorkspace(std::move(groupWorkspace));
 }
 
 void IndirectFitOutputOptionsPresenter::setPDFWorkspace(
     WorkspaceGroup_sptr groupWorkspace) {
-  m_model->setPDFWorkspace(groupWorkspace);
+  m_model->setPDFWorkspace(std::move(groupWorkspace));
 }
 
 void IndirectFitOutputOptionsPresenter::setPlotWorkspaces() {
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPlotModel.cpp b/qt/scientific_interfaces/Indirect/IndirectFitPlotModel.cpp
index 897f137a9e4..e0663de8ace 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPlotModel.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPlotModel.cpp
@@ -6,6 +6,8 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "IndirectFitPlotModel.h"
 
+#include <utility>
+
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/FunctionDomain1D.h"
@@ -25,9 +27,10 @@ IFunction_sptr firstFunctionWithParameter(IFunction_sptr function,
                                           const std::string &category,
                                           const std::string &parameterName);
 
-IFunction_sptr firstFunctionWithParameter(CompositeFunction_sptr composite,
-                                          const std::string &category,
-                                          const std::string &parameterName) {
+IFunction_sptr
+firstFunctionWithParameter(const CompositeFunction_sptr &composite,
+                           const std::string &category,
+                           const std::string &parameterName) {
   for (auto i = 0u; i < composite->nFunctions(); ++i) {
     const auto value = firstFunctionWithParameter(composite->getFunction(i),
                                                   category, parameterName);
@@ -50,7 +53,7 @@ IFunction_sptr firstFunctionWithParameter(IFunction_sptr function,
   return nullptr;
 }
 
-boost::optional<double> firstParameterValue(IFunction_sptr function,
+boost::optional<double> firstParameterValue(const IFunction_sptr &function,
                                             const std::string &category,
                                             const std::string &parameterName) {
   if (!function)
@@ -63,22 +66,24 @@ boost::optional<double> firstParameterValue(IFunction_sptr function,
   return boost::none;
 }
 
-boost::optional<double> findFirstPeakCentre(IFunction_sptr function) {
-  return firstParameterValue(function, "Peak", "PeakCentre");
+boost::optional<double> findFirstPeakCentre(const IFunction_sptr &function) {
+  return firstParameterValue(std::move(function), "Peak", "PeakCentre");
 }
 
-boost::optional<double> findFirstFWHM(IFunction_sptr function) {
-  return firstParameterValue(function, "Peak", "FWHM");
+boost::optional<double> findFirstFWHM(const IFunction_sptr &function) {
+  return firstParameterValue(std::move(function), "Peak", "FWHM");
 }
 
-boost::optional<double> findFirstBackgroundLevel(IFunction_sptr function) {
-  return firstParameterValue(function, "Background", "A0");
+boost::optional<double>
+findFirstBackgroundLevel(const IFunction_sptr &function) {
+  return firstParameterValue(std::move(function), "Background", "A0");
 }
 
-void setFunctionParameters(IFunction_sptr function, const std::string &category,
+void setFunctionParameters(const IFunction_sptr &function,
+                           const std::string &category,
                            const std::string &parameterName, double value);
 
-void setFunctionParameters(CompositeFunction_sptr composite,
+void setFunctionParameters(const CompositeFunction_sptr &composite,
                            const std::string &category,
                            const std::string &parameterName, double value) {
   for (auto i = 0u; i < composite->nFunctions(); ++i)
@@ -86,7 +91,8 @@ void setFunctionParameters(CompositeFunction_sptr composite,
                           value);
 }
 
-void setFunctionParameters(IFunction_sptr function, const std::string &category,
+void setFunctionParameters(const IFunction_sptr &function,
+                           const std::string &category,
                            const std::string &parameterName, double value) {
   if (function->category() == category && function->hasParameter(parameterName))
     function->setParameter(parameterName, value);
@@ -96,7 +102,7 @@ void setFunctionParameters(IFunction_sptr function, const std::string &category,
     setFunctionParameters(composite, category, parameterName, value);
 }
 
-void setFunctionParameters(MultiDomainFunction_sptr function,
+void setFunctionParameters(const MultiDomainFunction_sptr &function,
                            const std::string &category,
                            const std::string &parameterName, double value) {
   for (size_t i = 0u; i < function->nFunctions(); ++i)
@@ -105,11 +111,11 @@ void setFunctionParameters(MultiDomainFunction_sptr function,
 }
 
 void setFirstBackground(IFunction_sptr function, double value) {
-  firstFunctionWithParameter(function, "Background", "A0")
+  firstFunctionWithParameter(std::move(function), "Background", "A0")
       ->setParameter("A0", value);
 }
 
-MatrixWorkspace_sptr castToMatrixWorkspace(Workspace_sptr workspace) {
+MatrixWorkspace_sptr castToMatrixWorkspace(const Workspace_sptr &workspace) {
   return boost::dynamic_pointer_cast<MatrixWorkspace>(workspace);
 }
 
@@ -297,9 +303,9 @@ MatrixWorkspace_sptr IndirectFitPlotModel::getGuessWorkspace() const {
 }
 
 MatrixWorkspace_sptr IndirectFitPlotModel::appendGuessToInput(
-    MatrixWorkspace_sptr guessWorkspace) const {
+    const MatrixWorkspace_sptr &guessWorkspace) const {
   const auto range = getGuessRange();
-  return createInputAndGuessWorkspace(getWorkspace(), guessWorkspace,
+  return createInputAndGuessWorkspace(getWorkspace(), std::move(guessWorkspace),
                                       m_activeSpectrum.value, range.first,
                                       range.second);
 }
@@ -311,8 +317,9 @@ std::pair<double, double> IndirectFitPlotModel::getGuessRange() const {
 }
 
 MatrixWorkspace_sptr IndirectFitPlotModel::createInputAndGuessWorkspace(
-    MatrixWorkspace_sptr inputWS, MatrixWorkspace_sptr guessWorkspace,
-    int spectrum, double startX, double endX) const {
+    const MatrixWorkspace_sptr &inputWS,
+    const MatrixWorkspace_sptr &guessWorkspace, int spectrum, double startX,
+    double endX) const {
   guessWorkspace->setInstrument(inputWS->getInstrument());
   guessWorkspace->replaceAxis(
       0,
@@ -331,10 +338,9 @@ MatrixWorkspace_sptr IndirectFitPlotModel::createInputAndGuessWorkspace(
   return inputAndGuess;
 }
 
-MatrixWorkspace_sptr
-IndirectFitPlotModel::createGuessWorkspace(MatrixWorkspace_sptr inputWorkspace,
-                                           IFunction_const_sptr func,
-                                           double startX, double endX) const {
+MatrixWorkspace_sptr IndirectFitPlotModel::createGuessWorkspace(
+    const MatrixWorkspace_sptr &inputWorkspace,
+    const IFunction_const_sptr &func, double startX, double endX) const {
   IAlgorithm_sptr createWsAlg =
       AlgorithmManager::Instance().create("EvaluateFunction");
   createWsAlg->initialize();
@@ -354,7 +360,7 @@ IndirectFitPlotModel::createGuessWorkspace(MatrixWorkspace_sptr inputWorkspace,
 }
 
 std::vector<double>
-IndirectFitPlotModel::computeOutput(IFunction_const_sptr func,
+IndirectFitPlotModel::computeOutput(const IFunction_const_sptr &func,
                                     const std::vector<double> &dataX) const {
   if (dataX.empty())
     return std::vector<double>();
@@ -385,7 +391,7 @@ IAlgorithm_sptr IndirectFitPlotModel::createWorkspaceAlgorithm(
 }
 
 MatrixWorkspace_sptr
-IndirectFitPlotModel::extractSpectra(MatrixWorkspace_sptr inputWS,
+IndirectFitPlotModel::extractSpectra(const MatrixWorkspace_sptr &inputWS,
                                      int startIndex, int endIndex,
                                      double startX, double endX) const {
   auto extractSpectraAlg =
@@ -403,9 +409,9 @@ IndirectFitPlotModel::extractSpectra(MatrixWorkspace_sptr inputWS,
   return extractSpectraAlg->getProperty("OutputWorkspace");
 }
 
-MatrixWorkspace_sptr
-IndirectFitPlotModel::appendSpectra(MatrixWorkspace_sptr inputWS,
-                                    MatrixWorkspace_sptr spectraWS) const {
+MatrixWorkspace_sptr IndirectFitPlotModel::appendSpectra(
+    const MatrixWorkspace_sptr &inputWS,
+    const MatrixWorkspace_sptr &spectraWS) const {
   auto appendSpectraAlg = AlgorithmManager::Instance().create("AppendSpectra");
   appendSpectraAlg->initialize();
   appendSpectraAlg->setChild(true);
@@ -418,8 +424,8 @@ IndirectFitPlotModel::appendSpectra(MatrixWorkspace_sptr inputWS,
 }
 
 MatrixWorkspace_sptr
-IndirectFitPlotModel::cropWorkspace(MatrixWorkspace_sptr inputWS, double startX,
-                                    double endX, int startIndex,
+IndirectFitPlotModel::cropWorkspace(const MatrixWorkspace_sptr &inputWS,
+                                    double startX, double endX, int startIndex,
                                     int endIndex) const {
   const auto cropAlg = AlgorithmManager::Instance().create("CropWorkspace");
   cropAlg->initialize();
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPlotModel.h b/qt/scientific_interfaces/Indirect/IndirectFitPlotModel.h
index 58c37cc0b16..9d8603612c1 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPlotModel.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPlotModel.h
@@ -30,8 +30,8 @@ public:
   Mantid::API::MatrixWorkspace_sptr getGuessWorkspace() const;
   Spectra getSpectra() const;
 
-  Mantid::API::MatrixWorkspace_sptr
-  appendGuessToInput(Mantid::API::MatrixWorkspace_sptr guessWorkspace) const;
+  Mantid::API::MatrixWorkspace_sptr appendGuessToInput(
+      const Mantid::API::MatrixWorkspace_sptr &guessWorkspace) const;
 
   TableDatasetIndex getActiveDataIndex() const;
   WorkspaceIndex getActiveSpectrum() const;
@@ -62,18 +62,19 @@ public:
 private:
   std::pair<double, double> getGuessRange() const;
 
-  Mantid::API::MatrixWorkspace_sptr
-  createInputAndGuessWorkspace(Mantid::API::MatrixWorkspace_sptr inputWS,
-                               Mantid::API::MatrixWorkspace_sptr guessWorkspace,
-                               int spectrum, double startX, double endX) const;
+  Mantid::API::MatrixWorkspace_sptr createInputAndGuessWorkspace(
+      const Mantid::API::MatrixWorkspace_sptr &inputWS,
+      const Mantid::API::MatrixWorkspace_sptr &guessWorkspace, int spectrum,
+      double startX, double endX) const;
 
   Mantid::API::MatrixWorkspace_sptr
-  createGuessWorkspace(Mantid::API::MatrixWorkspace_sptr inputWorkspace,
-                       Mantid::API::IFunction_const_sptr func, double startX,
-                       double endX) const;
+  createGuessWorkspace(const Mantid::API::MatrixWorkspace_sptr &inputWorkspace,
+                       const Mantid::API::IFunction_const_sptr &func,
+                       double startX, double endX) const;
 
-  std::vector<double> computeOutput(Mantid::API::IFunction_const_sptr func,
-                                    const std::vector<double> &dataX) const;
+  std::vector<double>
+  computeOutput(const Mantid::API::IFunction_const_sptr &func,
+                const std::vector<double> &dataX) const;
 
   Mantid::API::IAlgorithm_sptr
   createWorkspaceAlgorithm(std::size_t numberOfSpectra,
@@ -81,15 +82,16 @@ private:
                            const std::vector<double> &dataY) const;
 
   Mantid::API::MatrixWorkspace_sptr
-  extractSpectra(Mantid::API::MatrixWorkspace_sptr inputWS, int startIndex,
-                 int endIndex, double startX, double endX) const;
+  extractSpectra(const Mantid::API::MatrixWorkspace_sptr &inputWS,
+                 int startIndex, int endIndex, double startX,
+                 double endX) const;
 
   Mantid::API::MatrixWorkspace_sptr
-  appendSpectra(Mantid::API::MatrixWorkspace_sptr inputWS,
-                Mantid::API::MatrixWorkspace_sptr spectraWS) const;
+  appendSpectra(const Mantid::API::MatrixWorkspace_sptr &inputWS,
+                const Mantid::API::MatrixWorkspace_sptr &spectraWS) const;
 
   Mantid::API::MatrixWorkspace_sptr
-  cropWorkspace(Mantid::API::MatrixWorkspace_sptr inputWS, double startX,
+  cropWorkspace(const Mantid::API::MatrixWorkspace_sptr &inputWS, double startX,
                 double endX, int startIndex, int endIndex) const;
 
   void deleteWorkspace(const std::string &name) const;
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPlotModelLegacy.cpp b/qt/scientific_interfaces/Indirect/IndirectFitPlotModelLegacy.cpp
index 673c2894e62..b6bd5fc96ce 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPlotModelLegacy.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPlotModelLegacy.cpp
@@ -6,6 +6,8 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "IndirectFitPlotModelLegacy.h"
 
+#include <utility>
+
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/CompositeFunction.h"
@@ -25,9 +27,10 @@ IFunction_sptr firstFunctionWithParameter(IFunction_sptr function,
                                           const std::string &category,
                                           const std::string &parameterName);
 
-IFunction_sptr firstFunctionWithParameter(CompositeFunction_sptr composite,
-                                          const std::string &category,
-                                          const std::string &parameterName) {
+IFunction_sptr
+firstFunctionWithParameter(const CompositeFunction_sptr &composite,
+                           const std::string &category,
+                           const std::string &parameterName) {
   for (auto i = 0u; i < composite->nFunctions(); ++i) {
     const auto value = firstFunctionWithParameter(composite->getFunction(i),
                                                   category, parameterName);
@@ -50,7 +53,7 @@ IFunction_sptr firstFunctionWithParameter(IFunction_sptr function,
   return nullptr;
 }
 
-boost::optional<double> firstParameterValue(IFunction_sptr function,
+boost::optional<double> firstParameterValue(const IFunction_sptr &function,
                                             const std::string &category,
                                             const std::string &parameterName) {
   if (!function)
@@ -63,22 +66,24 @@ boost::optional<double> firstParameterValue(IFunction_sptr function,
   return boost::none;
 }
 
-boost::optional<double> findFirstPeakCentre(IFunction_sptr function) {
-  return firstParameterValue(function, "Peak", "PeakCentre");
+boost::optional<double> findFirstPeakCentre(const IFunction_sptr &function) {
+  return firstParameterValue(std::move(function), "Peak", "PeakCentre");
 }
 
-boost::optional<double> findFirstFWHM(IFunction_sptr function) {
-  return firstParameterValue(function, "Peak", "FWHM");
+boost::optional<double> findFirstFWHM(const IFunction_sptr &function) {
+  return firstParameterValue(std::move(function), "Peak", "FWHM");
 }
 
-boost::optional<double> findFirstBackgroundLevel(IFunction_sptr function) {
-  return firstParameterValue(function, "Background", "A0");
+boost::optional<double>
+findFirstBackgroundLevel(const IFunction_sptr &function) {
+  return firstParameterValue(std::move(function), "Background", "A0");
 }
 
-void setFunctionParameters(IFunction_sptr function, const std::string &category,
+void setFunctionParameters(const IFunction_sptr &function,
+                           const std::string &category,
                            const std::string &parameterName, double value);
 
-void setFunctionParameters(CompositeFunction_sptr composite,
+void setFunctionParameters(const CompositeFunction_sptr &composite,
                            const std::string &category,
                            const std::string &parameterName, double value) {
   for (auto i = 0u; i < composite->nFunctions(); ++i)
@@ -86,7 +91,8 @@ void setFunctionParameters(CompositeFunction_sptr composite,
                           value);
 }
 
-void setFunctionParameters(IFunction_sptr function, const std::string &category,
+void setFunctionParameters(const IFunction_sptr &function,
+                           const std::string &category,
                            const std::string &parameterName, double value) {
   if (function->category() == category && function->hasParameter(parameterName))
     function->setParameter(parameterName, value);
@@ -97,11 +103,11 @@ void setFunctionParameters(IFunction_sptr function, const std::string &category,
 }
 
 void setFirstBackground(IFunction_sptr function, double value) {
-  firstFunctionWithParameter(function, "Background", "A0")
+  firstFunctionWithParameter(std::move(function), "Background", "A0")
       ->setParameter("A0", value);
 }
 
-MatrixWorkspace_sptr castToMatrixWorkspace(Workspace_sptr workspace) {
+MatrixWorkspace_sptr castToMatrixWorkspace(const Workspace_sptr &workspace) {
   return boost::dynamic_pointer_cast<MatrixWorkspace>(workspace);
 }
 
@@ -265,10 +271,10 @@ MatrixWorkspace_sptr IndirectFitPlotModelLegacy::getGuessWorkspace() const {
 }
 
 MatrixWorkspace_sptr IndirectFitPlotModelLegacy::appendGuessToInput(
-    MatrixWorkspace_sptr guessWorkspace) const {
+    const MatrixWorkspace_sptr &guessWorkspace) const {
   const auto range = getGuessRange();
   return createInputAndGuessWorkspace(
-      getWorkspace(), guessWorkspace,
+      getWorkspace(), std::move(guessWorkspace),
       boost::numeric_cast<int>(m_activeSpectrum), range.first, range.second);
 }
 
@@ -279,8 +285,9 @@ std::pair<double, double> IndirectFitPlotModelLegacy::getGuessRange() const {
 }
 
 MatrixWorkspace_sptr IndirectFitPlotModelLegacy::createInputAndGuessWorkspace(
-    MatrixWorkspace_sptr inputWS, MatrixWorkspace_sptr guessWorkspace,
-    int spectrum, double startX, double endX) const {
+    const MatrixWorkspace_sptr &inputWS,
+    const MatrixWorkspace_sptr &guessWorkspace, int spectrum, double startX,
+    double endX) const {
   guessWorkspace->setInstrument(inputWS->getInstrument());
   guessWorkspace->replaceAxis(
       0,
@@ -300,8 +307,8 @@ MatrixWorkspace_sptr IndirectFitPlotModelLegacy::createInputAndGuessWorkspace(
 }
 
 MatrixWorkspace_sptr IndirectFitPlotModelLegacy::createGuessWorkspace(
-    MatrixWorkspace_sptr inputWorkspace, IFunction_const_sptr func,
-    double startX, double endX) const {
+    const MatrixWorkspace_sptr &inputWorkspace,
+    const IFunction_const_sptr &func, double startX, double endX) const {
   IAlgorithm_sptr createWsAlg =
       AlgorithmManager::Instance().create("EvaluateFunction");
   createWsAlg->initialize();
@@ -321,7 +328,7 @@ MatrixWorkspace_sptr IndirectFitPlotModelLegacy::createGuessWorkspace(
 }
 
 std::vector<double> IndirectFitPlotModelLegacy::computeOutput(
-    IFunction_const_sptr func, const std::vector<double> &dataX) const {
+    const IFunction_const_sptr &func, const std::vector<double> &dataX) const {
   if (dataX.empty())
     return std::vector<double>();
 
@@ -351,7 +358,7 @@ IAlgorithm_sptr IndirectFitPlotModelLegacy::createWorkspaceAlgorithm(
 }
 
 MatrixWorkspace_sptr
-IndirectFitPlotModelLegacy::extractSpectra(MatrixWorkspace_sptr inputWS,
+IndirectFitPlotModelLegacy::extractSpectra(const MatrixWorkspace_sptr &inputWS,
                                            int startIndex, int endIndex,
                                            double startX, double endX) const {
   auto extractSpectraAlg =
@@ -370,7 +377,8 @@ IndirectFitPlotModelLegacy::extractSpectra(MatrixWorkspace_sptr inputWS,
 }
 
 MatrixWorkspace_sptr IndirectFitPlotModelLegacy::appendSpectra(
-    MatrixWorkspace_sptr inputWS, MatrixWorkspace_sptr spectraWS) const {
+    const MatrixWorkspace_sptr &inputWS,
+    const MatrixWorkspace_sptr &spectraWS) const {
   auto appendSpectraAlg = AlgorithmManager::Instance().create("AppendSpectra");
   appendSpectraAlg->initialize();
   appendSpectraAlg->setChild(true);
@@ -383,7 +391,7 @@ MatrixWorkspace_sptr IndirectFitPlotModelLegacy::appendSpectra(
 }
 
 MatrixWorkspace_sptr
-IndirectFitPlotModelLegacy::cropWorkspace(MatrixWorkspace_sptr inputWS,
+IndirectFitPlotModelLegacy::cropWorkspace(const MatrixWorkspace_sptr &inputWS,
                                           double startX, double endX,
                                           int startIndex, int endIndex) const {
   const auto cropAlg = AlgorithmManager::Instance().create("CropWorkspace");
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPlotModelLegacy.h b/qt/scientific_interfaces/Indirect/IndirectFitPlotModelLegacy.h
index 3f8cfc43e8e..2da0b9fa59b 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPlotModelLegacy.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPlotModelLegacy.h
@@ -29,8 +29,8 @@ public:
   Mantid::API::MatrixWorkspace_sptr getGuessWorkspace() const;
   SpectraLegacy getSpectra() const;
 
-  Mantid::API::MatrixWorkspace_sptr
-  appendGuessToInput(Mantid::API::MatrixWorkspace_sptr guessWorkspace) const;
+  Mantid::API::MatrixWorkspace_sptr appendGuessToInput(
+      const Mantid::API::MatrixWorkspace_sptr &guessWorkspace) const;
 
   std::size_t getActiveDataIndex() const;
   std::size_t getActiveSpectrum() const;
@@ -60,18 +60,19 @@ public:
 private:
   std::pair<double, double> getGuessRange() const;
 
-  Mantid::API::MatrixWorkspace_sptr
-  createInputAndGuessWorkspace(Mantid::API::MatrixWorkspace_sptr inputWS,
-                               Mantid::API::MatrixWorkspace_sptr guessWorkspace,
-                               int spectrum, double startX, double endX) const;
+  Mantid::API::MatrixWorkspace_sptr createInputAndGuessWorkspace(
+      const Mantid::API::MatrixWorkspace_sptr &inputWS,
+      const Mantid::API::MatrixWorkspace_sptr &guessWorkspace, int spectrum,
+      double startX, double endX) const;
 
   Mantid::API::MatrixWorkspace_sptr
-  createGuessWorkspace(Mantid::API::MatrixWorkspace_sptr inputWorkspace,
-                       Mantid::API::IFunction_const_sptr func, double startX,
-                       double endX) const;
+  createGuessWorkspace(const Mantid::API::MatrixWorkspace_sptr &inputWorkspace,
+                       const Mantid::API::IFunction_const_sptr &func,
+                       double startX, double endX) const;
 
-  std::vector<double> computeOutput(Mantid::API::IFunction_const_sptr func,
-                                    const std::vector<double> &dataX) const;
+  std::vector<double>
+  computeOutput(const Mantid::API::IFunction_const_sptr &func,
+                const std::vector<double> &dataX) const;
 
   Mantid::API::IAlgorithm_sptr
   createWorkspaceAlgorithm(std::size_t numberOfSpectra,
@@ -79,15 +80,16 @@ private:
                            const std::vector<double> &dataY) const;
 
   Mantid::API::MatrixWorkspace_sptr
-  extractSpectra(Mantid::API::MatrixWorkspace_sptr inputWS, int startIndex,
-                 int endIndex, double startX, double endX) const;
+  extractSpectra(const Mantid::API::MatrixWorkspace_sptr &inputWS,
+                 int startIndex, int endIndex, double startX,
+                 double endX) const;
 
   Mantid::API::MatrixWorkspace_sptr
-  appendSpectra(Mantid::API::MatrixWorkspace_sptr inputWS,
-                Mantid::API::MatrixWorkspace_sptr spectraWS) const;
+  appendSpectra(const Mantid::API::MatrixWorkspace_sptr &inputWS,
+                const Mantid::API::MatrixWorkspace_sptr &spectraWS) const;
 
   Mantid::API::MatrixWorkspace_sptr
-  cropWorkspace(Mantid::API::MatrixWorkspace_sptr inputWS, double startX,
+  cropWorkspace(const Mantid::API::MatrixWorkspace_sptr &inputWS, double startX,
                 double endX, int startIndex, int endIndex) const;
 
   void deleteWorkspace(const std::string &name) const;
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenter.cpp b/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenter.cpp
index fec31eb06db..bfcea94e63e 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenter.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenter.cpp
@@ -9,6 +9,7 @@
 #include "MantidQtWidgets/Common/SignalBlocker.h"
 
 #include <QTimer>
+#include <utility>
 
 namespace {
 using MantidQt::CustomInterfaces::IDA::IIndirectFitPlotView;
@@ -278,17 +279,17 @@ void IndirectFitPlotPresenter::plotLines() {
 }
 
 void IndirectFitPlotPresenter::plotInput(MatrixWorkspace_sptr workspace) {
-  plotInput(workspace, m_model->getActiveSpectrum());
+  plotInput(std::move(workspace), m_model->getActiveSpectrum());
   if (auto doGuess = m_view->isPlotGuessChecked())
     plotGuess(doGuess);
 }
 
 void IndirectFitPlotPresenter::plotInput(MatrixWorkspace_sptr workspace,
                                          WorkspaceIndex spectrum) {
-  m_view->plotInTopPreview("Sample", workspace, spectrum, Qt::black);
+  m_view->plotInTopPreview("Sample", std::move(workspace), spectrum, Qt::black);
 }
 
-void IndirectFitPlotPresenter::plotFit(MatrixWorkspace_sptr workspace) {
+void IndirectFitPlotPresenter::plotFit(const MatrixWorkspace_sptr &workspace) {
   plotInput(workspace, WorkspaceIndex{0});
   if (auto doGuess = m_view->isPlotGuessChecked())
     plotGuess(doGuess);
@@ -298,12 +299,13 @@ void IndirectFitPlotPresenter::plotFit(MatrixWorkspace_sptr workspace) {
 
 void IndirectFitPlotPresenter::plotFit(MatrixWorkspace_sptr workspace,
                                        WorkspaceIndex spectrum) {
-  m_view->plotInTopPreview("Fit", workspace, spectrum, Qt::red);
+  m_view->plotInTopPreview("Fit", std::move(workspace), spectrum, Qt::red);
 }
 
 void IndirectFitPlotPresenter::plotDifference(MatrixWorkspace_sptr workspace,
                                               WorkspaceIndex spectrum) {
-  m_view->plotInBottomPreview("Difference", workspace, spectrum, Qt::blue);
+  m_view->plotInBottomPreview("Difference", std::move(workspace), spectrum,
+                              Qt::blue);
 }
 
 void IndirectFitPlotPresenter::updatePlotRange(
@@ -360,11 +362,12 @@ void IndirectFitPlotPresenter::plotGuess(bool doPlotGuess) {
 
 void IndirectFitPlotPresenter::plotGuess(
     Mantid::API::MatrixWorkspace_sptr workspace) {
-  m_view->plotInTopPreview("Guess", workspace, WorkspaceIndex{0}, Qt::green);
+  m_view->plotInTopPreview("Guess", std::move(workspace), WorkspaceIndex{0},
+                           Qt::green);
 }
 
 void IndirectFitPlotPresenter::plotGuessInSeparateWindow(
-    Mantid::API::MatrixWorkspace_sptr workspace) {
+    const Mantid::API::MatrixWorkspace_sptr &workspace) {
   m_plotExternalGuessRunner.addCallback(
       [this, workspace]() { m_model->appendGuessToInput(workspace); });
 }
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenter.h b/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenter.h
index 6c4bc0f96a2..0a4218be8eb 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenter.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenter.h
@@ -91,7 +91,7 @@ private:
   void plotInput(Mantid::API::MatrixWorkspace_sptr workspace);
   void plotInput(Mantid::API::MatrixWorkspace_sptr workspace,
                  WorkspaceIndex spectrum);
-  void plotFit(Mantid::API::MatrixWorkspace_sptr workspace);
+  void plotFit(const Mantid::API::MatrixWorkspace_sptr &workspace);
   void plotFit(Mantid::API::MatrixWorkspace_sptr workspace,
                WorkspaceIndex spectrum);
   void plotDifference(Mantid::API::MatrixWorkspace_sptr workspace,
@@ -100,7 +100,8 @@ private:
   void clearFit();
   void clearDifference();
   void plotGuess(Mantid::API::MatrixWorkspace_sptr workspace);
-  void plotGuessInSeparateWindow(Mantid::API::MatrixWorkspace_sptr workspace);
+  void
+  plotGuessInSeparateWindow(const Mantid::API::MatrixWorkspace_sptr &workspace);
   void plotLines();
   void updatePlotRange(const std::pair<double, double> &range);
   void clearGuess();
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenterLegacy.cpp b/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenterLegacy.cpp
index b3ab5fe5f99..1039289f86d 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenterLegacy.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenterLegacy.cpp
@@ -9,6 +9,7 @@
 #include "MantidQtWidgets/Common/SignalBlocker.h"
 
 #include <QTimer>
+#include <utility>
 
 namespace {
 using MantidQt::CustomInterfaces::IDA::DiscontinuousSpectra;
@@ -264,17 +265,18 @@ void IndirectFitPlotPresenterLegacy::plotLines() {
 }
 
 void IndirectFitPlotPresenterLegacy::plotInput(MatrixWorkspace_sptr workspace) {
-  plotInput(workspace, m_model->getActiveSpectrum());
+  plotInput(std::move(workspace), m_model->getActiveSpectrum());
   if (auto doGuess = m_view->isPlotGuessChecked())
     plotGuess(doGuess);
 }
 
 void IndirectFitPlotPresenterLegacy::plotInput(MatrixWorkspace_sptr workspace,
                                                std::size_t spectrum) {
-  m_view->plotInTopPreview("Sample", workspace, spectrum, Qt::black);
+  m_view->plotInTopPreview("Sample", std::move(workspace), spectrum, Qt::black);
 }
 
-void IndirectFitPlotPresenterLegacy::plotFit(MatrixWorkspace_sptr workspace) {
+void IndirectFitPlotPresenterLegacy::plotFit(
+    const MatrixWorkspace_sptr &workspace) {
   plotInput(workspace, 0);
   if (auto doGuess = m_view->isPlotGuessChecked())
     plotGuess(doGuess);
@@ -284,12 +286,13 @@ void IndirectFitPlotPresenterLegacy::plotFit(MatrixWorkspace_sptr workspace) {
 
 void IndirectFitPlotPresenterLegacy::plotFit(MatrixWorkspace_sptr workspace,
                                              std::size_t spectrum) {
-  m_view->plotInTopPreview("Fit", workspace, spectrum, Qt::red);
+  m_view->plotInTopPreview("Fit", std::move(workspace), spectrum, Qt::red);
 }
 
 void IndirectFitPlotPresenterLegacy::plotDifference(
     MatrixWorkspace_sptr workspace, std::size_t spectrum) {
-  m_view->plotInBottomPreview("Difference", workspace, spectrum, Qt::blue);
+  m_view->plotInBottomPreview("Difference", std::move(workspace), spectrum,
+                              Qt::blue);
 }
 
 void IndirectFitPlotPresenterLegacy::updatePlotRange(
@@ -346,11 +349,11 @@ void IndirectFitPlotPresenterLegacy::plotGuess(bool doPlotGuess) {
 
 void IndirectFitPlotPresenterLegacy::plotGuess(
     Mantid::API::MatrixWorkspace_sptr workspace) {
-  m_view->plotInTopPreview("Guess", workspace, 0, Qt::green);
+  m_view->plotInTopPreview("Guess", std::move(workspace), 0, Qt::green);
 }
 
 void IndirectFitPlotPresenterLegacy::plotGuessInSeparateWindow(
-    Mantid::API::MatrixWorkspace_sptr workspace) {
+    const Mantid::API::MatrixWorkspace_sptr &workspace) {
   m_plotExternalGuessRunner.addCallback(
       [this, workspace]() { m_model->appendGuessToInput(workspace); });
 }
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenterLegacy.h b/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenterLegacy.h
index 35baeea08b4..b893ba19b8a 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenterLegacy.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPlotPresenterLegacy.h
@@ -85,13 +85,14 @@ private:
   void plotInput(Mantid::API::MatrixWorkspace_sptr workspace);
   void plotInput(Mantid::API::MatrixWorkspace_sptr workspace,
                  std::size_t spectrum);
-  void plotFit(Mantid::API::MatrixWorkspace_sptr workspace);
+  void plotFit(const Mantid::API::MatrixWorkspace_sptr &workspace);
   void plotFit(Mantid::API::MatrixWorkspace_sptr workspace,
                std::size_t spectrum);
   void plotDifference(Mantid::API::MatrixWorkspace_sptr workspace,
                       std::size_t spectrum);
   void plotGuess(Mantid::API::MatrixWorkspace_sptr workspace);
-  void plotGuessInSeparateWindow(Mantid::API::MatrixWorkspace_sptr workspace);
+  void
+  plotGuessInSeparateWindow(const Mantid::API::MatrixWorkspace_sptr &workspace);
   void plotLines();
   void updatePlotRange(const std::pair<double, double> &range);
   void clearGuess();
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPlotView.h b/qt/scientific_interfaces/Indirect/IndirectFitPlotView.h
index 49fda6350e2..f2c750704e0 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPlotView.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPlotView.h
@@ -19,6 +19,7 @@
 #include <QSplitterHandle>
 #endif
 #include <QSplitter>
+#include <utility>
 
 namespace MantidQt {
 namespace CustomInterfaces {
@@ -30,7 +31,7 @@ class SplitterHandle : public QSplitterHandle {
 public:
   SplitterHandle(QIcon icon, Qt::Orientation orientation,
                  QSplitter *parent = nullptr)
-      : QSplitterHandle(orientation, parent), m_icon(icon) {}
+      : QSplitterHandle(orientation, parent), m_icon(std::move(icon)) {}
 
   void paintEvent(QPaintEvent *e) override {
     QSplitterHandle::paintEvent(e);
@@ -47,7 +48,7 @@ private:
 class Splitter : public QSplitter {
 public:
   Splitter(QIcon icon, QWidget *parent = nullptr)
-      : QSplitter(parent), m_icon(icon) {}
+      : QSplitter(parent), m_icon(std::move(icon)) {}
 
   QSplitterHandle *createHandle() override {
     return new SplitterHandle(m_icon, Qt::Vertical, this);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPlotViewLegacy.h b/qt/scientific_interfaces/Indirect/IndirectFitPlotViewLegacy.h
index 7a079933b43..541d4947303 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPlotViewLegacy.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPlotViewLegacy.h
@@ -19,6 +19,7 @@
 #include <QSplitterHandle>
 #endif
 #include <QSplitter>
+#include <utility>
 
 namespace MantidQt {
 namespace CustomInterfaces {
@@ -30,7 +31,7 @@ class SplitterHandleLegacy : public QSplitterHandle {
 public:
   SplitterHandleLegacy(QIcon icon, Qt::Orientation orientation,
                        QSplitter *parent = nullptr)
-      : QSplitterHandle(orientation, parent), m_icon(icon) {}
+      : QSplitterHandle(orientation, parent), m_icon(std::move(icon)) {}
 
   void paintEvent(QPaintEvent *e) override {
     QSplitterHandle::paintEvent(e);
@@ -47,7 +48,7 @@ private:
 class SplitterLegacy : public QSplitter {
 public:
   SplitterLegacy(QIcon icon, QWidget *parent = nullptr)
-      : QSplitter(parent), m_icon(icon) {}
+      : QSplitter(parent), m_icon(std::move(icon)) {}
 
   QSplitterHandle *createHandle() override {
     return new SplitterHandleLegacy(m_icon, Qt::Vertical, this);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPropertyBrowser.cpp b/qt/scientific_interfaces/Indirect/IndirectFitPropertyBrowser.cpp
index 69209c537e8..1471c62ee51 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPropertyBrowser.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPropertyBrowser.cpp
@@ -318,7 +318,8 @@ void IndirectFitPropertyBrowser::clear() {
  * Updates the plot guess feature in this indirect fit property browser.
  * @param sampleWorkspace :: The workspace loaded as sample
  */
-void IndirectFitPropertyBrowser::updatePlotGuess(MatrixWorkspace_const_sptr) {}
+void IndirectFitPropertyBrowser::updatePlotGuess(
+    const MatrixWorkspace_const_sptr &) {}
 
 void IndirectFitPropertyBrowser::setErrorsEnabled(bool enabled) {
   m_functionBrowser->setErrorsEnabled(enabled);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFitPropertyBrowser.h b/qt/scientific_interfaces/Indirect/IndirectFitPropertyBrowser.h
index 369dfdfa8d6..80fbebee9fb 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFitPropertyBrowser.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFitPropertyBrowser.h
@@ -66,7 +66,7 @@ public:
       TableRowIndex nData, const QStringList &datasetNames,
       const std::vector<double> &qValues,
       const std::vector<std::pair<std::string, int>> &fitResolutions);
-  void updatePlotGuess(MatrixWorkspace_const_sptr sampleWorkspace);
+  void updatePlotGuess(const MatrixWorkspace_const_sptr &sampleWorkspace);
   void setErrorsEnabled(bool enabled);
   void
   updateParameterEstimationData(DataForParameterEstimationCollection &&data);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFittingModel.cpp b/qt/scientific_interfaces/Indirect/IndirectFittingModel.cpp
index 2a4bf65eefd..67a5e0b8db4 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFittingModel.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFittingModel.cpp
@@ -19,6 +19,7 @@
 #include <set>
 
 #include <boost/algorithm/string.hpp>
+#include <utility>
 
 using namespace Mantid::API;
 using IDAWorkspaceIndex = MantidQt::CustomInterfaces::IDA::WorkspaceIndex;
@@ -37,8 +38,8 @@ std::string cutLastOf(std::string const &str, std::string const &delimiter) {
   return str;
 }
 
-bool equivalentWorkspaces(MatrixWorkspace_const_sptr lhs,
-                          MatrixWorkspace_const_sptr rhs) {
+bool equivalentWorkspaces(const MatrixWorkspace_const_sptr &lhs,
+                          const MatrixWorkspace_const_sptr &rhs) {
   if (!lhs || !rhs)
     return false;
   else if (lhs->getName() == "" && rhs->getName() == "")
@@ -50,8 +51,8 @@ bool equivalentWorkspaces(MatrixWorkspace_const_sptr lhs,
  * @return  True if the first function precedes the second when ordering by
  *          name.
  */
-bool functionNameComparator(IFunction_const_sptr first,
-                            IFunction_const_sptr second) {
+bool functionNameComparator(const IFunction_const_sptr &first,
+                            const IFunction_const_sptr &second) {
   return first->name() < second->name();
 }
 
@@ -72,8 +73,8 @@ extractFunctions(const CompositeFunction &composite) {
   return functions;
 }
 
-bool equivalentFunctions(IFunction_const_sptr func1,
-                         IFunction_const_sptr func2);
+bool equivalentFunctions(const IFunction_const_sptr &func1,
+                         const IFunction_const_sptr &func2);
 
 /*
  * Checks whether the specified composite functions have the same composition.
@@ -111,8 +112,8 @@ bool equivalentComposites(const CompositeFunction &composite1,
  * @return      True if the specified functions have the same composition,
  *              False otherwise.
  */
-bool equivalentFunctions(IFunction_const_sptr func1,
-                         IFunction_const_sptr func2) {
+bool equivalentFunctions(const IFunction_const_sptr &func1,
+                         const IFunction_const_sptr &func2) {
   const auto composite1 =
       boost::dynamic_pointer_cast<const CompositeFunction>(func1);
   const auto composite2 =
@@ -147,8 +148,8 @@ constructInputString(const IndirectFitDataCollectionType &fittingData) {
   return input.str();
 }
 
-void addInputDataToSimultaneousFit(IAlgorithm_sptr fitAlgorithm,
-                                   MatrixWorkspace_sptr workspace,
+void addInputDataToSimultaneousFit(const IAlgorithm_sptr &fitAlgorithm,
+                                   const MatrixWorkspace_sptr &workspace,
                                    IDAWorkspaceIndex spectrum,
                                    const std::pair<double, double> &xRange,
                                    const std::vector<double> &excludeRegions,
@@ -192,7 +193,7 @@ void addInputDataToSimultaneousFit(
 }
 
 void addInputDataToSimultaneousFit(
-    IAlgorithm_sptr fitAlgorithm,
+    const IAlgorithm_sptr &fitAlgorithm,
     const IndirectFitDataCollectionType &fittingData) {
   std::size_t counter = 0;
   for (const auto &data : fittingData)
@@ -200,7 +201,7 @@ void addInputDataToSimultaneousFit(
 }
 
 void addInputDataToSimultaneousFit(
-    IAlgorithm_sptr fitAlgorithm,
+    const IAlgorithm_sptr &fitAlgorithm,
     const IndirectFitDataCollectionType &fittingData,
     const std::pair<double, double> &range,
     const std::vector<double> &exclude) {
@@ -216,7 +217,7 @@ template <typename Map> Map combine(const Map &mapA, const Map &mapB) {
 }
 
 std::unordered_map<std::string, std::string>
-shortToLongParameterNames(IFunction_sptr function) {
+shortToLongParameterNames(const IFunction_sptr &function) {
   std::unordered_map<std::string, std::string> shortToLong;
   for (const auto &name : function->getParameterNames())
     shortToLong[name.substr(name.rfind(".") + 1)] = name;
@@ -279,26 +280,29 @@ IFunction_sptr extractFirstInnerFunction(const std::string &function) {
 
 template <typename WorkspaceType>
 boost::shared_ptr<WorkspaceType>
-getWorkspaceOutput(IAlgorithm_sptr algorithm, const std::string &propertyName) {
+getWorkspaceOutput(const IAlgorithm_sptr &algorithm,
+                   const std::string &propertyName) {
   return AnalysisDataService::Instance().retrieveWS<WorkspaceType>(
       algorithm->getProperty(propertyName));
 }
 
-WorkspaceGroup_sptr getOutputResult(IAlgorithm_sptr algorithm) {
-  return getWorkspaceOutput<WorkspaceGroup>(algorithm, "OutputWorkspace");
+WorkspaceGroup_sptr getOutputResult(const IAlgorithm_sptr &algorithm) {
+  return getWorkspaceOutput<WorkspaceGroup>(std::move(algorithm),
+                                            "OutputWorkspace");
 }
 
-ITableWorkspace_sptr getOutputParameters(IAlgorithm_sptr algorithm) {
-  return getWorkspaceOutput<ITableWorkspace>(algorithm,
+ITableWorkspace_sptr getOutputParameters(const IAlgorithm_sptr &algorithm) {
+  return getWorkspaceOutput<ITableWorkspace>(std::move(algorithm),
                                              "OutputParameterWorkspace");
 }
 
-WorkspaceGroup_sptr getOutputGroup(IAlgorithm_sptr algorithm) {
-  return getWorkspaceOutput<WorkspaceGroup>(algorithm, "OutputWorkspaceGroup");
+WorkspaceGroup_sptr getOutputGroup(const IAlgorithm_sptr &algorithm) {
+  return getWorkspaceOutput<WorkspaceGroup>(std::move(algorithm),
+                                            "OutputWorkspaceGroup");
 }
 
 void addFitProperties(Mantid::API::IAlgorithm &algorithm,
-                      Mantid::API::IFunction_sptr function,
+                      const Mantid::API::IFunction_sptr &function,
                       std::string const &xAxisUnit) {
   algorithm.setProperty("Function", function);
   algorithm.setProperty("ResultXAxisUnit", xAxisUnit);
@@ -576,9 +580,10 @@ void IndirectFittingModel::addWorkspace(MatrixWorkspace_sptr workspace,
     addNewWorkspace(workspace, spectra);
 }
 
-void IndirectFittingModel::addNewWorkspace(MatrixWorkspace_sptr workspace,
-                                           const Spectra &spectra) {
-  m_fittingData.emplace_back(new IndirectFitData(workspace, spectra));
+void IndirectFittingModel::addNewWorkspace(
+    const MatrixWorkspace_sptr &workspace, const Spectra &spectra) {
+  m_fittingData.emplace_back(
+      new IndirectFitData(std::move(workspace), spectra));
   m_defaultParameters.emplace_back(
       createDefaultParameters(m_fittingData.last()));
 }
@@ -626,7 +631,7 @@ void IndirectFittingModel::setFittingMode(FittingMode mode) {
 }
 
 void IndirectFittingModel::setFitFunction(MultiDomainFunction_sptr function) {
-  m_activeFunction = function;
+  m_activeFunction = std::move(function);
   m_previousModelSelected = isPreviousModelSelected();
 }
 
@@ -637,10 +642,11 @@ void IndirectFittingModel::setDefaultParameterValue(
 }
 
 void IndirectFittingModel::addOutput(IAlgorithm_sptr fitAlgorithm) {
-  addOutput(fitAlgorithm, m_fittingData.begin(), m_fittingData.end());
+  addOutput(std::move(fitAlgorithm), m_fittingData.begin(),
+            m_fittingData.end());
 }
 
-void IndirectFittingModel::addOutput(IAlgorithm_sptr fitAlgorithm,
+void IndirectFittingModel::addOutput(const IAlgorithm_sptr &fitAlgorithm,
                                      const FitDataIterator &fitDataBegin,
                                      const FitDataIterator &fitDataEnd) {
   auto group = getOutputGroup(fitAlgorithm);
@@ -651,8 +657,8 @@ void IndirectFittingModel::addOutput(IAlgorithm_sptr fitAlgorithm,
   addOutput(group, parameters, result, fitDataBegin, fitDataEnd);
 }
 
-void IndirectFittingModel::addSingleFitOutput(IAlgorithm_sptr fitAlgorithm,
-                                              TableDatasetIndex index) {
+void IndirectFittingModel::addSingleFitOutput(
+    const IAlgorithm_sptr &fitAlgorithm, TableDatasetIndex index) {
   auto group = getOutputGroup(fitAlgorithm);
   auto parameters = getOutputParameters(fitAlgorithm);
   auto result = getOutputResult(fitAlgorithm);
@@ -663,9 +669,9 @@ void IndirectFittingModel::addSingleFitOutput(IAlgorithm_sptr fitAlgorithm,
             WorkspaceIndex{spectrum});
 }
 
-void IndirectFittingModel::addOutput(WorkspaceGroup_sptr resultGroup,
-                                     ITableWorkspace_sptr parameterTable,
-                                     WorkspaceGroup_sptr resultWorkspace,
+void IndirectFittingModel::addOutput(const WorkspaceGroup_sptr &resultGroup,
+                                     const ITableWorkspace_sptr &parameterTable,
+                                     const WorkspaceGroup_sptr &resultWorkspace,
                                      const FitDataIterator &fitDataBegin,
                                      const FitDataIterator &fitDataEnd) {
   if (m_previousModelSelected && m_fitOutput)
@@ -678,9 +684,9 @@ void IndirectFittingModel::addOutput(WorkspaceGroup_sptr resultGroup,
   m_previousModelSelected = isPreviousModelSelected();
 }
 
-void IndirectFittingModel::addOutput(WorkspaceGroup_sptr resultGroup,
-                                     ITableWorkspace_sptr parameterTable,
-                                     WorkspaceGroup_sptr resultWorkspace,
+void IndirectFittingModel::addOutput(const WorkspaceGroup_sptr &resultGroup,
+                                     const ITableWorkspace_sptr &parameterTable,
+                                     const WorkspaceGroup_sptr &resultWorkspace,
                                      IndirectFitData *fitData,
                                      WorkspaceIndex spectrum) {
   if (m_previousModelSelected && m_fitOutput)
@@ -696,8 +702,9 @@ IndirectFitOutput IndirectFittingModel::createFitOutput(
     WorkspaceGroup_sptr resultGroup, ITableWorkspace_sptr parameterTable,
     WorkspaceGroup_sptr resultWorkspace, const FitDataIterator &fitDataBegin,
     const FitDataIterator &fitDataEnd) const {
-  return IndirectFitOutput(resultGroup, parameterTable, resultWorkspace,
-                           fitDataBegin, fitDataEnd);
+  return IndirectFitOutput(std::move(resultGroup), std::move(parameterTable),
+                           std::move(resultWorkspace), fitDataBegin,
+                           fitDataEnd);
 }
 
 IndirectFitOutput IndirectFittingModel::createFitOutput(
@@ -705,8 +712,8 @@ IndirectFitOutput IndirectFittingModel::createFitOutput(
     Mantid::API::ITableWorkspace_sptr parameterTable,
     Mantid::API::WorkspaceGroup_sptr resultWorkspace, IndirectFitData *fitData,
     WorkspaceIndex spectrum) const {
-  return IndirectFitOutput(resultGroup, parameterTable, resultWorkspace,
-                           fitData, spectrum);
+  return IndirectFitOutput(std::move(resultGroup), std::move(parameterTable),
+                           std::move(resultWorkspace), fitData, spectrum);
 }
 
 void IndirectFittingModel::addOutput(IndirectFitOutput *fitOutput,
@@ -715,8 +722,8 @@ void IndirectFittingModel::addOutput(IndirectFitOutput *fitOutput,
                                      WorkspaceGroup_sptr resultWorkspace,
                                      const FitDataIterator &fitDataBegin,
                                      const FitDataIterator &fitDataEnd) const {
-  fitOutput->addOutput(resultGroup, parameterTable, resultWorkspace,
-                       fitDataBegin, fitDataEnd);
+  fitOutput->addOutput(std::move(resultGroup), std::move(parameterTable),
+                       std::move(resultWorkspace), fitDataBegin, fitDataEnd);
 }
 
 void IndirectFittingModel::addOutput(
@@ -724,8 +731,8 @@ void IndirectFittingModel::addOutput(
     Mantid::API::ITableWorkspace_sptr parameterTable,
     Mantid::API::WorkspaceGroup_sptr resultWorkspace, IndirectFitData *fitData,
     WorkspaceIndex spectrum) const {
-  fitOutput->addOutput(resultGroup, parameterTable, resultWorkspace, fitData,
-                       spectrum);
+  fitOutput->addOutput(std::move(resultGroup), std::move(parameterTable),
+                       std::move(resultWorkspace), fitData, spectrum);
 }
 
 FittingMode IndirectFittingModel::getFittingMode() const {
@@ -867,14 +874,15 @@ IndirectFittingModel::simultaneousFitAlgorithm() const {
 IAlgorithm_sptr
 IndirectFittingModel::createSequentialFit(IFunction_sptr function) const {
   const auto input = constructInputString(m_fittingData);
-  return createSequentialFit(function, input, m_fittingData.front().get());
+  return createSequentialFit(std::move(function), input,
+                             m_fittingData.front().get());
 }
 
 IAlgorithm_sptr IndirectFittingModel::createSequentialFit(
-    IFunction_sptr function, const std::string &input,
+    const IFunction_sptr &function, const std::string &input,
     IndirectFitData *initialFitData) const {
   auto fitAlgorithm = sequentialFitAlgorithm();
-  addFitProperties(*fitAlgorithm, function, getResultXAxisUnit());
+  addFitProperties(*fitAlgorithm, std::move(function), getResultXAxisUnit());
   fitAlgorithm->setProperty("Input", input);
   fitAlgorithm->setProperty("OutputWorkspace", sequentialFitOutputName());
   fitAlgorithm->setProperty("LogName", getResultLogName());
@@ -892,7 +900,7 @@ IAlgorithm_sptr IndirectFittingModel::createSequentialFit(
 }
 
 IAlgorithm_sptr IndirectFittingModel::createSimultaneousFit(
-    MultiDomainFunction_sptr function) const {
+    const MultiDomainFunction_sptr &function) const {
   auto fitAlgorithm = simultaneousFitAlgorithm();
   addFitProperties(*fitAlgorithm, function, getResultXAxisUnit());
   addInputDataToSimultaneousFit(fitAlgorithm, m_fittingData);
@@ -901,9 +909,9 @@ IAlgorithm_sptr IndirectFittingModel::createSimultaneousFit(
 }
 
 IAlgorithm_sptr IndirectFittingModel::createSimultaneousFitWithEqualRange(
-    IFunction_sptr function) const {
+    const IFunction_sptr &function) const {
   auto fitAlgorithm = simultaneousFitAlgorithm();
-  addFitProperties(*fitAlgorithm, function, getResultXAxisUnit());
+  addFitProperties(*fitAlgorithm, std::move(function), getResultXAxisUnit());
 
   auto const dataIndex = TableDatasetIndex{0};
   auto const workspaceIndex = getSpectra(dataIndex).front();
@@ -931,12 +939,13 @@ std::string IndirectFittingModel::getOutputBasename() const {
   return cutLastOf(sequentialFitOutputName(), "_Results");
 }
 
-void IndirectFittingModel::cleanFailedRun(IAlgorithm_sptr fittingAlgorithm) {
+void IndirectFittingModel::cleanFailedRun(
+    const IAlgorithm_sptr &fittingAlgorithm) {
   cleanTemporaries(fittingAlgorithm->name(), m_fittingData);
 }
 
 void IndirectFittingModel::cleanFailedSingleRun(
-    IAlgorithm_sptr fittingAlgorithm, TableDatasetIndex index) {
+    const IAlgorithm_sptr &fittingAlgorithm, TableDatasetIndex index) {
   const auto base =
       "__" + fittingAlgorithm->name() + "_ws" + std::to_string(index.value + 1);
   removeFromADSIfExists(base);
@@ -945,7 +954,7 @@ void IndirectFittingModel::cleanFailedSingleRun(
 
 DataForParameterEstimationCollection
 IndirectFittingModel::getDataForParameterEstimation(
-    EstimationDataSelector selector) const {
+    const EstimationDataSelector &selector) const {
   DataForParameterEstimationCollection dataCollection;
   for (auto i = m_fittingData.zero(); i < m_fittingData.size(); ++i) {
     auto const &data = *m_fittingData[i];
diff --git a/qt/scientific_interfaces/Indirect/IndirectFittingModel.h b/qt/scientific_interfaces/Indirect/IndirectFittingModel.h
index dd5b37ad3c2..b4b39ccbb0a 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFittingModel.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFittingModel.h
@@ -109,7 +109,7 @@ public:
   virtual void setFitFunction(Mantid::API::MultiDomainFunction_sptr function);
   virtual void setDefaultParameterValue(const std::string &name, double value,
                                         TableDatasetIndex dataIndex);
-  void addSingleFitOutput(Mantid::API::IAlgorithm_sptr fitAlgorithm,
+  void addSingleFitOutput(const Mantid::API::IAlgorithm_sptr &fitAlgorithm,
                           TableDatasetIndex index);
   virtual void addOutput(Mantid::API::IAlgorithm_sptr fitAlgorithm);
 
@@ -135,11 +135,12 @@ public:
                                                 WorkspaceIndex spectrum) const;
   std::string getOutputBasename() const;
 
-  void cleanFailedRun(Mantid::API::IAlgorithm_sptr fittingAlgorithm);
-  void cleanFailedSingleRun(Mantid::API::IAlgorithm_sptr fittingAlgorithm,
-                            TableDatasetIndex index);
+  void cleanFailedRun(const Mantid::API::IAlgorithm_sptr &fittingAlgorithm);
+  void
+  cleanFailedSingleRun(const Mantid::API::IAlgorithm_sptr &fittingAlgorithm,
+                       TableDatasetIndex index);
   DataForParameterEstimationCollection
-  getDataForParameterEstimation(EstimationDataSelector selector) const;
+  getDataForParameterEstimation(const EstimationDataSelector &selector) const;
 
   std::vector<double> getQValuesForData() const;
   virtual std::vector<std::pair<std::string, int>> getResolutionsForFit() const;
@@ -148,17 +149,17 @@ protected:
   Mantid::API::IAlgorithm_sptr getFittingAlgorithm(FittingMode mode) const;
   Mantid::API::IAlgorithm_sptr
   createSequentialFit(Mantid::API::IFunction_sptr function) const;
-  Mantid::API::IAlgorithm_sptr
-  createSimultaneousFit(Mantid::API::MultiDomainFunction_sptr function) const;
+  Mantid::API::IAlgorithm_sptr createSimultaneousFit(
+      const Mantid::API::MultiDomainFunction_sptr &function) const;
   Mantid::API::IAlgorithm_sptr createSimultaneousFitWithEqualRange(
-      Mantid::API::IFunction_sptr function) const;
+      const Mantid::API::IFunction_sptr &function) const;
   virtual Mantid::API::MultiDomainFunction_sptr getMultiDomainFunction() const;
   virtual std::unordered_map<std::string, std::string>
   mapDefaultParameterNames() const;
   std::string createSingleFitOutputName(const std::string &formatString,
                                         TableDatasetIndex index,
                                         WorkspaceIndex spectrum) const;
-  void addNewWorkspace(Mantid::API::MatrixWorkspace_sptr workspace,
+  void addNewWorkspace(const Mantid::API::MatrixWorkspace_sptr &workspace,
                        const Spectra &spectra);
   void removeFittingData(TableDatasetIndex index);
 
@@ -168,7 +169,7 @@ private:
   void removeWorkspaceFromFittingData(TableDatasetIndex const &index);
 
   Mantid::API::IAlgorithm_sptr
-  createSequentialFit(Mantid::API::IFunction_sptr function,
+  createSequentialFit(const Mantid::API::IFunction_sptr &function,
                       const std::string &input,
                       IndirectFitData *initialFitData) const;
   virtual Mantid::API::IAlgorithm_sptr sequentialFitAlgorithm() const;
@@ -197,17 +198,17 @@ private:
                   Mantid::API::WorkspaceGroup_sptr resultWorkspace,
                   IndirectFitData *fitData, WorkspaceIndex spectrum) const;
 
-  void addOutput(Mantid::API::IAlgorithm_sptr fitAlgorithm,
+  void addOutput(const Mantid::API::IAlgorithm_sptr &fitAlgorithm,
                  const FitDataIterator &fitDataBegin,
                  const FitDataIterator &fitDataEnd);
-  void addOutput(Mantid::API::WorkspaceGroup_sptr resultGroup,
-                 Mantid::API::ITableWorkspace_sptr parameterTable,
-                 Mantid::API::WorkspaceGroup_sptr resultWorkspace,
+  void addOutput(const Mantid::API::WorkspaceGroup_sptr &resultGroup,
+                 const Mantid::API::ITableWorkspace_sptr &parameterTable,
+                 const Mantid::API::WorkspaceGroup_sptr &resultWorkspace,
                  const FitDataIterator &fitDataBegin,
                  const FitDataIterator &fitDataEnd);
-  void addOutput(Mantid::API::WorkspaceGroup_sptr resultGroup,
-                 Mantid::API::ITableWorkspace_sptr parameterTable,
-                 Mantid::API::WorkspaceGroup_sptr resultWorkspace,
+  void addOutput(const Mantid::API::WorkspaceGroup_sptr &resultGroup,
+                 const Mantid::API::ITableWorkspace_sptr &parameterTable,
+                 const Mantid::API::WorkspaceGroup_sptr &resultWorkspace,
                  IndirectFitData *fitData, WorkspaceIndex spectrum);
 
   virtual void addOutput(IndirectFitOutput *fitOutput,
diff --git a/qt/scientific_interfaces/Indirect/IndirectFittingModelLegacy.cpp b/qt/scientific_interfaces/Indirect/IndirectFittingModelLegacy.cpp
index 059c0de67ff..fb1120f4b61 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFittingModelLegacy.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFittingModelLegacy.cpp
@@ -19,6 +19,7 @@
 #include <set>
 
 #include <boost/algorithm/string.hpp>
+#include <utility>
 
 using namespace Mantid::API;
 
@@ -36,8 +37,8 @@ std::string cutLastOf(std::string const &str, std::string const &delimiter) {
   return str;
 }
 
-bool equivalentWorkspaces(MatrixWorkspace_const_sptr lhs,
-                          MatrixWorkspace_const_sptr rhs) {
+bool equivalentWorkspaces(const MatrixWorkspace_const_sptr &lhs,
+                          const MatrixWorkspace_const_sptr &rhs) {
   if (!lhs || !rhs)
     return false;
   else if (lhs->getName() == "" && rhs->getName() == "")
@@ -49,8 +50,8 @@ bool equivalentWorkspaces(MatrixWorkspace_const_sptr lhs,
  * @return  True if the first function precedes the second when ordering by
  *          name.
  */
-bool functionNameComparator(IFunction_const_sptr first,
-                            IFunction_const_sptr second) {
+bool functionNameComparator(const IFunction_const_sptr &first,
+                            const IFunction_const_sptr &second) {
   return first->name() < second->name();
 }
 
@@ -71,8 +72,8 @@ extractFunctions(const CompositeFunction &composite) {
   return functions;
 }
 
-bool equivalentFunctions(IFunction_const_sptr func1,
-                         IFunction_const_sptr func2);
+bool equivalentFunctions(const IFunction_const_sptr &func1,
+                         const IFunction_const_sptr &func2);
 
 /*
  * Checks whether the specified composite functions have the same composition.
@@ -110,8 +111,8 @@ bool equivalentComposites(const CompositeFunction &composite1,
  * @return      True if the specified functions have the same composition,
  *              False otherwise.
  */
-bool equivalentFunctions(IFunction_const_sptr func1,
-                         IFunction_const_sptr func2) {
+bool equivalentFunctions(const IFunction_const_sptr &func1,
+                         const IFunction_const_sptr &func2) {
   const auto composite1 =
       boost::dynamic_pointer_cast<const CompositeFunction>(func1);
   const auto composite2 =
@@ -146,8 +147,8 @@ std::string constructInputString(
   return input.str();
 }
 
-void addInputDataToSimultaneousFit(IAlgorithm_sptr fitAlgorithm,
-                                   MatrixWorkspace_sptr workspace,
+void addInputDataToSimultaneousFit(const IAlgorithm_sptr &fitAlgorithm,
+                                   const MatrixWorkspace_sptr &workspace,
                                    std::size_t spectrum,
                                    const std::pair<double, double> &xRange,
                                    const std::vector<double> &excludeRegions,
@@ -193,7 +194,7 @@ void addInputDataToSimultaneousFit(
 }
 
 void addInputDataToSimultaneousFit(
-    IAlgorithm_sptr fitAlgorithm,
+    const IAlgorithm_sptr &fitAlgorithm,
     const std::vector<std::unique_ptr<IndirectFitDataLegacy>> &fittingData) {
   std::size_t counter = 0;
   for (const auto &data : fittingData)
@@ -201,7 +202,7 @@ void addInputDataToSimultaneousFit(
 }
 
 void addInputDataToSimultaneousFit(
-    IAlgorithm_sptr fitAlgorithm,
+    const IAlgorithm_sptr &fitAlgorithm,
     const std::vector<std::unique_ptr<IndirectFitDataLegacy>> &fittingData,
     const std::pair<double, double> &range,
     const std::vector<double> &exclude) {
@@ -217,7 +218,7 @@ template <typename Map> Map combine(const Map &mapA, const Map &mapB) {
 }
 
 std::unordered_map<std::string, std::string>
-shortToLongParameterNames(IFunction_sptr function) {
+shortToLongParameterNames(const IFunction_sptr &function) {
   std::unordered_map<std::string, std::string> shortToLong;
   for (const auto &name : function->getParameterNames())
     shortToLong[name.substr(name.rfind(".") + 1)] = name;
@@ -264,7 +265,7 @@ void cleanTemporaries(
     cleanTemporaries(prefix + std::to_string(i + 1), fittingData[i]);
 }
 
-CompositeFunction_sptr createMultiDomainFunction(IFunction_sptr function,
+CompositeFunction_sptr createMultiDomainFunction(const IFunction_sptr &function,
                                                  std::size_t numberOfDomains) {
   auto multiDomainFunction = boost::make_shared<MultiDomainFunction>();
 
@@ -291,26 +292,29 @@ IFunction_sptr extractFirstInnerFunction(const std::string &function) {
 
 template <typename WorkspaceType>
 boost::shared_ptr<WorkspaceType>
-getWorkspaceOutput(IAlgorithm_sptr algorithm, const std::string &propertyName) {
+getWorkspaceOutput(const IAlgorithm_sptr &algorithm,
+                   const std::string &propertyName) {
   return AnalysisDataService::Instance().retrieveWS<WorkspaceType>(
       algorithm->getProperty(propertyName));
 }
 
-WorkspaceGroup_sptr getOutputResult(IAlgorithm_sptr algorithm) {
-  return getWorkspaceOutput<WorkspaceGroup>(algorithm, "OutputWorkspace");
+WorkspaceGroup_sptr getOutputResult(const IAlgorithm_sptr &algorithm) {
+  return getWorkspaceOutput<WorkspaceGroup>(std::move(algorithm),
+                                            "OutputWorkspace");
 }
 
-ITableWorkspace_sptr getOutputParameters(IAlgorithm_sptr algorithm) {
-  return getWorkspaceOutput<ITableWorkspace>(algorithm,
+ITableWorkspace_sptr getOutputParameters(const IAlgorithm_sptr &algorithm) {
+  return getWorkspaceOutput<ITableWorkspace>(std::move(algorithm),
                                              "OutputParameterWorkspace");
 }
 
-WorkspaceGroup_sptr getOutputGroup(IAlgorithm_sptr algorithm) {
-  return getWorkspaceOutput<WorkspaceGroup>(algorithm, "OutputWorkspaceGroup");
+WorkspaceGroup_sptr getOutputGroup(const IAlgorithm_sptr &algorithm) {
+  return getWorkspaceOutput<WorkspaceGroup>(std::move(algorithm),
+                                            "OutputWorkspaceGroup");
 }
 
 void addFitProperties(Mantid::API::IAlgorithm &algorithm,
-                      Mantid::API::IFunction_sptr function,
+                      const Mantid::API::IFunction_sptr &function,
                       std::string const &xAxisUnit) {
   algorithm.setProperty("Function", function);
   algorithm.setProperty("ResultXAxisUnit", xAxisUnit);
@@ -550,7 +554,8 @@ void IndirectFittingModelLegacy::addWorkspace(MatrixWorkspace_sptr workspace,
 
 void IndirectFittingModelLegacy::addNewWorkspace(MatrixWorkspace_sptr workspace,
                                                  const SpectraLegacy &spectra) {
-  m_fittingData.emplace_back(new IndirectFitDataLegacy(workspace, spectra));
+  m_fittingData.emplace_back(
+      new IndirectFitDataLegacy(std::move(workspace), spectra));
   m_defaultParameters.emplace_back(
       createDefaultParameters(m_fittingData.size() - 1));
 }
@@ -596,7 +601,7 @@ void IndirectFittingModelLegacy::setFittingMode(FittingModeLegacy mode) {
 }
 
 void IndirectFittingModelLegacy::setFitFunction(IFunction_sptr function) {
-  m_activeFunction = function;
+  m_activeFunction = std::move(function);
   m_previousModelSelected = isPreviousModelSelected();
 }
 
@@ -607,11 +612,13 @@ void IndirectFittingModelLegacy::setDefaultParameterValue(
 }
 
 void IndirectFittingModelLegacy::addOutput(IAlgorithm_sptr fitAlgorithm) {
-  addOutput(fitAlgorithm, m_fittingData.begin(), m_fittingData.end());
+  addOutput(std::move(fitAlgorithm), m_fittingData.begin(),
+            m_fittingData.end());
 }
 
 void IndirectFittingModelLegacy::addOutput(
-    IAlgorithm_sptr fitAlgorithm, const FitDataIteratorLegacy &fitDataBegin,
+    const IAlgorithm_sptr &fitAlgorithm,
+    const FitDataIteratorLegacy &fitDataBegin,
     const FitDataIteratorLegacy &fitDataEnd) {
   auto group = getOutputGroup(fitAlgorithm);
   auto parameters = getOutputParameters(fitAlgorithm);
@@ -622,7 +629,7 @@ void IndirectFittingModelLegacy::addOutput(
 }
 
 void IndirectFittingModelLegacy::addSingleFitOutput(
-    IAlgorithm_sptr fitAlgorithm, std::size_t index) {
+    const IAlgorithm_sptr &fitAlgorithm, std::size_t index) {
   auto group = getOutputGroup(fitAlgorithm);
   auto parameters = getOutputParameters(fitAlgorithm);
   auto result = getOutputResult(fitAlgorithm);
@@ -634,8 +641,9 @@ void IndirectFittingModelLegacy::addSingleFitOutput(
 }
 
 void IndirectFittingModelLegacy::addOutput(
-    WorkspaceGroup_sptr resultGroup, ITableWorkspace_sptr parameterTable,
-    WorkspaceGroup_sptr resultWorkspace,
+    const WorkspaceGroup_sptr &resultGroup,
+    const ITableWorkspace_sptr &parameterTable,
+    const WorkspaceGroup_sptr &resultWorkspace,
     const FitDataIteratorLegacy &fitDataBegin,
     const FitDataIteratorLegacy &fitDataEnd) {
   if (m_previousModelSelected && m_fitOutput)
@@ -648,11 +656,11 @@ void IndirectFittingModelLegacy::addOutput(
   m_previousModelSelected = isPreviousModelSelected();
 }
 
-void IndirectFittingModelLegacy::addOutput(WorkspaceGroup_sptr resultGroup,
-                                           ITableWorkspace_sptr parameterTable,
-                                           WorkspaceGroup_sptr resultWorkspace,
-                                           IndirectFitDataLegacy *fitData,
-                                           std::size_t spectrum) {
+void IndirectFittingModelLegacy::addOutput(
+    const WorkspaceGroup_sptr &resultGroup,
+    const ITableWorkspace_sptr &parameterTable,
+    const WorkspaceGroup_sptr &resultWorkspace, IndirectFitDataLegacy *fitData,
+    std::size_t spectrum) {
   if (m_previousModelSelected && m_fitOutput)
     addOutput(m_fitOutput.get(), resultGroup, parameterTable, resultWorkspace,
               fitData, spectrum);
@@ -667,8 +675,9 @@ IndirectFitOutputLegacy IndirectFittingModelLegacy::createFitOutput(
     WorkspaceGroup_sptr resultWorkspace,
     const FitDataIteratorLegacy &fitDataBegin,
     const FitDataIteratorLegacy &fitDataEnd) const {
-  return IndirectFitOutputLegacy(resultGroup, parameterTable, resultWorkspace,
-                                 fitDataBegin, fitDataEnd);
+  return IndirectFitOutputLegacy(
+      std::move(resultGroup), std::move(parameterTable),
+      std::move(resultWorkspace), fitDataBegin, fitDataEnd);
 }
 
 IndirectFitOutputLegacy IndirectFittingModelLegacy::createFitOutput(
@@ -676,8 +685,9 @@ IndirectFitOutputLegacy IndirectFittingModelLegacy::createFitOutput(
     Mantid::API::ITableWorkspace_sptr parameterTable,
     Mantid::API::WorkspaceGroup_sptr resultWorkspace,
     IndirectFitDataLegacy *fitData, std::size_t spectrum) const {
-  return IndirectFitOutputLegacy(resultGroup, parameterTable, resultWorkspace,
-                                 fitData, spectrum);
+  return IndirectFitOutputLegacy(std::move(resultGroup),
+                                 std::move(parameterTable),
+                                 std::move(resultWorkspace), fitData, spectrum);
 }
 
 void IndirectFittingModelLegacy::addOutput(
@@ -685,8 +695,8 @@ void IndirectFittingModelLegacy::addOutput(
     ITableWorkspace_sptr parameterTable, WorkspaceGroup_sptr resultWorkspace,
     const FitDataIteratorLegacy &fitDataBegin,
     const FitDataIteratorLegacy &fitDataEnd) const {
-  fitOutput->addOutput(resultGroup, parameterTable, resultWorkspace,
-                       fitDataBegin, fitDataEnd);
+  fitOutput->addOutput(std::move(resultGroup), std::move(parameterTable),
+                       std::move(resultWorkspace), fitDataBegin, fitDataEnd);
 }
 
 void IndirectFittingModelLegacy::addOutput(
@@ -695,8 +705,8 @@ void IndirectFittingModelLegacy::addOutput(
     Mantid::API::ITableWorkspace_sptr parameterTable,
     Mantid::API::WorkspaceGroup_sptr resultWorkspace,
     IndirectFitDataLegacy *fitData, std::size_t spectrum) const {
-  fitOutput->addOutput(resultGroup, parameterTable, resultWorkspace, fitData,
-                       spectrum);
+  fitOutput->addOutput(std::move(resultGroup), std::move(parameterTable),
+                       std::move(resultWorkspace), fitData, spectrum);
 }
 
 FittingModeLegacy IndirectFittingModelLegacy::getFittingMode() const {
@@ -820,14 +830,15 @@ IndirectFittingModelLegacy::simultaneousFitAlgorithm() const {
 IAlgorithm_sptr
 IndirectFittingModelLegacy::createSequentialFit(IFunction_sptr function) const {
   const auto input = constructInputString(m_fittingData);
-  return createSequentialFit(function, input, m_fittingData.front().get());
+  return createSequentialFit(std::move(function), input,
+                             m_fittingData.front().get());
 }
 
 IAlgorithm_sptr IndirectFittingModelLegacy::createSequentialFit(
-    IFunction_sptr function, const std::string &input,
+    const IFunction_sptr &function, const std::string &input,
     IndirectFitDataLegacy *initialFitData) const {
   auto fitAlgorithm = sequentialFitAlgorithm();
-  addFitProperties(*fitAlgorithm, function, getResultXAxisUnit());
+  addFitProperties(*fitAlgorithm, std::move(function), getResultXAxisUnit());
   fitAlgorithm->setProperty("Input", input);
   fitAlgorithm->setProperty("OutputWorkspace", sequentialFitOutputName());
   fitAlgorithm->setProperty("PassWSIndexToFunction", true);
@@ -845,18 +856,18 @@ IAlgorithm_sptr IndirectFittingModelLegacy::createSequentialFit(
 }
 
 IAlgorithm_sptr IndirectFittingModelLegacy::createSimultaneousFit(
-    IFunction_sptr function) const {
+    const IFunction_sptr &function) const {
   auto fitAlgorithm = simultaneousFitAlgorithm();
-  addFitProperties(*fitAlgorithm, function, getResultXAxisUnit());
+  addFitProperties(*fitAlgorithm, std::move(function), getResultXAxisUnit());
   addInputDataToSimultaneousFit(fitAlgorithm, m_fittingData);
   fitAlgorithm->setProperty("OutputWorkspace", simultaneousFitOutputName());
   return fitAlgorithm;
 }
 
 IAlgorithm_sptr IndirectFittingModelLegacy::createSimultaneousFitWithEqualRange(
-    IFunction_sptr function) const {
+    const IFunction_sptr &function) const {
   auto fitAlgorithm = simultaneousFitAlgorithm();
-  addFitProperties(*fitAlgorithm, function, getResultXAxisUnit());
+  addFitProperties(*fitAlgorithm, std::move(function), getResultXAxisUnit());
 
   auto exclude = vectorFromStringLegacy<double>(getExcludeRegion(0, 0));
   addInputDataToSimultaneousFit(fitAlgorithm, m_fittingData,
@@ -880,12 +891,12 @@ std::string IndirectFittingModelLegacy::getOutputBasename() const {
 }
 
 void IndirectFittingModelLegacy::cleanFailedRun(
-    IAlgorithm_sptr fittingAlgorithm) {
+    const IAlgorithm_sptr &fittingAlgorithm) {
   cleanTemporaries(fittingAlgorithm->name(), m_fittingData);
 }
 
 void IndirectFittingModelLegacy::cleanFailedSingleRun(
-    IAlgorithm_sptr fittingAlgorithm, std::size_t index) {
+    const IAlgorithm_sptr &fittingAlgorithm, std::size_t index) {
   const auto base =
       "__" + fittingAlgorithm->name() + "_ws" + std::to_string(index + 1);
   removeFromADSIfExists(base);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFittingModelLegacy.h b/qt/scientific_interfaces/Indirect/IndirectFittingModelLegacy.h
index 1e316cc02dd..d87fee500ee 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFittingModelLegacy.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFittingModelLegacy.h
@@ -96,7 +96,7 @@ public:
   virtual void setFitFunction(Mantid::API::IFunction_sptr function);
   virtual void setDefaultParameterValue(const std::string &name, double value,
                                         std::size_t dataIndex);
-  void addSingleFitOutput(Mantid::API::IAlgorithm_sptr fitAlgorithm,
+  void addSingleFitOutput(const Mantid::API::IAlgorithm_sptr &fitAlgorithm,
                           std::size_t index);
   virtual void addOutput(Mantid::API::IAlgorithm_sptr fitAlgorithm);
 
@@ -119,9 +119,10 @@ public:
                                             std::size_t spectrum) const;
   std::string getOutputBasename() const;
 
-  void cleanFailedRun(Mantid::API::IAlgorithm_sptr fittingAlgorithm);
-  void cleanFailedSingleRun(Mantid::API::IAlgorithm_sptr fittingAlgorithm,
-                            std::size_t index);
+  void cleanFailedRun(const Mantid::API::IAlgorithm_sptr &fittingAlgorithm);
+  void
+  cleanFailedSingleRun(const Mantid::API::IAlgorithm_sptr &fittingAlgorithm,
+                       std::size_t index);
 
 protected:
   Mantid::API::IAlgorithm_sptr
@@ -129,9 +130,9 @@ protected:
   Mantid::API::IAlgorithm_sptr
   createSequentialFit(Mantid::API::IFunction_sptr function) const;
   Mantid::API::IAlgorithm_sptr
-  createSimultaneousFit(Mantid::API::IFunction_sptr function) const;
+  createSimultaneousFit(const Mantid::API::IFunction_sptr &function) const;
   Mantid::API::IAlgorithm_sptr createSimultaneousFitWithEqualRange(
-      Mantid::API::IFunction_sptr function) const;
+      const Mantid::API::IFunction_sptr &function) const;
   virtual Mantid::API::CompositeFunction_sptr getMultiDomainFunction() const;
   virtual std::unordered_map<std::string, std::string>
   mapDefaultParameterNames() const;
@@ -148,7 +149,7 @@ private:
   void removeWorkspaceFromFittingData(std::size_t const &index);
 
   Mantid::API::IAlgorithm_sptr
-  createSequentialFit(Mantid::API::IFunction_sptr function,
+  createSequentialFit(const Mantid::API::IFunction_sptr &function,
                       const std::string &input,
                       IndirectFitDataLegacy *initialFitData) const;
   virtual Mantid::API::IAlgorithm_sptr sequentialFitAlgorithm() const;
@@ -177,17 +178,17 @@ private:
                   Mantid::API::WorkspaceGroup_sptr resultWorkspace,
                   IndirectFitDataLegacy *fitData, std::size_t spectrum) const;
 
-  void addOutput(Mantid::API::IAlgorithm_sptr fitAlgorithm,
+  void addOutput(const Mantid::API::IAlgorithm_sptr &fitAlgorithm,
                  const FitDataIteratorLegacy &fitDataBegin,
                  const FitDataIteratorLegacy &fitDataEnd);
-  void addOutput(Mantid::API::WorkspaceGroup_sptr resultGroup,
-                 Mantid::API::ITableWorkspace_sptr parameterTable,
-                 Mantid::API::WorkspaceGroup_sptr resultWorkspace,
+  void addOutput(const Mantid::API::WorkspaceGroup_sptr &resultGroup,
+                 const Mantid::API::ITableWorkspace_sptr &parameterTable,
+                 const Mantid::API::WorkspaceGroup_sptr &resultWorkspace,
                  const FitDataIteratorLegacy &fitDataBegin,
                  const FitDataIteratorLegacy &fitDataEnd);
-  void addOutput(Mantid::API::WorkspaceGroup_sptr resultGroup,
-                 Mantid::API::ITableWorkspace_sptr parameterTable,
-                 Mantid::API::WorkspaceGroup_sptr resultWorkspace,
+  void addOutput(const Mantid::API::WorkspaceGroup_sptr &resultGroup,
+                 const Mantid::API::ITableWorkspace_sptr &parameterTable,
+                 const Mantid::API::WorkspaceGroup_sptr &resultWorkspace,
                  IndirectFitDataLegacy *fitData, std::size_t spectrum);
 
   virtual void addOutput(IndirectFitOutputLegacy *fitOutput,
diff --git a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/ConvFunctionModel.cpp b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/ConvFunctionModel.cpp
index 563f7ba7366..0cf9dc9adbe 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/ConvFunctionModel.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/ConvFunctionModel.cpp
@@ -69,7 +69,7 @@ void ConvFunctionModel::setFunction(IFunction_sptr fun) {
   m_model.setFunction(fun);
 }
 
-void ConvFunctionModel::checkConvolution(IFunction_sptr fun) {
+void ConvFunctionModel::checkConvolution(const IFunction_sptr &fun) {
   bool isFitTypeSet = false;
   bool isResolutionSet = false;
   for (size_t i = 0; i < fun->nFunctions(); ++i) {
@@ -102,7 +102,7 @@ void ConvFunctionModel::checkConvolution(IFunction_sptr fun) {
   }
 }
 
-void ConvFunctionModel::checkSingleFunction(IFunction_sptr fun,
+void ConvFunctionModel::checkSingleFunction(const IFunction_sptr &fun,
                                             bool &isFitTypeSet) {
   assert(fun->nFunctions() == 0);
   auto const name = fun->name();
@@ -609,7 +609,7 @@ void ConvFunctionModel::setCurrentValues(const QMap<ParamID, double> &values) {
 }
 
 void ConvFunctionModel::applyParameterFunction(
-    std::function<void(ParamID)> paramFun) const {
+    const std::function<void(ParamID)> &paramFun) const {
   applyToFitType(m_fitType, paramFun);
   applyToBackground(m_backgroundType, paramFun);
   applyToDelta(m_hasDeltaFunction, paramFun);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/ConvFunctionModel.h b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/ConvFunctionModel.h
index 2f67831a5e2..edfa5f477bf 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/ConvFunctionModel.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/ConvFunctionModel.h
@@ -115,7 +115,8 @@ private:
   boost::optional<QString> getParameterDescription(ParamID name) const;
   boost::optional<QString> getPrefix(ParamID name) const;
   void setCurrentValues(const QMap<ParamID, double> &);
-  void applyParameterFunction(std::function<void(ParamID)> paramFun) const;
+  void
+  applyParameterFunction(const std::function<void(ParamID)> &paramFun) const;
   boost::optional<ParamID> getParameterId(const QString &parName);
   std::string buildLorentzianFunctionString() const;
   std::string buildTeixeiraFunctionString() const;
@@ -130,8 +131,8 @@ private:
   void removeGlobal(const QString &parName);
   QStringList makeGlobalList() const;
   int getNumberOfPeaks() const;
-  void checkConvolution(IFunction_sptr fun);
-  void checkSingleFunction(IFunction_sptr fun, bool &isFitTypeSet);
+  void checkConvolution(const IFunction_sptr &fun);
+  void checkSingleFunction(const IFunction_sptr &fun, bool &isFitTypeSet);
 
   ConvolutionFunctionModel m_model;
   FitType m_fitType = FitType::None;
diff --git a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/ConvTypes.h b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/ConvTypes.h
index daaedec3ca4..99473fdaed0 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/ConvTypes.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/ConvTypes.h
@@ -91,7 +91,7 @@ inline ParamID &operator++(ParamID &id) {
 }
 
 inline void applyToParamIDRange(ParamID from, ParamID to,
-                                std::function<void(ParamID)> fun) {
+                                const std::function<void(ParamID)> &fun) {
   if (from == ParamID::NONE || to == ParamID::NONE)
     return;
   for (auto i = from; i <= to; ++i)
diff --git a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/FQTemplateBrowser.cpp b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/FQTemplateBrowser.cpp
index 50ba28e8907..d46c53ec0aa 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/FQTemplateBrowser.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/FQTemplateBrowser.cpp
@@ -56,7 +56,7 @@ void FQTemplateBrowser::createProperties() {
   m_boolManager->blockSignals(false);
 }
 
-void FQTemplateBrowser::setDataType(QStringList allowedFunctionsList) {
+void FQTemplateBrowser::setDataType(const QStringList &allowedFunctionsList) {
   ScopedFalse _false(m_emitEnumChange);
   m_enumManager->setEnumNames(m_fitType, allowedFunctionsList);
   m_enumManager->setValue(m_fitType, 0);
@@ -67,8 +67,8 @@ void FQTemplateBrowser::setEnumValue(int enumIndex) {
   m_enumManager->setValue(m_fitType, enumIndex);
 }
 
-void FQTemplateBrowser::addParameter(QString parameterName,
-                                     QString parameterDescription) {
+void FQTemplateBrowser::addParameter(const QString &parameterName,
+                                     const QString &parameterDescription) {
   auto newParameter = m_parameterManager->addProperty(parameterName);
   m_parameterManager->setDescription(newParameter,
                                      parameterDescription.toStdString());
@@ -152,7 +152,7 @@ void FQTemplateBrowser::updateParameters(const IFunction &fun) {
   m_presenter.updateParameters(fun);
 }
 
-void FQTemplateBrowser::setParameterValue(QString parameterName,
+void FQTemplateBrowser::setParameterValue(const QString &parameterName,
                                           double parameterValue,
                                           double parameterError) {
   m_parameterManager->setValue(m_parameterMap[parameterName], parameterValue);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/FQTemplateBrowser.h b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/FQTemplateBrowser.h
index 74b37cecedd..72c5221d0a1 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/FQTemplateBrowser.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/FQTemplateBrowser.h
@@ -59,10 +59,11 @@ public:
   int getCurrentDataset() override;
   void updateDataType(DataType) override;
   void spectrumChanged(int) override;
-  void addParameter(QString parameterName, QString parameterDescription);
-  void setParameterValue(QString parameterName, double parameterValue,
+  void addParameter(const QString &parameterName,
+                    const QString &parameterDescription);
+  void setParameterValue(const QString &parameterName, double parameterValue,
                          double parameterError);
-  void setDataType(QStringList allowedFunctionsList);
+  void setDataType(const QStringList &allowedFunctionsList);
   void setEnumValue(int enumIndex);
 
 signals:
diff --git a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/IqtFunctionModel.cpp b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/IqtFunctionModel.cpp
index 6f52de42fd7..d299d35e23b 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/IqtFunctionModel.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/IqtFunctionModel.cpp
@@ -565,7 +565,7 @@ void IqtFunctionModel::setCurrentValues(const QMap<ParamID, double> &values) {
 }
 
 void IqtFunctionModel::applyParameterFunction(
-    std::function<void(ParamID)> paramFun) const {
+    const std::function<void(ParamID)> &paramFun) const {
   if (m_numberOfExponentials > 0) {
     paramFun(ParamID::EXP1_HEIGHT);
     paramFun(ParamID::EXP1_LIFETIME);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/IqtFunctionModel.h b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/IqtFunctionModel.h
index 7e41e7ed46c..37518833780 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/IqtFunctionModel.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/IqtFunctionModel.h
@@ -114,7 +114,8 @@ private:
   boost::optional<QString> getParameterDescription(ParamID name) const;
   boost::optional<QString> getPrefix(ParamID name) const;
   void setCurrentValues(const QMap<ParamID, double> &);
-  void applyParameterFunction(std::function<void(ParamID)> paramFun) const;
+  void
+  applyParameterFunction(const std::function<void(ParamID)> &paramFun) const;
   boost::optional<ParamID> getParameterId(const QString &parName);
   std::string buildExpDecayFunctionString() const;
   std::string buildStretchExpFunctionString() const;
diff --git a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/MSDFunctionModel.cpp b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/MSDFunctionModel.cpp
index 3dbc02bab61..be208b3b067 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/MSDFunctionModel.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/MSDFunctionModel.cpp
@@ -457,7 +457,7 @@ void MSDFunctionModel::setCurrentValues(const QMap<ParamID, double> &values) {
 }
 
 void MSDFunctionModel::applyParameterFunction(
-    std::function<void(ParamID)> paramFun) const {
+    const std::function<void(ParamID)> &paramFun) const {
   if (m_fitType == QString::fromStdString(Gauss)) {
     paramFun(ParamID::GAUSSIAN_HEIGHT);
     paramFun(ParamID::GAUSSIAN_MSD);
diff --git a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/MSDFunctionModel.h b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/MSDFunctionModel.h
index fef723310a8..19962b630a8 100644
--- a/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/MSDFunctionModel.h
+++ b/qt/scientific_interfaces/Indirect/IndirectFunctionBrowser/MSDFunctionModel.h
@@ -109,7 +109,8 @@ private:
   boost::optional<QString> getParameterDescription(ParamID name) const;
   boost::optional<QString> getPrefix(ParamID name) const;
   void setCurrentValues(const QMap<ParamID, double> &);
-  void applyParameterFunction(std::function<void(ParamID)> paramFun) const;
+  void
+  applyParameterFunction(const std::function<void(ParamID)> &paramFun) const;
   boost::optional<ParamID> getParameterId(const QString &parName);
   std::string buildGaussianFunctionString() const;
   std::string buildPetersFunctionString() const;
diff --git a/qt/scientific_interfaces/Indirect/IndirectInstrumentConfig.cpp b/qt/scientific_interfaces/Indirect/IndirectInstrumentConfig.cpp
index 33dccab2d0c..a743511ad4c 100644
--- a/qt/scientific_interfaces/Indirect/IndirectInstrumentConfig.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectInstrumentConfig.cpp
@@ -300,7 +300,8 @@ void IndirectInstrumentConfig::updateInstrumentConfigurations(
  * @param ws Instrument workspace
  * @return If the workspace contained valid analysers
  */
-bool IndirectInstrumentConfig::updateAnalysersList(MatrixWorkspace_sptr ws) {
+bool IndirectInstrumentConfig::updateAnalysersList(
+    const MatrixWorkspace_sptr &ws) {
   if (!ws)
     return false;
 
diff --git a/qt/scientific_interfaces/Indirect/IndirectInstrumentConfig.h b/qt/scientific_interfaces/Indirect/IndirectInstrumentConfig.h
index dafeaba3598..1419916b327 100644
--- a/qt/scientific_interfaces/Indirect/IndirectInstrumentConfig.h
+++ b/qt/scientific_interfaces/Indirect/IndirectInstrumentConfig.h
@@ -96,7 +96,7 @@ signals:
 
 private slots:
   /// Updates the list of analysers when an instrument is selected
-  bool updateAnalysersList(Mantid::API::MatrixWorkspace_sptr ws);
+  bool updateAnalysersList(const Mantid::API::MatrixWorkspace_sptr &ws);
   /// Updates the list of reflections when an analyser is selected
   void updateReflectionsList(int index);
   /// Filters out any disabled instruments
diff --git a/qt/scientific_interfaces/Indirect/IndirectLoadILL.cpp b/qt/scientific_interfaces/Indirect/IndirectLoadILL.cpp
index fa721defb41..9b7e11f354a 100644
--- a/qt/scientific_interfaces/Indirect/IndirectLoadILL.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectLoadILL.cpp
@@ -47,7 +47,7 @@ std::string constructPrefix(std::string const &runName,
   return constructPrefix(runName, analyser, reflection);
 }
 
-std::string getWorkspacePrefix(MatrixWorkspace_const_sptr workspace,
+std::string getWorkspacePrefix(const MatrixWorkspace_const_sptr &workspace,
                                std::string const &facility) {
   auto const instrument = workspace->getInstrument();
   auto const runName =
diff --git a/qt/scientific_interfaces/Indirect/IndirectMoments.cpp b/qt/scientific_interfaces/Indirect/IndirectMoments.cpp
index d95ef291604..85f54fcd2ca 100644
--- a/qt/scientific_interfaces/Indirect/IndirectMoments.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectMoments.cpp
@@ -267,8 +267,8 @@ void IndirectMoments::setSaveEnabled(bool enabled) {
 
 void IndirectMoments::updateRunButton(bool enabled,
                                       std::string const &enableOutputButtons,
-                                      QString const message,
-                                      QString const tooltip) {
+                                      QString const &message,
+                                      QString const &tooltip) {
   setRunEnabled(enabled);
   m_uiForm.pbRun->setText(message);
   m_uiForm.pbRun->setToolTip(tooltip);
diff --git a/qt/scientific_interfaces/Indirect/IndirectMoments.h b/qt/scientific_interfaces/Indirect/IndirectMoments.h
index 8ea77bb0812..35234afd12b 100644
--- a/qt/scientific_interfaces/Indirect/IndirectMoments.h
+++ b/qt/scientific_interfaces/Indirect/IndirectMoments.h
@@ -48,8 +48,8 @@ protected slots:
   void setSaveEnabled(bool enabled);
   void updateRunButton(bool enabled = true,
                        std::string const &enableOutputButtons = "unchanged",
-                       QString const message = "Run",
-                       QString const tooltip = "");
+                       QString const &message = "Run",
+                       QString const &tooltip = "");
 
 private slots:
   void handleDataReady(QString const &dataName) override;
diff --git a/qt/scientific_interfaces/Indirect/IndirectPlotOptionsModel.cpp b/qt/scientific_interfaces/Indirect/IndirectPlotOptionsModel.cpp
index cddf78e04ff..cb11eac1a08 100644
--- a/qt/scientific_interfaces/Indirect/IndirectPlotOptionsModel.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectPlotOptionsModel.cpp
@@ -86,7 +86,7 @@ void insertWorkspaceNames(std::vector<std::string> &allNames,
 }
 
 boost::optional<std::string>
-checkWorkspaceSpectrumSize(MatrixWorkspace_const_sptr workspace) {
+checkWorkspaceSpectrumSize(const MatrixWorkspace_const_sptr &workspace) {
   if (workspace->y(0).size() < 2)
     return "Plot Spectra failed: There is only one data point to plot in " +
            workspace->getName() + ".";
@@ -94,7 +94,7 @@ checkWorkspaceSpectrumSize(MatrixWorkspace_const_sptr workspace) {
 }
 
 boost::optional<std::string>
-checkWorkspaceBinSize(MatrixWorkspace_const_sptr workspace) {
+checkWorkspaceBinSize(const MatrixWorkspace_const_sptr &workspace) {
   if (workspace->getNumberHistograms() < 2)
     return "Plot Bins failed: There is only one data point to plot in " +
            workspace->getName() + ".";
@@ -208,14 +208,14 @@ bool IndirectPlotOptionsModel::validateIndices(
 }
 
 bool IndirectPlotOptionsModel::validateSpectra(
-    MatrixWorkspace_sptr workspace, std::string const &spectra) const {
+    const MatrixWorkspace_sptr &workspace, std::string const &spectra) const {
   auto const numberOfHistograms = workspace->getNumberHistograms();
   auto const lastIndex = std::stoul(splitStringBy(spectra, ",-").back());
   return lastIndex < numberOfHistograms;
 }
 
-bool IndirectPlotOptionsModel::validateBins(MatrixWorkspace_sptr workspace,
-                                            std::string const &bins) const {
+bool IndirectPlotOptionsModel::validateBins(
+    const MatrixWorkspace_sptr &workspace, std::string const &bins) const {
   auto const numberOfBins = workspace->y(0).size();
   auto const lastIndex = std::stoul(splitStringBy(bins, ",-").back());
   return lastIndex < numberOfBins;
diff --git a/qt/scientific_interfaces/Indirect/IndirectPlotOptionsModel.h b/qt/scientific_interfaces/Indirect/IndirectPlotOptionsModel.h
index 6092f5f3330..eebcf27dbdd 100644
--- a/qt/scientific_interfaces/Indirect/IndirectPlotOptionsModel.h
+++ b/qt/scientific_interfaces/Indirect/IndirectPlotOptionsModel.h
@@ -61,9 +61,9 @@ public:
   std::map<std::string, std::string> availableActions() const;
 
 private:
-  bool validateSpectra(Mantid::API::MatrixWorkspace_sptr workspace,
+  bool validateSpectra(const Mantid::API::MatrixWorkspace_sptr &workspace,
                        std::string const &spectra) const;
-  bool validateBins(Mantid::API::MatrixWorkspace_sptr workspace,
+  bool validateBins(const Mantid::API::MatrixWorkspace_sptr &workspace,
                     std::string const &bins) const;
 
   boost::optional<std::string>
diff --git a/qt/scientific_interfaces/Indirect/IndirectPlotter.cpp b/qt/scientific_interfaces/Indirect/IndirectPlotter.cpp
index aa18b4cd7c4..56711979d16 100644
--- a/qt/scientific_interfaces/Indirect/IndirectPlotter.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectPlotter.cpp
@@ -18,6 +18,7 @@
 #include <QString>
 #include <QStringList>
 #include <QVariant>
+#include <utility>
 
 using namespace MantidQt::Widgets::MplCpp;
 #endif
@@ -178,8 +179,8 @@ workbenchPlot(QStringList const &workspaceNames,
     plotKwargs["capsize"] = ERROR_CAPSIZE;
 
   using MantidQt::Widgets::MplCpp::plot;
-  return plot(workspaceNames, boost::none, indices, figure, plotKwargs,
-              boost::none, boost::none, errorBars);
+  return plot(workspaceNames, boost::none, indices, std::move(figure),
+              plotKwargs, boost::none, boost::none, errorBars);
 }
 #endif
 
@@ -360,7 +361,7 @@ bool IndirectPlotter::validate(
  * @return True if the data is valid
  */
 bool IndirectPlotter::validate(
-    MatrixWorkspace_const_sptr workspace,
+    const MatrixWorkspace_const_sptr &workspace,
     boost::optional<std::string> const &workspaceIndices,
     boost::optional<MantidAxis> const &axisType) const {
   if (workspaceIndices && axisType && axisType.get() == MantidAxis::Spectrum)
@@ -379,7 +380,7 @@ bool IndirectPlotter::validate(
  * @return True if the indices exist
  */
 bool IndirectPlotter::validateSpectra(
-    MatrixWorkspace_const_sptr workspace,
+    const MatrixWorkspace_const_sptr &workspace,
     std::string const &workspaceIndices) const {
   auto const numberOfHistograms = workspace->getNumberHistograms();
   auto const lastIndex =
@@ -395,7 +396,7 @@ bool IndirectPlotter::validateSpectra(
  * '0-2,5,7-10')
  * @return True if the bin indices exist
  */
-bool IndirectPlotter::validateBins(MatrixWorkspace_const_sptr workspace,
+bool IndirectPlotter::validateBins(const MatrixWorkspace_const_sptr &workspace,
                                    std::string const &binIndices) const {
   auto const numberOfBins = workspace->y(0).size();
   auto const lastIndex = std::stoul(splitStringBy(binIndices, ",-").back());
diff --git a/qt/scientific_interfaces/Indirect/IndirectPlotter.h b/qt/scientific_interfaces/Indirect/IndirectPlotter.h
index 4e3560d3d57..db9a1a2e01a 100644
--- a/qt/scientific_interfaces/Indirect/IndirectPlotter.h
+++ b/qt/scientific_interfaces/Indirect/IndirectPlotter.h
@@ -54,12 +54,12 @@ public:
 
 private:
   bool
-  validate(Mantid::API::MatrixWorkspace_const_sptr workspace,
+  validate(const Mantid::API::MatrixWorkspace_const_sptr &workspace,
            boost::optional<std::string> const &workspaceIndices = boost::none,
            boost::optional<MantidAxis> const &axisType = boost::none) const;
-  bool validateSpectra(Mantid::API::MatrixWorkspace_const_sptr workspace,
+  bool validateSpectra(const Mantid::API::MatrixWorkspace_const_sptr &workspace,
                        std::string const &workspaceIndices) const;
-  bool validateBins(Mantid::API::MatrixWorkspace_const_sptr workspace,
+  bool validateBins(const Mantid::API::MatrixWorkspace_const_sptr &workspace,
                     std::string const &binIndices) const;
 
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
diff --git a/qt/scientific_interfaces/Indirect/IndirectSettings.cpp b/qt/scientific_interfaces/Indirect/IndirectSettings.cpp
index 983666592b0..cc3e604f7f9 100644
--- a/qt/scientific_interfaces/Indirect/IndirectSettings.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectSettings.cpp
@@ -54,7 +54,7 @@ void IndirectSettings::otherUserSubWindowCreated(
 }
 
 void IndirectSettings::connectIndirectInterface(
-    QPointer<UserSubWindow> window) {
+    const QPointer<UserSubWindow> &window) {
   if (auto indirectInterface = dynamic_cast<IndirectInterface *>(window.data()))
     connect(m_presenter.get(), SIGNAL(applySettings()), indirectInterface,
             SLOT(applySettings()));
diff --git a/qt/scientific_interfaces/Indirect/IndirectSettings.h b/qt/scientific_interfaces/Indirect/IndirectSettings.h
index 02e3fb43722..581da825cd2 100644
--- a/qt/scientific_interfaces/Indirect/IndirectSettings.h
+++ b/qt/scientific_interfaces/Indirect/IndirectSettings.h
@@ -51,7 +51,7 @@ private:
   void
   otherUserSubWindowCreated(QList<QPointer<UserSubWindow>> &windows) override;
 
-  void connectIndirectInterface(QPointer<UserSubWindow> window);
+  void connectIndirectInterface(const QPointer<UserSubWindow> &window);
 
   QWidget *getDockedOrFloatingWindow();
 
diff --git a/qt/scientific_interfaces/Indirect/IndirectSqw.cpp b/qt/scientific_interfaces/Indirect/IndirectSqw.cpp
index 0b7a4ac2568..61368c34ca7 100644
--- a/qt/scientific_interfaces/Indirect/IndirectSqw.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectSqw.cpp
@@ -300,8 +300,8 @@ void IndirectSqw::setSaveEnabled(bool enabled) {
 
 void IndirectSqw::updateRunButton(bool enabled,
                                   std::string const &enableOutputButtons,
-                                  QString const message,
-                                  QString const tooltip) {
+                                  QString const &message,
+                                  QString const &tooltip) {
   setRunEnabled(enabled);
   m_uiForm.pbRun->setText(message);
   m_uiForm.pbRun->setToolTip(tooltip);
diff --git a/qt/scientific_interfaces/Indirect/IndirectSqw.h b/qt/scientific_interfaces/Indirect/IndirectSqw.h
index ea018c966ed..68299a9e82b 100644
--- a/qt/scientific_interfaces/Indirect/IndirectSqw.h
+++ b/qt/scientific_interfaces/Indirect/IndirectSqw.h
@@ -38,8 +38,8 @@ private slots:
 
   void updateRunButton(bool enabled = true,
                        std::string const &enableOutputButtons = "unchanged",
-                       QString const message = "Run",
-                       QString const tooltip = "");
+                       QString const &message = "Run",
+                       QString const &tooltip = "");
 
 private:
   void plotRqwContour(std::string const &sampleName);
diff --git a/qt/scientific_interfaces/Indirect/IndirectSymmetrise.cpp b/qt/scientific_interfaces/Indirect/IndirectSymmetrise.cpp
index 33e78fe617e..955c6774538 100644
--- a/qt/scientific_interfaces/Indirect/IndirectSymmetrise.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectSymmetrise.cpp
@@ -620,8 +620,8 @@ void IndirectSymmetrise::setSaveEnabled(bool enabled) {
 
 void IndirectSymmetrise::updateRunButton(bool enabled,
                                          std::string const &enableOutputButtons,
-                                         QString const message,
-                                         QString const tooltip) {
+                                         QString const &message,
+                                         QString const &tooltip) {
   setRunEnabled(enabled);
   m_uiForm.pbRun->setText(message);
   m_uiForm.pbRun->setToolTip(tooltip);
diff --git a/qt/scientific_interfaces/Indirect/IndirectSymmetrise.h b/qt/scientific_interfaces/Indirect/IndirectSymmetrise.h
index 49dc8ab1b27..c1d739beed5 100644
--- a/qt/scientific_interfaces/Indirect/IndirectSymmetrise.h
+++ b/qt/scientific_interfaces/Indirect/IndirectSymmetrise.h
@@ -68,8 +68,8 @@ private slots:
   void setSaveEnabled(bool enabled);
   void updateRunButton(bool enabled = true,
                        std::string const &enableOutputButtons = "unchanged",
-                       QString const message = "Run",
-                       QString const tooltip = "");
+                       QString const &message = "Run",
+                       QString const &tooltip = "");
 
 private:
   void setFileExtensionsByName(bool filter) override;
diff --git a/qt/scientific_interfaces/Indirect/IndirectTab.cpp b/qt/scientific_interfaces/Indirect/IndirectTab.cpp
index 5e0ae57d68c..efc40de6b18 100644
--- a/qt/scientific_interfaces/Indirect/IndirectTab.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectTab.cpp
@@ -51,7 +51,7 @@ std::string castToString(int value) {
 }
 
 template <typename Predicate>
-void setPropertyIf(Algorithm_sptr algorithm, std::string const &propName,
+void setPropertyIf(const Algorithm_sptr &algorithm, std::string const &propName,
                    std::string const &value, Predicate const &condition) {
   if (condition)
     algorithm->setPropertyValue(propName, value);
@@ -503,7 +503,7 @@ void IndirectTab::setRangeSelectorMax(QtProperty *minProperty,
  * @param ws Pointer to the workspace
  * @return Energy mode
  */
-std::string IndirectTab::getEMode(Mantid::API::MatrixWorkspace_sptr ws) {
+std::string IndirectTab::getEMode(const Mantid::API::MatrixWorkspace_sptr &ws) {
   Mantid::Kernel::Unit_sptr xUnit = ws->getAxis(0)->unit();
   std::string xUnitName = xUnit->caption();
 
@@ -521,7 +521,7 @@ std::string IndirectTab::getEMode(Mantid::API::MatrixWorkspace_sptr ws) {
  * @param ws Pointer to the workspace
  * @return eFixed value
  */
-double IndirectTab::getEFixed(Mantid::API::MatrixWorkspace_sptr ws) {
+double IndirectTab::getEFixed(const Mantid::API::MatrixWorkspace_sptr &ws) {
   Mantid::Geometry::Instrument_const_sptr inst = ws->getInstrument();
   if (!inst)
     throw std::runtime_error("No instrument on workspace");
@@ -567,7 +567,7 @@ bool IndirectTab::getResolutionRangeFromWs(const QString &workspace,
  *found)
  */
 bool IndirectTab::getResolutionRangeFromWs(
-    Mantid::API::MatrixWorkspace_const_sptr workspace,
+    const Mantid::API::MatrixWorkspace_const_sptr &workspace,
     QPair<double, double> &res) {
   if (workspace) {
     auto const instrument = workspace->getInstrument();
@@ -601,7 +601,8 @@ IndirectTab::getXRangeFromWorkspace(std::string const &workspaceName,
 }
 
 QPair<double, double> IndirectTab::getXRangeFromWorkspace(
-    Mantid::API::MatrixWorkspace_const_sptr workspace, double precision) const {
+    const Mantid::API::MatrixWorkspace_const_sptr &workspace,
+    double precision) const {
   auto const xValues = workspace->x(0);
   return roundRangeToPrecision(xValues.front(), xValues.back(), precision);
 }
@@ -611,7 +612,7 @@ QPair<double, double> IndirectTab::getXRangeFromWorkspace(
  *
  * @param algorithm :: The algorithm to be run
  */
-void IndirectTab::runAlgorithm(const Mantid::API::IAlgorithm_sptr algorithm) {
+void IndirectTab::runAlgorithm(const Mantid::API::IAlgorithm_sptr &algorithm) {
   algorithm->setRethrows(true);
 
   // There should never really be unexecuted algorithms in the queue, but it is
@@ -646,7 +647,7 @@ void IndirectTab::algorithmFinished(bool error) {
  * @param no_output Enable to ignore any output
  * @returns What was printed to stdout
  */
-QString IndirectTab::runPythonCode(QString code, bool no_output) {
+QString IndirectTab::runPythonCode(const QString &code, bool no_output) {
   return m_pythonRunner.runPythonCode(code, no_output);
 }
 
@@ -675,7 +676,7 @@ bool IndirectTab::checkADSForPlotSaveWorkspace(const std::string &workspaceName,
 }
 
 std::unordered_map<std::string, size_t> IndirectTab::extractAxisLabels(
-    Mantid::API::MatrixWorkspace_const_sptr workspace,
+    const Mantid::API::MatrixWorkspace_const_sptr &workspace,
     const size_t &axisIndex) const {
   Axis *axis = workspace->getAxis(axisIndex);
   if (!axis->isText())
diff --git a/qt/scientific_interfaces/Indirect/IndirectTab.h b/qt/scientific_interfaces/Indirect/IndirectTab.h
index a327c5d9eaa..199dfe650e2 100644
--- a/qt/scientific_interfaces/Indirect/IndirectTab.h
+++ b/qt/scientific_interfaces/Indirect/IndirectTab.h
@@ -116,7 +116,7 @@ protected:
   /// Extracts the labels from the axis at the specified index in the
   /// specified workspace.
   std::unordered_map<std::string, size_t>
-  extractAxisLabels(Mantid::API::MatrixWorkspace_const_sptr workspace,
+  extractAxisLabels(const Mantid::API::MatrixWorkspace_const_sptr &workspace,
                     const size_t &axisIndex) const;
 
   /// Function to set the range limits of the plot
@@ -138,10 +138,10 @@ protected:
                            double newValue);
 
   /// Function to get energy mode from a workspace
-  std::string getEMode(Mantid::API::MatrixWorkspace_sptr ws);
+  std::string getEMode(const Mantid::API::MatrixWorkspace_sptr &ws);
 
   /// Function to get eFixed from a workspace
-  double getEFixed(Mantid::API::MatrixWorkspace_sptr ws);
+  double getEFixed(const Mantid::API::MatrixWorkspace_sptr &ws);
 
   /// Function to read an instrument's resolution from the IPF using a string
   bool getResolutionRangeFromWs(const QString &filename,
@@ -149,25 +149,26 @@ protected:
 
   /// Function to read an instrument's resolution from the IPF using a workspace
   /// pointer
-  bool getResolutionRangeFromWs(Mantid::API::MatrixWorkspace_const_sptr ws,
-                                QPair<double, double> &res);
+  bool
+  getResolutionRangeFromWs(const Mantid::API::MatrixWorkspace_const_sptr &ws,
+                           QPair<double, double> &res);
 
   /// Gets the x range from a workspace
   QPair<double, double>
   getXRangeFromWorkspace(std::string const &workspaceName,
                          double precision = 0.000001) const;
-  QPair<double, double>
-  getXRangeFromWorkspace(Mantid::API::MatrixWorkspace_const_sptr workspace,
-                         double precision = 0.000001) const;
+  QPair<double, double> getXRangeFromWorkspace(
+      const Mantid::API::MatrixWorkspace_const_sptr &workspace,
+      double precision = 0.000001) const;
 
   /// Converts a standard vector of standard strings to a QVector of QStrings.
   QVector<QString>
   convertStdStringVector(const std::vector<std::string> &stringVec) const;
 
   /// Function to run an algorithm on a seperate thread
-  void runAlgorithm(const Mantid::API::IAlgorithm_sptr algorithm);
+  void runAlgorithm(const Mantid::API::IAlgorithm_sptr &algorithm);
 
-  QString runPythonCode(QString vode, bool no_output = false);
+  QString runPythonCode(const QString &vode, bool no_output = false);
 
   /// Checks the ADS for a workspace named `workspaceName`,
   /// opens a warning box for plotting/saving if none found
diff --git a/qt/scientific_interfaces/Indirect/IndirectTransmission.cpp b/qt/scientific_interfaces/Indirect/IndirectTransmission.cpp
index 71f8def0741..db76d8e2632 100644
--- a/qt/scientific_interfaces/Indirect/IndirectTransmission.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectTransmission.cpp
@@ -165,8 +165,8 @@ void IndirectTransmission::setSaveEnabled(bool enabled) {
 }
 
 void IndirectTransmission::updateRunButton(
-    bool enabled, std::string const &enableOutputButtons, QString const message,
-    QString const tooltip) {
+    bool enabled, std::string const &enableOutputButtons,
+    QString const &message, QString const &tooltip) {
   setRunEnabled(enabled);
   m_uiForm.pbRun->setText(message);
   m_uiForm.pbRun->setToolTip(tooltip);
diff --git a/qt/scientific_interfaces/Indirect/IndirectTransmission.h b/qt/scientific_interfaces/Indirect/IndirectTransmission.h
index 2531a66baab..310e7128547 100644
--- a/qt/scientific_interfaces/Indirect/IndirectTransmission.h
+++ b/qt/scientific_interfaces/Indirect/IndirectTransmission.h
@@ -44,8 +44,8 @@ private slots:
   void setSaveEnabled(bool enabled);
   void updateRunButton(bool enabled = true,
                        std::string const &enableOutputButtons = "unchanged",
-                       QString const message = "Run",
-                       QString const tooltip = "");
+                       QString const &message = "Run",
+                       QString const &tooltip = "");
 
 private:
   void setInstrument(QString const &instrumentName);
diff --git a/qt/scientific_interfaces/Indirect/Iqt.cpp b/qt/scientific_interfaces/Indirect/Iqt.cpp
index 17c7e47c09f..058e944fc59 100644
--- a/qt/scientific_interfaces/Indirect/Iqt.cpp
+++ b/qt/scientific_interfaces/Indirect/Iqt.cpp
@@ -28,10 +28,10 @@ MatrixWorkspace_sptr getADSMatrixWorkspace(std::string const &workspaceName) {
       workspaceName);
 }
 
-std::string
-checkInstrumentParametersMatch(Instrument_const_sptr sampleInstrument,
-                               Instrument_const_sptr resolutionInstrument,
-                               std::string const &parameter) {
+std::string checkInstrumentParametersMatch(
+    const Instrument_const_sptr &sampleInstrument,
+    const Instrument_const_sptr &resolutionInstrument,
+    std::string const &parameter) {
   if (!sampleInstrument->hasParameter(parameter))
     return "Could not find the " + parameter + " for the sample workspace.";
   if (!resolutionInstrument->hasParameter(parameter))
@@ -43,9 +43,10 @@ checkInstrumentParametersMatch(Instrument_const_sptr sampleInstrument,
   return "";
 }
 
-std::string checkParametersMatch(MatrixWorkspace_const_sptr sampleWorkspace,
-                                 MatrixWorkspace_const_sptr resolutionWorkspace,
-                                 std::string const &parameter) {
+std::string
+checkParametersMatch(const MatrixWorkspace_const_sptr &sampleWorkspace,
+                     const MatrixWorkspace_const_sptr &resolutionWorkspace,
+                     std::string const &parameter) {
   auto const sampleInstrument = sampleWorkspace->getInstrument();
   auto const resolutionInstrument = resolutionWorkspace->getInstrument();
   return checkInstrumentParametersMatch(sampleInstrument, resolutionInstrument,
@@ -61,8 +62,8 @@ std::string checkParametersMatch(std::string const &sampleName,
 }
 
 std::string
-checkInstrumentsMatch(MatrixWorkspace_const_sptr sampleWorkspace,
-                      MatrixWorkspace_const_sptr resolutionWorkspace) {
+checkInstrumentsMatch(const MatrixWorkspace_const_sptr &sampleWorkspace,
+                      const MatrixWorkspace_const_sptr &resolutionWorkspace) {
   auto const sampleInstrument = sampleWorkspace->getInstrument();
   auto const resolutionInstrument = resolutionWorkspace->getInstrument();
   if (sampleInstrument->getName() != resolutionInstrument->getName())
@@ -70,9 +71,9 @@ checkInstrumentsMatch(MatrixWorkspace_const_sptr sampleWorkspace,
   return "";
 }
 
-std::string
-validateNumberOfHistograms(MatrixWorkspace_const_sptr sampleWorkspace,
-                           MatrixWorkspace_const_sptr resolutionWorkspace) {
+std::string validateNumberOfHistograms(
+    const MatrixWorkspace_const_sptr &sampleWorkspace,
+    const MatrixWorkspace_const_sptr &resolutionWorkspace) {
   auto const sampleSize = sampleWorkspace->getNumberHistograms();
   auto const resolutionSize = resolutionWorkspace->getNumberHistograms();
   if (resolutionSize > 1 && sampleSize != resolutionSize)
@@ -85,8 +86,8 @@ void addErrorMessage(UserInputValidator &uiv, std::string const &message) {
     uiv.addErrorMessage(QString::fromStdString(message) + "\n");
 }
 
-bool isTechniqueDirect(MatrixWorkspace_const_sptr sampleWorkspace,
-                       MatrixWorkspace_const_sptr resWorkspace) {
+bool isTechniqueDirect(const MatrixWorkspace_const_sptr &sampleWorkspace,
+                       const MatrixWorkspace_const_sptr &resWorkspace) {
   try {
     auto const logValue1 = sampleWorkspace->getLog("deltaE-mode")->value();
     auto const logValue2 = resWorkspace->getLog("deltaE-mode")->value();
diff --git a/qt/scientific_interfaces/Indirect/IqtFitModel.cpp b/qt/scientific_interfaces/Indirect/IqtFitModel.cpp
index ef402af173b..2750e94081f 100644
--- a/qt/scientific_interfaces/Indirect/IqtFitModel.cpp
+++ b/qt/scientific_interfaces/Indirect/IqtFitModel.cpp
@@ -12,6 +12,7 @@
 #include "MantidAPI/MultiDomainFunction.h"
 
 #include <boost/algorithm/string/predicate.hpp>
+#include <utility>
 
 using namespace Mantid::API;
 
@@ -19,7 +20,7 @@ namespace {
 IFunction_sptr getFirstInCategory(IFunction_sptr function,
                                   const std::string &category);
 
-IFunction_sptr getFirstInCategory(CompositeFunction_sptr composite,
+IFunction_sptr getFirstInCategory(const CompositeFunction_sptr &composite,
                                   const std::string &category) {
   for (auto i = 0u; i < composite->nFunctions(); ++i) {
     auto function = getFirstInCategory(composite->getFunction(i), category);
@@ -41,7 +42,7 @@ IFunction_sptr getFirstInCategory(IFunction_sptr function,
   return nullptr;
 }
 
-std::vector<std::string> getParameters(IFunction_sptr function,
+std::vector<std::string> getParameters(const IFunction_sptr &function,
                                        const std::string &shortParameterName) {
   std::vector<std::string> parameters;
 
@@ -52,7 +53,7 @@ std::vector<std::string> getParameters(IFunction_sptr function,
   return parameters;
 }
 
-bool constrainIntensities(IFunction_sptr function) {
+bool constrainIntensities(const IFunction_sptr &function) {
   const auto intensityParameters = getParameters(function, "Height");
   const auto backgroundParameters = getParameters(function, "A0");
 
@@ -73,7 +74,7 @@ bool constrainIntensities(IFunction_sptr function) {
   return true;
 }
 
-double computeTauApproximation(MatrixWorkspace_sptr workspace) {
+double computeTauApproximation(const MatrixWorkspace_sptr &workspace) {
   const auto &x = workspace->x(0);
   const auto &y = workspace->y(0);
 
@@ -83,28 +84,28 @@ double computeTauApproximation(MatrixWorkspace_sptr workspace) {
 }
 
 double computeHeightApproximation(IFunction_sptr function) {
-  const auto background = getFirstInCategory(function, "Background");
+  const auto background = getFirstInCategory(std::move(function), "Background");
   const double height = 1.0;
   if (background && background->hasParameter("A0"))
     return height - background->getParameter("A0");
   return height;
 }
 
-std::string getSuffix(MatrixWorkspace_sptr workspace) {
+std::string getSuffix(const MatrixWorkspace_sptr &workspace) {
   const auto position = workspace->getName().rfind("_");
   return workspace->getName().substr(position + 1);
 }
 
-std::string getFitString(MatrixWorkspace_sptr workspace) {
-  auto suffix = getSuffix(workspace);
+std::string getFitString(const MatrixWorkspace_sptr &workspace) {
+  auto suffix = getSuffix(std::move(workspace));
   boost::algorithm::to_lower(suffix);
   if (suffix == "iqt")
     return "Fit";
   return "_IqtFit";
 }
 
-boost::optional<std::string> findFullParameterName(IFunction_sptr function,
-                                                   const std::string &name) {
+boost::optional<std::string>
+findFullParameterName(const IFunction_sptr &function, const std::string &name) {
   for (auto i = 0u; i < function->nParams(); ++i) {
     const auto fullName = function->parameterName(i);
     if (boost::algorithm::ends_with(fullName, name))
@@ -230,8 +231,8 @@ IqtFitModel::createDefaultParameters(TableDatasetIndex index) const {
   return parameters;
 }
 
-MultiDomainFunction_sptr
-IqtFitModel::createFunctionWithGlobalBeta(IFunction_sptr function) const {
+MultiDomainFunction_sptr IqtFitModel::createFunctionWithGlobalBeta(
+    const IFunction_sptr &function) const {
   boost::shared_ptr<MultiDomainFunction> multiDomainFunction(
       new MultiDomainFunction);
   const auto functionString = function->asString();
diff --git a/qt/scientific_interfaces/Indirect/IqtFitModel.h b/qt/scientific_interfaces/Indirect/IqtFitModel.h
index 962064594ce..3c083447af3 100644
--- a/qt/scientific_interfaces/Indirect/IqtFitModel.h
+++ b/qt/scientific_interfaces/Indirect/IqtFitModel.h
@@ -31,8 +31,8 @@ private:
                                   WorkspaceIndex spectrum) const override;
   std::unordered_map<std::string, ParameterValue>
   createDefaultParameters(TableDatasetIndex index) const override;
-  Mantid::API::MultiDomainFunction_sptr
-  createFunctionWithGlobalBeta(Mantid::API::IFunction_sptr function) const;
+  Mantid::API::MultiDomainFunction_sptr createFunctionWithGlobalBeta(
+      const Mantid::API::IFunction_sptr &function) const;
 
   bool m_makeBetaGlobal;
   bool m_constrainIntensities;
diff --git a/qt/scientific_interfaces/Indirect/JumpFitModel.cpp b/qt/scientific_interfaces/Indirect/JumpFitModel.cpp
index fbb7043541c..a1050b133a3 100644
--- a/qt/scientific_interfaces/Indirect/JumpFitModel.cpp
+++ b/qt/scientific_interfaces/Indirect/JumpFitModel.cpp
@@ -6,6 +6,8 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "JumpFitModel.h"
 
+#include <utility>
+
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/TextAxis.h"
 #include "MantidKernel/Logger.h"
@@ -60,7 +62,7 @@ findAxisLabels(MatrixWorkspace const *workspace, Predicate const &predicate) {
   return std::make_pair(std::vector<std::string>(), std::vector<std::size_t>());
 }
 
-std::string createSpectra(std::vector<std::size_t> spectrum) {
+std::string createSpectra(const std::vector<std::size_t> &spectrum) {
   std::string spectra = "";
   for (auto spec : spectrum) {
     spectra.append(std::to_string(spec) + ",");
@@ -123,16 +125,18 @@ std::string extractSpectra(std::string const &inputName, int startIndex,
   return outputName;
 }
 
-std::string extractSpectrum(MatrixWorkspace_sptr workspace, int index,
+std::string extractSpectrum(const MatrixWorkspace_sptr &workspace, int index,
                             std::string const &outputName) {
   return extractSpectra(workspace->getName(), index, index, outputName);
 }
 
-std::string extractHWHMSpectrum(MatrixWorkspace_sptr workspace, int index) {
+std::string extractHWHMSpectrum(const MatrixWorkspace_sptr &workspace,
+                                int index) {
   auto const scaledName = "__scaled_" + std::to_string(index);
   auto const extractedName = "__extracted_" + std::to_string(index);
   auto const outputName = scaleWorkspace(
-      extractSpectrum(workspace, index, extractedName), scaledName, 0.5);
+      extractSpectrum(std::move(workspace), index, extractedName), scaledName,
+      0.5);
   deleteTemporaryWorkspaces({extractedName});
   return outputName;
 }
@@ -159,7 +163,7 @@ MatrixWorkspace_sptr appendAll(std::vector<std::string> const &workspaces,
 }
 
 std::vector<std::string>
-subdivideWidthWorkspace(MatrixWorkspace_sptr workspace,
+subdivideWidthWorkspace(const MatrixWorkspace_sptr &workspace,
                         const std::vector<std::size_t> &widthSpectra) {
   std::vector<std::string> subworkspaces;
   subworkspaces.reserve(1 + 2 * widthSpectra.size());
@@ -393,7 +397,7 @@ std::string JumpFitModel::constructOutputName() const {
 }
 
 bool JumpFitModel::allWorkspacesEqual(
-    Mantid::API::MatrixWorkspace_sptr workspace) const {
+    const Mantid::API::MatrixWorkspace_sptr &workspace) const {
   for (auto i = TableDatasetIndex{1}; i < numberOfWorkspaces(); ++i) {
     if (getWorkspace(i) != workspace)
       return false;
diff --git a/qt/scientific_interfaces/Indirect/JumpFitModel.h b/qt/scientific_interfaces/Indirect/JumpFitModel.h
index ac9881c537b..12125b237bf 100644
--- a/qt/scientific_interfaces/Indirect/JumpFitModel.h
+++ b/qt/scientific_interfaces/Indirect/JumpFitModel.h
@@ -53,7 +53,8 @@ public:
 
 private:
   std::string constructOutputName() const;
-  bool allWorkspacesEqual(Mantid::API::MatrixWorkspace_sptr workspace) const;
+  bool
+  allWorkspacesEqual(const Mantid::API::MatrixWorkspace_sptr &workspace) const;
   JumpFitParameters &
   addJumpFitParameters(Mantid::API::MatrixWorkspace *workspace,
                        const std::string &hwhmName);
diff --git a/qt/scientific_interfaces/Indirect/ResNorm.cpp b/qt/scientific_interfaces/Indirect/ResNorm.cpp
index 35ef872c128..21b982a8ac9 100644
--- a/qt/scientific_interfaces/Indirect/ResNorm.cpp
+++ b/qt/scientific_interfaces/Indirect/ResNorm.cpp
@@ -215,12 +215,12 @@ void ResNorm::processLogs() {
   addAdditionalLogs(resultWorkspace);
 }
 
-void ResNorm::addAdditionalLogs(WorkspaceGroup_sptr resultGroup) const {
+void ResNorm::addAdditionalLogs(const WorkspaceGroup_sptr &resultGroup) const {
   for (auto const &workspace : *resultGroup)
     addAdditionalLogs(workspace);
 }
 
-void ResNorm::addAdditionalLogs(Workspace_sptr resultWorkspace) const {
+void ResNorm::addAdditionalLogs(const Workspace_sptr &resultWorkspace) const {
   auto logAdder = AlgorithmManager::Instance().create("AddSampleLog");
   auto const name = resultWorkspace->getName();
 
@@ -265,14 +265,14 @@ double ResNorm::getDoubleManagerProperty(QString const &propName) const {
   return m_dblManager->value(m_properties[propName]);
 }
 
-void ResNorm::copyLogs(MatrixWorkspace_sptr resultWorkspace,
-                       WorkspaceGroup_sptr resultGroup) const {
+void ResNorm::copyLogs(const MatrixWorkspace_sptr &resultWorkspace,
+                       const WorkspaceGroup_sptr &resultGroup) const {
   for (auto const &workspace : *resultGroup)
     copyLogs(resultWorkspace, workspace);
 }
 
-void ResNorm::copyLogs(MatrixWorkspace_sptr resultWorkspace,
-                       Workspace_sptr workspace) const {
+void ResNorm::copyLogs(const MatrixWorkspace_sptr &resultWorkspace,
+                       const Workspace_sptr &workspace) const {
   auto logCopier = AlgorithmManager::Instance().create("CopyLogs");
   logCopier->setProperty("InputWorkspace", resultWorkspace->getName());
   logCopier->setProperty("OutputWorkspace", workspace->getName());
diff --git a/qt/scientific_interfaces/Indirect/ResNorm.h b/qt/scientific_interfaces/Indirect/ResNorm.h
index 77319d6be74..c793c9c751e 100644
--- a/qt/scientific_interfaces/Indirect/ResNorm.h
+++ b/qt/scientific_interfaces/Indirect/ResNorm.h
@@ -51,15 +51,17 @@ private:
   void setFileExtensionsByName(bool filter) override;
 
   void processLogs();
-  void addAdditionalLogs(Mantid::API::WorkspaceGroup_sptr resultGroup) const;
-  void addAdditionalLogs(Mantid::API::Workspace_sptr resultWorkspace) const;
+  void
+  addAdditionalLogs(const Mantid::API::WorkspaceGroup_sptr &resultGroup) const;
+  void
+  addAdditionalLogs(const Mantid::API::Workspace_sptr &resultWorkspace) const;
   std::map<std::string, std::string> getAdditionalLogStrings() const;
   std::map<std::string, std::string> getAdditionalLogNumbers() const;
   double getDoubleManagerProperty(QString const &propName) const;
-  void copyLogs(Mantid::API::MatrixWorkspace_sptr resultWorkspace,
-                Mantid::API::WorkspaceGroup_sptr resultGroup) const;
-  void copyLogs(Mantid::API::MatrixWorkspace_sptr resultWorkspace,
-                Mantid::API::Workspace_sptr workspace) const;
+  void copyLogs(const Mantid::API::MatrixWorkspace_sptr &resultWorkspace,
+                const Mantid::API::WorkspaceGroup_sptr &resultGroup) const;
+  void copyLogs(const Mantid::API::MatrixWorkspace_sptr &resultWorkspace,
+                const Mantid::API::Workspace_sptr &workspace) const;
 
   void setRunEnabled(bool enabled);
   void setPlotResultEnabled(bool enabled);
diff --git a/qt/scientific_interfaces/Indirect/test/IndirectDataValidationHelperTest.h b/qt/scientific_interfaces/Indirect/test/IndirectDataValidationHelperTest.h
index 8538eddeb39..f8f511c6691 100644
--- a/qt/scientific_interfaces/Indirect/test/IndirectDataValidationHelperTest.h
+++ b/qt/scientific_interfaces/Indirect/test/IndirectDataValidationHelperTest.h
@@ -45,7 +45,8 @@ std::string emptyWorkspaceGroupError() {
          " is empty.";
 }
 
-MatrixWorkspace_sptr convertWorkspace2DToMatrix(Workspace2D_sptr workspace) {
+MatrixWorkspace_sptr
+convertWorkspace2DToMatrix(const Workspace2D_sptr &workspace) {
   return boost::dynamic_pointer_cast<MatrixWorkspace>(workspace);
 }
 
diff --git a/qt/scientific_interfaces/Indirect/test/IndirectFitOutputTest.h b/qt/scientific_interfaces/Indirect/test/IndirectFitOutputTest.h
index a7917e4d55c..4ec0658d631 100644
--- a/qt/scientific_interfaces/Indirect/test/IndirectFitOutputTest.h
+++ b/qt/scientific_interfaces/Indirect/test/IndirectFitOutputTest.h
@@ -88,9 +88,9 @@ WorkspaceGroup_sptr getPopulatedGroup(std::size_t const &size) {
 }
 
 std::unique_ptr<IndirectFitOutputLegacy>
-createFitOutput(WorkspaceGroup_sptr resultGroup,
-                ITableWorkspace_sptr parameterTable,
-                WorkspaceGroup_sptr resultWorkspace,
+createFitOutput(const WorkspaceGroup_sptr &resultGroup,
+                const ITableWorkspace_sptr &parameterTable,
+                const WorkspaceGroup_sptr &resultWorkspace,
                 IndirectFitDataLegacy *fitData, std::size_t spectrum) {
   return std::make_unique<IndirectFitOutputLegacy>(
       resultGroup, parameterTable, resultWorkspace, fitData, spectrum);
@@ -324,9 +324,9 @@ private:
   }
 
   /// Store workspaces in ADS and won't destruct the ADS when leaving scope
-  void storeWorkspacesInADS(WorkspaceGroup_sptr workspacesGroup,
-                            WorkspaceGroup_sptr resultGroup,
-                            ITableWorkspace_sptr table) {
+  void storeWorkspacesInADS(const WorkspaceGroup_sptr &workspacesGroup,
+                            const WorkspaceGroup_sptr &resultGroup,
+                            const ITableWorkspace_sptr &table) {
     std::string const nameStart = resultGroup->size() > 1 ? "Multi" : "";
     m_ads = std::make_unique<SetUpADSWithWorkspace>(
         nameStart + "ConvFit_1L_Workspaces", workspacesGroup);
diff --git a/qt/scientific_interfaces/Indirect/test/IndirectFitPlotModelTest.h b/qt/scientific_interfaces/Indirect/test/IndirectFitPlotModelTest.h
index 55a0f2ce125..2114fe0717e 100644
--- a/qt/scientific_interfaces/Indirect/test/IndirectFitPlotModelTest.h
+++ b/qt/scientific_interfaces/Indirect/test/IndirectFitPlotModelTest.h
@@ -8,6 +8,8 @@
 
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "IndirectFitPlotModelLegacy.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/FunctionFactory.h"
@@ -121,7 +123,7 @@ IndirectFittingModelLegacy *createModelWithSingleInstrumentWorkspace(
   return model;
 }
 
-IAlgorithm_sptr setupFitAlgorithm(MatrixWorkspace_sptr workspace,
+IAlgorithm_sptr setupFitAlgorithm(const MatrixWorkspace_sptr &workspace,
                                   std::string const &functionString) {
   auto alg = boost::make_shared<ConvolutionFitSequential>();
   alg->initialize();
@@ -140,18 +142,19 @@ IAlgorithm_sptr setupFitAlgorithm(MatrixWorkspace_sptr workspace,
 }
 
 IAlgorithm_sptr getSetupFitAlgorithm(IndirectFittingModelLegacy *model,
-                                     MatrixWorkspace_sptr workspace,
+                                     const MatrixWorkspace_sptr &workspace,
                                      std::string const &workspaceName) {
   setFittingFunction(model, getFittingFunctionString(workspaceName), true);
-  auto alg =
-      setupFitAlgorithm(workspace, getFittingFunctionString(workspaceName));
+  auto alg = setupFitAlgorithm(std::move(workspace),
+                               getFittingFunctionString(workspaceName));
   return alg;
 }
 
 IAlgorithm_sptr getExecutedFitAlgorithm(IndirectFittingModelLegacy *model,
                                         MatrixWorkspace_sptr workspace,
                                         std::string const &workspaceName) {
-  auto const alg = getSetupFitAlgorithm(model, workspace, workspaceName);
+  auto const alg =
+      getSetupFitAlgorithm(model, std::move(workspace), workspaceName);
   alg->execute();
   return alg;
 }
diff --git a/qt/scientific_interfaces/Indirect/test/IndirectFittingModelTest.h b/qt/scientific_interfaces/Indirect/test/IndirectFittingModelTest.h
index cf0333eb503..b5afd434e62 100644
--- a/qt/scientific_interfaces/Indirect/test/IndirectFittingModelTest.h
+++ b/qt/scientific_interfaces/Indirect/test/IndirectFittingModelTest.h
@@ -8,6 +8,8 @@
 
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "IndirectFittingModelLegacy.h"
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/FunctionFactory.h"
@@ -106,7 +108,7 @@ void setFittingFunction(std::unique_ptr<DummyModel> &model,
   model->setFitFunction(getFunction(functionString));
 }
 
-IAlgorithm_sptr setupFitAlgorithm(MatrixWorkspace_sptr workspace,
+IAlgorithm_sptr setupFitAlgorithm(const MatrixWorkspace_sptr &workspace,
                                   std::string const &functionString) {
   auto alg = boost::make_shared<ConvolutionFitSequential>();
   alg->initialize();
@@ -125,7 +127,7 @@ IAlgorithm_sptr setupFitAlgorithm(MatrixWorkspace_sptr workspace,
 }
 
 IAlgorithm_sptr getSetupFitAlgorithm(std::unique_ptr<DummyModel> &model,
-                                     MatrixWorkspace_sptr workspace,
+                                     const MatrixWorkspace_sptr &workspace,
                                      std::string const &workspaceName) {
   std::string const function =
       "name=LinearBackground,A0=0,A1=0,ties=(A0=0.000000,A1=0.0);"
@@ -136,14 +138,15 @@ IAlgorithm_sptr getSetupFitAlgorithm(std::unique_ptr<DummyModel> &model,
       "false;name=Lorentzian,Amplitude=1,PeakCentre=0,FWHM=0."
       "0175)))";
   setFittingFunction(model, function);
-  auto alg = setupFitAlgorithm(workspace, function);
+  auto alg = setupFitAlgorithm(std::move(workspace), function);
   return alg;
 }
 
 IAlgorithm_sptr getExecutedFitAlgorithm(std::unique_ptr<DummyModel> &model,
                                         MatrixWorkspace_sptr workspace,
                                         std::string const &workspaceName) {
-  auto const alg = getSetupFitAlgorithm(model, workspace, workspaceName);
+  auto const alg =
+      getSetupFitAlgorithm(model, std::move(workspace), workspaceName);
   alg->execute();
   return alg;
 }
diff --git a/qt/scientific_interfaces/Indirect/test/IndirectPlotOptionsModelTest.h b/qt/scientific_interfaces/Indirect/test/IndirectPlotOptionsModelTest.h
index 963a8a9ee94..50daa20751b 100644
--- a/qt/scientific_interfaces/Indirect/test/IndirectPlotOptionsModelTest.h
+++ b/qt/scientific_interfaces/Indirect/test/IndirectPlotOptionsModelTest.h
@@ -32,7 +32,8 @@ std::string const GROUP_NAME = "GroupName";
 std::string const WORKSPACE_NAME = "WorkspaceName";
 std::string const WORKSPACE_INDICES = "0-2,4";
 
-MatrixWorkspace_sptr convertWorkspace2DToMatrix(Workspace2D_sptr workspace) {
+MatrixWorkspace_sptr
+convertWorkspace2DToMatrix(const Workspace2D_sptr &workspace) {
   return boost::dynamic_pointer_cast<MatrixWorkspace>(workspace);
 }
 
diff --git a/qt/scientific_interfaces/Indirect/test/IndirectPlotterTest.h b/qt/scientific_interfaces/Indirect/test/IndirectPlotterTest.h
index 8a8ac0ca31e..63e26d4b06a 100644
--- a/qt/scientific_interfaces/Indirect/test/IndirectPlotterTest.h
+++ b/qt/scientific_interfaces/Indirect/test/IndirectPlotterTest.h
@@ -28,7 +28,8 @@ namespace {
 std::string const WORKSPACE_NAME = "WorkspaceName";
 std::string const WORKSPACE_INDICES = "0-2,4";
 
-MatrixWorkspace_sptr convertWorkspace2DToMatrix(Workspace2D_sptr workspace) {
+MatrixWorkspace_sptr
+convertWorkspace2DToMatrix(const Workspace2D_sptr &workspace) {
   return boost::dynamic_pointer_cast<MatrixWorkspace>(workspace);
 }
 
diff --git a/qt/scientific_interfaces/MultiDatasetFit/MDFFunctionPlotData.cpp b/qt/scientific_interfaces/MultiDatasetFit/MDFFunctionPlotData.cpp
index 269e083b5ff..775b683bac3 100644
--- a/qt/scientific_interfaces/MultiDatasetFit/MDFFunctionPlotData.cpp
+++ b/qt/scientific_interfaces/MultiDatasetFit/MDFFunctionPlotData.cpp
@@ -18,6 +18,8 @@
 #include <qwt_plot.h>
 #include <qwt_plot_curve.h>
 
+#include <utility>
+
 namespace MantidQt {
 namespace CustomInterfaces {
 namespace MDF {
@@ -38,7 +40,7 @@ auto FUNCTION_CURVE_COLOR = Qt::magenta;
 MDFFunctionPlotData::MDFFunctionPlotData(
     boost::shared_ptr<Mantid::API::IFunction> fun, double startX, double endX,
     size_t nX)
-    : m_function(fun), m_functionCurve(new QwtPlotCurve()) {
+    : m_function(std::move(fun)), m_functionCurve(new QwtPlotCurve()) {
   setDomain(startX, endX, nX);
   auto pen = m_functionCurve->pen();
   pen.setColor(FUNCTION_CURVE_COLOR);
diff --git a/qt/scientific_interfaces/MultiDatasetFit/MultiDatasetFit.cpp b/qt/scientific_interfaces/MultiDatasetFit/MultiDatasetFit.cpp
index 66f8c2d83d9..16ddb25e259 100644
--- a/qt/scientific_interfaces/MultiDatasetFit/MultiDatasetFit.cpp
+++ b/qt/scientific_interfaces/MultiDatasetFit/MultiDatasetFit.cpp
@@ -704,7 +704,7 @@ QString MultiDatasetFit::getLocalParameterTie(const QString &parName,
 /// @param i :: Index of the dataset (spectrum).
 /// @param tie :: A tie string to set.
 void MultiDatasetFit::setLocalParameterTie(const QString &parName, int i,
-                                           QString tie) {
+                                           const QString &tie) {
   m_functionBrowser->setLocalParameterTie(parName, i, tie);
 }
 
diff --git a/qt/scientific_interfaces/MultiDatasetFit/MultiDatasetFit.h b/qt/scientific_interfaces/MultiDatasetFit/MultiDatasetFit.h
index 1c22f702a89..4fbffc943cb 100644
--- a/qt/scientific_interfaces/MultiDatasetFit/MultiDatasetFit.h
+++ b/qt/scientific_interfaces/MultiDatasetFit/MultiDatasetFit.h
@@ -79,7 +79,7 @@ public:
   /// Get the tie for a local parameter.
   QString getLocalParameterTie(const QString &parName, int i) const;
   /// Set a tie for a local parameter.
-  void setLocalParameterTie(const QString &parName, int i, QString tie);
+  void setLocalParameterTie(const QString &parName, int i, const QString &tie);
   /// Log a warning
   static void logWarning(const std::string &msg);
 
diff --git a/qt/scientific_interfaces/Muon/ALCBaselineModellingModel.cpp b/qt/scientific_interfaces/Muon/ALCBaselineModellingModel.cpp
index 5d098f6c3a6..6bce171fc77 100644
--- a/qt/scientific_interfaces/Muon/ALCBaselineModellingModel.cpp
+++ b/qt/scientific_interfaces/Muon/ALCBaselineModellingModel.cpp
@@ -14,12 +14,13 @@
 
 #include "Poco/ActiveResult.h"
 #include <QApplication>
+#include <utility>
 
 using namespace Mantid::API;
 
 namespace {
 
-MatrixWorkspace_sptr extractSpectrum(MatrixWorkspace_sptr inputWorkspace,
+MatrixWorkspace_sptr extractSpectrum(const MatrixWorkspace_sptr &inputWorkspace,
                                      const int workspaceIndex) {
   auto extracter = AlgorithmManager::Instance().create("ExtractSingleSpectrum");
   extracter->setChild(true);
@@ -31,8 +32,9 @@ MatrixWorkspace_sptr extractSpectrum(MatrixWorkspace_sptr inputWorkspace,
   return output;
 }
 
-MatrixWorkspace_sptr evaluateFunction(IFunction_const_sptr function,
-                                      MatrixWorkspace_sptr inputWorkspace) {
+MatrixWorkspace_sptr
+evaluateFunction(const IFunction_const_sptr &function,
+                 const MatrixWorkspace_sptr &inputWorkspace) {
   auto fit = AlgorithmManager::Instance().create("Fit");
   fit->setChild(true);
   fit->setProperty("Function", function->asString());
@@ -96,7 +98,7 @@ void ALCBaselineModellingModel::fit(IFunction_const_sptr function,
 }
 
 void ALCBaselineModellingModel::setData(MatrixWorkspace_sptr data) {
-  m_data = data;
+  m_data = std::move(data);
   emit dataChanged();
 }
 
@@ -108,7 +110,7 @@ void ALCBaselineModellingModel::setData(MatrixWorkspace_sptr data) {
  * @param sections :: Section we want to use for fitting
  */
 void ALCBaselineModellingModel::disableUnwantedPoints(
-    MatrixWorkspace_sptr ws,
+    const MatrixWorkspace_sptr &ws,
     const std::vector<IALCBaselineModellingModel::Section> &sections) {
   // Whether point with particular index should be disabled
   const size_t numBins = ws->blocksize();
@@ -146,7 +148,8 @@ void ALCBaselineModellingModel::disableUnwantedPoints(
  * @param sourceWs :: Workspace with original errors
  */
 void ALCBaselineModellingModel::enableDisabledPoints(
-    MatrixWorkspace_sptr destWs, MatrixWorkspace_const_sptr sourceWs) {
+    const MatrixWorkspace_sptr &destWs,
+    const MatrixWorkspace_const_sptr &sourceWs) {
   // Unwanted points were disabled by setting their errors to very high values.
   // We recover here the original errors stored in sourceWs
   destWs->mutableE(0) = sourceWs->e(0);
@@ -156,7 +159,8 @@ void ALCBaselineModellingModel::enableDisabledPoints(
  * Set errors in Diff spectrum after a fit
  * @param data :: [input/output] Workspace containing spectrum to set errors to
  */
-void ALCBaselineModellingModel::setErrorsAfterFit(MatrixWorkspace_sptr data) {
+void ALCBaselineModellingModel::setErrorsAfterFit(
+    const MatrixWorkspace_sptr &data) {
 
   data->mutableE(2) = data->e(0);
 }
@@ -208,13 +212,13 @@ ITableWorkspace_sptr ALCBaselineModellingModel::exportModel() {
 }
 
 void ALCBaselineModellingModel::setCorrectedData(MatrixWorkspace_sptr data) {
-  m_data = data;
+  m_data = std::move(data);
   emit correctedDataChanged();
 }
 
 void ALCBaselineModellingModel::setFittedFunction(
     IFunction_const_sptr function) {
-  m_fittedFunction = function;
+  m_fittedFunction = std::move(function);
   emit fittedFunctionChanged();
 }
 
diff --git a/qt/scientific_interfaces/Muon/ALCBaselineModellingModel.h b/qt/scientific_interfaces/Muon/ALCBaselineModellingModel.h
index 58b7793440e..552cf859176 100644
--- a/qt/scientific_interfaces/Muon/ALCBaselineModellingModel.h
+++ b/qt/scientific_interfaces/Muon/ALCBaselineModellingModel.h
@@ -76,16 +76,16 @@ private:
   void setFittedFunction(Mantid::API::IFunction_const_sptr function);
 
   // Set errors in the ws after the fit
-  void setErrorsAfterFit(Mantid::API::MatrixWorkspace_sptr data);
+  void setErrorsAfterFit(const Mantid::API::MatrixWorkspace_sptr &data);
 
   /// Disables points which shouldn't be used for fitting
-  static void disableUnwantedPoints(Mantid::API::MatrixWorkspace_sptr ws,
+  static void disableUnwantedPoints(const Mantid::API::MatrixWorkspace_sptr &ws,
                                     const std::vector<Section> &sections);
 
   /// Enable previously disabled points
   static void
-  enableDisabledPoints(Mantid::API::MatrixWorkspace_sptr destWs,
-                       Mantid::API::MatrixWorkspace_const_sptr sourceWs);
+  enableDisabledPoints(const Mantid::API::MatrixWorkspace_sptr &destWs,
+                       const Mantid::API::MatrixWorkspace_const_sptr &sourceWs);
 };
 
 } // namespace CustomInterfaces
diff --git a/qt/scientific_interfaces/Muon/ALCDataLoadingPresenter.cpp b/qt/scientific_interfaces/Muon/ALCDataLoadingPresenter.cpp
index 9b690fb5a69..b69d77f6408 100644
--- a/qt/scientific_interfaces/Muon/ALCDataLoadingPresenter.cpp
+++ b/qt/scientific_interfaces/Muon/ALCDataLoadingPresenter.cpp
@@ -331,7 +331,7 @@ MatrixWorkspace_sptr ALCDataLoadingPresenter::exportWorkspace() {
   return MatrixWorkspace_sptr();
 }
 
-void ALCDataLoadingPresenter::setData(MatrixWorkspace_sptr data) {
+void ALCDataLoadingPresenter::setData(const MatrixWorkspace_sptr &data) {
 
   if (data) {
     // Set the data
diff --git a/qt/scientific_interfaces/Muon/ALCDataLoadingPresenter.h b/qt/scientific_interfaces/Muon/ALCDataLoadingPresenter.h
index 5d3c9b115f5..cd32412a5bf 100644
--- a/qt/scientific_interfaces/Muon/ALCDataLoadingPresenter.h
+++ b/qt/scientific_interfaces/Muon/ALCDataLoadingPresenter.h
@@ -35,7 +35,7 @@ public:
   Mantid::API::MatrixWorkspace_sptr exportWorkspace();
 
   /// Sets some data
-  void setData(Mantid::API::MatrixWorkspace_sptr data);
+  void setData(const Mantid::API::MatrixWorkspace_sptr &data);
 
   // Returns a boolean stating whether data is currently being loading
   bool isLoading() const;
diff --git a/qt/scientific_interfaces/Muon/ALCPeakFittingModel.cpp b/qt/scientific_interfaces/Muon/ALCPeakFittingModel.cpp
index e163ec97d03..9eae7ba7510 100644
--- a/qt/scientific_interfaces/Muon/ALCPeakFittingModel.cpp
+++ b/qt/scientific_interfaces/Muon/ALCPeakFittingModel.cpp
@@ -16,12 +16,13 @@
 
 #include <Poco/ActiveResult.h>
 #include <QApplication>
+#include <utility>
 
 using namespace Mantid::API;
 
 namespace {
 
-MatrixWorkspace_sptr extractSpectrum(MatrixWorkspace_sptr inputWorkspace,
+MatrixWorkspace_sptr extractSpectrum(const MatrixWorkspace_sptr &inputWorkspace,
                                      const int workspaceIndex) {
   auto extracter = AlgorithmManager::Instance().create("ExtractSingleSpectrum");
   extracter->setChild(true);
@@ -33,8 +34,9 @@ MatrixWorkspace_sptr extractSpectrum(MatrixWorkspace_sptr inputWorkspace,
   return output;
 }
 
-MatrixWorkspace_sptr evaluateFunction(IFunction_const_sptr function,
-                                      MatrixWorkspace_sptr inputWorkspace) {
+MatrixWorkspace_sptr
+evaluateFunction(const IFunction_const_sptr &function,
+                 const MatrixWorkspace_sptr &inputWorkspace) {
   auto fit = AlgorithmManager::Instance().create("Fit");
   fit->setChild(true);
   fit->setProperty("Function", function->asString());
@@ -52,7 +54,7 @@ namespace MantidQt {
 namespace CustomInterfaces {
 
 void ALCPeakFittingModel::setData(MatrixWorkspace_sptr newData) {
-  m_data = newData;
+  m_data = std::move(newData);
   emit dataChanged();
 }
 
@@ -79,7 +81,7 @@ ITableWorkspace_sptr ALCPeakFittingModel::exportFittedPeaks() {
 }
 
 void ALCPeakFittingModel::setFittedPeaks(IFunction_const_sptr fittedPeaks) {
-  m_fittedPeaks = fittedPeaks;
+  m_fittedPeaks = std::move(fittedPeaks);
   emit fittedPeaksChanged();
 }
 
diff --git a/qt/scientific_interfaces/Muon/MuonAnalysis.cpp b/qt/scientific_interfaces/Muon/MuonAnalysis.cpp
index 656b4b0092e..2de5fbaf935 100644
--- a/qt/scientific_interfaces/Muon/MuonAnalysis.cpp
+++ b/qt/scientific_interfaces/Muon/MuonAnalysis.cpp
@@ -60,6 +60,7 @@
 #include <QVariant>
 
 #include <fstream>
+#include <utility>
 
 // Add this class to the list of specialised dialogs in this namespace
 namespace MantidQt {
@@ -604,7 +605,7 @@ Workspace_sptr MuonAnalysis::createAnalysisWorkspace(ItemType itemType,
   options.timeLimits.second = finishTime();
   options.rebinArgs = isRaw ? "" : rebinParams(loadedWS);
   options.plotType = plotType;
-  options.wsName = wsName;
+  options.wsName = std::move(wsName);
   const auto *table =
       itemType == ItemType::Group ? m_uiForm.groupTable : m_uiForm.pairTable;
   options.groupPairName = table->item(tableRow, 0)->text().toStdString();
@@ -1180,8 +1181,8 @@ void MuonAnalysis::handleInputFileChanges() {
  * @param loadResult :: Various loaded parameters as returned by load()
  * @return Used grouping for populating grouping table
  */
-boost::shared_ptr<GroupResult>
-MuonAnalysis::getGrouping(boost::shared_ptr<LoadResult> loadResult) const {
+boost::shared_ptr<GroupResult> MuonAnalysis::getGrouping(
+    const boost::shared_ptr<LoadResult> &loadResult) const {
   auto result = boost::make_shared<GroupResult>();
 
   boost::shared_ptr<Mantid::API::Grouping> groupingToUse;
@@ -2220,13 +2221,13 @@ double MuonAnalysis::timeZero() {
  * size
  * @return Params string to pass to rebin
  */
-std::string MuonAnalysis::rebinParams(Workspace_sptr wsForRebin) {
+std::string MuonAnalysis::rebinParams(const Workspace_sptr &wsForRebin) {
   MuonAnalysisOptionTab::RebinType rebinType = m_optionTab->getRebinType();
 
   if (rebinType == MuonAnalysisOptionTab::NoRebin) {
     return "";
   } else if (rebinType == MuonAnalysisOptionTab::FixedRebin) {
-    MatrixWorkspace_sptr ws = firstPeriod(wsForRebin);
+    MatrixWorkspace_sptr ws = firstPeriod(std::move(wsForRebin));
     double binSize = ws->x(0)[1] - ws->x(0)[0];
 
     double stepSize = m_optionTab->getRebinStep();
@@ -2749,7 +2750,7 @@ void MuonAnalysis::changeTab(int newTabIndex) {
 
   m_currentTab = newTab;
 }
-void MuonAnalysis::updateNormalization(QString name) {
+void MuonAnalysis::updateNormalization(const QString &name) {
   m_uiForm.fitBrowser->setNormalization(name.toStdString());
 }
 
diff --git a/qt/scientific_interfaces/Muon/MuonAnalysis.h b/qt/scientific_interfaces/Muon/MuonAnalysis.h
index 66edab2ad32..928e66f62e9 100644
--- a/qt/scientific_interfaces/Muon/MuonAnalysis.h
+++ b/qt/scientific_interfaces/Muon/MuonAnalysis.h
@@ -241,7 +241,7 @@ private slots:
   /// Called when "overwrite" is changed
   void updateDataPresenterOverwrite(int state);
   // update the displayed normalization
-  void updateNormalization(QString name);
+  void updateNormalization(const QString &name);
 
 private:
   void moveUnNormWS(const std::string &name, std::vector<std::string> &wsNames,
@@ -270,7 +270,7 @@ private:
 
   /// Get grouping for the loaded workspace
   boost::shared_ptr<Muon::GroupResult>
-  getGrouping(boost::shared_ptr<Muon::LoadResult> loadResult) const;
+  getGrouping(const boost::shared_ptr<Muon::LoadResult> &loadResult) const;
 
   /// Set whether the loading buttons and MWRunFiles widget are enabled.
   void allowLoading(bool enabled);
@@ -413,7 +413,7 @@ private:
 
   /// Returns params string which can be passed to Rebin, according to what user
   /// specified
-  std::string rebinParams(Mantid::API::Workspace_sptr wsForRebin);
+  std::string rebinParams(const Mantid::API::Workspace_sptr &wsForRebin);
 
   /// Updates rebin params in the fit data presenter
   void updateRebinParams();
diff --git a/qt/scientific_interfaces/Muon/MuonAnalysisDataLoader.cpp b/qt/scientific_interfaces/Muon/MuonAnalysisDataLoader.cpp
index 7c173945654..07eee852f1d 100644
--- a/qt/scientific_interfaces/Muon/MuonAnalysisDataLoader.cpp
+++ b/qt/scientific_interfaces/Muon/MuonAnalysisDataLoader.cpp
@@ -199,7 +199,7 @@ LoadResult MuonAnalysisDataLoader::loadFiles(const QStringList &files) const {
  * @returns :: name of instrument (empty if failed to get it)
  */
 std::string MuonAnalysisDataLoader::getInstrumentName(
-    const Workspace_sptr workspace) const {
+    const Workspace_sptr &workspace) const {
   if (workspace) {
     const auto period = MuonAnalysisHelper::firstPeriod(workspace);
     if (period) {
@@ -339,7 +339,7 @@ Workspace_sptr MuonAnalysisDataLoader::loadDeadTimesFromFile(
  * @returns :: Workspace containing analysed data
  */
 Workspace_sptr MuonAnalysisDataLoader::createAnalysisWorkspace(
-    const Workspace_sptr inputWS, const AnalysisOptions &options) const {
+    const Workspace_sptr &inputWS, const AnalysisOptions &options) const {
   IAlgorithm_sptr alg =
       AlgorithmManager::Instance().createUnmanaged("MuonProcess");
 
@@ -381,7 +381,7 @@ Workspace_sptr MuonAnalysisDataLoader::createAnalysisWorkspace(
  * @param options :: [input] Options to get properties from
  */
 void MuonAnalysisDataLoader::setProcessAlgorithmProperties(
-    IAlgorithm_sptr alg, const AnalysisOptions &options) const {
+    const IAlgorithm_sptr &alg, const AnalysisOptions &options) const {
   alg->setProperty("Mode", "Analyse");
   alg->setProperty("TimeZero", options.timeZero);             // user input
   alg->setProperty("LoadedTimeZero", options.loadedTimeZero); // from file
diff --git a/qt/scientific_interfaces/Muon/MuonAnalysisDataLoader.h b/qt/scientific_interfaces/Muon/MuonAnalysisDataLoader.h
index e79b47c4e85..1922723d230 100644
--- a/qt/scientific_interfaces/Muon/MuonAnalysisDataLoader.h
+++ b/qt/scientific_interfaces/Muon/MuonAnalysisDataLoader.h
@@ -72,7 +72,7 @@ public:
                   const Mantid::API::Grouping &grouping) const;
   /// create analysis workspace
   Mantid::API::Workspace_sptr
-  createAnalysisWorkspace(const Mantid::API::Workspace_sptr inputWS,
+  createAnalysisWorkspace(const Mantid::API::Workspace_sptr &inputWS,
                           const Muon::AnalysisOptions &options) const;
   /// Get dead time table
   Mantid::API::ITableWorkspace_sptr
@@ -92,7 +92,7 @@ public:
 protected:
   /// Set properties of algorithm from options
   void
-  setProcessAlgorithmProperties(Mantid::API::IAlgorithm_sptr alg,
+  setProcessAlgorithmProperties(const Mantid::API::IAlgorithm_sptr &alg,
                                 const Muon::AnalysisOptions &options) const;
   /// Remove from cache any workspaces that have been deleted in the meantime
   void updateCache() const;
@@ -100,7 +100,7 @@ protected:
 private:
   /// Get instrument name from workspace
   std::string
-  getInstrumentName(const Mantid::API::Workspace_sptr workspace) const;
+  getInstrumentName(const Mantid::API::Workspace_sptr &workspace) const;
   /// Check if we should cache result of a load of the given files
   bool shouldBeCached(const QStringList &filenames) const;
 
diff --git a/qt/scientific_interfaces/Muon/MuonAnalysisFitDataPresenter.cpp b/qt/scientific_interfaces/Muon/MuonAnalysisFitDataPresenter.cpp
index f02b2080ab4..4130fd8f14b 100644
--- a/qt/scientific_interfaces/Muon/MuonAnalysisFitDataPresenter.cpp
+++ b/qt/scientific_interfaces/Muon/MuonAnalysisFitDataPresenter.cpp
@@ -483,7 +483,7 @@ MuonAnalysisFitDataPresenter::createWorkspace(const std::string &name,
  * @returns :: parameter string for rebinning
  */
 std::string MuonAnalysisFitDataPresenter::getRebinParams(
-    const Mantid::API::Workspace_sptr ws) const {
+    const Mantid::API::Workspace_sptr &ws) const {
   // First check for workspace group. If it is, use first entry
   if (const auto &group = boost::dynamic_pointer_cast<WorkspaceGroup>(ws)) {
     if (group->size() > 0) {
diff --git a/qt/scientific_interfaces/Muon/MuonAnalysisFitDataPresenter.h b/qt/scientific_interfaces/Muon/MuonAnalysisFitDataPresenter.h
index 438b59b8a08..bf7701c46f8 100644
--- a/qt/scientific_interfaces/Muon/MuonAnalysisFitDataPresenter.h
+++ b/qt/scientific_interfaces/Muon/MuonAnalysisFitDataPresenter.h
@@ -134,7 +134,7 @@ private:
   /// Update model and view with names of workspaces to fit
   void updateWorkspaceNames(const std::vector<std::string> &names) const;
   /// Get rebin options for analysis
-  std::string getRebinParams(const Mantid::API::Workspace_sptr ws) const;
+  std::string getRebinParams(const Mantid::API::Workspace_sptr &ws) const;
   /// Add special logs to fitted workspaces
   void addSpecialLogs(
       const std::string &wsName,
diff --git a/qt/scientific_interfaces/Muon/MuonAnalysisHelper.cpp b/qt/scientific_interfaces/Muon/MuonAnalysisHelper.cpp
index c48468a378d..bc4dea86177 100644
--- a/qt/scientific_interfaces/Muon/MuonAnalysisHelper.cpp
+++ b/qt/scientific_interfaces/Muon/MuonAnalysisHelper.cpp
@@ -27,6 +27,7 @@
 #include <boost/lexical_cast.hpp>
 #include <boost/scope_exit.hpp>
 #include <stdexcept>
+#include <utility>
 
 namespace {
 /// Colors for workspace (Black, Red, Green, Blue, Orange, Purple, if there are
@@ -96,7 +97,7 @@ void setDoubleValidator(QLineEdit *field, bool allowEmpty) {
  * only - it is returned.
  * @param ws :: Run workspace
  */
-MatrixWorkspace_sptr firstPeriod(Workspace_sptr ws) {
+MatrixWorkspace_sptr firstPeriod(const Workspace_sptr &ws) {
   if (auto group = boost::dynamic_pointer_cast<WorkspaceGroup>(ws)) {
     return boost::dynamic_pointer_cast<MatrixWorkspace>(group->getItem(0));
   } else {
@@ -109,7 +110,7 @@ MatrixWorkspace_sptr firstPeriod(Workspace_sptr ws) {
  * @param ws :: Run wokspace
  * @return Number of periods
  */
-size_t numPeriods(Workspace_sptr ws) {
+size_t numPeriods(const Workspace_sptr &ws) {
   if (auto group = boost::dynamic_pointer_cast<WorkspaceGroup>(ws)) {
     return group->size();
   } else {
@@ -122,7 +123,7 @@ size_t numPeriods(Workspace_sptr ws) {
  * @param runWs :: Run workspace to retrieve information from
  * @param out :: Stream to print to
  */
-void printRunInfo(MatrixWorkspace_sptr runWs, std::ostringstream &out) {
+void printRunInfo(const MatrixWorkspace_sptr &runWs, std::ostringstream &out) {
   // Remember current out stream format
   std::ios_base::fmtflags outFlags(out.flags());
   std::streamsize outPrecision(out.precision());
@@ -253,7 +254,7 @@ void WidgetAutoSaver::registerWidget(QWidget *widget, const QString &name,
                                      QVariant defaultValue) {
   m_registeredWidgets.push_back(widget);
   m_widgetNames[widget] = name;
-  m_widgetDefaultValues[widget] = defaultValue;
+  m_widgetDefaultValues[widget] = std::move(defaultValue);
   m_widgetGroups[widget] =
       m_settings.group(); // Current group set up using beginGroup and endGroup
 }
@@ -710,7 +711,7 @@ void replaceLogValue(const std::string &wsName, const std::string &logName,
  * @param logName :: [input] Name of log
  * @returns All values found for the given log
  */
-std::vector<std::string> findLogValues(const Workspace_sptr ws,
+std::vector<std::string> findLogValues(const Workspace_sptr &ws,
                                        const std::string &logName) {
   std::vector<std::string> values;
   MatrixWorkspace_sptr matrixWS;
@@ -747,7 +748,7 @@ std::vector<std::string> findLogValues(const Workspace_sptr ws,
  * @returns :: Pair of (smallest, largest) values
  */
 std::pair<std::string, std::string> findLogRange(
-    const Workspace_sptr ws, const std::string &logName,
+    const Workspace_sptr &ws, const std::string &logName,
     bool (*isLessThan)(const std::string &first, const std::string &second)) {
   auto values = findLogValues(ws, logName);
   if (!values.empty()) {
@@ -793,7 +794,8 @@ std::pair<std::string, std::string> findLogRange(
  * @throws std::invalid_argument if the workspaces supplied are null or have
  * different number of periods
  */
-void appendTimeSeriesLogs(Workspace_sptr toAppend, Workspace_sptr resultant,
+void appendTimeSeriesLogs(const Workspace_sptr &toAppend,
+                          const Workspace_sptr &resultant,
                           const std::string &logName) {
   // check input
   if (!toAppend || !resultant) {
@@ -802,7 +804,7 @@ void appendTimeSeriesLogs(Workspace_sptr toAppend, Workspace_sptr resultant,
   }
 
   // Cast the inputs to MatrixWorkspace (could be a group)
-  auto getWorkspaces = [](const Workspace_sptr ws) {
+  auto getWorkspaces = [](const Workspace_sptr &ws) {
     std::vector<MatrixWorkspace_sptr> workspaces;
     MatrixWorkspace_sptr matrixWS =
         boost::dynamic_pointer_cast<MatrixWorkspace>(ws);
@@ -824,7 +826,7 @@ void appendTimeSeriesLogs(Workspace_sptr toAppend, Workspace_sptr resultant,
   };
 
   // Extract time series log from workspace
-  auto getTSLog = [&logName](const MatrixWorkspace_sptr ws) {
+  auto getTSLog = [&logName](const MatrixWorkspace_sptr &ws) {
     const Mantid::API::Run &run = ws->run();
     TimeSeriesProperty<double> *prop = nullptr;
     if (run.hasProperty(logName)) {
@@ -905,8 +907,8 @@ QString runNumberString(const std::string &workspaceName,
  * @throws std::invalid_argument if loadedWorkspace is null
  */
 bool isReloadGroupingNecessary(
-    const boost::shared_ptr<Mantid::API::Workspace> currentWorkspace,
-    const boost::shared_ptr<Mantid::API::Workspace> loadedWorkspace) {
+    const boost::shared_ptr<Mantid::API::Workspace> &currentWorkspace,
+    const boost::shared_ptr<Mantid::API::Workspace> &loadedWorkspace) {
   if (!loadedWorkspace) {
     throw std::invalid_argument("No loaded workspace to get grouping for!");
   }
diff --git a/qt/scientific_interfaces/Muon/MuonAnalysisHelper.h b/qt/scientific_interfaces/Muon/MuonAnalysisHelper.h
index 8eb5319168f..4044b331463 100644
--- a/qt/scientific_interfaces/Muon/MuonAnalysisHelper.h
+++ b/qt/scientific_interfaces/Muon/MuonAnalysisHelper.h
@@ -50,7 +50,7 @@ MANTIDQT_MUONINTERFACE_DLL void setDoubleValidator(QLineEdit *field,
 
 /// Returns a first period MatrixWorkspace in a run workspace
 MANTIDQT_MUONINTERFACE_DLL Mantid::API::MatrixWorkspace_sptr
-firstPeriod(Mantid::API::Workspace_sptr ws);
+firstPeriod(const Mantid::API::Workspace_sptr &ws);
 
 /// Validates the field and returns the value
 MANTIDQT_MUONINTERFACE_DLL double
@@ -58,11 +58,13 @@ getValidatedDouble(QLineEdit *field, const QString &defaultValue,
                    const QString &valueDescr, Mantid::Kernel::Logger &log);
 
 /// Returns a number of periods in a run workspace
-MANTIDQT_MUONINTERFACE_DLL size_t numPeriods(Mantid::API::Workspace_sptr ws);
+MANTIDQT_MUONINTERFACE_DLL size_t
+numPeriods(const Mantid::API::Workspace_sptr &ws);
 
 /// Print various information about the run
 MANTIDQT_MUONINTERFACE_DLL void
-printRunInfo(Mantid::API::MatrixWorkspace_sptr runWs, std::ostringstream &out);
+printRunInfo(const Mantid::API::MatrixWorkspace_sptr &runWs,
+             std::ostringstream &out);
 
 /// Get a run label for the workspace
 MANTIDQT_MUONINTERFACE_DLL std::string
@@ -97,11 +99,12 @@ MANTIDQT_MUONINTERFACE_DLL void replaceLogValue(const std::string &wsName,
 
 /// Finds all of the values for a log
 MANTIDQT_MUONINTERFACE_DLL std::vector<std::string>
-findLogValues(const Mantid::API::Workspace_sptr ws, const std::string &logName);
+findLogValues(const Mantid::API::Workspace_sptr &ws,
+              const std::string &logName);
 
 /// Finds the range of values for a log
 MANTIDQT_MUONINTERFACE_DLL std::pair<std::string, std::string> findLogRange(
-    const Mantid::API::Workspace_sptr ws, const std::string &logName,
+    const Mantid::API::Workspace_sptr &ws, const std::string &logName,
     bool (*isLessThan)(const std::string &first, const std::string &second));
 
 /// Finds the range of values for a log for a vector of workspaces
@@ -112,8 +115,8 @@ MANTIDQT_MUONINTERFACE_DLL std::pair<std::string, std::string> findLogRange(
 
 /// Concatenates time-series log of one workspace with the second
 MANTIDQT_MUONINTERFACE_DLL void
-appendTimeSeriesLogs(boost::shared_ptr<Mantid::API::Workspace> toAppend,
-                     boost::shared_ptr<Mantid::API::Workspace> resultant,
+appendTimeSeriesLogs(const boost::shared_ptr<Mantid::API::Workspace> &toAppend,
+                     const boost::shared_ptr<Mantid::API::Workspace> &resultant,
                      const std::string &logName);
 
 /// Parse analysis workspace name
@@ -130,8 +133,8 @@ runNumberString(const std::string &workspaceName, const std::string &firstRun);
 
 /// Decide if grouping needs to be reloaded
 MANTIDQT_MUONINTERFACE_DLL bool isReloadGroupingNecessary(
-    const boost::shared_ptr<Mantid::API::Workspace> currentWorkspace,
-    const boost::shared_ptr<Mantid::API::Workspace> loadedWorkspace);
+    const boost::shared_ptr<Mantid::API::Workspace> &currentWorkspace,
+    const boost::shared_ptr<Mantid::API::Workspace> &loadedWorkspace);
 
 /// Parse run label into instrument and runs
 MANTIDQT_MUONINTERFACE_DLL void parseRunLabel(const std::string &label,
diff --git a/qt/scientific_interfaces/Muon/MuonAnalysisResultTableCreator.cpp b/qt/scientific_interfaces/Muon/MuonAnalysisResultTableCreator.cpp
index 976259602cd..73921efcb8f 100644
--- a/qt/scientific_interfaces/Muon/MuonAnalysisResultTableCreator.cpp
+++ b/qt/scientific_interfaces/Muon/MuonAnalysisResultTableCreator.cpp
@@ -278,7 +278,7 @@ void MuonAnalysisResultTableCreator::checkSameNumberOfDatasets(
   const size_t firstNumRuns = workspacesByLabel.begin()->second.size();
   if (std::any_of(workspacesByLabel.begin(), workspacesByLabel.end(),
                   [&firstNumRuns](
-                      const std::pair<QString, std::vector<std::string>> fit) {
+                      const std::pair<QString, std::vector<std::string>> &fit) {
                     return fit.second.size() != firstNumRuns;
                   })) {
     throw std::runtime_error(
@@ -753,7 +753,7 @@ bool MuonAnalysisResultTableCreator::haveSameParameters(
  * @param table :: [input, output] Pointer to TableWorkspace to edit
  */
 void MuonAnalysisResultTableCreator::removeFixedParameterErrors(
-    const ITableWorkspace_sptr table) const {
+    const ITableWorkspace_sptr &table) const {
   assert(table);
   const size_t nRows = table->rowCount();
   const auto colNames = table->getColumnNames();
diff --git a/qt/scientific_interfaces/Muon/MuonAnalysisResultTableCreator.h b/qt/scientific_interfaces/Muon/MuonAnalysisResultTableCreator.h
index 35b5255dfbc..54a07a44d50 100644
--- a/qt/scientific_interfaces/Muon/MuonAnalysisResultTableCreator.h
+++ b/qt/scientific_interfaces/Muon/MuonAnalysisResultTableCreator.h
@@ -37,7 +37,7 @@ protected:
       const std::vector<Mantid::API::ITableWorkspace_sptr> &tables) const;
   /// Remove error columns for fixed parameters from a results table
   void removeFixedParameterErrors(
-      const Mantid::API::ITableWorkspace_sptr table) const;
+      const Mantid::API::ITableWorkspace_sptr &table) const;
 
 private:
   /// Get map of label to workspaces
diff --git a/qt/scientific_interfaces/Muon/MuonAnalysisResultTableTab.cpp b/qt/scientific_interfaces/Muon/MuonAnalysisResultTableTab.cpp
index ad0aaa54505..44828560914 100644
--- a/qt/scientific_interfaces/Muon/MuonAnalysisResultTableTab.cpp
+++ b/qt/scientific_interfaces/Muon/MuonAnalysisResultTableTab.cpp
@@ -676,7 +676,7 @@ bool MuonAnalysisResultTableTab::logNameLessThan(const QString &logName1,
  */
 void MuonAnalysisResultTableTab::populateFittings(
     const QStringList &names,
-    std::function<Workspace_sptr(const QString &)> wsFromName) {
+    const std::function<Workspace_sptr(const QString &)> &wsFromName) {
   // Add number of rows for the amount of fittings.
   m_uiForm.fittingResultsTable->setRowCount(names.size());
 
diff --git a/qt/scientific_interfaces/Muon/MuonAnalysisResultTableTab.h b/qt/scientific_interfaces/Muon/MuonAnalysisResultTableTab.h
index e055b3238f8..180e873717d 100644
--- a/qt/scientific_interfaces/Muon/MuonAnalysisResultTableTab.h
+++ b/qt/scientific_interfaces/Muon/MuonAnalysisResultTableTab.h
@@ -98,7 +98,8 @@ private:
   void populateLogsAndValues(const QStringList &fittedWsList);
   void populateFittings(
       const QStringList &names,
-      std::function<Mantid::API::Workspace_sptr(const QString &)> wsFromName);
+      const std::function<Mantid::API::Workspace_sptr(const QString &)>
+          &wsFromName);
 
   /// Creates the results table
   void createTable(bool multipleFits);
diff --git a/qt/scientific_interfaces/Muon/MuonSequentialFitDialog.cpp b/qt/scientific_interfaces/Muon/MuonSequentialFitDialog.cpp
index b4b32f5cd36..12bbd3b993f 100644
--- a/qt/scientific_interfaces/Muon/MuonSequentialFitDialog.cpp
+++ b/qt/scientific_interfaces/Muon/MuonSequentialFitDialog.cpp
@@ -140,7 +140,8 @@ std::string MuonSequentialFitDialog::isValidLabel(const std::string &label) {
  * @param ws :: Workspace to get title from
  * @return The title, or empty string if unable to get one
  */
-std::string MuonSequentialFitDialog::getRunTitle(Workspace_const_sptr ws) {
+std::string
+MuonSequentialFitDialog::getRunTitle(const Workspace_const_sptr &ws) {
   auto matrixWS = boost::dynamic_pointer_cast<const MatrixWorkspace>(ws);
 
   if (!matrixWS)
@@ -194,9 +195,9 @@ void MuonSequentialFitDialog::initDiagnosisTable() {
  * @param fitQuality     :: Number representing goodness of the fit
  * @param fittedFunction :: Function containing fitted parameters
  */
-void MuonSequentialFitDialog::addDiagnosisEntry(const std::string &runTitle,
-                                                double fitQuality,
-                                                IFunction_sptr fittedFunction) {
+void MuonSequentialFitDialog::addDiagnosisEntry(
+    const std::string &runTitle, double fitQuality,
+    const IFunction_sptr &fittedFunction) {
   int newRow = m_ui.diagnosisTable->rowCount();
 
   m_ui.diagnosisTable->insertRow(newRow);
diff --git a/qt/scientific_interfaces/Muon/MuonSequentialFitDialog.h b/qt/scientific_interfaces/Muon/MuonSequentialFitDialog.h
index ae4b581bbc7..b63041d86e7 100644
--- a/qt/scientific_interfaces/Muon/MuonSequentialFitDialog.h
+++ b/qt/scientific_interfaces/Muon/MuonSequentialFitDialog.h
@@ -56,7 +56,7 @@ private:
 
   /// Add a new entry to the diagnosis table
   void addDiagnosisEntry(const std::string &runTitle, double fitQuality,
-                         Mantid::API::IFunction_sptr fittedFunction);
+                         const Mantid::API::IFunction_sptr &fittedFunction);
 
   /// Helper function to create new item for Diagnosis table
   QTableWidgetItem *createTableWidgetItem(const QString &text);
@@ -90,7 +90,7 @@ private:
   static std::string isValidLabel(const std::string &label);
 
   /// Returns displayable title for the given workspace
-  static std::string getRunTitle(Mantid::API::Workspace_const_sptr ws);
+  static std::string getRunTitle(const Mantid::API::Workspace_const_sptr &ws);
 
   // -- SLOTS ------------------------------------------------------
 
diff --git a/qt/scientific_interfaces/test/EnggDiffFittingModelTest.h b/qt/scientific_interfaces/test/EnggDiffFittingModelTest.h
new file mode 100644
index 00000000000..7a7355b78ce
--- /dev/null
+++ b/qt/scientific_interfaces/test/EnggDiffFittingModelTest.h
@@ -0,0 +1,312 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "MantidAPI/FrameworkManager.h"
+#include "MantidAPI/ITableWorkspace.h"
+#include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/TableRow.h"
+#include "MantidAPI/WorkspaceFactory.h"
+
+#include "../EnggDiffraction/EnggDiffFittingModel.h"
+
+#include <cxxtest/TestSuite.h>
+#include <utility>
+
+#include <vector>
+
+using namespace Mantid;
+using namespace MantidQt::CustomInterfaces;
+
+namespace {
+
+// Helper class that exposes addFocusedWorkspace
+// This means we can test the workspace maps without having to run Load
+class EnggDiffFittingModelAddWSExposed : public EnggDiffFittingModel {
+public:
+  void addWorkspace(const RunLabel &runLabel,
+                    const Mantid::API::MatrixWorkspace_sptr &ws);
+
+  void addFitParams(const RunLabel &runLabel,
+                    const Mantid::API::ITableWorkspace_sptr &ws);
+
+  void mergeTablesExposed(const API::ITableWorkspace_sptr &tableToCopy,
+                          const API::ITableWorkspace_sptr &targetTable);
+};
+
+inline void EnggDiffFittingModelAddWSExposed::addWorkspace(
+    const RunLabel &runLabel, const API::MatrixWorkspace_sptr &ws) {
+  addFocusedWorkspace(runLabel, std::move(ws),
+                      runLabel.runNumber + "_" + std::to_string(runLabel.bank));
+}
+
+inline void EnggDiffFittingModelAddWSExposed::addFitParams(
+    const RunLabel &runLabel, const Mantid::API::ITableWorkspace_sptr &ws) {
+  addFitResults(runLabel, std::move(ws));
+}
+
+inline void EnggDiffFittingModelAddWSExposed::mergeTablesExposed(
+    const API::ITableWorkspace_sptr &tableToCopy,
+    const API::ITableWorkspace_sptr &targetTable) {
+  mergeTables(std::move(tableToCopy), std::move(targetTable));
+}
+
+void addSampleWorkspaceToModel(const RunLabel &runLabel,
+                               EnggDiffFittingModelAddWSExposed &model) {
+  API::MatrixWorkspace_sptr ws =
+      API::WorkspaceFactory::Instance().create("Workspace2D", 1, 10, 10);
+  model.addWorkspace(runLabel, ws);
+}
+
+API::ITableWorkspace_sptr createFitParamsTable() {
+  const size_t numColumns = 16;
+  const size_t numRows = 4;
+  auto table = API::WorkspaceFactory::Instance().createTable("TableWorkspace");
+  const std::array<std::string, numColumns> headings({{
+      "dSpacing[Y]",
+      "A0[Y]",
+      "A0_Err[yEr]",
+      "A1[Y]",
+      "A1_Err[yEr]",
+      "X0[Y]",
+      "X0_Err[yEr]",
+      "A[Y]",
+      "A_Err[yEr]",
+      "B[Y]",
+      "B_Err[yEr]",
+      "S[Y]",
+      "S_Err[yEr]",
+      "I[Y]",
+      "I_Err[yEr]",
+      "Chi[Y]",
+  }});
+
+  for (const auto &columnHeading : headings) {
+    table->addColumn("double", columnHeading);
+  }
+
+  const std::array<std::array<double, numColumns>, numRows> rows = {
+      {{{1.4826999999999999, 0.093628531894011102, 0.66109193835092461,
+         1.2564478992707699e-06, 2.4291293347225761e-05, 27140.960929827994,
+         4.4430783321852303, 0.045621368052062856, 0.0092005773305902459,
+         0.020298218347394655, 0.0025002243189996306, 11.741120992807753,
+         5.3771683079349311, 34.202007864467461, 1.8695496489293224,
+         1.4096728498206776}},
+       {{1.7197, 1.0731062065126851, 0.72931461734063008,
+         -2.9359794063082084e-05, 2.285663646689115e-05, 31770.101042814735,
+         5.6899014393655358, 0.050855278541599255, 0.013915934527381201,
+         0.029076388335360012, 0.002935493268317269, 27.132751332587915,
+         4.5849081323418064, 89.646425792809978, 2.1570533782524279,
+         0.79304374868658656}},
+       {{2.2399, 1.3229681799066122, 0.45360789821414083,
+         -3.0219780224537017e-05, 1.0941426250415265e-05, 41266.973604075109,
+         4.0391546488412224, 0.043604800066098286, 0.0071406722143233931,
+         0.021740542092941812, 0.001008755490980281, 36.523446658868707,
+         3.2982922870662814, 205.36292151601506, 2.3728608996241367,
+         0.90144473999482344}},
+       {{2.552, 0.46162942972449567, 0.24323265893625406,
+         -9.0850559562388256e-06, 5.1638893666718458e-06, 46982.314791027922,
+         46.041577282817634, 0.14208244137460718, 0.61720906575104273,
+         0.018444321135930489, 0.0078725143001187933, 45.171720946242374,
+         18.656365897259217, 14.950355673087914, 1.02699955199189,
+         0.68147322764610252}}}};
+
+  for (const auto &row : rows) {
+    API::TableRow tableRow = table->appendRow();
+    for (const auto entry : row) {
+      tableRow << entry;
+    }
+  }
+  return table;
+}
+
+template <size_t numColumns, size_t numRows>
+API::ITableWorkspace_sptr createDummyTable(
+    const std::array<std::string, numColumns> &columnHeadings,
+    const std::array<std::array<double, numColumns>, numRows> tableContents) {
+  auto table = API::WorkspaceFactory::Instance().createTable();
+  for (const auto &header : columnHeadings) {
+    table->addColumn("double", header);
+  }
+  for (const auto &row : tableContents) {
+    API::TableRow newRow = table->appendRow();
+    for (const auto value : row) {
+      newRow << value;
+    }
+  }
+  return table;
+}
+
+} // anonymous namespace
+
+class EnggDiffFittingModelTest : public CxxTest::TestSuite {
+
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static EnggDiffFittingModelTest *createSuite() {
+    return new EnggDiffFittingModelTest();
+  }
+  static void destroySuite(EnggDiffFittingModelTest *suite) { delete suite; }
+
+  EnggDiffFittingModelTest() { API::FrameworkManager::Instance(); }
+
+  void test_addAndGetWorkspace() {
+    auto model = EnggDiffFittingModelAddWSExposed();
+    API::MatrixWorkspace_sptr ws =
+        API::WorkspaceFactory::Instance().create("Workspace2D", 1, 10, 10);
+
+    const RunLabel runLabel("100", 1);
+    TS_ASSERT_THROWS_NOTHING(model.addWorkspace(runLabel, ws));
+    const auto retrievedWS = model.getFocusedWorkspace(runLabel);
+
+    TS_ASSERT(retrievedWS != nullptr);
+    TS_ASSERT_EQUALS(ws, retrievedWS);
+  }
+
+  void test_getRunNumbersAndBankIDs() {
+    auto model = EnggDiffFittingModelAddWSExposed();
+
+    addSampleWorkspaceToModel(RunLabel("123", 1), model);
+    addSampleWorkspaceToModel(RunLabel("456", 2), model);
+    addSampleWorkspaceToModel(RunLabel("789", 1), model);
+    addSampleWorkspaceToModel(RunLabel("123", 2), model);
+
+    const auto runLabels = model.getRunLabels();
+
+    TS_ASSERT_EQUALS(runLabels.size(), 4);
+    TS_ASSERT_EQUALS(runLabels[0], RunLabel("123", 1));
+    TS_ASSERT_EQUALS(runLabels[1], RunLabel("123", 2));
+    TS_ASSERT_EQUALS(runLabels[2], RunLabel("456", 2));
+    TS_ASSERT_EQUALS(runLabels[3], RunLabel("789", 1));
+  }
+
+  void test_loadWorkspaces() {
+    auto model = EnggDiffFittingModel();
+    TS_ASSERT_THROWS_NOTHING(model.loadWorkspaces(FOCUSED_WS_FILENAME));
+    API::MatrixWorkspace_sptr ws;
+    TS_ASSERT_THROWS_NOTHING(
+        ws = model.getFocusedWorkspace(FOCUSED_WS_RUN_LABEL));
+    TS_ASSERT_EQUALS(ws->getNumberHistograms(), 1);
+    TS_ASSERT_EQUALS(std::to_string(ws->getRunNumber()),
+                     FOCUSED_WS_RUN_LABEL.runNumber);
+  }
+
+  void test_setDifcTzero() {
+    auto model = EnggDiffFittingModel();
+    TS_ASSERT_THROWS_NOTHING(model.loadWorkspaces(FOCUSED_WS_FILENAME));
+
+    TS_ASSERT_THROWS_NOTHING(model.setDifcTzero(
+        FOCUSED_WS_RUN_LABEL, std::vector<GSASCalibrationParms>()));
+    auto ws = model.getFocusedWorkspace(FOCUSED_WS_RUN_LABEL);
+    auto run = ws->run();
+    TS_ASSERT(run.hasProperty("difa"));
+    TS_ASSERT(run.hasProperty("difc"));
+    TS_ASSERT(run.hasProperty("tzero"));
+  }
+
+  void test_createFittedPeaksWS() {
+    auto model = EnggDiffFittingModelAddWSExposed();
+
+    const auto fitParams = createFitParamsTable();
+    TS_ASSERT_THROWS_NOTHING(
+        model.addFitParams(FOCUSED_WS_RUN_LABEL, fitParams));
+    TS_ASSERT_THROWS_NOTHING(model.loadWorkspaces(FOCUSED_WS_FILENAME));
+
+    TS_ASSERT_THROWS_NOTHING(model.setDifcTzero(
+        FOCUSED_WS_RUN_LABEL, std::vector<GSASCalibrationParms>()));
+    TS_ASSERT_THROWS_NOTHING(model.createFittedPeaksWS(FOCUSED_WS_RUN_LABEL));
+
+    API::MatrixWorkspace_sptr fittedPeaksWS;
+    TS_ASSERT_THROWS_NOTHING(fittedPeaksWS =
+                                 model.getFittedPeaksWS(FOCUSED_WS_RUN_LABEL));
+    TS_ASSERT_EQUALS(fittedPeaksWS->getNumberHistograms(), 4);
+  }
+
+  void test_getNumFocusedWorkspaces() {
+    auto model = EnggDiffFittingModelAddWSExposed();
+
+    addSampleWorkspaceToModel(RunLabel("123", 1), model);
+    addSampleWorkspaceToModel(RunLabel("456", 2), model);
+    addSampleWorkspaceToModel(RunLabel("789", 1), model);
+
+    TS_ASSERT_EQUALS(model.getNumFocusedWorkspaces(), 3);
+  }
+
+  void test_mergeTables() {
+    auto model = EnggDiffFittingModelAddWSExposed();
+
+    const size_t numberOfColumns = 3;
+    const size_t numberOfRows = 2;
+
+    const std::array<std::string, numberOfColumns> columnHeadings = {
+        {"X", "Y", "Z"}};
+
+    const std::array<std::array<double, numberOfColumns>, numberOfRows>
+        targetTableValues = {{{{1, 2, 3}}, {{4, 5, 6}}}};
+
+    auto targetTable = createDummyTable(columnHeadings, targetTableValues);
+
+    const std::array<std::array<double, numberOfColumns>, numberOfRows>
+        copyTableValues = {{{{7, 8, 9}}, {{10, 11, 12}}}};
+
+    auto copyTable = createDummyTable(columnHeadings, copyTableValues);
+
+    TS_ASSERT_THROWS_NOTHING(model.mergeTablesExposed(copyTable, targetTable));
+
+    TS_ASSERT_EQUALS(targetTable->columnCount(), numberOfColumns);
+    TS_ASSERT_EQUALS(targetTable->rowCount(), numberOfRows * 2);
+
+    for (size_t rowIndex = 0; rowIndex < numberOfRows * 2; ++rowIndex) {
+      std::cout << "ROW " << rowIndex << "\n";
+      API::TableRow row = targetTable->getRow(rowIndex);
+      const double expectedX = static_cast<double>(rowIndex) * 3 + 1;
+      const double expectedY = static_cast<double>(rowIndex) * 3 + 2;
+      const double expectedZ = static_cast<double>(rowIndex) * 3 + 3;
+
+      // x, y and z must be initialized to keep RHEL7 happy
+      auto x = expectedX + 1;
+      auto y = expectedY + 1;
+      auto z = expectedZ + 1;
+
+      TS_ASSERT_THROWS_NOTHING(row >> x >> y >> z);
+      TS_ASSERT_EQUALS(x, expectedX);
+      TS_ASSERT_EQUALS(y, expectedY);
+      TS_ASSERT_EQUALS(z, expectedZ);
+    }
+  }
+
+  void test_removeRun() {
+    auto model = EnggDiffFittingModelAddWSExposed();
+
+    const RunLabel label1("123", 1);
+    addSampleWorkspaceToModel(label1, model);
+    const RunLabel label2("456", 2);
+    addSampleWorkspaceToModel(label2, model);
+    const RunLabel label3("789", 1);
+    addSampleWorkspaceToModel(label3, model);
+
+    model.removeRun(label1);
+
+    const auto runLabels = model.getRunLabels();
+    TS_ASSERT_EQUALS(runLabels.size(), 2);
+
+    TS_ASSERT_EQUALS(runLabels[0], label2);
+    TS_ASSERT_EQUALS(runLabels[1], label3);
+  }
+
+private:
+  const static std::string FOCUSED_WS_FILENAME;
+  const static RunLabel FOCUSED_WS_RUN_LABEL;
+};
+
+const std::string EnggDiffFittingModelTest::FOCUSED_WS_FILENAME =
+    "ENGINX_277208_focused_bank_2.nxs";
+
+const RunLabel EnggDiffFittingModelTest::FOCUSED_WS_RUN_LABEL =
+    RunLabel("277208", 2);
diff --git a/qt/scientific_interfaces/test/EnggDiffFittingPresenterTest.h b/qt/scientific_interfaces/test/EnggDiffFittingPresenterTest.h
new file mode 100644
index 00000000000..94f569ca36d
--- /dev/null
+++ b/qt/scientific_interfaces/test/EnggDiffFittingPresenterTest.h
@@ -0,0 +1,764 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "../EnggDiffraction/EnggDiffFittingPresenter.h"
+#include "MantidAPI/FrameworkManager.h"
+
+#include "MantidTestHelpers/WorkspaceCreationHelper.h"
+
+#include "EnggDiffFittingModelMock.h"
+#include "EnggDiffFittingViewMock.h"
+#include "EnggDiffractionParamMock.h"
+#include <cxxtest/TestSuite.h>
+#include <utility>
+
+#include <vector>
+
+using namespace MantidQt::CustomInterfaces;
+using testing::Return;
+using testing::ReturnRef;
+using testing::TypedEq;
+
+// Use this mocked presenter for tests that will start the focusing
+// workers/threads. Otherwise you'll run into trouble with issues like
+// "QEventLoop: Cannot be used without QApplication", as there is not
+// Qt application here and the normal Qt thread used by the presenter
+// uses signals/slots.
+class EnggDiffFittingPresenterNoThread : public EnggDiffFittingPresenter {
+public:
+  EnggDiffFittingPresenterNoThread(IEnggDiffFittingView *view)
+      : EnggDiffFittingPresenterNoThread(
+            view,
+            std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>()) {}
+
+  EnggDiffFittingPresenterNoThread(IEnggDiffFittingView *view,
+                                   std::unique_ptr<IEnggDiffFittingModel> model)
+      : EnggDiffFittingPresenter(view, std::move(model), nullptr, nullptr) {}
+
+  EnggDiffFittingPresenterNoThread(
+      IEnggDiffFittingView *view, std::unique_ptr<IEnggDiffFittingModel> model,
+      boost::shared_ptr<IEnggDiffractionParam> mainParam)
+      : EnggDiffFittingPresenter(view, std::move(model), nullptr,
+                                 std::move(mainParam)) {}
+
+private:
+  // not async at all
+  void startAsyncFittingWorker(const std::vector<RunLabel> &runLabels,
+                               const std::string &ExpectedPeaks) override {
+    assert(runLabels.size() == 1);
+    doFitting(runLabels, ExpectedPeaks);
+    fittingFinished();
+  }
+};
+
+class EnggDiffFittingPresenterTest : public CxxTest::TestSuite {
+
+public:
+  // This pair of boilerplate methods prevent tghe suite being created
+  // statically
+  // This means the constructor isn't called when running other tests
+  static EnggDiffFittingPresenterTest *createSuite() {
+    return new EnggDiffFittingPresenterTest();
+  }
+
+  static void destroySuite(EnggDiffFittingPresenterTest *suite) {
+    delete suite;
+  }
+
+  EnggDiffFittingPresenterTest() {
+    Mantid::API::FrameworkManager::Instance(); // make sure framework is
+                                               // initialized
+  }
+
+  void setUp() override {
+    m_view.reset(new testing::NiceMock<MockEnggDiffFittingView>());
+    auto mockModel =
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>();
+
+    m_presenter.reset(new MantidQt::CustomInterfaces::EnggDiffFittingPresenter(
+        m_view.get(), std::move(mockModel), nullptr, nullptr));
+
+    // default banks
+    m_ex_enginx_banks.emplace_back(true);
+    m_ex_enginx_banks.emplace_back(false);
+
+    // default run number
+    m_ex_empty_run_num.emplace_back("");
+    m_invalid_run_number.emplace_back("");
+    m_ex_run_number.emplace_back(g_validRunNo);
+    g_vanNo.emplace_back("8899999988");
+    g_ceriaNo.emplace_back("9999999999");
+
+    // provide personal directories in order to carry out the full disable tests
+    m_basicCalibSettings.m_inputDirCalib = "GUI_calib_folder/";
+    m_basicCalibSettings.m_inputDirRaw = "GUI_calib_folder/";
+
+    m_basicCalibSettings.m_pixelCalibFilename =
+        "ENGINX_full_pixel_calibration.csv";
+
+    m_basicCalibSettings.m_templateGSAS_PRM = "GUI_calib_folder/"
+                                              "template_ENGINX_241391_236516_"
+                                              "North_and_South_banks.prm";
+
+    m_basicCalibSettings.m_forceRecalcOverwrite = false;
+    m_basicCalibSettings.m_rebinCalibrate = 1;
+  }
+
+  void tearDown() override {
+    TS_ASSERT(testing::Mock::VerifyAndClearExpectations(m_view.get()));
+  }
+
+  void test_load_with_missing_param() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    auto mockModel =
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>();
+    auto *mockModel_ptr = mockModel.get();
+    MantidQt::CustomInterfaces::EnggDiffFittingPresenter pres(
+        &mockView, std::move(mockModel), nullptr, nullptr);
+
+    EXPECT_CALL(mockView, getFocusedFileNames()).Times(1).WillOnce(Return(""));
+
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(1);
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+
+    // Should never get as far as trying to load
+    EXPECT_CALL(*mockModel_ptr, loadWorkspaces(testing::_)).Times(0);
+
+    pres.notify(IEnggDiffFittingPresenter::Load);
+    TSM_ASSERT(
+        "View mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+    TSM_ASSERT(
+        "Model mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(mockModel_ptr))
+  }
+
+  void test_fitting_with_missing_param() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    auto mockModel =
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>();
+    MantidQt::CustomInterfaces::EnggDiffFittingPresenter pres(
+        &mockView, std::move(mockModel), nullptr, nullptr);
+
+    EXPECT_CALL(mockView, getFittingListWidgetCurrentValue())
+        .Times(1)
+        .WillOnce(Return(boost::none));
+
+    // should not get to the point where the status is updated
+    EXPECT_CALL(mockView, setPeakList(testing::_)).Times(0);
+    EXPECT_CALL(mockView, showStatus(testing::_)).Times(0);
+
+    // No errors/1 warnings. There will be an error log from the algorithms
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(1);
+
+    pres.notify(IEnggDiffFittingPresenter::FitPeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  // This would test the fitting tab with no focused workspace
+  // which should produce a warning
+  void test_fitting_without_focused_run() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    EnggDiffFittingPresenterNoThread pres(&mockView);
+
+    // inputs from user
+    EXPECT_CALL(mockView, getFittingListWidgetCurrentValue())
+        .Times(1)
+        .WillOnce(Return(boost::none));
+
+    // should not get to the point where the status is updated
+    EXPECT_CALL(mockView, setPeakList(testing::_)).Times(0);
+    EXPECT_CALL(mockView, showStatus(testing::_)).Times(0);
+
+    // No errors/1 warnings. There will be an error log from the algorithms
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(1);
+
+    pres.notify(IEnggDiffFittingPresenter::FitPeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  // This would test the fitting tab with invalid expected peaks but should only
+  // produce a warning
+  void test_fitting_with_invalid_expected_peaks() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    auto mockModel =
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>();
+    auto *mockModel_ptr = mockModel.get();
+
+    EnggDiffFittingPresenterNoThread pres(&mockView, std::move(mockModel));
+
+    EXPECT_CALL(mockView, getFittingListWidgetCurrentValue())
+        .Times(1)
+        .WillOnce(Return(boost::optional<std::string>(
+            boost::optional<std::string>("123_1"))));
+    EXPECT_CALL(*mockModel_ptr, getWorkspaceFilename(testing::_))
+        .Times(1)
+        .WillOnce(ReturnRef(EMPTY));
+
+    EXPECT_CALL(mockView, getExpectedPeaksInput())
+        .Times(1)
+        .WillOnce(Return(",3.5,7.78,r43d"));
+    EXPECT_CALL(mockView, setPeakList(testing::_)).Times(1);
+
+    // should not get to the point where the status is updated
+    EXPECT_CALL(mockView, showStatus(testing::_)).Times(0);
+
+    // No errors/1 warnings. There will be an error log from the algorithms
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(1);
+
+    pres.notify(IEnggDiffFittingPresenter::FitPeaks);
+    TSM_ASSERT(
+        "View mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+    TSM_ASSERT(
+        "Model mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(mockModel_ptr))
+  }
+
+  // Fit All Peaks test begin here
+  void test_fit_all_runno_valid_single_run() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    auto mockModel =
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>();
+    auto *mockModel_ptr = mockModel.get();
+
+    EnggDiffFittingPresenterNoThread pres(&mockView, std::move(mockModel));
+
+    EXPECT_CALL(mockView, getExpectedPeaksInput())
+        .Times(1)
+        .WillOnce(Return("2.3445,3.3433,4.5664"));
+
+    const RunLabel runLabel("123", 1);
+    EXPECT_CALL(*mockModel_ptr, getRunLabels())
+        .Times(1)
+        .WillOnce(Return(std::vector<RunLabel>({runLabel})));
+
+    EXPECT_CALL(*mockModel_ptr, getWorkspaceFilename(runLabel))
+        .Times(1)
+        .WillOnce(ReturnRef(EMPTY));
+
+    EXPECT_CALL(mockView, setPeakList(testing::_)).Times(1);
+
+    EXPECT_CALL(mockView, enableFitAllButton(testing::_)).Times(0);
+
+    // should not get to the point where the status is updated
+    EXPECT_CALL(mockView, showStatus(testing::_)).Times(0);
+
+    // No errors/1 warnings. There will be an error log because dir vector
+    // is empty
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(1);
+
+    pres.notify(IEnggDiffFittingPresenter::FitAllPeaks);
+  }
+
+  // This would test the fitting tab with invalid expected peaks but should only
+  // produce a warning
+  void test_fit_all_with_invalid_expected_peaks() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    auto mockModel =
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>();
+    auto *mockModel_ptr = mockModel.get();
+
+    EnggDiffFittingPresenterNoThread pres(&mockView, std::move(mockModel));
+
+    // inputs from user
+    EXPECT_CALL(mockView, getExpectedPeaksInput())
+        .Times(1)
+        .WillOnce(Return(",3.5,7.78,r43d"));
+    EXPECT_CALL(mockView, setPeakList(testing::_)).Times(1);
+
+    const RunLabel runLabel("123", 1);
+    EXPECT_CALL(*mockModel_ptr, getRunLabels())
+        .Times(1)
+        .WillOnce(Return(std::vector<RunLabel>({runLabel})));
+
+    EXPECT_CALL(*mockModel_ptr, getWorkspaceFilename(runLabel))
+        .Times(1)
+        .WillOnce(ReturnRef(EMPTY));
+
+    // should not get to the point where the status is updated
+    EXPECT_CALL(mockView, showStatus(testing::_)).Times(0);
+
+    // No errors/1 warnings. There will be an error log from the algorithms
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(1);
+
+    pres.notify(IEnggDiffFittingPresenter::FitAllPeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_browse_peaks_list() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    const auto paramMock =
+        boost::make_shared<testing::NiceMock<MockEnggDiffractionParam>>();
+    EnggDiffFittingPresenterNoThread pres(
+        &mockView,
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>(),
+        paramMock);
+
+    const auto &userDir(Poco::Path::home());
+    EXPECT_CALL(*paramMock, outFilesUserDir(""))
+        .Times(1)
+        .WillOnce(Return(userDir));
+
+    EXPECT_CALL(mockView, getOpenFile(userDir)).Times(1);
+
+    EXPECT_CALL(mockView, getSaveFile(testing::_)).Times(0);
+
+    // No errors/0 warnings.
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(0);
+
+    pres.notify(IEnggDiffFittingPresenter::browsePeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_browse_peaks_list_with_warning() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    const auto paramMock =
+        boost::make_shared<testing::NiceMock<MockEnggDiffractionParam>>();
+    EnggDiffFittingPresenterNoThread pres(
+        &mockView,
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>(),
+        paramMock);
+
+    const auto &userDir(Poco::Path::home());
+    EXPECT_CALL(*paramMock, outFilesUserDir(""))
+        .Times(1)
+        .WillOnce(Return(userDir));
+
+    std::string dummyDir = "I/am/a/dummy/directory";
+
+    EXPECT_CALL(mockView, getOpenFile(userDir))
+        .Times(1)
+        .WillOnce(Return(dummyDir));
+
+    EXPECT_CALL(mockView, setPreviousDir(dummyDir)).Times(1);
+
+    EXPECT_CALL(mockView, setPeakList(testing::_)).Times(1);
+
+    // No errors/0 warnings.
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(0);
+
+    pres.notify(IEnggDiffFittingPresenter::browsePeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_save_peaks_list() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    const auto paramMock =
+        boost::make_shared<testing::NiceMock<MockEnggDiffractionParam>>();
+    EnggDiffFittingPresenterNoThread pres(
+        &mockView,
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>(),
+        paramMock);
+
+    const auto &userDir(Poco::Path::home());
+    EXPECT_CALL(*paramMock, outFilesUserDir(""))
+        .Times(1)
+        .WillOnce(Return(userDir));
+
+    EXPECT_CALL(mockView, getSaveFile(userDir)).Times(1);
+
+    // No errors/No warnings.
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(0);
+
+    pres.notify(IEnggDiffFittingPresenter::savePeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_save_peaks_list_with_warning() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    const auto paramMock =
+        boost::make_shared<testing::NiceMock<MockEnggDiffractionParam>>();
+    EnggDiffFittingPresenterNoThread pres(
+        &mockView,
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>(),
+        paramMock);
+
+    const auto &userDir(Poco::Path::home());
+    EXPECT_CALL(*paramMock, outFilesUserDir(""))
+        .Times(1)
+        .WillOnce(Return(userDir));
+
+    std::string dummyDir = "/dummy/directory/";
+    EXPECT_CALL(mockView, getSaveFile(userDir))
+        .Times(1)
+        .WillOnce(Return(dummyDir));
+
+    EXPECT_CALL(mockView, getExpectedPeaksInput()).Times(0);
+
+    // No errors/1 warnings. Dummy file entered is not found
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(1);
+
+    pres.notify(IEnggDiffFittingPresenter::savePeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_add_peaks_to_empty_list() {
+
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    EnggDiffFittingPresenterNoThread pres(&mockView);
+
+    EXPECT_CALL(mockView, peakPickerEnabled()).Times(1).WillOnce(Return(true));
+
+    EXPECT_CALL(mockView, getPeakCentre()).Times(1);
+
+    EXPECT_CALL(mockView, getExpectedPeaksInput())
+        .Times(1)
+        .WillOnce(Return(""));
+    ;
+
+    EXPECT_CALL(mockView, setPeakList(testing::_)).Times(1);
+
+    // should not be updating the status
+    EXPECT_CALL(mockView, showStatus(testing::_)).Times(0);
+
+    // No errors/0 warnings.
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(0);
+
+    pres.notify(IEnggDiffFittingPresenter::addPeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_add_peaks_with_disabled_peak_picker() {
+
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    EnggDiffFittingPresenterNoThread pres(&mockView);
+
+    EXPECT_CALL(mockView, peakPickerEnabled()).Times(1).WillOnce(Return(false));
+
+    EXPECT_CALL(mockView, getPeakCentre()).Times(0);
+
+    EXPECT_CALL(mockView, getExpectedPeaksInput()).Times(0);
+
+    EXPECT_CALL(mockView, setPeakList(testing::_)).Times(0);
+
+    // should not be updating the status
+    EXPECT_CALL(mockView, showStatus(testing::_)).Times(0);
+
+    // No errors/0 warnings.
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(0);
+
+    pres.notify(IEnggDiffFittingPresenter::addPeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_add_valid_peaks_to_list_with_comma() {
+
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    EnggDiffFittingPresenterNoThread pres(&mockView);
+
+    EXPECT_CALL(mockView, peakPickerEnabled()).Times(1).WillOnce(Return(true));
+
+    EXPECT_CALL(mockView, getPeakCentre()).Times(1).WillOnce(Return(2.0684));
+
+    EXPECT_CALL(mockView, getExpectedPeaksInput())
+        .Times(1)
+        .WillOnce(Return("1.7906,2.0684,1.2676,"));
+
+    EXPECT_CALL(mockView, setPeakList("1.7906,2.0684,1.2676,2.0684")).Times(1);
+
+    // No errors/0 warnings.
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(0);
+
+    pres.notify(IEnggDiffFittingPresenter::addPeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_add_customised_valid_peaks_to_list_without_comma() {
+
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    EnggDiffFittingPresenterNoThread pres(&mockView);
+
+    EXPECT_CALL(mockView, peakPickerEnabled()).Times(1).WillOnce(Return(true));
+
+    EXPECT_CALL(mockView, getPeakCentre()).Times(1).WillOnce(Return(3.0234));
+
+    EXPECT_CALL(mockView, getExpectedPeaksInput())
+        .Times(1)
+        .WillOnce(Return("2.0684,1.2676"));
+
+    EXPECT_CALL(mockView, setPeakList("2.0684,1.2676,3.0234")).Times(1);
+
+    // should not be updating the status
+    EXPECT_CALL(mockView, showStatus(testing::_)).Times(0);
+
+    // No errors/0 warnings.
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(0);
+
+    pres.notify(IEnggDiffFittingPresenter::addPeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_add_invalid_peaks_to_list() {
+
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    EnggDiffFittingPresenterNoThread pres(&mockView);
+
+    EXPECT_CALL(mockView, peakPickerEnabled()).Times(1).WillOnce(Return(true));
+
+    EXPECT_CALL(mockView, getPeakCentre()).Times(1).WillOnce(Return(0.0133));
+
+    EXPECT_CALL(mockView, getExpectedPeaksInput())
+        .Times(1)
+        .WillOnce(Return(""));
+
+    // string should be "0.133," instead
+    EXPECT_CALL(mockView, setPeakList("0.0133")).Times(0);
+    EXPECT_CALL(mockView, setPeakList(",0.0133")).Times(0);
+    EXPECT_CALL(mockView, setPeakList("0.0133,")).Times(1);
+
+    // No errors/0 warnings. File entered is not found
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(0);
+
+    pres.notify(IEnggDiffFittingPresenter::addPeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_shutDown() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    MantidQt::CustomInterfaces::EnggDiffFittingPresenter pres(
+        &mockView,
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>(),
+        nullptr, nullptr);
+
+    EXPECT_CALL(mockView, setPeakList(testing::_)).Times(0);
+    EXPECT_CALL(mockView, getFocusedFileNames()).Times(0);
+    EXPECT_CALL(mockView, getFittingRunNumVec()).Times(0);
+
+    EXPECT_CALL(mockView, getFittingMultiRunMode()).Times(0);
+
+    EXPECT_CALL(mockView, showStatus(testing::_)).Times(0);
+
+    EXPECT_CALL(mockView, saveSettings()).Times(1);
+    // No errors, no warnings
+    EXPECT_CALL(mockView, userError(testing::_, testing::_)).Times(0);
+    EXPECT_CALL(mockView, userWarning(testing::_, testing::_)).Times(0);
+
+    pres.notify(IEnggDiffFittingPresenter::ShutDown);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_removeRun() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    auto mockModel =
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>();
+    auto *mockModel_ptr = mockModel.get();
+    MantidQt::CustomInterfaces::EnggDiffFittingPresenter pres(
+        &mockView, std::move(mockModel), nullptr, nullptr);
+
+    EXPECT_CALL(mockView, getFittingListWidgetCurrentValue())
+        .Times(1)
+        .WillOnce(Return(boost::optional<std::string>("123_1")));
+    EXPECT_CALL(*mockModel_ptr, removeRun(RunLabel("123", 1)));
+    EXPECT_CALL(*mockModel_ptr, getRunLabels())
+        .Times(1)
+        .WillOnce(Return(
+            std::vector<RunLabel>({RunLabel("123", 2), RunLabel("456", 1)})));
+    EXPECT_CALL(mockView, updateFittingListWidget(
+                              std::vector<std::string>({"123_2", "456_1"})));
+
+    pres.notify(IEnggDiffFittingPresenter::removeRun);
+
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_updatePlotFittedPeaksValidFittedPeaks() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    auto mockModel =
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>();
+    auto *mockModel_ptr = mockModel.get();
+
+    EnggDiffFittingPresenterNoThread pres(&mockView, std::move(mockModel));
+
+    const RunLabel runLabel("123", 1);
+    EXPECT_CALL(mockView, getFittingListWidgetCurrentValue())
+        .Times(2)
+        .WillRepeatedly(Return(boost::optional<std::string>("123_1")));
+    EXPECT_CALL(*mockModel_ptr, hasFittedPeaksForRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(true));
+    EXPECT_CALL(*mockModel_ptr, getAlignedWorkspace(runLabel))
+        .Times(1)
+        .WillOnce(Return(WorkspaceCreationHelper::create2DWorkspace(10, 10)));
+    EXPECT_CALL(mockView, plotFittedPeaksEnabled())
+        .Times(1)
+        .WillOnce(Return(true));
+    EXPECT_CALL(*mockModel_ptr, getFittedPeaksWS(runLabel))
+        .Times(1)
+        .WillOnce(Return(WorkspaceCreationHelper::create2DWorkspace(10, 10)));
+    EXPECT_CALL(mockView,
+                setDataVector(testing::_, testing::_, testing::_, testing::_))
+        .Times(2);
+
+    pres.notify(IEnggDiffFittingPresenter::updatePlotFittedPeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_updatePlotFittedPeaksNoFittedPeaks() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    auto mockModel =
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>();
+    auto *mockModel_ptr = mockModel.get();
+
+    EnggDiffFittingPresenterNoThread pres(&mockView, std::move(mockModel));
+
+    const RunLabel runLabel("123", 1);
+    EXPECT_CALL(mockView, getFittingListWidgetCurrentValue())
+        .Times(1)
+        .WillOnce(Return(boost::optional<std::string>("123_1")));
+    EXPECT_CALL(*mockModel_ptr, hasFittedPeaksForRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(false));
+    EXPECT_CALL(*mockModel_ptr, getFocusedWorkspace(runLabel))
+        .Times(1)
+        .WillOnce(Return(WorkspaceCreationHelper::create2DWorkspace(10, 10)));
+    EXPECT_CALL(mockView, plotFittedPeaksEnabled())
+        .Times(1)
+        .WillOnce(Return(true));
+    EXPECT_CALL(*mockModel_ptr, getFittedPeaksWS(runLabel)).Times(0);
+    EXPECT_CALL(mockView,
+                setDataVector(testing::_, testing::_, testing::_, testing::_))
+        .Times(1);
+    EXPECT_CALL(mockView, userWarning("Cannot plot fitted peaks", testing::_))
+        .Times(1);
+
+    pres.notify(IEnggDiffFittingPresenter::updatePlotFittedPeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+  void test_updatePlotSuccessfulFitPlotPeaksDisabled() {
+    testing::NiceMock<MockEnggDiffFittingView> mockView;
+    auto mockModel =
+        std::make_unique<testing::NiceMock<MockEnggDiffFittingModel>>();
+    auto *mockModel_ptr = mockModel.get();
+
+    EnggDiffFittingPresenterNoThread pres(&mockView, std::move(mockModel));
+
+    const RunLabel runLabel("123", 1);
+    EXPECT_CALL(mockView, getFittingListWidgetCurrentValue())
+        .Times(2)
+        .WillRepeatedly(Return(boost::optional<std::string>("123_1")));
+    EXPECT_CALL(*mockModel_ptr, hasFittedPeaksForRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(true));
+    EXPECT_CALL(*mockModel_ptr, getAlignedWorkspace(runLabel))
+        .Times(1)
+        .WillOnce(Return(WorkspaceCreationHelper::create2DWorkspace(10, 10)));
+    EXPECT_CALL(mockView, plotFittedPeaksEnabled())
+        .Times(1)
+        .WillOnce(Return(false));
+    EXPECT_CALL(*mockModel_ptr, getFittedPeaksWS(runLabel)).Times(0);
+    EXPECT_CALL(mockView,
+                setDataVector(testing::_, testing::_, testing::_, testing::_))
+        .Times(1);
+
+    pres.notify(IEnggDiffFittingPresenter::updatePlotFittedPeaks);
+    TSM_ASSERT(
+        "Mock not used as expected. Some EXPECT_CALL conditions were not "
+        "satisfied.",
+        testing::Mock::VerifyAndClearExpectations(&mockView))
+  }
+
+private:
+  std::unique_ptr<testing::NiceMock<MockEnggDiffFittingView>> m_view;
+  std::unique_ptr<MantidQt::CustomInterfaces::EnggDiffFittingPresenter>
+      m_presenter;
+
+  std::vector<bool> m_ex_enginx_banks;
+  const static std::string g_validRunNo;
+  const static std::string g_focusedRun;
+  const static std::string g_focusedBankFile;
+  const static std::string g_focusedFittingRunNo;
+  const static std::string EMPTY;
+  EnggDiffCalibSettings m_basicCalibSettings;
+
+  std::vector<std::string> m_ex_empty_run_num;
+  std::vector<std::string> m_invalid_run_number;
+  std::vector<std::string> m_ex_run_number;
+  std::vector<std::string> g_vanNo;
+  std::vector<std::string> g_ceriaNo;
+};
+
+const std::string EnggDiffFittingPresenterTest::g_focusedRun =
+    "focused_texture_bank_1";
+
+const std::string EnggDiffFittingPresenterTest::g_validRunNo = "228061";
+
+const std::string EnggDiffFittingPresenterTest::g_focusedBankFile =
+    "ENGINX_241395_focused_texture_bank_1";
+
+const std::string EnggDiffFittingPresenterTest::g_focusedFittingRunNo =
+    "241391-241394";
+
+const std::string EnggDiffFittingPresenterTest::EMPTY = "";
diff --git a/qt/scientific_interfaces/test/EnggDiffGSASFittingModelTest.h b/qt/scientific_interfaces/test/EnggDiffGSASFittingModelTest.h
new file mode 100644
index 00000000000..245b8b7b1a4
--- /dev/null
+++ b/qt/scientific_interfaces/test/EnggDiffGSASFittingModelTest.h
@@ -0,0 +1,289 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "../EnggDiffraction/EnggDiffGSASFittingModel.h"
+
+#include "MantidAPI/AlgorithmManager.h"
+#include "MantidAPI/AnalysisDataService.h"
+#include "MantidAPI/FrameworkManager.h"
+#include "MantidAPI/TableRow.h"
+#include "MantidAPI/WorkspaceFactory.h"
+#include "MantidTestHelpers/WorkspaceCreationHelper.h"
+
+#include <cxxtest/TestSuite.h>
+
+#include <utility>
+
+using namespace Mantid;
+using namespace MantidQt::CustomInterfaces;
+
+namespace { // Helpers
+
+std::vector<GSASIIRefineFitPeaksParameters>
+createGSASIIRefineFitPeaksParameters(
+    const API::MatrixWorkspace_sptr &inputWS, const RunLabel &runLabel,
+    const GSASRefinementMethod &refinementMethod) {
+  return {GSASIIRefineFitPeaksParameters(
+      inputWS, runLabel, refinementMethod, "", std::vector<std::string>({}), "",
+      "", boost::none, boost::none, boost::none, boost::none, false, false)};
+}
+
+template <size_t numColumns, size_t numRows>
+API::ITableWorkspace_sptr createDummyTable(
+    const std::array<std::string, numColumns> &columnHeadings,
+    const std::array<std::array<double, numColumns>, numRows> tableContents) {
+  auto table = API::WorkspaceFactory::Instance().createTable();
+  for (const auto &header : columnHeadings) {
+    table->addColumn("double", header);
+  }
+  for (const auto &row : tableContents) {
+    API::TableRow newRow = table->appendRow();
+    for (const auto value : row) {
+      newRow << value;
+    }
+  }
+  return table;
+}
+
+// Helper class with some protected methods exposed
+class TestEnggDiffGSASFittingModel : public EnggDiffGSASFittingModel {
+public:
+  void addGammaValue(const RunLabel &runLabel, const double gamma);
+
+  void addLatticeParamTable(const RunLabel &runLabel,
+                            const API::ITableWorkspace_sptr &table);
+
+  void addRwpValue(const RunLabel &runLabel, const double rwp);
+
+  void addSigmaValue(const RunLabel &runLabel, const double sigma);
+
+  void doRefinements(
+      const std::vector<GSASIIRefineFitPeaksParameters> &params) override;
+};
+
+inline void
+TestEnggDiffGSASFittingModel::addGammaValue(const RunLabel &runLabel,
+                                            const double gamma) {
+  addGamma(runLabel, gamma);
+}
+
+inline void TestEnggDiffGSASFittingModel::addLatticeParamTable(
+    const RunLabel &runLabel, const API::ITableWorkspace_sptr &table) {
+  addLatticeParams(runLabel, std::move(table));
+}
+
+inline void TestEnggDiffGSASFittingModel::addRwpValue(const RunLabel &runLabel,
+                                                      const double rwp) {
+  addRwp(runLabel, rwp);
+}
+
+inline void
+TestEnggDiffGSASFittingModel::addSigmaValue(const RunLabel &runLabel,
+                                            const double sigma) {
+  addSigma(runLabel, sigma);
+}
+
+void TestEnggDiffGSASFittingModel::doRefinements(
+    const std::vector<GSASIIRefineFitPeaksParameters> &params) {
+  // Mock method - just create some dummy output and ignore all the parameters
+  UNUSED_ARG(params);
+
+  const static std::array<std::string, 3> columnHeadings = {{"a", "b", "c"}};
+  const static std::array<std::array<double, 3>, 1> targetTableValues = {
+      {{{1, 2, 3}}}};
+  const auto latticeParams =
+      createDummyTable(columnHeadings, targetTableValues);
+
+  API::AnalysisDataServiceImpl &ADS = API::AnalysisDataService::Instance();
+  ADS.add("LATTICEPARAMS", latticeParams);
+
+  API::MatrixWorkspace_sptr ws =
+      WorkspaceCreationHelper::create2DWorkspaceBinned(4, 4, 0.5);
+  ADS.add("FITTEDPEAKS", ws);
+
+  processRefinementSuccessful(
+      nullptr, GSASIIRefineFitPeaksOutputProperties(1, 2, 3, ws, latticeParams,
+                                                    params[0].runLabel));
+}
+
+} // Anonymous namespace
+
+class EnggDiffGSASFittingModelTest : public CxxTest::TestSuite {
+public:
+  // This pair of boilerplate methods prevent the suite being created statically
+  // This means the constructor isn't called when running other tests
+  static EnggDiffGSASFittingModelTest *createSuite() {
+    return new EnggDiffGSASFittingModelTest();
+  }
+  static void destroySuite(EnggDiffGSASFittingModelTest *suite) {
+    delete suite;
+  }
+
+  EnggDiffGSASFittingModelTest() { API::FrameworkManager::Instance(); }
+
+  void test_validLoadRun() {
+    const static std::string inputFilename = "ENGINX_277208_focused_bank_2.nxs";
+    TestEnggDiffGSASFittingModel model;
+
+    API::MatrixWorkspace_sptr ws;
+    TS_ASSERT_THROWS_NOTHING(ws = model.loadFocusedRun(inputFilename));
+    TS_ASSERT(ws);
+  }
+
+  void test_invalidLoadRun() {
+    const static std::string inputFilename = "ENGINX_277209_focused_bank_2.nxs";
+    TestEnggDiffGSASFittingModel model;
+
+    API::MatrixWorkspace_sptr ws;
+    TS_ASSERT_THROWS_ANYTHING(ws = model.loadFocusedRun(inputFilename));
+    TS_ASSERT(!ws);
+  }
+
+  void test_getRwp() {
+    TestEnggDiffGSASFittingModel model;
+
+    const RunLabel valid("123", 1);
+    const double rwp = 75.5;
+    model.addRwpValue(valid, rwp);
+
+    auto retrievedRwp = boost::make_optional<double>(false, double());
+    TS_ASSERT_THROWS_NOTHING(retrievedRwp = model.getRwp(valid));
+    TS_ASSERT(retrievedRwp);
+    TS_ASSERT_EQUALS(rwp, *retrievedRwp);
+
+    const RunLabel invalid("456", 2);
+    TS_ASSERT_THROWS_NOTHING(retrievedRwp = model.getRwp(invalid));
+    TS_ASSERT_EQUALS(retrievedRwp, boost::none);
+  }
+
+  void test_getGamma() {
+    TestEnggDiffGSASFittingModel model;
+
+    const RunLabel valid("123", 1);
+    const double gamma = 75.5;
+    model.addGammaValue(valid, gamma);
+
+    auto retrievedGamma = boost::make_optional<double>(false, double());
+    TS_ASSERT_THROWS_NOTHING(retrievedGamma = model.getGamma(valid));
+    TS_ASSERT(retrievedGamma);
+    TS_ASSERT_EQUALS(gamma, *retrievedGamma);
+
+    const RunLabel invalid("456", 2);
+    TS_ASSERT_THROWS_NOTHING(retrievedGamma = model.getGamma(invalid));
+    TS_ASSERT_EQUALS(retrievedGamma, boost::none);
+  }
+
+  void test_getSigma() {
+    TestEnggDiffGSASFittingModel model;
+
+    const RunLabel valid("123", 1);
+    const double sigma = 75.5;
+    model.addSigmaValue(valid, sigma);
+
+    auto retrievedSigma = boost::make_optional<double>(false, double());
+    TS_ASSERT_THROWS_NOTHING(retrievedSigma = model.getSigma(valid));
+    TS_ASSERT(retrievedSigma);
+    TS_ASSERT_EQUALS(sigma, *retrievedSigma);
+
+    const RunLabel invalid("456", 2);
+    TS_ASSERT_THROWS_NOTHING(retrievedSigma = model.getSigma(invalid));
+    TS_ASSERT_EQUALS(retrievedSigma, boost::none);
+  }
+
+  void test_getLatticeParams() {
+    const std::array<std::string, 3> columnHeadings = {{"a", "b", "c"}};
+    const std::array<std::array<double, 3>, 1> targetTableValues = {
+        {{{1, 2, 3}}}};
+    const auto table = createDummyTable(columnHeadings, targetTableValues);
+
+    TestEnggDiffGSASFittingModel model;
+
+    const RunLabel valid("123", 1);
+    TS_ASSERT_THROWS_NOTHING(model.addLatticeParamTable(valid, table));
+
+    // auto retrievedTable = model.getLatticeParams(123, 1);
+    boost::optional<API::ITableWorkspace_sptr> retrievedTable;
+    TS_ASSERT_THROWS_NOTHING(retrievedTable = model.getLatticeParams(valid));
+    TS_ASSERT(retrievedTable);
+
+    API::TableRow row = (*retrievedTable)->getRow(0);
+    const double expectedA = 1;
+    const double expectedB = 2;
+    const double expectedC = 3;
+    auto a = expectedA + 1;
+    auto b = expectedB + 1;
+    auto c = expectedC + 1;
+
+    TS_ASSERT_THROWS_NOTHING(row >> a >> b >> c);
+    TS_ASSERT_EQUALS(a, expectedA);
+    TS_ASSERT_EQUALS(b, expectedB);
+    TS_ASSERT_EQUALS(c, expectedC);
+
+    const RunLabel invalid("456", 2);
+    TS_ASSERT_THROWS_NOTHING(retrievedTable = model.getLatticeParams(invalid));
+    TS_ASSERT_EQUALS(retrievedTable, boost::none);
+  }
+
+  void test_pawleyRefinement() {
+    // Note: due to the reliance on GSAS-II, this cannot test that the algorithm
+    // is used properly. It tests that, given that the algorithm is used
+    // properly, results are added to the appropriate maps in the model
+    TestEnggDiffGSASFittingModel model;
+    const RunLabel runLabel("123", 1);
+
+    API::MatrixWorkspace_sptr inputWS =
+        API::WorkspaceFactory::Instance().create("Workspace2D", 1, 10, 10);
+
+    TS_ASSERT_THROWS_NOTHING(
+        model.doRefinements(createGSASIIRefineFitPeaksParameters(
+            inputWS, runLabel, GSASRefinementMethod::PAWLEY)));
+
+    const auto rwp = model.getRwp(runLabel);
+    TS_ASSERT(rwp);
+
+    const auto sigma = model.getSigma(runLabel);
+    TS_ASSERT(sigma);
+
+    const auto gamma = model.getGamma(runLabel);
+    TS_ASSERT(gamma);
+
+    const auto latticeParams = model.getLatticeParams(runLabel);
+    TS_ASSERT(latticeParams);
+
+    API::AnalysisDataService::Instance().clear();
+  }
+
+  void test_RietveldRefinement() {
+    // Note: due to the reliance on GSAS-II, this cannot test that the algorithm
+    // is used properly. It tests that, given that the algorithm is used
+    // properly, results are added to the appropriate maps in the model
+    TestEnggDiffGSASFittingModel model;
+    const RunLabel runLabel("123", 1);
+
+    API::MatrixWorkspace_sptr inputWS =
+        API::WorkspaceFactory::Instance().create("Workspace2D", 1, 10, 10);
+
+    TS_ASSERT_THROWS_NOTHING(
+        model.doRefinements(createGSASIIRefineFitPeaksParameters(
+            inputWS, runLabel, GSASRefinementMethod::RIETVELD)));
+
+    const auto rwp = model.getRwp(runLabel);
+    TS_ASSERT(rwp);
+
+    const auto sigma = model.getSigma(runLabel);
+    TS_ASSERT(sigma);
+
+    const auto gamma = model.getGamma(runLabel);
+    TS_ASSERT(gamma);
+
+    const auto latticeParams = model.getLatticeParams(runLabel);
+    TS_ASSERT(latticeParams);
+
+    API::AnalysisDataService::Instance().clear();
+  }
+};
diff --git a/qt/scientific_interfaces/test/EnggDiffMultiRunFittingWidgetPresenterTest.h b/qt/scientific_interfaces/test/EnggDiffMultiRunFittingWidgetPresenterTest.h
new file mode 100644
index 00000000000..f46a1ee2518
--- /dev/null
+++ b/qt/scientific_interfaces/test/EnggDiffMultiRunFittingWidgetPresenterTest.h
@@ -0,0 +1,393 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "../EnggDiffraction/EnggDiffMultiRunFittingWidgetPresenter.h"
+#include "EnggDiffMultiRunFittingWidgetModelMock.h"
+#include "EnggDiffMultiRunFittingWidgetViewMock.h"
+
+#include "MantidAPI/FrameworkManager.h"
+#include "MantidAPI/WorkspaceFactory.h"
+#include "MantidTestHelpers/WorkspaceCreationHelper.h"
+
+#include <cxxtest/TestSuite.h>
+
+using namespace Mantid;
+
+using namespace MantidQt::CustomInterfaces;
+using testing::Return;
+
+namespace {
+API::MatrixWorkspace_sptr createSampleWorkspace() {
+  return API::WorkspaceFactory::Instance().create("Workspace2D", 1, 1, 1);
+}
+
+void addBankID(const API::MatrixWorkspace_sptr &ws, const size_t bankID) {
+  auto addLogAlg =
+      API::FrameworkManager::Instance().createAlgorithm("AddSampleLog");
+  addLogAlg->initialize();
+  addLogAlg->setProperty("Workspace", ws);
+  addLogAlg->setPropertyValue("LogName", "bankid");
+  addLogAlg->setPropertyValue("LogText", std::to_string(bankID));
+  addLogAlg->setPropertyValue("LogType", "Number");
+  addLogAlg->execute();
+}
+} // namespace
+
+class EnggDiffMultiRunFittingWidgetPresenterTest : public CxxTest::TestSuite {
+public:
+  void test_addFittedPeaks() {
+    auto presenter = setUpPresenter();
+    const auto ws = createSampleWorkspace();
+
+    const RunLabel runLabel("123", 1);
+    EXPECT_CALL(*m_mockModel, addFittedPeaks(runLabel, ws)).Times(1);
+
+    EXPECT_CALL(*m_mockModel, getFocusedRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(ws));
+    EXPECT_CALL(*m_mockView, reportPlotInvalidFocusedRun(testing::_)).Times(0);
+    EXPECT_CALL(*m_mockView, resetCanvas()).Times(1);
+    EXPECT_CALL(*m_mockView, plotFocusedRun(testing::_)).Times(1);
+    EXPECT_CALL(*m_mockModel, hasFittedPeaksForRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(true));
+    EXPECT_CALL(*m_mockView, showFitResultsSelected())
+        .Times(1)
+        .WillOnce(Return(false));
+    EXPECT_CALL(*m_mockModel, getFittedPeaks(testing::_)).Times(0);
+
+    presenter->addFittedPeaks(runLabel, ws);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_addFocusedRun() {
+    auto presenter = setUpPresenter();
+    const API::MatrixWorkspace_sptr ws = createSampleWorkspace();
+    addBankID(ws, 2);
+    const RunLabel runLabel("0", 2);
+
+    const std::vector<RunLabel> workspaceLabels({runLabel});
+    EXPECT_CALL(*m_mockModel, getAllWorkspaceLabels())
+        .Times(1)
+        .WillOnce(Return(workspaceLabels));
+
+    EXPECT_CALL(*m_mockView, updateRunList(workspaceLabels));
+    presenter->addFocusedRun(ws);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_loadRunUpdatesView() {
+    auto presenter = setUpPresenter();
+    const API::MatrixWorkspace_sptr ws = createSampleWorkspace();
+    addBankID(ws, 2);
+
+    const RunLabel runLabel("0", 2);
+    const std::vector<RunLabel> workspaceLabels({runLabel});
+    ON_CALL(*m_mockModel, getAllWorkspaceLabels())
+        .WillByDefault(Return(workspaceLabels));
+    EXPECT_CALL(*m_mockView, updateRunList(workspaceLabels));
+
+    presenter->addFocusedRun(ws);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_getFittedPeaks() {
+    auto presenter = setUpPresenter();
+
+    const RunLabel runLabel("123", 1);
+    EXPECT_CALL(*m_mockModel, getFittedPeaks(runLabel))
+        .Times(1)
+        .WillOnce(Return(boost::none));
+
+    presenter->getFittedPeaks(runLabel);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_getFocusedRun() {
+    auto presenter = setUpPresenter();
+
+    const RunLabel runLabel("123", 1);
+    EXPECT_CALL(*m_mockModel, getFocusedRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(boost::none));
+
+    presenter->getFocusedRun(runLabel);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_selectValidRunWithoutFittedPeaks() {
+    auto presenter = setUpPresenter();
+
+    const RunLabel runLabel("123", 1);
+    EXPECT_CALL(*m_mockView, getSelectedRunLabel())
+        .Times(1)
+        .WillOnce(Return(runLabel));
+
+    EXPECT_CALL(*m_mockModel, getFocusedRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(createSampleWorkspace()));
+
+    EXPECT_CALL(*m_mockView, reportPlotInvalidFocusedRun(testing::_)).Times(0);
+    EXPECT_CALL(*m_mockView, resetCanvas()).Times(1);
+    EXPECT_CALL(*m_mockView, plotFocusedRun(testing::_)).Times(1);
+
+    ON_CALL(*m_mockModel, hasFittedPeaksForRun(runLabel))
+        .WillByDefault(Return(false));
+    EXPECT_CALL(*m_mockView, plotFittedPeaks(testing::_)).Times(0);
+
+    presenter->notify(
+        IEnggDiffMultiRunFittingWidgetPresenter::Notification::SelectRun);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_selectRunInvalid() {
+    auto presenter = setUpPresenter();
+
+    const RunLabel runLabel("123", 1);
+    EXPECT_CALL(*m_mockView, getSelectedRunLabel())
+        .Times(1)
+        .WillOnce(Return(runLabel));
+    EXPECT_CALL(*m_mockModel, getFocusedRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(boost::none));
+    EXPECT_CALL(*m_mockView, reportPlotInvalidFocusedRun(runLabel)).Times(1);
+    EXPECT_CALL(*m_mockView, resetCanvas()).Times(0);
+
+    presenter->notify(
+        IEnggDiffMultiRunFittingWidgetPresenter::Notification::SelectRun);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_selectValidRunWithFittedPeaks() {
+    auto presenter = setUpPresenter();
+
+    const RunLabel runLabel("123", 1);
+    ON_CALL(*m_mockView, getSelectedRunLabel()).WillByDefault(Return(runLabel));
+
+    const auto sampleWorkspace = createSampleWorkspace();
+    ON_CALL(*m_mockModel, getFocusedRun(runLabel))
+        .WillByDefault(Return(sampleWorkspace));
+
+    ON_CALL(*m_mockModel, hasFittedPeaksForRun(runLabel))
+        .WillByDefault(Return(true));
+    ON_CALL(*m_mockView, showFitResultsSelected()).WillByDefault(Return(true));
+    EXPECT_CALL(*m_mockModel, getFittedPeaks(runLabel))
+        .Times(1)
+        .WillOnce(Return(sampleWorkspace));
+    EXPECT_CALL(*m_mockView, reportPlotInvalidFittedPeaks(testing::_)).Times(0);
+    EXPECT_CALL(*m_mockView, plotFittedPeaks(testing::_)).Times(1);
+
+    presenter->notify(
+        IEnggDiffMultiRunFittingWidgetPresenter::Notification::SelectRun);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_selectRunDoesNothingWhenNoRunSelected() {
+    auto presenter = setUpPresenter();
+
+    EXPECT_CALL(*m_mockView, getSelectedRunLabel())
+        .Times(1)
+        .WillOnce(Return(boost::none));
+    presenter->notify(
+        IEnggDiffMultiRunFittingWidgetPresenter::Notification::SelectRun);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_plotPeaksStateChangedUpdatesPlot() {
+    auto presenter = setUpPresenter();
+
+    const RunLabel runLabel("123", 1);
+    EXPECT_CALL(*m_mockView, getSelectedRunLabel())
+        .Times(1)
+        .WillOnce(Return(runLabel));
+
+    const boost::optional<Mantid::API::MatrixWorkspace_sptr> sampleWorkspace(
+        WorkspaceCreationHelper::create2DWorkspaceBinned(1, 100));
+    EXPECT_CALL(*m_mockModel, getFocusedRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(sampleWorkspace));
+
+    EXPECT_CALL(*m_mockView, resetCanvas()).Times(1);
+    EXPECT_CALL(*m_mockView, plotFocusedRun(testing::_)).Times(1);
+
+    EXPECT_CALL(*m_mockModel, hasFittedPeaksForRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(false));
+
+    presenter->notify(IEnggDiffMultiRunFittingWidgetPresenter::Notification::
+                          PlotPeaksStateChanged);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_plotPeaksStateChangedDoesNotCrashWhenNoRunSelected() {
+    auto presenter = setUpPresenter();
+
+    EXPECT_CALL(*m_mockView, getSelectedRunLabel())
+        .Times(1)
+        .WillOnce(Return(boost::none));
+    EXPECT_CALL(*m_mockModel, getFocusedRun(testing::_)).Times(0);
+
+    presenter->notify(IEnggDiffMultiRunFittingWidgetPresenter::Notification::
+                          PlotPeaksStateChanged);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_removeRun() {
+    auto presenter = setUpPresenter();
+
+    const RunLabel runLabel("123", 1);
+    EXPECT_CALL(*m_mockView, getSelectedRunLabel())
+        .Times(1)
+        .WillOnce(Return(runLabel));
+    EXPECT_CALL(*m_mockModel, removeRun(runLabel));
+
+    const std::vector<RunLabel> runLabels({runLabel});
+    EXPECT_CALL(*m_mockModel, getAllWorkspaceLabels())
+        .Times(1)
+        .WillOnce(Return(runLabels));
+    EXPECT_CALL(*m_mockView, updateRunList(runLabels));
+    EXPECT_CALL(*m_mockView, resetCanvas());
+
+    presenter->notify(
+        IEnggDiffMultiRunFittingWidgetPresenter::Notification::RemoveRun);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_removeRunDoesNothingWhenNoRunSelected() {
+    auto presenter = setUpPresenter();
+    EXPECT_CALL(*m_mockView, getSelectedRunLabel())
+        .Times(1)
+        .WillOnce(Return(boost::none));
+    EXPECT_CALL(*m_mockModel, removeRun(testing::_)).Times(0);
+    presenter->notify(
+        IEnggDiffMultiRunFittingWidgetPresenter::Notification::RemoveRun);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_plotToSeparateWindowDoesNothingWhenNoRunSelected() {
+    auto presenter = setUpPresenter();
+
+    EXPECT_CALL(*m_mockView, getSelectedRunLabel())
+        .Times(1)
+        .WillOnce(Return(boost::none));
+    EXPECT_CALL(*m_mockView, reportNoRunSelectedForPlot()).Times(1);
+
+    presenter->notify(IEnggDiffMultiRunFittingWidgetPresenter::Notification::
+                          PlotToSeparateWindow);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_plotToSeparateWindowValidFocusedRunNoFittedPeaks() {
+    auto presenter = setUpPresenter();
+    const RunLabel runLabel("123", 1);
+
+    EXPECT_CALL(*m_mockView, getSelectedRunLabel())
+        .Times(1)
+        .WillOnce(Return(runLabel));
+
+    const boost::optional<Mantid::API::MatrixWorkspace_sptr> sampleWorkspace(
+        WorkspaceCreationHelper::create2DWorkspaceBinned(1, 100));
+
+    EXPECT_CALL(*m_mockModel, getFocusedRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(sampleWorkspace));
+
+    EXPECT_CALL(*m_mockView, reportNoRunSelectedForPlot()).Times(0);
+    EXPECT_CALL(*m_mockView, reportPlotInvalidFocusedRun(testing::_)).Times(0);
+
+    EXPECT_CALL(*m_mockView, showFitResultsSelected())
+        .Times(1)
+        .WillOnce(Return(true));
+    EXPECT_CALL(*m_mockModel, hasFittedPeaksForRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(false));
+
+    EXPECT_CALL(*m_mockView, plotToSeparateWindow(
+                                 "123_1_external_plot",
+                                 boost::make_optional(false, std::string())))
+        .Times(1);
+
+    presenter->notify(IEnggDiffMultiRunFittingWidgetPresenter::Notification::
+                          PlotToSeparateWindow);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_plotToSeparateWindowWithFittedPeaks() {
+    auto presenter = setUpPresenter();
+    const RunLabel runLabel("123", 1);
+
+    EXPECT_CALL(*m_mockView, getSelectedRunLabel())
+        .Times(1)
+        .WillOnce(Return(runLabel));
+
+    const boost::optional<Mantid::API::MatrixWorkspace_sptr> sampleWorkspace(
+        WorkspaceCreationHelper::create2DWorkspaceBinned(1, 100));
+
+    EXPECT_CALL(*m_mockModel, getFocusedRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(sampleWorkspace));
+
+    EXPECT_CALL(*m_mockView, showFitResultsSelected())
+        .Times(1)
+        .WillOnce(Return(true));
+    EXPECT_CALL(*m_mockModel, hasFittedPeaksForRun(runLabel))
+        .Times(1)
+        .WillOnce(Return(true));
+
+    const boost::optional<Mantid::API::MatrixWorkspace_sptr> sampleFittedPeaks(
+        WorkspaceCreationHelper::create2DWorkspaceBinned(1, 100));
+    EXPECT_CALL(*m_mockModel, getFittedPeaks(runLabel))
+        .Times(1)
+        .WillOnce(Return(sampleFittedPeaks));
+    EXPECT_CALL(*m_mockView, reportPlotInvalidFittedPeaks(testing::_)).Times(0);
+
+    EXPECT_CALL(*m_mockView,
+                plotToSeparateWindow("123_1_external_plot",
+                                     boost::optional<std::string>(
+                                         "123_1_fitted_peaks_external_plot")))
+        .Times(1);
+
+    presenter->notify(IEnggDiffMultiRunFittingWidgetPresenter::Notification::
+                          PlotToSeparateWindow);
+    assertMocksUsedCorrectly();
+  }
+
+  void test_getAllRunLabelsDelegatesToView() {
+    auto presenter = setUpPresenter();
+    EXPECT_CALL(*m_mockView, getAllRunLabels());
+    presenter->getAllRunLabels();
+    assertMocksUsedCorrectly();
+  }
+
+private:
+  MockEnggDiffMultiRunFittingWidgetModel *m_mockModel;
+  MockEnggDiffMultiRunFittingWidgetView *m_mockView;
+
+  std::unique_ptr<EnggDiffMultiRunFittingWidgetPresenter> setUpPresenter() {
+    auto mockModel_uptr = std::make_unique<
+        testing::NiceMock<MockEnggDiffMultiRunFittingWidgetModel>>();
+    m_mockModel = mockModel_uptr.get();
+
+    m_mockView = new testing::NiceMock<MockEnggDiffMultiRunFittingWidgetView>();
+
+    return std::make_unique<EnggDiffMultiRunFittingWidgetPresenter>(
+        std::move(mockModel_uptr), m_mockView);
+  }
+
+  void assertMocksUsedCorrectly() {
+    TSM_ASSERT("View mock not used as expected: some EXPECT_CALL conditions "
+               "not satisfied",
+               testing::Mock::VerifyAndClearExpectations(m_mockModel));
+    TSM_ASSERT("Model mock not used as expected: some EXPECT_CALL conditions "
+               "not satisfied",
+               testing::Mock::VerifyAndClearExpectations(m_mockView));
+    if (m_mockView) {
+      delete m_mockView;
+    }
+  }
+};
diff --git a/qt/scientific_interfaces/test/EnggVanadiumCorrectionsModelTest.h b/qt/scientific_interfaces/test/EnggVanadiumCorrectionsModelTest.h
new file mode 100644
index 00000000000..c3c5309a190
--- /dev/null
+++ b/qt/scientific_interfaces/test/EnggVanadiumCorrectionsModelTest.h
@@ -0,0 +1,206 @@
+// Mantid Repository : https://github.com/mantidproject/mantid
+//
+// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
+//     NScD Oak Ridge National Laboratory, European Spallation Source
+//     & Institut Laue - Langevin
+// SPDX - License - Identifier: GPL - 3.0 +
+#pragma once
+
+#include "../EnggDiffraction/EnggVanadiumCorrectionsModel.h"
+
+#include "MantidAPI/AlgorithmManager.h"
+#include "MantidAPI/FrameworkManager.h"
+#include "MantidAPI/TableRow.h"
+#include "MantidAPI/WorkspaceFactory.h"
+#include "MantidTestHelpers/WorkspaceCreationHelper.h"
+
+#include <Poco/File.h>
+#include <Poco/Path.h>
+
+#include <cxxtest/TestSuite.h>
+
+using namespace MantidQt::CustomInterfaces;
+
+namespace {
+
+Mantid::API::MatrixWorkspace_sptr createSampleMatrixWorkspace() {
+  return WorkspaceCreationHelper::create2DWorkspaceBinned(1, 1, 2);
+}
+
+Mantid::API::ITableWorkspace_sptr createSampleTableWorkspace() {
+  auto table = Mantid::API::WorkspaceFactory::Instance().createTable();
+  table->addColumn("double", "x");
+  Mantid::API::TableRow newRow = table->appendRow();
+  newRow << 1.0;
+  return table;
+}
+
+/// Helper class to allow us to fake EnggVanadiumCorrections
+class TestEnggVanadiumCorrectionsModel : public EnggVanadiumCorrectionsModel {
+public:
+  TestEnggVanadiumCorrectionsModel(const EnggDiffCalibSettings &calibSettings,
+                                   const std::string &currentInstrument);
+
+  mutable bool m_calculateCorrectionsCalled;
+
+private:
+  std::pair<Mantid::API::ITableWorkspace_sptr,
+            Mantid::API::MatrixWorkspace_sptr>
+  calculateCorrectionWorkspaces(
+      const std::string &vanadiumRunNumber) const override;
+};
+
+inline TestEnggVanadiumCorrectionsModel::TestEnggVanadiumCorrectionsModel(
+    const EnggDiffCalibSettings &calibSettings,
+    const std::string &currentInstrument)
+    : EnggVanadiumCorrectionsModel(calibSettings, currentInstrument),
+      m_calculateCorrectionsCalled(false) {}
+
+inline std::pair<Mantid::API::ITableWorkspace_sptr,
+                 Mantid::API::MatrixWorkspace_sptr>
+TestEnggVanadiumCorrectionsModel::calculateCorrectionWorkspaces(
+    const std::string &) const {
+  m_calculateCorrectionsCalled = true;
+
+  auto &ADS = Mantid::API::AnalysisDataService::Instance();
+
+  Mantid::API::MatrixWorkspace_sptr curvesWS = createSampleMatrixWorkspace();
+  ADS.addOrReplace(CURVES_WORKSPACE_NAME, curvesWS);
+
+  auto integratedWS = createSampleTableWorkspace();
+  ADS.addOrReplace(INTEGRATED_WORKSPACE_NAME, integratedWS);
+
+  return std::make_pair(integratedWS, curvesWS);
+}
+
+} // anonymous namespace
+
+class EnggVanadiumCorrectionsModelTest : public CxxTest::TestSuite {
+
+public:
+  static EnggVanadiumCorrectionsModelTest *createSuite() {
+    return new EnggVanadiumCorrectionsModelTest();
+  }
+
+  static void destroySuite(EnggVanadiumCorrectionsModelTest *suite) {
+    delete suite;
+  }
+
+  EnggVanadiumCorrectionsModelTest() {
+    Poco::Path tempDir(Poco::Path::temp());
+    tempDir.append(INPUT_DIR_NAME);
+    m_inputDir = tempDir;
+    Mantid::API::FrameworkManager::Instance();
+  }
+
+  void setUp() override { m_inputDir.createDirectory(); }
+
+  void tearDown() override { m_inputDir.remove(true); }
+
+  void test_generateNewWorkspacesWhenNoCache() {
+    // We've created the calib directory but not populated it with any
+    // workspaces, so we should get our fake ones
+    EnggDiffCalibSettings calibSettings;
+    calibSettings.m_inputDirCalib = m_inputDir.path();
+    calibSettings.m_forceRecalcOverwrite = false;
+
+    if (m_inputDir.exists()) {
+      // Make sure that m_inputDir doesn't exist, as if a previous test exited
+      // abnormally tearDown() may not have been called
+      m_inputDir.remove(true);
+    }
+
+    TestEnggVanadiumCorrectionsModel model(calibSettings, CURRENT_INSTRUMENT);
+    std::pair<Mantid::API::ITableWorkspace_sptr,
+              Mantid::API::MatrixWorkspace_sptr>
+        correctionWorkspaces;
+    TS_ASSERT_THROWS_NOTHING(correctionWorkspaces =
+                                 model.fetchCorrectionWorkspaces("123"));
+    TS_ASSERT(model.m_calculateCorrectionsCalled);
+    TS_ASSERT(correctionWorkspaces.first);
+    TS_ASSERT(correctionWorkspaces.second);
+
+    Poco::Path curvesWSPath(m_inputDir.path());
+    curvesWSPath.append("123_precalculated_vanadium_run_bank_curves.nxs");
+    TS_ASSERT(Poco::File(curvesWSPath).exists());
+
+    Poco::Path integWSPath(m_inputDir.path());
+    integWSPath.append("123_precalculated_vanadium_run_integration.nxs");
+    TS_ASSERT(Poco::File(integWSPath).exists());
+  }
+
+  void test_cacheUsedWhenAvailable() {
+    const auto curvesWS = createSampleMatrixWorkspace();
+    const auto integratedWS = createSampleTableWorkspace();
+    writeOutSampleCorrectionWorkspaces(integratedWS, curvesWS);
+
+    EnggDiffCalibSettings calibSettings;
+    calibSettings.m_inputDirCalib = m_inputDir.path();
+    calibSettings.m_forceRecalcOverwrite = false;
+    TestEnggVanadiumCorrectionsModel model(calibSettings, CURRENT_INSTRUMENT);
+
+    std::pair<Mantid::API::ITableWorkspace_sptr,
+              Mantid::API::MatrixWorkspace_sptr>
+        correctionWorkspaces;
+    TS_ASSERT_THROWS_NOTHING(correctionWorkspaces =
+                                 model.fetchCorrectionWorkspaces("123"));
+    TS_ASSERT(!model.m_calculateCorrectionsCalled);
+
+    TS_ASSERT_EQUALS(curvesWS->y(0), correctionWorkspaces.second->y(0));
+
+    Mantid::API::TableRow sampleDataRow = integratedWS->getRow(0);
+    Mantid::API::TableRow readDataRow = correctionWorkspaces.first->getRow(0);
+    TS_ASSERT_EQUALS(sampleDataRow.Double(0), readDataRow.Double(0));
+  }
+
+  void test_recalculateIfRequired() {
+    const auto curvesWS = createSampleMatrixWorkspace();
+    const auto integratedWS = createSampleTableWorkspace();
+    writeOutSampleCorrectionWorkspaces(integratedWS, curvesWS);
+
+    EnggDiffCalibSettings calibSettings;
+    calibSettings.m_inputDirCalib = m_inputDir.path();
+    calibSettings.m_forceRecalcOverwrite = true;
+    TestEnggVanadiumCorrectionsModel model(calibSettings, CURRENT_INSTRUMENT);
+
+    std::pair<Mantid::API::ITableWorkspace_sptr,
+              Mantid::API::MatrixWorkspace_sptr>
+        correctionWorkspaces;
+    TS_ASSERT_THROWS_NOTHING(correctionWorkspaces =
+                                 model.fetchCorrectionWorkspaces("123"));
+    TS_ASSERT(model.m_calculateCorrectionsCalled);
+  }
+
+private:
+  const static std::string CURRENT_INSTRUMENT;
+  const static std::string INPUT_DIR_NAME;
+
+  Poco::File m_inputDir;
+
+  void saveNexus(const std::string &filename,
+                 const Mantid::API::Workspace_sptr &workspace) const {
+    auto save = Mantid::API::AlgorithmManager::Instance().create("SaveNexus");
+    save->initialize();
+    save->setProperty("InputWorkspace", workspace);
+    save->setProperty("Filename", filename);
+    save->execute();
+  }
+
+  void writeOutSampleCorrectionWorkspaces(
+      const Mantid::API::ITableWorkspace_sptr &integratedWS,
+      const Mantid::API::MatrixWorkspace_sptr &curvesWS) {
+    Poco::Path curvesWSPath(m_inputDir.path());
+    curvesWSPath.append("123_precalculated_vanadium_run_bank_curves.nxs");
+    saveNexus(curvesWSPath.toString(), curvesWS);
+
+    Poco::Path integWSPath(m_inputDir.path());
+    integWSPath.append("123_precalculated_vanadium_run_integration.nxs");
+    saveNexus(integWSPath.toString(), integratedWS);
+  }
+};
+
+const std::string EnggVanadiumCorrectionsModelTest::CURRENT_INSTRUMENT =
+    "TESTINST";
+
+const std::string EnggVanadiumCorrectionsModelTest::INPUT_DIR_NAME(
+    "EnggVanadiumCorrectionsModelTestData");
diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Experiment/ExperimentPresenterTest.h b/qt/scientific_interfaces/test/ISISReflectometry/Experiment/ExperimentPresenterTest.h
index d332900b977..15bc9f560a1 100644
--- a/qt/scientific_interfaces/test/ISISReflectometry/Experiment/ExperimentPresenterTest.h
+++ b/qt/scientific_interfaces/test/ISISReflectometry/Experiment/ExperimentPresenterTest.h
@@ -903,7 +903,8 @@ private:
   }
 
   void runTestForInvalidPerAngleOptions(OptionsTable const &optionsTable,
-                                        std::vector<int> rows, int column) {
+                                        const std::vector<int> &rows,
+                                        int column) {
     auto presenter = makePresenter();
     EXPECT_CALL(m_view, getPerAngleOptions()).WillOnce(Return(optionsTable));
     for (auto row : rows)
diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Experiment/PerThetaDefaultsTableValidatorTest.h b/qt/scientific_interfaces/test/ISISReflectometry/Experiment/PerThetaDefaultsTableValidatorTest.h
index 427fe07ae5a..cfd1f346c4b 100644
--- a/qt/scientific_interfaces/test/ISISReflectometry/Experiment/PerThetaDefaultsTableValidatorTest.h
+++ b/qt/scientific_interfaces/test/ISISReflectometry/Experiment/PerThetaDefaultsTableValidatorTest.h
@@ -173,22 +173,23 @@ private:
   Table emptyTable() { return Table(); }
   Cells emptyRow() { return Cells(); }
 
-  std::vector<InvalidDefaultsError> expectedErrors(std::vector<int> rows,
-                                                   std::vector<int> columns) {
+  std::vector<InvalidDefaultsError>
+  expectedErrors(const std::vector<int> &rows,
+                 const std::vector<int> &columns) {
     std::vector<InvalidDefaultsError> errors;
     for (auto row : rows)
       errors.emplace_back(InvalidDefaultsError(row, columns));
     return errors;
   }
 
-  std::vector<PerThetaDefaults> runTestValid(Table table) {
+  std::vector<PerThetaDefaults> runTestValid(const Table &table) {
     PerThetaDefaultsTableValidator validator;
     auto result = validator(table, TOLERANCE);
     TS_ASSERT(result.isValid());
     return result.assertValid();
   }
 
-  void runTestInvalidThetas(Table table,
+  void runTestInvalidThetas(const Table &table,
                             ThetaValuesValidationError thetaValuesError,
                             std::vector<InvalidDefaultsError> expectedErrors) {
     PerThetaDefaultsTableValidator validator;
@@ -200,7 +201,7 @@ private:
     TS_ASSERT_EQUALS(validationError.errors(), expectedErrors);
   }
 
-  void runTestInvalidCells(Table table,
+  void runTestInvalidCells(const Table &table,
                            std::vector<InvalidDefaultsError> expectedErrors) {
     PerThetaDefaultsTableValidator validator;
     auto result = validator(table, TOLERANCE);
diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Runs/RunsPresenterTest.h b/qt/scientific_interfaces/test/ISISReflectometry/Runs/RunsPresenterTest.h
index 399ea8ca6f0..57e05ea7459 100644
--- a/qt/scientific_interfaces/test/ISISReflectometry/Runs/RunsPresenterTest.h
+++ b/qt/scientific_interfaces/test/ISISReflectometry/Runs/RunsPresenterTest.h
@@ -24,6 +24,8 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
+#include <utility>
+
 using namespace MantidQt::CustomInterfaces::ISISReflectometry;
 using namespace MantidQt::CustomInterfaces::ISISReflectometry::
     ModelCreationHelper;
@@ -708,7 +710,7 @@ private:
   }
 
   AlgorithmRuntimeProps defaultLiveMonitorReductionOptions(
-      std::string instrument = std::string("OFFSPEC")) {
+      const std::string &instrument = std::string("OFFSPEC")) {
     return AlgorithmRuntimeProps{
         {"GetLiveValueAlgorithm", "GetLiveInstrumentValue"},
         {"InputWorkspace", "TOF_live"},
@@ -1005,7 +1007,7 @@ private:
     expectGetUpdateInterval(updateInterval);
     EXPECT_CALL(m_mainPresenter, rowProcessingProperties())
         .Times(1)
-        .WillOnce(Return(options));
+        .WillOnce(Return(std::move(options)));
   }
 
   void expectGetLiveDataOptions(std::string const &instrument,
diff --git a/qt/scientific_interfaces/test/ISISReflectometry/Save/SavePresenterTest.h b/qt/scientific_interfaces/test/ISISReflectometry/Save/SavePresenterTest.h
index 7484989a615..182f9f6f326 100644
--- a/qt/scientific_interfaces/test/ISISReflectometry/Save/SavePresenterTest.h
+++ b/qt/scientific_interfaces/test/ISISReflectometry/Save/SavePresenterTest.h
@@ -347,13 +347,13 @@ private:
     AnalysisDataService::Instance().clear();
   }
 
-  Workspace2D_sptr createWorkspace(std::string name) {
+  Workspace2D_sptr createWorkspace(const std::string &name) {
     Workspace2D_sptr ws = WorkspaceCreationHelper::create2DWorkspace(10, 10);
     AnalysisDataService::Instance().addOrReplace(name, ws);
     return ws;
   }
 
-  void createTableWorkspace(std::string name) {
+  void createTableWorkspace(const std::string &name) {
     ITableWorkspace_sptr ws =
         WorkspaceFactory::Instance().createTable("TableWorkspace");
     AnalysisDataService::Instance().addOrReplace(name, ws);
@@ -367,8 +367,8 @@ private:
     return workspaceNames;
   }
 
-  void createWorkspaceGroup(std::string groupName,
-                            std::vector<std::string> workspaceNames) {
+  void createWorkspaceGroup(const std::string &groupName,
+                            const std::vector<std::string> &workspaceNames) {
     AnalysisDataService::Instance().add(groupName,
                                         boost::make_shared<WorkspaceGroup>());
     createWorkspaces(workspaceNames);
@@ -436,8 +436,8 @@ private:
   }
 
   void expectSaveWorkspaces(
-      std::vector<std::string> workspaceNames,
-      std::vector<std::string> logs = std::vector<std::string>{}) {
+      const std::vector<std::string> &workspaceNames,
+      const std::vector<std::string> &logs = std::vector<std::string>{}) {
     EXPECT_CALL(m_view, getSelectedParameters())
         .Times(1)
         .WillOnce(Return(logs));
diff --git a/qt/scientific_interfaces/test/MuonAnalysisDataLoaderTest.h b/qt/scientific_interfaces/test/MuonAnalysisDataLoaderTest.h
index ea2dfa309fe..04cdbe410a6 100644
--- a/qt/scientific_interfaces/test/MuonAnalysisDataLoaderTest.h
+++ b/qt/scientific_interfaces/test/MuonAnalysisDataLoaderTest.h
@@ -10,6 +10,8 @@
 #include <Poco/Path.h>
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 #include "../Muon/MuonAnalysisDataLoader.h"
 #include "MantidAPI/Algorithm.h"
 #include "MantidAPI/AlgorithmManager.h"
@@ -42,9 +44,10 @@ public:
                  const QStringList &instruments,
                  const std::string &deadTimesFile = "")
       : MuonAnalysisDataLoader(deadTimesType, instruments, deadTimesFile){};
-  void setProcessAlgorithmProperties(IAlgorithm_sptr alg,
+  void setProcessAlgorithmProperties(const IAlgorithm_sptr &alg,
                                      const AnalysisOptions &options) const {
-    MuonAnalysisDataLoader::setProcessAlgorithmProperties(alg, options);
+    MuonAnalysisDataLoader::setProcessAlgorithmProperties(std::move(alg),
+                                                          options);
   }
 };
 
diff --git a/qt/scientific_interfaces/test/MuonAnalysisResultTableCreatorTest.h b/qt/scientific_interfaces/test/MuonAnalysisResultTableCreatorTest.h
index c3d785d9cd2..b41151b0d6a 100644
--- a/qt/scientific_interfaces/test/MuonAnalysisResultTableCreatorTest.h
+++ b/qt/scientific_interfaces/test/MuonAnalysisResultTableCreatorTest.h
@@ -58,7 +58,7 @@ public:
     return MuonAnalysisResultTableCreator::haveSameParameters(tables);
   }
   void removeFixedParameterErrors(
-      const Mantid::API::ITableWorkspace_sptr table) const {
+      const Mantid::API::ITableWorkspace_sptr &table) const {
     MuonAnalysisResultTableCreator::removeFixedParameterErrors(table);
   }
 };
@@ -467,7 +467,7 @@ private:
   }
 
   /// Expected output table
-  ITableWorkspace_sptr getExpectedOutputSingle(const QStringList workspaces) {
+  ITableWorkspace_sptr getExpectedOutputSingle(const QStringList &workspaces) {
     auto table = WorkspaceFactory::Instance().createTable();
     table->addColumn("str", "workspace_Name");
     const std::vector<std::string> titles = {
@@ -548,8 +548,8 @@ private:
     return table;
   }
 
-  bool compareTables(const ITableWorkspace_sptr lhs,
-                     const ITableWorkspace_sptr rhs) {
+  bool compareTables(const ITableWorkspace_sptr &lhs,
+                     const ITableWorkspace_sptr &rhs) {
     auto alg = AlgorithmManager::Instance().create("CompareWorkspaces");
     alg->initialize();
     alg->setChild(true);
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmDialog.h b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmDialog.h
index ea8e08a8444..c77003e337c 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmDialog.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmDialog.h
@@ -141,7 +141,7 @@ protected:
 
   /// Set properties on this algorithm by pulling values from the tied widgets
   bool setPropertyValues(const QStringList &skipList = QStringList());
-  bool setPropertyValue(const QString pName, bool validateOthers);
+  bool setPropertyValue(const QString &pName, bool validateOthers);
 
   void showValidators();
   //@}
@@ -255,7 +255,7 @@ protected:
   /// GenericDialogDemo.cpp
 public:
   /// Set the algorithm associated with this dialog
-  void setAlgorithm(Mantid::API::IAlgorithm_sptr /*alg*/);
+  void setAlgorithm(const Mantid::API::IAlgorithm_sptr & /*alg*/);
   /// Set a list of suggested values
   void setPresetValues(const QHash<QString, QString> &presetValues);
   /// Set whether this is intended for use from a script or not
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmHintStrategy.h b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmHintStrategy.h
index c50fd636cf3..4b63aad0daf 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmHintStrategy.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmHintStrategy.h
@@ -6,6 +6,8 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #pragma once
 
+#include <utility>
+
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/IAlgorithm.h"
 #include "MantidQtWidgets/Common/HintStrategy.h"
@@ -18,7 +20,7 @@ class AlgorithmHintStrategy : public HintStrategy {
 public:
   AlgorithmHintStrategy(Mantid::API::IAlgorithm_sptr algorithm,
                         std::vector<std::string> blacklist)
-      : m_algorithm(algorithm), m_blacklist(blacklist) {}
+      : m_algorithm(std::move(algorithm)), m_blacklist(std::move(blacklist)) {}
 
   AlgorithmHintStrategy(std::string const &algorithmName,
                         std::vector<std::string> blacklist)
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmHistoryWindow.h b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmHistoryWindow.h
index 523cb50607c..985fc73eff5 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmHistoryWindow.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmHistoryWindow.h
@@ -24,6 +24,9 @@
 #include <QStandardItemModel>
 #include <QTreeView>
 #include <QTreeWidget>
+#include <utility>
+
+#include <utility>
 
 //------------------------------------------------------------------------------
 // Forward declarations
@@ -49,7 +52,8 @@ public:
                  Mantid::API::AlgorithmHistory_const_sptr algHistory,
                  AlgHistoryItem *parent = nullptr)
       : QTreeWidgetItem(parent, names, UserType), Mantid::API::HistoryItem(
-                                                      algHistory) {}
+                                                      std::move(std::move(
+                                                          algHistory))) {}
 };
 
 class AlgHistoryTreeWidget : public QTreeWidget {
@@ -84,7 +88,7 @@ private:
   void itemChecked(QTreeWidgetItem *item, int index);
   void itemUnchecked(QTreeWidgetItem *item, int index);
   void populateNestedHistory(AlgHistoryItem *parentWidget,
-                             Mantid::API::AlgorithmHistory_sptr history);
+                             const Mantid::API::AlgorithmHistory_sptr &history);
   void uncheckAllChildren(QTreeWidgetItem *item, int index);
   QString concatVersionwithName(const std::string &name, const int version);
 
@@ -97,7 +101,7 @@ class AlgExecSummaryGrpBox : public QGroupBox {
   Q_OBJECT
 public:
   explicit AlgExecSummaryGrpBox(QWidget *w);
-  AlgExecSummaryGrpBox(QString /*title*/, QWidget *w);
+  AlgExecSummaryGrpBox(const QString & /*title*/, QWidget *w);
   ~AlgExecSummaryGrpBox() override;
   void setData(const double execDuration,
                const Mantid::Types::Core::DateAndTime execDate);
@@ -118,7 +122,7 @@ class AlgEnvHistoryGrpBox : public QGroupBox {
   Q_OBJECT
 public:
   explicit AlgEnvHistoryGrpBox(QWidget *w);
-  AlgEnvHistoryGrpBox(QString /*title*/, QWidget *w);
+  AlgEnvHistoryGrpBox(const QString & /*title*/, QWidget *w);
   ~AlgEnvHistoryGrpBox() override;
 
   QLineEdit *getosNameEdit() const { return m_osNameEdit; }
@@ -145,14 +149,15 @@ signals:
 public:
   AlgorithmHistoryWindow(
       QWidget *parent,
-      const boost::shared_ptr<const Mantid::API::Workspace> /*wsptr*/);
+      const boost::shared_ptr<const Mantid::API::Workspace> & /*wsptr*/);
   AlgorithmHistoryWindow(QWidget *parent, const QString &workspaceName);
   ~AlgorithmHistoryWindow() override;
 
   void closeEvent(QCloseEvent *ce) override;
 
 public slots:
-  void updateAll(Mantid::API::AlgorithmHistory_const_sptr algHistmakeory);
+  void
+  updateAll(const Mantid::API::AlgorithmHistory_const_sptr &algHistmakeory);
   void doUnroll(const std::vector<int> &unrollIndicies);
   void doRoll(int index);
 
@@ -166,10 +171,10 @@ private:
   AlgHistoryProperties *createAlgHistoryPropWindow();
 
   QFileDialog *createScriptDialog(const QString &algName);
-  void
-  updateExecSummaryGrpBox(Mantid::API::AlgorithmHistory_const_sptr algHistory);
+  void updateExecSummaryGrpBox(
+      const Mantid::API::AlgorithmHistory_const_sptr &algHistory);
   void updateAlgHistoryProperties(
-      Mantid::API::AlgorithmHistory_const_sptr algHistory);
+      const Mantid::API::AlgorithmHistory_const_sptr &algHistory);
 
   std::string getScriptVersionMode();
 
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmInputHistory.h b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmInputHistory.h
index b7fc3579623..6ba3742680b 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmInputHistory.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmInputHistory.h
@@ -60,7 +60,7 @@ public:
 
 protected:
   /// Constructor
-  AbstractAlgorithmInputHistory(QString settingsGroup);
+  AbstractAlgorithmInputHistory(const QString &settingsGroup);
 
 private:
   /// Load any values that are available from persistent storage
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmPropertiesWidget.h b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmPropertiesWidget.h
index 0428e7f1874..bb74c538df0 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmPropertiesWidget.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmPropertiesWidget.h
@@ -46,7 +46,7 @@ public:
   void initLayout();
 
   Mantid::API::IAlgorithm_sptr getAlgorithm();
-  void setAlgorithm(Mantid::API::IAlgorithm_sptr algo);
+  void setAlgorithm(const Mantid::API::IAlgorithm_sptr &algo);
 
   QString getAlgorithmName() const;
   void setAlgorithmName(QString name);
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmSelectorWidget.h b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmSelectorWidget.h
index 6944e44b903..26aed5baa8f 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmSelectorWidget.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmSelectorWidget.h
@@ -44,7 +44,7 @@ struct SelectedAlgorithm {
   /// implicit conversion to QString
   operator QString() { return name; }
   /// constructor
-  SelectedAlgorithm(const QString nameIn, const int versionIn)
+  SelectedAlgorithm(const QString &nameIn, const int versionIn)
       : name(nameIn), version(versionIn){};
 };
 
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/BatchAlgorithmRunner.h b/qt/widgets/common/inc/MantidQtWidgets/Common/BatchAlgorithmRunner.h
index c5e68293b80..687a16aa311 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/BatchAlgorithmRunner.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/BatchAlgorithmRunner.h
@@ -19,6 +19,7 @@
 #include <QMetaType>
 #include <deque>
 #include <mutex>
+#include <utility>
 
 namespace MantidQt {
 namespace API {
@@ -70,7 +71,7 @@ public:
 class AlgorithmCompleteNotification : public Poco::Notification {
 public:
   AlgorithmCompleteNotification(IConfiguredAlgorithm_sptr algorithm)
-      : Poco::Notification(), m_algorithm(algorithm) {}
+      : Poco::Notification(), m_algorithm(std::move(algorithm)) {}
 
   IConfiguredAlgorithm_sptr algorithm() const { return m_algorithm; }
 
@@ -81,7 +82,7 @@ private:
 class AlgorithmStartedNotification : public Poco::Notification {
 public:
   AlgorithmStartedNotification(IConfiguredAlgorithm_sptr algorithm)
-      : Poco::Notification(), m_algorithm(algorithm) {}
+      : Poco::Notification(), m_algorithm(std::move(algorithm)) {}
 
   IConfiguredAlgorithm_sptr algorithm() const { return m_algorithm; }
 
@@ -93,7 +94,7 @@ class AlgorithmErrorNotification : public Poco::Notification {
 public:
   AlgorithmErrorNotification(IConfiguredAlgorithm_sptr algorithm,
                              std::string const &errorMessage)
-      : Poco::Notification(), m_algorithm(algorithm),
+      : Poco::Notification(), m_algorithm(std::move(algorithm)),
         m_errorMessage(errorMessage) {}
 
   IConfiguredAlgorithm_sptr algorithm() const { return m_algorithm; }
@@ -120,8 +121,9 @@ public:
   ~BatchAlgorithmRunner() override;
 
   /// Adds an algorithm to the execution queue
-  void addAlgorithm(Mantid::API::IAlgorithm_sptr algo,
-                    AlgorithmRuntimeProps props = AlgorithmRuntimeProps());
+  void
+  addAlgorithm(const Mantid::API::IAlgorithm_sptr &algo,
+               const AlgorithmRuntimeProps &props = AlgorithmRuntimeProps());
   void setQueue(std::deque<IConfiguredAlgorithm_sptr> algorithm);
   /// Clears all algorithms from queue
   void clearQueue();
@@ -151,7 +153,7 @@ private:
   /// Implementation of algorithm runner
   bool executeBatchAsyncImpl(const Poco::Void & /*unused*/);
   /// Sets up and executes an algorithm
-  bool executeAlgo(IConfiguredAlgorithm_sptr algorithm);
+  bool executeAlgo(const IConfiguredAlgorithm_sptr &algorithm);
 
   /// Handlers for notifications
   void handleBatchComplete(const Poco::AutoPtr<BatchCompleteNotification> &pNf);
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/CatalogSearch.h b/qt/widgets/common/inc/MantidQtWidgets/Common/CatalogSearch.h
index 8a7296221a3..af2ee7038ba 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/CatalogSearch.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/CatalogSearch.h
@@ -100,7 +100,7 @@ private:
   /// Obtain all file extensions from the provided column (dataFileResults ->
   /// File name).
   std::unordered_set<std::string>
-  getDataFileExtensions(Mantid::API::Column_sptr column);
+  getDataFileExtensions(const Mantid::API::Column_sptr &column);
   /// Add the list of file extensions to the "Filter type..." drop-down.
   void populateDataFileType(const std::unordered_set<std::string> &extensions);
   /// Disable the download button if user can access the files locally from the
@@ -197,7 +197,7 @@ private:
   /// The current page the user is on in the results window. Used for paging.
   int m_currentPageNumber;
   // Ensure tooltip uses visible color on current OS
-  void correctedToolTip(std::string toolTip, QLabel *label);
+  void correctedToolTip(const std::string &toolTip, QLabel *label);
 };
 } // namespace MantidWidgets
 } // namespace MantidQt
\ No newline at end of file
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/ConvolutionFunctionModel.h b/qt/widgets/common/inc/MantidQtWidgets/Common/ConvolutionFunctionModel.h
index e7ae0322114..0ad93fa0aae 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/ConvolutionFunctionModel.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/ConvolutionFunctionModel.h
@@ -51,21 +51,22 @@ private:
   //  void findConvolutionPrefixes(const IFunction_sptr &fun);
   void iterateThroughFunction(IFunction *func, const QString &prefix);
   void setPrefix(IFunction *func, const QString &prefix);
-  CompositeFunction_sptr createInnerFunction(std::string peaksFunction,
+  CompositeFunction_sptr createInnerFunction(const std::string &peaksFunction,
                                              bool hasDeltaFunction,
                                              bool isQDependent, double q,
                                              bool hasTempCorrection,
                                              double tempValue);
-  CompositeFunction_sptr addTempCorrection(CompositeFunction_sptr peaksFunction,
-                                           double tempValue);
+  CompositeFunction_sptr
+  addTempCorrection(const CompositeFunction_sptr &peaksFunction,
+                    double tempValue);
   IFunction_sptr createTemperatureCorrection(double correction);
   CompositeFunction_sptr
   createConvolutionFunction(IFunction_sptr resolutionFunction,
-                            IFunction_sptr innerFunction);
-  IFunction_sptr createResolutionFunction(std::string workspaceName,
+                            const IFunction_sptr &innerFunction);
+  IFunction_sptr createResolutionFunction(const std::string &workspaceName,
                                           int workspaceIndex);
   CompositeFunction_sptr addBackground(CompositeFunction_sptr domainFunction,
-                                       std::string background);
+                                       const std::string &background);
   boost::optional<QString> m_backgroundPrefix;
   boost::optional<QString> m_convolutionPrefix;
   boost::optional<QString> m_deltaFunctionPrefix;
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenerateNotebook.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenerateNotebook.h
index 594db9c9d40..4eb2c2daa91 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenerateNotebook.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenerateNotebook.h
@@ -50,7 +50,7 @@ QString DLLExport plotsString(const GroupData &groupData,
                               const ProcessingAlgorithm &processor);
 
 QString DLLExport
-reduceRowString(const RowData_sptr data, const QString &instrument,
+reduceRowString(const RowData_sptr &data, const QString &instrument,
                 const WhiteList &whitelist,
                 const std::map<QString, PreprocessingAlgorithm> &preprocessMap,
                 const ProcessingAlgorithm &processor,
@@ -77,9 +77,10 @@ QString DLLExport completeOutputProperties(const QString &algName,
 class DLLExport GenerateNotebook {
 
 public:
-  GenerateNotebook(QString name, QString instrument, WhiteList whitelist,
+  GenerateNotebook(const QString &name, const QString &instrument,
+                   WhiteList whitelist,
                    std::map<QString, PreprocessingAlgorithm> preprocessMap,
-                   ProcessingAlgorithm processor,
+                   const ProcessingAlgorithm &processor,
                    boost::optional<PostprocessingStep> postprocessingStep,
                    ColumnOptionsMap preprocessingInstructionsMap);
   virtual ~GenerateNotebook() = default;
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenter.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenter.h
index fd8e95f54d6..e1ef47643f7 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenter.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenter.h
@@ -33,6 +33,7 @@
 
 #include "MantidAPI/AnalysisDataService.h"
 #include <QObject>
+#include <utility>
 
 namespace MantidQt {
 namespace MantidWidgets {
@@ -57,7 +58,7 @@ struct PreprocessingAttributes {
       : m_options(options) {}
   PreprocessingAttributes(const ColumnOptionsMap &options,
                           std::map<QString, PreprocessingAlgorithm> map)
-      : m_options(options), m_map(map) {}
+      : m_options(options), m_map(std::move(map)) {}
   ColumnOptionsMap m_options;
   std::map<QString, PreprocessingAlgorithm> m_map;
 
@@ -91,23 +92,24 @@ public:
   GenericDataProcessorPresenter(
       WhiteList whitelist,
       std::map<QString, PreprocessingAlgorithm> preprocessMap,
-      ProcessingAlgorithm processor, PostprocessingAlgorithm postprocessor,
-      int group,
+      const ProcessingAlgorithm &processor,
+      const PostprocessingAlgorithm &postprocessor, int group,
       std::map<QString, QString> postprocessMap = std::map<QString, QString>(),
-      QString loader = "Load");
+      const QString &loader = "Load");
   // Constructor: no pre-processing, post-processing
   GenericDataProcessorPresenter(WhiteList whitelist,
-                                ProcessingAlgorithm processor,
-                                PostprocessingAlgorithm postprocessor,
+                                const ProcessingAlgorithm &processor,
+                                const PostprocessingAlgorithm &postprocessor,
                                 int group);
   // Constructor: pre-processing, no post-processing
   GenericDataProcessorPresenter(
       WhiteList whitelist,
       std::map<QString, PreprocessingAlgorithm> preprocessMap,
-      ProcessingAlgorithm processor, int group);
+      const ProcessingAlgorithm &processor, int group);
   // Constructor: no pre-processing, no post-processing
   GenericDataProcessorPresenter(WhiteList whitelist,
-                                ProcessingAlgorithm processor, int group);
+                                const ProcessingAlgorithm &processor,
+                                int group);
   // Constructor: only whitelist
   GenericDataProcessorPresenter(WhiteList whitelist, int group);
   // Delegating constructor: pre-processing, no post-processing
@@ -141,7 +143,7 @@ public:
   // Get the whitelist
   WhiteList getWhiteList() const { return m_whitelist; };
   // Get the name of the reduced workspace for a given row
-  QString getReducedWorkspaceName(const RowData_sptr data) const;
+  QString getReducedWorkspaceName(const RowData_sptr &data) const;
 
   ParentItems selectedParents() const override;
   ChildItems selectedChildren() const override;
@@ -195,23 +197,23 @@ protected:
   void postProcessGroup(const GroupData &data);
   // Preprocess the given column value if applicable
   void preprocessColumnValue(const QString &columnName, QString &columnValue,
-                             RowData_sptr data);
+                             const RowData_sptr &data);
   // Preprocess all option values where applicable
-  void preprocessOptionValues(RowData_sptr data);
+  void preprocessOptionValues(const RowData_sptr &data);
   // Update the model with values used from the options and/or the results from
   // the algorithm
-  void updateModelFromResults(Mantid::API::IAlgorithm_sptr alg,
-                              RowData_sptr data);
+  void updateModelFromResults(const Mantid::API::IAlgorithm_sptr &alg,
+                              const RowData_sptr &data);
   // Create and execute the algorithm with the given properties
   Mantid::API::IAlgorithm_sptr createAndRunAlgorithm(const OptionsMap &options);
   // Reduce a row
-  void reduceRow(RowData_sptr data);
+  void reduceRow(const RowData_sptr &data);
   // Finds a run in the AnalysisDataService
   QString findRunInADS(const QString &run, const QString &prefix,
                        bool &runFound);
 
   // Set up data required for processing a row
-  bool initRowForProcessing(RowData_sptr rowData);
+  bool initRowForProcessing(const RowData_sptr &rowData);
   // Process rows
   virtual void process(TreeData itemsToProcess);
   // Plotting
@@ -249,12 +251,12 @@ protected:
   bool promptUser() const { return m_promptUser; }
   void setGroupIsProcessed(const int groupIndex, const bool isProcessed);
   void setGroupError(const int groupIndex, const std::string &error);
-  void setRowIsProcessed(RowData_sptr rowData, const bool isProcessed);
-  void setRowError(RowData_sptr rowData, const std::string &error);
-  bool rowNeedsProcessing(RowData_sptr rowData) const;
+  void setRowIsProcessed(const RowData_sptr &rowData, const bool isProcessed);
+  void setRowError(const RowData_sptr &rowData, const std::string &error);
+  bool rowNeedsProcessing(const RowData_sptr &rowData) const;
   bool groupNeedsProcessing(const int groupIndex) const;
   void resetProcessedState(const int groupIndex);
-  void resetProcessedState(RowData_sptr rowData);
+  void resetProcessedState(const RowData_sptr &rowData);
   void resetProcessedState(const std::string &workspaceName);
   void resetProcessedState();
   void updateWidgetEnabledState(const bool isProcessing) const;
@@ -383,7 +385,7 @@ private:
                       int parentColumn) override;
   int getNumberOfRows() override;
   void clearTable() override;
-  bool workspaceIsOutputOfRow(RowData_sptr rowData,
+  bool workspaceIsOutputOfRow(const RowData_sptr &rowData,
                               const std::string &workspaceName) const;
   bool workspaceIsBeingReduced(const std::string &workspaceName) const;
   void handleWorkspaceRemoved(const std::string &workspaceName,
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenterRowReducerWorker.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenterRowReducerWorker.h
index ee0705a292c..82d41b9e37a 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenterRowReducerWorker.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenterRowReducerWorker.h
@@ -9,6 +9,7 @@
 #include "MantidQtWidgets/Common/DataProcessorUI/GenericDataProcessorPresenter.h"
 
 #include <QThread>
+#include <utility>
 
 namespace MantidQt {
 namespace MantidWidgets {
@@ -27,8 +28,8 @@ public:
   GenericDataProcessorPresenterRowReducerWorker(
       GenericDataProcessorPresenter *presenter, RowData_sptr rowData,
       const int rowIndex, const int groupIndex)
-      : m_presenter(presenter), m_rowData(rowData), m_rowIndex(rowIndex),
-        m_groupIndex(groupIndex) {}
+      : m_presenter(presenter), m_rowData(std::move(rowData)),
+        m_rowIndex(rowIndex), m_groupIndex(groupIndex) {}
 
 private slots:
   void startWorker() {
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/OneLevelTreeManager.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/OneLevelTreeManager.h
index 6a0c2c30646..76f9fd9179c 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/OneLevelTreeManager.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/OneLevelTreeManager.h
@@ -27,7 +27,7 @@ class EXPORT_OPT_MANTIDQT_COMMON OneLevelTreeManager : public TreeManager {
 public:
   /// Constructor
   OneLevelTreeManager(DataProcessorPresenter *presenter,
-                      Mantid::API::ITableWorkspace_sptr table,
+                      const Mantid::API::ITableWorkspace_sptr &table,
                       const WhiteList &whitelist);
   /// Constructor (no table ws given)
   OneLevelTreeManager(DataProcessorPresenter *presenter,
@@ -123,9 +123,9 @@ private:
   Mantid::API::ITableWorkspace_sptr
   createDefaultWorkspace(const WhiteList &whitelist);
   /// Validate a table workspace
-  void validateModel(Mantid::API::ITableWorkspace_sptr ws,
+  void validateModel(const Mantid::API::ITableWorkspace_sptr &ws,
                      size_t whitelistColumns) const;
-  TreeData constructTreeData(std::set<int> rows);
+  TreeData constructTreeData(const std::set<int> &rows);
 };
 } // namespace DataProcessor
 } // namespace MantidWidgets
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/PostprocessingStep.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/PostprocessingStep.h
index f84122987de..891cda313b7 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/PostprocessingStep.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/PostprocessingStep.h
@@ -21,8 +21,9 @@ namespace MantidWidgets {
 namespace DataProcessor {
 struct EXPORT_OPT_MANTIDQT_COMMON PostprocessingStep {
 public:
-  PostprocessingStep(QString options);
-  PostprocessingStep(QString options, PostprocessingAlgorithm algorithm,
+  PostprocessingStep(const QString &options);
+  PostprocessingStep(const QString &options,
+                     const PostprocessingAlgorithm &algorithm,
                      std::map<QString, QString> map);
 
   void postProcessGroup(const QString &outputWSName,
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/PreprocessingAlgorithm.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/PreprocessingAlgorithm.h
index 95e3e86f294..9fd596235f8 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/PreprocessingAlgorithm.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/PreprocessingAlgorithm.h
@@ -23,12 +23,13 @@ class EXPORT_OPT_MANTIDQT_COMMON PreprocessingAlgorithm
     : public ProcessingAlgorithmBase {
 public:
   // Constructor
-  PreprocessingAlgorithm(QString name, QString prefix = "",
-                         QString separator = "",
-                         std::set<QString> blacklist = std::set<QString>());
+  PreprocessingAlgorithm(
+      const QString &name, const QString &prefix = "",
+      const QString &separator = "",
+      const std::set<QString> &blacklist = std::set<QString>());
   // Delegating constructor
-  PreprocessingAlgorithm(QString name, QString prefix, QString separator,
-                         const QString &blacklist);
+  PreprocessingAlgorithm(const QString &name, const QString &prefix,
+                         const QString &separator, const QString &blacklist);
   // Default constructor
   PreprocessingAlgorithm();
   // Destructor
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/ProcessingAlgorithm.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/ProcessingAlgorithm.h
index eda2f2f5cf6..77010523d6a 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/ProcessingAlgorithm.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/ProcessingAlgorithm.h
@@ -25,12 +25,12 @@ class EXPORT_OPT_MANTIDQT_COMMON ProcessingAlgorithm
 public:
   ProcessingAlgorithm();
   // Constructor
-  ProcessingAlgorithm(QString name, std::vector<QString> prefix,
+  ProcessingAlgorithm(const QString &name, std::vector<QString> prefix,
                       std::size_t postprocessedOutputPrefixIndex,
-                      std::set<QString> blacklist = std::set<QString>(),
+                      const std::set<QString> &blacklist = std::set<QString>(),
                       const int version = -1);
   // Delegating constructor
-  ProcessingAlgorithm(QString name, QString const &prefix,
+  ProcessingAlgorithm(const QString &name, QString const &prefix,
                       std::size_t postprocessedOutputPrefixIndex,
                       QString const &blacklist = "", const int version = -1);
   // Destructor
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/QOneLevelTreeModel.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/QOneLevelTreeModel.h
index a1b9420c31d..2b0e7624a1f 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/QOneLevelTreeModel.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/QOneLevelTreeModel.h
@@ -31,7 +31,7 @@ the same number of columns as the number of items in the WhiteList.
 class EXPORT_OPT_MANTIDQT_COMMON QOneLevelTreeModel : public AbstractTreeModel {
   Q_OBJECT
 public:
-  QOneLevelTreeModel(Mantid::API::ITableWorkspace_sptr tableWorkspace,
+  QOneLevelTreeModel(const Mantid::API::ITableWorkspace_sptr &tableWorkspace,
                      const WhiteList &whitelist);
   ~QOneLevelTreeModel() override;
 
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/QTwoLevelTreeModel.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/QTwoLevelTreeModel.h
index 2742bf09fc0..37c5d68c43f 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/QTwoLevelTreeModel.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/QTwoLevelTreeModel.h
@@ -36,7 +36,7 @@ number of items in the WhiteList.
 class EXPORT_OPT_MANTIDQT_COMMON QTwoLevelTreeModel : public AbstractTreeModel {
   Q_OBJECT
 public:
-  QTwoLevelTreeModel(Mantid::API::ITableWorkspace_sptr tableWorkspace,
+  QTwoLevelTreeModel(const Mantid::API::ITableWorkspace_sptr &tableWorkspace,
                      const WhiteList &whitelist);
   ~QTwoLevelTreeModel() override;
 
@@ -112,7 +112,7 @@ private:
                            const std::map<QString, QString> &rowValues);
   void insertRowAndGroupWithValues(const std::map<QString, QString> &rowValues);
   bool rowIsEmpty(int row, int parent) const;
-  void setupModelData(Mantid::API::ITableWorkspace_sptr table);
+  void setupModelData(const Mantid::API::ITableWorkspace_sptr &table);
   bool insertGroups(int position, int count);
   bool removeGroups(int position, int count);
   bool removeRows(int position, int count, int parent);
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/TreeData.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/TreeData.h
index e19fa5862f6..3f29447436f 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/TreeData.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/TreeData.h
@@ -35,7 +35,7 @@ class DLLExport RowData {
 public:
   // Constructors
   explicit RowData(const int columnCount);
-  explicit RowData(QStringList data);
+  explicit RowData(const QStringList &data);
   explicit RowData(const std::vector<std::string> &data);
   explicit RowData(const RowData &src);
 
@@ -112,7 +112,7 @@ public:
   bool reductionFailed() const;
 
   /// Get the reduced workspace name, optionally adding a prefix
-  QString reducedName(const QString prefix = QString()) const;
+  QString reducedName(const QString &prefix = QString()) const;
   /// Set the reduced workspace name
   void setReducedName(const QString &name) { m_reducedName = name; }
   bool hasOutputWorkspaceWithNameAndPrefix(const QString &workspaceName,
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/TwoLevelTreeManager.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/TwoLevelTreeManager.h
index fe365bf7d26..fde32267a06 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/TwoLevelTreeManager.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/TwoLevelTreeManager.h
@@ -29,7 +29,7 @@ class EXPORT_OPT_MANTIDQT_COMMON TwoLevelTreeManager : public TreeManager {
 public:
   /// Constructor
   TwoLevelTreeManager(DataProcessorPresenter *presenter,
-                      Mantid::API::ITableWorkspace_sptr table,
+                      const Mantid::API::ITableWorkspace_sptr &table,
                       const WhiteList &whitelist);
   /// Constructor (no table ws given)
   TwoLevelTreeManager(DataProcessorPresenter *presenter,
@@ -122,9 +122,9 @@ private:
   Mantid::API::ITableWorkspace_sptr
   createDefaultWorkspace(const WhiteList &whitelist);
   /// Validate a table workspace
-  void validateModel(Mantid::API::ITableWorkspace_sptr ws,
+  void validateModel(const Mantid::API::ITableWorkspace_sptr &ws,
                      size_t whitelistColumns) const;
-  TreeData constructTreeData(ChildItems rows);
+  TreeData constructTreeData(const ChildItems &rows);
 };
 } // namespace DataProcessor
 } // namespace MantidWidgets
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/WorkspaceNameUtils.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/WorkspaceNameUtils.h
index 8690aa2bce3..8d34e2234ba 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/WorkspaceNameUtils.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DataProcessorUI/WorkspaceNameUtils.h
@@ -31,11 +31,11 @@ QString preprocessingListToString(const QStringList &values,
                                   const QString &separator);
 // Returns the name of the reduced workspace for a given row
 QString DLLExport getReducedWorkspaceName(
-    const RowData_sptr data, const WhiteList &whitelist,
+    const RowData_sptr &data, const WhiteList &whitelist,
     const std::map<QString, PreprocessingAlgorithm> &preprocessor);
 // Consolidate global options with row values
 OptionsMap DLLExport getCanonicalOptions(
-    const RowData_sptr data, const OptionsMap &globalOptions,
+    const RowData_sptr &data, const OptionsMap &globalOptions,
     const WhiteList &whitelist, const bool allowInsertions,
     const std::vector<QString> &outputProperties = std::vector<QString>(),
     const std::vector<QString> &prefixes = std::vector<QString>());
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DiagResults.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DiagResults.h
index 622baafe033..36c1891eec3 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DiagResults.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DiagResults.h
@@ -28,8 +28,8 @@ signals:
   void died();
 
 private:
-  void updateRow(int row, QString text);
-  int addRow(QString firstColumn, QString secondColumn);
+  void updateRow(int row, const QString &text);
+  int addRow(const QString &firstColumn, const QString &secondColumn);
   void closeEvent(QCloseEvent *event) override;
 
 private:
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/DoubleSpinBox.h b/qt/widgets/common/inc/MantidQtWidgets/Common/DoubleSpinBox.h
index bad6c44add3..11af6dae0bd 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/DoubleSpinBox.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/DoubleSpinBox.h
@@ -62,7 +62,7 @@ public:
     setDecimals(prec);
   };
 
-  void addSpecialTextMapping(QString text, double value);
+  void addSpecialTextMapping(const QString &text, double value);
 
   QString textFromValue(double value) const;
   QValidator::State validate(QString &input, int &pos) const override;
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/EditLocalParameterDialog.h b/qt/widgets/common/inc/MantidQtWidgets/Common/EditLocalParameterDialog.h
index 811941e87c0..14a36248c28 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/EditLocalParameterDialog.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/EditLocalParameterDialog.h
@@ -28,9 +28,10 @@ class EXPORT_OPT_MANTIDQT_COMMON EditLocalParameterDialog
   Q_OBJECT
 public:
   EditLocalParameterDialog(QWidget *parent, const QString &parName,
-                           const QStringList &wsNames, QList<double> values,
-                           QList<bool> fixes, QStringList ties,
-                           QStringList constraints);
+                           const QStringList &wsNames,
+                           const QList<double> &values,
+                           const QList<bool> &fixes, const QStringList &ties,
+                           const QStringList &constraints);
   void doSetup(const QString &parName, const QStringList &wsNames);
   QString getParameterName() const { return m_parName; }
   QList<double> getValues() const;
@@ -55,9 +56,9 @@ private slots:
   void fixParameter(int /*index*/, bool /*fix*/);
   void setAllFixed(bool /*fix*/);
   void setTie(int /*index*/, QString /*tie*/);
-  void setTieAll(QString /*tie*/);
+  void setTieAll(const QString & /*tie*/);
   void setConstraint(int /*index*/, QString /*tie*/);
-  void setConstraintAll(QString /*tie*/);
+  void setConstraintAll(const QString & /*tie*/);
   void copy();
   void paste();
   void setValueToLog(int /*i*/);
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/FileDialogHandler.h b/qt/widgets/common/inc/MantidQtWidgets/Common/FileDialogHandler.h
index cb511b106e7..c9a80cb0478 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/FileDialogHandler.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/FileDialogHandler.h
@@ -37,7 +37,7 @@ namespace FileDialogHandler {
 DLLExport QString
 getSaveFileName(QWidget *parent = nullptr,
                 const Mantid::Kernel::Property *baseProp = nullptr,
-                QFileDialog::Options options = nullptr);
+                const QFileDialog::Options &options = nullptr);
 
 /**
  * For file dialogs. This will add the selected extension if an extension
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/FitOptionsBrowser.h b/qt/widgets/common/inc/MantidQtWidgets/Common/FitOptionsBrowser.h
index 66d6c471214..d0d0f4c1c91 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/FitOptionsBrowser.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/FitOptionsBrowser.h
@@ -64,7 +64,7 @@ public:
   void setLogNames(const QStringList &logNames);
   void setParameterNamesForPlotting(const QStringList &parNames);
   QString getParameterToPlot() const;
-  bool addPropertyToBlacklist(QString);
+  bool addPropertyToBlacklist(const QString &);
 
 signals:
   void changedToSequentialFitting();
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/FitPropertyBrowser.h b/qt/widgets/common/inc/MantidQtWidgets/Common/FitPropertyBrowser.h
index 862b93bd5c3..c7a0832df9f 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/FitPropertyBrowser.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/FitPropertyBrowser.h
@@ -226,7 +226,7 @@ public:
   void setTip(const QString &txt);
 
   /// alter text of Plot Guess
-  void setTextPlotGuess(const QString text);
+  void setTextPlotGuess(const QString &text);
 
   /// Creates the "Ties" property value for the Fit algorithm
   QString getTieString() const;
@@ -466,7 +466,7 @@ protected:
   ///
   void updateDecimals();
   /// Sets the workspace to a function
-  void setWorkspace(boost::shared_ptr<Mantid::API::IFunction> f) const;
+  void setWorkspace(const boost::shared_ptr<Mantid::API::IFunction> &f) const;
   /// Display properties relevant to the selected workspace
   void setWorkspaceProperties();
   /// Adds the workspace index property to the browser.
@@ -486,7 +486,7 @@ protected:
   /// Catches unexpected not found exceptions
   Mantid::API::IFunction_sptr tryCreateFitFunction(const QString &str);
   /// Create CompositeFunction from pointer
-  void createCompositeFunction(const Mantid::API::IFunction_sptr func);
+  void createCompositeFunction(const Mantid::API::IFunction_sptr &func);
 
   /// Property managers:
   QtGroupPropertyManager *m_groupManager;
@@ -593,7 +593,7 @@ private:
   /// Return the nearest allowed workspace index.
   int getAllowedIndex(int currentIndex) const;
 
-  void setCurrentFunction(Mantid::API::IFunction_const_sptr f) const;
+  void setCurrentFunction(const Mantid::API::IFunction_const_sptr &f) const;
 
   /// Sets the new workspace to the current one
   virtual void workspaceChange(const QString &wsName);
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionBrowser.h b/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionBrowser.h
index b99020efd28..eb2d18a9201 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionBrowser.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionBrowser.h
@@ -142,7 +142,7 @@ public slots:
   void setDatasetNames(const QStringList &names) override;
   void resetLocalParameters();
   void setCurrentDataset(int i) override;
-  void removeDatasets(QList<int> indices);
+  void removeDatasets(const QList<int> &indices);
   void addDatasets(const QStringList &names);
 
 protected:
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionModel.h b/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionModel.h
index db966aed4d0..64fb98aec9e 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionModel.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionModel.h
@@ -33,7 +33,7 @@ public:
   bool isParameterFixed(const QString &parName) const;
   QString getParameterTie(const QString &parName) const;
   void setParameterFixed(const QString &parName, bool fixed);
-  void setParameterTie(const QString &parName, QString tie);
+  void setParameterTie(const QString &parName, const QString &tie);
   QStringList getParameterNames() const override;
   IFunction_sptr getSingleFunction(int index) const override;
   IFunction_sptr getCurrentFunction() const override;
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionMultiDomainPresenter.h b/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionMultiDomainPresenter.h
index e6f852b08b0..ca5a1292675 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionMultiDomainPresenter.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionMultiDomainPresenter.h
@@ -62,9 +62,9 @@ public:
   void setLocalParameterValue(const QString &parName, int i, double value,
                               double error);
   void setLocalParameterFixed(const QString &parName, int i, bool fixed);
-  void setLocalParameterTie(const QString &parName, int i, QString tie);
+  void setLocalParameterTie(const QString &parName, int i, const QString &tie);
   void setLocalParameterConstraint(const QString &parName, int i,
-                                   QString constraint);
+                                   const QString &constraint);
   QStringList getGlobalParameters() const;
   void setGlobalParameters(const QStringList &globals);
   QStringList getLocalParameters() const;
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionTreeView.h b/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionTreeView.h
index 365ea2d20a6..cf0a75346af 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionTreeView.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/FunctionTreeView.h
@@ -137,24 +137,26 @@ protected:
   /// Remove and delete property
   void removeProperty(QtProperty *prop);
   /// Set a function
-  void setFunction(QtProperty *prop, Mantid::API::IFunction_sptr fun);
+  void setFunction(QtProperty *prop, const Mantid::API::IFunction_sptr &fun);
   /// Add a function
-  bool addFunction(QtProperty *prop, Mantid::API::IFunction_sptr fun);
+  bool addFunction(QtProperty *prop, const Mantid::API::IFunction_sptr &fun);
   /// Add a function property
-  AProperty addFunctionProperty(QtProperty *parent, QString funName);
+  AProperty addFunctionProperty(QtProperty *parent, const QString &funName);
   /// Add a parameter property
-  AProperty addParameterProperty(QtProperty *parent, QString paramName,
-                                 QString paramDesc, double paramValue);
+  AProperty addParameterProperty(QtProperty *parent, const QString &paramName,
+                                 const QString &paramDesc, double paramValue);
   /// Add a attribute property
-  AProperty addAttributeProperty(QtProperty *parent, QString attName,
+  AProperty addAttributeProperty(QtProperty *parent, const QString &attName,
                                  const Mantid::API::IFunction::Attribute &att);
   /// Add attribute and parameter properties to a function property
-  void addAttributeAndParameterProperties(QtProperty *prop,
-                                          Mantid::API::IFunction_sptr fun);
+  void
+  addAttributeAndParameterProperties(QtProperty *prop,
+                                     const Mantid::API::IFunction_sptr &fun);
   /// Add property showing function's index in the composite function
   AProperty addIndexProperty(QtProperty *prop);
   /// Update function index properties
-  void updateFunctionIndices(QtProperty *prop = nullptr, QString index = "");
+  void updateFunctionIndices(QtProperty *prop = nullptr,
+                             const QString &index = "");
   /// Get property of the overall function
   AProperty getFunctionProperty() const;
   /// Check if property is a function group
@@ -194,7 +196,7 @@ protected:
   QtProperty *getTieProperty(QtProperty *prop) const;
 
   /// Add a tie property
-  void addTieProperty(QtProperty *prop, QString tie);
+  void addTieProperty(QtProperty *prop, const QString &tie);
   /// Check if a parameter property has a tie
   bool hasTie(QtProperty *prop) const;
   /// Check if a property is a tie
@@ -204,7 +206,7 @@ protected:
 
   /// Add a constraint property
   QList<AProperty> addConstraintProperties(QtProperty *prop,
-                                           QString constraint);
+                                           const QString &constraint);
   /// Check if a property is a constraint
   bool isConstraint(QtProperty *prop) const;
   /// Check if a parameter property has a constraint
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/IndirectFitPropertyBrowserLegacy.h b/qt/widgets/common/inc/MantidQtWidgets/Common/IndirectFitPropertyBrowserLegacy.h
index b7c60108de7..fa184ab919f 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/IndirectFitPropertyBrowserLegacy.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/IndirectFitPropertyBrowserLegacy.h
@@ -34,7 +34,7 @@ public:
   boost::optional<size_t> backgroundIndex() const;
 
   boost::optional<size_t>
-  functionIndex(Mantid::API::IFunction_sptr function) const;
+  functionIndex(const Mantid::API::IFunction_sptr &function) const;
 
   QString selectedFitType() const;
 
@@ -55,7 +55,7 @@ public:
   void setParameterValue(const std::string &functionName,
                          const std::string &parameterName, double value);
 
-  void setParameterValue(Mantid::API::IFunction_sptr function,
+  void setParameterValue(const Mantid::API::IFunction_sptr &function,
                          const std::string &parameterName, double value);
 
   void setBackground(const std::string &backgroundName);
@@ -134,7 +134,8 @@ public:
 
   void setWorkspaceIndex(int i) override;
 
-  void updatePlotGuess(Mantid::API::MatrixWorkspace_const_sptr sampleWorkspace);
+  void updatePlotGuess(
+      const Mantid::API::MatrixWorkspace_const_sptr &sampleWorkspace);
 
 public slots:
   void fit() override;
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/InterfaceManager.h b/qt/widgets/common/inc/MantidQtWidgets/Common/InterfaceManager.h
index a59322011b4..547503c904c 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/InterfaceManager.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/InterfaceManager.h
@@ -58,8 +58,8 @@ class EXPORT_OPT_MANTIDQT_COMMON InterfaceManager {
 public:
   /// Create a new instance of the correct type of AlgorithmDialog
   AlgorithmDialog *createDialog(
-      boost::shared_ptr<Mantid::API::IAlgorithm> alg, QWidget *parent = nullptr,
-      bool forScript = false,
+      const boost::shared_ptr<Mantid::API::IAlgorithm> &alg,
+      QWidget *parent = nullptr, bool forScript = false,
       const QHash<QString, QString> &presetValues = (QHash<QString, QString>()),
       const QString &optional_msg = QString(),
       const QStringList &enabled = QStringList(),
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/LocalParameterEditor.h b/qt/widgets/common/inc/MantidQtWidgets/Common/LocalParameterEditor.h
index 47c65042c6e..01701a1af44 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/LocalParameterEditor.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/LocalParameterEditor.h
@@ -24,8 +24,8 @@ class LocalParameterEditor : public QWidget {
   Q_OBJECT
 public:
   LocalParameterEditor(QWidget *parent, int index, double value, bool fixed,
-                       QString tie, QString constraint, bool othersFixed,
-                       bool allOthersFixed, bool othersTied,
+                       const QString &tie, const QString &constraint,
+                       bool othersFixed, bool allOthersFixed, bool othersTied,
                        bool logOptionsEnabled);
 signals:
   void setAllValues(double /*_t1*/);
@@ -57,8 +57,8 @@ private slots:
 private:
   bool eventFilter(QObject *widget, QEvent *evn) override;
   void setEditorState();
-  static QString setTieDialog(QString tie);
-  static QString setConstraintDialog(QString tie);
+  static QString setTieDialog(const QString &tie);
+  static QString setConstraintDialog(const QString &tie);
   QLineEdit *m_editor;
   QPushButton *m_button;
   QAction *m_setAllAction;
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/MantidDialog.h b/qt/widgets/common/inc/MantidQtWidgets/Common/MantidDialog.h
index 98e2530fdd7..68f45b649ca 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/MantidDialog.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/MantidDialog.h
@@ -58,8 +58,8 @@ class EXPORT_OPT_MANTIDQT_COMMON MantidDialog : public QDialog {
 public:
   /// DefaultConstructor
   MantidDialog(QWidget *parent = nullptr,
-               Qt::WindowFlags flags = Qt::WindowCloseButtonHint |
-                                       Qt::WindowType::WindowTitleHint);
+               const Qt::WindowFlags &flags = Qt::WindowCloseButtonHint |
+                                              Qt::WindowType::WindowTitleHint);
   /// Destructor
   ~MantidDialog() override;
 
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/MantidHelpWindow.h b/qt/widgets/common/inc/MantidQtWidgets/Common/MantidHelpWindow.h
index eb827f00ce9..d4f39094c92 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/MantidHelpWindow.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/MantidHelpWindow.h
@@ -27,7 +27,8 @@ class EXPORT_OPT_MANTIDQT_COMMON MantidHelpWindow
 public:
   static bool helpWindowExists() { return g_helpWindow != nullptr; }
 
-  MantidHelpWindow(QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr);
+  MantidHelpWindow(QWidget *parent = nullptr,
+                   const Qt::WindowFlags &flags = nullptr);
   ~MantidHelpWindow() override;
 
   void showPage(const std::string &url = std::string()) override;
@@ -68,7 +69,7 @@ private:
 public slots:
   /// Perform any clean up on main window shutdown
   void shutdown() override;
-  void warning(QString msg);
+  void warning(const QString &msg);
 };
 
 } // namespace MantidWidgets
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/MantidTreeModel.h b/qt/widgets/common/inc/MantidQtWidgets/Common/MantidTreeModel.h
index 097001f301b..c351c8080cc 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/MantidTreeModel.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/MantidTreeModel.h
@@ -57,7 +57,7 @@ public:
   QWidget *getParent() override;
 
   MantidQt::API::AlgorithmDialog *
-  createAlgorithmDialog(Mantid::API::IAlgorithm_sptr alg);
+  createAlgorithmDialog(const Mantid::API::IAlgorithm_sptr &alg);
 
   // Plotting Methods
   MultiLayer *
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/MantidTreeWidgetItem.h b/qt/widgets/common/inc/MantidQtWidgets/Common/MantidTreeWidgetItem.h
index b3854149d37..3ff2ee37ebb 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/MantidTreeWidgetItem.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/MantidTreeWidgetItem.h
@@ -22,7 +22,8 @@ class MantidTreeWidget;
 class EXPORT_OPT_MANTIDQT_COMMON MantidTreeWidgetItem : public QTreeWidgetItem {
 public:
   explicit MantidTreeWidgetItem(MantidTreeWidget * /*parent*/);
-  MantidTreeWidgetItem(QStringList /*list*/, MantidTreeWidget * /*parent*/);
+  MantidTreeWidgetItem(const QStringList & /*list*/,
+                       MantidTreeWidget * /*parent*/);
   void disableIfNode(bool);
   void setSortPos(int o) { m_sortPos = o; }
   int getSortPos() const { return m_sortPos; }
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/MantidWSIndexDialog.h b/qt/widgets/common/inc/MantidQtWidgets/Common/MantidWSIndexDialog.h
index 48f03a8dc18..483e5edddd5 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/MantidWSIndexDialog.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/MantidWSIndexDialog.h
@@ -72,7 +72,7 @@ public:
   /// Constructor - starting at start and ending at end.
   Interval(int start, int end);
   /// Constructor - attempts to parse given string to find start and end.
-  explicit Interval(QString /*intervalString*/);
+  explicit Interval(const QString & /*intervalString*/);
   /// Copy constructor
   Interval(const Interval & /*copy*/);
 
@@ -114,9 +114,9 @@ public:
   /// Constructor - with empty list.
   IntervalList(void);
   /// Constructor - with a list created by parsing the input string
-  explicit IntervalList(QString /*intervals*/);
+  explicit IntervalList(const QString & /*intervals*/);
   /// Constructor - with a list containing a single Interval
-  explicit IntervalList(Interval /*interval*/);
+  explicit IntervalList(const Interval & /*interval*/);
   /// Copy Constructor
   IntervalList(const IntervalList & /*copy*/);
 
@@ -220,7 +220,7 @@ class EXPORT_OPT_MANTIDQT_COMMON MantidWSIndexWidget : public QWidget {
     QLineEdit *lineEdit() { return _lineEdit; };
     /// if Error is not empty, it will make the * label visible and set the
     /// tooltip as the error.
-    void setError(QString error);
+    void setError(const QString &error);
 
   private:
     QLineEdit *_lineEdit;
@@ -268,7 +268,7 @@ public:
   /// Constructor - same parameters as one of the parent constructors, along
   /// with a
   /// list of the names of workspaces to be plotted.
-  MantidWSIndexWidget(QWidget *parent, Qt::WindowFlags flags,
+  MantidWSIndexWidget(QWidget *parent, const Qt::WindowFlags &flags,
                       const QList<QString> &wsNames,
                       const bool showWaterfallOption = false,
                       const bool showTiledOption = false,
@@ -391,7 +391,7 @@ class EXPORT_OPT_MANTIDQT_COMMON MantidWSIndexDialog : public QDialog {
 
 public:
   /// Constructor - has a list of the names of workspaces to be plotted.
-  MantidWSIndexDialog(QWidget *parent, Qt::WindowFlags flags,
+  MantidWSIndexDialog(QWidget *parent, const Qt::WindowFlags &flags,
                       const QList<QString> &wsNames,
                       const bool showWaterfallOption = false,
                       const bool showPlotAll = true,
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/MdSettings.h b/qt/widgets/common/inc/MantidQtWidgets/Common/MdSettings.h
index 65f84da41a6..ab09a44d7e7 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/MdSettings.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/MdSettings.h
@@ -31,7 +31,7 @@ public:
    * Set the UserSetting color map for the vsi.
    *@param colorMap UserSetting colormap for the vsi
    */
-  void setUserSettingColorMap(QString colorMap);
+  void setUserSettingColorMap(const QString &colorMap);
 
   /**
    * Get the UserSetting color map for the vsi.
@@ -48,7 +48,7 @@ public:
    * Set the LastSession color map
    * @param colorMap The colormap for the VSI.
    */
-  void setLastSessionColorMap(QString colorMap);
+  void setLastSessionColorMap(const QString &colorMap);
 
   /**
    * Get the background color for the user setting.
@@ -66,7 +66,7 @@ public:
    * Set the background color for the user setting.
    * @param backgroundColor The background color.
    */
-  void setUserSettingBackgroundColor(QColor backgroundColor);
+  void setUserSettingBackgroundColor(const QColor &backgroundColor);
 
   /**
    * Get the background color for the last session.
@@ -78,14 +78,15 @@ public:
    * Set the background color for the user setting.
    * @param backgroundColor The background color.
    */
-  void setLastSessionBackgroundColor(QColor backgroundColor);
+  void setLastSessionBackgroundColor(const QColor &backgroundColor);
 
   /**
    * Set the general MD color map
    * @param colorMapName The name of the general color map.
    * @param colorMapFile The file name of the general color map.
    */
-  void setGeneralMdColorMap(QString colorMapName, QString colorMapFile);
+  void setGeneralMdColorMap(const QString &colorMapName,
+                            const QString &colorMapFile);
 
   /**
    * Get the general MD color map file
@@ -141,7 +142,7 @@ public:
    * Set the user setting for the initial view.
    * @param initialView The selected initial view.
    */
-  void setUserSettingIntialView(QString initialView);
+  void setUserSettingIntialView(const QString &initialView);
 
   /**
    * Retrieves the state of the last session's log scale.
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/Message.h b/qt/widgets/common/inc/MantidQtWidgets/Common/Message.h
index d5667c988be..c218b7fec15 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/Message.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/Message.h
@@ -36,15 +36,15 @@ public:
   Message();
   /// Construct a message from a QString with a given priority (default=notice)
   Message(const QString &text, Priority priority = Priority::PRIO_NOTICE,
-          QString scriptPath = "");
+          const QString &scriptPath = "");
   /// Construct a message from a std::string with a given priority
   /// (default=notice)
   Message(const std::string &text, Priority priority = Priority::PRIO_NOTICE,
-          QString scriptPath = "");
+          const QString &scriptPath = "");
   /// Construct a message from a c-style string and a given priority
   /// (default=notice)
   Message(const char *text, Priority priority = Priority::PRIO_NOTICE,
-          QString scriptPath = "");
+          const QString &scriptPath = "");
   /// Copy constructor
   Message(const Message &msg);
   /// Copy assignment
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/MuonFitDataSelector.h b/qt/widgets/common/inc/MantidQtWidgets/Common/MuonFitDataSelector.h
index e3caa39e9d3..4baa49c3dbc 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/MuonFitDataSelector.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/MuonFitDataSelector.h
@@ -48,8 +48,12 @@ public:
   /// Get names of chosen groups
   QStringList getChosenGroups() const override;
   /// Set chosen group/period
-  void setGroupsSelected(QStringList groups) { m_chosenGroups = groups; };
-  void setPeriodsSelected(QStringList periods) { m_chosenPeriods = periods; };
+  void setGroupsSelected(const QStringList &groups) {
+    m_chosenGroups = groups;
+  };
+  void setPeriodsSelected(const QStringList &periods) {
+    m_chosenPeriods = periods;
+  };
   /// Get selected periods
   QStringList getPeriodSelections() const override;
   /// Get type of fit
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/MuonFitPropertyBrowser.h b/qt/widgets/common/inc/MantidQtWidgets/Common/MuonFitPropertyBrowser.h
index e5ebbd454dc..3239b024b3f 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/MuonFitPropertyBrowser.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/MuonFitPropertyBrowser.h
@@ -128,8 +128,8 @@ public:
   void setChosenGroup(const QString &group);
   void setAllPeriods();
   void setChosenPeriods(const QString &period);
-  void setSingleFitLabel(std::string name);
-  void setNormalization(const std::string name);
+  void setSingleFitLabel(const std::string &name);
+  void setNormalization(const std::string &name);
   void checkFitEnabled();
 public slots:
   /// Perform the fit algorithm
@@ -185,8 +185,8 @@ private:
   void finishAfterSimultaneousFit(const Mantid::API::IAlgorithm *fitAlg,
                                   const int nWorkspaces) const;
   void finishAfterTFSimultaneousFit(const Mantid::API::IAlgorithm *alg,
-                                    const std::string baseName) const;
-  void setFitWorkspaces(const std::string input);
+                                    const std::string &baseName) const;
+  void setFitWorkspaces(const std::string &input);
   std::string getUnnormName(const std::string wsName);
   void ConvertFitFunctionForMuonTFAsymmetry(bool enabled);
   void setTFAsymmMode(bool state);
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/NonOrthogonal.h b/qt/widgets/common/inc/MantidQtWidgets/Common/NonOrthogonal.h
index 9e87f040843..773b926fd90 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/NonOrthogonal.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/NonOrthogonal.h
@@ -27,7 +27,8 @@ bool EXPORT_OPT_MANTIDQT_COMMON isHKLDimensions(
     const Mantid::API::IMDWorkspace &workspace, size_t dimX, size_t dimY);
 
 size_t EXPORT_OPT_MANTIDQT_COMMON getMissingHKLDimensionIndex(
-    Mantid::API::IMDWorkspace_const_sptr workspace, size_t dimX, size_t dimY);
+    const Mantid::API::IMDWorkspace_const_sptr &workspace, size_t dimX,
+    size_t dimY);
 
 void EXPORT_OPT_MANTIDQT_COMMON
 transformFromDoubleToCoordT(const Mantid::Kernel::DblMatrix &skewMatrix,
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/PluginLibraries.h b/qt/widgets/common/inc/MantidQtWidgets/Common/PluginLibraries.h
index 158052067ee..f84dd4db5c0 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/PluginLibraries.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/PluginLibraries.h
@@ -13,12 +13,13 @@
 namespace MantidQt {
 namespace API {
 
-EXPORT_OPT_MANTIDQT_COMMON std::string qtPluginPathFromCfg(std::string key);
+EXPORT_OPT_MANTIDQT_COMMON std::string
+qtPluginPathFromCfg(const std::string &key);
 
 /// Load plugins from a path given by the key in the config service
-EXPORT_OPT_MANTIDQT_COMMON int loadPluginsFromCfgPath(std::string key);
+EXPORT_OPT_MANTIDQT_COMMON int loadPluginsFromCfgPath(const std::string &key);
 
 /// Load plugins from a path
-EXPORT_OPT_MANTIDQT_COMMON int loadPluginsFromPath(std::string path);
+EXPORT_OPT_MANTIDQT_COMMON int loadPluginsFromPath(const std::string &path);
 } // namespace API
 } // namespace MantidQt
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/ProcessingAlgoWidget.h b/qt/widgets/common/inc/MantidQtWidgets/Common/ProcessingAlgoWidget.h
index 92f2975ebce..913753c63a7 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/ProcessingAlgoWidget.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/ProcessingAlgoWidget.h
@@ -34,7 +34,7 @@ public:
   /// @return the info string displayed at the top
   QString infoString() { return ui.lblInfo->text(); }
   /// Sets the info string displayed at the top
-  void infoString(QString text) { return ui.lblInfo->setText(text); }
+  void infoString(const QString &text) { return ui.lblInfo->setText(text); }
 
   /// @return true if the script editor is visible
   bool editorVisible() { return ui.editorContainer->isVisible(); }
@@ -55,7 +55,7 @@ public:
   /// @return the text in the script editor
   QString getScriptText();
   /// Set the script editor text
-  void setScriptText(QString text);
+  void setScriptText(const QString &text);
 
   void saveInput();
   /// Sets the AlgorithmInputHistory object recording the algorithm properties
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/ProjectSaveModel.h b/qt/widgets/common/inc/MantidQtWidgets/Common/ProjectSaveModel.h
index eb1c2078e04..25db0015b4a 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/ProjectSaveModel.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/ProjectSaveModel.h
@@ -45,9 +45,10 @@ struct WindowInfo {
 class EXPORT_OPT_MANTIDQT_COMMON ProjectSaveModel {
 public:
   /// Construct a new model instance with vector of window handles
-  ProjectSaveModel(std::vector<MantidQt::API::IProjectSerialisable *> windows,
-                   std::vector<std::string> activePythonInterfaces =
-                       std::vector<std::string>());
+  ProjectSaveModel(
+      const std::vector<MantidQt::API::IProjectSerialisable *> &windows,
+      std::vector<std::string> activePythonInterfaces =
+          std::vector<std::string>());
 
   /// Check if a workspace has any windows attached to it
   bool hasWindows(const std::string &ws) const;
@@ -80,7 +81,7 @@ public:
 private:
   /// Create a workspace info object for this workspace
   WorkspaceInfo
-  makeWorkspaceInfoObject(Mantid::API::Workspace_const_sptr ws) const;
+  makeWorkspaceInfoObject(const Mantid::API::Workspace_const_sptr &ws) const;
 
   WindowInfo
   makeWindowInfoObject(MantidQt::API::IProjectSerialisable *window) const;
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/PropertyHandler.h b/qt/widgets/common/inc/MantidQtWidgets/Common/PropertyHandler.h
index ac28a12a507..1fa12b5f7bf 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/PropertyHandler.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/PropertyHandler.h
@@ -42,7 +42,7 @@ class EXPORT_OPT_MANTIDQT_COMMON PropertyHandler
   Q_OBJECT
 public:
   // Constructor
-  PropertyHandler(Mantid::API::IFunction_sptr fun,
+  PropertyHandler(const Mantid::API::IFunction_sptr &fun,
                   boost::shared_ptr<Mantid::API::CompositeFunction> parent,
                   FitPropertyBrowser *browser, QtBrowserItem *item = nullptr);
 
@@ -94,7 +94,7 @@ public:
 
   PropertyHandler *findHandler(QtProperty *prop);
 
-  PropertyHandler *findHandler(Mantid::API::IFunction_const_sptr fun);
+  PropertyHandler *findHandler(const Mantid::API::IFunction_const_sptr &fun);
   PropertyHandler *findHandler(const Mantid::API::IFunction *fun);
 
   /**
@@ -184,7 +184,7 @@ public:
 
   void addTie(const QString &tieStr);
   void fix(const QString &parName);
-  void removeTie(QtProperty *prop, std::string globalName);
+  void removeTie(QtProperty *prop, const std::string &globalName);
   void removeTie(QtProperty *prop);
   void removeTie(const QString &propName);
   void addConstraint(QtProperty *parProp, bool lo, bool up, double loBound,
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/QtPropertyBrowser/qtpropertybrowserutils_p.h b/qt/widgets/common/inc/MantidQtWidgets/Common/QtPropertyBrowser/qtpropertybrowserutils_p.h
index 39f0522746e..0d4a272bf93 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/QtPropertyBrowser/qtpropertybrowserutils_p.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/QtPropertyBrowser/qtpropertybrowserutils_p.h
@@ -192,7 +192,7 @@ private slots:
 
 private:
   void handleKeyEvent(QKeyEvent *e);
-  int translateModifiers(Qt::KeyboardModifiers state,
+  int translateModifiers(const Qt::KeyboardModifiers &state,
                          const QString &text) const;
 
   int m_num;
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/SaveWorkspaces.h b/qt/widgets/common/inc/MantidQtWidgets/Common/SaveWorkspaces.h
index 59a69bd24c5..a0fcbbbfe2c 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/SaveWorkspaces.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/SaveWorkspaces.h
@@ -77,7 +77,7 @@ private:
                    QHash<QString, QString> workspaceMap);
   QHash<QString, QString>
   provideZeroFreeWorkspaces(const QListWidget *workspaces);
-  void removeZeroFreeWorkspaces(QHash<QString, QString> workspaces);
+  void removeZeroFreeWorkspaces(const QHash<QString, QString> &workspaces);
   bool isValid();
 private slots:
   void saveSel();
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/ScriptRepositoryView.h b/qt/widgets/common/inc/MantidQtWidgets/Common/ScriptRepositoryView.h
index 2ff1ff0d336..bbb6ecd5c85 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/ScriptRepositoryView.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/ScriptRepositoryView.h
@@ -37,7 +37,7 @@ class EXPORT_OPT_MANTIDQT_COMMON ScriptRepositoryView : public MantidDialog {
                      const QModelIndex &index) override;
     QSize sizeHint(const QStyleOptionViewItem &option,
                    const QModelIndex &index) const override;
-    QIcon getIcon(QString state) const;
+    QIcon getIcon(const QString &state) const;
   };
   /// Delegate to show the checkbox for configuring the auto update
   class CheckBoxDelegate : public QStyledItemDelegate {
@@ -78,7 +78,7 @@ protected slots:
   void updateModel();
   void currentChanged(const QModelIndex &current);
   void helpClicked();
-  void openFolderLink(QString /*link*/);
+  void openFolderLink(const QString & /*link*/);
 
 private:
   Ui::ScriptRepositoryView *ui;
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/SequentialFitDialog.h b/qt/widgets/common/inc/MantidQtWidgets/Common/SequentialFitDialog.h
index f2d09a6454d..9f6f9ec91a6 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/SequentialFitDialog.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/SequentialFitDialog.h
@@ -37,7 +37,7 @@ public:
 
   /// Add a list of workspace names to the data list
   /// Returns false if neither of the workspaces can be loaded
-  bool addWorkspaces(const QStringList wsNames);
+  bool addWorkspaces(const QStringList &wsNames);
 
 private:
   /// The form generated with Qt Designer
@@ -84,7 +84,7 @@ private slots:
 private:
   /// Checks that the logs in workspace wsName are consistent
   /// with logs of other workspaces
-  bool validateLogs(const QString wsName);
+  bool validateLogs(const QString &wsName);
 
   /// Populate parameter combo box with possible parameter names
   void populateParameters();
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/SlicingAlgorithmDialog.h b/qt/widgets/common/inc/MantidQtWidgets/Common/SlicingAlgorithmDialog.h
index 38a18c67550..8b65c656278 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/SlicingAlgorithmDialog.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/SlicingAlgorithmDialog.h
@@ -44,10 +44,10 @@ public:
   ~SlicingAlgorithmDialog() override;
 
   // Customisation for the VSI
-  void customiseLayoutForVsi(std::string initialWorkspace);
+  void customiseLayoutForVsi(const std::string &initialWorkspace);
 
   /// Reset the aligned dim values for the VSI
-  void resestAlignedDimProperty(size_t index, QString propertyValue);
+  void resestAlignedDimProperty(size_t index, const QString &propertyValue);
 
 protected:
   /// view
@@ -96,7 +96,7 @@ private:
   /// Build dimension inputs.
   void makeDimensionInputs(
       const QString &propertyPrefix, QLayout *owningLayout,
-      QString (*format)(Mantid::Geometry::IMDDimension_const_sptr),
+      QString (*format)(const Mantid::Geometry::IMDDimension_const_sptr &),
       History history);
 
   /// Determine if history should be used.
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/SlitCalculator.h b/qt/widgets/common/inc/MantidQtWidgets/Common/SlitCalculator.h
index 5d2dfa271f8..c9cf9d3fedf 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/SlitCalculator.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/SlitCalculator.h
@@ -37,10 +37,10 @@ private:
   Mantid::Geometry::Instrument_const_sptr instrument;
   std::string currentInstrumentName;
   void setupSlitCalculatorWithInstrumentValues(
-      Mantid::Geometry::Instrument_const_sptr /*instrument*/);
+      const Mantid::Geometry::Instrument_const_sptr & /*instrument*/);
   std::string getCurrentInstrumentName();
   Mantid::Geometry::Instrument_const_sptr getInstrument();
-  void setInstrument(std::string instrumentName);
+  void setInstrument(const std::string &instrumentName);
 private slots:
   void on_recalculate_triggered();
 };
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/TSVSerialiser.h b/qt/widgets/common/inc/MantidQtWidgets/Common/TSVSerialiser.h
index dfc351b42b1..7fec9813d37 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/TSVSerialiser.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/TSVSerialiser.h
@@ -110,7 +110,7 @@ public:
 
   void storeDouble(const double val);
   void storeInt(const int val);
-  void storeString(const std::string val);
+  void storeString(const std::string &val);
   void storeBool(const bool val);
 
   double readDouble();
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/UserInputValidator.h b/qt/widgets/common/inc/MantidQtWidgets/Common/UserInputValidator.h
index 0eeac6564f8..8647a5dcc00 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/UserInputValidator.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/UserInputValidator.h
@@ -80,12 +80,13 @@ public:
   /// Checks the number of histograms in a workspace
   bool checkWorkspaceNumberOfHistograms(QString const &workspaceName,
                                         std::size_t const &validSize);
-  bool checkWorkspaceNumberOfHistograms(Mantid::API::MatrixWorkspace_sptr,
-                                        std::size_t const &validSize);
+  bool
+  checkWorkspaceNumberOfHistograms(const Mantid::API::MatrixWorkspace_sptr &,
+                                   std::size_t const &validSize);
   /// Checks the number of bins in a workspace
   bool checkWorkspaceNumberOfBins(QString const &workspaceName,
                                   std::size_t const &validSize);
-  bool checkWorkspaceNumberOfBins(Mantid::API::MatrixWorkspace_sptr,
+  bool checkWorkspaceNumberOfBins(const Mantid::API::MatrixWorkspace_sptr &,
                                   std::size_t const &validSize);
   /// Checks that a workspace group contains valid matrix workspace's
   bool checkWorkspaceGroupIsValid(QString const &groupName,
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/WorkspacePresenter/WorkspaceTreeWidget.h b/qt/widgets/common/inc/MantidQtWidgets/Common/WorkspacePresenter/WorkspaceTreeWidget.h
index 136d68e6aac..3f744bcbb7a 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/WorkspacePresenter/WorkspaceTreeWidget.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/WorkspacePresenter/WorkspaceTreeWidget.h
@@ -131,7 +131,8 @@ public:
 
 private:
   bool hasUBMatrix(const std::string &wsName);
-  void addSaveMenuOption(QString algorithmString, QString menuEntryName = "");
+  void addSaveMenuOption(const QString &algorithmString,
+                         QString menuEntryName = "");
   void setTreeUpdating(const bool state);
   inline bool isTreeUpdating() const { return m_treeUpdating; }
   void updateTree(const TopLevelItems &items) override;
@@ -140,7 +141,7 @@ private:
   MantidTreeWidgetItem *
   addTreeEntry(const std::pair<std::string, Mantid::API::Workspace_sptr> &item,
                QTreeWidgetItem *parent = nullptr);
-  bool shouldBeSelected(QString name) const;
+  bool shouldBeSelected(const QString &name) const;
   void createWorkspaceMenuActions();
   void createSortMenuActions();
   void setItemIcon(QTreeWidgetItem *item, const std::string &wsID);
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/WorkspaceSelector.h b/qt/widgets/common/inc/MantidQtWidgets/Common/WorkspaceSelector.h
index a59a49342da..e01677133bd 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/WorkspaceSelector.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/WorkspaceSelector.h
@@ -94,9 +94,9 @@ private:
   handleReplaceEvent(Mantid::API::WorkspaceAfterReplaceNotification_ptr pNf);
 
   bool checkEligibility(const QString &name,
-                        Mantid::API::Workspace_sptr object) const;
+                        const Mantid::API::Workspace_sptr &object) const;
   bool hasValidSuffix(const QString &name) const;
-  bool hasValidNumberOfBins(Mantid::API::Workspace_sptr object) const;
+  bool hasValidNumberOfBins(const Mantid::API::Workspace_sptr &object) const;
 
 protected:
   // Method for handling drop events
diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/pqHelpWindow.h b/qt/widgets/common/inc/MantidQtWidgets/Common/pqHelpWindow.h
index 3ad5450c291..e3ae6d05ee2 100644
--- a/qt/widgets/common/inc/MantidQtWidgets/Common/pqHelpWindow.h
+++ b/qt/widgets/common/inc/MantidQtWidgets/Common/pqHelpWindow.h
@@ -78,7 +78,7 @@ class EXPORT_OPT_MANTIDQT_COMMON pqHelpWindow : public QMainWindow {
 
 public:
   pqHelpWindow(QHelpEngine *engine, QWidget *parent = nullptr,
-               Qt::WindowFlags flags = nullptr);
+               const Qt::WindowFlags &flags = nullptr);
 
 public slots:
   /// Requests showing of a particular page. The url must begin with "qthelp:"
diff --git a/qt/widgets/common/src/AlgorithmDialog.cpp b/qt/widgets/common/src/AlgorithmDialog.cpp
index a7f2c0c8ae4..9a29351738b 100644
--- a/qt/widgets/common/src/AlgorithmDialog.cpp
+++ b/qt/widgets/common/src/AlgorithmDialog.cpp
@@ -180,7 +180,7 @@ void AlgorithmDialog::saveInput() {
  * Set the algorithm pointer
  * @param alg :: A pointer to the algorithm
  */
-void AlgorithmDialog::setAlgorithm(Mantid::API::IAlgorithm_sptr alg) {
+void AlgorithmDialog::setAlgorithm(const Mantid::API::IAlgorithm_sptr &alg) {
   m_algorithm = alg;
   m_algName = QString::fromStdString(alg->name());
   m_algProperties.clear();
@@ -330,7 +330,7 @@ void AlgorithmDialog::showValidators() {
  * end.
  * @return true if the property is valid.
  */
-bool AlgorithmDialog::setPropertyValue(const QString pName,
+bool AlgorithmDialog::setPropertyValue(const QString &pName,
                                        bool validateOthers) {
   // Mantid::Kernel::Property *p = getAlgorithmProperty(pName);
   QString value = getInputValue(pName);
diff --git a/qt/widgets/common/src/AlgorithmHistoryWindow.cpp b/qt/widgets/common/src/AlgorithmHistoryWindow.cpp
index cbc796ec461..c6308d8aab9 100644
--- a/qt/widgets/common/src/AlgorithmHistoryWindow.cpp
+++ b/qt/widgets/common/src/AlgorithmHistoryWindow.cpp
@@ -60,7 +60,7 @@ AlgExecSummaryGrpBox::AlgExecSummaryGrpBox(QWidget *w)
     : QGroupBox(w), m_execDurationlabel(nullptr), m_execDurationEdit(nullptr),
       m_Datelabel(nullptr), m_execDateTimeEdit(nullptr), m_algexecDuration() {}
 
-AlgExecSummaryGrpBox::AlgExecSummaryGrpBox(QString title, QWidget *w)
+AlgExecSummaryGrpBox::AlgExecSummaryGrpBox(const QString &title, QWidget *w)
     : QGroupBox(title, w), m_execDurationlabel(nullptr),
       m_execDurationEdit(nullptr), m_Datelabel(nullptr),
       m_execDateTimeEdit(nullptr), m_algexecDuration() {
@@ -135,7 +135,7 @@ AlgEnvHistoryGrpBox::AlgEnvHistoryGrpBox(QWidget *w)
       m_osVersionLabel(nullptr), m_osVersionEdit(nullptr),
       m_frmworkVersionLabel(nullptr), m_frmwkVersnEdit(nullptr) {}
 
-AlgEnvHistoryGrpBox::AlgEnvHistoryGrpBox(QString title, QWidget *w)
+AlgEnvHistoryGrpBox::AlgEnvHistoryGrpBox(const QString &title, QWidget *w)
     : QGroupBox(title, w), m_osNameLabel(nullptr), m_osNameEdit(nullptr),
       m_osVersionLabel(nullptr), m_osVersionEdit(nullptr),
       m_frmworkVersionLabel(nullptr), m_frmwkVersnEdit(nullptr) {
@@ -202,7 +202,7 @@ AlgEnvHistoryGrpBox::~AlgEnvHistoryGrpBox() {
 }
 
 AlgorithmHistoryWindow::AlgorithmHistoryWindow(
-    QWidget *parent, const boost::shared_ptr<const Workspace> wsptr)
+    QWidget *parent, const boost::shared_ptr<const Workspace> &wsptr)
     : QDialog(parent), m_algHist(wsptr->getHistory()),
       m_histPropWindow(nullptr), m_execSumGrpBox(nullptr),
       m_envHistGrpBox(nullptr), m_wsName(wsptr->getName().c_str()),
@@ -464,13 +464,13 @@ void AlgEnvHistoryGrpBox::fillEnvHistoryGroupBox(
 }
 
 void AlgorithmHistoryWindow::updateAll(
-    Mantid::API::AlgorithmHistory_const_sptr algHistory) {
+    const Mantid::API::AlgorithmHistory_const_sptr &algHistory) {
   updateAlgHistoryProperties(algHistory);
   updateExecSummaryGrpBox(algHistory);
 }
 
 void AlgorithmHistoryWindow::updateAlgHistoryProperties(
-    AlgorithmHistory_const_sptr algHistory) {
+    const AlgorithmHistory_const_sptr &algHistory) {
   PropertyHistories histProp = algHistory->getProperties();
   if (m_histPropWindow) {
     m_histPropWindow->setAlgProperties(histProp);
@@ -480,7 +480,7 @@ void AlgorithmHistoryWindow::updateAlgHistoryProperties(
 }
 
 void AlgorithmHistoryWindow::updateExecSummaryGrpBox(
-    AlgorithmHistory_const_sptr algHistory) {
+    const AlgorithmHistory_const_sptr &algHistory) {
   // getting the selected algorithm at pos from History vector
   double duration = algHistory->executionDuration();
   Mantid::Types::Core::DateAndTime date = algHistory->executionDate();
@@ -766,7 +766,8 @@ void AlgHistoryTreeWidget::populateAlgHistoryTreeWidget(
 }
 
 void AlgHistoryTreeWidget::populateNestedHistory(
-    AlgHistoryItem *parentWidget, Mantid::API::AlgorithmHistory_sptr history) {
+    AlgHistoryItem *parentWidget,
+    const Mantid::API::AlgorithmHistory_sptr &history) {
   const Mantid::API::AlgorithmHistories &entries = history->getChildHistories();
   if (history->childHistorySize() > 0) {
     parentWidget->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsSelectable |
diff --git a/qt/widgets/common/src/AlgorithmInputHistory.cpp b/qt/widgets/common/src/AlgorithmInputHistory.cpp
index 9ed41fb910c..84228b2ae6e 100644
--- a/qt/widgets/common/src/AlgorithmInputHistory.cpp
+++ b/qt/widgets/common/src/AlgorithmInputHistory.cpp
@@ -12,6 +12,7 @@
 
 #include <QSettings>
 #include <QStringList>
+#include <utility>
 
 using namespace MantidQt::API;
 
@@ -23,9 +24,9 @@ using namespace MantidQt::API;
  * Constructor
  */
 AbstractAlgorithmInputHistory::AbstractAlgorithmInputHistory(
-    QString settingsGroup)
-    : m_lastInput(), m_previousDirectory(""), m_algorithmsGroup(settingsGroup),
-      m_dirKey("LastDirectory") {
+    const QString &settingsGroup)
+    : m_lastInput(), m_previousDirectory(""),
+      m_algorithmsGroup(std::move(settingsGroup)), m_dirKey("LastDirectory") {
   // Fill the stored map from the QSettings information
   load();
 }
diff --git a/qt/widgets/common/src/AlgorithmPropertiesWidget.cpp b/qt/widgets/common/src/AlgorithmPropertiesWidget.cpp
index 6c51bf9ae46..ffb6d372ccf 100644
--- a/qt/widgets/common/src/AlgorithmPropertiesWidget.cpp
+++ b/qt/widgets/common/src/AlgorithmPropertiesWidget.cpp
@@ -23,6 +23,8 @@
 #include <QScrollArea>
 
 #include <algorithm>
+#include <utility>
+
 #include <vector>
 
 using namespace Mantid::Kernel;
@@ -98,7 +100,7 @@ Mantid::API::IAlgorithm_sptr AlgorithmPropertiesWidget::getAlgorithm() {
  *
  * @param algo :: IAlgorithm bare ptr */
 void AlgorithmPropertiesWidget::setAlgorithm(
-    Mantid::API::IAlgorithm_sptr algo) {
+    const Mantid::API::IAlgorithm_sptr &algo) {
   if (!algo)
     return;
   saveInput();
@@ -118,7 +120,7 @@ QString AlgorithmPropertiesWidget::getAlgorithmName() const {
  * @param name :: The algorithm name*/
 void AlgorithmPropertiesWidget::setAlgorithmName(QString name) {
   FrameworkManager::Instance();
-  m_algoName = name;
+  m_algoName = std::move(name);
   try {
     Algorithm_sptr alg =
         AlgorithmManager::Instance().createUnmanaged(m_algoName.toStdString());
diff --git a/qt/widgets/common/src/Batch/RowLocation.cpp b/qt/widgets/common/src/Batch/RowLocation.cpp
index 6a1ea542bb9..17a93674670 100644
--- a/qt/widgets/common/src/Batch/RowLocation.cpp
+++ b/qt/widgets/common/src/Batch/RowLocation.cpp
@@ -7,6 +7,7 @@
 #include "MantidQtWidgets/Common/Batch/RowLocation.h"
 #include "MantidQtWidgets/Common/Batch/AssertOrThrow.h"
 #include <boost/algorithm/string/predicate.hpp>
+#include <utility>
 
 #include "MantidQtWidgets/Common/Batch/equal.hpp"
 // equivalent to
@@ -18,7 +19,7 @@ namespace MantidQt {
 namespace MantidWidgets {
 namespace Batch {
 
-RowLocation::RowLocation(RowPath path) : m_path(path) {}
+RowLocation::RowLocation(RowPath path) : m_path(std::move(path)) {}
 RowPath const &RowLocation::path() const { return m_path; }
 int RowLocation::rowRelativeToParent() const { return m_path.back(); }
 bool RowLocation::isRoot() const { return m_path.empty(); }
diff --git a/qt/widgets/common/src/BatchAlgorithmRunner.cpp b/qt/widgets/common/src/BatchAlgorithmRunner.cpp
index 28b47469e2f..a7aea0cff7e 100644
--- a/qt/widgets/common/src/BatchAlgorithmRunner.cpp
+++ b/qt/widgets/common/src/BatchAlgorithmRunner.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidQtWidgets/Common/BatchAlgorithmRunner.h"
 
 #include "MantidAPI/AlgorithmManager.h"
@@ -20,7 +22,7 @@ namespace API {
 
 ConfiguredAlgorithm::ConfiguredAlgorithm(Mantid::API::IAlgorithm_sptr algorithm,
                                          AlgorithmRuntimeProps properties)
-    : m_algorithm(algorithm), m_properties(std::move(properties)) {}
+    : m_algorithm(std::move(algorithm)), m_properties(std::move(properties)) {}
 
 ConfiguredAlgorithm::~ConfiguredAlgorithm() {}
 
@@ -82,8 +84,8 @@ void BatchAlgorithmRunner::stopOnFailure(bool stopOnFailure) {
  * @param props Optional map of property name to property values to be set just
  *before execution (mainly intended for input and inout workspace names)
  */
-void BatchAlgorithmRunner::addAlgorithm(IAlgorithm_sptr algo,
-                                        AlgorithmRuntimeProps props) {
+void BatchAlgorithmRunner::addAlgorithm(const IAlgorithm_sptr &algo,
+                                        const AlgorithmRuntimeProps &props) {
   m_algorithms.emplace_back(std::make_unique<ConfiguredAlgorithm>(algo, props));
 
   g_log.debug() << "Added algorithm \""
@@ -216,7 +218,8 @@ bool BatchAlgorithmRunner::executeBatchAsyncImpl(
  * @param algorithm Algorithm and properties to assign to it
  * @return False if algorithm execution failed
  */
-bool BatchAlgorithmRunner::executeAlgo(IConfiguredAlgorithm_sptr algorithm) {
+bool BatchAlgorithmRunner::executeAlgo(
+    const IConfiguredAlgorithm_sptr &algorithm) {
   try {
     m_currentAlgorithm = algorithm->algorithm();
 
diff --git a/qt/widgets/common/src/CatalogSearch.cpp b/qt/widgets/common/src/CatalogSearch.cpp
index 7ac9b3a457d..e7e59c70eb2 100644
--- a/qt/widgets/common/src/CatalogSearch.cpp
+++ b/qt/widgets/common/src/CatalogSearch.cpp
@@ -576,7 +576,7 @@ bool CatalogSearch::validateDates() {
   return ret;
 }
 
-void CatalogSearch::correctedToolTip(std::string text, QLabel *label) {
+void CatalogSearch::correctedToolTip(const std::string &text, QLabel *label) {
 #ifdef Q_OS_WIN
   label->setToolTip(QString::fromStdString("<span style=\"color: black;\">" +
                                            text + "</span>"));
@@ -1121,7 +1121,7 @@ void CatalogSearch::updateDataFileLabels(QTableWidgetItem *item) {
  * @return A set containing all file extensions.
  */
 std::unordered_set<std::string>
-CatalogSearch::getDataFileExtensions(Mantid::API::Column_sptr column) {
+CatalogSearch::getDataFileExtensions(const Mantid::API::Column_sptr &column) {
   std::unordered_set<std::string> extensions;
 
   // For every filename in the column...
diff --git a/qt/widgets/common/src/ConvolutionFunctionModel.cpp b/qt/widgets/common/src/ConvolutionFunctionModel.cpp
index 1caaf25bd7e..b67f48c0105 100644
--- a/qt/widgets/common/src/ConvolutionFunctionModel.cpp
+++ b/qt/widgets/common/src/ConvolutionFunctionModel.cpp
@@ -12,6 +12,7 @@
 #include "MantidKernel/Logger.h"
 #include "MantidQtWidgets/Common/FunctionBrowser/FunctionBrowserUtils.h"
 #include <iostream>
+#include <utility>
 
 namespace {
 Mantid::Kernel::Logger g_log("ConvolutionFunctionModel");
@@ -112,7 +113,7 @@ void ConvolutionFunctionModel::setModel(
 
 CompositeFunction_sptr
 ConvolutionFunctionModel::addBackground(CompositeFunction_sptr domainFunction,
-                                        std::string background) {
+                                        const std::string &background) {
   if (background.empty())
     return domainFunction;
 
@@ -126,7 +127,7 @@ ConvolutionFunctionModel::addBackground(CompositeFunction_sptr domainFunction,
 }
 
 CompositeFunction_sptr ConvolutionFunctionModel::createInnerFunction(
-    std::string peaksFunction, bool hasDeltaFunction, bool isQDependent,
+    const std::string &peaksFunction, bool hasDeltaFunction, bool isQDependent,
     double qValue, bool hasTempCorrection, double tempValue) {
   auto functionSpecified = !peaksFunction.empty();
   CompositeFunction_sptr innerFunction =
@@ -169,7 +170,7 @@ CompositeFunction_sptr ConvolutionFunctionModel::createInnerFunction(
 }
 
 CompositeFunction_sptr ConvolutionFunctionModel::addTempCorrection(
-    CompositeFunction_sptr peaksFunction, double tempValue) {
+    const CompositeFunction_sptr &peaksFunction, double tempValue) {
   CompositeFunction_sptr productFunction =
       boost::dynamic_pointer_cast<CompositeFunction>(
           FunctionFactory::Instance().createFunction("ProductFunction"));
@@ -194,11 +195,11 @@ ConvolutionFunctionModel::createTemperatureCorrection(double correction) {
 }
 
 CompositeFunction_sptr ConvolutionFunctionModel::createConvolutionFunction(
-    IFunction_sptr resolutionFunction, IFunction_sptr innerFunction) {
+    IFunction_sptr resolutionFunction, const IFunction_sptr &innerFunction) {
   CompositeFunction_sptr convolution =
       boost::dynamic_pointer_cast<CompositeFunction>(
           FunctionFactory::Instance().createFunction("Convolution"));
-  convolution->addFunction(resolutionFunction);
+  convolution->addFunction(std::move(resolutionFunction));
 
   if (innerFunction->nFunctions() > 0)
     convolution->addFunction(innerFunction);
@@ -206,9 +207,8 @@ CompositeFunction_sptr ConvolutionFunctionModel::createConvolutionFunction(
   return convolution;
 }
 
-IFunction_sptr
-ConvolutionFunctionModel::createResolutionFunction(std::string workspaceName,
-                                                   int workspaceIndex) {
+IFunction_sptr ConvolutionFunctionModel::createResolutionFunction(
+    const std::string &workspaceName, int workspaceIndex) {
   std::string resolution =
       workspaceName.empty()
           ? "name=Resolution"
diff --git a/qt/widgets/common/src/DataProcessorUI/AbstractTreeModel.cpp b/qt/widgets/common/src/DataProcessorUI/AbstractTreeModel.cpp
index 2d8eae3ddd6..f5ea73451f7 100644
--- a/qt/widgets/common/src/DataProcessorUI/AbstractTreeModel.cpp
+++ b/qt/widgets/common/src/DataProcessorUI/AbstractTreeModel.cpp
@@ -4,9 +4,11 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidQtWidgets/Common/DataProcessorUI/AbstractTreeModel.h"
+#include <utility>
+
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/TableRow.h"
+#include "MantidQtWidgets/Common/DataProcessorUI/AbstractTreeModel.h"
 
 namespace MantidQt {
 namespace MantidWidgets {
@@ -21,7 +23,7 @@ using namespace Mantid::API;
  */
 AbstractTreeModel::AbstractTreeModel(ITableWorkspace_sptr tableWorkspace,
                                      const WhiteList &whitelist)
-    : m_tWS(tableWorkspace), m_whitelist(whitelist) {}
+    : m_tWS(std::move(tableWorkspace)), m_whitelist(whitelist) {}
 
 AbstractTreeModel::~AbstractTreeModel() {}
 
diff --git a/qt/widgets/common/src/DataProcessorUI/GenerateNotebook.cpp b/qt/widgets/common/src/DataProcessorUI/GenerateNotebook.cpp
index d7de335e5df..17f11bedd75 100644
--- a/qt/widgets/common/src/DataProcessorUI/GenerateNotebook.cpp
+++ b/qt/widgets/common/src/DataProcessorUI/GenerateNotebook.cpp
@@ -51,9 +51,9 @@ the corresponding hinting line edit in the view
 @returns ipython notebook string
 */
 GenerateNotebook::GenerateNotebook(
-    QString name, QString instrument, WhiteList whitelist,
+    const QString &name, const QString &instrument, WhiteList whitelist,
     std::map<QString, PreprocessingAlgorithm> preprocessMap,
-    ProcessingAlgorithm processor,
+    const ProcessingAlgorithm &processor,
     boost::optional<PostprocessingStep> postprocessingStep,
     ColumnOptionsMap preprocessingOptionsMap)
     : m_wsName(std::move(name)), m_instrument(std::move(instrument)),
@@ -391,7 +391,7 @@ void addProperties(QStringList &algProperties, const Map &optionsMap) {
  second item are the names of the output workspaces.
 */
 QString
-reduceRowString(const RowData_sptr data, const QString &instrument,
+reduceRowString(const RowData_sptr &data, const QString &instrument,
                 const WhiteList &whitelist,
                 const std::map<QString, PreprocessingAlgorithm> &preprocessMap,
                 const ProcessingAlgorithm &processor,
diff --git a/qt/widgets/common/src/DataProcessorUI/GenericDataProcessorPresenter.cpp b/qt/widgets/common/src/DataProcessorUI/GenericDataProcessorPresenter.cpp
index 405d70d0876..dbb8011a087 100644
--- a/qt/widgets/common/src/DataProcessorUI/GenericDataProcessorPresenter.cpp
+++ b/qt/widgets/common/src/DataProcessorUI/GenericDataProcessorPresenter.cpp
@@ -37,6 +37,7 @@
 #include <fstream>
 #include <iterator>
 #include <sstream>
+#include <utility>
 
 using namespace Mantid::API;
 using namespace Mantid::Geometry;
@@ -80,7 +81,7 @@ template <typename T> void pop_front(std::vector<T> &queue) {
 /** Validate the algorithm inputs
  * @return : an error message, or empty string if ok
  */
-std::string validateAlgorithmInputs(IAlgorithm_sptr alg) {
+std::string validateAlgorithmInputs(const IAlgorithm_sptr &alg) {
   std::string error;
   // Get input property errors as a map
   auto errorMap = alg->validateInputs();
@@ -115,8 +116,9 @@ namespace DataProcessor {
 GenericDataProcessorPresenter::GenericDataProcessorPresenter(
     WhiteList whitelist,
     std::map<QString, PreprocessingAlgorithm> preprocessMap,
-    ProcessingAlgorithm processor, PostprocessingAlgorithm postprocessor,
-    int group, std::map<QString, QString> postprocessMap, QString loader)
+    const ProcessingAlgorithm &processor,
+    const PostprocessingAlgorithm &postprocessor, int group,
+    std::map<QString, QString> postprocessMap, const QString &loader)
     : WorkspaceObserver(), m_view(nullptr), m_progressView(nullptr),
       m_mainPresenter(), m_loader(std::move(loader)), m_reductionPaused(true),
       m_postprocessing(postprocessor.name().isEmpty()
@@ -178,8 +180,8 @@ GenericDataProcessorPresenter::GenericDataProcessorPresenter(
  * (reflectometry).
  */
 GenericDataProcessorPresenter::GenericDataProcessorPresenter(
-    WhiteList whitelist, ProcessingAlgorithm processor,
-    PostprocessingAlgorithm postprocessor, int group)
+    WhiteList whitelist, const ProcessingAlgorithm &processor,
+    const PostprocessingAlgorithm &postprocessor, int group)
     : GenericDataProcessorPresenter(
           std::move(whitelist), std::map<QString, PreprocessingAlgorithm>(),
           std::move(processor), std::move(postprocessor), group) {}
@@ -208,7 +210,7 @@ GenericDataProcessorPresenter::GenericDataProcessorPresenter(
 GenericDataProcessorPresenter::GenericDataProcessorPresenter(
     WhiteList whitelist,
     std::map<QString, PreprocessingAlgorithm> preprocessMap,
-    ProcessingAlgorithm processor, int group)
+    const ProcessingAlgorithm &processor, int group)
     : GenericDataProcessorPresenter(
           std::move(whitelist), std::move(preprocessMap), std::move(processor),
           PostprocessingAlgorithm(), group) {}
@@ -222,7 +224,7 @@ GenericDataProcessorPresenter::GenericDataProcessorPresenter(
  * (reflectometry)
  */
 GenericDataProcessorPresenter::GenericDataProcessorPresenter(
-    WhiteList whitelist, ProcessingAlgorithm processor, int group)
+    WhiteList whitelist, const ProcessingAlgorithm &processor, int group)
     : GenericDataProcessorPresenter(
           std::move(whitelist), std::map<QString, PreprocessingAlgorithm>(),
           std::move(processor), PostprocessingAlgorithm(), group) {}
@@ -233,7 +235,7 @@ GenericDataProcessorPresenter::GenericDataProcessorPresenter(
 GenericDataProcessorPresenter::~GenericDataProcessorPresenter() {}
 
 namespace {
-std::vector<std::string> toStdStringVector(std::set<QString> in) {
+std::vector<std::string> toStdStringVector(const std::set<QString> &in) {
   auto out = std::vector<std::string>();
   std::transform(
       in.cbegin(), in.cend(), std::back_inserter(out),
@@ -320,7 +322,7 @@ Returns the name of the reduced workspace for a given row
 @returns : The name of the workspace
 */
 QString GenericDataProcessorPresenter::getReducedWorkspaceName(
-    const RowData_sptr data) const {
+    const RowData_sptr &data) const {
   return MantidQt::MantidWidgets::DataProcessor::getReducedWorkspaceName(
       data, m_whitelist, m_preprocessing.m_map);
 }
@@ -356,13 +358,13 @@ void GenericDataProcessorPresenter::setGroupError(const int groupIndex,
   m_manager->setError(error, groupIndex);
 }
 
-void GenericDataProcessorPresenter::setRowIsProcessed(RowData_sptr rowData,
-                                                      const bool isProcessed) {
+void GenericDataProcessorPresenter::setRowIsProcessed(
+    const RowData_sptr &rowData, const bool isProcessed) {
   if (rowData)
     rowData->setProcessed(isProcessed);
 }
 
-void GenericDataProcessorPresenter::setRowError(RowData_sptr rowData,
+void GenericDataProcessorPresenter::setRowError(const RowData_sptr &rowData,
                                                 const std::string &error) {
   if (rowData)
     rowData->setError(error);
@@ -439,7 +441,7 @@ bool GenericDataProcessorPresenter::workspaceIsOutputOfGroup(
 }
 
 bool GenericDataProcessorPresenter::workspaceIsOutputOfRow(
-    RowData_sptr rowData, const std::string &workspaceName) const {
+    const RowData_sptr &rowData, const std::string &workspaceName) const {
   if (!rowData)
     return false;
 
@@ -458,7 +460,8 @@ void GenericDataProcessorPresenter::resetProcessedState(const int groupIndex) {
 
 /** Reset the processed state for a row
  */
-void GenericDataProcessorPresenter::resetProcessedState(RowData_sptr rowData) {
+void GenericDataProcessorPresenter::resetProcessedState(
+    const RowData_sptr &rowData) {
   rowData->reset();
 }
 
@@ -505,7 +508,8 @@ void GenericDataProcessorPresenter::resetProcessedState() {
  * @param rowData [inout] : the data to initialise
  * @return : true if ok, false if there was a problem
  */
-bool GenericDataProcessorPresenter::initRowForProcessing(RowData_sptr rowData) {
+bool GenericDataProcessorPresenter::initRowForProcessing(
+    const RowData_sptr &rowData) {
   // Reset the row to its unprocessed state
   rowData->reset();
 
@@ -575,7 +579,7 @@ bool GenericDataProcessorPresenter::groupNeedsProcessing(
 /** Check whether a row should be processed
  */
 bool GenericDataProcessorPresenter::rowNeedsProcessing(
-    RowData_sptr rowData) const {
+    const RowData_sptr &rowData) const {
   if (m_forceProcessing)
     return true;
 
@@ -591,7 +595,7 @@ bool GenericDataProcessorPresenter::rowNeedsProcessing(
 /** Process a given set of items
  */
 void GenericDataProcessorPresenter::process(TreeData itemsToProcess) {
-  m_itemsToProcess = itemsToProcess;
+  m_itemsToProcess = std::move(itemsToProcess);
 
   // Emit a signal that the process is starting
   m_view->emitProcessClicked();
@@ -707,7 +711,7 @@ void GenericDataProcessorPresenter::startAsyncRowReduceThread(
     RowData_sptr rowData, const int rowIndex, const int groupIndex) {
 
   auto *worker = new GenericDataProcessorPresenterRowReducerWorker(
-      this, rowData, rowIndex, groupIndex);
+      this, std::move(rowData), rowIndex, groupIndex);
 
   connect(worker, SIGNAL(finished(int)), this, SLOT(rowThreadFinished(int)));
   connect(worker, SIGNAL(reductionErrorSignal(QString)), this,
@@ -960,7 +964,8 @@ QString GenericDataProcessorPresenter::getPostprocessedWorkspaceName(
   if (!hasPostprocessing())
     throw std::runtime_error("Attempted to get postprocessing workspace but no "
                              "postprocessing is specified.");
-  return m_postprocessing->getPostprocessedWorkspaceName(groupData, sliceIndex);
+  return m_postprocessing->getPostprocessedWorkspaceName(groupData,
+                                                         std::move(sliceIndex));
 }
 
 /** Loads a run found from disk or AnalysisDataService
@@ -1089,7 +1094,7 @@ GenericDataProcessorPresenter::createProcessingAlgorithm() const {
  * @param data [in] :: the data in the row
  */
 void GenericDataProcessorPresenter::preprocessColumnValue(
-    const QString &columnName, QString &columnValue, RowData_sptr data) {
+    const QString &columnName, QString &columnValue, const RowData_sptr &data) {
   // Check if preprocessing is required for this column
   if (!m_preprocessing.hasPreprocessing(columnName))
     return;
@@ -1099,7 +1104,8 @@ void GenericDataProcessorPresenter::preprocessColumnValue(
   OptionsMap options;
   if (m_preprocessing.hasOptions(columnName)) {
     auto globalOptions = m_preprocessing.m_options.at(columnName);
-    options = getCanonicalOptions(data, globalOptions, m_whitelist, false);
+    options =
+        getCanonicalOptions(std::move(data), globalOptions, m_whitelist, false);
   }
 
   // Run the preprocessing algorithm
@@ -1112,7 +1118,8 @@ void GenericDataProcessorPresenter::preprocessColumnValue(
 /** Perform preprocessing on algorithm property values where applicable
  * @param data : the data in the row
  */
-void GenericDataProcessorPresenter::preprocessOptionValues(RowData_sptr data) {
+void GenericDataProcessorPresenter::preprocessOptionValues(
+    const RowData_sptr &data) {
   auto options = data->options();
   // Loop through all columns (excluding the Options and Hidden options
   // columns)
@@ -1137,8 +1144,8 @@ void GenericDataProcessorPresenter::preprocessOptionValues(RowData_sptr data) {
  * @param alg : the executed algorithm
  * @param data : the row data
  */
-void GenericDataProcessorPresenter::updateModelFromResults(IAlgorithm_sptr alg,
-                                                           RowData_sptr data) {
+void GenericDataProcessorPresenter::updateModelFromResults(
+    const IAlgorithm_sptr &alg, const RowData_sptr &data) {
 
   auto newData = data;
 
@@ -1221,7 +1228,7 @@ IAlgorithm_sptr GenericDataProcessorPresenter::createAndRunAlgorithm(
  * correspond to column contents
  * @throws std::runtime_error if reduction fails
  */
-void GenericDataProcessorPresenter::reduceRow(RowData_sptr data) {
+void GenericDataProcessorPresenter::reduceRow(const RowData_sptr &data) {
 
   // Perform any preprocessing on the input properties and cache the results
   // in the row data
diff --git a/qt/widgets/common/src/DataProcessorUI/OneLevelTreeManager.cpp b/qt/widgets/common/src/DataProcessorUI/OneLevelTreeManager.cpp
index 03694d1dfeb..5218be72ac0 100644
--- a/qt/widgets/common/src/DataProcessorUI/OneLevelTreeManager.cpp
+++ b/qt/widgets/common/src/DataProcessorUI/OneLevelTreeManager.cpp
@@ -30,6 +30,7 @@
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/join.hpp>
 #include <boost/algorithm/string/split.hpp>
+#include <utility>
 
 using namespace Mantid::API;
 using namespace Mantid::Kernel;
@@ -46,10 +47,10 @@ namespace DataProcessor {
  * @param whitelist :: a whitelist
  */
 OneLevelTreeManager::OneLevelTreeManager(
-    DataProcessorPresenter *presenter, Mantid::API::ITableWorkspace_sptr table,
-    const WhiteList &whitelist)
+    DataProcessorPresenter *presenter,
+    const Mantid::API::ITableWorkspace_sptr &table, const WhiteList &whitelist)
     : m_presenter(presenter),
-      m_model(new QOneLevelTreeModel(table, whitelist)) {}
+      m_model(new QOneLevelTreeModel(std::move(table), whitelist)) {}
 
 /**
  * Constructor (no table workspace given)
@@ -323,7 +324,7 @@ std::set<int> OneLevelTreeManager::getRowsToProcess(bool shouldPrompt) const {
  * @return :: All data as a map where keys are units of post-processing (i.e.
  * group indices) and values are a map of row index in the group to row data
  */
-TreeData OneLevelTreeManager::constructTreeData(std::set<int> rows) {
+TreeData OneLevelTreeManager::constructTreeData(const std::set<int> &rows) {
 
   // Return data in the format: map<int, set<RowData_sptr>>, where:
   // int -> row index
@@ -525,7 +526,7 @@ OneLevelTreeManager::createDefaultWorkspace(const WhiteList &whitelist) {
  * @param ws :: the table workspace
  * @param whitelistColumns :: the number of columns as specified in a whitelist
  */
-void OneLevelTreeManager::validateModel(ITableWorkspace_sptr ws,
+void OneLevelTreeManager::validateModel(const ITableWorkspace_sptr &ws,
                                         size_t whitelistColumns) const {
 
   if (!ws)
diff --git a/qt/widgets/common/src/DataProcessorUI/PostprocessingStep.cpp b/qt/widgets/common/src/DataProcessorUI/PostprocessingStep.cpp
index 5a101cb911c..eb731cdc8e4 100644
--- a/qt/widgets/common/src/DataProcessorUI/PostprocessingStep.cpp
+++ b/qt/widgets/common/src/DataProcessorUI/PostprocessingStep.cpp
@@ -10,10 +10,10 @@
 namespace MantidQt {
 namespace MantidWidgets {
 namespace DataProcessor {
-PostprocessingStep::PostprocessingStep(QString options)
+PostprocessingStep::PostprocessingStep(const QString &options)
     : m_options(std::move(options)) {}
-PostprocessingStep::PostprocessingStep(QString options,
-                                       PostprocessingAlgorithm algorithm,
+PostprocessingStep::PostprocessingStep(const QString &options,
+                                       const PostprocessingAlgorithm &algorithm,
                                        std::map<QString, QString> map)
     : m_options(std::move(options)), m_algorithm(std::move(algorithm)),
       m_map(std::move(map)) {}
diff --git a/qt/widgets/common/src/DataProcessorUI/PreprocessingAlgorithm.cpp b/qt/widgets/common/src/DataProcessorUI/PreprocessingAlgorithm.cpp
index 3ec222ce2dc..b17a8ca3bb3 100644
--- a/qt/widgets/common/src/DataProcessorUI/PreprocessingAlgorithm.cpp
+++ b/qt/widgets/common/src/DataProcessorUI/PreprocessingAlgorithm.cpp
@@ -18,9 +18,9 @@ namespace DataProcessor {
  * @param blacklist : The list of properties we don't want to show
  * algorithm in the processed workspace's name
  */
-PreprocessingAlgorithm::PreprocessingAlgorithm(QString name, QString prefix,
-                                               QString separator,
-                                               std::set<QString> blacklist)
+PreprocessingAlgorithm::PreprocessingAlgorithm(
+    const QString &name, const QString &prefix, const QString &separator,
+    const std::set<QString> &blacklist)
     : ProcessingAlgorithmBase(std::move(name), std::move(blacklist)),
       m_prefix(std::move(prefix)), m_separator(std::move(separator)) {
 
@@ -53,8 +53,9 @@ PreprocessingAlgorithm::PreprocessingAlgorithm(QString name, QString prefix,
  * @param blacklist : The list of properties we don't want to show, as a string
  * algorithm in the processed workspace's name
  */
-PreprocessingAlgorithm::PreprocessingAlgorithm(QString name, QString prefix,
-                                               QString separator,
+PreprocessingAlgorithm::PreprocessingAlgorithm(const QString &name,
+                                               const QString &prefix,
+                                               const QString &separator,
                                                const QString &blacklist)
     : PreprocessingAlgorithm(std::move(name), std::move(prefix),
                              std::move(separator),
diff --git a/qt/widgets/common/src/DataProcessorUI/ProcessingAlgorithm.cpp b/qt/widgets/common/src/DataProcessorUI/ProcessingAlgorithm.cpp
index b470b1bfbb9..186423fd860 100644
--- a/qt/widgets/common/src/DataProcessorUI/ProcessingAlgorithm.cpp
+++ b/qt/widgets/common/src/DataProcessorUI/ProcessingAlgorithm.cpp
@@ -21,9 +21,9 @@ namespace DataProcessor {
  * indicate the most recent version.
  */
 ProcessingAlgorithm::ProcessingAlgorithm(
-    QString name, std::vector<QString> prefix,
-    std::size_t postprocessedOutputPrefixIndex, std::set<QString> blacklist,
-    const int version)
+    const QString &name, std::vector<QString> prefix,
+    std::size_t postprocessedOutputPrefixIndex,
+    const std::set<QString> &blacklist, const int version)
     : ProcessingAlgorithmBase(std::move(name), std::move(blacklist), version),
       m_postprocessedOutputPrefixIndex(postprocessedOutputPrefixIndex),
       m_prefix(std::move(prefix)) {
@@ -63,7 +63,7 @@ ProcessingAlgorithm::ProcessingAlgorithm(
  * indicate the most recent version.
  */
 ProcessingAlgorithm::ProcessingAlgorithm(
-    QString name, QString const &prefix,
+    const QString &name, QString const &prefix,
     std::size_t postprocessedOutputPrefixIndex, QString const &blacklist,
     const int version)
     : ProcessingAlgorithm(std::move(name), convertStringToVector(prefix),
diff --git a/qt/widgets/common/src/DataProcessorUI/QOneLevelTreeModel.cpp b/qt/widgets/common/src/DataProcessorUI/QOneLevelTreeModel.cpp
index d8b577cc69e..8e417ba67f6 100644
--- a/qt/widgets/common/src/DataProcessorUI/QOneLevelTreeModel.cpp
+++ b/qt/widgets/common/src/DataProcessorUI/QOneLevelTreeModel.cpp
@@ -19,8 +19,8 @@ using namespace Mantid::API;
 @param tableWorkspace : The table workspace to wrap
 @param whitelist : A WhiteList containing the columns
 */
-QOneLevelTreeModel::QOneLevelTreeModel(ITableWorkspace_sptr tableWorkspace,
-                                       const WhiteList &whitelist)
+QOneLevelTreeModel::QOneLevelTreeModel(
+    const ITableWorkspace_sptr &tableWorkspace, const WhiteList &whitelist)
     : AbstractTreeModel(tableWorkspace, whitelist) {
 
   if (tableWorkspace->columnCount() != m_whitelist.size())
diff --git a/qt/widgets/common/src/DataProcessorUI/QTwoLevelTreeModel.cpp b/qt/widgets/common/src/DataProcessorUI/QTwoLevelTreeModel.cpp
index 57a1a326097..7f6e3707c40 100644
--- a/qt/widgets/common/src/DataProcessorUI/QTwoLevelTreeModel.cpp
+++ b/qt/widgets/common/src/DataProcessorUI/QTwoLevelTreeModel.cpp
@@ -25,7 +25,7 @@ public:
       : m_absoluteIndex(absoluteIndex),
         m_rowData(std::make_shared<RowData>(columnCount)) {}
   // Constructor taking a list of data values
-  RowInfo(const size_t absoluteIndex, QStringList rowDataValues)
+  RowInfo(const size_t absoluteIndex, const QStringList &rowDataValues)
       : m_absoluteIndex(absoluteIndex),
         m_rowData(std::make_shared<RowData>(std::move(rowDataValues))) {}
 
@@ -174,8 +174,8 @@ private:
 @param whitelist : A WhiteList containing information about the
 columns, their indices and descriptions
 */
-QTwoLevelTreeModel::QTwoLevelTreeModel(ITableWorkspace_sptr tableWorkspace,
-                                       const WhiteList &whitelist)
+QTwoLevelTreeModel::QTwoLevelTreeModel(
+    const ITableWorkspace_sptr &tableWorkspace, const WhiteList &whitelist)
     : AbstractTreeModel(tableWorkspace, whitelist) {
 
   if (tableWorkspace->columnCount() != m_whitelist.size() + 1)
@@ -786,7 +786,7 @@ bool QTwoLevelTreeModel::setData(const QModelIndex &index,
  * whitelist
  * @param table : A table workspace containing the data
  */
-void QTwoLevelTreeModel::setupModelData(ITableWorkspace_sptr table) {
+void QTwoLevelTreeModel::setupModelData(const ITableWorkspace_sptr &table) {
 
   int nrows = static_cast<int>(table->rowCount());
 
diff --git a/qt/widgets/common/src/DataProcessorUI/TreeData.cpp b/qt/widgets/common/src/DataProcessorUI/TreeData.cpp
index 566c778c3e3..16aa102ccad 100644
--- a/qt/widgets/common/src/DataProcessorUI/TreeData.cpp
+++ b/qt/widgets/common/src/DataProcessorUI/TreeData.cpp
@@ -18,7 +18,7 @@ RowData::RowData(const int columnCount) : m_isProcessed{false} {
     m_data.append("");
 }
 
-RowData::RowData(QStringList data)
+RowData::RowData(const QStringList &data)
     : m_data(std::move(data)), m_isProcessed{false} {}
 
 RowData::RowData(const std::vector<std::string> &data) : m_isProcessed{false} {
@@ -311,7 +311,7 @@ bool RowData::reductionFailed() const {
  * prefixes have been applied for specific output properties.
  * @param prefix [in] : if not empty, apply this prefix to the name
  */
-QString RowData::reducedName(const QString prefix) const {
+QString RowData::reducedName(const QString &prefix) const {
   if (prefix.isEmpty())
     return m_reducedName;
   else
diff --git a/qt/widgets/common/src/DataProcessorUI/TwoLevelTreeManager.cpp b/qt/widgets/common/src/DataProcessorUI/TwoLevelTreeManager.cpp
index 64d2b5e8864..c78a17311e0 100644
--- a/qt/widgets/common/src/DataProcessorUI/TwoLevelTreeManager.cpp
+++ b/qt/widgets/common/src/DataProcessorUI/TwoLevelTreeManager.cpp
@@ -39,6 +39,7 @@
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/join.hpp>
 #include <boost/algorithm/string/split.hpp>
+#include <utility>
 
 using namespace Mantid::API;
 using namespace Mantid::Kernel;
@@ -55,10 +56,10 @@ namespace DataProcessor {
  * @param whitelist :: a whitelist
  */
 TwoLevelTreeManager::TwoLevelTreeManager(
-    DataProcessorPresenter *presenter, Mantid::API::ITableWorkspace_sptr table,
-    const WhiteList &whitelist)
+    DataProcessorPresenter *presenter,
+    const Mantid::API::ITableWorkspace_sptr &table, const WhiteList &whitelist)
     : m_presenter(presenter),
-      m_model(new QTwoLevelTreeModel(table, whitelist)) {}
+      m_model(new QTwoLevelTreeModel(std::move(table), whitelist)) {}
 
 /**
  * Constructor (no table workspace given)
@@ -446,7 +447,7 @@ int TwoLevelTreeManager::numRowsInGroup(int group) const {
  * @return :: All data as a map where keys are units of post-processing (i.e.
  * group indices) and values are a map of row index in the group to row data
  */
-TreeData TwoLevelTreeManager::constructTreeData(ChildItems rows) {
+TreeData TwoLevelTreeManager::constructTreeData(const ChildItems &rows) {
   TreeData tree;
   const int columnNotUsed = 0; // dummy value required to create index
   // Return row data in the format: map<int, set<vector<string>>>, where:
@@ -722,7 +723,7 @@ TwoLevelTreeManager::createDefaultWorkspace(const WhiteList &whitelist) {
  * @param ws :: the table workspace
  * @param whitelistColumns :: the number of columns as specified in a whitelist
  */
-void TwoLevelTreeManager::validateModel(ITableWorkspace_sptr ws,
+void TwoLevelTreeManager::validateModel(const ITableWorkspace_sptr &ws,
                                         size_t whitelistColumns) const {
 
   if (!ws)
diff --git a/qt/widgets/common/src/DataProcessorUI/WorkspaceNameUtils.cpp b/qt/widgets/common/src/DataProcessorUI/WorkspaceNameUtils.cpp
index 88563e9f060..1dff5796842 100644
--- a/qt/widgets/common/src/DataProcessorUI/WorkspaceNameUtils.cpp
+++ b/qt/widgets/common/src/DataProcessorUI/WorkspaceNameUtils.cpp
@@ -27,7 +27,7 @@ namespace { // unnamed namespace
              * @param allowInsertions : if true, allow new keys to be inserted;
              * otherwise, only allow updating of keys that already exist
              */
-void updateRowOptions(OptionsMap &options, const RowData_sptr data,
+void updateRowOptions(OptionsMap &options, const RowData_sptr &data,
                       const WhiteList &whitelist, const bool allowInsertions) {
   // Loop through all columns (excluding the Options and Hidden options
   // columns)
@@ -55,7 +55,7 @@ void updateRowOptions(OptionsMap &options, const RowData_sptr data,
  * @param allowInsertions : if true, allow new keys to be inserted;
  * otherwise, only allow updating of keys that already exist
  */
-void updateUserOptions(OptionsMap &options, const RowData_sptr data,
+void updateUserOptions(OptionsMap &options, const RowData_sptr &data,
                        const WhiteList &whitelist, const bool allowInsertions) {
   auto userOptions =
       parseKeyValueQString(data->value(static_cast<int>(whitelist.size()) - 2));
@@ -72,7 +72,7 @@ void updateUserOptions(OptionsMap &options, const RowData_sptr data,
  * @param allowInsertions : if true, allow new keys to be inserted;
  * otherwise, only allow updating of keys that already exist
  */
-void updateHiddenOptions(OptionsMap &options, const RowData_sptr data,
+void updateHiddenOptions(OptionsMap &options, const RowData_sptr &data,
                          const bool allowInsertions) {
   const auto hiddenOptions = parseKeyValueQString(data->back());
   for (auto &kvp : hiddenOptions) {
@@ -86,7 +86,7 @@ void updateHiddenOptions(OptionsMap &options, const RowData_sptr data,
  * @param options : a map of property name to option value to update
  * @param data : the data for this row
  */
-void updateOutputOptions(OptionsMap &options, const RowData_sptr data,
+void updateOutputOptions(OptionsMap &options, const RowData_sptr &data,
                          const bool allowInsertions,
                          const std::vector<QString> &outputPropertyNames,
                          const std::vector<QString> &outputNamePrefixes) {
@@ -141,7 +141,7 @@ algorithm for that column
 @returns : The name of the workspace
 */
 QString getReducedWorkspaceName(
-    const RowData_sptr data, const WhiteList &whitelist,
+    const RowData_sptr &data, const WhiteList &whitelist,
     const std::map<QString, PreprocessingAlgorithm> &preprocessMap) {
   if (data->size() != static_cast<int>(whitelist.size()))
     throw std::invalid_argument("Can't find reduced workspace name");
@@ -206,7 +206,7 @@ QString getReducedWorkspaceName(
  * names
  * @return : a map of property names to value
  */
-OptionsMap getCanonicalOptions(const RowData_sptr data,
+OptionsMap getCanonicalOptions(const RowData_sptr &data,
                                const OptionsMap &globalOptions,
                                const WhiteList &whitelist,
                                const bool allowInsertions,
diff --git a/qt/widgets/common/src/DiagResults.cpp b/qt/widgets/common/src/DiagResults.cpp
index 66a944e5b7a..90b925690a8 100644
--- a/qt/widgets/common/src/DiagResults.cpp
+++ b/qt/widgets/common/src/DiagResults.cpp
@@ -112,7 +112,8 @@ void DiagResults::updateResults(const QString &testSummary) {
 // Private member functions
 //----------------------
 /// insert a row at the bottom of the grid
-int DiagResults::addRow(QString firstColumn, QString secondColumn) {
+int DiagResults::addRow(const QString &firstColumn,
+                        const QString &secondColumn) {
   // set row to one past the end of the number of rows that currently exist
   int row = m_Grid->rowCount();
   m_Grid->addWidget(new QLabel(firstColumn), row, 0);
@@ -124,7 +125,7 @@ int DiagResults::addRow(QString firstColumn, QString secondColumn) {
  *  @param row :: the row where the data will be displayed
  *  @param text :: the text that should be displayed in the first column
  */
-void DiagResults::updateRow(int row, QString text) {
+void DiagResults::updateRow(int row, const QString &text) {
   // Get the text label from the grid
   QWidget *widget = m_Grid->itemAtPosition(row, 1)->widget();
   QLabel *label = qobject_cast<QLabel *>(widget);
diff --git a/qt/widgets/common/src/DoubleSpinBox.cpp b/qt/widgets/common/src/DoubleSpinBox.cpp
index f215e3c726a..583cdf5a216 100644
--- a/qt/widgets/common/src/DoubleSpinBox.cpp
+++ b/qt/widgets/common/src/DoubleSpinBox.cpp
@@ -115,7 +115,7 @@ void DoubleSpinBox::interpretText(bool notify) {
  * @param text QString with text to map
  * @param value Value to map it to
  */
-void DoubleSpinBox::addSpecialTextMapping(QString text, double value) {
+void DoubleSpinBox::addSpecialTextMapping(const QString &text, double value) {
   m_specialTextMappings[text] = value;
 }
 
diff --git a/qt/widgets/common/src/EditLocalParameterDialog.cpp b/qt/widgets/common/src/EditLocalParameterDialog.cpp
index 226cae763bd..b39f1e02c30 100644
--- a/qt/widgets/common/src/EditLocalParameterDialog.cpp
+++ b/qt/widgets/common/src/EditLocalParameterDialog.cpp
@@ -13,6 +13,7 @@
 #include <QMenu>
 #include <QMessageBox>
 #include <limits>
+#include <utility>
 
 namespace {
 QString makeNumber(double d) { return QString::number(d, 'g', 16); }
@@ -35,8 +36,8 @@ namespace MantidWidgets {
  */
 EditLocalParameterDialog::EditLocalParameterDialog(
     QWidget *parent, const QString &parName, const QStringList &wsNames,
-    QList<double> values, QList<bool> fixes, QStringList ties,
-    QStringList constraints)
+    const QList<double> &values, const QList<bool> &fixes,
+    const QStringList &ties, const QStringList &constraints)
     : MantidDialog(parent), m_parName(parName), m_values(values),
       m_fixes(fixes), m_ties(ties), m_constraints(constraints) {
   assert(values.size() == wsNames.size());
@@ -171,14 +172,14 @@ void EditLocalParameterDialog::fixParameter(int index, bool fix) {
 /// @param index :: Index of a paramter to tie.
 /// @param tie :: A tie string.
 void EditLocalParameterDialog::setTie(int index, QString tie) {
-  m_ties[index] = tie;
+  m_ties[index] = std::move(tie);
   m_fixes[index] = false;
   updateRoleColumn(index);
 }
 
 /// Set the same tie to all parameters.
 /// @param tie :: A tie string.
-void EditLocalParameterDialog::setTieAll(QString tie) {
+void EditLocalParameterDialog::setTieAll(const QString &tie) {
   for (int i = 0; i < m_ties.size(); ++i) {
     m_ties[i] = tie;
     m_fixes[i] = false;
@@ -188,11 +189,11 @@ void EditLocalParameterDialog::setTieAll(QString tie) {
 }
 
 void EditLocalParameterDialog::setConstraint(int index, QString constraint) {
-  m_constraints[index] = constraint;
+  m_constraints[index] = std::move(constraint);
   updateRoleColumn(index);
 }
 
-void EditLocalParameterDialog::setConstraintAll(QString constraint) {
+void EditLocalParameterDialog::setConstraintAll(const QString &constraint) {
   for (int i = 0; i < m_constraints.size(); ++i) {
     m_constraints[i] = constraint;
     updateRoleColumn(i);
diff --git a/qt/widgets/common/src/FileDialogHandler.cpp b/qt/widgets/common/src/FileDialogHandler.cpp
index 8afbe8aef42..aadd30c3cea 100644
--- a/qt/widgets/common/src/FileDialogHandler.cpp
+++ b/qt/widgets/common/src/FileDialogHandler.cpp
@@ -41,7 +41,7 @@ namespace FileDialogHandler {
 */
 QString getSaveFileName(QWidget *parent,
                         const Mantid::Kernel::Property *baseProp,
-                        QFileDialog::Options options) {
+                        const QFileDialog::Options &options) {
   // set up filters and dialog title
   const auto filter = getFilter(baseProp);
   const auto caption = getCaption("Save file", baseProp);
diff --git a/qt/widgets/common/src/FindFilesThreadPoolManager.cpp b/qt/widgets/common/src/FindFilesThreadPoolManager.cpp
index 6fc29255e7c..2f03ba23f97 100644
--- a/qt/widgets/common/src/FindFilesThreadPoolManager.cpp
+++ b/qt/widgets/common/src/FindFilesThreadPoolManager.cpp
@@ -17,6 +17,7 @@
 #include <QCoreApplication>
 #include <QSharedPointer>
 #include <boost/algorithm/string.hpp>
+#include <utility>
 
 using namespace Mantid::Kernel;
 using namespace Mantid::API;
@@ -63,7 +64,7 @@ FindFilesThreadPoolManager::FindFilesThreadPoolManager() {
  * worker objects
  */
 void FindFilesThreadPoolManager::setAllocator(ThreadAllocator allocator) {
-  m_workerAllocator = allocator;
+  m_workerAllocator = std::move(allocator);
 }
 
 void FindFilesThreadPoolManager::createWorker(
diff --git a/qt/widgets/common/src/FitOptionsBrowser.cpp b/qt/widgets/common/src/FitOptionsBrowser.cpp
index c964e6f595d..83b27198101 100644
--- a/qt/widgets/common/src/FitOptionsBrowser.cpp
+++ b/qt/widgets/common/src/FitOptionsBrowser.cpp
@@ -838,7 +838,7 @@ void FitOptionsBrowser::displayProperty(const QString &propertyName,
 /**
  * Adds the property with the given name to a blacklist of properties to hide
  */
-bool FitOptionsBrowser::addPropertyToBlacklist(QString name) {
+bool FitOptionsBrowser::addPropertyToBlacklist(const QString &name) {
   if (!m_propertyNameMap.contains(name)) {
     return false;
   }
diff --git a/qt/widgets/common/src/FitPropertyBrowser.cpp b/qt/widgets/common/src/FitPropertyBrowser.cpp
index 25d268dc758..1d75b9d193c 100644
--- a/qt/widgets/common/src/FitPropertyBrowser.cpp
+++ b/qt/widgets/common/src/FitPropertyBrowser.cpp
@@ -55,6 +55,7 @@
 #include <QVBoxLayout>
 
 #include <algorithm>
+#include <utility>
 
 namespace MantidQt {
 using API::MantidDesktopServices;
@@ -66,7 +67,7 @@ Mantid::Kernel::Logger g_log("FitPropertyBrowser");
 
 using namespace Mantid::API;
 
-int getNumberOfSpectra(MatrixWorkspace_sptr workspace) {
+int getNumberOfSpectra(const MatrixWorkspace_sptr &workspace) {
   return static_cast<int>(workspace->getNumberHistograms());
 }
 
@@ -774,7 +775,7 @@ void FitPropertyBrowser::closeFit() { m_fitSelector->close(); }
  * @param func :: [input] Pointer to function
  */
 void FitPropertyBrowser::createCompositeFunction(
-    const Mantid::API::IFunction_sptr func) {
+    const Mantid::API::IFunction_sptr &func) {
   if (m_compositeFunction) {
     emit functionRemoved();
     m_autoBackground = nullptr;
@@ -1598,8 +1599,8 @@ void FitPropertyBrowser::setCurrentFunction(PropertyHandler *h) const {
  * @param f :: New current function
  */
 void FitPropertyBrowser::setCurrentFunction(
-    Mantid::API::IFunction_const_sptr f) const {
-  setCurrentFunction(getHandler()->findHandler(f));
+    const Mantid::API::IFunction_const_sptr &f) const {
+  setCurrentFunction(getHandler()->findHandler(std::move(f)));
 }
 
 /**
@@ -2716,7 +2717,7 @@ void FitPropertyBrowser::reset() {
 }
 
 void FitPropertyBrowser::setWorkspace(
-    Mantid::API::IFunction_sptr function) const {
+    const Mantid::API::IFunction_sptr &function) const {
   std::string wsName = workspaceName();
   if (!wsName.empty()) {
     try {
@@ -2979,7 +2980,7 @@ bool FitPropertyBrowser::rawData() const {
   return m_boolManager->value(m_rawData);
 }
 
-void FitPropertyBrowser::setTextPlotGuess(const QString text) {
+void FitPropertyBrowser::setTextPlotGuess(const QString &text) {
   m_displayActionPlotGuess->setText(text);
 }
 
diff --git a/qt/widgets/common/src/FunctionBrowser.cpp b/qt/widgets/common/src/FunctionBrowser.cpp
index b207df97dc1..6824ab9ea5b 100644
--- a/qt/widgets/common/src/FunctionBrowser.cpp
+++ b/qt/widgets/common/src/FunctionBrowser.cpp
@@ -25,6 +25,7 @@
 
 #include <algorithm>
 #include <boost/lexical_cast.hpp>
+#include <utility>
 
 namespace {
 Mantid::Kernel::Logger g_log("Function Browser");
@@ -81,7 +82,7 @@ void FunctionBrowser::setFunction(const QString &funStr) {
  * @param fun :: A function
  */
 void FunctionBrowser::setFunction(IFunction_sptr fun) {
-  m_presenter->setFunction(fun);
+  m_presenter->setFunction(std::move(fun));
 }
 
 /**
@@ -199,8 +200,8 @@ void FunctionBrowser::setCurrentDataset(int i) {
 
 /// Remove local parameter values for a number of datasets.
 /// @param indices :: A list of indices of datasets to remove.
-void FunctionBrowser::removeDatasets(QList<int> indices) {
-  m_presenter->removeDatasets(indices);
+void FunctionBrowser::removeDatasets(const QList<int> &indices) {
+  m_presenter->removeDatasets(std::move(indices));
 }
 
 /// Add some datasets to those already set.
diff --git a/qt/widgets/common/src/FunctionModel.cpp b/qt/widgets/common/src/FunctionModel.cpp
index 2d74d736d6a..6109e3be89a 100644
--- a/qt/widgets/common/src/FunctionModel.cpp
+++ b/qt/widgets/common/src/FunctionModel.cpp
@@ -178,7 +178,8 @@ void FunctionModel::setParameterFixed(const QString &parName, bool fixed) {
                          fixed);
 }
 
-void FunctionModel::setParameterTie(const QString &parName, QString tie) {
+void FunctionModel::setParameterTie(const QString &parName,
+                                    const QString &tie) {
   setLocalParameterTie(parName, static_cast<int>(m_currentDomainIndex), tie);
 }
 
diff --git a/qt/widgets/common/src/FunctionMultiDomainPresenter.cpp b/qt/widgets/common/src/FunctionMultiDomainPresenter.cpp
index 54b5abade8c..f6877ec980c 100644
--- a/qt/widgets/common/src/FunctionMultiDomainPresenter.cpp
+++ b/qt/widgets/common/src/FunctionMultiDomainPresenter.cpp
@@ -17,6 +17,7 @@
 #include <QClipboard>
 #include <QMessageBox>
 #include <QWidget>
+#include <utility>
 
 namespace MantidQt {
 namespace MantidWidgets {
@@ -51,7 +52,7 @@ FunctionMultiDomainPresenter::FunctionMultiDomainPresenter(IFunctionView *view)
 }
 
 void FunctionMultiDomainPresenter::setFunction(IFunction_sptr fun) {
-  m_model->setFunction(fun);
+  m_model->setFunction(std::move(fun));
   m_view->setFunction(m_model->getCurrentFunction());
   emit functionStructureChanged();
 }
@@ -224,7 +225,8 @@ void FunctionMultiDomainPresenter::setLocalParameterFixed(
 }
 
 void FunctionMultiDomainPresenter::setLocalParameterTie(const QString &parName,
-                                                        int i, QString tie) {
+                                                        int i,
+                                                        const QString &tie) {
   m_model->setLocalParameterTie(parName, i, tie);
   if (m_model->currentDomainIndex() == i) {
     m_view->setParameterTie(parName, tie);
@@ -232,7 +234,7 @@ void FunctionMultiDomainPresenter::setLocalParameterTie(const QString &parName,
 }
 
 void FunctionMultiDomainPresenter::setLocalParameterConstraint(
-    const QString &parName, int i, QString constraint) {
+    const QString &parName, int i, const QString &constraint) {
   m_model->setLocalParameterConstraint(parName, i, constraint);
   if (m_model->currentDomainIndex() == i) {
     m_view->setParameterConstraint(parName, constraint);
diff --git a/qt/widgets/common/src/FunctionTreeView.cpp b/qt/widgets/common/src/FunctionTreeView.cpp
index 7fe4bba3e68..734ce0f4ba9 100644
--- a/qt/widgets/common/src/FunctionTreeView.cpp
+++ b/qt/widgets/common/src/FunctionTreeView.cpp
@@ -47,6 +47,7 @@
 
 #include <algorithm>
 #include <boost/lexical_cast.hpp>
+#include <utility>
 
 namespace {
 const char *globalOptionName = "Global";
@@ -362,7 +363,8 @@ void FunctionTreeView::removeProperty(QtProperty *prop) {
  * @return :: A set AProperty struct
  */
 FunctionTreeView::AProperty
-FunctionTreeView::addFunctionProperty(QtProperty *parent, QString funName) {
+FunctionTreeView::addFunctionProperty(QtProperty *parent,
+                                      const QString &funName) {
   // check that parent is a function property
   if (parent && dynamic_cast<QtAbstractPropertyManager *>(m_functionManager) !=
                     parent->propertyManager()) {
@@ -379,9 +381,9 @@ FunctionTreeView::addFunctionProperty(QtProperty *parent, QString funName) {
  * @param paramDesc :: Parameter description
  * @param paramValue :: Parameter value
  */
-FunctionTreeView::AProperty
-FunctionTreeView::addParameterProperty(QtProperty *parent, QString paramName,
-                                       QString paramDesc, double paramValue) {
+FunctionTreeView::AProperty FunctionTreeView::addParameterProperty(
+    QtProperty *parent, const QString &paramName, const QString &paramDesc,
+    double paramValue) {
   // check that parent is a function property
   if (!parent || dynamic_cast<QtAbstractPropertyManager *>(m_functionManager) !=
                      parent->propertyManager()) {
@@ -406,11 +408,11 @@ FunctionTreeView::addParameterProperty(QtProperty *parent, QString paramName,
  * @param fun :: A function
  */
 void FunctionTreeView::setFunction(QtProperty *prop,
-                                   Mantid::API::IFunction_sptr fun) {
+                                   const Mantid::API::IFunction_sptr &fun) {
   auto children = prop->subProperties();
   foreach (QtProperty *child, children) { removeProperty(child); }
   // m_localParameterValues.clear();
-  addAttributeAndParameterProperties(prop, fun);
+  addAttributeAndParameterProperties(prop, std::move(fun));
 }
 
 /**
@@ -419,7 +421,7 @@ void FunctionTreeView::setFunction(QtProperty *prop,
  * @param fun :: A function to add
  */
 bool FunctionTreeView::addFunction(QtProperty *prop,
-                                   Mantid::API::IFunction_sptr fun) {
+                                   const Mantid::API::IFunction_sptr &fun) {
   if (!fun)
     return false;
   if (!prop) {
@@ -459,8 +461,8 @@ class CreateAttributePropertyForFunctionTreeView
 public:
   CreateAttributePropertyForFunctionTreeView(FunctionTreeView *browser,
                                              QtProperty *parent,
-                                             QString attName)
-      : m_browser(browser), m_parent(parent), m_attName(attName) {
+                                             const QString &attName)
+      : m_browser(browser), m_parent(parent), m_attName(std::move(attName)) {
     // check that parent is a function property
     if (!m_parent ||
         dynamic_cast<QtAbstractPropertyManager *>(
@@ -614,9 +616,10 @@ private:
  * @param att :: Attribute value
  */
 FunctionTreeView::AProperty FunctionTreeView::addAttributeProperty(
-    QtProperty *parent, QString attName,
+    QtProperty *parent, const QString &attName,
     const Mantid::API::IFunction::Attribute &att) {
-  CreateAttributePropertyForFunctionTreeView cap(this, parent, attName);
+  CreateAttributePropertyForFunctionTreeView cap(this, parent,
+                                                 std::move(attName));
   return att.apply(cap);
 }
 
@@ -628,7 +631,7 @@ FunctionTreeView::AProperty FunctionTreeView::addAttributeProperty(
  * @param fun :: Shared pointer to a created function
  */
 void FunctionTreeView::addAttributeAndParameterProperties(
-    QtProperty *prop, Mantid::API::IFunction_sptr fun) {
+    QtProperty *prop, const Mantid::API::IFunction_sptr &fun) {
   // add the function index property
   addIndexProperty(prop);
 
@@ -703,7 +706,8 @@ FunctionTreeView::addIndexProperty(QtProperty *prop) {
  * @param prop :: A function property
  * @param index :: The parent function's index
  */
-void FunctionTreeView::updateFunctionIndices(QtProperty *prop, QString index) {
+void FunctionTreeView::updateFunctionIndices(QtProperty *prop,
+                                             const QString &index) {
   if (prop == nullptr) {
     auto top = m_browser->properties();
     if (top.isEmpty())
@@ -896,7 +900,7 @@ QtProperty *FunctionTreeView::getFunctionProperty(const QString &index) const {
  * @param prop :: Parent parameter property
  * @param tie :: A tie string
  */
-void FunctionTreeView::addTieProperty(QtProperty *prop, QString tie) {
+void FunctionTreeView::addTieProperty(QtProperty *prop, const QString &tie) {
   if (!prop) {
     throw std::runtime_error("FunctionTreeView: null property pointer");
   }
@@ -977,7 +981,7 @@ QString FunctionTreeView::getTie(QtProperty *prop) const {
  */
 QList<FunctionTreeView::AProperty>
 FunctionTreeView::addConstraintProperties(QtProperty *prop,
-                                          QString constraint) {
+                                          const QString &constraint) {
   if (!isParameter(prop))
     return QList<FunctionTreeView::AProperty>();
   auto const parts = splitConstraintString(constraint);
diff --git a/qt/widgets/common/src/HintingLineEdit.cpp b/qt/widgets/common/src/HintingLineEdit.cpp
index 17267943b05..0454039340b 100644
--- a/qt/widgets/common/src/HintingLineEdit.cpp
+++ b/qt/widgets/common/src/HintingLineEdit.cpp
@@ -11,11 +11,12 @@
 #include <QStyle>
 #include <QToolTip>
 #include <boost/algorithm/string.hpp>
+#include <utility>
 
 namespace MantidQt {
 namespace MantidWidgets {
 HintingLineEdit::HintingLineEdit(QWidget *parent, std::vector<Hint> hints)
-    : QLineEdit(parent), m_hints(hints), m_dontComplete(false) {
+    : QLineEdit(parent), m_hints(std::move(hints)), m_dontComplete(false) {
   m_hintLabel = new QLabel(this, Qt::ToolTip);
   m_hintLabel->setMargin(1 +
                          style()->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth,
diff --git a/qt/widgets/common/src/IndirectFitPropertyBrowserLegacy.cpp b/qt/widgets/common/src/IndirectFitPropertyBrowserLegacy.cpp
index 2685c42720f..4d6335bc43b 100644
--- a/qt/widgets/common/src/IndirectFitPropertyBrowserLegacy.cpp
+++ b/qt/widgets/common/src/IndirectFitPropertyBrowserLegacy.cpp
@@ -211,8 +211,8 @@ IndirectFitPropertyBrowserLegacy::backgroundIndex() const {
  * @param function  The function, whose function index to retrieve.
  * @return          The function index of the specified function in the browser.
  */
-boost::optional<size_t>
-IndirectFitPropertyBrowserLegacy::functionIndex(IFunction_sptr function) const {
+boost::optional<size_t> IndirectFitPropertyBrowserLegacy::functionIndex(
+    const IFunction_sptr &function) const {
   for (size_t i = 0u; i < compositeFunction()->nFunctions(); ++i) {
     if (compositeFunction()->getFunction(i) == function)
       return i;
@@ -344,7 +344,8 @@ void IndirectFitPropertyBrowserLegacy::setParameterValue(
  * @param value         The value to set.
  */
 void IndirectFitPropertyBrowserLegacy::setParameterValue(
-    IFunction_sptr function, const std::string &parameterName, double value) {
+    const IFunction_sptr &function, const std::string &parameterName,
+    double value) {
   if (function->hasParameter(parameterName)) {
     function->setParameter(parameterName, value);
     emit parameterChanged(function.get());
@@ -818,7 +819,7 @@ void IndirectFitPropertyBrowserLegacy::clearAllCustomFunctions() {
  * @param sampleWorkspace :: The workspace loaded as sample
  */
 void IndirectFitPropertyBrowserLegacy::updatePlotGuess(
-    MatrixWorkspace_const_sptr sampleWorkspace) {
+    const MatrixWorkspace_const_sptr &sampleWorkspace) {
   if (sampleWorkspace && compositeFunction()->nFunctions() > 0)
     setPeakToolOn(true);
   else
diff --git a/qt/widgets/common/src/InterfaceManager.cpp b/qt/widgets/common/src/InterfaceManager.cpp
index 60da0c8b8c8..e0c13a43397 100644
--- a/qt/widgets/common/src/InterfaceManager.cpp
+++ b/qt/widgets/common/src/InterfaceManager.cpp
@@ -74,7 +74,7 @@ Mantid::Kernel::AbstractInstantiator<MantidHelpInterface>
  * @returns An AlgorithmDialog object
  */
 AlgorithmDialog *InterfaceManager::createDialog(
-    boost::shared_ptr<Mantid::API::IAlgorithm> alg, QWidget *parent,
+    const boost::shared_ptr<Mantid::API::IAlgorithm> &alg, QWidget *parent,
     bool forScript, const QHash<QString, QString> &presetValues,
     const QString &optionalMsg, const QStringList &enabled,
     const QStringList &disabled) {
diff --git a/qt/widgets/common/src/LocalParameterEditor.cpp b/qt/widgets/common/src/LocalParameterEditor.cpp
index 0546605e8d6..c502f1c4a3b 100644
--- a/qt/widgets/common/src/LocalParameterEditor.cpp
+++ b/qt/widgets/common/src/LocalParameterEditor.cpp
@@ -16,6 +16,7 @@
 #include <QLineEdit>
 #include <QMenu>
 #include <QPushButton>
+#include <utility>
 
 namespace MantidQt {
 namespace MantidWidgets {
@@ -31,16 +32,14 @@ namespace MantidWidgets {
 /// @param allOthersFixed :: True if all other local parameters are fixed.
 /// @param othersTied :: True if there are other tied parameters.
 /// @param logOptionsEnabled :: True if the log checkbox is ticked.
-LocalParameterEditor::LocalParameterEditor(QWidget *parent, int index,
-                                           double value, bool fixed,
-                                           QString tie, QString constraint,
-                                           bool othersFixed,
-                                           bool allOthersFixed, bool othersTied,
-                                           bool logOptionsEnabled)
+LocalParameterEditor::LocalParameterEditor(
+    QWidget *parent, int index, double value, bool fixed, const QString &tie,
+    const QString &constraint, bool othersFixed, bool allOthersFixed,
+    bool othersTied, bool logOptionsEnabled)
     : QWidget(parent), m_index(index), m_value(QString::number(value, 'g', 16)),
-      m_fixed(fixed), m_tie(tie), m_constraint(constraint),
-      m_othersFixed(othersFixed), m_allOthersFixed(allOthersFixed),
-      m_othersTied(othersTied) {
+      m_fixed(fixed), m_tie(std::move(tie)),
+      m_constraint(std::move(constraint)), m_othersFixed(othersFixed),
+      m_allOthersFixed(allOthersFixed), m_othersTied(othersTied) {
   auto layout = new QHBoxLayout(this);
   layout->setMargin(0);
   layout->setSpacing(0);
@@ -312,7 +311,7 @@ void LocalParameterEditor::setEditorState() {
 }
 
 /// Open an input dialog to enter a tie expression.
-QString LocalParameterEditor::setTieDialog(QString tie) {
+QString LocalParameterEditor::setTieDialog(const QString &tie) {
   QInputDialog input;
   input.setWindowTitle("Set a tie.");
   input.setTextValue(tie);
@@ -322,7 +321,7 @@ QString LocalParameterEditor::setTieDialog(QString tie) {
   return "";
 }
 
-QString LocalParameterEditor::setConstraintDialog(QString constraint) {
+QString LocalParameterEditor::setConstraintDialog(const QString &constraint) {
   QInputDialog input;
   input.setWindowTitle("Set a constraint.");
   input.setTextValue(constraint);
diff --git a/qt/widgets/common/src/MantidDialog.cpp b/qt/widgets/common/src/MantidDialog.cpp
index 74a30e92174..dd67a2f8c7d 100644
--- a/qt/widgets/common/src/MantidDialog.cpp
+++ b/qt/widgets/common/src/MantidDialog.cpp
@@ -19,7 +19,7 @@ using namespace MantidQt::API;
 /**
  * Default Constructor
  */
-MantidDialog::MantidDialog(QWidget *parent, Qt::WindowFlags flags)
+MantidDialog::MantidDialog(QWidget *parent, const Qt::WindowFlags &flags)
     : QDialog(parent, flags), m_pyRunner() {
   // re-emit the run Python code from m_pyRunner, to work this signal must reach
   // the slot in QtiPlot
diff --git a/qt/widgets/common/src/MantidHelpWindow.cpp b/qt/widgets/common/src/MantidHelpWindow.cpp
index b65427535ac..cb0af5b2e49 100644
--- a/qt/widgets/common/src/MantidHelpWindow.cpp
+++ b/qt/widgets/common/src/MantidHelpWindow.cpp
@@ -65,7 +65,8 @@ const QString COLLECTION_FILE("MantidProject.qhc");
 /**
  * Default constructor shows the @link DEFAULT_URL @endlink.
  */
-MantidHelpWindow::MantidHelpWindow(QWidget *parent, Qt::WindowFlags flags)
+MantidHelpWindow::MantidHelpWindow(QWidget *parent,
+                                   const Qt::WindowFlags &flags)
     : MantidHelpInterface(), m_collectionFile(""), m_cacheFile(""),
       m_firstRun(true) {
   // find the collection and delete the cache file if this is the first run
@@ -487,7 +488,7 @@ void MantidHelpWindow::determineFileLocs() {
   }
 }
 
-void MantidHelpWindow::warning(QString msg) {
+void MantidHelpWindow::warning(const QString &msg) {
   g_log.warning(msg.toStdString());
 }
 
diff --git a/qt/widgets/common/src/MantidTreeModel.cpp b/qt/widgets/common/src/MantidTreeModel.cpp
index 9e9508d53b9..f7dbee08593 100644
--- a/qt/widgets/common/src/MantidTreeModel.cpp
+++ b/qt/widgets/common/src/MantidTreeModel.cpp
@@ -121,8 +121,8 @@ void MantidTreeModel::showAlgorithmDialog(const QString &algName,
  * This creates an algorithm dialog (the default property entry thingie).
  * Helper function not required by interface
  */
-MantidQt::API::AlgorithmDialog *
-MantidTreeModel::createAlgorithmDialog(Mantid::API::IAlgorithm_sptr alg) {
+MantidQt::API::AlgorithmDialog *MantidTreeModel::createAlgorithmDialog(
+    const Mantid::API::IAlgorithm_sptr &alg) {
   QHash<QString, QString> presets;
   QStringList enabled;
 
diff --git a/qt/widgets/common/src/MantidTreeWidget.cpp b/qt/widgets/common/src/MantidTreeWidget.cpp
index d94c406f99f..fa6c4d5a6f0 100644
--- a/qt/widgets/common/src/MantidTreeWidget.cpp
+++ b/qt/widgets/common/src/MantidTreeWidget.cpp
@@ -37,7 +37,7 @@ MantidTreeWidget::MantidTreeWidget(MantidDisplayBase *mui, QWidget *parent)
   setSortOrder(Qt::AscendingOrder);
   setAcceptDrops(true);
 
-  m_doubleClickAction = [&](QString wsName) {
+  m_doubleClickAction = [&](const QString &wsName) {
     m_mantidUI->importWorkspace(wsName, false);
   };
 }
diff --git a/qt/widgets/common/src/MantidTreeWidgetItem.cpp b/qt/widgets/common/src/MantidTreeWidgetItem.cpp
index 200faef424a..0381fcafdcd 100644
--- a/qt/widgets/common/src/MantidTreeWidgetItem.cpp
+++ b/qt/widgets/common/src/MantidTreeWidgetItem.cpp
@@ -25,7 +25,7 @@ MantidTreeWidgetItem::MantidTreeWidgetItem(MantidTreeWidget *parent)
 /**Constructor.
  * Must be passed its parent MantidTreeWidget, to facilitate correct sorting.
  */
-MantidTreeWidgetItem::MantidTreeWidgetItem(QStringList list,
+MantidTreeWidgetItem::MantidTreeWidgetItem(const QStringList &list,
                                            MantidTreeWidget *parent)
     : QTreeWidgetItem(list), m_parent(parent), m_sortPos(0) {}
 
diff --git a/qt/widgets/common/src/MantidWSIndexDialog.cpp b/qt/widgets/common/src/MantidWSIndexDialog.cpp
index 77590e3268d..b017b39fa43 100644
--- a/qt/widgets/common/src/MantidWSIndexDialog.cpp
+++ b/qt/widgets/common/src/MantidWSIndexDialog.cpp
@@ -20,6 +20,7 @@
 #include <boost/lexical_cast.hpp>
 #include <cstdlib>
 #include <exception>
+#include <utility>
 
 namespace MantidQt {
 namespace MantidWidgets {
@@ -48,7 +49,8 @@ const QString MantidWSIndexWidget::CONTOUR_PLOT = "Contour Plot";
  * @param showTiledOption :: true if tiled plot enabled
  * @param isAdvanced :: true if advanced plotting has been selected
  */
-MantidWSIndexWidget::MantidWSIndexWidget(QWidget *parent, Qt::WindowFlags flags,
+MantidWSIndexWidget::MantidWSIndexWidget(QWidget *parent,
+                                         const Qt::WindowFlags &flags,
                                          const QList<QString> &wsNames,
                                          const bool showWaterfallOption,
                                          const bool showTiledOption,
@@ -830,12 +832,10 @@ bool MantidWSIndexWidget::usingSpectraNumbers() const {
  * @param showTiledOption :: If true the "Tiled" option is created
  * @param isAdvanced :: true if adanced plotting dialog is created
  */
-MantidWSIndexDialog::MantidWSIndexDialog(QWidget *parent, Qt::WindowFlags flags,
-                                         const QList<QString> &wsNames,
-                                         const bool showWaterfallOption,
-                                         const bool showPlotAll,
-                                         const bool showTiledOption,
-                                         const bool isAdvanced)
+MantidWSIndexDialog::MantidWSIndexDialog(
+    QWidget *parent, const Qt::WindowFlags &flags,
+    const QList<QString> &wsNames, const bool showWaterfallOption,
+    const bool showPlotAll, const bool showTiledOption, const bool isAdvanced)
     : QDialog(parent, flags),
       m_widget(this, flags, wsNames, showWaterfallOption, showTiledOption,
                isAdvanced),
@@ -973,7 +973,7 @@ Interval::Interval(int single) { init(single, single); }
 
 Interval::Interval(int start, int end) { init(start, end); }
 
-Interval::Interval(QString intervalString) {
+Interval::Interval(const QString &intervalString) {
   // Check to see if string is of the correct format, and then parse.
   // An interval can either be "n" or "n-m" where n and m are integers
   const QString patternSingle("^\\d+$");     // E.g. "2" or "712"
@@ -1086,9 +1086,13 @@ void Interval::init(int start, int end) {
 //----------------------------------
 IntervalList::IntervalList(void) {}
 
-IntervalList::IntervalList(QString intervals) { addIntervals(intervals); }
+IntervalList::IntervalList(const QString &intervals) {
+  addIntervals(std::move(intervals));
+}
 
-IntervalList::IntervalList(Interval interval) { m_list.append(interval); }
+IntervalList::IntervalList(const Interval &interval) {
+  m_list.append(interval);
+}
 
 IntervalList::IntervalList(const IntervalList &copy) { m_list = copy.m_list; }
 
@@ -1350,7 +1354,8 @@ MantidWSIndexWidget::QLineEditWithErrorMark::QLineEditWithErrorMark(
   setLayout(layout);
 }
 
-void MantidWSIndexWidget::QLineEditWithErrorMark::setError(QString error) {
+void MantidWSIndexWidget::QLineEditWithErrorMark::setError(
+    const QString &error) {
   if (error.isEmpty()) {
     m_validLbl->setVisible(false);
   } else {
diff --git a/qt/widgets/common/src/MdSettings.cpp b/qt/widgets/common/src/MdSettings.cpp
index 3ae4ba778f6..291db7c62cc 100644
--- a/qt/widgets/common/src/MdSettings.cpp
+++ b/qt/widgets/common/src/MdSettings.cpp
@@ -47,7 +47,7 @@ QString MdSettings::getUserSettingColorMap() {
   return userSettingColorMap;
 }
 
-void MdSettings::setUserSettingColorMap(QString colorMap) {
+void MdSettings::setUserSettingColorMap(const QString &colorMap) {
   QSettings settings;
 
   settings.beginGroup(m_vsiGroup);
@@ -66,7 +66,7 @@ QString MdSettings::getLastSessionColorMap() {
   return colormap;
 }
 
-void MdSettings::setLastSessionColorMap(QString colorMap) {
+void MdSettings::setLastSessionColorMap(const QString &colorMap) {
   QSettings settings;
 
   settings.beginGroup(m_vsiGroup);
@@ -87,7 +87,7 @@ QColor MdSettings::getUserSettingBackgroundColor() {
   return backgroundColor;
 }
 
-void MdSettings::setUserSettingBackgroundColor(QColor backgroundColor) {
+void MdSettings::setUserSettingBackgroundColor(const QColor &backgroundColor) {
   QSettings settings;
 
   settings.beginGroup(m_vsiGroup);
@@ -112,7 +112,7 @@ QColor MdSettings::getDefaultBackgroundColor() {
   return m_mdConstants.getDefaultBackgroundColor();
 }
 
-void MdSettings::setLastSessionBackgroundColor(QColor backgroundColor) {
+void MdSettings::setLastSessionBackgroundColor(const QColor &backgroundColor) {
   QSettings settings;
 
   settings.beginGroup(m_vsiGroup);
@@ -120,8 +120,8 @@ void MdSettings::setLastSessionBackgroundColor(QColor backgroundColor) {
   settings.endGroup();
 }
 
-void MdSettings::setGeneralMdColorMap(QString colorMapName,
-                                      QString colorMapFile) {
+void MdSettings::setGeneralMdColorMap(const QString &colorMapName,
+                                      const QString &colorMapFile) {
   QSettings settings;
 
   settings.beginGroup(m_generalMdGroup);
@@ -221,7 +221,7 @@ bool MdSettings::getLastSessionLogScale() {
   return logScale;
 }
 
-void MdSettings::setUserSettingIntialView(QString initialView) {
+void MdSettings::setUserSettingIntialView(const QString &initialView) {
   QSettings settings;
 
   settings.beginGroup(m_vsiGroup);
diff --git a/qt/widgets/common/src/Message.cpp b/qt/widgets/common/src/Message.cpp
index 21dda845f29..fe80bde54c0 100644
--- a/qt/widgets/common/src/Message.cpp
+++ b/qt/widgets/common/src/Message.cpp
@@ -7,6 +7,8 @@
 //-------------------------------------------
 // Includes
 //-------------------------------------------
+#include <utility>
+
 #include "MantidQtWidgets/Common/Message.h"
 
 namespace MantidQt {
@@ -28,8 +30,10 @@ Message::Message()
  * @param scriptPath The path of the script the message originated from. Empty
  * string if no script applicable
  */
-Message::Message(const QString &text, Priority priority, QString scriptPath)
-    : QObject(), m_text(text), m_priority(priority), m_scriptPath(scriptPath) {}
+Message::Message(const QString &text, Priority priority,
+                 const QString &scriptPath)
+    : QObject(), m_text(text), m_priority(priority),
+      m_scriptPath(std::move(scriptPath)) {}
 
 /**
  * @param text A std::string containing the message text
@@ -37,9 +41,10 @@ Message::Message(const QString &text, Priority priority, QString scriptPath)
  * @param scriptPath The path of the script the message originated from. Empty
  * string if no script applicable
  */
-Message::Message(const std::string &text, Priority priority, QString scriptPath)
+Message::Message(const std::string &text, Priority priority,
+                 const QString &scriptPath)
     : QObject(), m_text(QString::fromStdString(text)), m_priority(priority),
-      m_scriptPath(scriptPath) {}
+      m_scriptPath(std::move(scriptPath)) {}
 
 /**
  * @param text A c-style string containing the message text
@@ -47,8 +52,9 @@ Message::Message(const std::string &text, Priority priority, QString scriptPath)
  * @param scriptPath The path of the script the message originated from. Empty
  * string if no script applicable
  */
-Message::Message(const char *text, Priority priority, QString scriptPath)
-    : QObject(), m_text(text), m_priority(priority), m_scriptPath(scriptPath) {}
+Message::Message(const char *text, Priority priority, const QString &scriptPath)
+    : QObject(), m_text(text), m_priority(priority),
+      m_scriptPath(std::move(scriptPath)) {}
 
 /**
  * Construct a message from another object
diff --git a/qt/widgets/common/src/MuonFitPropertyBrowser.cpp b/qt/widgets/common/src/MuonFitPropertyBrowser.cpp
index 48fe43dc82f..f4bb2caa326 100644
--- a/qt/widgets/common/src/MuonFitPropertyBrowser.cpp
+++ b/qt/widgets/common/src/MuonFitPropertyBrowser.cpp
@@ -64,6 +64,7 @@
 #include <QMessageBox>
 #include <QSignalMapper>
 #include <QTableWidgetItem>
+#include <utility>
 
 namespace {
 Mantid::Kernel::Logger g_log("MuonFitPropertyBrowser");
@@ -514,7 +515,7 @@ void MuonFitPropertyBrowser::setNormalization() {
  * @param name :: the ws name to get normalization for
  * @returns the normalization
  */
-void MuonFitPropertyBrowser::setNormalization(const std::string name) {
+void MuonFitPropertyBrowser::setNormalization(const std::string &name) {
   m_normalizationValue.clear();
   QString label;
   auto norms = readMultipleNormalization();
@@ -891,7 +892,7 @@ bool MuonFitPropertyBrowser::isWorkspaceValid(Workspace_sptr ws) const {
   return dynamic_cast<MatrixWorkspace *>(ws.get()) != nullptr;
 }
 
-void MuonFitPropertyBrowser::setFitWorkspaces(const std::string input) {
+void MuonFitPropertyBrowser::setFitWorkspaces(const std::string &input) {
   // Copy experiment info to output workspace
   if (AnalysisDataService::Instance().doesExist(outputName() + "_Workspace")) {
     // Input workspace should be a MatrixWorkspace according to isWorkspaceValid
@@ -1027,7 +1028,7 @@ void MuonFitPropertyBrowser::finishAfterSimultaneousFit(
  * @param baseName :: [input] The common name of the workspaces of interest
  */
 void MuonFitPropertyBrowser::finishAfterTFSimultaneousFit(
-    const Mantid::API::IAlgorithm *alg, const std::string baseName) const {
+    const Mantid::API::IAlgorithm *alg, const std::string &baseName) const {
   AnalysisDataServiceImpl &ads = AnalysisDataService::Instance();
   try {
     std::vector<std::string> wsList =
@@ -1827,7 +1828,7 @@ void MuonFitPropertyBrowser::combineBtnPressed() {
  * selects the relevant group/pair
  * @param name :: string of the ws
  */
-void MuonFitPropertyBrowser::setSingleFitLabel(std::string name) {
+void MuonFitPropertyBrowser::setSingleFitLabel(const std::string &name) {
   clearChosenGroups();
   clearChosenPeriods();
   std::vector<std::string> splitName;
@@ -1898,7 +1899,7 @@ void MuonFitPropertyBrowser::setAllGroupsOrPairs(const bool isItGroup) {
 }
 void MuonFitPropertyBrowser::setGroupNames(
     std::vector<std::string> groupNames) {
-  m_groupsList = groupNames;
+  m_groupsList = std::move(groupNames);
 }
 void MuonFitPropertyBrowser::setTFAsymm(bool state) {
   m_boolManager->setValue(m_TFAsymmMode, state);
diff --git a/qt/widgets/common/src/NonOrthogonal.cpp b/qt/widgets/common/src/NonOrthogonal.cpp
index 01a5ab14b5f..7a5d216a9a8 100644
--- a/qt/widgets/common/src/NonOrthogonal.cpp
+++ b/qt/widgets/common/src/NonOrthogonal.cpp
@@ -350,9 +350,9 @@ double getAngleInRadian(std::array<Mantid::coord_t, N> orthogonalVector,
 namespace MantidQt {
 namespace API {
 
-size_t
-getMissingHKLDimensionIndex(Mantid::API::IMDWorkspace_const_sptr workspace,
-                            size_t dimX, size_t dimY) {
+size_t getMissingHKLDimensionIndex(
+    const Mantid::API::IMDWorkspace_const_sptr &workspace, size_t dimX,
+    size_t dimY) {
   for (size_t i = 0; i < workspace->getNumDims(); ++i) {
     auto dimension = workspace->getDimension(i);
     const auto &frame = dimension->getMDFrame();
diff --git a/qt/widgets/common/src/PlotAxis.cpp b/qt/widgets/common/src/PlotAxis.cpp
index a1ae86bcbd5..16ed2f1d3e6 100644
--- a/qt/widgets/common/src/PlotAxis.cpp
+++ b/qt/widgets/common/src/PlotAxis.cpp
@@ -22,7 +22,7 @@ namespace {
 QString
 replacePerWithNegativeIndice(const std::string &label,
                              const bool &plotAsDistribution,
-                             const Mantid::Kernel::UnitLabel xLabel = "") {
+                             const Mantid::Kernel::UnitLabel &xLabel = "") {
   std::vector<std::string> splitVec;
   QString negativeOnePower = toQStringInternal(L"\u207b\u00b9");
   QString newLabel;
diff --git a/qt/widgets/common/src/PluginLibraries.cpp b/qt/widgets/common/src/PluginLibraries.cpp
index ae681c9b797..ef046a6cb87 100644
--- a/qt/widgets/common/src/PluginLibraries.cpp
+++ b/qt/widgets/common/src/PluginLibraries.cpp
@@ -25,7 +25,7 @@ namespace API {
  * @param key The name of a key in the Mantid config
  * @return The value of the key
  */
-std::string qtPluginPathFromCfg(std::string key) {
+std::string qtPluginPathFromCfg(const std::string &key) {
   static std::string qtMajorVersion;
   static std::string qtTag("%V");
   if (qtMajorVersion.empty()) {
@@ -42,7 +42,7 @@ std::string qtPluginPathFromCfg(std::string key) {
  * %V to specify the Qt version
  * @return The number of libraries successfully loaded
  */
-int loadPluginsFromCfgPath(std::string key) {
+int loadPluginsFromCfgPath(const std::string &key) {
   return loadPluginsFromPath(qtPluginPathFromCfg(std::move(key)));
 }
 
@@ -50,7 +50,7 @@ int loadPluginsFromCfgPath(std::string key) {
  * Load all plugins from the path specified.
  * @return The number of libraries successfully loaded
  */
-int loadPluginsFromPath(std::string path) {
+int loadPluginsFromPath(const std::string &path) {
 // We must *NOT* load plugins compiled against a different version of Qt
 // so we set exclude flags by Qt version.
 #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
diff --git a/qt/widgets/common/src/ProcessingAlgoWidget.cpp b/qt/widgets/common/src/ProcessingAlgoWidget.cpp
index 86a64dcd7d9..d0fb062f7d4 100644
--- a/qt/widgets/common/src/ProcessingAlgoWidget.cpp
+++ b/qt/widgets/common/src/ProcessingAlgoWidget.cpp
@@ -164,7 +164,7 @@ void ProcessingAlgoWidget::setSelectedAlgorithm(QString algo) {
 /// @return the text in the script editor
 QString ProcessingAlgoWidget::getScriptText() { return ui.editor->text(); }
 /// Set the script editor text
-void ProcessingAlgoWidget::setScriptText(QString text) {
+void ProcessingAlgoWidget::setScriptText(const QString &text) {
   ui.editor->setText(text);
 }
 
diff --git a/qt/widgets/common/src/ProjectSaveModel.cpp b/qt/widgets/common/src/ProjectSaveModel.cpp
index 86b2a1fdb8b..83b529b11d9 100644
--- a/qt/widgets/common/src/ProjectSaveModel.cpp
+++ b/qt/widgets/common/src/ProjectSaveModel.cpp
@@ -24,7 +24,7 @@ using namespace MantidQt::MantidWidgets;
  * @param activePythonInterfaces The list of active Python interfaces
  */
 ProjectSaveModel::ProjectSaveModel(
-    std::vector<IProjectSerialisable *> windows,
+    const std::vector<IProjectSerialisable *> &windows,
     std::vector<std::string> activePythonInterfaces)
     : m_activePythonInterfaces(std::move(activePythonInterfaces)) {
   auto workspaces = getWorkspaces();
@@ -204,8 +204,8 @@ std::vector<Workspace_sptr> ProjectSaveModel::getWorkspaces() const {
   return ads.getObjects();
 }
 
-WorkspaceInfo
-ProjectSaveModel::makeWorkspaceInfoObject(Workspace_const_sptr ws) const {
+WorkspaceInfo ProjectSaveModel::makeWorkspaceInfoObject(
+    const Workspace_const_sptr &ws) const {
   WorkspaceIcons icons;
   WorkspaceInfo info;
   info.name = ws->getName();
diff --git a/qt/widgets/common/src/PropertyHandler.cpp b/qt/widgets/common/src/PropertyHandler.cpp
index d66dc9a77ba..ce324b420ed 100644
--- a/qt/widgets/common/src/PropertyHandler.cpp
+++ b/qt/widgets/common/src/PropertyHandler.cpp
@@ -26,6 +26,7 @@
 #include "MantidQtWidgets/Common/QtPropertyBrowser/qttreepropertybrowser.h"
 
 #include <QMessageBox>
+#include <utility>
 
 using std::size_t;
 
@@ -33,16 +34,16 @@ namespace MantidQt {
 namespace MantidWidgets {
 
 // Constructor
-PropertyHandler::PropertyHandler(Mantid::API::IFunction_sptr fun,
+PropertyHandler::PropertyHandler(const Mantid::API::IFunction_sptr &fun,
                                  Mantid::API::CompositeFunction_sptr parent,
                                  FitPropertyBrowser *browser,
                                  QtBrowserItem *item)
     : FunctionHandler(fun), m_browser(browser),
       m_cf(boost::dynamic_pointer_cast<Mantid::API::CompositeFunction>(fun)),
       m_pf(boost::dynamic_pointer_cast<Mantid::API::IPeakFunction>(fun)),
-      m_parent(parent), m_type(nullptr), m_item(item), m_isMultispectral(false),
-      m_workspace(nullptr), m_workspaceIndex(nullptr), m_base(0), m_ci(0),
-      m_hasPlot(false) {}
+      m_parent(std::move(parent)), m_type(nullptr), m_item(item),
+      m_isMultispectral(false), m_workspace(nullptr), m_workspaceIndex(nullptr),
+      m_base(0), m_ci(0), m_hasPlot(false) {}
 
 /// Destructor
 PropertyHandler::~PropertyHandler() {}
@@ -606,7 +607,7 @@ PropertyHandler *PropertyHandler::findHandler(QtProperty *prop) {
 }
 
 PropertyHandler *
-PropertyHandler::findHandler(Mantid::API::IFunction_const_sptr fun) {
+PropertyHandler::findHandler(const Mantid::API::IFunction_const_sptr &fun) {
   if (fun == function())
     return this;
   if (m_cf) {
@@ -1156,7 +1157,8 @@ void PropertyHandler::fix(const QString &parName) {
  * @param globalName :: Name of the parameter in compoite function
  * (e.g. f1.omega)
  */
-void PropertyHandler::removeTie(QtProperty *prop, std::string globalName) {
+void PropertyHandler::removeTie(QtProperty *prop,
+                                const std::string &globalName) {
   QString parName = m_ties.key(prop, "");
   if (parName.isEmpty())
     return;
diff --git a/qt/widgets/common/src/QtJSONUtils.cpp b/qt/widgets/common/src/QtJSONUtils.cpp
index 44e1821f071..ad1d4d972f1 100644
--- a/qt/widgets/common/src/QtJSONUtils.cpp
+++ b/qt/widgets/common/src/QtJSONUtils.cpp
@@ -58,7 +58,7 @@ public:
     return toString.call(obj).toString();
   }
 
-  QMap<QString, QVariant> decodeInner(QScriptValue object) {
+  QMap<QString, QVariant> decodeInner(const QScriptValue &object) {
     QMap<QString, QVariant> map;
     QScriptValueIterator it(object);
     while (it.hasNext()) {
@@ -79,7 +79,7 @@ public:
     return map;
   }
 
-  QList<QVariant> decodeInnerToList(QScriptValue arrayValue) {
+  QList<QVariant> decodeInnerToList(const QScriptValue &arrayValue) {
     QList<QVariant> list;
     QScriptValueIterator it(arrayValue);
     while (it.hasNext()) {
diff --git a/qt/widgets/common/src/QtPropertyBrowser/qtpropertybrowserutils.cpp b/qt/widgets/common/src/QtPropertyBrowser/qtpropertybrowserutils.cpp
index b314504ea06..d36cf51256d 100644
--- a/qt/widgets/common/src/QtPropertyBrowser/qtpropertybrowserutils.cpp
+++ b/qt/widgets/common/src/QtPropertyBrowser/qtpropertybrowserutils.cpp
@@ -461,7 +461,7 @@ void QtKeySequenceEdit::setKeySequence(const QKeySequence &sequence) {
 
 QKeySequence QtKeySequenceEdit::keySequence() const { return m_keySequence; }
 
-int QtKeySequenceEdit::translateModifiers(Qt::KeyboardModifiers state,
+int QtKeySequenceEdit::translateModifiers(const Qt::KeyboardModifiers &state,
                                           const QString &text) const {
   int result = 0;
   if ((state & Qt::ShiftModifier) &&
diff --git a/qt/widgets/common/src/SaveWorkspaces.cpp b/qt/widgets/common/src/SaveWorkspaces.cpp
index b9b9a82511f..379f2712a6d 100644
--- a/qt/widgets/common/src/SaveWorkspaces.cpp
+++ b/qt/widgets/common/src/SaveWorkspaces.cpp
@@ -482,7 +482,7 @@ SaveWorkspaces::provideZeroFreeWorkspaces(const QListWidget *workspaces) {
  * workspaces.
  */
 void SaveWorkspaces::removeZeroFreeWorkspaces(
-    QHash<QString, QString> workspaces) {
+    const QHash<QString, QString> &workspaces) {
   auto zeroFreeWorkspaceNames = workspaces.values();
   for (auto &zeroFreeWorkspaceName : zeroFreeWorkspaceNames) {
     emit deleteZeroErrorFreeWorkspace(zeroFreeWorkspaceName);
diff --git a/qt/widgets/common/src/ScriptRepositoryView.cpp b/qt/widgets/common/src/ScriptRepositoryView.cpp
index e9f39afc030..71d96520c2a 100644
--- a/qt/widgets/common/src/ScriptRepositoryView.cpp
+++ b/qt/widgets/common/src/ScriptRepositoryView.cpp
@@ -360,7 +360,7 @@ void ScriptRepositoryView::RepoDelegate::paint(
   QApplication::style()->drawControl(QStyle::CE_PushButton, &button, painter);
 }
 
-QIcon ScriptRepositoryView::RepoDelegate::getIcon(QString state) const {
+QIcon ScriptRepositoryView::RepoDelegate::getIcon(const QString &state) const {
   QIcon icon;
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
   if (state == RepoModel::remoteOnlySt())
@@ -646,7 +646,7 @@ bool ScriptRepositoryView::RemoveEntryDelegate::editorEvent(
  *
  * @param link :: the folder link to open.
  */
-void ScriptRepositoryView::openFolderLink(QString link) {
+void ScriptRepositoryView::openFolderLink(const QString &link) {
   const std::string error_msg =
       "Unable to open \"" + link.toStdString() + "\".  Reason: ";
 
diff --git a/qt/widgets/common/src/SelectWorkspacesDialog.cpp b/qt/widgets/common/src/SelectWorkspacesDialog.cpp
index 77c0465afe0..1a3617b57b3 100644
--- a/qt/widgets/common/src/SelectWorkspacesDialog.cpp
+++ b/qt/widgets/common/src/SelectWorkspacesDialog.cpp
@@ -32,7 +32,7 @@ private:
 public:
   explicit WorkspaceIsNotOfType(const std::string &type)
       : m_type(type), m_isMatrixWorkspace(type == "MatrixWorkspace") {}
-  bool operator()(Mantid::API::Workspace_sptr ws) const {
+  bool operator()(const Mantid::API::Workspace_sptr &ws) const {
     if (m_type.empty())
       return false;
     if (m_isMatrixWorkspace) {
diff --git a/qt/widgets/common/src/SequentialFitDialog.cpp b/qt/widgets/common/src/SequentialFitDialog.cpp
index 3b3eb16fe4c..e4db13d7fb5 100644
--- a/qt/widgets/common/src/SequentialFitDialog.cpp
+++ b/qt/widgets/common/src/SequentialFitDialog.cpp
@@ -88,7 +88,7 @@ void SequentialFitDialog::addWorkspace() {
   }
 }
 
-bool SequentialFitDialog::addWorkspaces(const QStringList wsNames) {
+bool SequentialFitDialog::addWorkspaces(const QStringList &wsNames) {
   if (wsNames.isEmpty())
     return false;
   int row = ui.tWorkspaces->rowCount();
@@ -191,7 +191,7 @@ void SequentialFitDialog::removeItem() {
   }
 }
 
-bool SequentialFitDialog::validateLogs(const QString wsName) {
+bool SequentialFitDialog::validateLogs(const QString &wsName) {
   Mantid::API::MatrixWorkspace_sptr ws =
       boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(
           Mantid::API::AnalysisDataService::Instance().retrieve(
diff --git a/qt/widgets/common/src/SlicingAlgorithmDialog.cpp b/qt/widgets/common/src/SlicingAlgorithmDialog.cpp
index 523f936469e..d55299da9b4 100644
--- a/qt/widgets/common/src/SlicingAlgorithmDialog.cpp
+++ b/qt/widgets/common/src/SlicingAlgorithmDialog.cpp
@@ -102,8 +102,8 @@ SlicingAlgorithmDialog::~SlicingAlgorithmDialog() { saveSettings(); }
  dimension.
  @param dim : dimension to format to string.
 */
-QString
-formattedAlignedDimensionInput(Mantid::Geometry::IMDDimension_const_sptr dim) {
+QString formattedAlignedDimensionInput(
+    const Mantid::Geometry::IMDDimension_const_sptr &dim) {
   QString min, max, nbins, result;
   QString name(dim->getName().c_str());
   min.setNum(dim->getMinimum());
@@ -133,7 +133,7 @@ formattedAlignedDimensionInput(Mantid::Geometry::IMDDimension_const_sptr dim) {
  @return : empty string.
 */
 QString formatNonAlignedDimensionInput(
-    Mantid::Geometry::IMDDimension_const_sptr /*unused*/) {
+    const Mantid::Geometry::IMDDimension_const_sptr & /*unused*/) {
   // Deliberately return an empty string here, because it's not obvious how the
   // basis vectors could be automatically formed.
   return QString("");
@@ -288,7 +288,7 @@ generated.
 */
 void SlicingAlgorithmDialog::makeDimensionInputs(
     const QString &propertyPrefix, QLayout *owningLayout,
-    QString (*format)(IMDDimension_const_sptr), History history) {
+    QString (*format)(const IMDDimension_const_sptr &), History history) {
   // Remove excess dimensions from the tied properties and the stored property
   // values
   size_t indexRemoved = 0;
@@ -441,7 +441,7 @@ bool SlicingAlgorithmDialog::doAutoFillDimensions() const {
  *Customise the layout for usage in the Vsi
  */
 void SlicingAlgorithmDialog::customiseLayoutForVsi(
-    std::string initialWorkspace) {
+    const std::string &initialWorkspace) {
   // File back-end
   ui.file_backend_layout->setVisible(false);
 
@@ -466,8 +466,8 @@ void SlicingAlgorithmDialog::customiseLayoutForVsi(
  * @param index The property index.
  * @param propertyValue The new value of the axis dimension.
  */
-void SlicingAlgorithmDialog::resestAlignedDimProperty(size_t index,
-                                                      QString propertyValue) {
+void SlicingAlgorithmDialog::resestAlignedDimProperty(
+    size_t index, const QString &propertyValue) {
   QString alignedDim = "AlignedDim";
 
   const QString propertyName = alignedDim.append(QString().number(index));
diff --git a/qt/widgets/common/src/SlitCalculator.cpp b/qt/widgets/common/src/SlitCalculator.cpp
index 5b6b51b76cf..33b7e1d7703 100644
--- a/qt/widgets/common/src/SlitCalculator.cpp
+++ b/qt/widgets/common/src/SlitCalculator.cpp
@@ -32,7 +32,7 @@ void SlitCalculator::processInstrumentHasBeenChanged() {
   on_recalculate_triggered();
 }
 SlitCalculator::~SlitCalculator() {}
-void SlitCalculator::setInstrument(std::string instrumentName) {
+void SlitCalculator::setInstrument(const std::string &instrumentName) {
   // we want to get the most up-to-date definition, so we use the current
   // date/time
   auto date =
@@ -64,7 +64,7 @@ void SlitCalculator::setInstrument(std::string instrumentName) {
 void SlitCalculator::show() { QDialog::show(); }
 
 void SlitCalculator::setupSlitCalculatorWithInstrumentValues(
-    Mantid::Geometry::Instrument_const_sptr instrument) {
+    const Mantid::Geometry::Instrument_const_sptr &instrument) {
   // fetch the components that we need for values from IDF
   auto slit1Component = instrument->getComponentByName("slit1");
   auto slit2Component = instrument->getComponentByName("slit2");
diff --git a/qt/widgets/common/src/TSVSerialiser.cpp b/qt/widgets/common/src/TSVSerialiser.cpp
index fa34ed03c94..240460e63a4 100644
--- a/qt/widgets/common/src/TSVSerialiser.cpp
+++ b/qt/widgets/common/src/TSVSerialiser.cpp
@@ -325,7 +325,7 @@ QString TSVSerialiser::asQString(const size_t i) const {
 void TSVSerialiser::storeDouble(const double val) { m_output << "\t" << val; }
 
 void TSVSerialiser::storeInt(const int val) { m_output << "\t" << val; }
-void TSVSerialiser::storeString(const std::string val) {
+void TSVSerialiser::storeString(const std::string &val) {
   m_output << "\t" << val;
 }
 
diff --git a/qt/widgets/common/src/UserInputValidator.cpp b/qt/widgets/common/src/UserInputValidator.cpp
index 7572c5148db..c3b520b567e 100644
--- a/qt/widgets/common/src/UserInputValidator.cpp
+++ b/qt/widgets/common/src/UserInputValidator.cpp
@@ -33,7 +33,7 @@ bool doesExistInADS(std::string const &workspaceName) {
 }
 
 boost::optional<std::string>
-containsInvalidWorkspace(WorkspaceGroup_const_sptr group) {
+containsInvalidWorkspace(const WorkspaceGroup_const_sptr &group) {
   if (group->isEmpty())
     return "The group workspace " + group->getName() + " is empty.";
 
@@ -337,7 +337,7 @@ bool UserInputValidator::checkWorkspaceNumberOfHistograms(
  * @return True if the workspace has the correct size
  */
 bool UserInputValidator::checkWorkspaceNumberOfHistograms(
-    MatrixWorkspace_sptr workspace, std::size_t const &validSize) {
+    const MatrixWorkspace_sptr &workspace, std::size_t const &validSize) {
   if (workspace->getNumberHistograms() != validSize) {
     addErrorMessage(
         QString::fromStdString(workspace->getName()) + " should contain " +
@@ -370,7 +370,7 @@ bool UserInputValidator::checkWorkspaceNumberOfBins(
  * @return True if the workspace has the correct size
  */
 bool UserInputValidator::checkWorkspaceNumberOfBins(
-    MatrixWorkspace_sptr workspace, std::size_t const &validSize) {
+    const MatrixWorkspace_sptr &workspace, std::size_t const &validSize) {
   if (workspace->x(0).size() != validSize) {
     addErrorMessage(
         QString::fromStdString(workspace->getName()) + " should contain " +
diff --git a/qt/widgets/common/src/WorkspaceObserver.cpp b/qt/widgets/common/src/WorkspaceObserver.cpp
index af54813cd84..7d58b5b0b94 100644
--- a/qt/widgets/common/src/WorkspaceObserver.cpp
+++ b/qt/widgets/common/src/WorkspaceObserver.cpp
@@ -7,8 +7,10 @@
 //-----------------------------------
 // Includes
 //-----------------------------------
-#include "MantidQtWidgets/Common/WorkspaceObserver.h"
+#include <utility>
+
 #include "MantidAPI/AnalysisDataService.h"
+#include "MantidQtWidgets/Common/WorkspaceObserver.h"
 
 namespace MantidQt {
 namespace API {
@@ -18,7 +20,7 @@ namespace API {
 //---------------------------------------------------------------------------
 void ObserverCallback::handlePreDelete(const std::string &name,
                                        Mantid::API::Workspace_sptr workspace) {
-  m_observer->preDeleteHandle(name, workspace);
+  m_observer->preDeleteHandle(name, std::move(workspace));
 }
 
 void ObserverCallback::handlePostDelete(const std::string &name) {
@@ -27,12 +29,12 @@ void ObserverCallback::handlePostDelete(const std::string &name) {
 
 void ObserverCallback::handleAdd(const std::string &name,
                                  Mantid::API::Workspace_sptr workspace) {
-  m_observer->addHandle(name, workspace);
+  m_observer->addHandle(name, std::move(workspace));
 }
 
 void ObserverCallback::handleAfterReplace(
     const std::string &name, Mantid::API::Workspace_sptr workspace) {
-  m_observer->afterReplaceHandle(name, workspace);
+  m_observer->afterReplaceHandle(name, std::move(workspace));
 }
 
 void ObserverCallback::handleRename(const std::string &oldName,
diff --git a/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidget.cpp b/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidget.cpp
index 72baa7b8d2c..cf9a9136fad 100644
--- a/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidget.cpp
+++ b/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidget.cpp
@@ -883,7 +883,7 @@ MantidTreeWidgetItem *WorkspaceTreeWidget::addTreeEntry(
  * Check if a workspace should be selected after dock update.
  * @param name :: Name of a workspace to check.
  */
-bool WorkspaceTreeWidget::shouldBeSelected(QString name) const {
+bool WorkspaceTreeWidget::shouldBeSelected(const QString &name) const {
   QMutexLocker lock(&m_mutex);
   QStringList renamed = m_renameMap.keys(name);
   if (!renamed.isEmpty()) {
@@ -1114,7 +1114,7 @@ bool WorkspaceTreeWidget::hasUBMatrix(const std::string &wsName) {
  * ALGO_NAME
  * @param menuEntryName Text to be shown in menu
  */
-void WorkspaceTreeWidget::addSaveMenuOption(QString algorithmString,
+void WorkspaceTreeWidget::addSaveMenuOption(const QString &algorithmString,
                                             QString menuEntryName) {
   // Default to algo string if no entry name given
   if (menuEntryName.isEmpty())
diff --git a/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidgetSimple.cpp b/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidgetSimple.cpp
index 151c0ce6d4a..b21c583f702 100644
--- a/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidgetSimple.cpp
+++ b/qt/widgets/common/src/WorkspacePresenter/WorkspaceTreeWidgetSimple.cpp
@@ -45,7 +45,7 @@ WorkspaceTreeWidgetSimple::WorkspaceTreeWidgetSimple(bool viewOnly,
       m_showDetectors(new QAction("Show Detectors", this)) {
 
   // Replace the double click action on the MantidTreeWidget
-  m_tree->m_doubleClickAction = [&](QString wsName) {
+  m_tree->m_doubleClickAction = [&](const QString &wsName) {
     emit workspaceDoubleClicked(wsName);
   };
 
diff --git a/qt/widgets/common/src/WorkspaceSelector.cpp b/qt/widgets/common/src/WorkspaceSelector.cpp
index 69d8f4ee05f..d21f5d69936 100644
--- a/qt/widgets/common/src/WorkspaceSelector.cpp
+++ b/qt/widgets/common/src/WorkspaceSelector.cpp
@@ -246,7 +246,7 @@ void WorkspaceSelector::handleReplaceEvent(
 }
 
 bool WorkspaceSelector::checkEligibility(
-    const QString &name, Mantid::API::Workspace_sptr object) const {
+    const QString &name, const Mantid::API::Workspace_sptr &object) const {
   if (m_algorithm && !m_algPropName.isEmpty()) {
     try {
       m_algorithm->setPropertyValue(m_algPropName.toStdString(),
@@ -287,7 +287,7 @@ bool WorkspaceSelector::hasValidSuffix(const QString &name) const {
 }
 
 bool WorkspaceSelector::hasValidNumberOfBins(
-    Mantid::API::Workspace_sptr object) const {
+    const Mantid::API::Workspace_sptr &object) const {
   if (m_binLimits.first != 0 || m_binLimits.second != -1) {
     if (auto const workspace =
             boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(object)) {
diff --git a/qt/widgets/common/src/pqHelpWindow.cxx b/qt/widgets/common/src/pqHelpWindow.cxx
index 3af9bb00463..6973caf08ef 100644
--- a/qt/widgets/common/src/pqHelpWindow.cxx
+++ b/qt/widgets/common/src/pqHelpWindow.cxx
@@ -224,7 +224,7 @@ private:
 
 //-----------------------------------------------------------------------------
 pqHelpWindow::pqHelpWindow(QHelpEngine *engine, QWidget *parentObject,
-                           Qt::WindowFlags parentFlags)
+                           const Qt::WindowFlags& parentFlags)
     : Superclass(parentObject, parentFlags), m_helpEngine(engine) {
   Q_ASSERT(engine != nullptr);
   // Take ownership of the engine
diff --git a/qt/widgets/common/test/DataProcessorUI/GenericDataProcessorPresenterTest.h b/qt/widgets/common/test/DataProcessorUI/GenericDataProcessorPresenterTest.h
index 6d1e519ae89..8bbea10b4e9 100644
--- a/qt/widgets/common/test/DataProcessorUI/GenericDataProcessorPresenterTest.h
+++ b/qt/widgets/common/test/DataProcessorUI/GenericDataProcessorPresenterTest.h
@@ -9,6 +9,8 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
+#include <utility>
+
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidAPI/WorkspaceGroup.h"
@@ -432,7 +434,7 @@ private:
   // Expect the view's widgets to be set in a particular state according to
   // whether processing or not
   void expectUpdateViewState(MockDataProcessorView &mockDataProcessorView,
-                             Cardinality numTimes, bool isProcessing) {
+                             const Cardinality &numTimes, bool isProcessing) {
     // Update menu items according to whether processing or not
     EXPECT_CALL(mockDataProcessorView, updateMenuEnabledState(isProcessing))
         .Times(numTimes);
@@ -451,18 +453,20 @@ private:
   // Expect the view's widgets to be set in the paused state
   void
   expectUpdateViewToPausedState(MockDataProcessorView &mockDataProcessorView,
-                                Cardinality numTimes) {
-    expectUpdateViewState(mockDataProcessorView, numTimes, false);
+                                const Cardinality &numTimes) {
+    expectUpdateViewState(mockDataProcessorView, std::move(numTimes), false);
   }
 
   // Expect the view's widgets to be set in the processing state
   void expectUpdateViewToProcessingState(
-      MockDataProcessorView &mockDataProcessorView, Cardinality numTimes) {
-    expectUpdateViewState(mockDataProcessorView, numTimes, true);
+      MockDataProcessorView &mockDataProcessorView,
+      const Cardinality &numTimes) {
+    expectUpdateViewState(mockDataProcessorView, std::move(numTimes), true);
   }
 
   void expectGetSelection(MockDataProcessorView &mockDataProcessorView,
-                          Cardinality numTimes, RowList rowlist = RowList(),
+                          const Cardinality &numTimes,
+                          RowList rowlist = RowList(),
                           GroupList grouplist = GroupList()) {
 
     if (numTimes.IsSatisfiedByCallCount(0)) {
@@ -472,16 +476,16 @@ private:
     } else {
       EXPECT_CALL(mockDataProcessorView, getSelectedChildren())
           .Times(numTimes)
-          .WillRepeatedly(Return(rowlist));
+          .WillRepeatedly(Return(std::move(rowlist)));
       EXPECT_CALL(mockDataProcessorView, getSelectedParents())
           .Times(numTimes)
-          .WillRepeatedly(Return(grouplist));
+          .WillRepeatedly(Return(std::move(grouplist)));
     }
   }
 
   void expectGetOptions(MockMainPresenter &mockMainPresenter,
-                        Cardinality numTimes,
-                        std::string postprocessingOptions = "") {
+                        const Cardinality &numTimes,
+                        const std::string &postprocessingOptions = "") {
     if (numTimes.IsSatisfiedByCallCount(0)) {
       // If 0 calls, don't check return value
       EXPECT_CALL(mockMainPresenter, getPreprocessingOptions()).Times(numTimes);
@@ -503,7 +507,7 @@ private:
   }
 
   void expectNotebookIsDisabled(MockDataProcessorView &mockDataProcessorView,
-                                Cardinality numTimes) {
+                                const Cardinality &numTimes) {
     // Call to check whether the notebook is enabled
     if (numTimes.IsSatisfiedByCallCount(0)) {
       // If 0 calls, don't check return value
@@ -519,7 +523,7 @@ private:
   }
 
   void expectNotebookIsEnabled(MockDataProcessorView &mockDataProcessorView,
-                               Cardinality numTimes) {
+                               const Cardinality &numTimes) {
     // Call to check whether the notebook is enabled
     if (numTimes.IsSatisfiedByCallCount(0)) {
       // If 0 calls, don't check return value
@@ -535,7 +539,8 @@ private:
   }
 
   void expectGetWorkspace(MockDataProcessorView &mockDataProcessorView,
-                          Cardinality numTimes, const char *workspaceName) {
+                          const Cardinality &numTimes,
+                          const char *workspaceName) {
     if (numTimes.IsSatisfiedByCallCount(0)) {
       // If 0 calls, don't check return value
       EXPECT_CALL(mockDataProcessorView, getWorkspaceToOpen()).Times(numTimes);
@@ -547,7 +552,7 @@ private:
   }
 
   void expectAskUserWorkspaceName(MockDataProcessorView &mockDataProcessorView,
-                                  Cardinality numTimes,
+                                  const Cardinality &numTimes,
                                   const char *workspaceName = "") {
     if (numTimes.IsSatisfiedByCallCount(0)) {
       // If 0 calls, don't check return value
@@ -563,7 +568,8 @@ private:
   }
 
   void expectAskUserYesNo(MockDataProcessorView &mockDataProcessorView,
-                          Cardinality numTimes, const bool answer = false) {
+                          const Cardinality &numTimes,
+                          const bool answer = false) {
 
     if (numTimes.IsSatisfiedByCallCount(0)) {
       // If 0 calls, don't check return value
@@ -581,7 +587,7 @@ private:
   }
 
   void expectInstrumentIsINTER(MockDataProcessorView &mockDataProcessorView,
-                               Cardinality numTimes) {
+                               const Cardinality &numTimes) {
     if (numTimes.IsSatisfiedByCallCount(0)) {
       // If 0 calls, don't check return value
       EXPECT_CALL(mockDataProcessorView, getProcessInstrument())
@@ -607,12 +613,13 @@ private:
       "IvsQ_TOF_12345", "IvsQ_binned_TOF_12346",
       "IvsQ_TOF_12346", "IvsQ_TOF_12345_TOF_12346"};
 
-  void checkWorkspacesExistInADS(std::vector<std::string> workspaceNames) {
+  void
+  checkWorkspacesExistInADS(const std::vector<std::string> &workspaceNames) {
     for (auto &ws : workspaceNames)
       TS_ASSERT(AnalysisDataService::Instance().doesExist(ws));
   }
 
-  void removeWorkspacesFromADS(std::vector<std::string> workspaceNames) {
+  void removeWorkspacesFromADS(const std::vector<std::string> &workspaceNames) {
     for (auto &ws : workspaceNames)
       AnalysisDataService::Instance().remove(ws);
   }
diff --git a/qt/widgets/common/test/ProjectSaveModelTest.h b/qt/widgets/common/test/ProjectSaveModelTest.h
index 31977d77ce3..9489c88aced 100644
--- a/qt/widgets/common/test/ProjectSaveModelTest.h
+++ b/qt/widgets/common/test/ProjectSaveModelTest.h
@@ -17,6 +17,8 @@
 #include <cxxtest/TestSuite.h>
 #include <gmock/gmock.h>
 
+#include <utility>
+
 using namespace MantidQt::API;
 using namespace MantidQt::MantidWidgets;
 using namespace testing;
@@ -28,17 +30,18 @@ GNU_DIAG_OFF_SUGGEST_OVERRIDE
 class MockProjectSaveModel : public ProjectSaveModel {
 public:
   MockProjectSaveModel(
-      std::vector<MantidQt::API::IProjectSerialisable *> windows,
+      const std::vector<MantidQt::API::IProjectSerialisable *> &windows,
       std::vector<std::string> activePythonInterfaces =
           std::vector<std::string>())
-      : ProjectSaveModel(windows, activePythonInterfaces) {}
+      : ProjectSaveModel(std::move(windows),
+                         std::move(activePythonInterfaces)) {}
   MOCK_METHOD1(getProjectSize, size_t(const std::vector<std::string> &wsNames));
 };
 
 GNU_DIAG_ON_SUGGEST_OVERRIDE
 
 namespace {
-size_t calculateSize(std::vector<Workspace_sptr> workspaces) {
+size_t calculateSize(const std::vector<Workspace_sptr> &workspaces) {
   size_t result = 0;
   for (const auto &ws : workspaces) {
     result += ws->getMemorySize();
diff --git a/qt/widgets/common/test/WorkspacePresenter/WorkspacePresenterTest.h b/qt/widgets/common/test/WorkspacePresenter/WorkspacePresenterTest.h
index ce64cbfef79..916adb5874e 100644
--- a/qt/widgets/common/test/WorkspacePresenter/WorkspacePresenterTest.h
+++ b/qt/widgets/common/test/WorkspacePresenter/WorkspacePresenterTest.h
@@ -657,7 +657,7 @@ private:
   boost::shared_ptr<NiceMock<MockWorkspaceDockView>> mockView;
   WorkspacePresenterVN_sptr presenter;
 
-  void createGroup(std::string groupName) {
+  void createGroup(const std::string &groupName) {
     auto group =
         WorkspaceCreationHelper::createWorkspaceGroup(0, 10, 10, groupName);
     auto wksp1 = WorkspaceCreationHelper::create2DWorkspace(10, 10);
@@ -669,7 +669,7 @@ private:
     AnalysisDataService::Instance().addToGroup(groupName, "wksp2");
   }
 
-  void removeGroup(std::string groupName) {
+  void removeGroup(const std::string &groupName) {
     AnalysisDataService::Instance().deepRemoveGroup(groupName);
   }
 };
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentActor.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentActor.h
index dd8c977526f..12f95b9866f 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentActor.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentActor.h
@@ -216,9 +216,10 @@ signals:
   void colorMapChanged() const;
 
 private:
-  void setUpWorkspace(
-      boost::shared_ptr<const Mantid::API::MatrixWorkspace> sharedWorkspace,
-      double scaleMin, double scaleMax);
+  void
+  setUpWorkspace(const boost::shared_ptr<const Mantid::API::MatrixWorkspace>
+                     &sharedWorkspace,
+                 double scaleMin, double scaleMax);
   void setupPhysicalInstrumentIfExists();
   void resetColors();
   void loadSettings();
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentTreeWidget.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentTreeWidget.h
index eb0f5f9c17b..20a66988fdd 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentTreeWidget.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentTreeWidget.h
@@ -39,7 +39,7 @@ public:
   QStringList
   findExpandedComponents(const QModelIndex &parent = QModelIndex()) const;
 public slots:
-  void sendComponentSelectedSignal(const QModelIndex /*index*/);
+  void sendComponentSelectedSignal(const QModelIndex & /*index*/);
 signals:
   void componentSelected(size_t /*_t1*/);
 
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentWidget.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentWidget.h
index 33e697c4735..1592f4fcd6f 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentWidget.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentWidget.h
@@ -117,7 +117,7 @@ public:
   /// Recalculate the detector data and redraw the instrument view
   void updateInstrumentDetectors();
   /// Delete the peaks workspace.
-  void deletePeaksWorkspace(Mantid::API::IPeaksWorkspace_sptr pws);
+  void deletePeaksWorkspace(const Mantid::API::IPeaksWorkspace_sptr &pws);
 
   /// Alter data from a script. These just foward calls to the 3D widget
   void setColorMapMinValue(double minValue);
@@ -148,7 +148,7 @@ public:
   bool hasWorkspace(const std::string &wsName) const;
   void handleWorkspaceReplacement(
       const std::string &wsName,
-      const boost::shared_ptr<Mantid::API::Workspace> workspace);
+      const boost::shared_ptr<Mantid::API::Workspace> &workspace);
 
   /// Get the currently selected tab index
   int getCurrentTab() const;
@@ -193,7 +193,7 @@ public slots:
   void tabChanged(int /*unused*/);
   void componentSelected(size_t componentIndex);
   void executeAlgorithm(const QString & /*unused*/, const QString & /*unused*/);
-  void executeAlgorithm(Mantid::API::IAlgorithm_sptr /*alg*/);
+  void executeAlgorithm(const Mantid::API::IAlgorithm_sptr & /*alg*/);
 
   void setupColorMap();
 
@@ -325,11 +325,11 @@ private:
                     const std::string &newName) override;
   void clearADSHandle() override;
   /// overlay a peaks workspace on the projection surface
-  void overlayPeaksWorkspace(Mantid::API::IPeaksWorkspace_sptr ws);
+  void overlayPeaksWorkspace(const Mantid::API::IPeaksWorkspace_sptr &ws);
   /// overlay a masked workspace on the projection surface
-  void overlayMaskedWorkspace(Mantid::API::IMaskWorkspace_sptr ws);
+  void overlayMaskedWorkspace(const Mantid::API::IMaskWorkspace_sptr &ws);
   /// overlay a table workspace with shape parameters on the projection surface
-  void overlayShapesWorkspace(Mantid::API::ITableWorkspace_sptr /*ws*/);
+  void overlayShapesWorkspace(const Mantid::API::ITableWorkspace_sptr & /*ws*/);
   /// get a workspace from the ADS
   Mantid::API::Workspace_sptr getWorkspaceFromADS(const std::string &name);
   /// get a handle to the unwrapped surface
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentWidgetRenderTab.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentWidgetRenderTab.h
index e5f9794f2b9..fc2dce20e27 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentWidgetRenderTab.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/InstrumentWidgetRenderTab.h
@@ -71,7 +71,7 @@ public slots:
   void changeColorMap(const QString &filename = "");
   void setSurfaceType(int /*index*/);
   void flipUnwrappedView(bool /*on*/);
-  void saveImage(QString filename = "");
+  void saveImage(const QString &filename = "");
 
 private slots:
 
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/MantidGLWidget.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/MantidGLWidget.h
index 19216c20d91..049049a3fbc 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/MantidGLWidget.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/MantidGLWidget.h
@@ -30,7 +30,7 @@ public:
   void setSurface(boost::shared_ptr<ProjectionSurface> surface);
   boost::shared_ptr<ProjectionSurface> getSurface() { return m_surface; }
 
-  void setBackgroundColor(QColor /*input*/);
+  void setBackgroundColor(const QColor & /*input*/);
   QColor currentBackgroundColor() const;
   void saveToFile(const QString &filename);
   // int getLightingState() const {return m_lightingState;}
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PeakMarker2D.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PeakMarker2D.h
index 36265b569ee..5935ef11dc2 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PeakMarker2D.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PeakMarker2D.h
@@ -6,6 +6,8 @@
 // SPDX - License - Identifier: GPL - 3.0 +
 #pragma once
 
+#include <utility>
+
 #include "MantidGeometry/Crystal/IPeak.h"
 #include "Shape2D.h"
 
@@ -23,8 +25,9 @@ class PeakMarker2D : public Shape2D {
 public:
   enum Symbol { Circle = 0, Diamond, Square };
   struct Style {
-    Style(Symbol sb = Circle, QColor c = Qt::red, int sz = g_defaultMarkerSize)
-        : symbol(sb), color(c), size(sz) {}
+    Style(Symbol sb = Circle, const QColor &c = Qt::red,
+          int sz = g_defaultMarkerSize)
+        : symbol(sb), color(std::move(c)), size(sz) {}
     Symbol symbol;
     QColor color;
     int size;
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PeakOverlay.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PeakOverlay.h
index d3f4595fdac..134d4f8eb1c 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PeakOverlay.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PeakOverlay.h
@@ -122,7 +122,7 @@ class PeakOverlay : public Shape2DCollection,
   Q_OBJECT
 public:
   PeakOverlay(UnwrappedSurface *surface,
-              boost::shared_ptr<Mantid::API::IPeaksWorkspace> pws);
+              const boost::shared_ptr<Mantid::API::IPeaksWorkspace> &pws);
   ~PeakOverlay() override {}
   /// Override the drawing method
   void draw(QPainter &painter) const override;
@@ -146,7 +146,7 @@ public:
   void setShowLabelsFlag(bool yes) { m_showLabels = yes; }
   void setShowRelativeIntensityFlag(bool yes);
   static PeakMarker2D::Style getDefaultStyle(int index);
-  void setPeakVisibility(double xmin, double xmax, QString units);
+  void setPeakVisibility(double xmin, double xmax, const QString &units);
 
 signals:
   void executeAlgorithm(Mantid::API::IAlgorithm_sptr /*_t1*/);
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneModel.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneModel.h
index 3084622be38..d3f799633cf 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneModel.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneModel.h
@@ -19,7 +19,7 @@ class PlotFitAnalysisPaneModel {
 public:
   IFunction_sptr doFit(const std::string &wsName,
                        const std::pair<double, double> &range,
-                       const IFunction_sptr func);
+                       const IFunction_sptr &func);
 };
 
 } // namespace MantidWidgets
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneView.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneView.h
index 51db83e9ceb..63764ebde7e 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneView.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PlotFitAnalysisPaneView.h
@@ -35,10 +35,10 @@ public:
   };
   std::pair<double, double> getRange();
   Mantid::API::IFunction_sptr getFunction();
-  void addSpectrum(std::string wsName);
-  void addFitSpectrum(std::string wsName);
+  void addSpectrum(const std::string &wsName);
+  void addFitSpectrum(const std::string &wsName);
   void addFunction(Mantid::API::IFunction_sptr func);
-  void updateFunction(Mantid::API::IFunction_sptr func);
+  void updateFunction(const Mantid::API::IFunction_sptr &func);
   void fitWarning(const std::string &message);
 
 public slots:
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/ProjectionSurface.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/ProjectionSurface.h
index 4d13f8079d6..3e557dc36d0 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/ProjectionSurface.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/ProjectionSurface.h
@@ -235,7 +235,8 @@ public:
   /// Save masks to a table workspace
   void saveShapesToTableWorkspace();
   /// Load masks from a table workspace
-  void loadShapesFromTableWorkspace(Mantid::API::ITableWorkspace_const_sptr ws);
+  void loadShapesFromTableWorkspace(
+      const Mantid::API::ITableWorkspace_const_sptr &ws);
 
   //-----------------------------------
   //    Peaks overlay methods
@@ -244,7 +245,8 @@ public:
   QList<PeakMarker2D *> getMarkersWithID(int detID) const;
   boost::shared_ptr<Mantid::API::IPeaksWorkspace> getEditPeaksWorkspace() const;
   QStringList getPeaksWorkspaceNames() const;
-  void deletePeaksWorkspace(boost::shared_ptr<Mantid::API::IPeaksWorkspace> ws);
+  void deletePeaksWorkspace(
+      const boost::shared_ptr<Mantid::API::IPeaksWorkspace> &ws);
   void clearPeakOverlays();
   void clearAlignmentPlane();
   void clearComparisonPeaks();
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/Shape2DCollection.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/Shape2DCollection.h
index eefdd65ed15..4546c0b021a 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/Shape2DCollection.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/Shape2DCollection.h
@@ -96,7 +96,8 @@ public:
   /// Save shape collection to a Table workspace
   void saveToTableWorkspace();
   /// Load shape collectio from a Table workspace
-  void loadFromTableWorkspace(Mantid::API::ITableWorkspace_const_sptr ws);
+  void
+  loadFromTableWorkspace(const Mantid::API::ITableWorkspace_const_sptr &ws);
   /// Load settings for the shape 2D collection from a project file
   virtual void loadFromProject(const std::string &lines);
   /// Save settings for the shape 2D collection to a project file
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/UnwrappedDetector.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/UnwrappedDetector.h
index 28a33c3632a..9a35771d759 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/UnwrappedDetector.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/UnwrappedDetector.h
@@ -34,7 +34,7 @@ This class keeps information used to draw a detector on an unwrapped surface.
 class UnwrappedDetector {
 public:
   UnwrappedDetector();
-  UnwrappedDetector(GLColor color, size_t detIndex);
+  UnwrappedDetector(const GLColor &color, size_t detIndex);
   UnwrappedDetector(const UnwrappedDetector &other);
   UnwrappedDetector &operator=(const UnwrappedDetector &other);
   bool empty() const;
diff --git a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/UnwrappedSurface.h b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/UnwrappedSurface.h
index 84a3d5934d3..44b56e70a32 100644
--- a/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/UnwrappedSurface.h
+++ b/qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/UnwrappedSurface.h
@@ -67,7 +67,8 @@ public:
   void componentSelected(size_t componentIndex) override;
   void getSelectedDetectors(std::vector<size_t> &detIndices) override;
   void getMaskedDetectors(std::vector<size_t> &detIndices) const override;
-  void setPeaksWorkspace(boost::shared_ptr<Mantid::API::IPeaksWorkspace> pws);
+  void
+  setPeaksWorkspace(const boost::shared_ptr<Mantid::API::IPeaksWorkspace> &pws);
   QString getInfoText() const override;
   RectF getSurfaceBounds() const override;
   //@}
diff --git a/qt/widgets/instrumentview/src/InstrumentActor.cpp b/qt/widgets/instrumentview/src/InstrumentActor.cpp
index 43de0c06ec5..b82e8973674 100644
--- a/qt/widgets/instrumentview/src/InstrumentActor.cpp
+++ b/qt/widgets/instrumentview/src/InstrumentActor.cpp
@@ -38,6 +38,7 @@
 
 #include <limits>
 #include <numeric>
+#include <utility>
 
 using namespace Mantid::Kernel::Exception;
 using namespace Mantid::Geometry;
@@ -140,7 +141,8 @@ InstrumentActor::~InstrumentActor() { saveSettings(); }
  * value is ignored.
  */
 void InstrumentActor::setUpWorkspace(
-    boost::shared_ptr<const Mantid::API::MatrixWorkspace> sharedWorkspace,
+    const boost::shared_ptr<const Mantid::API::MatrixWorkspace>
+        &sharedWorkspace,
     double scaleMin, double scaleMax) {
   m_WkspBinMinValue = DBL_MAX;
   m_WkspBinMaxValue = -DBL_MAX;
@@ -257,7 +259,7 @@ MatrixWorkspace_sptr InstrumentActor::getMaskMatrixWorkspace() const {
  */
 void InstrumentActor::setMaskMatrixWorkspace(
     MatrixWorkspace_sptr wsMask) const {
-  m_maskWorkspace = wsMask;
+  m_maskWorkspace = std::move(wsMask);
 }
 
 void InstrumentActor::invertMaskWorkspace() const {
diff --git a/qt/widgets/instrumentview/src/InstrumentTreeWidget.cpp b/qt/widgets/instrumentview/src/InstrumentTreeWidget.cpp
index 5809d78c549..558c6dbce2f 100644
--- a/qt/widgets/instrumentview/src/InstrumentTreeWidget.cpp
+++ b/qt/widgets/instrumentview/src/InstrumentTreeWidget.cpp
@@ -70,7 +70,7 @@ InstrumentTreeWidget::findComponentByName(const QString &name) const {
 }
 
 void InstrumentTreeWidget::sendComponentSelectedSignal(
-    const QModelIndex index) {
+    const QModelIndex &index) {
   auto selectedIndex = InstrumentTreeModel::extractIndex(index);
   m_instrWidget->getInstrumentActor().setComponentVisible(selectedIndex);
   emit componentSelected(selectedIndex);
diff --git a/qt/widgets/instrumentview/src/InstrumentWidget.cpp b/qt/widgets/instrumentview/src/InstrumentWidget.cpp
index a2b103af25c..dd0dab3d9d2 100644
--- a/qt/widgets/instrumentview/src/InstrumentWidget.cpp
+++ b/qt/widgets/instrumentview/src/InstrumentWidget.cpp
@@ -65,6 +65,7 @@
 
 #include <numeric>
 #include <stdexcept>
+#include <utility>
 
 using namespace Mantid::API;
 using namespace Mantid::Geometry;
@@ -893,7 +894,8 @@ void InstrumentWidget::executeAlgorithm(const QString & /*unused*/,
   // emit execMantidAlgorithm(alg_name, param_list, this);
 }
 
-void InstrumentWidget::executeAlgorithm(Mantid::API::IAlgorithm_sptr alg) {
+void InstrumentWidget::executeAlgorithm(
+    const Mantid::API::IAlgorithm_sptr &alg) {
   try {
     alg->executeAsync();
   } catch (Poco::NoThreadAvailableException &) {
@@ -1184,8 +1186,8 @@ void InstrumentWidget::updateInstrumentDetectors() {
 }
 
 void InstrumentWidget::deletePeaksWorkspace(
-    Mantid::API::IPeaksWorkspace_sptr pws) {
-  this->getSurface()->deletePeaksWorkspace(pws);
+    const Mantid::API::IPeaksWorkspace_sptr &pws) {
+  this->getSurface()->deletePeaksWorkspace(std::move(pws));
   updateInstrumentView();
 }
 
@@ -1336,7 +1338,7 @@ bool InstrumentWidget::hasWorkspace(const std::string &wsName) const {
 }
 
 void InstrumentWidget::handleWorkspaceReplacement(
-    const std::string &wsName, const boost::shared_ptr<Workspace> workspace) {
+    const std::string &wsName, const boost::shared_ptr<Workspace> &workspace) {
   if (!hasWorkspace(wsName) || !m_instrumentActor) {
     return;
   }
@@ -1400,10 +1402,10 @@ void InstrumentWidget::clearADSHandle() {
  * Overlay a peaks workspace on the surface projection
  * @param ws :: peaks workspace to overlay
  */
-void InstrumentWidget::overlayPeaksWorkspace(IPeaksWorkspace_sptr ws) {
+void InstrumentWidget::overlayPeaksWorkspace(const IPeaksWorkspace_sptr &ws) {
   auto surface = getUnwrappedSurface();
   if (surface) {
-    surface->setPeaksWorkspace(ws);
+    surface->setPeaksWorkspace(std::move(ws));
     updateInstrumentView();
   }
 }
@@ -1412,7 +1414,7 @@ void InstrumentWidget::overlayPeaksWorkspace(IPeaksWorkspace_sptr ws) {
  * Overlay a mask workspace on the surface projection
  * @param ws :: mask workspace to overlay
  */
-void InstrumentWidget::overlayMaskedWorkspace(IMaskWorkspace_sptr ws) {
+void InstrumentWidget::overlayMaskedWorkspace(const IMaskWorkspace_sptr &ws) {
   auto &actor = getInstrumentActor();
   actor.setMaskMatrixWorkspace(
       boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(ws));
@@ -1425,7 +1427,7 @@ void InstrumentWidget::overlayMaskedWorkspace(IMaskWorkspace_sptr ws) {
  * Overlay a table workspace containing shape parameters
  * @param ws :: a workspace of shape parameters to create
  */
-void InstrumentWidget::overlayShapesWorkspace(ITableWorkspace_sptr ws) {
+void InstrumentWidget::overlayShapesWorkspace(const ITableWorkspace_sptr &ws) {
   auto surface = getUnwrappedSurface();
   if (surface) {
     surface->loadShapesFromTableWorkspace(ws);
diff --git a/qt/widgets/instrumentview/src/InstrumentWidgetRenderTab.cpp b/qt/widgets/instrumentview/src/InstrumentWidgetRenderTab.cpp
index 6b212df0eb0..1709377cd17 100644
--- a/qt/widgets/instrumentview/src/InstrumentWidgetRenderTab.cpp
+++ b/qt/widgets/instrumentview/src/InstrumentWidgetRenderTab.cpp
@@ -35,6 +35,7 @@
 #include "MantidQtWidgets/InstrumentView/InstrumentWidget.h"
 
 #include <limits>
+#include <utility>
 
 namespace MantidQt {
 namespace MantidWidgets {
@@ -610,8 +611,8 @@ void InstrumentWidgetRenderTab::flipUnwrappedView(bool on) {
  * for finding the file
  * @param filename Optional full path of the saved image
  */
-void InstrumentWidgetRenderTab::saveImage(QString filename) {
-  m_instrWidget->saveImage(filename);
+void InstrumentWidgetRenderTab::saveImage(const QString &filename) {
+  m_instrWidget->saveImage(std::move(filename));
 }
 
 /**
diff --git a/qt/widgets/instrumentview/src/MantidGLWidget.cpp b/qt/widgets/instrumentview/src/MantidGLWidget.cpp
index de77556d24a..227fe14cefc 100644
--- a/qt/widgets/instrumentview/src/MantidGLWidget.cpp
+++ b/qt/widgets/instrumentview/src/MantidGLWidget.cpp
@@ -23,6 +23,7 @@
 #include <map>
 #include <string>
 #include <typeinfo>
+#include <utility>
 
 namespace MantidQt {
 namespace MantidWidgets {
@@ -57,7 +58,7 @@ MantidGLWidget::MantidGLWidget(QWidget *parent)
 MantidGLWidget::~MantidGLWidget() {}
 
 void MantidGLWidget::setSurface(boost::shared_ptr<ProjectionSurface> surface) {
-  m_surface = surface;
+  m_surface = std::move(surface);
   connect(m_surface.get(), SIGNAL(redrawRequired()), this, SLOT(repaint()),
           Qt::QueuedConnection);
   m_firstFrame = true;
@@ -227,7 +228,7 @@ void MantidGLWidget::keyReleaseEvent(QKeyEvent *event) {
 /**
  * This method set the background color.
  */
-void MantidGLWidget::setBackgroundColor(QColor input) {
+void MantidGLWidget::setBackgroundColor(const QColor &input) {
   makeCurrent();
   glClearColor(GLclampf(input.red() / 255.0), GLclampf(input.green() / 255.0),
                GLclampf(input.blue() / 255.0), 1.0);
diff --git a/qt/widgets/instrumentview/src/MiniPlotMpl.cpp b/qt/widgets/instrumentview/src/MiniPlotMpl.cpp
index 4ecdb1aea43..1a721c83a08 100644
--- a/qt/widgets/instrumentview/src/MiniPlotMpl.cpp
+++ b/qt/widgets/instrumentview/src/MiniPlotMpl.cpp
@@ -20,6 +20,7 @@
 #include <QPushButton>
 #include <QSpacerItem>
 #include <QVBoxLayout>
+#include <utility>
 
 using Mantid::PythonInterface::GlobalInterpreterLock;
 using MantidQt::Widgets::MplCpp::cycler;
@@ -116,7 +117,7 @@ void MiniPlotMpl::setData(std::vector<double> x, std::vector<double> y,
   // plot automatically calls "scalex=True, scaley=True"
   m_lines.emplace_back(
       axes.plot(std::move(x), std::move(y), ACTIVE_CURVE_FORMAT));
-  m_activeCurveLabel = curveLabel;
+  m_activeCurveLabel = std::move(curveLabel);
   setXLabel(std::move(xunit));
   // If the current axis limits can fit the data then matplotlib
   // won't change the axis scale. If the intensity of different plots
diff --git a/qt/widgets/instrumentview/src/MiniPlotQwt.cpp b/qt/widgets/instrumentview/src/MiniPlotQwt.cpp
index f8d5806e4dc..82834669135 100644
--- a/qt/widgets/instrumentview/src/MiniPlotQwt.cpp
+++ b/qt/widgets/instrumentview/src/MiniPlotQwt.cpp
@@ -24,6 +24,7 @@
 #include <QPainter>
 
 #include <cmath>
+#include <utility>
 
 namespace {
 Mantid::Kernel::Logger g_log("MiniPlotQwt");
@@ -72,7 +73,7 @@ MiniPlotQwt::~MiniPlotQwt() { clearAll(); }
  * @param xunit
  */
 void MiniPlotQwt::setXLabel(QString xunit) {
-  m_xUnits = xunit;
+  m_xUnits = std::move(xunit);
   this->setAxisTitle(xBottom, m_xUnits);
 }
 
@@ -238,8 +239,8 @@ void MiniPlotQwt::setData(std::vector<double> x, std::vector<double> y,
     return;
   }
 
-  m_xUnits = xunit;
-  m_label = curveLabel;
+  m_xUnits = std::move(xunit);
+  m_label = std::move(curveLabel);
   if (!m_curve) {
     m_curve = new QwtPlotCurve();
     m_curve->attach(this);
diff --git a/qt/widgets/instrumentview/src/PeakOverlay.cpp b/qt/widgets/instrumentview/src/PeakOverlay.cpp
index 05ef068ed7b..9311990a846 100644
--- a/qt/widgets/instrumentview/src/PeakOverlay.cpp
+++ b/qt/widgets/instrumentview/src/PeakOverlay.cpp
@@ -176,8 +176,9 @@ int QualitativeIntensityScale::getIntensityLevel(double intensity) const {
 /**---------------------------------------------------------------------
  * Constructor
  */
-PeakOverlay::PeakOverlay(UnwrappedSurface *surface,
-                         boost::shared_ptr<Mantid::API::IPeaksWorkspace> pws)
+PeakOverlay::PeakOverlay(
+    UnwrappedSurface *surface,
+    const boost::shared_ptr<Mantid::API::IPeaksWorkspace> &pws)
     : Shape2DCollection(), m_peaksWorkspace(pws), m_surface(surface),
       m_precision(6), m_showRows(true), m_showLabels(true),
       m_peakIntensityScale(std::make_unique<QualitativeIntensityScale>(pws)) {
@@ -416,7 +417,8 @@ PeakMarker2D::Style PeakOverlay::getDefaultStyle(int index) {
  * @param units :: Units of the x - array in the underlying workspace:
  *     "TOF", "dSpacing", or "Wavelength".
  */
-void PeakOverlay::setPeakVisibility(double xmin, double xmax, QString units) {
+void PeakOverlay::setPeakVisibility(double xmin, double xmax,
+                                    const QString &units) {
   enum XUnits { Unknown, TOF, dSpacing, Wavelength };
   XUnits xUnits = Unknown;
   if (units == "TOF")
diff --git a/qt/widgets/instrumentview/src/PlotFitAnalysisPaneModel.cpp b/qt/widgets/instrumentview/src/PlotFitAnalysisPaneModel.cpp
index d31692b9474..0b5e38f9cb4 100644
--- a/qt/widgets/instrumentview/src/PlotFitAnalysisPaneModel.cpp
+++ b/qt/widgets/instrumentview/src/PlotFitAnalysisPaneModel.cpp
@@ -15,7 +15,7 @@ namespace MantidWidgets {
 IFunction_sptr
 PlotFitAnalysisPaneModel::doFit(const std::string &wsName,
                                 const std::pair<double, double> &range,
-                                IFunction_sptr func) {
+                                const IFunction_sptr &func) {
 
   IAlgorithm_sptr alg = AlgorithmManager::Instance().create("Fit");
   alg->initialize();
diff --git a/qt/widgets/instrumentview/src/PlotFitAnalysisPanePresenter.cpp b/qt/widgets/instrumentview/src/PlotFitAnalysisPanePresenter.cpp
index 73b45b00ffd..792eab37517 100644
--- a/qt/widgets/instrumentview/src/PlotFitAnalysisPanePresenter.cpp
+++ b/qt/widgets/instrumentview/src/PlotFitAnalysisPanePresenter.cpp
@@ -9,6 +9,7 @@
 #include <exception>
 #include <functional>
 #include <tuple>
+#include <utility>
 
 namespace MantidQt {
 namespace MantidWidgets {
@@ -42,7 +43,7 @@ void PlotFitAnalysisPanePresenter::doFit() {
 
 void PlotFitAnalysisPanePresenter::addFunction(
     Mantid::API::IFunction_sptr func) {
-  m_view->addFunction(func);
+  m_view->addFunction(std::move(func));
 }
 
 void PlotFitAnalysisPanePresenter::addSpectrum(const std::string &wsName) {
diff --git a/qt/widgets/instrumentview/src/PlotFitAnalysisPaneView.cpp b/qt/widgets/instrumentview/src/PlotFitAnalysisPaneView.cpp
index 5f2ea400054..044ea34f26d 100644
--- a/qt/widgets/instrumentview/src/PlotFitAnalysisPaneView.cpp
+++ b/qt/widgets/instrumentview/src/PlotFitAnalysisPaneView.cpp
@@ -15,6 +15,8 @@
 #include <QSpacerItem>
 #include <QSplitter>
 #include <QVBoxLayout>
+#include <utility>
+
 namespace MantidQt {
 namespace MantidWidgets {
 
@@ -86,10 +88,10 @@ void PlotFitAnalysisPaneView::doFit() {
   }
 }
 
-void PlotFitAnalysisPaneView::addSpectrum(std::string wsName) {
+void PlotFitAnalysisPaneView::addSpectrum(const std::string &wsName) {
   m_plot->addSpectrum("Extracted Data", wsName.c_str(), 0, Qt::black);
 }
-void PlotFitAnalysisPaneView::addFitSpectrum(std::string wsName) {
+void PlotFitAnalysisPaneView::addFitSpectrum(const std::string &wsName) {
   m_plot->addSpectrum("Fitted Data", wsName.c_str(), 1, Qt::red);
 }
 
@@ -103,12 +105,13 @@ Mantid::API::IFunction_sptr PlotFitAnalysisPaneView::getFunction() {
   return m_fitBrowser->getFunction();
 }
 
-void PlotFitAnalysisPaneView::updateFunction(Mantid::API::IFunction_sptr func) {
+void PlotFitAnalysisPaneView::updateFunction(
+    const Mantid::API::IFunction_sptr &func) {
   m_fitBrowser->updateMultiDatasetParameters(*func);
 }
 
 void PlotFitAnalysisPaneView::addFunction(Mantid::API::IFunction_sptr func) {
-  m_fitBrowser->setFunction(func);
+  m_fitBrowser->setFunction(std::move(func));
 }
 
 void PlotFitAnalysisPaneView::fitWarning(const std::string &message) {
diff --git a/qt/widgets/instrumentview/src/ProjectionSurface.cpp b/qt/widgets/instrumentview/src/ProjectionSurface.cpp
index 350e38d7e99..9b9d0667480 100644
--- a/qt/widgets/instrumentview/src/ProjectionSurface.cpp
+++ b/qt/widgets/instrumentview/src/ProjectionSurface.cpp
@@ -33,6 +33,7 @@
 #include <cfloat>
 #include <cmath>
 #include <limits>
+#include <utility>
 
 using Mantid::Kernel::V3D;
 
@@ -689,8 +690,8 @@ void ProjectionSurface::saveShapesToTableWorkspace() {
  * @param ws :: table workspace to load shapes from
  */
 void ProjectionSurface::loadShapesFromTableWorkspace(
-    Mantid::API::ITableWorkspace_const_sptr ws) {
-  m_maskShapes.loadFromTableWorkspace(ws);
+    const Mantid::API::ITableWorkspace_const_sptr &ws) {
+  m_maskShapes.loadFromTableWorkspace(std::move(ws));
 }
 
 /**
@@ -721,7 +722,7 @@ ProjectionSurface::getEditPeaksWorkspace() const {
  * @param ws :: Shared pointer to the deleted peaks workspace.
  */
 void ProjectionSurface::deletePeaksWorkspace(
-    boost::shared_ptr<Mantid::API::IPeaksWorkspace> ws) {
+    const boost::shared_ptr<Mantid::API::IPeaksWorkspace> &ws) {
   const int npeaks = m_peakShapes.size();
   for (int i = 0; i < npeaks; ++i) {
     if (m_peakShapes[i]->getPeaksWorkspace() == ws) {
diff --git a/qt/widgets/instrumentview/src/Shape2DCollection.cpp b/qt/widgets/instrumentview/src/Shape2DCollection.cpp
index 31fa6c27c80..762dfc384f2 100644
--- a/qt/widgets/instrumentview/src/Shape2DCollection.cpp
+++ b/qt/widgets/instrumentview/src/Shape2DCollection.cpp
@@ -677,7 +677,7 @@ void Shape2DCollection::saveToTableWorkspace() {
  * @param ws :: table workspace to load shapes from.
  */
 void Shape2DCollection::loadFromTableWorkspace(
-    Mantid::API::ITableWorkspace_const_sptr ws) {
+    const Mantid::API::ITableWorkspace_const_sptr &ws) {
   using namespace Mantid::API;
   auto columnNames = ws->getColumnNames();
 
diff --git a/qt/widgets/instrumentview/src/SimpleWidget.cpp b/qt/widgets/instrumentview/src/SimpleWidget.cpp
index aad5c279317..8b1842ded58 100644
--- a/qt/widgets/instrumentview/src/SimpleWidget.cpp
+++ b/qt/widgets/instrumentview/src/SimpleWidget.cpp
@@ -9,6 +9,7 @@
 
 #include <QApplication>
 #include <QPixmap>
+#include <utility>
 
 namespace MantidQt {
 namespace MantidWidgets {
@@ -25,7 +26,7 @@ SimpleWidget::~SimpleWidget() {}
 
 /// Assign a surface to draw on
 void SimpleWidget::setSurface(boost::shared_ptr<ProjectionSurface> surface) {
-  m_surface = surface;
+  m_surface = std::move(surface);
   connect(m_surface.get(), SIGNAL(redrawRequired()), this, SLOT(repaint()),
           Qt::QueuedConnection);
 }
diff --git a/qt/widgets/instrumentview/src/UnwrappedDetector.cpp b/qt/widgets/instrumentview/src/UnwrappedDetector.cpp
index fde0abeff9e..6e09fd0c777 100644
--- a/qt/widgets/instrumentview/src/UnwrappedDetector.cpp
+++ b/qt/widgets/instrumentview/src/UnwrappedDetector.cpp
@@ -18,7 +18,7 @@ UnwrappedDetector::UnwrappedDetector()
   color = GLColor(0, 0, 0);
 }
 
-UnwrappedDetector::UnwrappedDetector(GLColor color, size_t detIndex)
+UnwrappedDetector::UnwrappedDetector(const GLColor &color, size_t detIndex)
     : u(0), v(0), width(0), height(0), uscale(0), vscale(0),
       detIndex(detIndex) {
   this->color = color;
diff --git a/qt/widgets/instrumentview/src/UnwrappedSurface.cpp b/qt/widgets/instrumentview/src/UnwrappedSurface.cpp
index 4661474e0b4..81bd7c3068d 100644
--- a/qt/widgets/instrumentview/src/UnwrappedSurface.cpp
+++ b/qt/widgets/instrumentview/src/UnwrappedSurface.cpp
@@ -226,8 +226,9 @@ void UnwrappedSurface::setColor(size_t index, bool picking) const {
   }
 }
 
-bool hasParent(boost::shared_ptr<const Mantid::Geometry::IComponent> comp,
-               Mantid::Geometry::ComponentID id) {
+bool hasParent(
+    const boost::shared_ptr<const Mantid::Geometry::IComponent> &comp,
+    Mantid::Geometry::ComponentID id) {
   boost::shared_ptr<const Mantid::Geometry::IComponent> parent =
       comp->getParent();
   if (!parent)
@@ -362,7 +363,7 @@ RectF UnwrappedSurface::getSurfaceBounds() const { return m_viewRect; }
  * @param pws :: A shared pointer to the workspace.
  */
 void UnwrappedSurface::setPeaksWorkspace(
-    boost::shared_ptr<Mantid::API::IPeaksWorkspace> pws) {
+    const boost::shared_ptr<Mantid::API::IPeaksWorkspace> &pws) {
   if (!pws) {
     return;
   }
diff --git a/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Artist.h b/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Artist.h
index 6e8ccc10081..e00b29ba706 100644
--- a/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Artist.h
+++ b/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Artist.h
@@ -21,7 +21,7 @@ public:
   // Holds a reference to the matplotlib artist object
   explicit Artist(Common::Python::Object obj);
 
-  void set(Common::Python::Dict kwargs);
+  void set(const Common::Python::Dict &kwargs);
   void remove();
 };
 
diff --git a/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Axes.h b/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Axes.h
index b9bdf7ee611..c85cd575f37 100644
--- a/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Axes.h
+++ b/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Axes.h
@@ -27,7 +27,7 @@ public:
   /// Function-signature required for operation applied to each artist
   using ArtistOperation = std::function<void(Artist &&)>;
   void forEachArtist(const char *containerAttr, const ArtistOperation &op);
-  void removeArtists(const char *containerAttr, const QString label);
+  void removeArtists(const char *containerAttr, const QString &label);
   void setXLabel(const char *label);
   void setYLabel(const char *label);
   void setTitle(const char *label);
@@ -40,8 +40,8 @@ public:
   Line2D plot(std::vector<double> xdata, std::vector<double> ydata,
               const char *format = "b-");
   Line2D plot(std::vector<double> xdata, std::vector<double> ydata,
-              const QString format, const QString label);
-  Artist text(double x, double y, QString text,
+              const QString &format, const QString &label);
+  Artist text(double x, double y, const QString &text,
               const char *horizontalAlignment);
   /// @}
 
diff --git a/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Cycler.h b/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Cycler.h
index cc1bd6f7e7e..64058256db2 100644
--- a/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Cycler.h
+++ b/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Cycler.h
@@ -24,7 +24,7 @@ namespace MplCpp {
  */
 class MANTID_MPLCPP_DLL Cycler : public Common::Python::InstanceHolder {
 public:
-  Cycler(Common::Python::Object obj);
+  Cycler(const Common::Python::Object &obj);
 
   /// Return the next value in the sequence
   Common::Python::Dict operator()() const;
diff --git a/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Figure.h b/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Figure.h
index a38a3b10d9a..61c1171108b 100644
--- a/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Figure.h
+++ b/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/Figure.h
@@ -46,10 +46,10 @@ public:
 
   void setTightLayout(QHash<QString, QVariant> const &args);
   QColor faceColor() const;
-  void setFaceColor(const QColor color);
+  void setFaceColor(const QColor &color);
   void setFaceColor(const char *color);
   Axes addAxes(double left, double bottom, double width, double height);
-  Axes addSubPlot(const int subplotspec, const QString projection = "");
+  Axes addSubPlot(const int subplotspec, const QString &projection = "");
   Common::Python::Object
   colorbar(const ScalarMappable &mappable, const Axes &cax,
            const Common::Python::Object &ticks = Common::Python::Object(),
diff --git a/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/FigureCanvasQt.h b/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/FigureCanvasQt.h
index eb11150f311..63320a265a1 100644
--- a/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/FigureCanvasQt.h
+++ b/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/FigureCanvasQt.h
@@ -26,7 +26,7 @@ class MANTID_MPLCPP_DLL FigureCanvasQt : public QWidget,
                                          public Common::Python::InstanceHolder {
   Q_OBJECT
 public:
-  FigureCanvasQt(const int subplotspec, const QString projection = "",
+  FigureCanvasQt(const int subplotspec, const QString &projection = "",
                  QWidget *parent = nullptr);
   FigureCanvasQt(Figure fig, QWidget *parent = nullptr);
 
diff --git a/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/MantidAxes.h b/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/MantidAxes.h
index 07e10c44501..23730a5fafa 100644
--- a/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/MantidAxes.h
+++ b/qt/widgets/mplcpp/inc/MantidQtWidgets/MplCpp/MantidAxes.h
@@ -30,13 +30,13 @@ public:
   /// @name Plot creation functions
   ///@{
   Line2D plot(const Mantid::API::MatrixWorkspace_sptr &workspace,
-              const size_t wkspIndex, const QString lineColour,
-              const QString label,
+              const size_t wkspIndex, const QString &lineColour,
+              const QString &label,
               const boost::optional<QHash<QString, QVariant>> &otherKwargs =
                   boost::none);
   ErrorbarContainer errorbar(const Mantid::API::MatrixWorkspace_sptr &workspace,
-                             const size_t wkspIndex, const QString lineColour,
-                             const QString label,
+                             const size_t wkspIndex, const QString &lineColour,
+                             const QString &label,
                              const boost::optional<QHash<QString, QVariant>>
                                  &otherKwargs = boost::none);
   void pcolormesh(const Mantid::API::MatrixWorkspace_sptr &workspace,
diff --git a/qt/widgets/mplcpp/src/Artist.cpp b/qt/widgets/mplcpp/src/Artist.cpp
index e6044471c6b..cb5ef776d85 100644
--- a/qt/widgets/mplcpp/src/Artist.cpp
+++ b/qt/widgets/mplcpp/src/Artist.cpp
@@ -26,7 +26,7 @@ Artist::Artist(Python::Object obj) : InstanceHolder(std::move(obj), "draw") {}
  * Set properties on the Artist given by the dict of kwargs
  * @param kwargs A dict of known matplotlib.artist.Artist properties
  */
-void Artist::set(Python::Dict kwargs) {
+void Artist::set(const Python::Dict &kwargs) {
   GlobalInterpreterLock lock;
   auto args = Python::NewRef(Py_BuildValue("()"));
   pyobj().attr("set")(*args, **kwargs);
diff --git a/qt/widgets/mplcpp/src/Axes.cpp b/qt/widgets/mplcpp/src/Axes.cpp
index e950f310831..09d8e8869ee 100644
--- a/qt/widgets/mplcpp/src/Axes.cpp
+++ b/qt/widgets/mplcpp/src/Axes.cpp
@@ -85,7 +85,7 @@ void Axes::forEachArtist(const char *containerAttr, const ArtistOperation &op) {
  * @param containerAttr The name of the container attribute
  * @param label The label of the artists to remove
  */
-void Axes::removeArtists(const char *containerAttr, const QString label) {
+void Axes::removeArtists(const char *containerAttr, const QString &label) {
   GlobalInterpreterLock lock;
   const auto lineNameAsUnicode =
       Python::NewRef(PyUnicode_FromString(label.toLatin1().constData()));
@@ -166,7 +166,7 @@ Artist Axes::legendInstance() const {
  * the canvas as the vector data will be destroyed.
  */
 Line2D Axes::plot(std::vector<double> xdata, std::vector<double> ydata,
-                  const QString format, const QString label) {
+                  const QString &format, const QString &label) {
   GlobalInterpreterLock lock;
   auto line2d =
       plot(std::move(xdata), std::move(ydata), format.toLatin1().constData());
@@ -221,7 +221,7 @@ Line2D Axes::plot(std::vector<double> xdata, std::vector<double> ydata,
  * @param horizontalAlignment A string indicating the horizontal
  * alignment of the string
  */
-Artist Axes::text(double x, double y, QString text,
+Artist Axes::text(double x, double y, const QString &text,
                   const char *horizontalAlignment) {
   GlobalInterpreterLock lock;
   auto args =
diff --git a/qt/widgets/mplcpp/src/Colormap.cpp b/qt/widgets/mplcpp/src/Colormap.cpp
index ba7d580526c..8083106aa70 100644
--- a/qt/widgets/mplcpp/src/Colormap.cpp
+++ b/qt/widgets/mplcpp/src/Colormap.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidQtWidgets/MplCpp/Colormap.h"
 #include "MantidQtWidgets/MplCpp/Colors.h"
 
@@ -21,7 +23,7 @@ namespace MplCpp {
  * @brief Construct a Colormap object given a name
  */
 Colormap::Colormap(Python::Object obj)
-    : Python::InstanceHolder(obj, "is_gray") {}
+    : Python::InstanceHolder(std::move(obj), "is_gray") {}
 
 /**
  * @return A reference to the matplotlib.cm module
diff --git a/qt/widgets/mplcpp/src/Cycler.cpp b/qt/widgets/mplcpp/src/Cycler.cpp
index 50cb3ac1473..d1c83065728 100644
--- a/qt/widgets/mplcpp/src/Cycler.cpp
+++ b/qt/widgets/mplcpp/src/Cycler.cpp
@@ -40,7 +40,7 @@ Python::Object cycleIterator(const Python::Object &rawCycler) {
  * that produces an iterable
  * @param obj An existing instance of a Cycler object
  */
-Cycler::Cycler(Python::Object obj)
+Cycler::Cycler(const Python::Object &obj)
     : Python::InstanceHolder(cycleIterator(std::move(obj))) {}
 
 /**
diff --git a/qt/widgets/mplcpp/src/Figure.cpp b/qt/widgets/mplcpp/src/Figure.cpp
index 2853d932e11..41f9d66d9e7 100644
--- a/qt/widgets/mplcpp/src/Figure.cpp
+++ b/qt/widgets/mplcpp/src/Figure.cpp
@@ -58,7 +58,7 @@ QColor Figure::faceColor() const {
  * @param color A character string indicating the color.
  * See https://matplotlib.org/api/colors_api.html
  */
-void Figure::setFaceColor(const QColor color) {
+void Figure::setFaceColor(const QColor &color) {
   callMethodNoCheck<void, const char *>(
       pyobj(), "set_facecolor",
       color.name(QColor::HexRgb).toLatin1().constData());
@@ -103,7 +103,7 @@ Axes Figure::addAxes(double left, double bottom, double width, double height) {
  * @param projection An optional string denoting the projection type
  * @return A wrapper around the Axes object
  */
-Axes Figure::addSubPlot(const int subplotspec, const QString projection) {
+Axes Figure::addSubPlot(const int subplotspec, const QString &projection) {
   GlobalInterpreterLock lock;
   if (projection.isEmpty())
     return Axes{pyobj().attr("add_subplot")(subplotspec)};
diff --git a/qt/widgets/mplcpp/src/FigureCanvasQt.cpp b/qt/widgets/mplcpp/src/FigureCanvasQt.cpp
index c0edcadcb5e..354d007dbf6 100644
--- a/qt/widgets/mplcpp/src/FigureCanvasQt.cpp
+++ b/qt/widgets/mplcpp/src/FigureCanvasQt.cpp
@@ -30,7 +30,7 @@ const char *DEFAULT_FACECOLOR = "w";
  * @param fig An existing matplotlib Figure instance
  * @return A new FigureCanvasQT object
  */
-Python::Object createPyCanvasFromFigure(Figure fig) {
+Python::Object createPyCanvasFromFigure(const Figure &fig) {
   GlobalInterpreterLock lock;
   return backendModule().attr("FigureCanvasQTAgg")(fig.pyobj());
 }
@@ -41,7 +41,8 @@ Python::Object createPyCanvasFromFigure(Figure fig) {
  * @param projection A string denoting the projection to use
  * @return A new FigureCanvasQT object
  */
-Python::Object createPyCanvas(const int subplotspec, const QString projection) {
+Python::Object createPyCanvas(const int subplotspec,
+                              const QString &projection) {
   Figure fig{true};
   fig.setFaceColor(DEFAULT_FACECOLOR);
 
@@ -73,7 +74,7 @@ QWidget *initLayout(FigureCanvasQt *cppCanvas) {
  * @param projection A string denoting the projection to use on the canvas
  * @param parent The owning parent widget
  */
-FigureCanvasQt::FigureCanvasQt(const int subplotspec, const QString projection,
+FigureCanvasQt::FigureCanvasQt(const int subplotspec, const QString &projection,
                                QWidget *parent)
     : QWidget(parent),
       InstanceHolder(createPyCanvas(subplotspec, projection), "draw"),
diff --git a/qt/widgets/mplcpp/src/MantidAxes.cpp b/qt/widgets/mplcpp/src/MantidAxes.cpp
index a16f33d4158..81ad08271e7 100644
--- a/qt/widgets/mplcpp/src/MantidAxes.cpp
+++ b/qt/widgets/mplcpp/src/MantidAxes.cpp
@@ -34,8 +34,8 @@ MantidAxes::MantidAxes(Python::Object pyObj) : Axes{std::move(pyObj)} {}
  */
 Line2D
 MantidAxes::plot(const Mantid::API::MatrixWorkspace_sptr &workspace,
-                 const size_t wkspIndex, const QString lineColour,
-                 const QString label,
+                 const size_t wkspIndex, const QString &lineColour,
+                 const QString &label,
                  const boost::optional<QHash<QString, QVariant>> &otherKwargs) {
   GlobalInterpreterLock lock;
   const auto wksp = Python::NewRef(MatrixWorkpaceToPython()(workspace));
@@ -61,7 +61,7 @@ MantidAxes::plot(const Mantid::API::MatrixWorkspace_sptr &workspace,
  */
 ErrorbarContainer MantidAxes::errorbar(
     const Mantid::API::MatrixWorkspace_sptr &workspace, const size_t wkspIndex,
-    const QString lineColour, const QString label,
+    const QString &lineColour, const QString &label,
     const boost::optional<QHash<QString, QVariant>> &otherKwargs) {
   GlobalInterpreterLock lock;
   const auto wksp = Python::NewRef(MatrixWorkpaceToPython()(workspace));
diff --git a/qt/widgets/mplcpp/src/Plot.cpp b/qt/widgets/mplcpp/src/Plot.cpp
index c9c989d4eb5..cb324f79ad4 100644
--- a/qt/widgets/mplcpp/src/Plot.cpp
+++ b/qt/widgets/mplcpp/src/Plot.cpp
@@ -5,12 +5,15 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include "MantidQtWidgets/MplCpp/Plot.h"
+
 #include "MantidPythonInterface/core/CallMethod.h"
 #include "MantidPythonInterface/core/Converters/ToPyList.h"
 #include "MantidPythonInterface/core/GlobalInterpreterLock.h"
 #include "MantidQtWidgets/Common/Python/Object.h"
 #include "MantidQtWidgets/Common/Python/QHashToDict.h"
 #include "MantidQtWidgets/Common/Python/Sip.h"
+#include "MantidQtWidgets/MplCpp/Plot.h"
+#include <utility>
 
 using namespace Mantid::PythonInterface;
 using namespace MantidQt::Widgets::Common;
@@ -102,9 +105,10 @@ Python::Object plot(const Python::Object &args,
                     boost::optional<QHash<QString, QVariant>> axProperties,
                     boost::optional<std::string> windowTitle, bool errors,
                     bool overplot, bool tiled) {
-  const auto kwargs =
-      constructKwargs(spectrumNums, wkspIndices, fig, plotKwargs, axProperties,
-                      windowTitle, errors, overplot, tiled);
+  const auto kwargs = constructKwargs(
+      std::move(spectrumNums), std::move(wkspIndices), std::move(fig),
+      std::move(plotKwargs), std::move(axProperties), std::move(windowTitle),
+      errors, overplot, tiled);
   try {
     return functionsModule().attr("plot")(*args, **kwargs);
   } catch (Python::ErrorAlreadySet &) {
diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Mpl/ContourPreviewPlot.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Mpl/ContourPreviewPlot.h
index fafd2d672cb..634c1b4aed2 100644
--- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Mpl/ContourPreviewPlot.h
+++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Mpl/ContourPreviewPlot.h
@@ -39,7 +39,7 @@ public:
 
   void setCanvasColour(QColor const &colour);
 
-  void setWorkspace(Mantid::API::MatrixWorkspace_sptr workspace);
+  void setWorkspace(const Mantid::API::MatrixWorkspace_sptr &workspace);
 
   std::tuple<double, double> getAxisRange(AxisID axisID) const;
 
diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Mpl/PreviewPlot.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Mpl/PreviewPlot.h
index 4c07a0cd027..a320af8b07b 100644
--- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Mpl/PreviewPlot.h
+++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Mpl/PreviewPlot.h
@@ -94,8 +94,8 @@ public slots:
   void clear();
   void resizeX();
   void resetView();
-  void setCanvasColour(QColor colour);
-  void setLinesWithErrors(QStringList labels);
+  void setCanvasColour(const QColor &colour);
+  void setLinesWithErrors(const QStringList &labels);
   void showLegend(bool visible);
   void replot();
 
@@ -136,7 +136,7 @@ private:
   void switchPlotTool(QAction *selected);
   void setXScaleType(QAction *selected);
   void setYScaleType(QAction *selected);
-  void setScaleType(AxisID id, QString actionName);
+  void setScaleType(AxisID id, const QString &actionName);
   void toggleLegend(const bool checked);
 
   boost::optional<char const *> overrideAxisLabel(AxisID const &axisID);
diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/ContourPreviewPlot.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/ContourPreviewPlot.h
index 7e6e878cdd9..0ffe6150789 100644
--- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/ContourPreviewPlot.h
+++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/ContourPreviewPlot.h
@@ -52,7 +52,7 @@ public:
   ~ContourPreviewPlot() override;
 
   Mantid::API::MatrixWorkspace_sptr getActiveWorkspace() const;
-  void setWorkspace(Mantid::API::MatrixWorkspace_sptr const workspace);
+  void setWorkspace(Mantid::API::MatrixWorkspace_sptr const &workspace);
   SafeQwtPlot *getPlot2D();
 
   void setPlotVisible(bool const &visible);
diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/DisplayCurveFit.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/DisplayCurveFit.h
index dcbd15cfaf7..58f0c0091cf 100644
--- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/DisplayCurveFit.h
+++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/DisplayCurveFit.h
@@ -57,12 +57,12 @@ public:
   void setAxisRange(QPair<double, double> range,
                     AxisID axisID = AxisID::XBottom);
   curveTypes
-  getCurvesForWorkspace(const Mantid::API::MatrixWorkspace_sptr workspace);
+  getCurvesForWorkspace(const Mantid::API::MatrixWorkspace_sptr &workspace);
   QPair<double, double> getCurveRange(const curveType &atype);
   QPair<double, double>
-  getCurveRange(const Mantid::API::MatrixWorkspace_sptr workspace);
+  getCurveRange(const Mantid::API::MatrixWorkspace_sptr &workspace);
   void addSpectrum(const curveType &aType,
-                   const Mantid::API::MatrixWorkspace_sptr workspace,
+                   const Mantid::API::MatrixWorkspace_sptr &workspace,
                    const size_t specIndex = 0);
   void removeSpectrum(const curveType &aType);
   bool hasCurve(const curveType &aType);
diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/MWView.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/MWView.h
index 5e21b68f736..7b5fdca0c9c 100644
--- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/MWView.h
+++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/MWView.h
@@ -58,8 +58,8 @@ class EXPORT_OPT_MANTIDQT_PLOTTING MWView
 public:
   MWView(QWidget *parent = nullptr);
   ~MWView() override;
-  void loadColorMap(QString filename = QString());
-  void setWorkspace(Mantid::API::MatrixWorkspace_sptr ws);
+  void loadColorMap(const QString &filename = QString());
+  void setWorkspace(const Mantid::API::MatrixWorkspace_sptr &ws);
   void updateDisplay();
   SafeQwtPlot *getPlot2D();
 
diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/PeakPicker.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/PeakPicker.h
index c8fbdbffa31..a68fb643c69 100644
--- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/PeakPicker.h
+++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/PeakPicker.h
@@ -28,8 +28,8 @@ class EXPORT_OPT_MANTIDQT_PLOTTING PeakPicker : public QwtPlotPicker,
 
 public:
   /// Constructor
-  PeakPicker(QwtPlot *plot, QColor color);
-  PeakPicker(PreviewPlot *plot, QColor color);
+  PeakPicker(QwtPlot *plot, const QColor &color);
+  PeakPicker(PreviewPlot *plot, const QColor &color);
 
   /// Correct QwtPlotItem type info
   int rtti() const override { return QwtPlotItem::Rtti_PlotMarker; }
diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/PreviewPlot.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/PreviewPlot.h
index 8b7f9bb5b09..49b16a49db5 100644
--- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/PreviewPlot.h
+++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/PreviewPlot.h
@@ -73,7 +73,7 @@ public:
   getAxisRange(AxisID axisID = AxisID::XBottom) const;
 
   QPair<double, double>
-  getCurveRange(const Mantid::API::MatrixWorkspace_sptr ws);
+  getCurveRange(const Mantid::API::MatrixWorkspace_sptr &ws);
   QPair<double, double> getCurveRange(const QString &curveName);
 
   void addSpectrum(
@@ -85,7 +85,7 @@ public:
       const QColor &curveColour = QColor(),
       const QHash<QString, QVariant> &plotKwargs = QHash<QString, QVariant>());
 
-  void removeSpectrum(const Mantid::API::MatrixWorkspace_sptr ws);
+  void removeSpectrum(const Mantid::API::MatrixWorkspace_sptr &ws);
   void removeSpectrum(const QString &curveName);
 
   bool hasCurve(const QString &curveName);
@@ -157,16 +157,19 @@ private:
                 const QColor &curveColour, const QString &curveName = "");
   void removeCurve(QwtPlotItem *curve);
 
-  QList<QAction *> addOptionsToMenus(QString menuName, QActionGroup *group,
-                                     QStringList items, QString defaultItem);
+  QList<QAction *> addOptionsToMenus(const QString &menuName,
+                                     QActionGroup *group,
+                                     const QStringList &items,
+                                     const QString &defaultItem);
 
-  QStringList getCurvesForWorkspace(const Mantid::API::MatrixWorkspace_sptr ws);
+  QStringList
+  getCurvesForWorkspace(const Mantid::API::MatrixWorkspace_sptr &ws);
 
 private slots:
   void showContextMenu(QPoint position);
   void handleViewToolSelect();
   void handleAxisTypeSelect();
-  void removeWorkspace(Mantid::API::MatrixWorkspace_sptr ws);
+  void removeWorkspace(const Mantid::API::MatrixWorkspace_sptr &ws);
 
 private:
   Ui::PreviewPlot m_uiForm;
diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/QwtHelper.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/QwtHelper.h
index 12eeac6d4b0..17ce370ae64 100644
--- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/QwtHelper.h
+++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/QwtHelper.h
@@ -18,25 +18,27 @@ namespace API {
 namespace QwtHelper {
 /// Create Qwt curve data from a workspace
 EXPORT_OPT_MANTIDQT_PLOTTING boost::shared_ptr<QwtData>
-curveDataFromWs(Mantid::API::MatrixWorkspace_const_sptr ws, size_t wsIndex);
+curveDataFromWs(const Mantid::API::MatrixWorkspace_const_sptr &ws,
+                size_t wsIndex);
 
 /// Create vector of Qwt curve data from a workspace, used for EnggDiffraction
 /// GUI
 EXPORT_OPT_MANTIDQT_PLOTTING std::vector<boost::shared_ptr<QwtData>>
-curveDataFromWs(Mantid::API::MatrixWorkspace_const_sptr ws);
+curveDataFromWs(const Mantid::API::MatrixWorkspace_const_sptr &ws);
 
 /// Create error vector from a workspace
 EXPORT_OPT_MANTIDQT_PLOTTING std::vector<double>
-curveErrorsFromWs(Mantid::API::MatrixWorkspace_const_sptr ws, size_t wsIndex);
+curveErrorsFromWs(const Mantid::API::MatrixWorkspace_const_sptr &ws,
+                  size_t wsIndex);
 
 /// Create Qwt curve data from a function
 EXPORT_OPT_MANTIDQT_PLOTTING boost::shared_ptr<QwtData>
-curveDataFromFunction(Mantid::API::IFunction_const_sptr func,
+curveDataFromFunction(const Mantid::API::IFunction_const_sptr &func,
                       const std::vector<double> &xValues);
 
 /// Create workspace filled with function values
 EXPORT_OPT_MANTIDQT_PLOTTING Mantid::API::MatrixWorkspace_sptr
-createWsFromFunction(Mantid::API::IFunction_const_sptr func,
+createWsFromFunction(const Mantid::API::IFunction_const_sptr &func,
                      const std::vector<double> &xValues);
 
 /// Creates empty Qwt curve data
diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/QwtRasterDataMD.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/QwtRasterDataMD.h
index 01d90f854a6..1aa5cf4eaf4 100644
--- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/QwtRasterDataMD.h
+++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/QwtRasterDataMD.h
@@ -41,7 +41,7 @@ public:
   virtual void setWorkspace(Mantid::API::IMDWorkspace_const_sptr ws);
   Mantid::API::IMDWorkspace_const_sptr getWorkspace() const;
 
-  void setOverlayWorkspace(Mantid::API::IMDWorkspace_const_sptr ws);
+  void setOverlayWorkspace(const Mantid::API::IMDWorkspace_const_sptr &ws);
 
   QwtDoubleInterval range() const override;
   void setRange(const QwtDoubleInterval &range);
diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/RangeSelector.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/RangeSelector.h
index 37e57137f43..ab37db3277d 100644
--- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/RangeSelector.h
+++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/RangeSelector.h
@@ -56,7 +56,7 @@ public slots:
   void setMaximum(double /*val*/); ///< outside setting of value
   void reapply();                  ///< re-apply the range selector lines
   void detach(); ///< Detach range selector lines from the plot
-  void setColour(QColor colour);
+  void setColour(const QColor &colour);
   void setInfoOnly(bool state);
   void setVisible(bool state);
 
diff --git a/qt/widgets/plotting/src/Mpl/ContourPreviewPlot.cpp b/qt/widgets/plotting/src/Mpl/ContourPreviewPlot.cpp
index 599e863bfc5..ab7ddad5de5 100644
--- a/qt/widgets/plotting/src/Mpl/ContourPreviewPlot.cpp
+++ b/qt/widgets/plotting/src/Mpl/ContourPreviewPlot.cpp
@@ -104,7 +104,7 @@ void ContourPreviewPlot::setCanvasColour(QColor const &colour) {
  * Sets the workspace for the contour plot
  * @param workspace The workspace to plot on the contour plot.
  */
-void ContourPreviewPlot::setWorkspace(MatrixWorkspace_sptr workspace) {
+void ContourPreviewPlot::setWorkspace(const MatrixWorkspace_sptr &workspace) {
   if (workspace) {
     auto axes = m_canvas->gca<MantidAxes>();
     axes.pcolormesh(workspace);
diff --git a/qt/widgets/plotting/src/Mpl/PreviewPlot.cpp b/qt/widgets/plotting/src/Mpl/PreviewPlot.cpp
index 8ede39c537e..08faa6ab84c 100644
--- a/qt/widgets/plotting/src/Mpl/PreviewPlot.cpp
+++ b/qt/widgets/plotting/src/Mpl/PreviewPlot.cpp
@@ -19,6 +19,7 @@
 #include <QVBoxLayout>
 
 #include <algorithm>
+#include <utility>
 
 using Mantid::API::AnalysisDataService;
 using Mantid::API::MatrixWorkspace;
@@ -354,15 +355,15 @@ void PreviewPlot::resetView() {
  * Set the face colour for the canvas
  * @param colour A new colour for the figure facecolor
  */
-void PreviewPlot::setCanvasColour(QColor colour) {
-  m_canvas->gcf().setFaceColor(colour);
+void PreviewPlot::setCanvasColour(const QColor &colour) {
+  m_canvas->gcf().setFaceColor(std::move(colour));
 }
 
 /**
  * @brief PreviewPlot::setLinesWithErrors
  * @param labels A list of line labels where error bars should be shown
  */
-void PreviewPlot::setLinesWithErrors(QStringList labels) {
+void PreviewPlot::setLinesWithErrors(const QStringList &labels) {
   for (const QString &label : labels) {
     m_lines[label] = true;
   }
@@ -685,7 +686,7 @@ void PreviewPlot::setYScaleType(QAction *selected) {
   setScaleType(AxisID::YLeft, selected->text());
 }
 
-void PreviewPlot::setScaleType(AxisID id, QString actionName) {
+void PreviewPlot::setScaleType(AxisID id, const QString &actionName) {
   auto scaleType = actionName.toLower().toLatin1();
   auto axes = m_canvas->gca();
   switch (id) {
diff --git a/qt/widgets/plotting/src/Qwt/ContourPreviewPlot.cpp b/qt/widgets/plotting/src/Qwt/ContourPreviewPlot.cpp
index 71b159b1fc9..7e2ac2f8c44 100644
--- a/qt/widgets/plotting/src/Qwt/ContourPreviewPlot.cpp
+++ b/qt/widgets/plotting/src/Qwt/ContourPreviewPlot.cpp
@@ -31,7 +31,7 @@ namespace {
 Mantid::Kernel::Logger g_log("ContourPreviewPlot");
 
 MatrixWorkspace_sptr
-convertToMatrixWorkspace(boost::shared_ptr<Workspace> const workspace) {
+convertToMatrixWorkspace(boost::shared_ptr<Workspace> const &workspace) {
   return boost::dynamic_pointer_cast<MatrixWorkspace>(workspace);
 }
 
@@ -79,7 +79,7 @@ MatrixWorkspace_sptr ContourPreviewPlot::getActiveWorkspace() const {
 /**
  * Initialize objects after loading the workspace
  */
-void ContourPreviewPlot::setWorkspace(MatrixWorkspace_sptr const workspace) {
+void ContourPreviewPlot::setWorkspace(MatrixWorkspace_sptr const &workspace) {
   m_workspace = workspace;
   this->checkRangeLimits();
   m_data->setWorkspace(workspace);
diff --git a/qt/widgets/plotting/src/Qwt/DisplayCurveFit.cpp b/qt/widgets/plotting/src/Qwt/DisplayCurveFit.cpp
index dcfb2b3c6ae..c4ca4641697 100644
--- a/qt/widgets/plotting/src/Qwt/DisplayCurveFit.cpp
+++ b/qt/widgets/plotting/src/Qwt/DisplayCurveFit.cpp
@@ -76,7 +76,7 @@ void DisplayCurveFit::setAxisRange(QPair<double, double> range, AxisID axisID) {
  * @return a std::vector containing the curve types
  */
 DisplayCurveFit::curveTypes DisplayCurveFit::getCurvesForWorkspace(
-    const Mantid::API::MatrixWorkspace_sptr workspace) {
+    const Mantid::API::MatrixWorkspace_sptr &workspace) {
   QStringList curveNames = m_uiForm.fitPlot->getCurvesForWorkspace(workspace);
   curveNames =
       curveNames + m_uiForm.residualsPlot->getCurvesForWorkspace(workspace);
@@ -103,7 +103,7 @@ QPair<double, double> DisplayCurveFit::getCurveRange(const curveType &atype) {
  * workspace
  */
 QPair<double, double> DisplayCurveFit::getCurveRange(
-    const Mantid::API::MatrixWorkspace_sptr workspace) {
+    const Mantid::API::MatrixWorkspace_sptr &workspace) {
   curveTypes typesFound = this->getCurvesForWorkspace(workspace);
   if (typesFound.size() == 0) {
     throw std::runtime_error("No fitting curves associated to workspace" +
@@ -119,7 +119,7 @@ QPair<double, double> DisplayCurveFit::getCurveRange(
  * @param specIndex Spectrum index of workspace argument.
  */
 void DisplayCurveFit::addSpectrum(
-    const curveType &aType, const Mantid::API::MatrixWorkspace_sptr workspace,
+    const curveType &aType, const Mantid::API::MatrixWorkspace_sptr &workspace,
     const size_t specIndex) {
   const QString &curveName{m_curveTypeToQString.at(aType)};
   const QColor curveColor(m_curveTypeToColor.at(aType));
diff --git a/qt/widgets/plotting/src/Qwt/MWView.cpp b/qt/widgets/plotting/src/Qwt/MWView.cpp
index 2cd92547361..c7fea8b389f 100644
--- a/qt/widgets/plotting/src/Qwt/MWView.cpp
+++ b/qt/widgets/plotting/src/Qwt/MWView.cpp
@@ -63,7 +63,7 @@ MWView::~MWView() {
  *
  * @param filename :: file to open; empty to ask via a dialog box.
  */
-void MWView::loadColorMap(QString filename) {
+void MWView::loadColorMap(const QString &filename) {
   QString fileselection;
   if (filename.isEmpty()) {
     fileselection = MantidColorMap::chooseColorMap(m_currentColorMapFile, this);
@@ -81,7 +81,7 @@ void MWView::loadColorMap(QString filename) {
 /**
  * @brief Initialize objects after loading the workspace, and observe.
  */
-void MWView::setWorkspace(Mantid::API::MatrixWorkspace_sptr ws) {
+void MWView::setWorkspace(const Mantid::API::MatrixWorkspace_sptr &ws) {
   m_workspace = ws;
   this->checkRangeLimits();
   m_data->setWorkspace(ws);
diff --git a/qt/widgets/plotting/src/Qwt/MantidQwtIMDWorkspaceData.cpp b/qt/widgets/plotting/src/Qwt/MantidQwtIMDWorkspaceData.cpp
index 7e55f94fa6d..969ade58360 100644
--- a/qt/widgets/plotting/src/Qwt/MantidQwtIMDWorkspaceData.cpp
+++ b/qt/widgets/plotting/src/Qwt/MantidQwtIMDWorkspaceData.cpp
@@ -15,6 +15,7 @@
 #include "MantidGeometry/MDGeometry/MDTypes.h"
 #include "MantidQtWidgets/Common/QStringUtils.h"
 #include <QStringBuilder>
+#include <utility>
 
 using MantidQt::API::toQStringInternal;
 using namespace Mantid::Kernel;
@@ -39,7 +40,7 @@ MantidQwtIMDWorkspaceData::MantidQwtIMDWorkspaceData(
     Mantid::API::IMDWorkspace_const_sptr workspace, const bool logScaleY,
     Mantid::Kernel::VMD start, Mantid::Kernel::VMD end,
     Mantid::API::MDNormalization normalize, bool isDistribution)
-    : MantidQwtWorkspaceData(logScaleY), m_workspace(workspace),
+    : MantidQwtWorkspaceData(logScaleY), m_workspace(std::move(workspace)),
       m_preview(false), m_start(start), m_end(end), m_normalization(normalize),
       m_isDistribution(isDistribution), m_transform(nullptr),
       m_plotAxis(PlotDistance), m_currentPlotAxis(PlotDistance) {
diff --git a/qt/widgets/plotting/src/Qwt/PeakPicker.cpp b/qt/widgets/plotting/src/Qwt/PeakPicker.cpp
index 62a5c8fc627..0c00852b62e 100644
--- a/qt/widgets/plotting/src/Qwt/PeakPicker.cpp
+++ b/qt/widgets/plotting/src/Qwt/PeakPicker.cpp
@@ -24,7 +24,7 @@ const Qt::CursorShape PeakPicker::DEFAULT_CURSOR = Qt::PointingHandCursor;
  * @param plot :: A plot this peak picker should operate on
  * @param color :: Peak picker color
  */
-PeakPicker::PeakPicker(QwtPlot *plot, QColor color)
+PeakPicker::PeakPicker(QwtPlot *plot, const QColor &color)
     : QwtPlotPicker(plot->canvas()), QwtPlotItem(), m_plot(plot),
       m_basePen(color, 0, Qt::SolidLine), m_widthPen(color, 0, Qt::DashLine),
       m_isMoving(false), m_isResizing(false), m_peak() {
@@ -32,7 +32,7 @@ PeakPicker::PeakPicker(QwtPlot *plot, QColor color)
   plot->canvas()->setCursor(DEFAULT_CURSOR);
 }
 
-PeakPicker::PeakPicker(PreviewPlot *plot, QColor color)
+PeakPicker::PeakPicker(PreviewPlot *plot, const QColor &color)
     : QwtPlotPicker(plot->canvas()), QwtPlotItem(), m_plot(plot->getPlot()),
       m_basePen(color, 0, Qt::SolidLine), m_widthPen(color, 0, Qt::DashLine),
       m_isMoving(false), m_isResizing(false), m_peak() {
diff --git a/qt/widgets/plotting/src/Qwt/PreviewPlot.cpp b/qt/widgets/plotting/src/Qwt/PreviewPlot.cpp
index 7dd0ac92a87..72333906a1f 100644
--- a/qt/widgets/plotting/src/Qwt/PreviewPlot.cpp
+++ b/qt/widgets/plotting/src/Qwt/PreviewPlot.cpp
@@ -17,6 +17,7 @@
 
 #include <QAction>
 #include <QPalette>
+#include <utility>
 
 #include <qwt_array.h>
 #include <qwt_data.h>
@@ -240,7 +241,7 @@ std::tuple<double, double> PreviewPlot::getAxisRange(AxisID axisID) const {
  * @param ws Pointer to workspace
  */
 QPair<double, double>
-PreviewPlot::getCurveRange(const Mantid::API::MatrixWorkspace_sptr ws) {
+PreviewPlot::getCurveRange(const Mantid::API::MatrixWorkspace_sptr &ws) {
   QStringList curveNames = getCurvesForWorkspace(ws);
 
   if (curveNames.size() == 0)
@@ -365,7 +366,7 @@ void PreviewPlot::addSpectrum(const QString &curveName, const QString &wsName,
  *
  * @param ws Pointer to workspace
  */
-void PreviewPlot::removeSpectrum(const MatrixWorkspace_sptr ws) {
+void PreviewPlot::removeSpectrum(const MatrixWorkspace_sptr &ws) {
   if (!ws) {
     g_log.error("Cannot remove curve for null workspace");
     return;
@@ -658,9 +659,9 @@ void PreviewPlot::handleRemoveEvent(WorkspacePreDeleteNotification_ptr pNf) {
  *
  * @param ws the workspace that is being removed.
  */
-void PreviewPlot::removeWorkspace(MatrixWorkspace_sptr ws) {
+void PreviewPlot::removeWorkspace(const MatrixWorkspace_sptr &ws) {
   // Remove the workspace on the main GUI thread
-  removeSpectrum(ws);
+  removeSpectrum(std::move(ws));
   emit needToReplot();
 }
 
@@ -820,10 +821,10 @@ void PreviewPlot::removeCurve(QwtPlotItem *curve) {
  * @param defaultItem Default item name
  * @return List of Actions added
  */
-QList<QAction *> PreviewPlot::addOptionsToMenus(QString menuName,
+QList<QAction *> PreviewPlot::addOptionsToMenus(const QString &menuName,
                                                 QActionGroup *group,
-                                                QStringList items,
-                                                QString defaultItem) {
+                                                const QStringList &items,
+                                                const QString &defaultItem) {
   auto *menu = new QMenu(m_contextMenu);
 
   for (auto &item : items) {
@@ -880,7 +881,7 @@ QString PreviewPlot::getAxisType(int axisID) {
  * @param ws Pointer to workspace
  * @return List of curve names
  */
-QStringList PreviewPlot::getCurvesForWorkspace(const MatrixWorkspace_sptr ws) {
+QStringList PreviewPlot::getCurvesForWorkspace(const MatrixWorkspace_sptr &ws) {
   QStringList curveNames;
 
   for (auto it = m_curves.begin(); it != m_curves.end(); ++it) {
diff --git a/qt/widgets/plotting/src/Qwt/QwtHelper.cpp b/qt/widgets/plotting/src/Qwt/QwtHelper.cpp
index 1b6f9c764a1..b86a5762578 100644
--- a/qt/widgets/plotting/src/Qwt/QwtHelper.cpp
+++ b/qt/widgets/plotting/src/Qwt/QwtHelper.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidQtWidgets/Plotting/Qwt/QwtHelper.h"
 
 #include "MantidAPI/AlgorithmManager.h"
@@ -24,7 +26,7 @@ namespace QwtHelper {
  * @param wsIndex :: Workspace index to use
  * @return Pointer to created QwtData
  */
-boost::shared_ptr<QwtData> curveDataFromWs(MatrixWorkspace_const_sptr ws,
+boost::shared_ptr<QwtData> curveDataFromWs(const MatrixWorkspace_const_sptr &ws,
                                            size_t wsIndex) {
   const double *x = &ws->x(wsIndex)[0];
   const double *y = &ws->y(wsIndex)[0];
@@ -40,7 +42,7 @@ boost::shared_ptr<QwtData> curveDataFromWs(MatrixWorkspace_const_sptr ws,
  * @return Pointer to created Vector QwtData
  */
 std::vector<boost::shared_ptr<QwtData>>
-curveDataFromWs(MatrixWorkspace_const_sptr ws) {
+curveDataFromWs(const MatrixWorkspace_const_sptr &ws) {
 
   std::vector<boost::shared_ptr<QwtData>> dataVector;
   auto histograms = ws->getNumberHistograms();
@@ -58,7 +60,7 @@ curveDataFromWs(MatrixWorkspace_const_sptr ws) {
  * @param wsIndex :: Workspace index to use
  * @return Vector of errors
  */
-std::vector<double> curveErrorsFromWs(MatrixWorkspace_const_sptr ws,
+std::vector<double> curveErrorsFromWs(const MatrixWorkspace_const_sptr &ws,
                                       size_t wsIndex) {
   return ws->e(wsIndex).rawData();
 }
@@ -72,9 +74,9 @@ std::vector<double> curveErrorsFromWs(MatrixWorkspace_const_sptr ws,
  * @return Pointer to create QwtData
  */
 boost::shared_ptr<QwtData>
-curveDataFromFunction(IFunction_const_sptr func,
+curveDataFromFunction(const IFunction_const_sptr &func,
                       const std::vector<double> &xValues) {
-  MatrixWorkspace_sptr ws = createWsFromFunction(func, xValues);
+  MatrixWorkspace_sptr ws = createWsFromFunction(std::move(func), xValues);
   return curveDataFromWs(ws, 0);
 }
 
@@ -85,7 +87,7 @@ curveDataFromFunction(IFunction_const_sptr func,
  * @param xValues :: X values to use
  * @return Single-spectrum workspace with calculated function values
  */
-MatrixWorkspace_sptr createWsFromFunction(IFunction_const_sptr func,
+MatrixWorkspace_sptr createWsFromFunction(const IFunction_const_sptr &func,
                                           const std::vector<double> &xValues) {
   auto inputWs = boost::dynamic_pointer_cast<MatrixWorkspace>(
       WorkspaceFactory::Instance().create("Workspace2D", 1, xValues.size(),
diff --git a/qt/widgets/plotting/src/Qwt/QwtRasterDataMD.cpp b/qt/widgets/plotting/src/Qwt/QwtRasterDataMD.cpp
index 435e4a21be7..e4ebde8e8dc 100644
--- a/qt/widgets/plotting/src/Qwt/QwtRasterDataMD.cpp
+++ b/qt/widgets/plotting/src/Qwt/QwtRasterDataMD.cpp
@@ -10,6 +10,7 @@
 #include "MantidGeometry/MDGeometry/IMDDimension.h"
 #include "MantidGeometry/MDGeometry/MDTypes.h"
 #include <cmath>
+#include <utility>
 
 namespace MantidQt {
 namespace API {
@@ -199,7 +200,7 @@ Mantid::API::IMDWorkspace_const_sptr QwtRasterDataMD::getWorkspace() const {
  * @param ws :: IMDWorkspace to show
  */
 void QwtRasterDataMD::setOverlayWorkspace(
-    Mantid::API::IMDWorkspace_const_sptr ws) {
+    const Mantid::API::IMDWorkspace_const_sptr &ws) {
   if (!ws) {
     m_overlayWS.reset();
     return;
@@ -229,8 +230,8 @@ void QwtRasterDataMD::setSliceParams(
                              "vector/number of dimensions size.");
   m_dimX = dimX;
   m_dimY = dimY;
-  m_X = X;
-  m_Y = Y;
+  m_X = std::move(X);
+  m_Y = std::move(Y);
   if (!m_X || !m_Y)
     throw std::runtime_error("QwtRasterDataMD::setSliceParams(): one of the "
                              "input dimensions is NULL");
diff --git a/qt/widgets/plotting/src/Qwt/RangeSelector.cpp b/qt/widgets/plotting/src/Qwt/RangeSelector.cpp
index 1f3a4fad886..36e161d2fa2 100644
--- a/qt/widgets/plotting/src/Qwt/RangeSelector.cpp
+++ b/qt/widgets/plotting/src/Qwt/RangeSelector.cpp
@@ -305,7 +305,7 @@ void RangeSelector::detach() {
   m_mrkMax->attach(nullptr);
 }
 
-void RangeSelector::setColour(QColor colour) {
+void RangeSelector::setColour(const QColor &colour) {
   m_pen->setColor(colour);
   switch (m_type) {
   case XMINMAX:
diff --git a/qt/widgets/plotting/src/Qwt/SafeQwtPlot.cpp b/qt/widgets/plotting/src/Qwt/SafeQwtPlot.cpp
index f0f8f6dea3f..fc2f6a8e8f6 100644
--- a/qt/widgets/plotting/src/Qwt/SafeQwtPlot.cpp
+++ b/qt/widgets/plotting/src/Qwt/SafeQwtPlot.cpp
@@ -4,10 +4,12 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidQtWidgets/Plotting/Qwt/SafeQwtPlot.h"
+#include <utility>
+
 #include "MantidAPI/Workspace.h"
 #include "MantidKernel/ReadLock.h"
 #include "MantidKernel/System.h"
+#include "MantidQtWidgets/Plotting/Qwt/SafeQwtPlot.h"
 
 using namespace Mantid::Kernel;
 
@@ -35,7 +37,9 @@ SafeQwtPlot::~SafeQwtPlot() {}
  *
  * @param ws :: shared ptr to workspace
  */
-void SafeQwtPlot::setWorkspace(Mantid::API::Workspace_sptr ws) { m_ws = ws; }
+void SafeQwtPlot::setWorkspace(Mantid::API::Workspace_sptr ws) {
+  m_ws = std::move(ws);
+}
 
 //----------------------------------------------------------------------------------------------
 /** Overridden drawCanvas() that protects the
diff --git a/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/PeriodicTableWidget.h b/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/PeriodicTableWidget.h
index df543c96171..3f6e331b6e9 100644
--- a/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/PeriodicTableWidget.h
+++ b/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/PeriodicTableWidget.h
@@ -42,7 +42,8 @@ public:
 
   /// @return Comma-separated string of all the element buttons for one group
   /// that are currently checked
-  QString elementsSelectedToString(QVector<QPushButton *> elementsSelected);
+  QString
+  elementsSelectedToString(const QVector<QPushButton *> &elementsSelected);
 
   /// @return Comma-separated string of all element buttons that are checked in
   /// the whole PeriodicTableWidget
@@ -55,12 +56,12 @@ public:
   void disableAllElementButtons();
 
   /// Enables a button for an element by the element name i.e 'Au' for Gold.
-  void enableButtonByName(QString elementStr);
+  void enableButtonByName(const QString &elementStr);
 
   ///@return the result of the comparison between a string and the text of a
   /// button.
   bool compareButtonNameToStr(QPushButton *buttonToCompare,
-                              QString stringToCompare);
+                              const QString &stringToCompare);
 
   /// Displays or hides the Legend for the colour coding of periodic groups
   void showGroupLegend(bool checked);
@@ -86,7 +87,7 @@ private:
   void ColourNobleGases(const QVector<QPushButton *> &nobleGases);
 
   /// Methods to colour single element button by setting styleSheet
-  void ColourButton(QPushButton *elementButton, QString colour);
+  void ColourButton(QPushButton *elementButton, const QString &colour);
 
   /// Method to populate Group Vectors with element QPushButtons
   void populateGroupVectors();
diff --git a/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/SampleShapeHelpers.h b/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/SampleShapeHelpers.h
index 42105c79aad..cf97e72a5a9 100644
--- a/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/SampleShapeHelpers.h
+++ b/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/SampleShapeHelpers.h
@@ -74,7 +74,7 @@ struct Operation {
   Operation(int op = 0) : binaryop(op) {}
 
   /// Return the string that represnts the result of this operation
-  QString toString(QString left, QString right) const;
+  QString toString(const QString &left, const QString &right) const;
 
   /// The stored operation
   int binaryop;
diff --git a/qt/widgets/plugins/algorithm_dialogs/src/FitDialog.cpp b/qt/widgets/plugins/algorithm_dialogs/src/FitDialog.cpp
index f15fbd0863a..81012058c51 100644
--- a/qt/widgets/plugins/algorithm_dialogs/src/FitDialog.cpp
+++ b/qt/widgets/plugins/algorithm_dialogs/src/FitDialog.cpp
@@ -514,7 +514,7 @@ namespace {
  * Helper function to check if a function is an MD one.
  * @param fun :: Function to check
  */
-bool isFunctionMD(Mantid::API::IFunction_sptr fun) {
+bool isFunctionMD(const Mantid::API::IFunction_sptr &fun) {
   auto cf = boost::dynamic_pointer_cast<Mantid::API::CompositeFunction>(fun);
   if (!cf)
     return static_cast<bool>(
diff --git a/qt/widgets/plugins/algorithm_dialogs/src/MantidGLWidget.cpp b/qt/widgets/plugins/algorithm_dialogs/src/MantidGLWidget.cpp
index a76790c57a8..5ebeba86d62 100644
--- a/qt/widgets/plugins/algorithm_dialogs/src/MantidGLWidget.cpp
+++ b/qt/widgets/plugins/algorithm_dialogs/src/MantidGLWidget.cpp
@@ -14,6 +14,7 @@
 #include <QtOpenGL>
 
 #include <cfloat>
+#include <utility>
 
 using namespace MantidQt::CustomDialogs;
 
@@ -50,7 +51,7 @@ MantidGLWidget::~MantidGLWidget() { makeCurrent(); }
  */
 void MantidGLWidget::setDisplayObject(
     boost::shared_ptr<Mantid::Geometry::IObject> object) {
-  m_display_object = object;
+  m_display_object = std::move(object);
   m_x_rot = 0.0;
   m_y_rot = 0.0;
   m_z_rot = 0.0;
diff --git a/qt/widgets/plugins/algorithm_dialogs/src/PeriodicTableWidget.cpp b/qt/widgets/plugins/algorithm_dialogs/src/PeriodicTableWidget.cpp
index 35bc73bc7b1..d67146de96e 100644
--- a/qt/widgets/plugins/algorithm_dialogs/src/PeriodicTableWidget.cpp
+++ b/qt/widgets/plugins/algorithm_dialogs/src/PeriodicTableWidget.cpp
@@ -131,7 +131,7 @@ void PeriodicTableWidget::ColourUnknownProperties(
   }
 }
 
-void PeriodicTableWidget::enableButtonByName(QString elementStr) {
+void PeriodicTableWidget::enableButtonByName(const QString &elementStr) {
   for (auto &AllElementButton : AllElementButtons) {
     for (auto btn_i = AllElementButton.begin(); btn_i != AllElementButton.end();
          btn_i++) {
@@ -142,8 +142,8 @@ void PeriodicTableWidget::enableButtonByName(QString elementStr) {
   }
 }
 
-bool PeriodicTableWidget::compareButtonNameToStr(QPushButton *buttonToCompare,
-                                                 QString stringToCompare) {
+bool PeriodicTableWidget::compareButtonNameToStr(
+    QPushButton *buttonToCompare, const QString &stringToCompare) {
   return (strcmp(buttonToCompare->text().toStdString().c_str(),
                  stringToCompare.toStdString().c_str()) == 0);
 }
@@ -162,15 +162,15 @@ void PeriodicTableWidget::disableAllElementButtons() {
   disableButtons(UnknownProperties);
 }
 void PeriodicTableWidget::ColourButton(QPushButton *element,
-                                       QString colourStr) {
+                                       const QString &colourStr) {
   element->setStyleSheet(
       "QPushButton{border:1px solid rgb(0, 0, 0); " + colourStr + ";}" +
       "QPushButton:checked{ background-color:rgb(175,255,255)}" +
       "QPushButton:!enabled{background-color: rgb(204,204,204);" + "}");
 }
 
-QString
-PeriodicTableWidget::elementsSelectedToString(QVector<QPushButton *> elements) {
+QString PeriodicTableWidget::elementsSelectedToString(
+    const QVector<QPushButton *> &elements) {
   QString selectedElements = "";
   /* Loop through QPushButtons and if they are checked
    * then retrieve the text on the button i.e the
diff --git a/qt/widgets/plugins/algorithm_dialogs/src/SampleShapeHelpers.cpp b/qt/widgets/plugins/algorithm_dialogs/src/SampleShapeHelpers.cpp
index 77103e3563b..14a7f1f5d7a 100644
--- a/qt/widgets/plugins/algorithm_dialogs/src/SampleShapeHelpers.cpp
+++ b/qt/widgets/plugins/algorithm_dialogs/src/SampleShapeHelpers.cpp
@@ -150,7 +150,7 @@ QString PointGroupBox::write3DElement(const QString &elem_name) const {
  * @param right Right-hand side of binary operation
  * @returns A string representing the result of the operation on the arguments
  */
-QString Operation::toString(QString left, QString right) const {
+QString Operation::toString(const QString &left, const QString &right) const {
   QString result;
   switch (binaryop) {
   // union
diff --git a/qt/widgets/refdetectorview/inc/MantidQtWidgets/RefDetectorView/RefMatrixWSImageView.h b/qt/widgets/refdetectorview/inc/MantidQtWidgets/RefDetectorView/RefMatrixWSImageView.h
index 89be6c9787b..4511192c88e 100644
--- a/qt/widgets/refdetectorview/inc/MantidQtWidgets/RefDetectorView/RefMatrixWSImageView.h
+++ b/qt/widgets/refdetectorview/inc/MantidQtWidgets/RefDetectorView/RefMatrixWSImageView.h
@@ -29,10 +29,10 @@ class EXPORT_OPT_MANTIDQT_REFDETECTORVIEWER RefMatrixWSImageView {
 
 public:
   /// Construct an image viewer for the specifed MatrixWorkspace
-  RefMatrixWSImageView(Mantid::API::MatrixWorkspace_sptr /*mat_ws*/);
+  RefMatrixWSImageView(const Mantid::API::MatrixWorkspace_sptr & /*mat_ws*/);
 
-  RefMatrixWSImageView(QString wpsName, int peakMin, int peakMax, int backMin,
-                       int backMax, int tofMin, int tofMax);
+  RefMatrixWSImageView(const QString &wpsName, int peakMin, int peakMax,
+                       int backMin, int backMax, int tofMin, int tofMax);
 
   RefIVConnections *getConnections();
 
diff --git a/qt/widgets/refdetectorview/src/RefImageView.cpp b/qt/widgets/refdetectorview/src/RefImageView.cpp
index ca2e6436143..340f279f244 100644
--- a/qt/widgets/refdetectorview/src/RefImageView.cpp
+++ b/qt/widgets/refdetectorview/src/RefImageView.cpp
@@ -15,6 +15,7 @@
 
 #include <sstream>
 #include <string>
+#include <utility>
 
 namespace MantidQt {
 namespace RefDetectorViewer {
@@ -89,7 +90,7 @@ RefImageView::RefImageView(SpectrumView::SpectrumDataSource_sptr dataSource,
   m_imageDisplay->updateImage();
   iv_connections->peakBackTofRangeUpdate();
 
-  m_imageDisplay->setDataSource(dataSource);
+  m_imageDisplay->setDataSource(std::move(dataSource));
 }
 
 RefImageView::~RefImageView() {
diff --git a/qt/widgets/refdetectorview/src/RefMatrixWSImageView.cpp b/qt/widgets/refdetectorview/src/RefMatrixWSImageView.cpp
index 52febb1c037..5db995cd442 100644
--- a/qt/widgets/refdetectorview/src/RefMatrixWSImageView.cpp
+++ b/qt/widgets/refdetectorview/src/RefMatrixWSImageView.cpp
@@ -21,7 +21,8 @@ using namespace Mantid::API;
 /**
  * Construct an ImageView for the specified matrix workspace
  */
-RefMatrixWSImageView::RefMatrixWSImageView(MatrixWorkspace_sptr /*mat_ws*/)
+RefMatrixWSImageView::RefMatrixWSImageView(
+    const MatrixWorkspace_sptr & /*mat_ws*/)
     : m_imageView(nullptr) {
   return;
   //  RefMatrixWSDataSource* source = new RefMatrixWSDataSource( mat_ws );
@@ -31,7 +32,7 @@ RefMatrixWSImageView::RefMatrixWSImageView(MatrixWorkspace_sptr /*mat_ws*/)
   //                                         // is closed
 }
 
-RefMatrixWSImageView::RefMatrixWSImageView(QString wpsName, int peakMin,
+RefMatrixWSImageView::RefMatrixWSImageView(const QString &wpsName, int peakMin,
                                            int peakMax, int backMin,
                                            int backMax, int tofMin,
                                            int tofMax) {
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/CompositePeaksPresenter.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/CompositePeaksPresenter.h
index aa7d6826181..611b695daa7 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/CompositePeaksPresenter.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/CompositePeaksPresenter.h
@@ -92,7 +92,7 @@ public:
   /// Destructor
   ~CompositePeaksPresenter() override;
   /// Add a peaks presenter onto the composite.
-  void addPeaksPresenter(PeaksPresenter_sptr presenter);
+  void addPeaksPresenter(const PeaksPresenter_sptr &presenter);
   /// Get the number of subjects.
   size_t size() const;
   /// Clear the owned presenters.
@@ -107,43 +107,46 @@ public:
   double getPeakSizeIntoProjection() const override;
   /// Enter peak edit mode.
   void peakEditMode(EditMode mode) override;
-  void
-  setForegroundColor(boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws,
-                     const PeakViewColor /*color*/);
+  void setForegroundColor(
+      const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws,
+      const PeakViewColor & /*color*/);
   /// Change the background representation for the peaks of this workspace
-  void
-  setBackgroundColor(boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws,
-                     const PeakViewColor /*color*/);
+  void setBackgroundColor(
+      const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws,
+      const PeakViewColor & /*color*/);
   /// Get the foreground colour corresponding to the workspace
   PeakViewColor getForegroundPeakViewColor(
-      boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) const;
+      const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws) const;
   /// Get the background colour corresponding to the workspace
   PeakViewColor getBackgroundPeakViewColor(
-      boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) const;
+      const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws) const;
   /// Determine if the background is shown or not.
   bool getShowBackground(
-      boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) const;
+      const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws) const;
   /// Get a copy of the palette in its current state.
   PeakPalette<PeakViewColor> getPalette() const;
   /// Setter for indicating whether the background radius will be shown.
   void setBackgroundRadiusShown(
-      boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws,
+      const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws,
       const bool shown);
   /// Remove the workspace and corresponding presenter.
-  void remove(boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS);
+  void
+  remove(const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &peaksWS);
   /// Hide these peaks in the plot.
-  void setShown(boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS,
-                const bool shown);
+  void
+  setShown(const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &peaksWS,
+           const bool shown);
   /// zoom in on a peak.
-  void zoomToPeak(boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS,
-                  const int peakIndex);
+  void zoomToPeak(
+      const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &peaksWS,
+      const int peakIndex);
   /// Get the named peaks presenter.
   PeaksPresenter *getPeaksPresenter(const QString &name);
   /// Register any owning presenter
   void registerOwningPresenter(UpdateableOnDemand *owner) override;
   /// Is the presenter hidden.
-  bool getIsHidden(
-      boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS) const;
+  bool getIsHidden(const boost::shared_ptr<const Mantid::API::IPeaksWorkspace>
+                       &peaksWS) const;
   /// Perform update on demand
   void performUpdate() override;
   /// Zoom to the rectangle
@@ -162,8 +165,9 @@ public:
   /// Determine if the presenter contents are different.
   bool contentsDifferent(PeaksPresenter const *other) const override;
   /// Enter the requested edit mode for the peaks workspace.
-  void editCommand(EditMode editMode,
-                   boost::weak_ptr<const Mantid::API::IPeaksWorkspace> target);
+  void editCommand(
+      EditMode editMode,
+      const boost::weak_ptr<const Mantid::API::IPeaksWorkspace> &target);
 
 private:
   /// Updateable on demand method.
@@ -179,10 +183,10 @@ private:
   bool useDefault() const { return m_subjects.size() == 0; }
   /// Get the presenter for a given workspace.
   SubjectContainer::iterator getPresenterIteratorFromWorkspace(
-      boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws);
+      const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws);
   /// Get the presenter for a given workspace.
   SubjectContainer::const_iterator getPresenterIteratorFromWorkspace(
-      boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) const;
+      const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws) const;
   /// Get the presenter from a workspace name.
   SubjectContainer::iterator getPresenterIteratorFromName(const QString &name);
   /// Color palette
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/ConcretePeaksPresenter.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/ConcretePeaksPresenter.h
index ffa89dfef72..867d6e2cee6 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/ConcretePeaksPresenter.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/ConcretePeaksPresenter.h
@@ -36,9 +36,9 @@ class EXPORT_OPT_MANTIDQT_SLICEVIEWER ConcretePeaksPresenter
 public:
   ConcretePeaksPresenter(
       PeakOverlayViewFactory_sptr viewFactory,
-      Mantid::API::IPeaksWorkspace_sptr peaksWS,
-      boost::shared_ptr<Mantid::API::MDGeometry> mdWS,
-      Mantid::Geometry::PeakTransformFactory_sptr transformFactory);
+      const Mantid::API::IPeaksWorkspace_sptr &peaksWS,
+      const boost::shared_ptr<Mantid::API::MDGeometry> &mdWS,
+      const Mantid::Geometry::PeakTransformFactory_sptr &transformFactory);
   void reInitialize(Mantid::API::IPeaksWorkspace_sptr peaksWS) override;
   ~ConcretePeaksPresenter() override;
   void setNonOrthogonal(bool nonOrthogonalEnabled) override;
@@ -107,7 +107,7 @@ private:
   void produceViews();
   /// Check workspace compatibilities.
   void checkWorkspaceCompatibilities(
-      boost::shared_ptr<Mantid::API::MDGeometry> mdWS);
+      const boost::shared_ptr<Mantid::API::MDGeometry> &mdWS);
   /// Find peaks interacting with the slice and update the view.
   void doFindPeaksInRegion();
   /// make owner update.
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/LineOverlay.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/LineOverlay.h
index c953fecb664..3b9668f4ac5 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/LineOverlay.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/LineOverlay.h
@@ -92,7 +92,7 @@ private:
   int height() const;
   int width() const;
 
-  QRect drawHandle(QPainter &painter, QPointF coords, QColor brush);
+  QRect drawHandle(QPainter &painter, QPointF coords, const QColor &brush);
   void paintEvent(QPaintEvent *event) override;
 
   eHandleID mouseOverHandle(QPoint pos);
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/LinePlotOptions.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/LinePlotOptions.h
index 9338f574948..9a367fbea56 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/LinePlotOptions.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/LinePlotOptions.h
@@ -19,7 +19,7 @@ public:
   LinePlotOptions(QWidget *parent = nullptr, bool logScaleOption = false);
   ~LinePlotOptions() override;
 
-  void setOriginalWorkspace(Mantid::API::IMDWorkspace_sptr ws);
+  void setOriginalWorkspace(const Mantid::API::IMDWorkspace_sptr &ws);
 
   int getPlotAxis() const;
   void setPlotAxis(int choice);
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/LineViewer.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/LineViewer.h
index 36acf63665c..448a1dd234b 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/LineViewer.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/LineViewer.h
@@ -28,11 +28,11 @@ public:
   LineViewer(QWidget *parent = nullptr);
   ~LineViewer() override;
 
-  void setWorkspace(Mantid::API::IMDWorkspace_sptr ws);
+  void setWorkspace(const Mantid::API::IMDWorkspace_sptr &ws);
   void setFreeDimensions(bool all, int dimX, int dimY);
-  void setStart(Mantid::Kernel::VMD start);
-  void setEnd(Mantid::Kernel::VMD end);
-  void setThickness(Mantid::Kernel::VMD width);
+  void setStart(const Mantid::Kernel::VMD &start);
+  void setEnd(const Mantid::Kernel::VMD &end);
+  void setThickness(const Mantid::Kernel::VMD &width);
   void setPlanarWidth(double width);
   void setNumBins(int numBins);
   void setFixedBinWidthMode(bool fixedWidth, double binWidth);
@@ -97,9 +97,9 @@ signals:
 
 private:
   Mantid::API::IAlgorithm_sptr
-  applyMDWorkspace(Mantid::API::IMDWorkspace_sptr ws);
+  applyMDWorkspace(const Mantid::API::IMDWorkspace_sptr &ws);
   Mantid::API::IAlgorithm_sptr
-  applyMatrixWorkspace(Mantid::API::MatrixWorkspace_sptr ws);
+  applyMatrixWorkspace(const Mantid::API::MatrixWorkspace_sptr &ws);
   void setupScaleEngine(MantidQwtWorkspaceData &curveData);
   /// set the slice workspace from the ADS
   void setSliceWorkspace(const std::string &name);
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/NonOrthogonalOverlay.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/NonOrthogonalOverlay.h
index 451284a726f..5c8d363ae5b 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/NonOrthogonalOverlay.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/NonOrthogonalOverlay.h
@@ -52,10 +52,10 @@ private:
   QPointF invTransform(QPoint pixels) const;
 
   void drawYLines(QPainter &painter, QPen &gridPen, int widthScreen,
-                  QwtValueList yAxisTicks, double yAngle);
+                  const QwtValueList &yAxisTicks, double yAngle);
 
   void drawXLines(QPainter &painter, QPen &gridPen, int heightScreen,
-                  QwtValueList xAxisTicks, double xAngle);
+                  const QwtValueList &xAxisTicks, double xAngle);
 
   void paintEvent(QPaintEvent *event) override;
 
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakBoundingBox.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakBoundingBox.h
index dd7038bbfe9..fc7eaf10c94 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakBoundingBox.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakBoundingBox.h
@@ -104,7 +104,7 @@ public:
   /// Serialize as set of comma separated values
   std::string toExtentsString() const;
   /// Transform the box.
-  void transformBox(Mantid::Geometry::PeakTransform_sptr transform);
+  void transformBox(const Mantid::Geometry::PeakTransform_sptr &transform);
   /// Make a new box based on the slice
   PeakBoundingBox makeSliceBox(const double &sliceDelta) const;
 };
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakRepresentationEllipsoid.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakRepresentationEllipsoid.h
index 33f1aeedb77..edfb0ea8656 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakRepresentationEllipsoid.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakRepresentationEllipsoid.h
@@ -18,10 +18,10 @@ class EXPORT_OPT_MANTIDQT_SLICEVIEWER PeakRepresentationEllipsoid
     : public PeakRepresentation {
 public:
   PeakRepresentationEllipsoid(
-      const Mantid::Kernel::V3D &origin, const std::vector<double> peakRadii,
-      const std::vector<double> backgroundInnerRadii,
-      const std::vector<double> backgroundOuterRadii,
-      const std::vector<Mantid::Kernel::V3D> directions,
+      const Mantid::Kernel::V3D &origin, const std::vector<double> &peakRadii,
+      const std::vector<double> &backgroundInnerRadii,
+      const std::vector<double> &backgroundOuterRadii,
+      const std::vector<Mantid::Kernel::V3D> &directions,
       std::shared_ptr<Mantid::SliceViewer::EllipsoidPlaneSliceCalculator>
           calculator);
 
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakViewColor.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakViewColor.h
index c10442a46ce..be320a3aa46 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakViewColor.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakViewColor.h
@@ -22,8 +22,9 @@
  * New peak types will need to have a color entry registered here.
  */
 struct PeakViewColor {
-  PeakViewColor(QColor colorCross = QColor(), QColor colorSphere = QColor(),
-                QColor colorEllipsoid = QColor())
+  PeakViewColor(const QColor &colorCross = QColor(),
+                const QColor &colorSphere = QColor(),
+                const QColor &colorEllipsoid = QColor())
       : colorCross(colorCross), colorSphere(colorSphere),
         colorEllipsoid(colorEllipsoid) {}
 
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakViewFactory.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakViewFactory.h
index 50103e19ce4..4081b4e2b4a 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakViewFactory.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeakViewFactory.h
@@ -44,7 +44,7 @@ private:
   // Creates a cross-like representation
   PeakRepresentation_sptr createPeakRepresentationCross(
       Mantid::Kernel::V3D position,
-      Mantid::Geometry::PeakTransform_const_sptr transform) const;
+      const Mantid::Geometry::PeakTransform_const_sptr &transform) const;
 
   // Creates a spherical representation
   PeakRepresentation_sptr
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeaksViewer.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeaksViewer.h
index 2f43b597c35..5b1c3ee32f2 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeaksViewer.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeaksViewer.h
@@ -31,14 +31,15 @@ class EXPORT_OPT_MANTIDQT_SLICEVIEWER PeaksViewer : public QWidget,
 public:
   PeaksViewer(QWidget *parent = nullptr);
   void setPeaksWorkspaces(const SetPeaksWorkspaces &workspaces);
-  void setPresenter(boost::shared_ptr<ProxyCompositePeaksPresenter> presenter);
+  void setPresenter(
+      const boost::shared_ptr<ProxyCompositePeaksPresenter> &presenter);
   void performUpdate() override;
   void
   updatePeaksWorkspace(const std::string &toName,
                        boost::shared_ptr<const Mantid::API::IPeaksWorkspace>
                            toWorkspace) override;
   bool removePeaksWorkspace(
-      boost::shared_ptr<const Mantid::API::IPeaksWorkspace> toRemove);
+      const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &toRemove);
   bool removePeaksWorkspace(const std::string &toRemove);
   void hide();
   ~PeaksViewer() override;
@@ -61,7 +62,8 @@ public slots:
   void
   onBackgroundRadiusShown(Mantid::API::IPeaksWorkspace_const_sptr /*peaksWS*/,
                           bool /*show*/);
-  void onRemoveWorkspace(Mantid::API::IPeaksWorkspace_const_sptr /*peaksWS*/);
+  void onRemoveWorkspace(
+      const Mantid::API::IPeaksWorkspace_const_sptr & /*peaksWS*/);
   void onHideInPlot(Mantid::API::IPeaksWorkspace_const_sptr peaksWS,
                     bool /*hide*/);
   void onZoomToPeak(Mantid::API::IPeaksWorkspace_const_sptr peaksWS,
@@ -82,8 +84,8 @@ private:
   /// Load a presented peaks workspace and settings from a project file
   void loadPresentedWorkspace(const std::string &section);
   /// Save a presented peaks workspace and settings to a project file
-  std::string
-  savePresentedWorkspace(Mantid::API::IPeaksWorkspace_const_sptr ws) const;
+  std::string savePresentedWorkspace(
+      const Mantid::API::IPeaksWorkspace_const_sptr &ws) const;
 
   boost::shared_ptr<ProxyCompositePeaksPresenter> m_presenter;
 };
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeaksViewerOverlayDialog.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeaksViewerOverlayDialog.h
index 604913459cd..21514a8fabc 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeaksViewerOverlayDialog.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeaksViewerOverlayDialog.h
@@ -20,7 +20,7 @@ class PeaksViewerOverlayDialog : public QDialog {
   Q_OBJECT
 
 public:
-  explicit PeaksViewerOverlayDialog(PeaksPresenter_sptr peaksPresenter,
+  explicit PeaksViewerOverlayDialog(const PeaksPresenter_sptr &peaksPresenter,
                                     QWidget *parent = nullptr);
   ~PeaksViewerOverlayDialog() override;
 
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeaksWorkspaceWidget.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeaksWorkspaceWidget.h
index 88e6f5f5c0f..1b71b252999 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeaksWorkspaceWidget.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/PeaksWorkspaceWidget.h
@@ -37,7 +37,7 @@ public:
   void setHidden(bool isHidden);
   void setSelectedPeak(int index);
   std::string getWSName() const;
-  void workspaceUpdate(Mantid::API::IPeaksWorkspace_const_sptr ws =
+  void workspaceUpdate(const Mantid::API::IPeaksWorkspace_const_sptr &ws =
                            Mantid::API::IPeaksWorkspace_const_sptr());
   void exitClearPeaksMode();
   void exitAddPeaksMode();
@@ -95,7 +95,7 @@ private slots:
   void onShowBackgroundChanged(bool /*show*/);
   void onRemoveWorkspaceClicked();
   void onToggleHideInPlot();
-  void onCurrentChanged(QModelIndex /*index*/, QModelIndex /*unused*/);
+  void onCurrentChanged(QModelIndex /*index*/, const QModelIndex & /*unused*/);
   void onClearPeaksToggled(bool /*on*/);
   void onAddPeaksToggled(bool /*on*/);
 };
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/ProxyCompositePeaksPresenter.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/ProxyCompositePeaksPresenter.h
index 3a75f574bed..f0a774f2395 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/ProxyCompositePeaksPresenter.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/ProxyCompositePeaksPresenter.h
@@ -34,11 +34,11 @@ public:
 
   void
   setForegroundColor(boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws,
-                     PeakViewColor /*color*/);
+                     const PeakViewColor & /*color*/);
   /// Change the background representation for the peaks of this workspace
   void
   setBackgroundColor(boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws,
-                     PeakViewColor /*color*/);
+                     const PeakViewColor & /*color*/);
   /// Get the foreground colour corresponding to the workspace
   PeakViewColor getForegroundPeakViewColor(
       boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) const;
@@ -87,8 +87,9 @@ public:
   /// Get optional zoomed peak index.
   int getZoomedPeakIndex() const;
   /// Set the edit mode.
-  void editCommand(EditMode editMode,
-                   boost::weak_ptr<const Mantid::API::IPeaksWorkspace> target);
+  void editCommand(
+      EditMode editMode,
+      const boost::weak_ptr<const Mantid::API::IPeaksWorkspace> &target);
   /// Set the peaks size within the current projection
   void setPeakSizeOnProjection(const double fraction);
   /// Set the peaks size into the current projection
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/QwtScaleDrawNonOrthogonal.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/QwtScaleDrawNonOrthogonal.h
index 571f76e1941..b8ec1b0e352 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/QwtScaleDrawNonOrthogonal.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/QwtScaleDrawNonOrthogonal.h
@@ -20,7 +20,7 @@ public:
 
   QwtScaleDrawNonOrthogonal(
       QwtPlot *plot, ScreenDimension screenDimension,
-      Mantid::API::IMDWorkspace_sptr workspace, size_t dimX, size_t dimY,
+      const Mantid::API::IMDWorkspace_sptr &workspace, size_t dimX, size_t dimY,
       Mantid::Kernel::VMD slicePoint,
       MantidQt::SliceViewer::NonOrthogonalOverlay *gridPlot);
 
@@ -32,7 +32,8 @@ public:
   void updateSlicePoint(Mantid::Kernel::VMD newSlicepoint);
 
 private:
-  void setTransformationMatrices(Mantid::API::IMDWorkspace_sptr workspace);
+  void
+  setTransformationMatrices(const Mantid::API::IMDWorkspace_sptr &workspace);
   qreal getScreenBottomInXyz() const;
   qreal getScreenLeftInXyz() const;
 
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/SliceViewer.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/SliceViewer.h
index d4fa335b371..66628a84527 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/SliceViewer.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/SliceViewer.h
@@ -85,11 +85,11 @@ public:
   ~SliceViewer() override;
 
   void setWorkspace(const QString &wsName);
-  void setWorkspace(Mantid::API::IMDWorkspace_sptr ws);
+  void setWorkspace(const Mantid::API::IMDWorkspace_sptr &ws);
   Mantid::API::IMDWorkspace_sptr getWorkspace();
   void showControls(bool visible);
   void zoomBy(double factor);
-  void loadColorMap(QString filename = QString());
+  void loadColorMap(const QString &filename = QString());
   LineOverlay *getLineOverlay() { return m_lineOverlay; }
   Mantid::Kernel::VMD getSlicePoint() const { return m_slicePoint; }
   int getDimX() const;
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/SliceViewerWindow.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/SliceViewerWindow.h
index 31f29ddf333..f6d598531e6 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/SliceViewerWindow.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/SliceViewerWindow.h
@@ -36,7 +36,7 @@ class EXPORT_OPT_MANTIDQT_SLICEVIEWER SliceViewerWindow
 
 public:
   SliceViewerWindow(const QString &wsName, const QString &label = QString(),
-                    Qt::WindowFlags f = nullptr);
+                    const Qt::WindowFlags &f = nullptr);
   ~SliceViewerWindow() override;
   MantidQt::SliceViewer::SliceViewer *getSlicer();
   MantidQt::SliceViewer::LineViewer *getLiner();
@@ -66,7 +66,7 @@ protected slots:
   void closeWindow();
   void updateWorkspace();
   void slicerWorkspaceChanged();
-  void changedSlicePoint(Mantid::Kernel::VMD /*slice*/);
+  void changedSlicePoint(const Mantid::Kernel::VMD & /*slice*/);
   void lineChanging(QPointF start, QPointF end, double width);
   void lineChanged(QPointF start, QPointF end, double width);
   void changeStartOrEnd(Mantid::Kernel::VMD /*start*/,
diff --git a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/XYLimitsDialog.h b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/XYLimitsDialog.h
index 72cc991dab6..55c522ff6da 100644
--- a/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/XYLimitsDialog.h
+++ b/qt/widgets/sliceviewer/inc/MantidQtWidgets/SliceViewer/XYLimitsDialog.h
@@ -23,8 +23,8 @@ public:
   XYLimitsDialog(QWidget *parent = nullptr);
   ~XYLimitsDialog() override;
 
-  void setXDim(Mantid::Geometry::IMDDimension_const_sptr dim);
-  void setYDim(Mantid::Geometry::IMDDimension_const_sptr dim);
+  void setXDim(const Mantid::Geometry::IMDDimension_const_sptr &dim);
+  void setYDim(const Mantid::Geometry::IMDDimension_const_sptr &dim);
   void setLimits(double x0, double x1, double y0, double y1);
   double getXMin();
   double getXMax();
diff --git a/qt/widgets/sliceviewer/src/CompositePeaksPresenter.cpp b/qt/widgets/sliceviewer/src/CompositePeaksPresenter.cpp
index bac9535472a..c9f010b773f 100644
--- a/qt/widgets/sliceviewer/src/CompositePeaksPresenter.cpp
+++ b/qt/widgets/sliceviewer/src/CompositePeaksPresenter.cpp
@@ -7,6 +7,7 @@
 #include "MantidQtWidgets/SliceViewer/CompositePeaksPresenter.h"
 #include "MantidAPI/IPeaksWorkspace.h"
 #include <stdexcept>
+#include <utility>
 
 using Mantid::Geometry::PeakTransform_sptr;
 
@@ -19,7 +20,8 @@ CompositePeaksPresenter::CompositePeaksPresenter(
     ZoomablePeaksView *const zoomablePlottingWidget,
     PeaksPresenter_sptr defaultPresenter)
     : m_zoomablePlottingWidget(zoomablePlottingWidget),
-      m_default(defaultPresenter), m_owner(nullptr), m_zoomedPeakIndex(-1) {
+      m_default(std::move(defaultPresenter)), m_owner(nullptr),
+      m_zoomedPeakIndex(-1) {
   if (m_zoomablePlottingWidget == nullptr) {
     throw std::runtime_error("Zoomable Plotting Widget is NULL");
   }
@@ -146,7 +148,8 @@ bool CompositePeaksPresenter::contentsDifferent(
 Add peaks presenter
 @param presenter : Subject peaks presenter
 */
-void CompositePeaksPresenter::addPeaksPresenter(PeaksPresenter_sptr presenter) {
+void CompositePeaksPresenter::addPeaksPresenter(
+    const PeaksPresenter_sptr &presenter) {
   if (this->size() == 10) {
     throw std::invalid_argument("Maximum number of PeaksWorkspaces that can be "
                                 "simultaneously displayed is 10.");
@@ -186,7 +189,7 @@ SetPeaksWorkspaces CompositePeaksPresenter::presentedWorkspaces() const {
 */
 CompositePeaksPresenter::SubjectContainer::iterator
 CompositePeaksPresenter::getPresenterIteratorFromWorkspace(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) {
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws) {
   SubjectContainer::iterator presenterFound = m_subjects.end();
   for (auto presenterIterator = m_subjects.begin();
        presenterIterator != m_subjects.end(); ++presenterIterator) {
@@ -206,7 +209,7 @@ CompositePeaksPresenter::getPresenterIteratorFromWorkspace(
 */
 CompositePeaksPresenter::SubjectContainer::const_iterator
 CompositePeaksPresenter::getPresenterIteratorFromWorkspace(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) const {
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws) const {
   SubjectContainer::const_iterator presenterFound = m_subjects.end();
   for (auto presenterIterator = m_subjects.begin();
        presenterIterator != m_subjects.end(); ++presenterIterator) {
@@ -226,9 +229,10 @@ Set the foreground colour of the peaks.
 @ colour to use for re-colouring
 */
 void CompositePeaksPresenter::setForegroundColor(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws,
-    const PeakViewColor color) {
-  SubjectContainer::iterator iterator = getPresenterIteratorFromWorkspace(ws);
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws,
+    const PeakViewColor &color) {
+  SubjectContainer::iterator iterator =
+      getPresenterIteratorFromWorkspace(std::move(ws));
 
   // Update the palette the foreground colour
   const int pos = static_cast<int>(std::distance(m_subjects.begin(), iterator));
@@ -244,9 +248,10 @@ Set the background colour of the peaks.
 @ colour to use for re-colouring
 */
 void CompositePeaksPresenter::setBackgroundColor(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws,
-    const PeakViewColor color) {
-  SubjectContainer::iterator iterator = getPresenterIteratorFromWorkspace(ws);
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws,
+    const PeakViewColor &color) {
+  SubjectContainer::iterator iterator =
+      getPresenterIteratorFromWorkspace(std::move(ws));
 
   // Update the palette background colour.
   const int pos = static_cast<int>(std::distance(m_subjects.begin(), iterator));
@@ -279,13 +284,13 @@ PeakPalette<PeakViewColor> CompositePeaksPresenter::getPalette() const {
 @return the foreground colour corresponding to the peaks workspace.
 */
 PeakViewColor CompositePeaksPresenter::getForegroundPeakViewColor(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) const {
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws) const {
   if (useDefault()) {
     throw std::runtime_error("Foreground colours from palette cannot be "
                              "fetched until nested presenters are added.");
   }
   SubjectContainer::const_iterator iterator =
-      getPresenterIteratorFromWorkspace(ws);
+      getPresenterIteratorFromWorkspace(std::move(ws));
   const int pos = static_cast<int>(std::distance(m_subjects.begin(), iterator));
   return m_palettePeakViewColor.foregroundIndexToColour(pos);
 }
@@ -295,13 +300,13 @@ PeakViewColor CompositePeaksPresenter::getForegroundPeakViewColor(
 @return the background colour corresponding to the peaks workspace.
 */
 PeakViewColor CompositePeaksPresenter::getBackgroundPeakViewColor(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) const {
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws) const {
   if (useDefault()) {
     throw std::runtime_error("Background colours from palette cannot be "
                              "fetched until nested presenters are added.");
   }
   SubjectContainer::const_iterator iterator =
-      getPresenterIteratorFromWorkspace(ws);
+      getPresenterIteratorFromWorkspace(std::move(ws));
   const int pos = static_cast<int>(std::distance(m_subjects.begin(), iterator));
   return m_palettePeakViewColor.backgroundIndexToColour(pos);
 }
@@ -313,12 +318,12 @@ PeakViewColor CompositePeaksPresenter::getBackgroundPeakViewColor(
  * @param shown : True to show.
  */
 void CompositePeaksPresenter::setBackgroundRadiusShown(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws,
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws,
     const bool shown) {
   if (useDefault()) {
     return m_default->showBackgroundRadius(shown);
   }
-  auto iterator = getPresenterIteratorFromWorkspace(ws);
+  auto iterator = getPresenterIteratorFromWorkspace(std::move(ws));
   (*iterator)->showBackgroundRadius(shown);
 }
 
@@ -327,11 +332,11 @@ void CompositePeaksPresenter::setBackgroundRadiusShown(
  * @param peaksWS : Peaks list to remove.
  */
 void CompositePeaksPresenter::remove(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS) {
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &peaksWS) {
   if (useDefault()) {
     return;
   }
-  auto iterator = getPresenterIteratorFromWorkspace(peaksWS);
+  auto iterator = getPresenterIteratorFromWorkspace(std::move(peaksWS));
   if (iterator != m_subjects.end()) {
     m_subjects.erase(iterator);
   }
@@ -346,12 +351,12 @@ void CompositePeaksPresenter::remove(
  * @param shown : True to show.
  */
 void CompositePeaksPresenter::setShown(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS,
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &peaksWS,
     const bool shown) {
   if (useDefault()) {
     return m_default->setShown(shown);
   }
-  auto iterator = getPresenterIteratorFromWorkspace(peaksWS);
+  auto iterator = getPresenterIteratorFromWorkspace(std::move(peaksWS));
   if (iterator == m_subjects.end())
     return;
 
@@ -367,9 +372,9 @@ void CompositePeaksPresenter::setShown(
  * @param peakIndex : Index of the peak in the peaks list to zoom into.
  */
 void CompositePeaksPresenter::zoomToPeak(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS,
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &peaksWS,
     const int peakIndex) {
-  auto iterator = getPresenterIteratorFromWorkspace(peaksWS);
+  auto iterator = getPresenterIteratorFromWorkspace(std::move(peaksWS));
   auto subjectPresenter = *iterator;
   auto boundingBox = subjectPresenter->getBoundingBox(peakIndex);
   m_zoomablePlottingWidget->zoomToRectangle(boundingBox);
@@ -460,13 +465,13 @@ double CompositePeaksPresenter::getPeakSizeIntoProjection() const {
  * @return
  */
 bool CompositePeaksPresenter::getShowBackground(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) const {
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &ws) const {
   if (useDefault()) {
     throw std::runtime_error("Get show background cannot be fetched until "
                              "nested presenters are added.");
   }
   SubjectContainer::const_iterator iterator =
-      getPresenterIteratorFromWorkspace(ws);
+      getPresenterIteratorFromWorkspace(std::move(ws));
   return (*iterator)->getShowBackground();
 }
 
@@ -478,7 +483,7 @@ private:
 
 public:
   explicit MatchWorkspaceName(const QString &name) : m_wsName(name) {}
-  bool operator()(SetPeaksWorkspaces::value_type ws) {
+  bool operator()(const SetPeaksWorkspaces::value_type &ws) {
     const std::string &wsName = ws->getName();
     const std::string toMatch = m_wsName.toStdString();
     const bool result = (wsName == toMatch);
@@ -557,7 +562,7 @@ private:
 
 public:
   explicit MatchPointer(PeaksPresenter *toFind) : m_toFind(toFind) {}
-  bool operator()(PeaksPresenter_sptr candidate) {
+  bool operator()(const PeaksPresenter_sptr &candidate) {
     return candidate.get() == m_toFind;
   }
 };
@@ -594,8 +599,9 @@ void CompositePeaksPresenter::zoomToPeak(PeaksPresenter *const presenter,
  * @return True if hidden.
  */
 bool CompositePeaksPresenter::getIsHidden(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS) const {
-  auto iterator = getPresenterIteratorFromWorkspace(peaksWS);
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &peaksWS)
+    const {
+  auto iterator = getPresenterIteratorFromWorkspace(std::move(peaksWS));
   auto subjectPresenter = *iterator;
   return subjectPresenter->isHidden();
 }
@@ -630,7 +636,7 @@ int CompositePeaksPresenter::getZoomedPeakIndex() const {
 
 void CompositePeaksPresenter::editCommand(
     EditMode editMode,
-    boost::weak_ptr<const Mantid::API::IPeaksWorkspace> target) {
+    const boost::weak_ptr<const Mantid::API::IPeaksWorkspace> &target) {
   if (auto ws = target.lock()) {
 
     // Change the right subject to the desired edit mode.
diff --git a/qt/widgets/sliceviewer/src/ConcretePeaksPresenter.cpp b/qt/widgets/sliceviewer/src/ConcretePeaksPresenter.cpp
index db85bdd976f..5aab97492e8 100644
--- a/qt/widgets/sliceviewer/src/ConcretePeaksPresenter.cpp
+++ b/qt/widgets/sliceviewer/src/ConcretePeaksPresenter.cpp
@@ -21,6 +21,7 @@
 #include "MantidQtWidgets/SliceViewer/UpdateableOnDemand.h"
 #include "MantidQtWidgets/SliceViewer/ZoomableOnDemand.h"
 #include <boost/regex.hpp>
+#include <utility>
 
 using namespace Mantid::API;
 using namespace Mantid::Kernel;
@@ -78,7 +79,7 @@ void ConcretePeaksPresenter::produceViews() {
  * @param mdWS : MDWorkspace currently plotted.
  */
 void ConcretePeaksPresenter::checkWorkspaceCompatibilities(
-    boost::shared_ptr<Mantid::API::MDGeometry> mdWS) {
+    const boost::shared_ptr<Mantid::API::MDGeometry> &mdWS) {
   if (auto imdWS =
           boost::dynamic_pointer_cast<Mantid::API::IMDWorkspace>(mdWS)) {
     const SpecialCoordinateSystem coordSystMD =
@@ -135,10 +136,11 @@ void ConcretePeaksPresenter::checkWorkspaceCompatibilities(
  interpreting the MODEL.
  */
 ConcretePeaksPresenter::ConcretePeaksPresenter(
-    PeakOverlayViewFactory_sptr viewFactory, IPeaksWorkspace_sptr peaksWS,
-    boost::shared_ptr<MDGeometry> mdWS,
-    Mantid::Geometry::PeakTransformFactory_sptr transformFactory)
-    : m_viewFactory(viewFactory), m_peaksWS(peaksWS),
+    PeakOverlayViewFactory_sptr viewFactory,
+    const IPeaksWorkspace_sptr &peaksWS,
+    const boost::shared_ptr<MDGeometry> &mdWS,
+    const Mantid::Geometry::PeakTransformFactory_sptr &transformFactory)
+    : m_viewFactory(std::move(viewFactory)), m_peaksWS(peaksWS),
       m_transformFactory(transformFactory),
       m_transform(transformFactory->createDefaultTransform()), m_slicePoint(),
       m_owningPresenter(nullptr), m_isHidden(false),
@@ -159,7 +161,7 @@ ConcretePeaksPresenter::ConcretePeaksPresenter(
   m_axisData.fromHklToXyz[8] = 1.0;
 
   // Check that the workspaces appear to be compatible. Log if otherwise.
-  checkWorkspaceCompatibilities(mdWS);
+  checkWorkspaceCompatibilities(std::move(mdWS));
   this->initialize();
 }
 
diff --git a/qt/widgets/sliceviewer/src/DimensionSliceWidget.cpp b/qt/widgets/sliceviewer/src/DimensionSliceWidget.cpp
index c4f21af9961..cf5abdf884a 100644
--- a/qt/widgets/sliceviewer/src/DimensionSliceWidget.cpp
+++ b/qt/widgets/sliceviewer/src/DimensionSliceWidget.cpp
@@ -9,6 +9,7 @@
 #include "MantidQtWidgets/Common/QStringUtils.h"
 #include <QLayout>
 #include <iosfwd>
+#include <utility>
 
 namespace MantidQt {
 using API::toQStringInternal;
@@ -179,7 +180,7 @@ void DimensionSliceWidget::setMinMax(double min, double max) {
 /** Set the dimension to display */
 void DimensionSliceWidget::setDimension(
     int index, Mantid::Geometry::IMDDimension_const_sptr dim) {
-  m_dim = dim;
+  m_dim = std::move(dim);
   m_dimIndex = index;
   // set the limits of the slider to be the bin centres and not
   // the edges of the bins
diff --git a/qt/widgets/sliceviewer/src/EllipsoidPlaneSliceCalculator.cpp b/qt/widgets/sliceviewer/src/EllipsoidPlaneSliceCalculator.cpp
index 91cbe5e151f..f1d8b04f6a6 100644
--- a/qt/widgets/sliceviewer/src/EllipsoidPlaneSliceCalculator.cpp
+++ b/qt/widgets/sliceviewer/src/EllipsoidPlaneSliceCalculator.cpp
@@ -9,6 +9,8 @@
 
 #include <algorithm>
 #include <cmath>
+#include <utility>
+
 /**
  *
  * The functions in this file intend to calculate the paramters of an ellipse
@@ -94,8 +96,8 @@ namespace {
  * @param zVal: the z value (in the ellipse frame)
  * @return the origin of the ellipse
  */
-Mantid::Kernel::V3D getOrigin(Mantid::Kernel::DblMatrix AInverse,
-                              Mantid::Kernel::DblMatrix B,
+Mantid::Kernel::V3D getOrigin(const Mantid::Kernel::DblMatrix &AInverse,
+                              const Mantid::Kernel::DblMatrix &B,
                               Mantid::Kernel::V3D originEllipsoid,
                               double zVal) {
   const auto multiplied = AInverse * B;
@@ -167,16 +169,17 @@ getEigenVectorsForEllipse(const Mantid::Kernel::DblMatrix &MM,
  * @return radii and directions
  */
 EigenSystemEllipse getAxesInformation(Mantid::Kernel::DblMatrix A,
-                                      Mantid::Kernel::DblMatrix AInverse,
-                                      Mantid::Kernel::DblMatrix B,
-                                      Mantid::Kernel::DblMatrix BT, double c) {
+                                      const Mantid::Kernel::DblMatrix &AInverse,
+                                      const Mantid::Kernel::DblMatrix &B,
+                                      const Mantid::Kernel::DblMatrix &BT,
+                                      double c) {
   // Calculate the denominator: (Transpose[B]*A^(-1)*B/4 - (c-1))
   const auto temp1 = AInverse * B;
   const auto temp2 = BT * temp1;
   const auto denominator = 0.25 * temp2[0][0] - c + 1;
 
   // Calculate the MM matrix: A/(Transpose[B]*A^(-1)*B/4 - (c-1))
-  auto MM = A;
+  auto MM = std::move(A);
   MM /= denominator;
 
   // Calculate the Eigenvalues: since we are dealing with EVs of a
@@ -234,7 +237,8 @@ SliceEllipseInfo EllipsoidPlaneSliceCalculator::getSlicePlaneInfo(
     std::vector<Mantid::Kernel::V3D> directions, std::vector<double> radii,
     Mantid::Kernel::V3D originEllipsoid, double zPlane) const {
   // Setup the Ellipsoid Matrix
-  auto m = createEllipsoidMatrixInXYZFrame(directions, radii);
+  auto m =
+      createEllipsoidMatrixInXYZFrame(std::move(directions), std::move(radii));
 
   auto isEllipsoid = checkIfIsEllipse(m);
 
diff --git a/qt/widgets/sliceviewer/src/LineOverlay.cpp b/qt/widgets/sliceviewer/src/LineOverlay.cpp
index 2ccd3c96939..5b2591c9968 100644
--- a/qt/widgets/sliceviewer/src/LineOverlay.cpp
+++ b/qt/widgets/sliceviewer/src/LineOverlay.cpp
@@ -240,7 +240,8 @@ QPointF LineOverlay::snap(QPointF original) const {
 
 //----------------------------------------------------------------------------------------------
 /** Draw a handle (for dragging) at the given plot coordinates */
-QRect LineOverlay::drawHandle(QPainter &painter, QPointF coords, QColor brush) {
+QRect LineOverlay::drawHandle(QPainter &painter, QPointF coords,
+                              const QColor &brush) {
   int size = 8;
   QPoint center = transform(coords);
   QRect marker(center.x() - size / 2, center.y() - size / 2, size, size);
diff --git a/qt/widgets/sliceviewer/src/LinePlotOptions.cpp b/qt/widgets/sliceviewer/src/LinePlotOptions.cpp
index 5c48a5f89b9..adb9a72406a 100644
--- a/qt/widgets/sliceviewer/src/LinePlotOptions.cpp
+++ b/qt/widgets/sliceviewer/src/LinePlotOptions.cpp
@@ -64,7 +64,8 @@ void LinePlotOptions::addPlotRadioButton(const std::string &text,
 
 //------------------------------------------------------------------------------
 /** Set the original workspace, to show the axes plot choice */
-void LinePlotOptions::setOriginalWorkspace(Mantid::API::IMDWorkspace_sptr ws) {
+void LinePlotOptions::setOriginalWorkspace(
+    const Mantid::API::IMDWorkspace_sptr &ws) {
   if (!ws)
     return;
 
diff --git a/qt/widgets/sliceviewer/src/LineViewer.cpp b/qt/widgets/sliceviewer/src/LineViewer.cpp
index 084a6c933b2..66c1b8e0351 100644
--- a/qt/widgets/sliceviewer/src/LineViewer.cpp
+++ b/qt/widgets/sliceviewer/src/LineViewer.cpp
@@ -75,8 +75,8 @@ Mantid::Kernel::Logger g_log("LineViewer");
  * @param width : Default thickness (for non integrated dimensions)
  * @param thicknesses : Thickness vector to write to
  */
-void setThicknessUsingDimensionInfo(IMDWorkspace_sptr ws, size_t dimIndex,
-                                    double width,
+void setThicknessUsingDimensionInfo(const IMDWorkspace_sptr &ws,
+                                    size_t dimIndex, double width,
                                     Mantid::Kernel::VMD &thicknesses) {
   auto currentDim = ws->getDimension(dimIndex);
   if (currentDim->getIsIntegrated()) {
@@ -328,7 +328,7 @@ void LineViewer::readTextboxes() {
  * @param ws :: MatrixWorkspace to integrate
  */
 IAlgorithm_sptr
-LineViewer::applyMatrixWorkspace(Mantid::API::MatrixWorkspace_sptr ws) {
+LineViewer::applyMatrixWorkspace(const Mantid::API::MatrixWorkspace_sptr &ws) {
   // (half-width in the plane)
   const double planeWidth = getPlanarWidth();
 
@@ -409,7 +409,7 @@ LineViewer::applyMatrixWorkspace(Mantid::API::MatrixWorkspace_sptr ws) {
  * @return the algorithm to run
  */
 IAlgorithm_sptr
-LineViewer::applyMDWorkspace(Mantid::API::IMDWorkspace_sptr ws) {
+LineViewer::applyMDWorkspace(const Mantid::API::IMDWorkspace_sptr &ws) {
   bool adaptive = ui.chkAdaptiveBins->isChecked();
 
   // (half-width in the plane)
@@ -706,7 +706,7 @@ bool LineViewer::getFixedBinWidthMode() const { return m_fixedBinWidthMode; }
 /** Set the workspace being sliced
  *
  * @param ws :: IMDWorkspace */
-void LineViewer::setWorkspace(Mantid::API::IMDWorkspace_sptr ws) {
+void LineViewer::setWorkspace(const Mantid::API::IMDWorkspace_sptr &ws) {
   if (!ws)
     throw std::runtime_error("LineViewer::setWorkspace(): Invalid workspace.");
   m_initFreeDimX = -1;
@@ -720,7 +720,7 @@ void LineViewer::setWorkspace(Mantid::API::IMDWorkspace_sptr ws) {
 
 /** Set the start point of the line to integrate
  * @param start :: vector for the start point */
-void LineViewer::setStart(Mantid::Kernel::VMD start) {
+void LineViewer::setStart(const Mantid::Kernel::VMD &start) {
   if (m_ws && start.getNumDims() != m_ws->getNumDims())
     throw std::runtime_error("LineViewer::setStart(): Invalid number of "
                              "dimensions in the start vector.");
@@ -730,7 +730,7 @@ void LineViewer::setStart(Mantid::Kernel::VMD start) {
 
 /** Set the end point of the line to integrate
  * @param end :: vector for the end point */
-void LineViewer::setEnd(Mantid::Kernel::VMD end) {
+void LineViewer::setEnd(const Mantid::Kernel::VMD &end) {
   if (m_ws && end.getNumDims() != m_ws->getNumDims())
     throw std::runtime_error("LineViewer::setEnd(): Invalid number of "
                              "dimensions in the end vector.");
@@ -741,7 +741,7 @@ void LineViewer::setEnd(Mantid::Kernel::VMD end) {
 /** Set the width of the line in each dimensions
  * @param width :: vector for the width in each dimension. X dimension stands in
  * for the XY plane width */
-void LineViewer::setThickness(Mantid::Kernel::VMD width) {
+void LineViewer::setThickness(const Mantid::Kernel::VMD &width) {
   if (m_ws && width.getNumDims() != m_ws->getNumDims())
     throw std::runtime_error("LineViewer::setThickness(): Invalid number of "
                              "dimensions in the width vector.");
diff --git a/qt/widgets/sliceviewer/src/NonOrthogonalOverlay.cpp b/qt/widgets/sliceviewer/src/NonOrthogonalOverlay.cpp
index 95b5cb431ee..b809c442f2c 100644
--- a/qt/widgets/sliceviewer/src/NonOrthogonalOverlay.cpp
+++ b/qt/widgets/sliceviewer/src/NonOrthogonalOverlay.cpp
@@ -127,7 +127,8 @@ void NonOrthogonalOverlay::paintEvent(QPaintEvent * /*event*/) {
 }
 
 void NonOrthogonalOverlay::drawYLines(QPainter &painter, QPen &gridPen,
-                                      int widthScreen, QwtValueList yAxisTicks,
+                                      int widthScreen,
+                                      const QwtValueList &yAxisTicks,
                                       double yAngle) {
 
   auto offset = yAngle == 0. ? 0. : widthScreen * tan(yAngle);
@@ -141,7 +142,8 @@ void NonOrthogonalOverlay::drawYLines(QPainter &painter, QPen &gridPen,
 }
 
 void NonOrthogonalOverlay::drawXLines(QPainter &painter, QPen &gridPen,
-                                      int heightScreen, QwtValueList xAxisTicks,
+                                      int heightScreen,
+                                      const QwtValueList &xAxisTicks,
                                       double xAngle) {
   xAngle *= -1.f;
   auto offset = xAngle == 0. ? 0. : heightScreen * tan(xAngle);
diff --git a/qt/widgets/sliceviewer/src/PeakBoundingBox.cpp b/qt/widgets/sliceviewer/src/PeakBoundingBox.cpp
index c200d724c7e..39a844e5f9a 100644
--- a/qt/widgets/sliceviewer/src/PeakBoundingBox.cpp
+++ b/qt/widgets/sliceviewer/src/PeakBoundingBox.cpp
@@ -213,7 +213,7 @@ std::string PeakBoundingBox::toExtentsString() const {
  * @param transform : Transform to use.
  */
 void PeakBoundingBox::transformBox(
-    Mantid::Geometry::PeakTransform_sptr transform) {
+    const Mantid::Geometry::PeakTransform_sptr &transform) {
   using Mantid::Kernel::V3D;
   // Front bottom left
   V3D newBottomLeft =
diff --git a/qt/widgets/sliceviewer/src/PeakRepresentationEllipsoid.cpp b/qt/widgets/sliceviewer/src/PeakRepresentationEllipsoid.cpp
index fd496f5154e..03b75fc1c47 100644
--- a/qt/widgets/sliceviewer/src/PeakRepresentationEllipsoid.cpp
+++ b/qt/widgets/sliceviewer/src/PeakRepresentationEllipsoid.cpp
@@ -14,6 +14,7 @@ Mantid::Kernel::Logger g_log("PeakRepresentation");
 }
 
 #include <QPainter>
+#include <utility>
 
 namespace {
 
@@ -62,10 +63,10 @@ namespace SliceViewer {
 const double PeakRepresentationEllipsoid::zeroRadius = 0.0;
 
 PeakRepresentationEllipsoid::PeakRepresentationEllipsoid(
-    const Mantid::Kernel::V3D &origin, const std::vector<double> peakRadii,
-    const std::vector<double> backgroundInnerRadii,
-    const std::vector<double> backgroundOuterRadii,
-    const std::vector<Mantid::Kernel::V3D> directions,
+    const Mantid::Kernel::V3D &origin, const std::vector<double> &peakRadii,
+    const std::vector<double> &backgroundInnerRadii,
+    const std::vector<double> &backgroundOuterRadii,
+    const std::vector<Mantid::Kernel::V3D> &directions,
     std::shared_ptr<Mantid::SliceViewer::EllipsoidPlaneSliceCalculator>
         calculator)
     : m_originalOrigin(origin), m_originalDirections(directions),
@@ -73,7 +74,7 @@ PeakRepresentationEllipsoid::PeakRepresentationEllipsoid(
       m_backgroundInnerRadii(backgroundInnerRadii),
       m_backgroundOuterRadii(backgroundOuterRadii), m_opacityMax(0.8),
       m_opacityMin(0.0), m_cachedOpacityAtDistance(0.0), m_angleEllipse(-1.0),
-      m_showBackgroundRadii(false), m_calculator(calculator) {
+      m_showBackgroundRadii(false), m_calculator(std::move(calculator)) {
   // Get projection lengths onto the xyz axes of the ellipsoid axes
   auto projections = Mantid::SliceViewer::getProjectionLengths(
       directions, backgroundOuterRadii);
diff --git a/qt/widgets/sliceviewer/src/PeakView.cpp b/qt/widgets/sliceviewer/src/PeakView.cpp
index e0c121610fa..ae6d3a6c97b 100644
--- a/qt/widgets/sliceviewer/src/PeakView.cpp
+++ b/qt/widgets/sliceviewer/src/PeakView.cpp
@@ -8,6 +8,8 @@
 #include "MantidQtWidgets/SliceViewer/SliceViewer.h"
 
 #include <QPainter>
+#include <utility>
+
 #include <qwt_double_interval.h>
 #include <qwt_plot.h>
 #include <qwt_scale_div.h>
@@ -24,7 +26,8 @@ PeakView::PeakView(PeaksPresenter *const presenter, QwtPlot *plot,
     : PeakOverlayInteractive(presenter, plot, plotXIndex, plotYIndex, parent),
       m_peaks(vecPeakRepresentation), m_cachedOccupancyIntoView(0.015),
       m_cachedOccupancyInView(0.015), m_showBackground(false),
-      m_foregroundColor(foregroundColor), m_backgroundColor(backgroundColor),
+      m_foregroundColor(std::move(foregroundColor)),
+      m_backgroundColor(std::move(backgroundColor)),
       m_largestEffectiveRadius(largestEffectiveRadius) {}
 
 PeakView::~PeakView() {}
diff --git a/qt/widgets/sliceviewer/src/PeakViewFactory.cpp b/qt/widgets/sliceviewer/src/PeakViewFactory.cpp
index d48e7cb24b1..402ccb0c30b 100644
--- a/qt/widgets/sliceviewer/src/PeakViewFactory.cpp
+++ b/qt/widgets/sliceviewer/src/PeakViewFactory.cpp
@@ -4,7 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
-#include "MantidQtWidgets/SliceViewer/PeakViewFactory.h"
+#include <utility>
+
 #include "MantidDataObjects/PeakShapeEllipsoid.h"
 #include "MantidDataObjects/PeakShapeSpherical.h"
 #include "MantidGeometry/Crystal/IPeak.h"
@@ -17,6 +18,7 @@
 #include "MantidQtWidgets/SliceViewer/PeakRepresentationEllipsoid.h"
 #include "MantidQtWidgets/SliceViewer/PeakRepresentationSphere.h"
 #include "MantidQtWidgets/SliceViewer/PeakView.h"
+#include "MantidQtWidgets/SliceViewer/PeakViewFactory.h"
 
 namespace {
 struct ZMinAndMax {
@@ -24,8 +26,9 @@ struct ZMinAndMax {
   double zMin;
 };
 
-ZMinAndMax getZMinAndMax(Mantid::API::IMDWorkspace_sptr workspace,
-                         Mantid::Geometry::PeakTransform_const_sptr transform) {
+ZMinAndMax
+getZMinAndMax(const Mantid::API::IMDWorkspace_sptr &workspace,
+              const Mantid::Geometry::PeakTransform_const_sptr &transform) {
   double zMax = 0.0;
   double zMin = 0.0;
   const auto numberOfDimensions = workspace->getNumDims();
@@ -79,7 +82,7 @@ PeakViewFactory::PeakViewFactory(Mantid::API::IMDWorkspace_sptr mdWS,
                                  const size_t colorNumber)
     : PeakOverlayViewFactoryBase(plot, parent, plotXIndex, plotYIndex,
                                  colorNumber),
-      m_mdWS(mdWS), m_peaksWS(peaksWS),
+      m_mdWS(std::move(mdWS)), m_peaksWS(std::move(peaksWS)),
       m_calculator(std::make_shared<
                    Mantid::SliceViewer::EllipsoidPlaneSliceCalculator>()) {
   setForegroundAndBackgroundColors(colorNumber);
@@ -127,15 +130,16 @@ PeakRepresentation_sptr PeakViewFactory::createSinglePeakRepresentation(
              Mantid::DataObjects::PeakShapeEllipsoid::ellipsoidShapeName()) {
     peakRepresentation = createPeakRepresentationEllipsoid(position, peak);
   } else {
-    peakRepresentation = createPeakRepresentationCross(position, transform);
+    peakRepresentation =
+        createPeakRepresentationCross(position, std::move(transform));
   }
   return peakRepresentation;
 }
 
 PeakRepresentation_sptr PeakViewFactory::createPeakRepresentationCross(
     Mantid::Kernel::V3D position,
-    Mantid::Geometry::PeakTransform_const_sptr transform) const {
-  const auto zMinAndMax = getZMinAndMax(m_mdWS, transform);
+    const Mantid::Geometry::PeakTransform_const_sptr &transform) const {
+  const auto zMinAndMax = getZMinAndMax(m_mdWS, std::move(transform));
   return std::make_shared<PeakRepresentationCross>(position, zMinAndMax.zMax,
                                                    zMinAndMax.zMin);
 }
diff --git a/qt/widgets/sliceviewer/src/PeaksViewer.cpp b/qt/widgets/sliceviewer/src/PeaksViewer.cpp
index 1331feeaca9..2c673a4fe64 100644
--- a/qt/widgets/sliceviewer/src/PeaksViewer.cpp
+++ b/qt/widgets/sliceviewer/src/PeaksViewer.cpp
@@ -14,6 +14,7 @@
 #include "MantidQtWidgets/SliceViewer/ProxyCompositePeaksPresenter.h"
 #include <QBoxLayout>
 #include <QLayoutItem>
+#include <utility>
 
 namespace MantidQt {
 namespace SliceViewer {
@@ -49,7 +50,7 @@ void removeLayout(QWidget *widget) {
  * @param presenter : Proxy through which all information can be fetched.
  */
 void PeaksViewer::setPresenter(
-    boost::shared_ptr<ProxyCompositePeaksPresenter> presenter) {
+    const boost::shared_ptr<ProxyCompositePeaksPresenter> &presenter) {
   m_presenter = presenter;
   m_presenter->registerView(this);
 
@@ -317,7 +318,7 @@ std::string PeaksViewer::saveToProject() const {
  * @return the state of the presented peaks workspace as a project file string
  */
 std::string PeaksViewer::savePresentedWorkspace(
-    Mantid::API::IPeaksWorkspace_const_sptr ws) const {
+    const Mantid::API::IPeaksWorkspace_const_sptr &ws) const {
   API::TSVSerialiser tsv;
   tsv.writeLine("Name") << ws->getName();
   tsv.writeLine("ShowBackground") << m_presenter->getShowBackground(ws);
@@ -345,7 +346,7 @@ std::string PeaksViewer::savePresentedWorkspace(
  */
 void PeaksViewer::onPeakColorChanged(
     Mantid::API::IPeaksWorkspace_const_sptr peaksWS, PeakViewColor newColor) {
-  m_presenter->setForegroundColor(peaksWS, newColor);
+  m_presenter->setForegroundColor(std::move(peaksWS), std::move(newColor));
 }
 
 /**
@@ -355,7 +356,7 @@ void PeaksViewer::onPeakColorChanged(
  */
 void PeaksViewer::onBackgroundColorChanged(
     Mantid::API::IPeaksWorkspace_const_sptr peaksWS, PeakViewColor newColor) {
-  m_presenter->setBackgroundColor(peaksWS, newColor);
+  m_presenter->setBackgroundColor(std::move(peaksWS), std::move(newColor));
 }
 
 /**
@@ -365,7 +366,7 @@ void PeaksViewer::onBackgroundColorChanged(
  */
 void PeaksViewer::onBackgroundRadiusShown(
     Mantid::API::IPeaksWorkspace_const_sptr peaksWS, bool show) {
-  m_presenter->setBackgroundRadiusShown(peaksWS, show);
+  m_presenter->setBackgroundRadiusShown(std::move(peaksWS), show);
 }
 
 /**
@@ -373,8 +374,8 @@ void PeaksViewer::onBackgroundRadiusShown(
  * @param peaksWS : Workspace to remove
  */
 void PeaksViewer::onRemoveWorkspace(
-    Mantid::API::IPeaksWorkspace_const_sptr peaksWS) {
-  this->removePeaksWorkspace(peaksWS);
+    const Mantid::API::IPeaksWorkspace_const_sptr &peaksWS) {
+  this->removePeaksWorkspace(std::move(peaksWS));
 }
 
 /**
@@ -384,7 +385,7 @@ void PeaksViewer::onRemoveWorkspace(
  */
 void PeaksViewer::onHideInPlot(Mantid::API::IPeaksWorkspace_const_sptr peaksWS,
                                bool hide) {
-  m_presenter->hideInPlot(peaksWS, hide);
+  m_presenter->hideInPlot(std::move(peaksWS), hide);
 }
 
 /**
@@ -394,7 +395,7 @@ void PeaksViewer::onHideInPlot(Mantid::API::IPeaksWorkspace_const_sptr peaksWS,
  */
 void PeaksViewer::onZoomToPeak(Mantid::API::IPeaksWorkspace_const_sptr peaksWS,
                                int peakIndex) {
-  m_presenter->zoomToPeak(peaksWS, peakIndex);
+  m_presenter->zoomToPeak(std::move(peaksWS), peakIndex);
 }
 
 /**
@@ -476,7 +477,7 @@ void PeaksViewer::updatePeaksWorkspace(
 }
 
 bool PeaksViewer::removePeaksWorkspace(
-    boost::shared_ptr<const Mantid::API::IPeaksWorkspace> toRemove) {
+    const boost::shared_ptr<const Mantid::API::IPeaksWorkspace> &toRemove) {
   bool somethingToRemove = false;
   if (m_presenter) {
 
diff --git a/qt/widgets/sliceviewer/src/PeaksViewerOverlayDialog.cpp b/qt/widgets/sliceviewer/src/PeaksViewerOverlayDialog.cpp
index c12e0d3dfba..a77f05cca54 100644
--- a/qt/widgets/sliceviewer/src/PeaksViewerOverlayDialog.cpp
+++ b/qt/widgets/sliceviewer/src/PeaksViewerOverlayDialog.cpp
@@ -62,7 +62,7 @@ QString formattedPercentageValue(double fraction) {
  * @param parent : Parent widget
  */
 PeaksViewerOverlayDialog::PeaksViewerOverlayDialog(
-    PeaksPresenter_sptr peaksPresenter, QWidget *parent)
+    const PeaksPresenter_sptr &peaksPresenter, QWidget *parent)
     : QDialog(parent), ui(new Ui::PeaksViewerOverlayDialog),
       m_peaksPresenter(peaksPresenter) {
   ui->setupUi(this);
diff --git a/qt/widgets/sliceviewer/src/PeaksWorkspaceWidget.cpp b/qt/widgets/sliceviewer/src/PeaksWorkspaceWidget.cpp
index 8a413595174..79b50119473 100644
--- a/qt/widgets/sliceviewer/src/PeaksWorkspaceWidget.cpp
+++ b/qt/widgets/sliceviewer/src/PeaksWorkspaceWidget.cpp
@@ -12,6 +12,7 @@
 #include <QColorDialog>
 #include <QPlastiqueStyle>
 #include <QSortFilterProxyModel>
+#include <utility>
 
 namespace {
 QColor getSelectedColor() {
@@ -40,9 +41,10 @@ PeaksWorkspaceWidget::PeaksWorkspaceWidget(
     const std::string &coordinateSystem,
     PeakViewColor defaultForegroundPeakViewColor,
     PeakViewColor defaultBackgroundPeakViewColor, PeaksViewer *parent)
-    : QWidget(parent), m_ws(ws), m_coordinateSystem(coordinateSystem),
-      m_foregroundPeakViewColor(defaultForegroundPeakViewColor),
-      m_backgroundPeakViewColor(defaultBackgroundPeakViewColor),
+    : QWidget(parent), m_ws(std::move(ws)),
+      m_coordinateSystem(coordinateSystem),
+      m_foregroundPeakViewColor(std::move(defaultForegroundPeakViewColor)),
+      m_backgroundPeakViewColor(std::move(defaultBackgroundPeakViewColor)),
       m_parent(parent) {
 
   ui.setupUi(this);
@@ -340,7 +342,7 @@ std::string PeaksWorkspaceWidget::getWSName() const {
  * @param ws : Workspace to redisplay with
  */
 void PeaksWorkspaceWidget::workspaceUpdate(
-    Mantid::API::IPeaksWorkspace_const_sptr ws) {
+    const Mantid::API::IPeaksWorkspace_const_sptr &ws) {
   // Only if we provide a peaks workspace for replacement.
   if (ws) {
     m_ws = ws;
@@ -360,7 +362,7 @@ void PeaksWorkspaceWidget::workspaceUpdate(
  * @param index : Index of the table newly selected
  */
 void PeaksWorkspaceWidget::onCurrentChanged(QModelIndex index,
-                                            QModelIndex /*unused*/) {
+                                            const QModelIndex & /*unused*/) {
   if (index.isValid()) {
     index = m_tableModel->mapToSource(index);
     emit zoomToPeak(this->m_ws, index.row());
diff --git a/qt/widgets/sliceviewer/src/ProxyCompositePeaksPresenter.cpp b/qt/widgets/sliceviewer/src/ProxyCompositePeaksPresenter.cpp
index 348deaac6ab..69bd6210919 100644
--- a/qt/widgets/sliceviewer/src/ProxyCompositePeaksPresenter.cpp
+++ b/qt/widgets/sliceviewer/src/ProxyCompositePeaksPresenter.cpp
@@ -4,6 +4,8 @@
 //   NScD Oak Ridge National Laboratory, European Spallation Source,
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
+#include <utility>
+
 #include "MantidQtWidgets/SliceViewer/ProxyCompositePeaksPresenter.h"
 
 namespace MantidQt {
@@ -13,7 +15,7 @@ Constructor
 */
 ProxyCompositePeaksPresenter::ProxyCompositePeaksPresenter(
     boost::shared_ptr<CompositePeaksPresenter> composite)
-    : m_compositePresenter(composite), m_updateableView(nullptr) {
+    : m_compositePresenter(std::move(composite)), m_updateableView(nullptr) {
   m_compositePresenter->registerOwningPresenter(this);
 }
 
@@ -44,8 +46,8 @@ Set the foreground colour of the peaks.
 */
 void ProxyCompositePeaksPresenter::setForegroundColor(
     boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws,
-    PeakViewColor color) {
-  m_compositePresenter->setForegroundColor(ws, color);
+    const PeakViewColor &color) {
+  m_compositePresenter->setForegroundColor(std::move(ws), std::move(color));
 }
 
 /**
@@ -55,23 +57,23 @@ Set the background colour of the peaks.
 */
 void ProxyCompositePeaksPresenter::setBackgroundColor(
     boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws,
-    PeakViewColor color) {
-  m_compositePresenter->setBackgroundColor(ws, color);
+    const PeakViewColor &color) {
+  m_compositePresenter->setBackgroundColor(std::move(ws), std::move(color));
 }
 
 PeakViewColor ProxyCompositePeaksPresenter::getBackgroundPeakViewColor(
     boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) const {
-  return m_compositePresenter->getBackgroundPeakViewColor(ws);
+  return m_compositePresenter->getBackgroundPeakViewColor(std::move(ws));
 }
 
 PeakViewColor ProxyCompositePeaksPresenter::getForegroundPeakViewColor(
     boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) const {
-  return m_compositePresenter->getForegroundPeakViewColor(ws);
+  return m_compositePresenter->getForegroundPeakViewColor(std::move(ws));
 }
 
 bool ProxyCompositePeaksPresenter::getShowBackground(
     boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws) const {
-  return m_compositePresenter->getShowBackground(ws);
+  return m_compositePresenter->getShowBackground(std::move(ws));
 }
 
 /**
@@ -91,24 +93,24 @@ std::string ProxyCompositePeaksPresenter::getTransformName() const {
 void ProxyCompositePeaksPresenter::setBackgroundRadiusShown(
     boost::shared_ptr<const Mantid::API::IPeaksWorkspace> ws,
     const bool shown) {
-  m_compositePresenter->setBackgroundRadiusShown(ws, shown);
+  m_compositePresenter->setBackgroundRadiusShown(std::move(ws), shown);
 }
 
 void ProxyCompositePeaksPresenter::remove(
     boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS) {
-  m_compositePresenter->remove(peaksWS);
+  m_compositePresenter->remove(std::move(peaksWS));
 }
 
 void ProxyCompositePeaksPresenter::hideInPlot(
     boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS,
     const bool hide) {
-  m_compositePresenter->setShown(peaksWS, !hide);
+  m_compositePresenter->setShown(std::move(peaksWS), !hide);
 }
 
 void ProxyCompositePeaksPresenter::zoomToPeak(
     boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS,
     const int peakIndex) {
-  m_compositePresenter->zoomToPeak(peaksWS, peakIndex);
+  m_compositePresenter->zoomToPeak(std::move(peaksWS), peakIndex);
 }
 
 PeaksPresenter *
@@ -132,7 +134,7 @@ void ProxyCompositePeaksPresenter::updatePeaksWorkspace(
 
 bool ProxyCompositePeaksPresenter::getIsHidden(
     boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS) const {
-  return m_compositePresenter->getIsHidden(peaksWS);
+  return m_compositePresenter->getIsHidden(std::move(peaksWS));
 }
 
 void ProxyCompositePeaksPresenter::registerView(
@@ -151,8 +153,8 @@ int ProxyCompositePeaksPresenter::getZoomedPeakIndex() const {
 
 void ProxyCompositePeaksPresenter::editCommand(
     EditMode editMode,
-    boost::weak_ptr<const Mantid::API::IPeaksWorkspace> target) {
-  m_compositePresenter->editCommand(editMode, target);
+    const boost::weak_ptr<const Mantid::API::IPeaksWorkspace> &target) {
+  m_compositePresenter->editCommand(editMode, std::move(target));
 }
 
 void ProxyCompositePeaksPresenter::setPeakSizeOnProjection(
diff --git a/qt/widgets/sliceviewer/src/QPeaksTableModel.cpp b/qt/widgets/sliceviewer/src/QPeaksTableModel.cpp
index 0def4036177..0e7d10697dd 100644
--- a/qt/widgets/sliceviewer/src/QPeaksTableModel.cpp
+++ b/qt/widgets/sliceviewer/src/QPeaksTableModel.cpp
@@ -14,6 +14,7 @@
 #include "MantidKernel/InstrumentInfo.h"
 #include <QString>
 #include <boost/lexical_cast.hpp>
+#include <utility>
 
 using namespace Mantid::API;
 using namespace Mantid::Geometry;
@@ -152,7 +153,7 @@ Constructor
 */
 QPeaksTableModel::QPeaksTableModel(
     boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS)
-    : QAbstractTableModel(nullptr), m_peaksWS(peaksWS) {
+    : QAbstractTableModel(nullptr), m_peaksWS(std::move(peaksWS)) {
   m_columnNameMap = {{0, RUNNUMBER},
                      {1, DETID},
                      {2, H},
@@ -264,7 +265,7 @@ void QPeaksTableModel::setPeaksWorkspace(
     boost::shared_ptr<const Mantid::API::IPeaksWorkspace> peaksWS) {
   beginResetModel();
   emit layoutAboutToBeChanged();
-  m_peaksWS = peaksWS;
+  m_peaksWS = std::move(peaksWS);
   emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
   emit layoutChanged();
   endResetModel();
diff --git a/qt/widgets/sliceviewer/src/QwtScaleDrawNonOrthogonal.cpp b/qt/widgets/sliceviewer/src/QwtScaleDrawNonOrthogonal.cpp
index bf424782861..f06198fa22f 100644
--- a/qt/widgets/sliceviewer/src/QwtScaleDrawNonOrthogonal.cpp
+++ b/qt/widgets/sliceviewer/src/QwtScaleDrawNonOrthogonal.cpp
@@ -15,18 +15,19 @@
 #include <QMatrix>
 #include <QPainter>
 #include <QPalette>
+#include <utility>
 
 QwtScaleDrawNonOrthogonal::QwtScaleDrawNonOrthogonal(
     QwtPlot *plot, ScreenDimension screenDimension,
-    Mantid::API::IMDWorkspace_sptr workspace, size_t dimX, size_t dimY,
+    const Mantid::API::IMDWorkspace_sptr &workspace, size_t dimX, size_t dimY,
     Mantid::Kernel::VMD slicePoint,
     MantidQt::SliceViewer::NonOrthogonalOverlay *gridPlot)
     : m_fromHklToXyz({{1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}}),
       m_fromXyzToHkl({{1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}}),
       m_plot(plot), m_screenDimension(screenDimension), m_dimX(dimX),
-      m_dimY(dimY), m_slicePoint(slicePoint), m_gridPlot(gridPlot) {
+      m_dimY(dimY), m_slicePoint(std::move(slicePoint)), m_gridPlot(gridPlot) {
   // Set up the transformation matrix
-  setTransformationMatrices(workspace);
+  setTransformationMatrices(std::move(workspace));
 
   // Set up the angles
   // set the angles for the two dimensions
@@ -289,7 +290,7 @@ QwtScaleDrawNonOrthogonal::fromHklToXyz(const Mantid::Kernel::VMD &hkl) const {
 }
 
 void QwtScaleDrawNonOrthogonal::setTransformationMatrices(
-    Mantid::API::IMDWorkspace_sptr workspace) {
+    const Mantid::API::IMDWorkspace_sptr &workspace) {
   m_missingDimension =
       MantidQt::API::getMissingHKLDimensionIndex(workspace, m_dimX, m_dimY);
 
@@ -315,5 +316,5 @@ qreal QwtScaleDrawNonOrthogonal::getScreenLeftInXyz() const {
 
 void QwtScaleDrawNonOrthogonal::updateSlicePoint(
     Mantid::Kernel::VMD newSlicepoint) {
-  m_slicePoint = newSlicepoint;
+  m_slicePoint = std::move(newSlicepoint);
 }
diff --git a/qt/widgets/sliceviewer/src/SliceViewer.cpp b/qt/widgets/sliceviewer/src/SliceViewer.cpp
index fe03b73ec68..1569f9d4b7b 100644
--- a/qt/widgets/sliceviewer/src/SliceViewer.cpp
+++ b/qt/widgets/sliceviewer/src/SliceViewer.cpp
@@ -750,7 +750,7 @@ void SliceViewer::switchQWTRaster(bool useNonOrthogonal) {
  *
  * @param ws :: IMDWorkspace to show.
  */
-void SliceViewer::setWorkspace(Mantid::API::IMDWorkspace_sptr ws) {
+void SliceViewer::setWorkspace(const Mantid::API::IMDWorkspace_sptr &ws) {
   struct ScopedFlag {
     explicit ScopedFlag(bool &b) : m_flag(b) { m_flag = true; }
     ~ScopedFlag() { m_flag = false; }
@@ -913,7 +913,7 @@ Mantid::API::IMDWorkspace_sptr SliceViewer::getWorkspace() { return m_ws; }
  *
  * @param filename :: file to open; empty to ask via a dialog box.
  */
-void SliceViewer::loadColorMap(QString filename) {
+void SliceViewer::loadColorMap(const QString &filename) {
   QString fileselection;
   if (filename.isEmpty()) {
     fileselection = MantidColorMap::chooseColorMap(m_currentColorMapFile, this);
diff --git a/qt/widgets/sliceviewer/src/SliceViewerWindow.cpp b/qt/widgets/sliceviewer/src/SliceViewerWindow.cpp
index 04b7ca66e87..12ebfdbaf3c 100644
--- a/qt/widgets/sliceviewer/src/SliceViewerWindow.cpp
+++ b/qt/widgets/sliceviewer/src/SliceViewerWindow.cpp
@@ -37,7 +37,8 @@ namespace SliceViewer {
  * @return
  */
 SliceViewerWindow::SliceViewerWindow(const QString &wsName,
-                                     const QString &label, Qt::WindowFlags f)
+                                     const QString &label,
+                                     const Qt::WindowFlags &f)
     : QMainWindow(nullptr, f), WorkspaceObserver(), m_lastLinerWidth(0),
       m_lastPeaksViewerWidth(0) {
 
@@ -372,7 +373,7 @@ void SliceViewerWindow::lineChanged(QPointF start2D, QPointF end2D,
 
 /** Slot called when changing the slice point of the 2D view
  * (keeping the line in the same 2D point) */
-void SliceViewerWindow::changedSlicePoint(Mantid::Kernel::VMD slice) {
+void SliceViewerWindow::changedSlicePoint(const Mantid::Kernel::VMD &slice) {
   UNUSED_ARG(slice);
   setLineViewerValues(m_slicer->getLineOverlay()->getPointA(),
                       m_slicer->getLineOverlay()->getPointB(),
diff --git a/qt/widgets/sliceviewer/src/XYLimitsDialog.cpp b/qt/widgets/sliceviewer/src/XYLimitsDialog.cpp
index 35a4a5436ee..af4f1d35411 100644
--- a/qt/widgets/sliceviewer/src/XYLimitsDialog.cpp
+++ b/qt/widgets/sliceviewer/src/XYLimitsDialog.cpp
@@ -27,14 +27,16 @@ XYLimitsDialog::~XYLimitsDialog() {}
 //------------------------------------------------------------------------------------------
 /** Set the labels for the X dimensions
  * @param dim : IMDDimension */
-void XYLimitsDialog::setXDim(Mantid::Geometry::IMDDimension_const_sptr dim) {
+void XYLimitsDialog::setXDim(
+    const Mantid::Geometry::IMDDimension_const_sptr &dim) {
   ui.lblXName->setText(QString::fromStdString(dim->getName()));
   ui.lblXUnits->setText(toQStringInternal(dim->getUnits().utf8()));
 }
 
 /** Set the labels for the Y dimensions
  * @param dim : IMDDimension */
-void XYLimitsDialog::setYDim(Mantid::Geometry::IMDDimension_const_sptr dim) {
+void XYLimitsDialog::setYDim(
+    const Mantid::Geometry::IMDDimension_const_sptr &dim) {
   ui.lblYName->setText(QString::fromStdString(dim->getName()));
   ui.lblYUnits->setText(toQStringInternal(dim->getUnits().utf8()));
 }
diff --git a/qt/widgets/sliceviewer/test/ConcretePeaksPresenterTest.h b/qt/widgets/sliceviewer/test/ConcretePeaksPresenterTest.h
index cdc4686369f..ba7f4afd375 100644
--- a/qt/widgets/sliceviewer/test/ConcretePeaksPresenterTest.h
+++ b/qt/widgets/sliceviewer/test/ConcretePeaksPresenterTest.h
@@ -22,6 +22,7 @@
 #include <boost/make_shared.hpp>
 #include <cxxtest/TestSuite.h>
 #include <string>
+#include <utility>
 
 using namespace MantidQt::SliceViewer;
 using namespace Mantid::API;
@@ -50,7 +51,7 @@ class ConcretePeaksPresenterTest : public CxxTest::TestSuite {
   }
 
   /// Helper method to create a mock MDDimension.
-  IMDDimension_sptr createExpectedMDDimension(const std::string returnLabel) {
+  IMDDimension_sptr createExpectedMDDimension(const std::string &returnLabel) {
     auto *pDim = new NiceMock<MockIMDDimension>;
     IMDDimension_sptr dim(pDim);
     EXPECT_CALL(*pDim, getName()).WillRepeatedly(Return(returnLabel));
@@ -100,12 +101,16 @@ class ConcretePeaksPresenterTest : public CxxTest::TestSuite {
     }
 
     void withViewFactory(PeakOverlayViewFactory_sptr val) {
-      m_viewFactory = val;
+      m_viewFactory = std::move(val);
+    }
+    void withPeaksWorkspace(IPeaksWorkspace_sptr val) {
+      m_peaksWS = std::move(val);
+    }
+    void withMDWorkspace(boost::shared_ptr<MDGeometry> val) {
+      m_mdWS = std::move(val);
     }
-    void withPeaksWorkspace(IPeaksWorkspace_sptr val) { m_peaksWS = val; }
-    void withMDWorkspace(boost::shared_ptr<MDGeometry> val) { m_mdWS = val; }
     void withTransformFactory(PeakTransformFactory_sptr val) {
-      m_transformFactory = val;
+      m_transformFactory = std::move(val);
     }
 
     ConcretePeaksPresenter_sptr create() {
diff --git a/qt/widgets/sliceviewer/test/PeakRepresentationEllipsoidTest.h b/qt/widgets/sliceviewer/test/PeakRepresentationEllipsoidTest.h
index 6d58882e1b3..bef73f4f1a6 100644
--- a/qt/widgets/sliceviewer/test/PeakRepresentationEllipsoidTest.h
+++ b/qt/widgets/sliceviewer/test/PeakRepresentationEllipsoidTest.h
@@ -10,6 +10,8 @@
 #include "MockObjects.h"
 #include <cxxtest/TestSuite.h>
 
+#include <utility>
+
 using namespace MantidQt::SliceViewer;
 using namespace testing;
 
@@ -34,12 +36,12 @@ public:
       const Mantid::Kernel::V3D &origin, const std::vector<double> &peakRadius,
       const std::vector<double> &backgroundInnerRadius,
       const std::vector<double> &backgroundOuterRadius,
-      const std::vector<Mantid::Kernel::V3D> directions,
+      const std::vector<Mantid::Kernel::V3D> &directions,
       std::shared_ptr<Mantid::SliceViewer::EllipsoidPlaneSliceCalculator>
           calculator)
       : PeakRepresentationEllipsoid(origin, peakRadius, backgroundInnerRadius,
                                     backgroundOuterRadius, directions,
-                                    calculator)
+                                    std::move(calculator))
 
   {}
   std::shared_ptr<PeakPrimitives> getDrawingInformationWrapper(
diff --git a/qt/widgets/sliceviewer/test/SliceViewerFunctionsTest.h b/qt/widgets/sliceviewer/test/SliceViewerFunctionsTest.h
index dff6162d9e8..50d77e46b41 100644
--- a/qt/widgets/sliceviewer/test/SliceViewerFunctionsTest.h
+++ b/qt/widgets/sliceviewer/test/SliceViewerFunctionsTest.h
@@ -38,7 +38,7 @@ SliceDefinition get_slice_definition(const size_t numberOfDimensions,
 
 std::vector<Mantid::Geometry::MDHistoDimension_sptr> get_dimensions_collection(
     const size_t numberOfDimensions, const Mantid::Kernel::VMD_t minValue,
-    const Mantid::Kernel::VMD_t maxValue, const std::string sliceLies) {
+    const Mantid::Kernel::VMD_t maxValue, const std::string &sliceLies) {
 
   std::vector<Mantid::Geometry::MDHistoDimension_sptr> dimensions(
       numberOfDimensions);
@@ -75,7 +75,7 @@ std::vector<Mantid::Geometry::MDHistoDimension_sptr> get_dimensions_collection(
 class SliceViewerFunctionsTest : public CxxTest::TestSuite {
 public:
   bool do_test_slice_lies_in_workspace_boundaries(
-      const std::string sliceLiesWithinWorkspaceBoundary) {
+      const std::string &sliceLiesWithinWorkspaceBoundary) {
     // Arrange
     const size_t numberOfDimensions = 3;
     Mantid::Kernel::VMD_t minValue = 1;
diff --git a/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/MatrixWSDataSource.h b/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/MatrixWSDataSource.h
index 57ee73206d7..9b8e7ca0fd2 100644
--- a/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/MatrixWSDataSource.h
+++ b/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/MatrixWSDataSource.h
@@ -41,7 +41,7 @@ class EXPORT_OPT_MANTIDQT_SPECTRUMVIEWER MatrixWSDataSource
     : public SpectrumDataSource {
 public:
   /// Construct a DataSource object around the specifed MatrixWorkspace
-  MatrixWSDataSource(Mantid::API::MatrixWorkspace_const_sptr matWs);
+  MatrixWSDataSource(const Mantid::API::MatrixWorkspace_const_sptr &matWs);
 
   ~MatrixWSDataSource() override;
 
diff --git a/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/SliderHandler.h b/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/SliderHandler.h
index 08b0dfbcba7..65c07eb21b4 100644
--- a/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/SliderHandler.h
+++ b/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/SliderHandler.h
@@ -36,7 +36,8 @@ public:
                         SpectrumDataSource_sptr dataSource) override;
 
   /// Configure the image scrollbars for the specified drawing area
-  void reConfigureSliders(QRect drawArea, SpectrumDataSource_sptr dataSource);
+  void reConfigureSliders(QRect drawArea,
+                          const SpectrumDataSource_sptr &dataSource);
 
   /// Configure the horizontal scrollbar to cover the specified range
   void configureHSlider(int nDataSteps, int nPixels) override;
diff --git a/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/SpectrumPlotItem.h b/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/SpectrumPlotItem.h
index ec79009e063..9afb272f8e8 100644
--- a/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/SpectrumPlotItem.h
+++ b/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/SpectrumPlotItem.h
@@ -37,7 +37,7 @@ public:
   ~SpectrumPlotItem() override;
 
   /// Specify the data to be plotted and the color table to use
-  void setData(DataArray_const_sptr dataArray,
+  void setData(const DataArray_const_sptr &dataArray,
                std::vector<QRgb> *positiveColorTable,
                std::vector<QRgb> *negativeColorTable);
 
diff --git a/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/SpectrumView.h b/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/SpectrumView.h
index 5dc7dc559b3..bbc286f57ce 100644
--- a/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/SpectrumView.h
+++ b/qt/widgets/spectrumviewer/inc/MantidQtWidgets/SpectrumViewer/SpectrumView.h
@@ -56,7 +56,7 @@ public:
   SpectrumView(QWidget *parent = nullptr);
 
   ~SpectrumView() override;
-  void renderWorkspace(Mantid::API::MatrixWorkspace_const_sptr wksp);
+  void renderWorkspace(const Mantid::API::MatrixWorkspace_const_sptr &wksp);
   void renderWorkspace(const QString &wsName);
   QList<boost::shared_ptr<SpectrumDisplay>> getSpectrumDisplays() const {
     return m_spectrumDisplay;
diff --git a/qt/widgets/spectrumviewer/src/ArrayDataSource.cpp b/qt/widgets/spectrumviewer/src/ArrayDataSource.cpp
index ae9c8910e86..8323d504ba7 100644
--- a/qt/widgets/spectrumviewer/src/ArrayDataSource.cpp
+++ b/qt/widgets/spectrumviewer/src/ArrayDataSource.cpp
@@ -5,6 +5,7 @@
 //   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
 // SPDX - License - Identifier: GPL - 3.0 +
 #include <cmath>
+#include <utility>
 
 #include "MantidQtWidgets/SpectrumViewer/ArrayDataSource.h"
 #include "MantidQtWidgets/SpectrumViewer/SVUtils.h"
@@ -38,7 +39,7 @@ ArrayDataSource::ArrayDataSource(double m_totalXMin, double m_totalXMax,
                                  std::vector<float> data)
     : SpectrumDataSource(m_totalXMin, m_totalXMax, m_totalYMin, m_totalYMax,
                          m_totalRows, m_totalCols),
-      m_data(data) {}
+      m_data(std::move(data)) {}
 
 ArrayDataSource::~ArrayDataSource() {}
 
diff --git a/qt/widgets/spectrumviewer/src/GraphDisplay.cpp b/qt/widgets/spectrumviewer/src/GraphDisplay.cpp
index cb9ce8bdecf..69768e395e8 100644
--- a/qt/widgets/spectrumviewer/src/GraphDisplay.cpp
+++ b/qt/widgets/spectrumviewer/src/GraphDisplay.cpp
@@ -13,6 +13,8 @@
 #include <QString>
 #include <QVector>
 #include <boost/algorithm/clamp.hpp>
+#include <utility>
+
 #include <qwt_scale_engine.h>
 
 namespace MantidQt {
@@ -56,7 +58,7 @@ GraphDisplay::~GraphDisplay() { clearCurves(); }
  *                   the table.
  */
 void GraphDisplay::setDataSource(SpectrumDataSource_sptr dataSource) {
-  m_dataSource = dataSource;
+  m_dataSource = std::move(dataSource);
 }
 
 /**
diff --git a/qt/widgets/spectrumviewer/src/MatrixWSDataSource.cpp b/qt/widgets/spectrumviewer/src/MatrixWSDataSource.cpp
index 03a4824cdc7..125f79a9b12 100644
--- a/qt/widgets/spectrumviewer/src/MatrixWSDataSource.cpp
+++ b/qt/widgets/spectrumviewer/src/MatrixWSDataSource.cpp
@@ -46,7 +46,7 @@ namespace SpectrumView {
  *
  * @param matWs  Shared pointer to the matrix workspace being "wrapped"
  */
-MatrixWSDataSource::MatrixWSDataSource(MatrixWorkspace_const_sptr matWs)
+MatrixWSDataSource::MatrixWSDataSource(const MatrixWorkspace_const_sptr &matWs)
     : SpectrumDataSource(0.0, 1.0, 0.0, 1.0, 0, 0), m_matWs(matWs),
       m_emodeHandler(nullptr), m_spectrumInfo(m_matWs->spectrumInfo()) {
   m_totalXMin = matWs->getXMin();
diff --git a/qt/widgets/spectrumviewer/src/SliderHandler.cpp b/qt/widgets/spectrumviewer/src/SliderHandler.cpp
index 8537256237f..90c5d1b58e0 100644
--- a/qt/widgets/spectrumviewer/src/SliderHandler.cpp
+++ b/qt/widgets/spectrumviewer/src/SliderHandler.cpp
@@ -27,8 +27,8 @@ SliderHandler::SliderHandler(Ui_SpectrumViewer *svUI)
  *                    be drawn
  * @param dataSource  SpectrumDataSource that provides the data to be drawn
  */
-void SliderHandler::reConfigureSliders(QRect drawArea,
-                                       SpectrumDataSource_sptr dataSource) {
+void SliderHandler::reConfigureSliders(
+    QRect drawArea, const SpectrumDataSource_sptr &dataSource) {
   QScrollBar *vScroll = m_svUI->imageVerticalScrollBar;
 
   int oldVValue = vScroll->value();
diff --git a/qt/widgets/spectrumviewer/src/SpectrumDisplay.cpp b/qt/widgets/spectrumviewer/src/SpectrumDisplay.cpp
index a0a6741ca1a..c4b581760c9 100644
--- a/qt/widgets/spectrumviewer/src/SpectrumDisplay.cpp
+++ b/qt/widgets/spectrumviewer/src/SpectrumDisplay.cpp
@@ -10,6 +10,8 @@
 #include <QImage>
 #include <QString>
 #include <QVector>
+#include <utility>
+
 #include <qwt_scale_engine.h>
 
 #include "MantidQtWidgets/SpectrumViewer/ColorMaps.h"
@@ -97,7 +99,7 @@ void SpectrumDisplay::setupSpectrumPlotItem() {
  *                    and information for the table.
  */
 void SpectrumDisplay::setDataSource(SpectrumDataSource_sptr dataSource) {
-  m_dataSource = dataSource;
+  m_dataSource = std::move(dataSource);
 
   m_hGraphDisplay->setDataSource(m_dataSource);
   m_vGraphDisplay->setDataSource(m_dataSource);
diff --git a/qt/widgets/spectrumviewer/src/SpectrumPlotItem.cpp b/qt/widgets/spectrumviewer/src/SpectrumPlotItem.cpp
index 6cfb788c680..1404950528c 100644
--- a/qt/widgets/spectrumviewer/src/SpectrumPlotItem.cpp
+++ b/qt/widgets/spectrumviewer/src/SpectrumPlotItem.cpp
@@ -35,7 +35,7 @@ SpectrumPlotItem::~SpectrumPlotItem() {}
  *                            must have the same number of entries as the
  *                            positive color table.
  */
-void SpectrumPlotItem::setData(DataArray_const_sptr dataArray,
+void SpectrumPlotItem::setData(const DataArray_const_sptr &dataArray,
                                std::vector<QRgb> *positiveColorTable,
                                std::vector<QRgb> *negativeColorTable) {
   if (m_bufferID == 0) {
diff --git a/qt/widgets/spectrumviewer/src/SpectrumView.cpp b/qt/widgets/spectrumviewer/src/SpectrumView.cpp
index 33daff0127b..c185ec69136 100644
--- a/qt/widgets/spectrumviewer/src/SpectrumView.cpp
+++ b/qt/widgets/spectrumviewer/src/SpectrumView.cpp
@@ -99,7 +99,7 @@ void SpectrumView::resizeEvent(QResizeEvent *event) {
  * @param wksp The matrix workspace to render
  */
 void SpectrumView::renderWorkspace(
-    Mantid::API::MatrixWorkspace_const_sptr wksp) {
+    const Mantid::API::MatrixWorkspace_const_sptr &wksp) {
 
   // Handle rendering of a workspace we already track
   if (replaceExistingWorkspace(wksp->getName(), wksp))
-- 
GitLab


From 0228a728efccf5e7d5b6f02b2d55e69807708318 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Fri, 20 Mar 2020 11:25:38 +0000
Subject: [PATCH 23/30] Remove unused vars from cppcheck 1.9

---
 Framework/API/test/FileFinderTest.h                 | 1 -
 Framework/API/test/FunctionPropertyTest.h           | 1 -
 Framework/Algorithms/test/FitPeakTest.h             | 2 --
 Framework/Algorithms/test/GetAllEiTest.h            | 2 +-
 Framework/Geometry/test/MDBoxImplicitFunctionTest.h | 1 -
 Framework/Kernel/test/RegexStringsTest.h            | 1 -
 Framework/Kernel/test/SimpleJSONTest.h              | 7 ++-----
 7 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/Framework/API/test/FileFinderTest.h b/Framework/API/test/FileFinderTest.h
index 2d909d37393..3c90bb3aca0 100644
--- a/Framework/API/test/FileFinderTest.h
+++ b/Framework/API/test/FileFinderTest.h
@@ -215,7 +215,6 @@ public:
   }
 
   void testGetInstrument() {
-    std::string name; // place to put results
     ConfigService::Instance().setFacility("ISIS");
     ConfigService::Instance().setString("default.instrument", "HRPD");
 
diff --git a/Framework/API/test/FunctionPropertyTest.h b/Framework/API/test/FunctionPropertyTest.h
index 3667910809d..05c0417a61a 100644
--- a/Framework/API/test/FunctionPropertyTest.h
+++ b/Framework/API/test/FunctionPropertyTest.h
@@ -87,7 +87,6 @@ public:
 
   void test_Assignment_By_SharedPtr() {
     FunctionProperty prop("fun");
-    std::string error;
     auto fun_p = FunctionFactory::Instance().createInitialized(
         createTestFunctionString());
     TS_ASSERT(fun_p);
diff --git a/Framework/Algorithms/test/FitPeakTest.h b/Framework/Algorithms/test/FitPeakTest.h
index fda649e543a..836e206fadd 100644
--- a/Framework/Algorithms/test/FitPeakTest.h
+++ b/Framework/Algorithms/test/FitPeakTest.h
@@ -358,8 +358,6 @@ public:
   /** Generate a workspace contains PG3_4866 5-th peak
    */
   MatrixWorkspace_sptr gen_PG3DiamondData() {
-    vector<double> vecx, vecy, vece;
-
     size_t NVectors = 1;
     size_t size = 53;
     MatrixWorkspace_sptr ws = boost::dynamic_pointer_cast<MatrixWorkspace>(
diff --git a/Framework/Algorithms/test/GetAllEiTest.h b/Framework/Algorithms/test/GetAllEiTest.h
index d431d7d9245..108f38febb7 100644
--- a/Framework/Algorithms/test/GetAllEiTest.h
+++ b/Framework/Algorithms/test/GetAllEiTest.h
@@ -503,7 +503,7 @@ public:
     TS_ASSERT_DELTA(zeros[2], 7.85, 1.e-3);
   }
   void test_binRanges() {
-    std::vector<size_t> bin_min, bin_max, zeros;
+    std::vector<size_t> bin_min, bin_max;
     // Index           0 1 2 3 4 5 6 7 8 9  10 11 12 13
     double debin[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15};
     std::vector<double> ebin(debin, debin + sizeof(debin) / sizeof(double));
diff --git a/Framework/Geometry/test/MDBoxImplicitFunctionTest.h b/Framework/Geometry/test/MDBoxImplicitFunctionTest.h
index df0683d05f3..6d30faa3b66 100644
--- a/Framework/Geometry/test/MDBoxImplicitFunctionTest.h
+++ b/Framework/Geometry/test/MDBoxImplicitFunctionTest.h
@@ -106,7 +106,6 @@ public:
     // The box to test.
     const coord_t boxMin = 1.1f;
     const coord_t boxMax = 1.9f;
-    std::vector<coord_t> boxVertexes;
     std::vector<Extent> extents;
     // extent
     extents.emplace_back(Extent(boxMin, boxMax));
diff --git a/Framework/Kernel/test/RegexStringsTest.h b/Framework/Kernel/test/RegexStringsTest.h
index 6eed39b23af..4f3e6c5dbdb 100644
--- a/Framework/Kernel/test/RegexStringsTest.h
+++ b/Framework/Kernel/test/RegexStringsTest.h
@@ -144,7 +144,6 @@ public:
   }
 
   void testStrFullCut() {
-    std::vector<double> dblresult;
     double sgldblResult;
     std::string input("100.01 101.02 103.04 105.06 Remainder of string");
     TS_ASSERT_EQUALS(
diff --git a/Framework/Kernel/test/SimpleJSONTest.h b/Framework/Kernel/test/SimpleJSONTest.h
index 19e730790ae..e4c1e478db2 100644
--- a/Framework/Kernel/test/SimpleJSONTest.h
+++ b/Framework/Kernel/test/SimpleJSONTest.h
@@ -51,8 +51,6 @@ public:
 
   void test_JSONArray() {
     std::string str = "json failure here";
-    std::istringstream input(str);
-    std::string res;
 
     JSONArray ja;
     TS_ASSERT_THROWS_NOTHING(ja.emplace_back(str));
@@ -64,11 +62,10 @@ public:
   }
 
   void test_JSONObjectWrongStrings() {
-    std::string str = "json failure here";
-    std::istringstream input(str);
+    std::istringstream input;
     std::string res;
 
-    str = "";
+    std::string str = "";
     JSONObject jo;
     TS_ASSERT_THROWS(initFromStream(jo, input), const JSONParseException &);
     TS_ASSERT_THROWS_NOTHING(jo["no_param"].getValue(res));
-- 
GitLab


From a200387fa97205eaddd6d599a0d51c8c4ad2aa58 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Fri, 20 Mar 2020 11:26:55 +0000
Subject: [PATCH 24/30] Update suppressions list for cppcheck 1.9

---
 Framework/Crystal/src/LoadIsawPeaks.cpp       |  4 +-
 .../DataHandling/src/LoadRaw/isisraw.cpp      | 25 +++--
 .../ICat/inc/MantidICat/ICat4/ICat4Catalog.h  |  2 +-
 Framework/ICat/src/CatalogLogin.cpp           |  2 +-
 Framework/ICat/src/ICat4/ICat4Catalog.cpp     |  2 +-
 .../LiveData/src/ISIS/DAE/isisds_command.cpp  |  8 +-
 buildconfig/CMake/CppCheckSetup.cmake         |  4 +-
 .../CMake/CppCheck_Suppressions.txt.in        | 91 ++++++++++++++++++-
 .../Indirect/IndirectBayesTab.cpp             |  2 +
 .../Indirect/IndirectDataTablePresenter.cpp   |  4 +-
 .../qtgroupboxpropertybrowser.cpp             |  7 +-
 11 files changed, 117 insertions(+), 34 deletions(-)

diff --git a/Framework/Crystal/src/LoadIsawPeaks.cpp b/Framework/Crystal/src/LoadIsawPeaks.cpp
index a5dfeb4278d..dce2c0b5ff8 100644
--- a/Framework/Crystal/src/LoadIsawPeaks.cpp
+++ b/Framework/Crystal/src/LoadIsawPeaks.cpp
@@ -68,7 +68,7 @@ int LoadIsawPeaks::confidence(Kernel::FileDescriptor &descriptor) const {
       throw std::logic_error(std::string("No Version for Peaks file"));
 
     getWord(in, false); // tag
-    std::string C_Facility = getWord(in, false);
+    getWord(in, false); // C_Facility
 
     getWord(in, false); // tag
     std::string C_Instrument = getWord(in, false);
@@ -142,7 +142,7 @@ std::string LoadIsawPeaks::readHeader(const PeaksWorkspace_sptr &outWS,
     throw std::logic_error(std::string("No Version for Peaks file"));
 
   getWord(in, false); // tag
-  std::string C_Facility = getWord(in, false);
+  getWord(in, false); // C_Facility
 
   getWord(in, false); // tag
   std::string C_Instrument = getWord(in, false);
diff --git a/Framework/DataHandling/src/LoadRaw/isisraw.cpp b/Framework/DataHandling/src/LoadRaw/isisraw.cpp
index 60ed63f04b2..4f583929f01 100644
--- a/Framework/DataHandling/src/LoadRaw/isisraw.cpp
+++ b/Framework/DataHandling/src/LoadRaw/isisraw.cpp
@@ -715,10 +715,10 @@ int ISISRAW::ioRAW(FILE *file, LOG_STRUCT *s, int len, bool from_file) {
 int ISISRAW::ioRAW(FILE *file, LOG_LINE *s, int len, bool from_file) {
   char padding[5];
   memset(padding, ' ', sizeof(padding));
-  int i, nbytes_rounded;
+  int i;
   for (i = 0; i < len; i++) {
     ioRAW(file, &(s[i].len), 1, from_file);
-    nbytes_rounded = 4 * (1 + (s[i].len - 1) / 4);
+    int nbytes_rounded = 4 * (1 + (s[i].len - 1) / 4);
     ioRAW(file, &(s[i].data), s[i].len, from_file);
     ioRAW(file, padding, nbytes_rounded - s[i].len, from_file);
   }
@@ -731,12 +731,11 @@ int ISISRAW::ioRAW(FILE *file, char *s, int len, bool from_file) {
     return 0;
   }
 
-  size_t n;
   if (from_file) {
-    n = fread(s, sizeof(char), len, file);
+    size_t n = fread(s, sizeof(char), len, file);
     return static_cast<int>(n - len);
   } else {
-    n = fwrite(s, sizeof(char), len, file);
+    fwrite(s, sizeof(char), len, file);
   }
 
   return 0;
@@ -748,12 +747,11 @@ int ISISRAW::ioRAW(FILE *file, int *s, int len, bool from_file) {
     return 0;
   }
 
-  size_t n;
   if (from_file) {
-    n = fread(s, sizeof(int), len, file);
+    size_t n = fread(s, sizeof(int), len, file);
     return static_cast<int>(n - len);
   } else {
-    n = fwrite(s, sizeof(int), len, file);
+    fwrite(s, sizeof(int), len, file);
   }
 
   return 0;
@@ -765,12 +763,11 @@ int ISISRAW::ioRAW(FILE *file, uint32_t *s, int len, bool from_file) {
     return 0;
   }
 
-  size_t n;
   if (from_file) {
-    n = fread(s, sizeof(uint32_t), len, file);
+    size_t n = fread(s, sizeof(uint32_t), len, file);
     return static_cast<int>(n - len);
   } else {
-    n = fwrite(s, sizeof(uint32_t), len, file);
+    fwrite(s, sizeof(uint32_t), len, file);
   }
   return 0;
 }
@@ -782,14 +779,13 @@ int ISISRAW::ioRAW(FILE *file, float *s, int len, bool from_file) {
     return 0;
   }
 
-  size_t n;
   if (from_file) {
-    n = fread(s, sizeof(float), len, file);
+    size_t n = fread(s, sizeof(float), len, file);
     vaxf_to_local(s, &len, &errcode);
     return static_cast<int>(n - len);
   } else {
     local_to_vaxf(s, &len, &errcode);
-    n = fwrite(s, sizeof(float), len, file);
+    fwrite(s, sizeof(float), len, file);
     vaxf_to_local(s, &len, &errcode);
   }
   return 0;
@@ -942,6 +938,7 @@ int ISISRAW::vmstime(char *timbuf, int len, time_t time_value) {
    * get time in VMS format 01-JAN-1970 00:00:00
    */
   size_t i, n;
+  // cppcheck-suppress redundantAssignment
   struct tm *tmstruct = nullptr;
 #ifdef MS_VISUAL_STUDIO
   errno_t err = localtime_s(tmstruct, &time_value);
diff --git a/Framework/ICat/inc/MantidICat/ICat4/ICat4Catalog.h b/Framework/ICat/inc/MantidICat/ICat4/ICat4Catalog.h
index 0fdc12b1215..b0e5ac59b1e 100644
--- a/Framework/ICat/inc/MantidICat/ICat4/ICat4Catalog.h
+++ b/Framework/ICat/inc/MantidICat/ICat4/ICat4Catalog.h
@@ -79,7 +79,7 @@ private:
   void saveDataFiles(std::vector<ICat4::xsd__anyType *> response,
                      API::ITableWorkspace_sptr &outputws);
   // Saves "DataSets" information to the output workspace.
-  void saveDataSets(const std::vector<ICat4::xsd__anyType *> &response,
+  void saveDataSets(std::vector<ICat4::xsd__anyType *> response,
                     API::ITableWorkspace_sptr &outputws);
   // Convert a file size to human readable file format.
   std::string bytesToString(int64_t &fileSize);
diff --git a/Framework/ICat/src/CatalogLogin.cpp b/Framework/ICat/src/CatalogLogin.cpp
index bb03ee258fe..d40247dda00 100644
--- a/Framework/ICat/src/CatalogLogin.cpp
+++ b/Framework/ICat/src/CatalogLogin.cpp
@@ -24,7 +24,7 @@ namespace {
 std::vector<std::string> namesOfFacilitiesWithICAT() {
   const auto &config = Kernel::ConfigService::Instance();
 
-  const auto facilityDoesNotHaveICAT = [&](const std::string &name) {
+  const auto facilityDoesNotHaveICAT = [&](std::string name) {
     return config.getFacility(name).catalogInfo().soapEndPoint().empty();
   };
 
diff --git a/Framework/ICat/src/ICat4/ICat4Catalog.cpp b/Framework/ICat/src/ICat4/ICat4Catalog.cpp
index babd68ba9aa..baf14af9cfe 100644
--- a/Framework/ICat/src/ICat4/ICat4Catalog.cpp
+++ b/Framework/ICat/src/ICat4/ICat4Catalog.cpp
@@ -435,7 +435,7 @@ void ICat4Catalog::getDataSets(const std::string &investigationId,
  * @param response :: A vector containing the results of the search query.
  * @param outputws :: Shared pointer to output workspace.
  */
-void ICat4Catalog::saveDataSets(const std::vector<xsd__anyType *> &response,
+void ICat4Catalog::saveDataSets(std::vector<xsd__anyType *> response,
                                 API::ITableWorkspace_sptr &outputws) {
   if (outputws->getColumnNames().empty()) {
     // Add rows headers to the output workspace.
diff --git a/Framework/LiveData/src/ISIS/DAE/isisds_command.cpp b/Framework/LiveData/src/ISIS/DAE/isisds_command.cpp
index 3ac632ce22b..0a1d994f055 100644
--- a/Framework/LiveData/src/ISIS/DAE/isisds_command.cpp
+++ b/Framework/LiveData/src/ISIS/DAE/isisds_command.cpp
@@ -86,10 +86,10 @@ typedef struct {
 /* wait until read len bytes, return <=0 on error */
 static int recv_all(SOCKET s, void *buffer, int len, int flags) {
   auto *cbuffer = reinterpret_cast<char *>(buffer);
-  int n, ntot;
+  int ntot;
   ntot = 0;
   while (len > 0) {
-    n = recv(s, cbuffer, len, flags);
+    int n = recv(s, cbuffer, len, flags);
     if (n <= 0) {
       return n; /* error */
     }
@@ -283,7 +283,7 @@ int isisds_send_command(SOCKET s, const char *command, const void *data,
 static int isisds_recv_command_helper(SOCKET s, char **command, void **data,
                                       ISISDSDataType *type, int dims_array[],
                                       int *ndims, int do_alloc) {
-  int n, len_data, size_in, i;
+  int n, len_data, i;
   isisds_command_header_t comm;
   n = recv_all(s, reinterpret_cast<char *>(&comm), sizeof(comm), 0);
   if (n != sizeof(comm)) {
@@ -308,7 +308,7 @@ static int isisds_recv_command_helper(SOCKET s, char **command, void **data,
     *data = malloc(len_data + 1);
     (reinterpret_cast<char *>(*data))[len_data] = '\0';
   } else {
-    size_in = 1;
+    int size_in = 1;
     for (i = 0; i < *ndims; i++) {
       size_in *= dims_array[i];
     }
diff --git a/buildconfig/CMake/CppCheckSetup.cmake b/buildconfig/CMake/CppCheckSetup.cmake
index b825a1086b1..cf1df331589 100644
--- a/buildconfig/CMake/CppCheckSetup.cmake
+++ b/buildconfig/CMake/CppCheckSetup.cmake
@@ -11,8 +11,10 @@ if ( CPPCHECK_EXECUTABLE )
   # setup the standard arguments
   set ( CPPCHECK_ARGS --enable=all --inline-suppr --max-configs=120
   --suppressions-list=${CMAKE_BINARY_DIR}/CppCheck_Suppressions.txt
-  --suppress=*:*${CMAKE_BINARY_DIR}/*
   --project=${CMAKE_BINARY_DIR}/compile_commands.json
+  # Force cppcheck to check when we use project-wide macros
+  -DDLLExport=
+  -DMANTID_ALGORITHMS_DLL=
   )
 
   set (_cppcheck_args "${CPPCHECK_ARGS}")
diff --git a/buildconfig/CMake/CppCheck_Suppressions.txt.in b/buildconfig/CMake/CppCheck_Suppressions.txt.in
index 9f17522e55d..ed2ac5eb001 100644
--- a/buildconfig/CMake/CppCheck_Suppressions.txt.in
+++ b/buildconfig/CMake/CppCheck_Suppressions.txt.in
@@ -1,8 +1,93 @@
 // suppress specific rule in specific files
 // NOTE this needs the full path to the file, so would need this file to be generated by cmake
 //      as different build servers have different starts to the file path
-// Example:
-// memsetClassFloat:/Users/builder/Jenkins/workspace/cppcheck-1.72/
+
+
+
+// -------- Project Wide ------------------
 
 // Hide warnings about using explicit keyword constructors as we have "too many"
-noExplicitConstructor
\ No newline at end of file
+// and automated clang-tidy breaks a couple of implicit conversions we use widely
+noExplicitConstructor
+
+// Hide warnings about shadowed members for inheritance. Typically "m_log" with Algorithm
+duplInheritedMember
+
+// We have some potentially uninitialized member vars but too many to fix at the moment
+uninitMemberVar
+
+// Cppcheck struggles with some inheritance chains, some of these might be true though
+unusedPrivateFunction
+
+// Nice to have, not need to have at the moment
+useInitializationList
+
+// A large number of copying instead of pass by ref were picked up by clang-tidy, but around 200 remain
+passedByValue
+
+// Around 100 of these exist where noConstructor is present
+noConstructor
+
+// Pre-processor Directives, such as #error, which are upstream anyway
+preprocessorErrorDirective
+
+// ---------- cppcheck 1.90 Transition -------
+// If-init not supported
+syntaxError:${CMAKE_SOURCE_DIR}/Framework/API/src/MatrixWorkspace.cpp
+
+// ---------- Individual suppressions -----------------
+
+// Mantid Plot specific ones we probably won't fix before removal
+cstyleCase:*${CMAKE_SOURCE_DIR}/MantidPlot
+*:${CMAKE_SOURCE_DIR}/MantidPlot/src/origin/tree.hh
+*:${CMAKE_SOURCE_DIR}/MantidPlot/src/nrutil.cpp
+
+// Macro expansion means this is incorrectly flagged on Unix
+redundantAssignment:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadRaw/isisraw.cpp
+
+// Ones below was beyond the Cppcheck 1.90 migration scope
+pureVirtualCall:${CMAKE_SOURCE_DIR}/qt/scientific_interfaces/Indirect/IndirectBayesTab.cpp
+
+// Ref binding means Cppcheck can't see these are used
+unreadVariable:${CMAKE_SOURCE_DIR}/Framework/Algorithms/src/MaskBinsIf.cpp
+
+// --------- Missing copy assignment / constructors -------------------
+// We don't want more creeping in so just mark these one by one
+
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/API/inc/MantidAPI/BoxController.h
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/API/inc/MantidAPI/ExperimentInfo.h
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/API/inc/MantidAPI/IFunction.h
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/API/inc/MantidAPI/MDGeometry.h
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/API/inc/MantidAPI/MultipleExperimentInfos.h
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/API/inc/MantidAPI/SingleValueParameter.h
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/API/inc/MantidAPI/VectorParameter.h
+
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/Catalog/inc/MantidCatalog/ONCat.h
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/Catalog/inc/MantidCatalog/ONCatEntity.h
+
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/Crystal/inc/MantidCrystal/IntegratePeakTimeSlices.h
+
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/QwtWorkspaceBinData.h
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/QwtWorkspaceSpectrumData.h
+
+noCopyConstructor:${CMAKE_SOURCE_DIR}/Framework/DataHandling/inc/MantidDataHandling/BankPulseTimes.h
+noCopyConstructor:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadRaw/isisraw.h
+
+// ----------------- Upstream libs ---------------
+
+// Always ignore bin dir
+*:*${CMAKE_BINARY_DIR}/*
+
+// For some reason upstream libs sometimes end up in the check results
+*:*/usr/include/*
+
+// All ANN files as they are upstream anyway
+*:*${CMAKE_SOURCE_DIR}/Framework/Kernel/src/ANN/*
+
+// Libs we have in-source
+*:*${CMAKE_SOURCE_DIR}/Framework/DataObjects/inc/MantidDataObjects/MortonIndex/*
+*:*${CMAKE_SOURCE_DIR}/Framework/ICat/src/GSoap/*
+*:*${CMAKE_SOURCE_DIR}/ICat/src/ICat3/GSoapGenerated/*
+*:*${CMAKE_SOURCE_DIR}/ICat/src/ICat4/GSoapGenerated/*
+*:*${CMAKE_SOURCE_DIR}/MantidPlot/src/zlib123/*
diff --git a/qt/scientific_interfaces/Indirect/IndirectBayesTab.cpp b/qt/scientific_interfaces/Indirect/IndirectBayesTab.cpp
index 050001f810f..07d99f46148 100644
--- a/qt/scientific_interfaces/Indirect/IndirectBayesTab.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectBayesTab.cpp
@@ -13,7 +13,9 @@ IndirectBayesTab::IndirectBayesTab(QWidget *parent)
     : IndirectTab(parent), m_propTree(new QtTreePropertyBrowser()) {
   m_propTree->setFactoryForManager(m_dblManager, m_dblEdFac);
 
+  // cppcheck-suppress pureVirtualCall
   connect(m_dblManager, SIGNAL(valueChanged(QtProperty *, double)), this,
+          // cppcheck-suppress pureVirtualCall
           SLOT(updateProperties(QtProperty *, double)));
 }
 
diff --git a/qt/scientific_interfaces/Indirect/IndirectDataTablePresenter.cpp b/qt/scientific_interfaces/Indirect/IndirectDataTablePresenter.cpp
index eafa0818ac2..3039804bcef 100644
--- a/qt/scientific_interfaces/Indirect/IndirectDataTablePresenter.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectDataTablePresenter.cpp
@@ -216,11 +216,11 @@ IndirectDataTablePresenter::getSpectra(TableRowIndex start,
   while (start < end) {
     WorkspaceIndex minimum = getWorkspaceIndex(start);
     WorkspaceIndex maximum = minimum;
-    start++;
+    ++start;
     while (start < end &&
            getWorkspaceIndex(start) == maximum + WorkspaceIndex{1}) {
       ++maximum;
-      start++;
+      ++start;
     }
     spectraPairs.emplace_back(minimum, maximum);
   }
diff --git a/qt/widgets/common/src/QtPropertyBrowser/qtgroupboxpropertybrowser.cpp b/qt/widgets/common/src/QtPropertyBrowser/qtgroupboxpropertybrowser.cpp
index bf89eb4fde6..5d38e2237fa 100644
--- a/qt/widgets/common/src/QtPropertyBrowser/qtgroupboxpropertybrowser.cpp
+++ b/qt/widgets/common/src/QtPropertyBrowser/qtgroupboxpropertybrowser.cpp
@@ -308,15 +308,12 @@ void QtGroupBoxPropertyBrowserPrivate::propertyRemoved(QtBrowserItem *index) {
   } else {
     WidgetItem *par = parentItem->parent;
     QGridLayout *l = nullptr;
-    int oldRow = -1;
     if (!par) {
       l = m_mainLayout;
-      oldRow = m_children.indexOf(parentItem);
+      m_children.indexOf(parentItem);
     } else {
       l = par->layout;
-      oldRow = par->children.indexOf(parentItem);
-      if (hasHeader(par))
-        oldRow += 2;
+      par->children.indexOf(parentItem);
     }
 
     if (parentItem->widget) {
-- 
GitLab


From 39a6998dbac046f553b7b641aaeb6e242dd0f876 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Fri, 20 Mar 2020 17:48:22 +0000
Subject: [PATCH 25/30] Fix Cppcheck warnings for 1.90

---
 Framework/API/src/Expression.cpp              |   4 +-
 Framework/API/src/IFunction.cpp               |   4 +-
 Framework/API/src/IndexProperty.cpp           |   1 -
 Framework/API/src/MatrixWorkspace.cpp         |   3 -
 Framework/API/src/ParamFunction.cpp           |   2 +-
 Framework/API/test/AlgorithmFactoryTest.h     |   2 +-
 Framework/API/test/FunctionPropertyTest.h     |   1 -
 Framework/API/test/LogManagerTest.h           |  10 +-
 Framework/API/test/MultiDomainFunctionTest.h  |   1 -
 Framework/API/test/RunTest.h                  |   4 +-
 Framework/Algorithms/src/ConjoinXRuns.cpp     |   2 +-
 Framework/Algorithms/src/CorrectKiKf.cpp      |   3 +-
 .../src/CreateGroupingWorkspace.cpp           |   1 -
 .../Algorithms/src/DiffractionFocussing2.cpp  |   5 +-
 Framework/Algorithms/src/FitPeaks.cpp         |  13 +-
 .../Algorithms/src/GenerateEventsFilter.cpp   | 220 +++++++++---------
 .../src/GetDetOffsetsMultiPeaks.cpp           |   7 +-
 Framework/Algorithms/src/PDCalibration.cpp    |   3 +-
 .../src/PolarizationCorrectionWildes.cpp      |  16 --
 .../Algorithms/test/AnyShapeAbsorptionTest.h  |   1 -
 .../Algorithms/test/ApplyCalibrationTest.h    |   3 -
 .../test/CalculateFlatBackgroundTest.h        |   1 +
 .../test/CalculateTransmissionTest.h          |   6 +-
 Framework/Algorithms/test/CreateEPPTest.h     |   2 +-
 .../test/DetectorEfficiencyCorTest.h          |   1 -
 Framework/Algorithms/test/FFTSmooth2Test.h    |   4 +-
 .../test/FindCenterOfMassPosition2Test.h      |   2 +-
 Framework/Algorithms/test/FitPeaksTest.h      |   1 -
 Framework/Algorithms/test/LineProfileTest.h   |   4 +-
 Framework/Algorithms/test/MergeRunsTest.h     |   1 +
 .../test/MonteCarloAbsorptionTest.h           |   1 -
 .../Algorithms/test/MultiplyDivideTest.in.h   |   5 +
 .../Algorithms/test/NormaliseByDetectorTest.h |   3 +-
 .../Algorithms/test/NormaliseToMonitorTest.h  |   6 +-
 Framework/Algorithms/test/PlusMinusTest.in.h  |  16 +-
 .../test/ReflectometryMomentumTransferTest.h  |   3 +-
 Framework/Algorithms/test/ResampleXTest.h     |   8 +-
 Framework/Algorithms/test/RingProfileTest.h   |   8 -
 Framework/Algorithms/test/SassenaFFTTest.h    |   9 +-
 .../test/SofQWNormalisedPolygonTest.h         |   1 +
 Framework/Algorithms/test/SolidAngleTest.h    |   2 +-
 .../Algorithms/test/SumOverlappingTubesTest.h |  10 +-
 Framework/Algorithms/test/SumSpectraTest.h    |   1 -
 .../Crystal/inc/MantidCrystal/IndexSXPeaks.h  |   4 +-
 Framework/Crystal/test/PeaksInRegionTest.h    |  43 ++--
 Framework/Crystal/test/SaveIsawUBTest.h       |  11 +-
 .../MantidCurveFitting/Algorithms/LeBailFit.h |  36 +--
 .../src/CostFunctions/CostFuncFitting.cpp     |   3 +-
 .../CurveFitting/src/MultiDomainCreator.cpp   |   6 +-
 .../CurveFitting/test/Algorithms/FitTest.h    |   1 -
 .../test/Algorithms/LeBailFitTest.h           |  10 +-
 .../test/Algorithms/LeBailFunctionTest.h      |   5 +-
 .../test/Algorithms/PlotPeakByLogValueTest.h  |   2 -
 .../RefinePowderInstrumentParametersTest.h    |   4 +-
 Framework/CurveFitting/test/FitMWTest.h       |   2 -
 .../test/Functions/ComptonPeakProfileTest.h   |   4 +-
 .../test/Functions/ComptonProfileTest.h       |   2 +-
 .../test/Functions/ConvolutionTest.h          |   3 +-
 .../Functions/GaussianComptonProfileTest.h    |   3 +-
 .../GramCharlierComptonProfileTest.h          |   2 +-
 .../MultivariateGaussianComptonProfileTest.h  |   6 +-
 .../test/Functions/ProductFunctionTest.h      |   3 +-
 .../src/FilterEventsByLogValuePreNexus.cpp    |  31 +--
 .../DataHandling/src/GroupDetectors2.cpp      |   3 -
 Framework/DataHandling/src/LoadEMU.cpp        |   2 +-
 .../DataHandling/src/LoadEventPreNexus2.cpp   |   6 +-
 .../src/LoadGSASInstrumentFile.cpp            |   4 +-
 Framework/DataHandling/src/LoadNXSPE.cpp      |   9 +-
 .../DataHandling/src/LoadSpiceXML2DDet.cpp    |   4 +-
 .../DataHandling/src/ProcessBankData.cpp      |   4 +-
 Framework/DataHandling/src/ReadMaterial.cpp   |   2 -
 Framework/DataHandling/src/SaveDiffCal.cpp    |   1 +
 Framework/DataHandling/src/SaveDspacemap.cpp  |   2 +-
 .../src/SaveGSASInstrumentFile.cpp            |  68 +++---
 .../test/CheckMantidVersionTest.h             |   3 +-
 .../test/CreateSimulationWorkspaceTest.h      |   4 -
 .../test/DownloadInstrumentTest.h             |   3 -
 .../DataHandling/test/GroupDetectors2Test.h   |  18 +-
 .../DataHandling/test/GroupDetectorsTest.h    |   2 +-
 .../test/InstrumentRayTracerTest.h            |   2 +-
 .../DataHandling/test/LoadDspacemapTest.h     |   2 -
 .../test/LoadILLReflectometryTest.h           |   2 +
 .../DataHandling/test/LoadMappingTableTest.h  |   2 +-
 .../DataHandling/test/LoadNexusLogsTest.h     |   1 -
 Framework/DataHandling/test/LoadRaw3Test.h    |  16 +-
 Framework/DataHandling/test/LoadRawBin0Test.h |   4 +-
 .../test/LoadRawSaveNxsLoadNxsTest.h          |   1 -
 .../DataHandling/test/LoadRawSpectrum0Test.h  |   4 +-
 .../DataHandling/test/MaskDetectorsTest.h     |   4 +-
 Framework/DataHandling/test/SaveAscii2Test.h  |   6 +-
 .../test/SaveBankScatteringAnglesTest.h       |   2 +-
 Framework/DataHandling/test/SaveCalFileTest.h |   3 -
 .../test/SaveGSASInstrumentFileTest.h         |   1 -
 Framework/DataHandling/test/SavePDFGuiTest.h  |   3 -
 .../test/UpdateInstrumentFromFileTest.h       |   1 -
 .../test/AffineMatrixParameterTest.h          |   1 -
 .../DataObjects/test/PeaksWorkspaceTest.h     |   3 -
 .../DataObjects/test/WeightedEventTest.h      |   1 +
 .../src/Instrument/ObjCompAssembly.cpp        |   6 +-
 .../src/Instrument/XMLInstrumentParameter.cpp |   2 +-
 Framework/Geometry/src/Objects/CSGObject.cpp  |   1 +
 .../test/CountStandardDeviationsTest.h        |   4 -
 .../HistogramData/test/CountVariancesTest.h   |   4 -
 Framework/HistogramData/test/CountsTest.h     |   3 -
 .../HistogramData/test/FrequenciesTest.h      |   3 -
 .../test/FrequencyVariancesTest.h             |   4 -
 .../test/StandardDeviationVectorOfTest.h      |   2 -
 .../HistogramData/test/VarianceVectorOfTest.h |   2 -
 Framework/HistogramData/test/VectorOfTest.h   |   4 -
 Framework/ICat/test/CatalogSearchTest.h       |  16 --
 Framework/Kernel/test/CowPtrTest.h            |   1 +
 Framework/Kernel/test/LogParserTest.h         |  38 +--
 .../CMake/CppCheck_Suppressions.txt.in        |  51 ++--
 .../Indirect/IndirectBayesTab.cpp             |   1 -
 qt/widgets/common/src/FunctionTreeView.cpp    |   6 +-
 .../Plotting/Qwt/ScaleEngine.h                |   4 +-
 .../ConvertTableToMatrixWorkspaceDialog.cpp   |   4 +-
 117 files changed, 398 insertions(+), 534 deletions(-)

diff --git a/Framework/API/src/Expression.cpp b/Framework/API/src/Expression.cpp
index 67df10cc2af..5308ca5283b 100644
--- a/Framework/API/src/Expression.cpp
+++ b/Framework/API/src/Expression.cpp
@@ -117,8 +117,8 @@ Expression &Expression::operator=(const Expression &expr) {
   m_funct = expr.m_funct;
   m_op = expr.m_op;
   m_terms = expr.m_terms;
-  // m_expr = expr.m_expr;
-  // m_tokens = expr.m_tokens;
+  m_expr = expr.m_expr;
+  m_tokens = expr.m_tokens;
   return *this;
 }
 
diff --git a/Framework/API/src/IFunction.cpp b/Framework/API/src/IFunction.cpp
index 43c5e4b1e69..3e8ca78315a 100644
--- a/Framework/API/src/IFunction.cpp
+++ b/Framework/API/src/IFunction.cpp
@@ -559,10 +559,11 @@ std::vector<std::string> IFunction::getParameterNames() const {
  * @param handler :: A new handler
  */
 void IFunction::setHandler(std::unique_ptr<FunctionHandler> handler) {
-  m_handler = std::move(handler);
   if (handler && handler->function().get() != this) {
     throw std::runtime_error("Function handler points to a different function");
   }
+
+  m_handler = std::move(handler);
   m_handler->init();
 }
 
@@ -661,6 +662,7 @@ private:
 /// @param attr :: The attribute to copy from.
 IFunction::Attribute &IFunction::Attribute::operator=(const Attribute &attr) {
   m_data = attr.m_data;
+  m_quoteValue = attr.m_quoteValue;
   return *this;
 }
 
diff --git a/Framework/API/src/IndexProperty.cpp b/Framework/API/src/IndexProperty.cpp
index e1b5e3b5499..9ea0c194546 100644
--- a/Framework/API/src/IndexProperty.cpp
+++ b/Framework/API/src/IndexProperty.cpp
@@ -78,7 +78,6 @@ Indexing::SpectrumIndexSet IndexProperty::getIndices() const {
             static_cast<Indexing::SpectrumNumber>(static_cast<int32_t>(max)));
       }
     } else {
-      // cppcheck-suppress constArgument
       MSVC_DIAG_OFF(4244);
       switch (type) {
       case IndexType::WorkspaceIndex:
diff --git a/Framework/API/src/MatrixWorkspace.cpp b/Framework/API/src/MatrixWorkspace.cpp
index 479adf454d0..931023650ac 100644
--- a/Framework/API/src/MatrixWorkspace.cpp
+++ b/Framework/API/src/MatrixWorkspace.cpp
@@ -1940,8 +1940,6 @@ MatrixWorkspace::findY(double value,
   if (std::isnan(value)) {
     for (int64_t i = idx.first; i < numHists; ++i) {
       const auto &Y = this->y(i);
-      // https://trac.cppcheck.net/ticket/9237 if init buggy with cppcheck
-      // cppcheck-suppress stlIfFind
       if (auto it = std::find_if(std::next(Y.begin(), idx.second), Y.end(),
                                  [](double v) { return std::isnan(v); });
           it != Y.end()) {
@@ -1952,7 +1950,6 @@ MatrixWorkspace::findY(double value,
   } else {
     for (int64_t i = idx.first; i < numHists; ++i) {
       const auto &Y = this->y(i);
-      // cppcheck-suppress stlIfFind
       if (auto it = std::find(std::next(Y.begin(), idx.second), Y.end(), value);
           it != Y.end()) {
         out = {i, std::distance(Y.begin(), it)};
diff --git a/Framework/API/src/ParamFunction.cpp b/Framework/API/src/ParamFunction.cpp
index b59894b305c..66b2b282eda 100644
--- a/Framework/API/src/ParamFunction.cpp
+++ b/Framework/API/src/ParamFunction.cpp
@@ -150,7 +150,7 @@ double ParamFunction::getParameter(const std::string &name) const {
  */
 bool ParamFunction::hasParameter(const std::string &name) const {
   return std::find(m_parameterNames.cbegin(), m_parameterNames.cend(), name) !=
-         m_parameterNames.end();
+         m_parameterNames.cend();
 }
 
 /**
diff --git a/Framework/API/test/AlgorithmFactoryTest.h b/Framework/API/test/AlgorithmFactoryTest.h
index cb2bfc1dd64..4dea1a5f303 100644
--- a/Framework/API/test/AlgorithmFactoryTest.h
+++ b/Framework/API/test/AlgorithmFactoryTest.h
@@ -186,7 +186,7 @@ public:
       foundAlg = ("Cat" == descItr->category) &&
                  ("ToyAlgorithm" == descItr->name) &&
                  ("Dog" == descItr->alias) && (1 == descItr->version);
-      descItr++;
+      ++descItr;
     }
     TS_ASSERT(foundAlg);
 
diff --git a/Framework/API/test/FunctionPropertyTest.h b/Framework/API/test/FunctionPropertyTest.h
index 05c0417a61a..92b15eb6192 100644
--- a/Framework/API/test/FunctionPropertyTest.h
+++ b/Framework/API/test/FunctionPropertyTest.h
@@ -104,7 +104,6 @@ public:
 
   void test_Shared_Pointer() {
     FunctionProperty prop("fun");
-    std::string error;
     boost::shared_ptr<FunctionPropertyTest_Function> fun_p(
         new FunctionPropertyTest_Function);
     TS_ASSERT(fun_p);
diff --git a/Framework/API/test/LogManagerTest.h b/Framework/API/test/LogManagerTest.h
index fbcb69b8112..c047bd8e1e0 100644
--- a/Framework/API/test/LogManagerTest.h
+++ b/Framework/API/test/LogManagerTest.h
@@ -555,8 +555,7 @@ private:
     LogManager runInfo;
     const std::string name = "T_prop";
     runInfo.addProperty<T>(name, value);
-    int result(-1);
-    result = runInfo.getPropertyAsIntegerValue(name);
+    int result = runInfo.getPropertyAsIntegerValue(name);
     TS_ASSERT_THROWS_NOTHING(result = runInfo.getPropertyAsIntegerValue(name));
     TS_ASSERT_EQUALS(value, static_cast<T>(result));
   }
@@ -580,12 +579,11 @@ public:
   }
 
   void test_Accessing_Single_Value_From_Times_Series_A_Large_Number_Of_Times() {
-    double value(0.0);
     for (size_t i = 0; i < 20000; ++i) {
-      value = m_testRun.getPropertyAsSingleValue(m_propName);
+      // This has an observable side-effect of calling, so we don't need
+      // to store its return value
+      m_testRun.getPropertyAsSingleValue(m_propName);
     }
-    // Enure variable is used so that it is not optimised away by the compiler
-    value += 1.0;
   }
 
   LogManager m_testRun;
diff --git a/Framework/API/test/MultiDomainFunctionTest.h b/Framework/API/test/MultiDomainFunctionTest.h
index 141e3ce8591..31f604a5c32 100644
--- a/Framework/API/test/MultiDomainFunctionTest.h
+++ b/Framework/API/test/MultiDomainFunctionTest.h
@@ -324,7 +324,6 @@ public:
   void test_attribute_domain_range() {
     multi.clearDomainIndices();
     multi.setLocalAttributeValue(0, "domains", "0-2");
-    return;
     multi.setLocalAttributeValue(1, "domains", "i");
     multi.setLocalAttributeValue(2, "domains", "i");
 
diff --git a/Framework/API/test/RunTest.h b/Framework/API/test/RunTest.h
index 288ee1643e1..caaf5d0a9db 100644
--- a/Framework/API/test/RunTest.h
+++ b/Framework/API/test/RunTest.h
@@ -632,10 +632,8 @@ public:
   void test_Accessing_Single_Value_From_Times_Series_A_Large_Number_Of_Times() {
     double value(0.0);
     for (size_t i = 0; i < 20000; ++i) {
-      value = m_testRun.getPropertyAsSingleValue(m_propName);
+      m_testRun.getPropertyAsSingleValue(m_propName);
     }
-    // Enure variable is used so that it is not optimised away by the compiler
-    value += 1.0;
   }
 
   Run m_testRun;
diff --git a/Framework/Algorithms/src/ConjoinXRuns.cpp b/Framework/Algorithms/src/ConjoinXRuns.cpp
index 0378cc11101..aa1ef641612 100644
--- a/Framework/Algorithms/src/ConjoinXRuns.cpp
+++ b/Framework/Algorithms/src/ConjoinXRuns.cpp
@@ -404,7 +404,7 @@ void ConjoinXRuns::exec() {
                       << ". Reason: \"" << e.what() << "\". Skipping.\n";
         sampleLogsBehaviour.resetSampleLogs(temp);
         // remove the skipped one from the list
-        m_inputWS.erase(it);
+        it = m_inputWS.erase(it);
         --it;
       } else {
         throw std::invalid_argument(e);
diff --git a/Framework/Algorithms/src/CorrectKiKf.cpp b/Framework/Algorithms/src/CorrectKiKf.cpp
index 492a047143a..c4b97099dc2 100644
--- a/Framework/Algorithms/src/CorrectKiKf.cpp
+++ b/Framework/Algorithms/src/CorrectKiKf.cpp
@@ -220,11 +220,10 @@ void CorrectKiKf::execEvent() {
   PARALLEL_FOR_IF(Kernel::threadSafe(*outputWS))
   for (int64_t i = 0; i < numHistograms; ++i) {
     PARALLEL_START_INTERUPT_REGION
-
-    double Efi = 0;
     // Now get the detector object for this histogram to check if monitor
     // or to get Ef for indirect geometry
     if (emodeStr == "Indirect") {
+      double Efi = 0;
       if (efixedProp != EMPTY_DBL()) {
         Efi = efixedProp;
         // If a DetectorGroup is present should provide a value as a property
diff --git a/Framework/Algorithms/src/CreateGroupingWorkspace.cpp b/Framework/Algorithms/src/CreateGroupingWorkspace.cpp
index 63eea8809ca..14db984fea7 100644
--- a/Framework/Algorithms/src/CreateGroupingWorkspace.cpp
+++ b/Framework/Algorithms/src/CreateGroupingWorkspace.cpp
@@ -432,7 +432,6 @@ void CreateGroupingWorkspace::exec() {
       sortnames = true;
       GroupNames = "";
       int maxRecurseDepth = this->getProperty("MaxRecursionDepth");
-
       // cppcheck-suppress syntaxError
           PRAGMA_OMP(parallel for schedule(dynamic, 1) )
           for (int num = 0; num < 300; ++num) {
diff --git a/Framework/Algorithms/src/DiffractionFocussing2.cpp b/Framework/Algorithms/src/DiffractionFocussing2.cpp
index 8c204e9af13..9444e68fa4a 100644
--- a/Framework/Algorithms/src/DiffractionFocussing2.cpp
+++ b/Framework/Algorithms/src/DiffractionFocussing2.cpp
@@ -590,11 +590,10 @@ void DiffractionFocussing2::determineRebinParameters() {
 
   nGroups = group2minmax.size(); // Number of unique groups
 
-  double Xmin, Xmax, step;
   const int64_t xPoints = nPoints + 1;
-
   // Iterator over all groups to create the new X vectors
-  for (gpit = group2minmax.begin(); gpit != group2minmax.end(); gpit++) {
+  for (gpit = group2minmax.begin(); gpit != group2minmax.end(); ++gpit) {
+    double Xmin, Xmax, step;
     Xmin = (gpit->second).first;
     Xmax = (gpit->second).second;
 
diff --git a/Framework/Algorithms/src/FitPeaks.cpp b/Framework/Algorithms/src/FitPeaks.cpp
index c1d1fce0154..17a439ef3d1 100644
--- a/Framework/Algorithms/src/FitPeaks.cpp
+++ b/Framework/Algorithms/src/FitPeaks.cpp
@@ -1771,7 +1771,6 @@ double FitPeaks::fitFunctionSD(
     errorid << ": " << e.what();
     g_log.warning() << "While fitting " + errorid.str();
     return DBL_MAX; // probably the wrong thing to do
-    throw std::runtime_error("While fitting " + errorid.str());
   }
 
   // Retrieve result
@@ -1847,7 +1846,6 @@ double FitPeaks::fitFunctionMD(API::IFunction_sptr fit_function,
   double chi2 = DBL_MAX;
   if (fitStatus == "success") {
     chi2 = fit->getProperty("OutputChi2overDoF");
-    fit_function = fit->getProperty("Function");
   }
 
   return chi2;
@@ -1883,9 +1881,8 @@ double FitPeaks::fitFunctionHighBackground(
       createMatrixWorkspace(vec_x, vec_y, vec_e);
 
   // Fit peak with background
-  double cost = fitFunctionSD(fit, peakfunction, bkgdfunc, reduced_bkgd_ws, 0,
-                              vec_x.front(), vec_x.back(), expected_peak_center,
-                              observe_peak_shape, false);
+  fitFunctionSD(fit, peakfunction, bkgdfunc, reduced_bkgd_ws, 0, vec_x.front(),
+                vec_x.back(), expected_peak_center, observe_peak_shape, false);
 
   // add the reduced background back
   bkgdfunc->setParameter(0, bkgdfunc->getParameter(0) +
@@ -1893,9 +1890,9 @@ double FitPeaks::fitFunctionHighBackground(
   bkgdfunc->setParameter(1, bkgdfunc->getParameter(1) +
                                 high_bkgd_function->getParameter(1));
 
-  cost = fitFunctionSD(fit, peakfunction, bkgdfunc, m_inputMatrixWS, ws_index,
-                       vec_x.front(), vec_x.back(), expected_peak_center, false,
-                       false);
+  double cost = fitFunctionSD(fit, peakfunction, bkgdfunc, m_inputMatrixWS,
+                              ws_index, vec_x.front(), vec_x.back(),
+                              expected_peak_center, false, false);
 
   return cost;
 }
diff --git a/Framework/Algorithms/src/GenerateEventsFilter.cpp b/Framework/Algorithms/src/GenerateEventsFilter.cpp
index d0be0289a76..2e0de3025f2 100644
--- a/Framework/Algorithms/src/GenerateEventsFilter.cpp
+++ b/Framework/Algorithms/src/GenerateEventsFilter.cpp
@@ -456,10 +456,9 @@ void GenerateEventsFilter::setFilterByTimeOnly() {
     int64_t curtime_ns = m_startTime.totalNanoseconds();
     int wsindex = 0;
     while (curtime_ns < m_stopTime.totalNanoseconds()) {
-      int64_t deltatime_ns;
       for (size_t id = 0; id < numtimeintervals; ++id) {
         // get next time interval value
-        deltatime_ns = vec_dtimens[id];
+        int64_t deltatime_ns = vec_dtimens[id];
         // Calculate next.time
         int64_t nexttime_ns = curtime_ns + deltatime_ns;
         bool breaklater = false;
@@ -831,7 +830,6 @@ void GenerateEventsFilter::makeFilterBySingleValue(
 
   // Initialize control parameters
   bool lastGood = false;
-  bool isGood = false;
   time_duration tol = DateAndTime::durationFromSeconds(TimeTolerance);
   int numgood = 0;
   DateAndTime lastTime, currT;
@@ -844,8 +842,8 @@ void GenerateEventsFilter::makeFilterBySingleValue(
     currT = m_dblLog->nthTime(i);
 
     // A good value?
-    isGood = identifyLogEntry(i, currT, lastGood, min, max, startTime, stopTime,
-                              filterIncrease, filterDecrease);
+    bool isGood = identifyLogEntry(i, currT, lastGood, min, max, startTime,
+                                   stopTime, filterIncrease, filterDecrease);
     if (isGood)
       numgood++;
 
@@ -1219,7 +1217,6 @@ void GenerateEventsFilter::makeMultipleFiltersByValuesPartialLog(
     double currValue = m_dblLog->nthValue(i);
 
     // Filter out by time and direction (optional)
-    bool intime = true;
     if (currTime < startTime) {
       // case i.  Too early, do nothing
       createsplitter = false;
@@ -1254,130 +1251,127 @@ void GenerateEventsFilter::makeMultipleFiltersByValuesPartialLog(
     prevDirection = direction;
 
     // Examine log value for filter
-    if (intime) {
-      // Determine whether direction is fine
-      bool correctdir = true;
-      if (filterIncrease && filterDecrease) {
-        // Both direction is fine
+    // Determine whether direction is fine
+    bool correctdir = true;
+    if (filterIncrease && filterDecrease) {
+      // Both direction is fine
+      correctdir = true;
+    } else {
+      // Filter out one direction
+      if (filterIncrease && direction > 0)
         correctdir = true;
-      } else {
-        // Filter out one direction
-        if (filterIncrease && direction > 0)
-          correctdir = true;
-        else if (filterDecrease && direction < 0)
-          correctdir = true;
-        else if (direction == 0)
-          throw runtime_error("Direction is not determined.");
-        else
-          correctdir = false;
-      } // END-IF-ELSE: Direction
-
-      // Treat the log entry based on: changing direction (+ time range)
-      if (correctdir) {
-        // Check this value whether it falls into any range
-        size_t index = searchValue(logvalueranges, currValue);
-
-        bool valueWithinMinMax = true;
-        if (index > logvalueranges.size()) {
-          // Out of range
-          valueWithinMinMax = false;
-        }
+      else if (filterDecrease && direction < 0)
+        correctdir = true;
+      else if (direction == 0)
+        throw runtime_error("Direction is not determined.");
+      else
+        correctdir = false;
+    } // END-IF-ELSE: Direction
+
+    // Treat the log entry based on: changing direction (+ time range)
+    if (correctdir) {
+      // Check this value whether it falls into any range
+      size_t index = searchValue(logvalueranges, currValue);
+
+      bool valueWithinMinMax = true;
+      if (index > logvalueranges.size()) {
+        // Out of range
+        valueWithinMinMax = false;
+      }
 
-        if (g_log.is(Logger::Priority::PRIO_DEBUG)) {
-          stringstream dbss;
-          dbss << "[DBx257] Examine Log Index " << i
-               << ", Value = " << currValue << ", Data Range Index = " << index
-               << "; "
-               << "Group Index = " << indexwsindexmap[index / 2]
-               << " (log value range vector size = " << logvalueranges.size()
-               << "): ";
-          if (index == 0)
-            dbss << logvalueranges[index] << ", " << logvalueranges[index + 1];
-          else if (index == logvalueranges.size())
-            dbss << logvalueranges[index - 1] << ", " << logvalueranges[index];
-          else if (valueWithinMinMax)
-            dbss << logvalueranges[index - 1] << ", " << logvalueranges[index]
-                 << ", " << logvalueranges[index + 1];
-          g_log.debug(dbss.str());
-        }
+      if (g_log.is(Logger::Priority::PRIO_DEBUG)) {
+        stringstream dbss;
+        dbss << "[DBx257] Examine Log Index " << i << ", Value = " << currValue
+             << ", Data Range Index = " << index << "; "
+             << "Group Index = " << indexwsindexmap[index / 2]
+             << " (log value range vector size = " << logvalueranges.size()
+             << "): ";
+        if (index == 0)
+          dbss << logvalueranges[index] << ", " << logvalueranges[index + 1];
+        else if (index == logvalueranges.size())
+          dbss << logvalueranges[index - 1] << ", " << logvalueranges[index];
+        else if (valueWithinMinMax)
+          dbss << logvalueranges[index - 1] << ", " << logvalueranges[index]
+               << ", " << logvalueranges[index + 1];
+        g_log.debug(dbss.str());
+      }
 
-        if (valueWithinMinMax) {
-          if (index % 2 == 0) {
-            // [Situation] Falls in the interval
-            currindex = indexwsindexmap[index / 2];
-
-            if (currindex != lastindex && start.totalNanoseconds() == 0) {
-              // Group index is different from last and start is not set up: new
-              // a region!
-              newsplitter = true;
-            } else if (currindex != lastindex && start.totalNanoseconds() > 0) {
-              // Group index is different from last and start is set up:  close
-              // a region and new a region
+      if (valueWithinMinMax) {
+        if (index % 2 == 0) {
+          // [Situation] Falls in the interval
+          currindex = indexwsindexmap[index / 2];
+
+          if (currindex != lastindex && start.totalNanoseconds() == 0) {
+            // Group index is different from last and start is not set up: new
+            // a region!
+            newsplitter = true;
+          } else if (currindex != lastindex && start.totalNanoseconds() > 0) {
+            // Group index is different from last and start is set up:  close
+            // a region and new a region
+            stop = currTime;
+            createsplitter = true;
+            newsplitter = true;
+          } else if (currindex == lastindex && start.totalNanoseconds() > 0) {
+            // Still of the group index
+            if (i == iend) {
+              // Last entry in this section of log.  Need to flag to close the
+              // pair
               stop = currTime;
               createsplitter = true;
-              newsplitter = true;
-            } else if (currindex == lastindex && start.totalNanoseconds() > 0) {
-              // Still of the group index
-              if (i == iend) {
-                // Last entry in this section of log.  Need to flag to close the
-                // pair
-                stop = currTime;
-                createsplitter = true;
-                newsplitter = false;
-              } else {
-                // Do nothing
-                ;
-              }
+              newsplitter = false;
             } else {
-              // An impossible situation
-              std::stringstream errmsg;
-              double lastvalue = m_dblLog->nthValue(i - 1);
-              errmsg << "Impossible to have currindex == lastindex == "
-                     << currindex
-                     << ", while start is not init.  Log Index = " << i
-                     << "\t value = " << currValue << "\t, Index = " << index
-                     << " in range " << logvalueranges[index] << ", "
-                     << logvalueranges[index + 1]
-                     << "; Last value = " << lastvalue;
-              throw std::runtime_error(errmsg.str());
+              // Do nothing
+              ;
             }
-          } // [In-bound: Inside interval]
-          else {
-            // [Situation] Fall between interval (which is not likley happen)
-            currindex = -1;
-            g_log.warning()
-                << "Not likely to happen! Current value = " << currValue
-                << " is  within value range but its index = " << index
-                << " has no map to group index. "
-                << "\n";
-            if (start.totalNanoseconds() > 0) {
-              // Close the interval pair if it has been started.
-              stop = currTime;
-              createsplitter = true;
-            }
-          } // [In-bound: Between interval]
-        } else {
-          // Out of a range: check whether there is a splitter started
+          } else {
+            // An impossible situation
+            std::stringstream errmsg;
+            double lastvalue = m_dblLog->nthValue(i - 1);
+            errmsg << "Impossible to have currindex == lastindex == "
+                   << currindex
+                   << ", while start is not init.  Log Index = " << i
+                   << "\t value = " << currValue << "\t, Index = " << index
+                   << " in range " << logvalueranges[index] << ", "
+                   << logvalueranges[index + 1]
+                   << "; Last value = " << lastvalue;
+            throw std::runtime_error(errmsg.str());
+          }
+        } // [In-bound: Inside interval]
+        else {
+          // [Situation] Fall between interval (which is not likley happen)
           currindex = -1;
+          g_log.warning() << "Not likely to happen! Current value = "
+                          << currValue
+                          << " is  within value range but its index = " << index
+                          << " has no map to group index. "
+                          << "\n";
           if (start.totalNanoseconds() > 0) {
-            // End situation
+            // Close the interval pair if it has been started.
             stop = currTime;
             createsplitter = true;
           }
-        } // [Out-bound]
-
-      } // [CORRECT DIRECTION]
-      else {
-        // Log Index i falls out b/c out of wrong direction
+        } // [In-bound: Between interval]
+      } else {
+        // Out of a range: check whether there is a splitter started
         currindex = -1;
-
-        // Condition to generate a Splitter (close parenthesis)
-        if (!correctdir && start.totalNanoseconds() > 0) {
+        if (start.totalNanoseconds() > 0) {
+          // End situation
           stop = currTime;
           createsplitter = true;
         }
+      } // [Out-bound]
+
+    } // [CORRECT DIRECTION]
+    else {
+      // Log Index i falls out b/c out of wrong direction
+      currindex = -1;
+
+      // Condition to generate a Splitter (close parenthesis)
+      if (!correctdir && start.totalNanoseconds() > 0) {
+        stop = currTime;
+        createsplitter = true;
       }
-    } // ENDIF (log entry in specified time)
+    }
 
     // d) Create Splitter
     if (createsplitter) {
diff --git a/Framework/Algorithms/src/GetDetOffsetsMultiPeaks.cpp b/Framework/Algorithms/src/GetDetOffsetsMultiPeaks.cpp
index 75a9b6a0e22..d0aae901fc3 100644
--- a/Framework/Algorithms/src/GetDetOffsetsMultiPeaks.cpp
+++ b/Framework/Algorithms/src/GetDetOffsetsMultiPeaks.cpp
@@ -721,7 +721,7 @@ void GetDetOffsetsMultiPeaks::fitPeaksOffset(
 
   // Set up GSL minimzer
   const gsl_multimin_fminimizer_type *T = gsl_multimin_fminimizer_nmsimplex;
-  gsl_multimin_fminimizer *s = nullptr;
+
   gsl_vector *ss, *x;
   gsl_multimin_function minex_func;
 
@@ -729,7 +729,6 @@ void GetDetOffsetsMultiPeaks::fitPeaksOffset(
   size_t nopt = 1;
   size_t iter = 0;
   int status = 0;
-  double size;
 
   /* Starting point */
   x = gsl_vector_alloc(nopt);
@@ -744,7 +743,7 @@ void GetDetOffsetsMultiPeaks::fitPeaksOffset(
   minex_func.f = &gsl_costFunction;
   minex_func.params = &params;
 
-  s = gsl_multimin_fminimizer_alloc(T, nopt);
+  gsl_multimin_fminimizer *s = gsl_multimin_fminimizer_alloc(T, nopt);
   gsl_multimin_fminimizer_set(s, &minex_func, x, ss);
 
   do {
@@ -753,7 +752,7 @@ void GetDetOffsetsMultiPeaks::fitPeaksOffset(
     if (status)
       break;
 
-    size = gsl_multimin_fminimizer_size(s);
+    double size = gsl_multimin_fminimizer_size(s);
     status = gsl_multimin_test_size(size, 1e-4);
 
   } while (status == GSL_CONTINUE && iter < 50);
diff --git a/Framework/Algorithms/src/PDCalibration.cpp b/Framework/Algorithms/src/PDCalibration.cpp
index e0ea9546981..a5de2509c47 100644
--- a/Framework/Algorithms/src/PDCalibration.cpp
+++ b/Framework/Algorithms/src/PDCalibration.cpp
@@ -755,14 +755,13 @@ double fitDIFCtZeroDIFA(std::vector<double> &peaks, double &difc, double &t0,
   size_t iter = 0; // number of iterations
   const size_t MAX_ITER = 75 * numParams;
   int status = 0;
-  double size;
   do {
     iter++;
     status = gsl_multimin_fminimizer_iterate(minimizer);
     if (status)
       break;
 
-    size = gsl_multimin_fminimizer_size(minimizer);
+    double size = gsl_multimin_fminimizer_size(minimizer);
     status = gsl_multimin_test_size(size, 1e-4);
 
   } while (status == GSL_CONTINUE && iter < MAX_ITER);
diff --git a/Framework/Algorithms/src/PolarizationCorrectionWildes.cpp b/Framework/Algorithms/src/PolarizationCorrectionWildes.cpp
index 328054b3448..95cb7c112f6 100644
--- a/Framework/Algorithms/src/PolarizationCorrectionWildes.cpp
+++ b/Framework/Algorithms/src/PolarizationCorrectionWildes.cpp
@@ -96,30 +96,22 @@ void fourInputsCorrectedAndErrors(
   const auto diag1 = 1. / f1;
   const auto off1 = (f1 - 1.) / f1;
   Eigen::Matrix4d F1m;
-  // Suppress warnings about suspicious init with Eigen
-  // cppcheck-suppress constStatement
   F1m << 1., 0., 0., 0., 0., 1., 0., 0., off1, 0., diag1, 0., 0., off1, 0.,
       diag1;
 
   const auto diag2 = 1. / f2;
   const auto off2 = (f2 - 1.) / f2;
   Eigen::Matrix4d F2m;
-
-  // cppcheck-suppress constStatement
   F2m << 1., 0., 0., 0., off2, diag2, 0., 0., 0., 0., 1., 0., 0., 0., off2,
       diag2;
   const auto diag3 = (p1 - 1.) / (2. * p1 - 1.);
   const auto off3 = p1 / (2. * p1 - 1);
   Eigen::Matrix4d P1m;
-
-  // cppcheck-suppress constStatement
   P1m << diag3, 0, off3, 0, 0, diag3, 0, off3, off3, 0, diag3, 0, 0, off3, 0,
       diag3;
   const auto diag4 = (p2 - 1.) / (2. * p2 - 1.);
   const auto off4 = p2 / (2. * p2 - 1.);
   Eigen::Matrix4d P2m;
-
-  // cppcheck-suppress constStatement
   P2m << diag4, off4, 0., 0., off4, diag4, 0., 0., 0., 0., diag4, off4, 0., 0.,
       off4, diag4;
   const Eigen::Vector4d intensities(ppy, pmy, mpy, mmy);
@@ -131,26 +123,18 @@ void fourInputsCorrectedAndErrors(
   // the matrices above, multiplied by the error.
   const auto elemE1 = -1. / pow<2>(f1) * f1E;
   Eigen::Matrix4d F1Em;
-
-  // cppcheck-suppress constStatement
   F1Em << 0., 0., 0., 0., 0., 0., 0., 0., -elemE1, 0., elemE1, 0., 0., -elemE1,
       0., elemE1;
   const auto elemE2 = -1. / pow<2>(f2) * f2E;
   Eigen::Matrix4d F2Em;
-
-  // cppcheck-suppress constStatement
   F2Em << 0., 0., 0., 0., -elemE2, elemE2, 0., 0., 0., 0., 0., 0., 0., 0.,
       -elemE2, elemE2;
   const auto elemE3 = 1. / pow<2>(2. * p1 - 1.) * p1E;
   Eigen::Matrix4d P1Em;
-
-  // cppcheck-suppress constStatement
   P1Em << elemE3, 0., -elemE3, 0., 0., elemE3, 0., -elemE3, -elemE3, 0., elemE3,
       0., 0., -elemE3, 0., elemE3;
   const auto elemE4 = 1. / pow<2>(2. * p2 - 1.) * p2E;
   Eigen::Matrix4d P2Em;
-
-  // cppcheck-suppress constStatement
   P2Em << elemE4, -elemE4, 0., 0., -elemE4, elemE4, 0., 0., 0., 0., elemE4,
       -elemE4, 0., 0., -elemE4, elemE4;
   const Eigen::Vector4d yErrors(ppyE, pmyE, mpyE, mmyE);
diff --git a/Framework/Algorithms/test/AnyShapeAbsorptionTest.h b/Framework/Algorithms/test/AnyShapeAbsorptionTest.h
index 89f511c9ebf..00416e4ad48 100644
--- a/Framework/Algorithms/test/AnyShapeAbsorptionTest.h
+++ b/Framework/Algorithms/test/AnyShapeAbsorptionTest.h
@@ -257,7 +257,6 @@ public:
     constexpr double WL_DELTA = (2.9 - WL_MIN) / static_cast<double>(NUM_VALS);
 
     // create the input workspace
-    const std::string IN_WS{"AbsorptionCorrection_Input"};
     auto inputWS = WorkspaceCreationHelper::create2DWorkspaceBinned(
         1, NUM_VALS, WL_MIN, WL_DELTA);
     auto testInst =
diff --git a/Framework/Algorithms/test/ApplyCalibrationTest.h b/Framework/Algorithms/test/ApplyCalibrationTest.h
index c666885b977..fb596ef039a 100644
--- a/Framework/Algorithms/test/ApplyCalibrationTest.h
+++ b/Framework/Algorithms/test/ApplyCalibrationTest.h
@@ -82,11 +82,9 @@ public:
     TS_ASSERT(appCalib.isExecuted());
 
     const auto &spectrumInfo = ws->spectrumInfo();
-    const auto &componentInfo = ws->componentInfo();
 
     int id = spectrumInfo.detector(0).getID();
     V3D newPos = spectrumInfo.position(0);
-    V3D scaleFactor = componentInfo.scaleFactor(0);
 
     TS_ASSERT_EQUALS(id, 1);
     TS_ASSERT_DELTA(newPos.X(), 1.0, 0.0001);
@@ -95,7 +93,6 @@ public:
 
     id = spectrumInfo.detector(ndets - 1).getID();
     newPos = spectrumInfo.position(ndets - 1);
-    scaleFactor = componentInfo.scaleFactor(0);
 
     TS_ASSERT_EQUALS(id, ndets);
     TS_ASSERT_DELTA(newPos.X(), 1.0, 0.0001);
diff --git a/Framework/Algorithms/test/CalculateFlatBackgroundTest.h b/Framework/Algorithms/test/CalculateFlatBackgroundTest.h
index 4ef353d997b..7c65acff010 100644
--- a/Framework/Algorithms/test/CalculateFlatBackgroundTest.h
+++ b/Framework/Algorithms/test/CalculateFlatBackgroundTest.h
@@ -763,6 +763,7 @@ private:
           AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
               "Removed1");
       for (size_t j = 0; j < spectraCount; ++j) {
+        // cppcheck-suppress unreadVariable
         const double expected =
             (movingAverageSpecialY(j) + (static_cast<double>(windowWidth) - 1) *
                                             movingAverageStandardY(j)) /
diff --git a/Framework/Algorithms/test/CalculateTransmissionTest.h b/Framework/Algorithms/test/CalculateTransmissionTest.h
index 238ab958c5f..f440374c339 100644
--- a/Framework/Algorithms/test/CalculateTransmissionTest.h
+++ b/Framework/Algorithms/test/CalculateTransmissionTest.h
@@ -361,10 +361,9 @@ public:
       auto &fitted_x = fitted->x(0);
 
       //  TS_ASSERT_EQUALS(fitted_y.size(), unfitted_y.size());
-      double x;
 
       for (unsigned int i = 0; i < fitted_y.size(); ++i) {
-        x = fitted_x[i]; //(fitted_x[i] + fitted_x[i+1])* 0.5;
+        double x = fitted_x[i]; //(fitted_x[i] + fitted_x[i+1])* 0.5;
         TS_ASSERT_DELTA(fitted_y[i],
                         26.6936 - 9.31494 * x + 1.11532 * x * x -
                             0.044502 * x * x * x,
@@ -405,10 +404,9 @@ public:
       auto &fitted_x = fitted->x(0);
 
       //  TS_ASSERT_EQUALS(fitted_y.size(), unfitted_y.size());
-      double x;
 
       for (unsigned int i = 0; i < fitted_y.size(); ++i) {
-        x = (fitted_x[i] + fitted_x[i + 1]) * 0.5;
+        double x = (fitted_x[i] + fitted_x[i + 1]) * 0.5;
         TS_ASSERT_DELTA(fitted_y[i],
                         26.6936 - 9.31494 * x + 1.11532 * x * x -
                             0.044502 * x * x * x,
diff --git a/Framework/Algorithms/test/CreateEPPTest.h b/Framework/Algorithms/test/CreateEPPTest.h
index 7938d581ad0..2ed9d6e0c6d 100644
--- a/Framework/Algorithms/test/CreateEPPTest.h
+++ b/Framework/Algorithms/test/CreateEPPTest.h
@@ -177,7 +177,7 @@ private:
       return false;
     }
     for (const auto &columnName : columnNames) {
-      if (std::find(names.cbegin(), names.cend(), columnName) == names.end()) {
+      if (std::find(names.cbegin(), names.cend(), columnName) == names.cend()) {
         return false;
       }
     }
diff --git a/Framework/Algorithms/test/DetectorEfficiencyCorTest.h b/Framework/Algorithms/test/DetectorEfficiencyCorTest.h
index 4c851cdcf73..9bf3cae230d 100644
--- a/Framework/Algorithms/test/DetectorEfficiencyCorTest.h
+++ b/Framework/Algorithms/test/DetectorEfficiencyCorTest.h
@@ -41,7 +41,6 @@ public:
         WorkspaceCreationHelper::create2DWorkspaceWithFullInstrument(2, 1);
     dummyWS->getAxis(0)->unit() =
         Mantid::Kernel::UnitFactory::Instance().create("DeltaE");
-    const std::string inputWS = "testInput";
 
     Mantid::Algorithms::DetectorEfficiencyCor corrector;
     TS_ASSERT_THROWS_NOTHING(corrector.initialize());
diff --git a/Framework/Algorithms/test/FFTSmooth2Test.h b/Framework/Algorithms/test/FFTSmooth2Test.h
index a0a85cac670..ffae4ce2e45 100644
--- a/Framework/Algorithms/test/FFTSmooth2Test.h
+++ b/Framework/Algorithms/test/FFTSmooth2Test.h
@@ -277,9 +277,11 @@ public:
             }
 
             if (!AllSpectra) {
+              bool allSpectraGtZero = false;
+
               for (int WorkspaceIndex = 0; WorkspaceIndex < 10;
                    WorkspaceIndex++) {
-                performTest((event > 0), filter, params, (AllSpectra > 0),
+                performTest((event > 0), filter, params, allSpectraGtZero,
                             WorkspaceIndex, (inPlace > 0));
               }
             } else {
diff --git a/Framework/Algorithms/test/FindCenterOfMassPosition2Test.h b/Framework/Algorithms/test/FindCenterOfMassPosition2Test.h
index 31e925bc196..b914e7e6c0f 100644
--- a/Framework/Algorithms/test/FindCenterOfMassPosition2Test.h
+++ b/Framework/Algorithms/test/FindCenterOfMassPosition2Test.h
@@ -58,7 +58,7 @@ public:
         // Set tube extrema to special values
         if (iy == 0 || iy == SANSInstrumentCreationHelper::nBins - 1)
           Y[0] =
-              iy % 2 ? std::nan("") : std::numeric_limits<double>::infinity();
+              (iy % 2) ? std::nan("") : std::numeric_limits<double>::infinity();
         E[0] = 1;
       }
     }
diff --git a/Framework/Algorithms/test/FitPeaksTest.h b/Framework/Algorithms/test/FitPeaksTest.h
index 2af2633483f..f4849daa7e7 100644
--- a/Framework/Algorithms/test/FitPeaksTest.h
+++ b/Framework/Algorithms/test/FitPeaksTest.h
@@ -411,7 +411,6 @@ public:
     // std::string input_ws_name = loadVulcanHighAngleData();
 
     // Generate peak and background parameters
-    std::vector<string> peakparnames{"Mixing"};
     std::vector<double> peakparvalues{0.5};
 
     // Initialize FitPeak
diff --git a/Framework/Algorithms/test/LineProfileTest.h b/Framework/Algorithms/test/LineProfileTest.h
index ec4e372c533..61fda4391b0 100644
--- a/Framework/Algorithms/test/LineProfileTest.h
+++ b/Framework/Algorithms/test/LineProfileTest.h
@@ -568,9 +568,9 @@ public:
     TS_ASSERT_EQUALS(axis->getMax(), edges.back())
     const auto binHeight = axis->getMax() - axis->getMin();
     TS_ASSERT_EQUALS(outputWS->getNumberHistograms(), 1)
-    const auto &Xs = outputWS->x(0);
+    // cppcheck-suppress unreadVariable
     const std::vector<double> profilePoints{{1., 2., 3., 4.}};
-    TS_ASSERT_EQUALS(Xs.rawData(), profilePoints)
+    TS_ASSERT_EQUALS(outputWS->x(0).rawData(), profilePoints)
     const auto &Ys = outputWS->y(0);
     const auto horizontalIntegral = (3. * 0.1 + 2. * 1. + 1. * 10.) / binHeight;
     for (const auto y : Ys) {
diff --git a/Framework/Algorithms/test/MergeRunsTest.h b/Framework/Algorithms/test/MergeRunsTest.h
index 3e696152726..8bead92a85e 100644
--- a/Framework/Algorithms/test/MergeRunsTest.h
+++ b/Framework/Algorithms/test/MergeRunsTest.h
@@ -373,6 +373,7 @@ public:
     va_start(vl, num);
     for (int i = 0; i < num; i++)
       retVal.emplace_back(va_arg(vl, int));
+    va_end(vl);
     return retVal;
   }
 
diff --git a/Framework/Algorithms/test/MonteCarloAbsorptionTest.h b/Framework/Algorithms/test/MonteCarloAbsorptionTest.h
index 2754ce99000..bff3d16341a 100644
--- a/Framework/Algorithms/test/MonteCarloAbsorptionTest.h
+++ b/Framework/Algorithms/test/MonteCarloAbsorptionTest.h
@@ -87,7 +87,6 @@ void addSample(const Mantid::API::MatrixWorkspace_sptr &ws,
     ws->mutableSample().setShape(sampleShape);
 
     if (environment == Environment::SamplePlusContainer) {
-      const std::string id("container");
       constexpr double containerWallThickness{0.002};
       constexpr double containerInnerRadius{1.2 * sampleHeight};
       constexpr double containerOuterRadius{containerInnerRadius +
diff --git a/Framework/Algorithms/test/MultiplyDivideTest.in.h b/Framework/Algorithms/test/MultiplyDivideTest.in.h
index 44f71c607c1..2a2c6270760 100644
--- a/Framework/Algorithms/test/MultiplyDivideTest.in.h
+++ b/Framework/Algorithms/test/MultiplyDivideTest.in.h
@@ -9,6 +9,7 @@
 
 #include <cxxtest/TestSuite.h>
 #include <cmath>
+#include <stdexcept>
 
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 #include "MantidAlgorithms/Divide.h"
@@ -602,6 +603,10 @@ public:
     mess << "; RHS: grouping=" << rhs_grouping << ", 2D=" << rhs2D;
     message = mess.str();
 
+    if (lhs_grouping == 0 || rhs_grouping == 0){
+      throw std::runtime_error("Attempted div by zero in test");
+    }
+
     int numpix = 12;
     std::vector< std::vector<int> > lhs(numpix/lhs_grouping), rhs(numpix/rhs_grouping);
     for (int i=0; i<numpix; i++)
diff --git a/Framework/Algorithms/test/NormaliseByDetectorTest.h b/Framework/Algorithms/test/NormaliseByDetectorTest.h
index 8aa3652fe16..be357380860 100644
--- a/Framework/Algorithms/test/NormaliseByDetectorTest.h
+++ b/Framework/Algorithms/test/NormaliseByDetectorTest.h
@@ -400,10 +400,11 @@ public:
     MatrixWorkspace_sptr inputWS = create_workspace_with_fitting_functions();
     // Extract the output workspace so that we can verify the normalisation.
     const bool parallel = true;
+    const bool sequential = false;
     MatrixWorkspace_sptr outWS_parallel = do_test_doesnt_throw_on_execution(
         inputWS, parallel); // EXECUTES THE ALG IN PARALLEL.
     MatrixWorkspace_sptr outWS_sequential = do_test_doesnt_throw_on_execution(
-        inputWS, !parallel); // EXECUTES THE ALG SEQUENTIALLY.
+        inputWS, sequential); // EXECUTES THE ALG SEQUENTIALLY.
 
     // Output workspaces should have same number of histograms.
     TS_ASSERT_EQUALS(2, outWS_parallel->getNumberHistograms());
diff --git a/Framework/Algorithms/test/NormaliseToMonitorTest.h b/Framework/Algorithms/test/NormaliseToMonitorTest.h
index b3a9a9c345b..1642311c5f7 100644
--- a/Framework/Algorithms/test/NormaliseToMonitorTest.h
+++ b/Framework/Algorithms/test/NormaliseToMonitorTest.h
@@ -468,10 +468,11 @@ public:
     for (size_t i = 0; i < specOutInfo.size(); ++i) {
       const auto &yValues = outWS->histogram(i).y();
       for (size_t j = 0; j < yValues.size(); ++j) {
-        if (specOutInfo.isMonitor(i))
+        if (specOutInfo.isMonitor(i)) {
           TS_ASSERT_DELTA(yValues[j], 3.0, 1e-12)
-        else
+        } else {
           TS_ASSERT_DELTA(yValues[j], 6.0 / double(j + 1), 1e-12)
+        }
       }
     }
   }
@@ -497,6 +498,7 @@ public:
       const auto &yValues = outWS->histogram(i).y();
       for (size_t j = 0; j < yValues.size(); ++j) {
         if (specOutInfo.isMonitor(i))
+          // cppcheck-suppress syntaxError
           TS_ASSERT_DELTA(yValues[j], double(j + 1) / 15.0, 1e-12)
         else
           TS_ASSERT_DELTA(yValues[j], 2.0 / 15.0, 1e-12)
diff --git a/Framework/Algorithms/test/PlusMinusTest.in.h b/Framework/Algorithms/test/PlusMinusTest.in.h
index e264d7048f5..68a6515f889 100644
--- a/Framework/Algorithms/test/PlusMinusTest.in.h
+++ b/Framework/Algorithms/test/PlusMinusTest.in.h
@@ -392,7 +392,7 @@ public:
     MatrixWorkspace_sptr work_in2 = eventWS_5x10_50;
     // You have to specify the expected output value because in1 gets changed.
     performTest(work_in1,work_in2, true, false /*not event out*/,
-        DO_PLUS ? 4.0 : 0.0,   DO_PLUS ? 2.0 : 2.0);
+        DO_PLUS ? 4.0 : 0.0, 2.0);
   }
 
   void test_Event_2D()
@@ -468,7 +468,7 @@ public:
     MatrixWorkspace_sptr work_in1 = eventWS_5x10_50;
     MatrixWorkspace_sptr work_in2 = eventWS_5x10_50;
     MatrixWorkspace_sptr work_out = performTest(work_in1,work_in2, false /*inPlace*/, true /*outputIsEvent*/,
-        DO_PLUS ? 4.0 : 0.0,   DO_PLUS ? 2.0 : 2.0);
+        DO_PLUS ? 4.0 : 0.0, 2.0);
   }
 
   void test_Event_Event_inPlace()
@@ -477,7 +477,7 @@ public:
     MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::createEventWorkspace(nHist,nBins,50,0.0,1.0,2);
     MatrixWorkspace_sptr work_in2 = eventWS_5x10_50;
     MatrixWorkspace_sptr work_out = performTest(work_in1,work_in2, true, true /*outputIsEvent*/,
-        DO_PLUS ? 4.0 : 0.0,   DO_PLUS ? 2.0 : 2.0);
+        DO_PLUS ? 4.0 : 0.0, 2.0);
   }
 
   void test_Event_EventSingleSpectrum_fails()
@@ -502,7 +502,7 @@ public:
       MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::createEventWorkspace(nHist,nBins,50,0.0,1.0,2);
       MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::createEventWorkspace(nHist,nBins,50,0.0,1.0,2);
       MatrixWorkspace_sptr work_out = performTest(work_in1,work_in2, inplace!=0, true /*outputIsEvent*/,
-          DO_PLUS ? 4.0 : 0.0,   DO_PLUS ? 2.0 : 2.0);
+          DO_PLUS ? 4.0 : 0.0, 2.0);
     }
   }
 
@@ -514,7 +514,7 @@ public:
       MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::createEventWorkspace(nHist,nBins,50,0.0,1.0,2);
       MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::createEventWorkspace(nHist,1,50,0.0,1.0,2);
       MatrixWorkspace_sptr work_out = performTest(work_in1,work_in2, inplace!=0, true /*outputIsEvent*/,
-          DO_PLUS ? 4.0 : 0.0,   DO_PLUS ? 2.0 : 2.0);
+          DO_PLUS ? 4.0 : 0.0, 2.0);
     }
   }
 
@@ -525,7 +525,7 @@ public:
       MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::createEventWorkspace(5,1,50,0.0,1.0,2);
       MatrixWorkspace_sptr work_in2 = eventWS_5x10_50;
       MatrixWorkspace_sptr work_out = performTest(work_in1,work_in2, inplace!=0, true /*outputIsEvent*/,
-          DO_PLUS ? 4.0 : 0.0,   DO_PLUS ? 2.0 : 2.0);
+          DO_PLUS ? 4.0 : 0.0, 2.0);
     }
   }
 
@@ -537,7 +537,7 @@ public:
       MatrixWorkspace_sptr work_in1 = WorkspaceCreationHelper::createEventWorkspace(nHist,nBins,50,0.0,1.0,2);
       MatrixWorkspace_sptr work_in2 = WorkspaceCreationHelper::createEventWorkspace(nHist,nBins,50,0.0,1.0,2);
       MatrixWorkspace_sptr work_out = performTest(work_in1,work_in2, inplace!=0, true /*outputIsEvent*/,
-          DO_PLUS ? 4.0 : 0.0,   DO_PLUS ? 2.0 : 2.0);
+          DO_PLUS ? 4.0 : 0.0, 2.0);
     }
   }
 
@@ -567,7 +567,7 @@ public:
       TS_ASSERT( work_in2->getSpectrum(0).hasDetectorID(100) );
 
       MatrixWorkspace_sptr work_out = performTest(work_in1,work_in2, inplace!=0, true /*outputIsEvent*/,
-          DO_PLUS ? 3.0 : -1.0,   DO_PLUS ? 1.7320 : 1.7320);
+          DO_PLUS ? 3.0 : -1.0, 1.7320);
 
       //Ya, its an event workspace
       TS_ASSERT(work_out);
diff --git a/Framework/Algorithms/test/ReflectometryMomentumTransferTest.h b/Framework/Algorithms/test/ReflectometryMomentumTransferTest.h
index d4c076943fb..1c79b75e5dd 100644
--- a/Framework/Algorithms/test/ReflectometryMomentumTransferTest.h
+++ b/Framework/Algorithms/test/ReflectometryMomentumTransferTest.h
@@ -119,8 +119,7 @@ public:
     TS_ASSERT_EQUALS(outXs.size(), inXs.size())
     TS_ASSERT(outputWS->hasDx(0))
     const auto &inYs = inputWS->y(0);
-    const auto &outYs = outputWS->y(0);
-    TS_ASSERT_EQUALS(outYs.rawData(), inYs.rawData())
+    TS_ASSERT_EQUALS(outputWS->y(0).rawData(), inYs.rawData())
     const auto &inEs = inputWS->e(0);
     const auto &outEs = outputWS->e(0);
     TS_ASSERT_EQUALS(outEs.rawData(), inEs.rawData())
diff --git a/Framework/Algorithms/test/ResampleXTest.h b/Framework/Algorithms/test/ResampleXTest.h
index 10eca45e800..bb64a250039 100644
--- a/Framework/Algorithms/test/ResampleXTest.h
+++ b/Framework/Algorithms/test/ResampleXTest.h
@@ -221,7 +221,6 @@ public:
     vector<double> xmins = alg.getProperty("XMin");
     vector<double> xmaxs = alg.getProperty("XMax");
     int nBins = alg.getProperty("NumberBins");
-    double deltaBin;
 
     // Define tolerance for ASSERT_DELTA
     double tolerance = 1.0e-10;
@@ -230,7 +229,8 @@ public:
     for (int yIndex = 0; yIndex < ylen; ++yIndex) {
 
       // The bin width for the current spectrum
-      deltaBin = (xmaxs[yIndex] - xmins[yIndex]) / static_cast<double>(nBins);
+      double deltaBin =
+          (xmaxs[yIndex] - xmins[yIndex]) / static_cast<double>(nBins);
 
       // Check the axes lengths
       TS_ASSERT_EQUALS(outWS->x(yIndex).size(), nBins + 1);
@@ -344,7 +344,6 @@ public:
     vector<double> xmins = alg.getProperty("XMin");
     vector<double> xmaxs = alg.getProperty("XMax");
     int nBins = alg.getProperty("NumberBins");
-    double deltaBin;
 
     // Define tolerance for ASSERT_DELTA
     double tolerance = 1.0e-10;
@@ -354,7 +353,8 @@ public:
     for (int yIndex = 0; yIndex < ylen; ++yIndex) {
 
       // The bin width for the current spectrum
-      deltaBin = (xmaxs[yIndex] - xmins[yIndex]) / static_cast<double>(nBins);
+      double deltaBin =
+          (xmaxs[yIndex] - xmins[yIndex]) / static_cast<double>(nBins);
 
       // Check the axes lengths
       TS_ASSERT_EQUALS(outWS->x(yIndex).size(), nBins + 1);
diff --git a/Framework/Algorithms/test/RingProfileTest.h b/Framework/Algorithms/test/RingProfileTest.h
index 5eef8b18169..6081a76e993 100644
--- a/Framework/Algorithms/test/RingProfileTest.h
+++ b/Framework/Algorithms/test/RingProfileTest.h
@@ -39,14 +39,6 @@ public:
                      const std::invalid_argument &);
 
     // centre must be 2 or 3 values (x,y) or (x,y,z)
-    std::vector<double> justOne(1);
-    justOne[0] = -0.35;
-    // TS_ASSERT_THROWS(alg.setProperty("Centre",justOne),
-    // const std::invalid_argument &);
-
-    std::vector<double> fourInputs(4, -0.45);
-    // TS_ASSERT_THROWS(alg.setProperty("Centre", fourInputs),
-    // const std::invalid_argument &);
 
     TS_ASSERT_THROWS_NOTHING(
         alg.setPropertyValue("OutputWorkspace", outWSName));
diff --git a/Framework/Algorithms/test/SassenaFFTTest.h b/Framework/Algorithms/test/SassenaFFTTest.h
index 02725308399..575614655df 100644
--- a/Framework/Algorithms/test/SassenaFFTTest.h
+++ b/Framework/Algorithms/test/SassenaFFTTest.h
@@ -176,7 +176,6 @@ private:
     const double frErr = 1E-03; // allowed fractional error
     const size_t nspectra = ws->getNumberHistograms();
     MantidVec yv, xv;
-    double factor; // remove the detailed balance condition
     for (size_t i = 0; i < nspectra; i++) {
       double goldStandard =
           ps2meV * (1 + static_cast<double>(i)) *
@@ -186,7 +185,7 @@ private:
       size_t index =
           nbins / 2; // This position should yield ws->readX(i).at(index)==0.0
       double x = ws->readX(i).at(index);
-      factor = exp(exponentFactor * x);
+      double factor = exp(exponentFactor * x);
       double h = yv.at(index) * exp(x);
       xv = ws->readX(i);
       MantidVec::iterator itx = xv.begin();
@@ -212,9 +211,8 @@ private:
    */
   void Gaussian(MantidVec &xv, MantidVec &yv, const double &Heigth,
                 const double &sigma) {
-    double z;
     for (size_t i = 0; i < xv.size(); i++) {
-      z = xv[i] / sigma;
+      double z = xv[i] / sigma;
       yv[i] = Heigth * exp(-z * z / 2.0);
     }
   } // void Gaussian
@@ -250,12 +248,11 @@ private:
       xv.emplace_back(dt * static_cast<double>(j));
     }
 
-    double sigma;
     MantidVec yv(nbins);
     // each spectra is a gaussian of same Height but different stdev
     for (size_t i = 0; i < nspectra; i++) {
       ws->mutableX(i) = xv;
-      sigma = sigma0 / (1 + static_cast<double>(i));
+      double sigma = sigma0 / (1 + static_cast<double>(i));
       this->Gaussian(xv, yv, Heigth, sigma);
       ws->mutableY(i) = yv;
     }
diff --git a/Framework/Algorithms/test/SofQWNormalisedPolygonTest.h b/Framework/Algorithms/test/SofQWNormalisedPolygonTest.h
index 9e9ca636f28..88c965eb97b 100644
--- a/Framework/Algorithms/test/SofQWNormalisedPolygonTest.h
+++ b/Framework/Algorithms/test/SofQWNormalisedPolygonTest.h
@@ -236,6 +236,7 @@ public:
     TS_ASSERT_THROWS_NOTHING(alg.setProperty("EMode", "Indirect"))
     TS_ASSERT_THROWS_NOTHING(alg.setProperty("EFixed", 1.84))
     const double dE{0.3};
+    // cppcheck-suppress unreadVariable
     const std::vector<double> eBinParams{dE};
     std::vector<double> expectedEBinEdges;
     const auto firstEdge = inWS->x(0).front();
diff --git a/Framework/Algorithms/test/SolidAngleTest.h b/Framework/Algorithms/test/SolidAngleTest.h
index 649d35707bb..dc64b47dd9d 100644
--- a/Framework/Algorithms/test/SolidAngleTest.h
+++ b/Framework/Algorithms/test/SolidAngleTest.h
@@ -213,7 +213,7 @@ public:
     auto spectrumInfo2 = output2D_2->spectrumInfo();
     for (size_t i = 0; i < numberOfSpectra1; i++) {
       // all values after the start point of the second workspace should match
-      if (!(spectrumInfo2.isMasked(i) || spectrumInfo2.isMasked(i))) {
+      if (!(spectrumInfo1.isMasked(i) || spectrumInfo2.isMasked(i))) {
         TS_ASSERT_EQUALS(output2D_1->y(i)[0], output2D_2->y(i)[0]);
       }
     }
diff --git a/Framework/Algorithms/test/SumOverlappingTubesTest.h b/Framework/Algorithms/test/SumOverlappingTubesTest.h
index 191555ab6fa..af23cd66dd3 100644
--- a/Framework/Algorithms/test/SumOverlappingTubesTest.h
+++ b/Framework/Algorithms/test/SumOverlappingTubesTest.h
@@ -697,9 +697,8 @@ public:
     auto outWS = boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(
         AnalysisDataService::Instance().retrieve("outWS"));
 
-    const auto &xAxis = outWS->getAxis(0);
-    TS_ASSERT_EQUALS(xAxis->length(), 296)
-    const auto &yAxis = outWS->getAxis(1);
+    auto yAxis = outWS->getAxis(1);
+    TS_ASSERT_EQUALS(outWS->getAxis(0)->length(), 296)
     TS_ASSERT_EQUALS(yAxis->length(), 256)
 
     for (size_t i = 0; i < 256; i++) {
@@ -735,9 +734,8 @@ public:
     auto outWS = boost::dynamic_pointer_cast<Mantid::API::MatrixWorkspace>(
         AnalysisDataService::Instance().retrieve("outWS"));
 
-    const auto &xAxis = outWS->getAxis(0);
-    TS_ASSERT_EQUALS(xAxis->length(), 296)
-    const auto &yAxis = outWS->getAxis(1);
+    auto yAxis = outWS->getAxis(1);
+    TS_ASSERT_EQUALS(outWS->getAxis(0)->length(), 296)
     TS_ASSERT_EQUALS(yAxis->length(), 256)
 
     for (size_t i = 0; i < 256; i++) {
diff --git a/Framework/Algorithms/test/SumSpectraTest.h b/Framework/Algorithms/test/SumSpectraTest.h
index ebbbb6cffb6..664c39b90ea 100644
--- a/Framework/Algorithms/test/SumSpectraTest.h
+++ b/Framework/Algorithms/test/SumSpectraTest.h
@@ -568,7 +568,6 @@ public:
     testSig = std::sqrt(testSig);
     // Set the properties
     alg2.setProperty("InputWorkspace", tws);
-    const std::string outputSpace2 = "SumSpectraOut2";
     alg2.setPropertyValue("OutputWorkspace", outName);
     alg2.setProperty("IncludeMonitors", false);
     alg2.setProperty("WeightedSum", true);
diff --git a/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h b/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h
index 2cb20904b9f..1698015e4c9 100644
--- a/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h
+++ b/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h
@@ -99,10 +99,10 @@ public:
     std::set<index> s1;
     std::set<index> s2;
     for (it1 = _hkls.begin(); it1 != _hkls.end();
-         it1++) // All possible vectors for hkl on current instance
+         ++it1) // All possible vectors for hkl on current instance
     {
       for (it2 = rhs._hkls.begin(); it2 != rhs._hkls.end();
-           it2++) // All possible vectors for hkl on other
+           ++it2) // All possible vectors for hkl on other
       {
         const index &index1 = *it1;
         const index &index2 = *it2;
diff --git a/Framework/Crystal/test/PeaksInRegionTest.h b/Framework/Crystal/test/PeaksInRegionTest.h
index 2e5510a1f62..e3bca14a6c9 100644
--- a/Framework/Crystal/test/PeaksInRegionTest.h
+++ b/Framework/Crystal/test/PeaksInRegionTest.h
@@ -304,14 +304,12 @@ public:
     double peakRadius = 0.49; // not enough for the sphere to penetrate the
                               // bounding box. Expect failure
     do_test_bounds_check_extents(coordinateFrame, -wallDistanceFromPeakCenter,
-                                 1, 1, 1, 1, 1, peakRadius,
-                                 peakRadius > wallDistanceFromPeakCenter);
+                                 1, 1, 1, 1, 1, peakRadius, false);
 
     peakRadius = 0.51; // just enough for the sphere to penetrate the bounding
                        // box. Expect pass.
     do_test_bounds_check_extents(coordinateFrame, -wallDistanceFromPeakCenter,
-                                 1, 1, 1, 1, 1, peakRadius,
-                                 peakRadius > wallDistanceFromPeakCenter);
+                                 1, 1, 1, 1, 1, peakRadius, true);
   }
 
   void test_peak_intersects_xmax_boundary_when_radius_large_enough() {
@@ -320,15 +318,15 @@ public:
 
     double peakRadius = 0.49; // not enough for the sphere to penetrate the
                               // bounding box. Expect failure
-    do_test_bounds_check_extents(
-        coordinateFrame, 1, -wallDistanceFromPeakCenter, 1, 1, 1, 1, peakRadius,
-        peakRadius > wallDistanceFromPeakCenter);
+    do_test_bounds_check_extents(coordinateFrame, 1,
+                                 -wallDistanceFromPeakCenter, 1, 1, 1, 1,
+                                 peakRadius, false);
 
     peakRadius = 0.51; // just enough for the sphere to penetrate the bounding
                        // box. Expect pass.
-    do_test_bounds_check_extents(
-        coordinateFrame, 1, -wallDistanceFromPeakCenter, 1, 1, 1, 1, peakRadius,
-        peakRadius > wallDistanceFromPeakCenter);
+    do_test_bounds_check_extents(coordinateFrame, 1,
+                                 -wallDistanceFromPeakCenter, 1, 1, 1, 1,
+                                 peakRadius, true);
   }
 
   void test_peak_intersects_ymin_boundary_when_radius_large_enough() {
@@ -337,15 +335,15 @@ public:
 
     double peakRadius = 0.49; // not enough for the sphere to penetrate the
                               // bounding box. Expect failure
-    do_test_bounds_check_extents(
-        coordinateFrame, 1, 1, -wallDistanceFromPeakCenter, 1, 1, 1, peakRadius,
-        peakRadius > wallDistanceFromPeakCenter);
+    do_test_bounds_check_extents(coordinateFrame, 1, 1,
+                                 -wallDistanceFromPeakCenter, 1, 1, 1,
+                                 peakRadius, false);
 
     peakRadius = 0.51; // just enough for the sphere to penetrate the bounding
                        // box. Expect pass.
-    do_test_bounds_check_extents(
-        coordinateFrame, 1, 1, -wallDistanceFromPeakCenter, 1, 1, 1, peakRadius,
-        peakRadius > wallDistanceFromPeakCenter);
+    do_test_bounds_check_extents(coordinateFrame, 1, 1,
+                                 -wallDistanceFromPeakCenter, 1, 1, 1,
+                                 peakRadius, true);
   }
 
   void test_peak_intersects_ymax_boundary_when_radius_large_enough() {
@@ -356,13 +354,13 @@ public:
                               // bounding box. Expect failure
     do_test_bounds_check_extents(coordinateFrame, 1, 1, 1,
                                  -wallDistanceFromPeakCenter, 1, 1, peakRadius,
-                                 peakRadius > wallDistanceFromPeakCenter);
+                                 false);
 
     peakRadius = 0.51; // just enough for the sphere to penetrate the bounding
                        // box. Expect pass.
     do_test_bounds_check_extents(coordinateFrame, 1, 1, 1,
                                  -wallDistanceFromPeakCenter, 1, 1, peakRadius,
-                                 peakRadius > wallDistanceFromPeakCenter);
+                                 true);
   }
 
   void test_peak_intersects_zmin_boundary_when_radius_large_enough() {
@@ -373,13 +371,13 @@ public:
                               // bounding box. Expect failure
     do_test_bounds_check_extents(coordinateFrame, 1, 1, 1, 1,
                                  -wallDistanceFromPeakCenter, 1, peakRadius,
-                                 peakRadius > wallDistanceFromPeakCenter);
+                                 false);
 
     peakRadius = 0.51; // just enough for the sphere to penetrate the bounding
                        // box. Expect pass.
     do_test_bounds_check_extents(coordinateFrame, 1, 1, 1, 1,
                                  -wallDistanceFromPeakCenter, 1, peakRadius,
-                                 peakRadius > wallDistanceFromPeakCenter);
+                                 true);
   }
 
   void test_peak_intersects_zmax_boundary_when_radius_large_enough() {
@@ -390,13 +388,12 @@ public:
                               // bounding box. Expect failure
     do_test_bounds_check_extents(coordinateFrame, 1, 1, 1, 1, 1,
                                  -wallDistanceFromPeakCenter, peakRadius,
-                                 peakRadius > wallDistanceFromPeakCenter);
+                                 false);
 
     peakRadius = 0.51; // just enough for the sphere to penetrate the bounding
                        // box. Expect pass.
     do_test_bounds_check_extents(coordinateFrame, 1, 1, 1, 1, 1,
-                                 -wallDistanceFromPeakCenter, peakRadius,
-                                 peakRadius > wallDistanceFromPeakCenter);
+                                 -wallDistanceFromPeakCenter, peakRadius, true);
   }
 
   void test_false_intersection_when_check_peak_extents() {
diff --git a/Framework/Crystal/test/SaveIsawUBTest.h b/Framework/Crystal/test/SaveIsawUBTest.h
index 2f3394f32ad..e7cbf2bd731 100644
--- a/Framework/Crystal/test/SaveIsawUBTest.h
+++ b/Framework/Crystal/test/SaveIsawUBTest.h
@@ -90,15 +90,13 @@ public:
     F1.open(File1.c_str());
     F2.open(File2.c_str());
 
-    int line = 1;
     std::string s;
-    double val1, val2;
-    double tolerance;
 
-    if (F1.good() && F2.good())
+    if (F1.good() && F2.good()) {
+      int line = 1;
       for (int row = 0; row < 5; row++) {
         int NNums = 3;
-        tolerance = .0000003;
+        double tolerance = .0000003;
         if (line > 3) {
           NNums = 7;
           tolerance = .0003;
@@ -107,6 +105,7 @@ public:
         for (int N = 0; N < NNums; N++) {
           s = Mantid::Kernel::Strings::getWord(F1, false);
 
+          double val1, val2;
           if (!Mantid::Kernel::Strings::convert<double>(s, val1)) {
             stringstream message;
             message << "Characters on line " << line << " word " << N;
@@ -128,7 +127,7 @@ public:
         Mantid::Kernel::Strings::readToEndOfLine(F2, true);
         line++;
       }
-    else {
+    } else {
       TS_ASSERT(F1.good());
       TS_ASSERT(F2.good());
       remove(File2.c_str());
diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFit.h b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFit.h
index 8b44d19e3aa..0d881f945b0 100644
--- a/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFit.h
+++ b/Framework/CurveFitting/inc/MantidCurveFitting/Algorithms/LeBailFit.h
@@ -37,26 +37,26 @@ namespace Algorithms {
 struct Parameter {
   // Regular
   std::string name;
-  double curvalue;
-  double prevalue;
-  double minvalue;
-  double maxvalue;
-  bool fit;
-  double stepsize;
-  double fiterror;
+  double curvalue = 0;
+  double prevalue = 0;
+  double minvalue = 0;
+  double maxvalue = 0;
+  bool fit = false;
+  double stepsize = 0;
+  double fiterror = 0;
   // Monte Carlo
-  bool nonnegative;
-  double mcA0;
-  double mcA1;
+  bool nonnegative = false;
+  double mcA0 = 0;
+  double mcA1 = 0;
   // Monte Carlo record
-  double sumstepsize;
-  double maxabsstepsize;
-  double maxrecordvalue;
-  double minrecordvalue;
-  size_t numpositivemove;
-  size_t numnegativemove;
-  size_t numnomove;
-  int movedirection;
+  double sumstepsize = 0;
+  double maxabsstepsize = 0;
+  double maxrecordvalue = 0;
+  double minrecordvalue = 0;
+  size_t numpositivemove = 0;
+  size_t numnegativemove = 0;
+  size_t numnomove = 0;
+  int movedirection = 0;
 };
 
 class MANTID_CURVEFITTING_DLL LeBailFit : public API::Algorithm {
diff --git a/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp b/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp
index 6beaae12042..d458a539489 100644
--- a/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp
+++ b/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp
@@ -128,7 +128,8 @@ void CostFuncFitting::calActiveCovarianceMatrix(GSLMatrix &covar,
   // construct the jacobian
   GSLJacobian J(*m_function, m_values->size());
   size_t na = this->nParams(); // number of active parameters
-  assert(J.getJ()->size2 == na);
+  auto j = J.getJ();
+  assert(j->size2 == na);
   covar.resize(na, na);
 
   // calculate the derivatives
diff --git a/Framework/CurveFitting/src/MultiDomainCreator.cpp b/Framework/CurveFitting/src/MultiDomainCreator.cpp
index 977cc3f0e55..6e3f69ff2d8 100644
--- a/Framework/CurveFitting/src/MultiDomainCreator.cpp
+++ b/Framework/CurveFitting/src/MultiDomainCreator.cpp
@@ -15,6 +15,7 @@
 #include "MantidAPI/WorkspaceProperty.h"
 #include "MantidKernel/Logger.h"
 
+#include <memory>
 #include <sstream>
 #include <stdexcept>
 
@@ -46,11 +47,12 @@ void MultiDomainCreator::createDomain(
         "Cannot create JointDomain: number of workspaces does not match "
         "the number of creators");
   }
-  auto jointDomain = new API::JointDomain;
+  auto jointDomain = std::make_unique<API::JointDomain>();
   API::FunctionValues_sptr values;
   i0 = 0;
   for (auto &creator : m_creators) {
     if (!creator) {
+
       throw std::runtime_error("Missing domain creator");
     }
     API::FunctionDomain_sptr domain;
@@ -58,7 +60,7 @@ void MultiDomainCreator::createDomain(
     jointDomain->addDomain(domain);
     i0 += domain->size();
   }
-  domain.reset(jointDomain);
+  domain.reset(jointDomain.release());
   ivalues = values;
 }
 
diff --git a/Framework/CurveFitting/test/Algorithms/FitTest.h b/Framework/CurveFitting/test/Algorithms/FitTest.h
index e0b16441c01..48a3e74d71c 100644
--- a/Framework/CurveFitting/test/Algorithms/FitTest.h
+++ b/Framework/CurveFitting/test/Algorithms/FitTest.h
@@ -1029,7 +1029,6 @@ public:
     TS_ASSERT(alg2.isInitialized());
 
     // create mock data to test against
-    const std::string wsName = "ExpDecayMockData";
     const int histogramNumber = 1;
     const int timechannels = 20;
     Workspace_sptr ws = WorkspaceFactory::Instance().create(
diff --git a/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h b/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h
index c409cc7084e..1977a54d00d 100644
--- a/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h
+++ b/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h
@@ -500,17 +500,9 @@ API::MatrixWorkspace_sptr createInputDataWorkspace(int option) {
       break;
     }
 
-  } else if (option == 4) {
+  } else {
     // Load from column file
     throw runtime_error("Using .dat file is not allowed for committing. ");
-    string datafilename("PG3_4862_Bank7.dat");
-    string wsname("Data");
-    importDataFromColumnFile(datafilename, wsname);
-    dataws = boost::dynamic_pointer_cast<MatrixWorkspace>(
-        AnalysisDataService::Instance().retrieve(wsname));
-  } else {
-    // not supported
-    throw std::invalid_argument("Logic error. ");
   }
 
   return dataws;
diff --git a/Framework/CurveFitting/test/Algorithms/LeBailFunctionTest.h b/Framework/CurveFitting/test/Algorithms/LeBailFunctionTest.h
index cecfffc5b4b..b8b8ab8d8a3 100644
--- a/Framework/CurveFitting/test/Algorithms/LeBailFunctionTest.h
+++ b/Framework/CurveFitting/test/Algorithms/LeBailFunctionTest.h
@@ -216,7 +216,7 @@ public:
          << imax111 << "-th points.\n";
 
     // Calculate diffraction patters
-    auto out = lebailfunction.function(vecX, true, false);
+    lebailfunction.function(vecX, true, false);
     TS_ASSERT_THROWS_ANYTHING(lebailfunction.function(vecX, true, true));
 
     vector<string> vecbkgdparnames(2);
@@ -228,7 +228,7 @@ public:
     lebailfunction.addBackgroundFunction("Polynomial", 2, vecbkgdparnames,
                                          bkgdvec, vecX.front(), vecX.back());
 
-    out = lebailfunction.function(vecX, true, true);
+    auto out = lebailfunction.function(vecX, true, true);
 
     double v1 = out[imax111];
     double v2 = out[imax110];
@@ -441,7 +441,6 @@ public:
       if (line[0] != '#') {
         double x, y;
         std::stringstream ss;
-        std::string dataline(line);
         ss.str(line);
         ss >> x >> y;
         vecX.emplace_back(x);
diff --git a/Framework/CurveFitting/test/Algorithms/PlotPeakByLogValueTest.h b/Framework/CurveFitting/test/Algorithms/PlotPeakByLogValueTest.h
index df033698c0b..5376a94005d 100644
--- a/Framework/CurveFitting/test/Algorithms/PlotPeakByLogValueTest.h
+++ b/Framework/CurveFitting/test/Algorithms/PlotPeakByLogValueTest.h
@@ -625,8 +625,6 @@ private:
     ws->setSharedX(1, ws->sharedX(0));
     ws->setSharedX(2, ws->sharedX(0));
 
-    std::vector<double> amps{20.0, 30.0, 25.0};
-    std::vector<double> cents{0.0, 0.1, -1.0};
     std::vector<double> fwhms{1.0, 1.1, 0.6};
     for (size_t i = 0; i < 3; ++i) {
       std::string fun = "name=FlatBackground,A0=" + std::to_string(fwhms[i]);
diff --git a/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParametersTest.h b/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParametersTest.h
index e77dff704c4..487a1b787c4 100644
--- a/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParametersTest.h
+++ b/Framework/CurveFitting/test/Algorithms/RefinePowderInstrumentParametersTest.h
@@ -462,14 +462,14 @@ public:
     while (ins.getline(line, 256)) {
       if (line[0] != '#') {
         std::string parname;
-        double parvalue, parmin, parmax, parstepsize;
-
+        double parvalue;
         std::stringstream ss;
         ss.str(line);
         ss >> parname >> parvalue;
         parameters.emplace(parname, parvalue);
 
         try {
+          double parmin, parmax, parstepsize;
           ss >> parmin >> parmax >> parstepsize;
           vector<double> mcpars;
           mcpars.emplace_back(parmin);
diff --git a/Framework/CurveFitting/test/FitMWTest.h b/Framework/CurveFitting/test/FitMWTest.h
index 17aff569670..7e170fb5a74 100644
--- a/Framework/CurveFitting/test/FitMWTest.h
+++ b/Framework/CurveFitting/test/FitMWTest.h
@@ -497,8 +497,6 @@ public:
   test_Composite_Function_With_SeparateMembers_Option_On_FitMW_Outputs_Composite_Values_Plus_Each_Member() {
     const bool histogram = true;
     auto ws2 = createTestWorkspace(histogram);
-    const std::string inputWSName = "FitMWTest_CompositeTest";
-    // AnalysisDataService::Instance().add(inputWSName, ws2);
 
     auto composite = boost::make_shared<API::CompositeFunction>();
     API::IFunction_sptr expDecay(new ExpDecay);
diff --git a/Framework/CurveFitting/test/Functions/ComptonPeakProfileTest.h b/Framework/CurveFitting/test/Functions/ComptonPeakProfileTest.h
index 04247920fe6..26dde36728e 100644
--- a/Framework/CurveFitting/test/Functions/ComptonPeakProfileTest.h
+++ b/Framework/CurveFitting/test/Functions/ComptonPeakProfileTest.h
@@ -31,13 +31,13 @@ public:
   void test_initialized_object_has_expected_attributes() {
     auto profile = createFunction();
     static const size_t nattrs(3);
-    const char *expectedAttrs[nattrs] = {"WorkspaceIndex", "Mass",
-                                         "VoigtEnergyCutOff"};
 
     TS_ASSERT_EQUALS(nattrs, profile->nAttributes());
 
     // Test names as they are used in scripts
     if (profile->nAttributes() > 0) {
+      const char *expectedAttrs[nattrs] = {"WorkspaceIndex", "Mass",
+                                           "VoigtEnergyCutOff"};
       std::unordered_set<std::string> expectedAttrSet(expectedAttrs,
                                                       expectedAttrs + nattrs);
       std::vector<std::string> actualNames = profile->getAttributeNames();
diff --git a/Framework/CurveFitting/test/Functions/ComptonProfileTest.h b/Framework/CurveFitting/test/Functions/ComptonProfileTest.h
index 2e4458bacbd..cadb3838c6a 100644
--- a/Framework/CurveFitting/test/Functions/ComptonProfileTest.h
+++ b/Framework/CurveFitting/test/Functions/ComptonProfileTest.h
@@ -30,12 +30,12 @@ public:
   void test_initialized_object_has_expected_parameters() {
     auto profile = createFunction();
     static const size_t nparams(1);
-    const char *expectedParams[nparams] = {"Mass"};
 
     TS_ASSERT_EQUALS(nparams, profile->nParams());
 
     // Test names as they are used in scripts
     if (profile->nParams() > 0) {
+      const char *expectedParams[nparams] = {"Mass"};
       std::unordered_set<std::string> expectedParamStr(
           expectedParams, expectedParams + nparams);
       std::vector<std::string> actualNames = profile->getParameterNames();
diff --git a/Framework/CurveFitting/test/Functions/ConvolutionTest.h b/Framework/CurveFitting/test/Functions/ConvolutionTest.h
index a3c0ecac4f9..22e235d588f 100644
--- a/Framework/CurveFitting/test/Functions/ConvolutionTest.h
+++ b/Framework/CurveFitting/test/Functions/ConvolutionTest.h
@@ -180,8 +180,7 @@ public:
     linear->setParameter(0, 0.1);
     linear->setParameter(1, 0.2);
 
-    size_t iFun = 10000;
-    iFun = conv.addFunction(linear);
+    size_t iFun = conv.addFunction(linear);
     TS_ASSERT_EQUALS(iFun, 0);
     iFun = conv.addFunction(gauss1);
     TS_ASSERT_EQUALS(iFun, 1);
diff --git a/Framework/CurveFitting/test/Functions/GaussianComptonProfileTest.h b/Framework/CurveFitting/test/Functions/GaussianComptonProfileTest.h
index c3e722502b5..805d3b956f9 100644
--- a/Framework/CurveFitting/test/Functions/GaussianComptonProfileTest.h
+++ b/Framework/CurveFitting/test/Functions/GaussianComptonProfileTest.h
@@ -33,12 +33,13 @@ public:
   void test_Initialized_Function_Has_Expected_Parameters_In_Right_Order() {
     Mantid::API::IFunction_sptr profile = createFunction();
     static const size_t nparams(3);
-    const char *expectedParams[nparams] = {"Mass", "Width", "Intensity"};
 
     auto currentNames = profile->getParameterNames();
     const size_t nnames = currentNames.size();
     TS_ASSERT_EQUALS(nparams, nnames);
+
     if (nnames == nparams) {
+      const char *expectedParams[nparams] = {"Mass", "Width", "Intensity"};
       for (size_t i = 0; i < nnames; ++i) {
         TS_ASSERT_EQUALS(expectedParams[i], currentNames[i]);
       }
diff --git a/Framework/CurveFitting/test/Functions/GramCharlierComptonProfileTest.h b/Framework/CurveFitting/test/Functions/GramCharlierComptonProfileTest.h
index 1ca51c7a7ca..5a03d55af9c 100644
--- a/Framework/CurveFitting/test/Functions/GramCharlierComptonProfileTest.h
+++ b/Framework/CurveFitting/test/Functions/GramCharlierComptonProfileTest.h
@@ -152,12 +152,12 @@ private:
 
   void checkDefaultParametersExist(const Mantid::API::IFunction &profile) {
     static const size_t nparams(3);
-    const char *expectedParams[nparams] = {"Mass", "Width", "FSECoeff"};
 
     auto currentNames = profile.getParameterNames();
     const size_t nnames = currentNames.size();
     TS_ASSERT_LESS_THAN_EQUALS(nparams, nnames);
     if (nnames <= nparams) {
+      const char *expectedParams[nparams] = {"Mass", "Width", "FSECoeff"};
       for (size_t i = 0; i < nnames; ++i) {
         TS_ASSERT_EQUALS(expectedParams[i], currentNames[i]);
       }
diff --git a/Framework/CurveFitting/test/Functions/MultivariateGaussianComptonProfileTest.h b/Framework/CurveFitting/test/Functions/MultivariateGaussianComptonProfileTest.h
index 6a05454222e..aa73d35207f 100644
--- a/Framework/CurveFitting/test/Functions/MultivariateGaussianComptonProfileTest.h
+++ b/Framework/CurveFitting/test/Functions/MultivariateGaussianComptonProfileTest.h
@@ -33,12 +33,12 @@ public:
   void test_Initialized_Function_Has_Expected_Parameters_In_Right_Order() {
     Mantid::API::IFunction_sptr profile = createFunction();
     static const size_t nparams(5);
-    const char *expectedParams[nparams] = {"Mass", "Intensity", "SigmaX",
-                                           "SigmaY", "SigmaZ"};
     auto currentNames = profile->getParameterNames();
     const size_t nnames = currentNames.size();
     TS_ASSERT_EQUALS(nparams, nnames);
     if (nnames == nparams) {
+      const char *expectedParams[nparams] = {"Mass", "Intensity", "SigmaX",
+                                             "SigmaY", "SigmaZ"};
       for (size_t i = 0; i < nnames; ++i) {
         TS_ASSERT_EQUALS(expectedParams[i], currentNames[i]);
       }
@@ -48,12 +48,12 @@ public:
   void test_Initialized_Function_Has_Expected_Attributes() {
     Mantid::API::IFunction_sptr profile = createFunction();
     static const size_t nattrs(1);
-    const char *expectedAttrs[nattrs] = {"IntegrationSteps"};
 
     TS_ASSERT_EQUALS(nattrs, profile->nAttributes());
 
     // Test names as they are used in scripts
     if (profile->nAttributes() > 0) {
+      const char *expectedAttrs[nattrs] = {"IntegrationSteps"};
       std::set<std::string> expectedAttrSet(expectedAttrs,
                                             expectedAttrs + nattrs);
       std::vector<std::string> actualNames = profile->getAttributeNames();
diff --git a/Framework/CurveFitting/test/Functions/ProductFunctionTest.h b/Framework/CurveFitting/test/Functions/ProductFunctionTest.h
index b6c4459276e..8596d48dad3 100644
--- a/Framework/CurveFitting/test/Functions/ProductFunctionTest.h
+++ b/Framework/CurveFitting/test/Functions/ProductFunctionTest.h
@@ -116,8 +116,7 @@ public:
     linear->setParameter(0, 0.1);
     linear->setParameter(1, 0.2);
 
-    size_t iFun = 100000;
-    iFun = prodF.addFunction(linear);
+    size_t iFun = prodF.addFunction(linear);
     TS_ASSERT_EQUALS(iFun, 0);
     iFun = prodF.addFunction(gauss1);
     TS_ASSERT_EQUALS(iFun, 1);
diff --git a/Framework/DataHandling/src/FilterEventsByLogValuePreNexus.cpp b/Framework/DataHandling/src/FilterEventsByLogValuePreNexus.cpp
index 813d39664b6..b1ee58199cd 100644
--- a/Framework/DataHandling/src/FilterEventsByLogValuePreNexus.cpp
+++ b/Framework/DataHandling/src/FilterEventsByLogValuePreNexus.cpp
@@ -931,7 +931,6 @@ void FilterEventsByLogValuePreNexus::procEvents(
                       << " threads"
                       << " in " << numBlocks << " blocks. "
                       << "\n";
-
   // cppcheck-suppress syntaxError
     PRAGMA_OMP( parallel for schedule(dynamic, 1) if (m_parallelProcessing) )
     for (int i = 0; i < int(numThreads); i++) {
@@ -955,7 +954,7 @@ void FilterEventsByLogValuePreNexus::procEvents(
       // value = pointer to the events vector
       eventVectors[i] = new EventVector_pt[m_detid_max + 1];
       EventVector_pt *theseEventVectors = eventVectors[i];
-      for (detid_t j = 0; j < m_detid_max + 1; j++) {
+      for (detid_t j = 0; j < m_detid_max + 1; ++j) {
         size_t wi = m_pixelToWkspindex[j];
         // Save a POINTER to the vector<tofEvent>
         theseEventVectors[j] = &partWS->getSpectrum(wi).getEvents();
@@ -1134,15 +1133,13 @@ void FilterEventsByLogValuePreNexus::procEventsLinear(
                 << m_maxNumEvents << "\n";
   maxeventid = m_maxNumEvents + 1;
 
-  size_t numbadeventindex = 0;
-
   int numeventswritten = 0;
 
   // Declare local statistic parameters
   size_t local_numErrorEvents = 0;
   size_t local_numBadEvents = 0;
-  size_t local_numWrongdetidEvents = 0;
   size_t local_numIgnoredEvents = 0;
+  size_t local_numWrongdetidEvents = 0;
   size_t local_numGoodEvents = 0;
   double local_m_shortestTof =
       static_cast<double>(MAX_TOF_UINT32) * TOF_CONVERSION;
@@ -1162,8 +1159,6 @@ void FilterEventsByLogValuePreNexus::procEventsLinear(
   int64_t i_pulse = 0;
 
   for (size_t ievent = 0; ievent < current_event_buffer_size; ++ievent) {
-    bool iswrongdetid = false;
-
     // Load DasEvent
     DasEvent &tempevent = *(event_buffer + ievent);
 
@@ -1187,6 +1182,7 @@ void FilterEventsByLogValuePreNexus::procEventsLinear(
         pixelid = this->m_pixelmap[unmapped_pid];
       }
 
+      bool iswrongdetid = false;
       // Check special/wrong pixel IDs against max Detector ID
       if (pixelid > static_cast<PixelType>(m_detid_max)) {
         // Record the wrong/special ID
@@ -1368,12 +1364,6 @@ void FilterEventsByLogValuePreNexus::procEventsLinear(
     if (local_m_longestTof > m_longestTof)
       m_longestTof = local_m_longestTof;
   }
-
-  if (numbadeventindex > 0) {
-    g_log.notice() << "Single block: Encountered " << numbadeventindex
-                   << " bad event indexes"
-                   << "\n";
-  }
 }
 
 //----------------------------------------------------------------------------------------------
@@ -1559,7 +1549,7 @@ void FilterEventsByLogValuePreNexus::filterEvents() {
       // value = pointer to the events vector
       eventVectors[i] = new EventVector_pt[m_detid_max + 1];
       EventVector_pt *theseEventVectors = eventVectors[i];
-      for (detid_t j = 0; j < m_detid_max + 1; j++) {
+      for (detid_t j = 0; j < m_detid_max + 1; ++j) {
         size_t wi = m_pixelToWkspindex[j];
         // Save a POINTER to the vector<tofEvent>
         if (wi != static_cast<size_t>(-1))
@@ -1738,8 +1728,6 @@ void FilterEventsByLogValuePreNexus::filterEventsLinear(
                  << m_maxNumEvents << "\n";
   maxeventid = m_maxNumEvents + 1;
 
-  size_t numbadeventindex = 0;
-
   // Declare local statistic parameters
   size_t local_numErrorEvents = 0;
   size_t local_numBadEvents = 0;
@@ -1825,8 +1813,6 @@ void FilterEventsByLogValuePreNexus::filterEventsLinear(
   g_log.notice() << "[DB] L1 = " << l1 << "\n";
 
   for (size_t ievent = 0; ievent < current_event_buffer_size; ++ievent) {
-    bool iswrongdetid = false;
-    bool islogevent = false;
 
     // Load DasEvent
     DasEvent &tempevent = *(event_buffer + ievent);
@@ -1841,6 +1827,9 @@ void FilterEventsByLogValuePreNexus::filterEventsLinear(
       local_numBadEvents++;
       continue;
     } else {
+      bool islogevent = false;
+      bool iswrongdetid = false;
+
       // Covert DAS Pixel ID to Mantid Pixel ID
       if (pixelid == 1073741843) {
         // downstream monitor pixel for SNAP
@@ -2108,8 +2097,6 @@ void FilterEventsByLogValuePreNexus::filterEventsLinear(
       m_longestTof = local_m_longestTof;
   }
 
-  g_log.notice() << "Encountered " << numbadeventindex << " bad event indexes"
-                 << "\n";
 } // FilterEventsLinearly
 
 //----------------------------------------------------------------------------------------------
@@ -2369,8 +2356,6 @@ void FilterEventsByLogValuePreNexus::readPulseidFile(
     }
   }
 
-  double temp;
-
   if (m_numPulses > 0) {
     DateAndTime lastPulseDateTime(0, 0);
     this->pulsetimes.reserve(m_numPulses);
@@ -2385,7 +2370,7 @@ void FilterEventsByLogValuePreNexus::readPulseidFile(
       else
         lastPulseDateTime = pulseDateTime;
 
-      temp = pulse.pCurrent;
+      double temp = pulse.pCurrent;
       this->m_protonCharge.emplace_back(temp);
       if (temp < 0.)
         this->g_log.warning("Individual proton charge < 0 being ignored");
diff --git a/Framework/DataHandling/src/GroupDetectors2.cpp b/Framework/DataHandling/src/GroupDetectors2.cpp
index 573a4c4d4e0..85655ee45d9 100644
--- a/Framework/DataHandling/src/GroupDetectors2.cpp
+++ b/Framework/DataHandling/src/GroupDetectors2.cpp
@@ -646,7 +646,6 @@ void GroupDetectors2::processGroupingWorkspace(
     size_t groupid = static_cast<int>(groupWS->y(i)[0]);
     // group 0 is are unused spectra - don't process them
     if (groupid > 0) {
-      // cppcheck-suppress stlFindInsert
       if (group2WSIndexSetmap.find(groupid) == group2WSIndexSetmap.end()) {
         // not found - create an empty set
         group2WSIndexSetmap.emplace(groupid, std::set<size_t>());
@@ -697,8 +696,6 @@ void GroupDetectors2::processMatrixWorkspace(
   for (size_t i = 0; i < spectrumInfo.size(); ++i) {
     // read spectra from groupingws
     size_t groupid = i;
-
-    // cppcheck-suppress stlFindInsert
     if (group2WSIndexSetmap.find(groupid) == group2WSIndexSetmap.end()) {
       // not found - create an empty set
       group2WSIndexSetmap.emplace(groupid, std::set<size_t>());
diff --git a/Framework/DataHandling/src/LoadEMU.cpp b/Framework/DataHandling/src/LoadEMU.cpp
index 99f65416e83..24443dec1cb 100644
--- a/Framework/DataHandling/src/LoadEMU.cpp
+++ b/Framework/DataHandling/src/LoadEMU.cpp
@@ -690,7 +690,7 @@ void LoadEMU<FD>::exec(const std::string &hdfFile,
   //
   double sampleAnalyser = iparam("SampleAnalyser");
   auto endID = static_cast<detid_t>(DETECTOR_TUBES * PIXELS_PER_TUBE);
-  for (detid_t detID = 0; detID < endID; detID++)
+  for (detid_t detID = 0; detID < endID; ++detID)
     updateNeutronicPostions(detID, sampleAnalyser);
 
   // get the detector map from raw input to a physical detector
diff --git a/Framework/DataHandling/src/LoadEventPreNexus2.cpp b/Framework/DataHandling/src/LoadEventPreNexus2.cpp
index 09bca136ffd..447ae3efef5 100644
--- a/Framework/DataHandling/src/LoadEventPreNexus2.cpp
+++ b/Framework/DataHandling/src/LoadEventPreNexus2.cpp
@@ -758,7 +758,6 @@ void LoadEventPreNexus2::procEvents(
   partWorkspaces.resize(numThreads);
   buffers.resize(numThreads);
   eventVectors = new EventVector_pt *[numThreads];
-
   // cppcheck-suppress syntaxError
     PRAGMA_OMP( parallel for if (parallelProcessing) )
     for (int i = 0; i < int(numThreads); i++) {
@@ -781,7 +780,7 @@ void LoadEventPreNexus2::procEvents(
       // value = pointer to the events vector
       eventVectors[i] = new EventVector_pt[detid_max + 1];
       EventVector_pt *theseEventVectors = eventVectors[i];
-      for (detid_t j = 0; j < detid_max + 1; j++) {
+      for (detid_t j = 0; j < detid_max + 1; ++j) {
         size_t wi = pixel_to_wkspindex[j];
         // Save a POINTER to the vector<tofEvent>
         if (wi != static_cast<size_t>(-1))
@@ -1323,7 +1322,6 @@ void LoadEventPreNexus2::readPulseidFile(const std::string &filename,
   }
 
   if (num_pulses > 0) {
-    double temp;
     DateAndTime lastPulseDateTime(0, 0);
     this->pulsetimes.reserve(num_pulses);
     for (const auto &pulse : pulses) {
@@ -1337,7 +1335,7 @@ void LoadEventPreNexus2::readPulseidFile(const std::string &filename,
       else
         lastPulseDateTime = pulseDateTime;
 
-      temp = pulse.pCurrent;
+      double temp = pulse.pCurrent;
       this->proton_charge.emplace_back(temp);
       if (temp < 0.)
         this->g_log.warning("Individual proton charge < 0 being ignored");
diff --git a/Framework/DataHandling/src/LoadGSASInstrumentFile.cpp b/Framework/DataHandling/src/LoadGSASInstrumentFile.cpp
index c72b0bda3f2..e5174ebb212 100644
--- a/Framework/DataHandling/src/LoadGSASInstrumentFile.cpp
+++ b/Framework/DataHandling/src/LoadGSASInstrumentFile.cpp
@@ -255,7 +255,7 @@ LoadGSASInstrumentFile::getHistogramType(const vector<string> &lines) {
   // We assume there is just one HTYPE line, look for it from beginning and
   // return its value.
   std::string lookFor = "INS   HTYPE";
-  for (size_t i = 0; i <= lines.size(); ++i) {
+  for (size_t i = 0; i < lines.size(); ++i) {
     if (lines[i].substr(0, lookFor.size()) == lookFor) {
       if (lines[i].size() < lookFor.size() + 7) {
         // line too short
@@ -275,7 +275,7 @@ size_t LoadGSASInstrumentFile::getNumberOfBanks(const vector<string> &lines) {
   // We assume there is just one BANK line, look for it from beginning and
   // return its value.
   std::string lookFor = "INS   BANK";
-  for (size_t i = 0; i <= lines.size(); ++i) {
+  for (size_t i = 0; i < lines.size(); ++i) {
     if (lines[i].substr(0, lookFor.size()) == lookFor) {
       if (lines[i].size() < lookFor.size() + 3) {
         // line too short
diff --git a/Framework/DataHandling/src/LoadNXSPE.cpp b/Framework/DataHandling/src/LoadNXSPE.cpp
index 3835e25d6ad..d574160974e 100644
--- a/Framework/DataHandling/src/LoadNXSPE.cpp
+++ b/Framework/DataHandling/src/LoadNXSPE.cpp
@@ -353,10 +353,13 @@ void LoadNXSPE::exec() {
 
 boost::shared_ptr<Geometry::CSGObject>
 LoadNXSPE::createCuboid(double dx, double dy, double dz) {
+  UNUSED_ARG(dx)
+  UNUSED_ARG(dy)
+  UNUSED_ARG(dz)
 
-  dx = 0.5 * std::fabs(dx);
-  dy = 0.5 * std::fabs(dy);
-  dz = 0.5 * std::fabs(dz);
+  // dx = 0.5 * std::fabs(dx);
+  // dy = 0.5 * std::fabs(dy);
+  // dz = 0.5 * std::fabs(dz);
   /*
    std::stringstream planeName;
 
diff --git a/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp b/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp
index 5efadb955db..d1d6d36bc5c 100644
--- a/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp
+++ b/Framework/DataHandling/src/LoadSpiceXML2DDet.cpp
@@ -1076,9 +1076,7 @@ void LoadSpiceXML2DDet::loadInstrument(API::MatrixWorkspace_sptr matrixws,
   loadinst->setProperty("RewriteSpectraMap",
                         Mantid::Kernel::OptionalBool(true));
   loadinst->execute();
-  if (loadinst->isExecuted())
-    matrixws = loadinst->getProperty("Workspace");
-  else
+  if (!loadinst->isExecuted())
     g_log.error("Unable to load instrument to output workspace");
 }
 
diff --git a/Framework/DataHandling/src/ProcessBankData.cpp b/Framework/DataHandling/src/ProcessBankData.cpp
index c75481df46e..120fcf64bec 100644
--- a/Framework/DataHandling/src/ProcessBankData.cpp
+++ b/Framework/DataHandling/src/ProcessBankData.cpp
@@ -92,7 +92,7 @@ void ProcessBankData::run() { // override {
     // Now we pre-allocate (reserve) the vectors of events in each pixel
     // counted
     const size_t numEventLists = outputWS.getNumberHistograms();
-    for (detid_t pixID = m_min_id; pixID <= m_max_id; pixID++) {
+    for (detid_t pixID = m_min_id; pixID <= m_max_id; ++pixID) {
       if (counts[pixID - m_min_id] > 0) {
         size_t wi = getWorkspaceIndexFromPixelID(pixID);
         // Find the the workspace index corresponding to that pixel ID
@@ -224,7 +224,7 @@ void ProcessBankData::run() { // override {
   //------------ Compress Events (or set sort order) ------------------
   // Do it on all the detector IDs we touched
   if (compress) {
-    for (detid_t pixID = m_min_id; pixID <= m_max_id; pixID++) {
+    for (detid_t pixID = m_min_id; pixID <= m_max_id; ++pixID) {
       if (usedDetIds[pixID - m_min_id]) {
         // Find the the workspace index corresponding to that pixel ID
         size_t wi = getWorkspaceIndexFromPixelID(pixID);
diff --git a/Framework/DataHandling/src/ReadMaterial.cpp b/Framework/DataHandling/src/ReadMaterial.cpp
index 3a3543c8387..b65fb49728f 100644
--- a/Framework/DataHandling/src/ReadMaterial.cpp
+++ b/Framework/DataHandling/src/ReadMaterial.cpp
@@ -79,8 +79,6 @@ ReadMaterial::validateInputs(const MaterialParameters &params) {
     if (canCalculateMassDensity) {
       result["SampleMassDensity"] =
           "Cannot give SampleMassDensity with SampleNumberDensity set";
-      result["SampleMassDensity"] =
-          "Cannot give SampleMassDensity with SampleNumberDensity set";
     }
   }
   return result;
diff --git a/Framework/DataHandling/src/SaveDiffCal.cpp b/Framework/DataHandling/src/SaveDiffCal.cpp
index e97d3afb9b1..1911d8a1889 100644
--- a/Framework/DataHandling/src/SaveDiffCal.cpp
+++ b/Framework/DataHandling/src/SaveDiffCal.cpp
@@ -107,6 +107,7 @@ std::map<std::string, std::string> SaveDiffCal::validateInputs() {
 void SaveDiffCal::writeDoubleFieldFromTable(H5::Group &group,
                                             const std::string &name) {
   auto column = m_calibrationWS->getColumn(name);
+  // cppcheck-suppress compareBoolExpressionWithInt
   auto data = column->numeric_fill<>(m_numValues);
   H5Util::writeArray1D(group, name, data);
 }
diff --git a/Framework/DataHandling/src/SaveDspacemap.cpp b/Framework/DataHandling/src/SaveDspacemap.cpp
index f52b3a59d44..aec81df6109 100644
--- a/Framework/DataHandling/src/SaveDspacemap.cpp
+++ b/Framework/DataHandling/src/SaveDspacemap.cpp
@@ -87,7 +87,7 @@ void SaveDspacemap::CalculateDspaceFromCal(
   std::ofstream fout(filename, std::ios_base::out | std::ios_base::binary);
   Progress prog(this, 0.0, 1.0, maxdetID);
 
-  for (detid_t i = 0; i != maxdetID; i++) {
+  for (detid_t i = 0; i != maxdetID; ++i) {
     // Compute the factor
     double factor;
     Geometry::IDetector_const_sptr det;
diff --git a/Framework/DataHandling/src/SaveGSASInstrumentFile.cpp b/Framework/DataHandling/src/SaveGSASInstrumentFile.cpp
index 7e69abfc123..940ca4ab246 100644
--- a/Framework/DataHandling/src/SaveGSASInstrumentFile.cpp
+++ b/Framework/DataHandling/src/SaveGSASInstrumentFile.cpp
@@ -896,74 +896,74 @@ void SaveGSASInstrumentFile::writePRMSingleBank(
     throw runtime_error(errss.str());
   }
 
-  fprintf(pFile, "INS %2d ICONS%10.3f%10.3f%10.3f          %10.3f%5d%10.3f\n",
+  fprintf(pFile, "INS %2u ICONS%10.3f%10.3f%10.3f          %10.3f%5d%10.3f\n",
           bankid, instC * 1.00009, 0.0, zero, 0.0, 0, 0.0);
-  fprintf(pFile, "INS %2dBNKPAR%10.3f%10.3f%10.3f%10.3f%10.3f%5d%5d\n", bankid,
+  fprintf(pFile, "INS %2uBNKPAR%10.3f%10.3f%10.3f%10.3f%10.3f%5d%5d\n", bankid,
           m_L2, twotheta, 0., 0., 0.2, 1, 1);
 
-  fprintf(pFile, "INS %2dBAKGD     1    4    Y    0    Y\n", bankid);
-  fprintf(pFile, "INS %2dI HEAD %s\n", bankid, titleline.c_str());
-  fprintf(pFile, "INS %2dI ITYP%5d%10.4f%10.4f%10i\n", bankid, 0,
+  fprintf(pFile, "INS %2uBAKGD     1    4    Y    0    Y\n", bankid);
+  fprintf(pFile, "INS %2uI HEAD %s\n", bankid, titleline.c_str());
+  fprintf(pFile, "INS %2uI ITYP%5d%10.4f%10.4f%10i\n", bankid, 0,
           mindsp * 0.001 * instC, maxtof, randint);
-  fprintf(pFile, "INS %2dINAME   %s \n", bankid, m_instrument.c_str());
-  fprintf(pFile, "INS %2dPRCF1 %5d%5d%10.5f\n", bankid, -3, 21, 0.002);
-  fprintf(pFile, "INS %2dPRCF11%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
+  fprintf(pFile, "INS %2uINAME   %s \n", bankid, m_instrument.c_str());
+  fprintf(pFile, "INS %2uPRCF1 %5d%5d%10.5f\n", bankid, -3, 21, 0.002);
+  fprintf(pFile, "INS %2uPRCF11%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
           0.0, sig0);
-  fprintf(pFile, "INS %2dPRCF12%15.6f%15.6f%15.6f%15.6f\n", bankid, sig1, sig2,
+  fprintf(pFile, "INS %2uPRCF12%15.6f%15.6f%15.6f%15.6f\n", bankid, sig1, sig2,
           gam0, gam1);
-  fprintf(pFile, "INS %2dPRCF13%15.6f%15.6f%15.6f%15.6f\n", bankid, gam2, 0.0,
+  fprintf(pFile, "INS %2uPRCF13%15.6f%15.6f%15.6f%15.6f\n", bankid, gam2, 0.0,
           0.0, 0.0);
-  fprintf(pFile, "INS %2dPRCF14%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
+  fprintf(pFile, "INS %2uPRCF14%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
           0.0, 0.0);
-  fprintf(pFile, "INS %2dPRCF15%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
+  fprintf(pFile, "INS %2uPRCF15%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
           0.0, 0.0);
-  fprintf(pFile, "INS %2dPRCF16%15.6f\n", bankid, 0.0);
-  fprintf(pFile, "INS %2dPAB3    %3d\n", bankid, 90);
+  fprintf(pFile, "INS %2uPRCF16%15.6f\n", bankid, 0.0);
+  fprintf(pFile, "INS %2uPAB3    %3d\n", bankid, 90);
 
   for (size_t k = 0; k < 90; ++k) {
-    fprintf(pFile, "INS %2dPAB3%2d%10.5f%10.5f%10.5f%10.5f\n", bankid,
+    fprintf(pFile, "INS %2uPAB3%2d%10.5f%10.5f%10.5f%10.5f\n", bankid,
             static_cast<int>(k) + 1, m_gdsp[k], m_gdt[k], m_galpha[k],
             m_gbeta[k]);
   }
-  fprintf(pFile, "INS %2dPRCF2 %5i%5i%10.5f\n", bankid, -4, 27, 0.002);
-  fprintf(pFile, "INS %2dPRCF21%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
+  fprintf(pFile, "INS %2uPRCF2 %5i%5i%10.5f\n", bankid, -4, 27, 0.002);
+  fprintf(pFile, "INS %2uPRCF21%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
           0.0, sig1);
-  fprintf(pFile, "INS %2dPRCF22%15.6f%15.6f%15.6f%15.6f\n", bankid, sig2, gam2,
+  fprintf(pFile, "INS %2uPRCF22%15.6f%15.6f%15.6f%15.6f\n", bankid, sig2, gam2,
           0.0, 0.0);
-  fprintf(pFile, "INS %2dPRCF23%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
+  fprintf(pFile, "INS %2uPRCF23%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
           0.0, 0.0);
-  fprintf(pFile, "INS %2dPRCF24%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
+  fprintf(pFile, "INS %2uPRCF24%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
           0.0, 0.0);
-  fprintf(pFile, "INS %2dPRCF25%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
+  fprintf(pFile, "INS %2uPRCF25%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
           0.0, 0.0);
-  fprintf(pFile, "INS %2dPRCF26%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
+  fprintf(pFile, "INS %2uPRCF26%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
           0.0, 0.0);
-  fprintf(pFile, "INS %2dPRCF27%15.6f%15.6f%15.6f \n", bankid, 0.0, 0.0, 0.0);
+  fprintf(pFile, "INS %2uPRCF27%15.6f%15.6f%15.6f \n", bankid, 0.0, 0.0, 0.0);
 
-  fprintf(pFile, "INS %2dPAB4    %3i\n", bankid, 90);
+  fprintf(pFile, "INS %2uPAB4    %3i\n", bankid, 90);
   for (size_t k = 0; k < 90; ++k) {
-    fprintf(pFile, "INS %2dPAB4%2d%10.5f%10.5f%10.5f%10.5f\n", bankid,
+    fprintf(pFile, "INS %2uPAB4%2d%10.5f%10.5f%10.5f%10.5f\n", bankid,
             static_cast<int>(k) + 1, m_gdsp[k], m_gdt[k], m_galpha[k],
             m_gbeta[k]);
   }
 
-  fprintf(pFile, "INS %2dPRCF3 %5i%5i%10.5f\n", bankid, -5, 21, 0.002);
-  fprintf(pFile, "INS %2dPRCF31%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
+  fprintf(pFile, "INS %2uPRCF3 %5i%5i%10.5f\n", bankid, -5, 21, 0.002);
+  fprintf(pFile, "INS %2uPRCF31%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
           0.0, sig0);
-  fprintf(pFile, "INS %2dPRCF32%15.6f%15.6f%15.6f%15.6f\n", bankid, sig1, sig2,
+  fprintf(pFile, "INS %2uPRCF32%15.6f%15.6f%15.6f%15.6f\n", bankid, sig1, sig2,
           gam0, gam1);
-  fprintf(pFile, "INS %2dPRCF33%15.6f%15.6f%15.6f%15.6f\n", bankid, gam2, 0.0,
+  fprintf(pFile, "INS %2uPRCF33%15.6f%15.6f%15.6f%15.6f\n", bankid, gam2, 0.0,
           0.0, 0.0);
-  fprintf(pFile, "INS %2dPRCF34%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
+  fprintf(pFile, "INS %2uPRCF34%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
           0.0, 0.0);
-  fprintf(pFile, "INS %2dPRCF35%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
+  fprintf(pFile, "INS %2uPRCF35%15.6f%15.6f%15.6f%15.6f\n", bankid, 0.0, 0.0,
           0.0, 0.0);
-  fprintf(pFile, "INS %2dPRCF36%15.6f\n", bankid, 0.0);
+  fprintf(pFile, "INS %2uPRCF36%15.6f\n", bankid, 0.0);
 
-  fprintf(pFile, "INS %2dPAB5    %3i\n", bankid,
+  fprintf(pFile, "INS %2uPAB5    %3i\n", bankid,
           90); // 90 means there will be 90 lines of table
   for (size_t k = 0; k < 90; k++) {
-    fprintf(pFile, "INS %2dPAB5%2d%10.5f%10.5f%10.5f%10.5f\n", bankid,
+    fprintf(pFile, "INS %2uPAB5%2d%10.5f%10.5f%10.5f%10.5f\n", bankid,
             static_cast<int>(k) + 1, m_gdsp[k], m_gdt[k], m_galpha[k],
             m_gbeta[k]);
   }
diff --git a/Framework/DataHandling/test/CheckMantidVersionTest.h b/Framework/DataHandling/test/CheckMantidVersionTest.h
index a7478201a77..085fa054352 100644
--- a/Framework/DataHandling/test/CheckMantidVersionTest.h
+++ b/Framework/DataHandling/test/CheckMantidVersionTest.h
@@ -119,8 +119,7 @@ public:
 
     std::string currentVersion =
         alg.PropertyManagerOwner::getProperty("CurrentVersion");
-    std::string mostRecentVersion =
-        alg.PropertyManagerOwner::getProperty("MostRecentVersion");
+    alg.PropertyManagerOwner::getProperty("MostRecentVersion");
     bool isNewVersionAvailable =
         alg.PropertyManagerOwner::getProperty("IsNewVersionAvailable");
 
diff --git a/Framework/DataHandling/test/CreateSimulationWorkspaceTest.h b/Framework/DataHandling/test/CreateSimulationWorkspaceTest.h
index 35f68d49ddc..f523688c52b 100644
--- a/Framework/DataHandling/test/CreateSimulationWorkspaceTest.h
+++ b/Framework/DataHandling/test/CreateSimulationWorkspaceTest.h
@@ -235,10 +235,6 @@ private:
 class CreateSimulationWorkspaceTestPerformance : public CxxTest::TestSuite {
 public:
   void setUp() override {
-
-    // Starting bin, bin width, last bin
-    const std::string binParams("-30,3,279");
-
     alg.initialize();
 
     alg.setPropertyValue("Instrument", "HET");
diff --git a/Framework/DataHandling/test/DownloadInstrumentTest.h b/Framework/DataHandling/test/DownloadInstrumentTest.h
index e8bea923d84..5572bb93725 100644
--- a/Framework/DataHandling/test/DownloadInstrumentTest.h
+++ b/Framework/DataHandling/test/DownloadInstrumentTest.h
@@ -190,9 +190,6 @@ public:
   }
 
   int runDownloadInstrument() {
-    // Name of the output workspace.
-    std::string outWSName("DownloadInstrumentTest_OutputWS");
-
     MockedDownloadInstrument alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
diff --git a/Framework/DataHandling/test/GroupDetectors2Test.h b/Framework/DataHandling/test/GroupDetectors2Test.h
index 9143e2e5ee8..d97897e4d44 100644
--- a/Framework/DataHandling/test/GroupDetectors2Test.h
+++ b/Framework/DataHandling/test/GroupDetectors2Test.h
@@ -560,21 +560,21 @@ public:
     TS_ASSERT_EQUALS(*specDet, 2);
     specDet = output2D1->getSpectrum(2).getDetectorIDs().begin();
     TS_ASSERT_EQUALS(*specDet, 3);
-    specDet++;
+    ++specDet;
     TS_ASSERT_EQUALS(*specDet, 4);
-    specDet++;
+    ++specDet;
     TS_ASSERT_EQUALS(*specDet, 5);
     specDet = output2D1->getSpectrum(3).getDetectorIDs().begin();
     TS_ASSERT_EQUALS(*specDet, 2);
-    specDet++;
+    ++specDet;
     TS_ASSERT_EQUALS(*specDet, 8);
-    specDet++;
+    ++specDet;
     TS_ASSERT_EQUALS(*specDet, 9);
-    specDet++;
+    ++specDet;
     TS_ASSERT_EQUALS(*specDet, 11);
-    specDet++;
+    ++specDet;
     TS_ASSERT_EQUALS(*specDet, 12);
-    specDet++;
+    ++specDet;
     TS_ASSERT_EQUALS(*specDet, 13);
 
     AnalysisDataService::Instance().remove(outputSpace);
@@ -631,6 +631,7 @@ public:
     const auto &y = output->y(0);
     const auto &e = output->e(0);
     for (size_t i = 0; i < y.size(); ++i) {
+      // cppcheck-suppress unreadVariable
       const double expectedSignal = i == 0 ? 2. : (1. + 2.) / 2.;
       TS_ASSERT_EQUALS(y[i], expectedSignal)
       const double expectedError = i == 0 ? 1. : std::sqrt(2.) / 2.;
@@ -659,6 +660,7 @@ public:
     const auto &y = output->y(0);
     const auto &e = output->e(0);
     for (size_t i = 0; i < y.size(); ++i) {
+      // cppcheck-suppress unreadVariable
       const double expectedSignal = i == 0 ? 2. : 1. + 2.;
       TS_ASSERT_EQUALS(y[i], expectedSignal)
       const double expectedError = i == 0 ? 1. : std::sqrt(2.);
@@ -1122,7 +1124,7 @@ private:
     }
 
     Instrument_sptr instr(new Instrument);
-    for (detid_t i = 0; i < NHIST; i++) {
+    for (detid_t i = 0; i < NHIST; ++i) {
       Detector *d = new Detector("det", i, nullptr);
       d->setPos(1. + static_cast<double>(i) * 0.1, 0., 1.);
       instr->add(d);
diff --git a/Framework/DataHandling/test/GroupDetectorsTest.h b/Framework/DataHandling/test/GroupDetectorsTest.h
index 62d438f6607..47ff0be4fca 100644
--- a/Framework/DataHandling/test/GroupDetectorsTest.h
+++ b/Framework/DataHandling/test/GroupDetectorsTest.h
@@ -52,7 +52,7 @@ public:
       space2D->getSpectrum(j).setDetectorID(j);
     }
     Instrument_sptr instr(new Instrument);
-    for (detid_t i = 0; i < 5; i++) {
+    for (detid_t i = 0; i < 5; ++i) {
       Detector *d = new Detector("det", i, nullptr);
       instr->add(d);
       instr->markAsDetector(d);
diff --git a/Framework/DataHandling/test/InstrumentRayTracerTest.h b/Framework/DataHandling/test/InstrumentRayTracerTest.h
index f20863bd0f4..7ec49b9084a 100644
--- a/Framework/DataHandling/test/InstrumentRayTracerTest.h
+++ b/Framework/DataHandling/test/InstrumentRayTracerTest.h
@@ -100,7 +100,7 @@ public:
 private:
   void showResults(Links &results, const Instrument_const_sptr &inst) {
     Links::const_iterator resultItr = results.begin();
-    for (; resultItr != results.end(); resultItr++) {
+    for (; resultItr != results.end(); ++resultItr) {
       IComponent_const_sptr component =
           inst->getComponentByID(resultItr->componentID);
       std::cout << component->getName() << ", ";
diff --git a/Framework/DataHandling/test/LoadDspacemapTest.h b/Framework/DataHandling/test/LoadDspacemapTest.h
index f8c2843d60d..c6b72d53cd1 100644
--- a/Framework/DataHandling/test/LoadDspacemapTest.h
+++ b/Framework/DataHandling/test/LoadDspacemapTest.h
@@ -60,8 +60,6 @@ public:
 
   void doTestVulcan(const std::string &dspaceFile,
                     const std::string &fileType) {
-    std::string outputFile = "./VULCAN_dspacemaptocal_test.cal";
-
     LoadDspacemap testerDSP;
     TS_ASSERT_THROWS_NOTHING(testerDSP.initialize());
     TS_ASSERT_THROWS_NOTHING(testerDSP.isInitialized());
diff --git a/Framework/DataHandling/test/LoadILLReflectometryTest.h b/Framework/DataHandling/test/LoadILLReflectometryTest.h
index ee41277b477..e282244fd77 100644
--- a/Framework/DataHandling/test/LoadILLReflectometryTest.h
+++ b/Framework/DataHandling/test/LoadILLReflectometryTest.h
@@ -696,10 +696,12 @@ public:
     auto instrument = output->getInstrument();
     auto slit1 = instrument->getComponentByName("slit2");
     auto slit2 = instrument->getComponentByName("slit3");
+    // cppcheck-suppress unreadVariable
     const double S2z =
         -output->run().getPropertyValueAsType<double>("Distance.S2toSample") *
         1e-3;
     TS_ASSERT_EQUALS(slit1->getPos(), V3D(0.0, 0.0, S2z))
+    // cppcheck-suppress unreadVariable
     const double S3z =
         -output->run().getPropertyValueAsType<double>("Distance.S3toSample") *
         1e-3;
diff --git a/Framework/DataHandling/test/LoadMappingTableTest.h b/Framework/DataHandling/test/LoadMappingTableTest.h
index 7c1fa34fb1e..9459270a3e8 100644
--- a/Framework/DataHandling/test/LoadMappingTableTest.h
+++ b/Framework/DataHandling/test/LoadMappingTableTest.h
@@ -80,7 +80,7 @@ public:
     detectorgroup = work1->getSpectrum(2083).getDetectorIDs();
     std::set<detid_t>::const_iterator it;
     int pixnum = 101191;
-    for (it = detectorgroup.begin(); it != detectorgroup.end(); it++)
+    for (it = detectorgroup.begin(); it != detectorgroup.end(); ++it)
       TS_ASSERT_EQUALS(*it, pixnum++);
 
     AnalysisDataService::Instance().remove(outputSpace);
diff --git a/Framework/DataHandling/test/LoadNexusLogsTest.h b/Framework/DataHandling/test/LoadNexusLogsTest.h
index 579a1a79d20..85aa8487e0e 100644
--- a/Framework/DataHandling/test/LoadNexusLogsTest.h
+++ b/Framework/DataHandling/test/LoadNexusLogsTest.h
@@ -272,7 +272,6 @@ public:
 
   void test_last_time_series_log_entry_equals_end_time() {
     LoadNexusLogs ld;
-    std::string outws_name = "REF_L_instrument";
     ld.initialize();
     ld.setPropertyValue("Filename", "REF_L_32035.nxs");
     MatrixWorkspace_sptr ws = createTestWorkspace();
diff --git a/Framework/DataHandling/test/LoadRaw3Test.h b/Framework/DataHandling/test/LoadRaw3Test.h
index 1918a73af95..19f298d7286 100644
--- a/Framework/DataHandling/test/LoadRaw3Test.h
+++ b/Framework/DataHandling/test/LoadRaw3Test.h
@@ -153,7 +153,7 @@ public:
     detectorgroup = output2D->getSpectrum(2083).getDetectorIDs();
     std::set<detid_t>::const_iterator it;
     int pixnum = 101191;
-    for (it = detectorgroup.begin(); it != detectorgroup.end(); it++)
+    for (it = detectorgroup.begin(); it != detectorgroup.end(); ++it)
       TS_ASSERT_EQUALS(*it, pixnum++);
 
     AnalysisDataService::Instance().remove(outputSpace);
@@ -375,7 +375,7 @@ public:
     wsNamevec = sptrWSGrp->getNames();
     int period = 1;
     std::vector<std::string>::const_iterator it = wsNamevec.begin();
-    for (; it != wsNamevec.end(); it++) {
+    for (; it != wsNamevec.end(); ++it) {
       std::stringstream count;
       count << period;
       std::string wsName = "multiperiod_" + count.str();
@@ -385,7 +385,7 @@ public:
     std::vector<std::string>::const_iterator itr1 = wsNamevec.begin();
     int periodNumber = 0;
     const int nHistograms = 4;
-    for (; itr1 != wsNamevec.end(); itr1++) {
+    for (; itr1 != wsNamevec.end(); ++itr1) {
       MatrixWorkspace_sptr outsptr;
       TS_ASSERT_THROWS_NOTHING(
           outsptr = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
@@ -581,7 +581,7 @@ public:
     detectorgroup = output2D->getSpectrum(2079).getDetectorIDs();
     std::set<detid_t>::const_iterator it;
     int pixnum = 101191;
-    for (it = detectorgroup.begin(); it != detectorgroup.end(); it++)
+    for (it = detectorgroup.begin(); it != detectorgroup.end(); ++it)
       TS_ASSERT_EQUALS(*it, pixnum++);
 
     // Test if filename log is found in both monitor and sata workspace
@@ -626,7 +626,7 @@ public:
         monitorsptrWSGrp->getNames();
     int period = 1;
     std::vector<std::string>::const_iterator it = monitorwsNamevec.begin();
-    for (; it != monitorwsNamevec.end(); it++) {
+    for (; it != monitorwsNamevec.end(); ++it) {
       std::stringstream count;
       count << period;
       std::string wsName = "multiperiod_monitors_" + count.str();
@@ -634,7 +634,7 @@ public:
       period++;
     }
     std::vector<std::string>::const_iterator itr1 = monitorwsNamevec.begin();
-    for (; itr1 != monitorwsNamevec.end(); itr1++) {
+    for (; itr1 != monitorwsNamevec.end(); ++itr1) {
       MatrixWorkspace_sptr outsptr;
       TS_ASSERT_THROWS_NOTHING(
           outsptr = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
@@ -674,7 +674,7 @@ public:
     const std::vector<std::string> wsNamevec = sptrWSGrp->getNames();
     period = 1;
     it = wsNamevec.begin();
-    for (; it != wsNamevec.end(); it++) {
+    for (; it != wsNamevec.end(); ++it) {
       std::stringstream count;
       count << period;
       std::string wsName = "multiperiod_" + count.str();
@@ -684,7 +684,7 @@ public:
     itr1 = wsNamevec.begin();
     int periodNumber = 0;
     const int nHistograms = 2;
-    for (; itr1 != wsNamevec.end(); itr1++) {
+    for (; itr1 != wsNamevec.end(); ++itr1) {
       MatrixWorkspace_sptr outsptr;
       TS_ASSERT_THROWS_NOTHING(
           outsptr = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
diff --git a/Framework/DataHandling/test/LoadRawBin0Test.h b/Framework/DataHandling/test/LoadRawBin0Test.h
index 4bbe01e0775..b1c314f1c7a 100644
--- a/Framework/DataHandling/test/LoadRawBin0Test.h
+++ b/Framework/DataHandling/test/LoadRawBin0Test.h
@@ -108,7 +108,7 @@ public:
     wsNamevec = sptrWSGrp->getNames();
     int period = 1;
     std::vector<std::string>::const_iterator it = wsNamevec.begin();
-    for (; it != wsNamevec.end(); it++) {
+    for (; it != wsNamevec.end(); ++it) {
       std::stringstream count;
       count << period;
       std::string wsName = "multiperiod_" + count.str();
@@ -118,7 +118,7 @@ public:
     std::vector<std::string>::const_iterator itr1 = wsNamevec.begin();
     int periodNumber = 0;
     const int nHistograms = 4;
-    for (; itr1 != wsNamevec.end(); itr1++) {
+    for (; itr1 != wsNamevec.end(); ++itr1) {
       MatrixWorkspace_sptr outsptr;
       TS_ASSERT_THROWS_NOTHING(
           outsptr = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
diff --git a/Framework/DataHandling/test/LoadRawSaveNxsLoadNxsTest.h b/Framework/DataHandling/test/LoadRawSaveNxsLoadNxsTest.h
index 101fc484ffa..7af33edb978 100644
--- a/Framework/DataHandling/test/LoadRawSaveNxsLoadNxsTest.h
+++ b/Framework/DataHandling/test/LoadRawSaveNxsLoadNxsTest.h
@@ -72,7 +72,6 @@ public:
     // specify name of file to save workspace to
     outputFile = "testSaveLoadrawCSP.nxs";
     remove(outputFile.c_str());
-    std::string dataName = "spectra";
     std::string title = "Workspace from Loadraw CSP78173";
     saveNexusP.setPropertyValue("FileName", outputFile);
     outputFile = saveNexusP.getPropertyValue("Filename");
diff --git a/Framework/DataHandling/test/LoadRawSpectrum0Test.h b/Framework/DataHandling/test/LoadRawSpectrum0Test.h
index f1a86ad09ed..96a7f376aa8 100644
--- a/Framework/DataHandling/test/LoadRawSpectrum0Test.h
+++ b/Framework/DataHandling/test/LoadRawSpectrum0Test.h
@@ -110,7 +110,7 @@ public:
     wsNamevec = sptrWSGrp->getNames();
     int period = 1;
     std::vector<std::string>::const_iterator it = wsNamevec.begin();
-    for (; it != wsNamevec.end(); it++) {
+    for (; it != wsNamevec.end(); ++it) {
       std::stringstream count;
       count << period;
       std::string wsName = "multiperiod_" + count.str();
@@ -119,7 +119,7 @@ public:
     }
     std::vector<std::string>::const_iterator itr1 = wsNamevec.begin();
     int expectedPeriod = 0;
-    for (; itr1 != wsNamevec.end(); itr1++) {
+    for (; itr1 != wsNamevec.end(); ++itr1) {
       MatrixWorkspace_sptr outsptr;
       TS_ASSERT_THROWS_NOTHING(
           outsptr = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>(
diff --git a/Framework/DataHandling/test/MaskDetectorsTest.h b/Framework/DataHandling/test/MaskDetectorsTest.h
index 826fefab829..747f7e786ad 100644
--- a/Framework/DataHandling/test/MaskDetectorsTest.h
+++ b/Framework/DataHandling/test/MaskDetectorsTest.h
@@ -649,9 +649,9 @@ public:
 
   void test_MaskWithWorkspaceWithDetectorIDs() {
     auto &ads = AnalysisDataService::Instance();
-    const std::string inputWSName("inputWS"), existingMaskName("existingMask");
     const int numInputSpec(90);
 
+    const std::string inputWSName("inputWS");
     setUpWS(false, inputWSName, false, numInputSpec);
 
     auto inputWS = ads.retrieveWS<MatrixWorkspace>(inputWSName);
@@ -717,7 +717,7 @@ public:
 
   void test_MaskWithWorkspaceWithDetectorIDsAndWsIndexRange() {
     auto &ads = AnalysisDataService::Instance();
-    const std::string inputWSName("inputWS"), existingMaskName("existingMask");
+    const std::string inputWSName("inputWS");
     const int numInputSpec(90);
 
     setUpWS(false, inputWSName, false, numInputSpec);
diff --git a/Framework/DataHandling/test/SaveAscii2Test.h b/Framework/DataHandling/test/SaveAscii2Test.h
index a13dba15dc3..d9f1c18952f 100644
--- a/Framework/DataHandling/test/SaveAscii2Test.h
+++ b/Framework/DataHandling/test/SaveAscii2Test.h
@@ -114,7 +114,7 @@ public:
     }
     AnalysisDataService::Instance().add(m_name, wsToSave);
     SaveAscii2 save;
-    std::string filename = initSaveAscii2(save);
+    initSaveAscii2(save);
     TS_ASSERT_THROWS_NOTHING(save.setPropertyValue("WriteXError", "1"));
     TS_ASSERT_THROWS_ANYTHING(save.execute());
     AnalysisDataService::Instance().remove(m_name);
@@ -530,7 +530,7 @@ public:
     writeSampleWS(wsToSave, false);
 
     SaveAscii2 save;
-    std::string filename = initSaveAscii2(save);
+    initSaveAscii2(save);
 
     TS_ASSERT_THROWS_NOTHING(
         save.setProperty("SpectrumMetaData", "SpectrumNumber"));
@@ -836,7 +836,7 @@ public:
     writeSampleWS(wsToSave);
 
     SaveAscii2 save;
-    std::string filename = initSaveAscii2(save);
+    initSaveAscii2(save);
 
     TS_ASSERT_THROWS_NOTHING(
         save.setPropertyValue("SpectrumMetaData", "NotAValidChoice"));
diff --git a/Framework/DataHandling/test/SaveBankScatteringAnglesTest.h b/Framework/DataHandling/test/SaveBankScatteringAnglesTest.h
index 45e667a4933..ab924856da4 100644
--- a/Framework/DataHandling/test/SaveBankScatteringAnglesTest.h
+++ b/Framework/DataHandling/test/SaveBankScatteringAnglesTest.h
@@ -62,9 +62,9 @@ public:
 
     std::ifstream file(tempFileName);
     std::string line;
-    int numLines = 0;
 
     if (file.is_open()) {
+      int numLines = 0;
       while (std::getline(file, line)) {
         numLines++;
       }
diff --git a/Framework/DataHandling/test/SaveCalFileTest.h b/Framework/DataHandling/test/SaveCalFileTest.h
index c00ec9eb160..d8ffb94aec8 100644
--- a/Framework/DataHandling/test/SaveCalFileTest.h
+++ b/Framework/DataHandling/test/SaveCalFileTest.h
@@ -51,9 +51,6 @@ public:
     maskWS->getSpectrum(0).clearData();
     maskWS->mutableSpectrumInfo().setMasked(0, true);
 
-    // Name of the output workspace.
-    std::string outWSName("SaveCalFileTest_OutputWS");
-
     SaveCalFile alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize())
     TS_ASSERT(alg.isInitialized())
diff --git a/Framework/DataHandling/test/SaveGSASInstrumentFileTest.h b/Framework/DataHandling/test/SaveGSASInstrumentFileTest.h
index 99b14d91ec4..641319f16a8 100644
--- a/Framework/DataHandling/test/SaveGSASInstrumentFileTest.h
+++ b/Framework/DataHandling/test/SaveGSASInstrumentFileTest.h
@@ -497,7 +497,6 @@ public:
 
     while (!file2.eof()) {
       getline(file2, str);
-      c2++;
     }
 
     // Reset file stream pointer
diff --git a/Framework/DataHandling/test/SavePDFGuiTest.h b/Framework/DataHandling/test/SavePDFGuiTest.h
index 07b5271a6b2..adea18d2e1b 100644
--- a/Framework/DataHandling/test/SavePDFGuiTest.h
+++ b/Framework/DataHandling/test/SavePDFGuiTest.h
@@ -112,9 +112,6 @@ public:
     grpAlg->setPropertyValue("OutputWorkspace", groupName);
     grpAlg->execute();
 
-    // name of the output file
-    const std::string outFilename("SavePDFGUIGroup.gr");
-
     // run the algorithm with a group
     SavePDFGui alg;
     TS_ASSERT_THROWS_NOTHING(alg.initialize());
diff --git a/Framework/DataHandling/test/UpdateInstrumentFromFileTest.h b/Framework/DataHandling/test/UpdateInstrumentFromFileTest.h
index d00bc48e599..f7ae6029178 100644
--- a/Framework/DataHandling/test/UpdateInstrumentFromFileTest.h
+++ b/Framework/DataHandling/test/UpdateInstrumentFromFileTest.h
@@ -137,7 +137,6 @@ public:
 
   void
   test_DAT_Extension_Without_Header_Assumes_Detector_Calibration_File_And_Fails_If_Number_Of_Columns_Incorrect() {
-    const std::string colNames = "spectrum,theta,t0,-,R";
     const std::string contents = "plik det  t0 l0 l1\n"
                                  "    3 130.4653  -0.4157  11.0050   0.6708\n"
                                  "    4 131.9319  -0.5338  11.0050   0.6545";
diff --git a/Framework/DataObjects/test/AffineMatrixParameterTest.h b/Framework/DataObjects/test/AffineMatrixParameterTest.h
index 74ca4058109..58da4a15d11 100644
--- a/Framework/DataObjects/test/AffineMatrixParameterTest.h
+++ b/Framework/DataObjects/test/AffineMatrixParameterTest.h
@@ -111,7 +111,6 @@ public:
     }
 
     param.setMatrix(transform);
-    std::string result = param.toXMLString();
     TSM_ASSERT_EQUALS(
         "Serialization of CoordTransform has not worked correctly.",
         "<Parameter><Type>AffineMatrixParameter</"
diff --git a/Framework/DataObjects/test/PeaksWorkspaceTest.h b/Framework/DataObjects/test/PeaksWorkspaceTest.h
index 41edfbeef31..da104484120 100644
--- a/Framework/DataObjects/test/PeaksWorkspaceTest.h
+++ b/Framework/DataObjects/test/PeaksWorkspaceTest.h
@@ -140,9 +140,6 @@ public:
   }
 
   void test_Save_Unmodified_PeaksWorkspace_Nexus() {
-
-    const std::string filename =
-        "test_Save_Unmodified_PeaksWorkspace_Nexus.nxs";
     auto testPWS = createSaveTestPeaksWorkspace();
     NexusTestHelper nexusHelper(true);
     nexusHelper.createFile("testSavePeaksWorkspace.nxs");
diff --git a/Framework/DataObjects/test/WeightedEventTest.h b/Framework/DataObjects/test/WeightedEventTest.h
index 7c22aa630fb..621d22978ef 100644
--- a/Framework/DataObjects/test/WeightedEventTest.h
+++ b/Framework/DataObjects/test/WeightedEventTest.h
@@ -62,6 +62,7 @@ public:
     // Copy constructor
     we = WeightedEvent();
     we2 = WeightedEvent(456, 789, 2.5, 1.5 * 1.5);
+    // cppcheck-suppress redundantAssignment
     we = we2;
     TS_ASSERT_EQUALS(we.tof(), 456);
     TS_ASSERT_EQUALS(we.pulseTime(), 789);
diff --git a/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp b/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp
index 57587fe9027..13c327d5375 100644
--- a/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp
+++ b/Framework/Geometry/src/Instrument/ObjCompAssembly.cpp
@@ -409,12 +409,12 @@ boost::shared_ptr<IObject> ObjCompAssembly::createOutline() {
   // find the 'moments of inertia' of the assembly
   double Ixx = 0, Iyy = 0, Izz = 0, Ixy = 0, Ixz = 0, Iyz = 0;
   V3D Cmass; // 'center of mass' of the assembly
-  for (const_comp_it it = group.begin(); it != group.end(); it++) {
+  for (const_comp_it it = group.begin(); it != group.end(); ++it) {
     V3D p = (**it).getRelativePos();
     Cmass += p;
   }
   Cmass /= nelements();
-  for (const_comp_it it = group.begin(); it != group.end(); it++) {
+  for (const_comp_it it = group.begin(); it != group.end(); ++it) {
     V3D p = (**it).getRelativePos();
     double x = p.X() - Cmass.X(), x2 = x * x;
     double y = p.Y() - Cmass.Y(), y2 = y * y;
@@ -476,7 +476,7 @@ boost::shared_ptr<IObject> ObjCompAssembly::createOutline() {
   // positive displacements are positive numbers and negative ones are negative
   double hxn = 0, hyn = 0, hzn = 0;
   double hxp = 0, hyp = 0, hzp = 0;
-  for (const_comp_it it = group.begin(); it != group.end(); it++) {
+  for (const_comp_it it = group.begin(); it != group.end(); ++it) {
     // displacement vector of a detector
     V3D p = (**it).getRelativePos() - Cmass;
     // its projection on the vx axis
diff --git a/Framework/Geometry/src/Instrument/XMLInstrumentParameter.cpp b/Framework/Geometry/src/Instrument/XMLInstrumentParameter.cpp
index ce2c5a1337b..17c163adb6c 100644
--- a/Framework/Geometry/src/Instrument/XMLInstrumentParameter.cpp
+++ b/Framework/Geometry/src/Instrument/XMLInstrumentParameter.cpp
@@ -147,7 +147,7 @@ double XMLInstrumentParameter::createParamValue(
     }
     // Looking for string: "position n", where n is an integer and is a 1-based
     // index
-    else if (m_extractSingleValueAs.find("position") == 0 &&
+    else if (m_extractSingleValueAs.compare("position") == 0 &&
              m_extractSingleValueAs.size() >= 10) {
       std::stringstream extractPosition(m_extractSingleValueAs);
       std::string dummy;
diff --git a/Framework/Geometry/src/Objects/CSGObject.cpp b/Framework/Geometry/src/Objects/CSGObject.cpp
index 9985ef2753a..bc955a76162 100644
--- a/Framework/Geometry/src/Objects/CSGObject.cpp
+++ b/Framework/Geometry/src/Objects/CSGObject.cpp
@@ -1594,6 +1594,7 @@ double CSGObject::singleShotMonteCarloVolume(const int shotSize,
     const auto threadCount = PARALLEL_NUMBER_OF_THREADS;
     const auto currentThreadNum = PARALLEL_THREAD_NUMBER;
     size_t blocksize = shotSize / threadCount;
+    // cppcheck-suppress knownConditionTrueFalse
     if (currentThreadNum == threadCount - 1) {
       // Last thread may have to do threadCount extra iterations in
       // the worst case.
diff --git a/Framework/HistogramData/test/CountStandardDeviationsTest.h b/Framework/HistogramData/test/CountStandardDeviationsTest.h
index fc094f623f4..4da236676c4 100644
--- a/Framework/HistogramData/test/CountStandardDeviationsTest.h
+++ b/Framework/HistogramData/test/CountStandardDeviationsTest.h
@@ -94,7 +94,6 @@ public:
     const BinEdges edges{1.0, 2.0};
     auto old_ptr = &frequencies[0];
     const CountStandardDeviations counts(std::move(frequencies), edges);
-    TS_ASSERT(!frequencies);
     TS_ASSERT_EQUALS(&counts[0], old_ptr);
   }
 
@@ -104,8 +103,6 @@ public:
     const BinEdges edges{1.0, 2.0};
     auto old_ptr = &frequencies[0];
     const CountStandardDeviations counts(std::move(frequencies), edges);
-    // Moved from frequencies...
-    TS_ASSERT(!frequencies);
     // ... but made a copy of data, since "copy" also held a reference.
     TS_ASSERT_DIFFERS(&counts[0], old_ptr);
   }
@@ -127,7 +124,6 @@ public:
     // This implicitly constructs FrequencyStandardDeviations first, so there is
     // a two-step move going on!
     const CountStandardDeviations counts(std::move(frequencies), edges);
-    TS_ASSERT(!frequencies);
     TS_ASSERT_EQUALS(&counts[0], old_ptr);
   }
 };
diff --git a/Framework/HistogramData/test/CountVariancesTest.h b/Framework/HistogramData/test/CountVariancesTest.h
index f574cb79e7e..1ee331c5510 100644
--- a/Framework/HistogramData/test/CountVariancesTest.h
+++ b/Framework/HistogramData/test/CountVariancesTest.h
@@ -101,7 +101,6 @@ public:
     const BinEdges edges{1.0, 2.0};
     auto old_ptr = &frequencies[0];
     const CountVariances counts(std::move(frequencies), edges);
-    TS_ASSERT(!frequencies);
     TS_ASSERT_EQUALS(&counts[0], old_ptr);
   }
 
@@ -111,8 +110,6 @@ public:
     const BinEdges edges{1.0, 2.0};
     auto old_ptr = &frequencies[0];
     const CountVariances counts(std::move(frequencies), edges);
-    // Moved from frequencies...
-    TS_ASSERT(!frequencies);
     // ... but made a copy of data, since "copy" also held a reference.
     TS_ASSERT_DIFFERS(&counts[0], old_ptr);
   }
@@ -134,7 +131,6 @@ public:
     // This implicitly constructs FrequencyVariances first, so there is a
     // two-step move going on!
     const CountVariances counts(std::move(frequencies), edges);
-    TS_ASSERT(!frequencies);
     TS_ASSERT_EQUALS(&counts[0], old_ptr);
   }
 };
diff --git a/Framework/HistogramData/test/CountsTest.h b/Framework/HistogramData/test/CountsTest.h
index d6474d26253..49725b67d75 100644
--- a/Framework/HistogramData/test/CountsTest.h
+++ b/Framework/HistogramData/test/CountsTest.h
@@ -97,7 +97,6 @@ public:
     const BinEdges edges{1.0, 2.0};
     auto old_ptr = &frequencies[0];
     const Counts counts(std::move(frequencies), edges);
-    TS_ASSERT(!frequencies);
     TS_ASSERT_EQUALS(&counts[0], old_ptr);
   }
 
@@ -107,8 +106,6 @@ public:
     const BinEdges edges{1.0, 2.0};
     auto old_ptr = &frequencies[0];
     const Counts counts(std::move(frequencies), edges);
-    // Moved from frequencies...
-    TS_ASSERT(!frequencies);
     // ... but made a copy of data, since "copy" also held a reference.
     TS_ASSERT_DIFFERS(&counts[0], old_ptr);
   }
diff --git a/Framework/HistogramData/test/FrequenciesTest.h b/Framework/HistogramData/test/FrequenciesTest.h
index 598fd5aa842..1eb1b105bdd 100644
--- a/Framework/HistogramData/test/FrequenciesTest.h
+++ b/Framework/HistogramData/test/FrequenciesTest.h
@@ -97,7 +97,6 @@ public:
     const BinEdges edges{1.0, 2.0};
     auto old_ptr = &counts[0];
     const Frequencies frequencies(std::move(counts), edges);
-    TS_ASSERT(!counts);
     TS_ASSERT_EQUALS(&frequencies[0], old_ptr);
   }
 
@@ -107,8 +106,6 @@ public:
     const BinEdges edges{1.0, 2.0};
     auto old_ptr = &counts[0];
     const Frequencies frequencies(std::move(counts), edges);
-    // Moved from counts...
-    TS_ASSERT(!counts);
     // ... but made a copy of data, since "copy" also held a reference.
     TS_ASSERT_DIFFERS(&frequencies[0], old_ptr);
   }
diff --git a/Framework/HistogramData/test/FrequencyVariancesTest.h b/Framework/HistogramData/test/FrequencyVariancesTest.h
index a308a66dd0e..cabf615d474 100644
--- a/Framework/HistogramData/test/FrequencyVariancesTest.h
+++ b/Framework/HistogramData/test/FrequencyVariancesTest.h
@@ -104,7 +104,6 @@ public:
     const BinEdges edges{1.0, 2.0};
     auto old_ptr = &counts[0];
     const FrequencyVariances frequencies(std::move(counts), edges);
-    TS_ASSERT(!counts);
     TS_ASSERT_EQUALS(&frequencies[0], old_ptr);
   }
 
@@ -114,8 +113,6 @@ public:
     const BinEdges edges{1.0, 2.0};
     auto old_ptr = &counts[0];
     const FrequencyVariances frequencies(std::move(counts), edges);
-    // Moved from counts...
-    TS_ASSERT(!counts);
     // ... but made a copy of data, since "copy" also held a reference.
     TS_ASSERT_DIFFERS(&frequencies[0], old_ptr);
   }
@@ -137,7 +134,6 @@ public:
     // This implicitly constructs CountVariances first, so there is a
     // two-step move going on!
     const FrequencyVariances frequencies(std::move(counts), edges);
-    TS_ASSERT(!counts);
     TS_ASSERT_EQUALS(&frequencies[0], old_ptr);
   }
 };
diff --git a/Framework/HistogramData/test/StandardDeviationVectorOfTest.h b/Framework/HistogramData/test/StandardDeviationVectorOfTest.h
index f5da8607d1e..113209ffb93 100644
--- a/Framework/HistogramData/test/StandardDeviationVectorOfTest.h
+++ b/Framework/HistogramData/test/StandardDeviationVectorOfTest.h
@@ -74,7 +74,6 @@ public:
     VariancesTester variances{1.0, 4.0};
     auto old_ptr = &variances[0];
     StandardDeviationVectorOfTester sigmas(std::move(variances));
-    TS_ASSERT(!variances);
     TS_ASSERT_EQUALS(&sigmas[0], old_ptr);
     TS_ASSERT_EQUALS(sigmas[0], 1.0);
     TS_ASSERT_EQUALS(sigmas[1], 2.0);
@@ -93,7 +92,6 @@ public:
     auto old_ptr = &variances[0];
     StandardDeviationVectorOfTester sigmas{};
     sigmas = std::move(variances);
-    TS_ASSERT(!variances);
     TS_ASSERT_EQUALS(&sigmas[0], old_ptr);
     TS_ASSERT_EQUALS(sigmas[0], 1.0);
     TS_ASSERT_EQUALS(sigmas[1], 2.0);
diff --git a/Framework/HistogramData/test/VarianceVectorOfTest.h b/Framework/HistogramData/test/VarianceVectorOfTest.h
index 1dfed01a9c6..2c58a64f541 100644
--- a/Framework/HistogramData/test/VarianceVectorOfTest.h
+++ b/Framework/HistogramData/test/VarianceVectorOfTest.h
@@ -70,7 +70,6 @@ public:
     SigmasTester sigmas{1.0, 2.0};
     auto old_ptr = &sigmas[0];
     VarianceVectorOfTester variances(std::move(sigmas));
-    TS_ASSERT(!sigmas);
     TS_ASSERT_EQUALS(&variances[0], old_ptr);
     TS_ASSERT_EQUALS(variances[0], 1.0);
     TS_ASSERT_EQUALS(variances[1], 4.0);
@@ -89,7 +88,6 @@ public:
     auto old_ptr = &sigmas[0];
     VarianceVectorOfTester variances{};
     variances = std::move(sigmas);
-    TS_ASSERT(!sigmas);
     TS_ASSERT_EQUALS(&variances[0], old_ptr);
     TS_ASSERT_EQUALS(variances[0], 1.0);
     TS_ASSERT_EQUALS(variances[1], 4.0);
diff --git a/Framework/HistogramData/test/VectorOfTest.h b/Framework/HistogramData/test/VectorOfTest.h
index 032b30e9fd3..f38e4d64c54 100644
--- a/Framework/HistogramData/test/VectorOfTest.h
+++ b/Framework/HistogramData/test/VectorOfTest.h
@@ -100,7 +100,6 @@ public:
     TS_ASSERT_EQUALS(src.size(), 2);
     TS_ASSERT(src);
     const VectorOfTester dest(std::move(src));
-    TS_ASSERT(!src);
     TS_ASSERT_EQUALS(dest[0], 0.1);
     TS_ASSERT_EQUALS(dest[1], 0.1);
   }
@@ -108,7 +107,6 @@ public:
   void test_move_from_null_constructor() {
     VectorOfTester src{};
     const VectorOfTester dest(std::move(src));
-    TS_ASSERT(!src);
     TS_ASSERT(!dest);
   }
 
@@ -160,7 +158,6 @@ public:
     TS_ASSERT_EQUALS(dest[0], 0.0);
     TS_ASSERT(src);
     dest = std::move(src);
-    TS_ASSERT(!src);
     TS_ASSERT_EQUALS(dest[0], 0.1);
     TS_ASSERT_EQUALS(dest[1], 0.1);
   }
@@ -169,7 +166,6 @@ public:
     VectorOfTester src{};
     VectorOfTester dest(1);
     dest = std::move(src);
-    TS_ASSERT(!src);
     TS_ASSERT(!dest);
   }
 
diff --git a/Framework/ICat/test/CatalogSearchTest.h b/Framework/ICat/test/CatalogSearchTest.h
index 89c73f02b08..54b80e7d6a5 100644
--- a/Framework/ICat/test/CatalogSearchTest.h
+++ b/Framework/ICat/test/CatalogSearchTest.h
@@ -121,16 +121,9 @@ public:
 
     if (!searchobj.isInitialized())
       searchobj.initialize();
-    std::string errorMsg = "Invalid value for property StartDate (string) "
-                           "sssss"
-                           ": Invalid Date:date format must be DD/MM/YYYY";
 
     TS_ASSERT_THROWS(searchobj.setPropertyValue("StartDate", "sssss"),
                      const std::invalid_argument &);
-
-    errorMsg = "Invalid value for property EndDate (string) "
-               "aaaaa"
-               ": Invalid Date:date format must be DD/MM/YYYY";
     TS_ASSERT_THROWS(searchobj.setPropertyValue("EndDate", "aaaaa"),
                      const std::invalid_argument &);
 
@@ -146,17 +139,8 @@ public:
     if (!searchobj.isInitialized())
       searchobj.initialize();
 
-    std::string errorMsg = "Invalid value for property StartDate (string) "
-                           "39/22/2009"
-                           ": Invalid Date:Day part of the Date parameter must "
-                           "be between 1 and 31";
     TS_ASSERT_THROWS(searchobj.setPropertyValue("StartDate", "39/22/2009"),
                      const std::invalid_argument &);
-
-    errorMsg = "Invalid value for property EndDate (string) "
-               "1/22/2009"
-               ": Invalid Date:Month part of the Date parameter must be "
-               "between 1 and 12";
     TS_ASSERT_THROWS(searchobj.setPropertyValue("EndDate", "1/22/2009"),
                      const std::invalid_argument &);
 
diff --git a/Framework/Kernel/test/CowPtrTest.h b/Framework/Kernel/test/CowPtrTest.h
index d4a97a9cc9e..5736a8dee62 100644
--- a/Framework/Kernel/test/CowPtrTest.h
+++ b/Framework/Kernel/test/CowPtrTest.h
@@ -10,6 +10,7 @@
 #include <boost/make_shared.hpp>
 #include <boost/shared_ptr.hpp>
 #include <cxxtest/TestSuite.h>
+#include <memory>
 
 using namespace Mantid::Kernel;
 
diff --git a/Framework/Kernel/test/LogParserTest.h b/Framework/Kernel/test/LogParserTest.h
index cc2e5d5e9fb..47f6e248f6e 100644
--- a/Framework/Kernel/test/LogParserTest.h
+++ b/Framework/Kernel/test/LogParserTest.h
@@ -69,10 +69,10 @@ public:
     const auto &ti_data1 = v->first.to_tm();
     TS_ASSERT_EQUALS(ti_data1.tm_hour, 12);
     TS_ASSERT_EQUALS(ti_data1.tm_min, 22);
-    v++;
-    v++;
-    v++;
-    v++;
+    ++v;
+    ++v;
+    ++v;
+    ++v;
     // time 5
     const auto &ti_data5 = v->first.to_tm();
     TS_ASSERT_EQUALS(ti_data5.tm_hour, 12);
@@ -119,10 +119,10 @@ public:
     const auto &ti_data1 = v->first.to_tm();
     TS_ASSERT_EQUALS(ti_data1.tm_hour, 12);
     TS_ASSERT_EQUALS(ti_data1.tm_min, 22);
-    v++;
-    v++;
-    v++;
-    v++;
+    ++v;
+    ++v;
+    ++v;
+    ++v;
     // time 5
     const auto &ti_data5 = v->first.to_tm();
     TS_ASSERT_EQUALS(ti_data5.tm_hour, 12);
@@ -156,10 +156,10 @@ public:
     const auto &ti_data1 = v->first.to_tm();
     TS_ASSERT_EQUALS(ti_data1.tm_hour, 12);
     TS_ASSERT_EQUALS(ti_data1.tm_min, 22);
-    v++;
-    v++;
-    v++;
-    v++;
+    ++v;
+    ++v;
+    ++v;
+    ++v;
     // time 5
     const auto &ti_data5 = v->first.to_tm();
     TS_ASSERT_EQUALS(ti_data5.tm_hour, 12);
@@ -216,9 +216,9 @@ public:
     const auto &ti_data1 = v->first.to_tm();
     TS_ASSERT_EQUALS(ti_data1.tm_hour, 12);
     TS_ASSERT_EQUALS(ti_data1.tm_min, 22);
-    v++;
-    v++;
-    v++;
+    ++v;
+    ++v;
+    ++v;
     // time 4
     TS_ASSERT_EQUALS(v->second, "   line 4");
     const auto &ti_data4 = v->first.to_tm();
@@ -381,10 +381,10 @@ public:
     const auto &ti_data1 = v->first.to_tm();
     TS_ASSERT_EQUALS(ti_data1.tm_hour, 12);
     TS_ASSERT_EQUALS(ti_data1.tm_min, 22);
-    v++;
-    v++;
-    v++;
-    v++;
+    ++v;
+    ++v;
+    ++v;
+    ++v;
     // time 5
     // TS_ASSERT(!isNaN(v->second));
     // last time
diff --git a/buildconfig/CMake/CppCheck_Suppressions.txt.in b/buildconfig/CMake/CppCheck_Suppressions.txt.in
index ed2ac5eb001..f60bde7ca6c 100644
--- a/buildconfig/CMake/CppCheck_Suppressions.txt.in
+++ b/buildconfig/CMake/CppCheck_Suppressions.txt.in
@@ -2,8 +2,6 @@
 // NOTE this needs the full path to the file, so would need this file to be generated by cmake
 //      as different build servers have different starts to the file path
 
-
-
 // -------- Project Wide ------------------
 
 // Hide warnings about using explicit keyword constructors as we have "too many"
@@ -16,15 +14,6 @@ duplInheritedMember
 // We have some potentially uninitialized member vars but too many to fix at the moment
 uninitMemberVar
 
-// Cppcheck struggles with some inheritance chains, some of these might be true though
-unusedPrivateFunction
-
-// Nice to have, not need to have at the moment
-useInitializationList
-
-// A large number of copying instead of pass by ref were picked up by clang-tidy, but around 200 remain
-passedByValue
-
 // Around 100 of these exist where noConstructor is present
 noConstructor
 
@@ -32,22 +21,39 @@ noConstructor
 preprocessorErrorDirective
 
 // ---------- cppcheck 1.90 Transition -------
+unmatchedSuppression
+
 // If-init not supported
 syntaxError:${CMAKE_SOURCE_DIR}/Framework/API/src/MatrixWorkspace.cpp
 
+// --- To be added back ------
+//cstyleCase:*${CMAKE_SOURCE_DIR}/MantidPlot
+
+// A large number of copying instead of pass by ref were picked up by clang-tidy, but around 200 remain
+//passedByValue
+
+// Cppcheck struggles with some inheritance chains, some of these might be true though
+//unusedPrivateFunction
+
+// Nice to have, not need to have at the moment
+//useInitializationList
+
+// Libs we have in-source
+// *:${CMAKE_SOURCE_DIR}/Framework/DataObjects/inc/MantidDataObjects/MortonIndex/*
+
 // ---------- Individual suppressions -----------------
 
 // Mantid Plot specific ones we probably won't fix before removal
-cstyleCase:*${CMAKE_SOURCE_DIR}/MantidPlot
+
 *:${CMAKE_SOURCE_DIR}/MantidPlot/src/origin/tree.hh
 *:${CMAKE_SOURCE_DIR}/MantidPlot/src/nrutil.cpp
 
+pureVirtualCall:${CMAKE_SOURCE_DIR}/qt/scientific_interfaces/Indirect/IndirectBayesTab.cpp
+pureVirtualCall:${CMAKE_SOURCE_DIR}/qt/scientific_interfaces/Indirect/IndirectBayesTab.h
+
 // Macro expansion means this is incorrectly flagged on Unix
 redundantAssignment:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadRaw/isisraw.cpp
 
-// Ones below was beyond the Cppcheck 1.90 migration scope
-pureVirtualCall:${CMAKE_SOURCE_DIR}/qt/scientific_interfaces/Indirect/IndirectBayesTab.cpp
-
 // Ref binding means Cppcheck can't see these are used
 unreadVariable:${CMAKE_SOURCE_DIR}/Framework/Algorithms/src/MaskBinsIf.cpp
 
@@ -68,11 +74,17 @@ copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/Catalog/inc/MantidCatalog/ON
 copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/Crystal/inc/MantidCrystal/IndexSXPeaks.h
 copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/Crystal/inc/MantidCrystal/IntegratePeakTimeSlices.h
 
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/Geometry/inc/MantidGeometry/Instrument/CompAssembly.h
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/Geometry/inc/MantidGeometry/Instrument/Container.h
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/Geometry/inc/MantidGeometry/Instrument/ObjCompAssembly.h
+copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/Framework/Geometry/inc/MantidGeometry/Rendering/GeometryHandler.h
+
 copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/QwtWorkspaceBinData.h
 copyCtorAndEqOperator:${CMAKE_SOURCE_DIR}/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/QwtWorkspaceSpectrumData.h
 
 noCopyConstructor:${CMAKE_SOURCE_DIR}/Framework/DataHandling/inc/MantidDataHandling/BankPulseTimes.h
 noCopyConstructor:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadRaw/isisraw.h
+noCopyConstructor:${CMAKE_SOURCE_DIR}/Framework/Geometry/inc/MantidGeometry/Rendering/vtkGeometryCacheWriter.h
 
 // ----------------- Upstream libs ---------------
 
@@ -86,8 +98,7 @@ noCopyConstructor:${CMAKE_SOURCE_DIR}/Framework/DataHandling/src/LoadRaw/isisraw
 *:*${CMAKE_SOURCE_DIR}/Framework/Kernel/src/ANN/*
 
 // Libs we have in-source
-*:*${CMAKE_SOURCE_DIR}/Framework/DataObjects/inc/MantidDataObjects/MortonIndex/*
-*:*${CMAKE_SOURCE_DIR}/Framework/ICat/src/GSoap/*
-*:*${CMAKE_SOURCE_DIR}/ICat/src/ICat3/GSoapGenerated/*
-*:*${CMAKE_SOURCE_DIR}/ICat/src/ICat4/GSoapGenerated/*
-*:*${CMAKE_SOURCE_DIR}/MantidPlot/src/zlib123/*
+*:${CMAKE_SOURCE_DIR}/Framework/ICat/src/GSoap/*
+*:${CMAKE_SOURCE_DIR}/Framework/ICat/src/ICat3/GSoapGenerated/*
+*:${CMAKE_SOURCE_DIR}/Framework/ICat/src/ICat4/GSoapGenerated/*
+*:${CMAKE_SOURCE_DIR}/MantidPlot/src/zlib123/*
diff --git a/qt/scientific_interfaces/Indirect/IndirectBayesTab.cpp b/qt/scientific_interfaces/Indirect/IndirectBayesTab.cpp
index 07d99f46148..8d7484a3a3f 100644
--- a/qt/scientific_interfaces/Indirect/IndirectBayesTab.cpp
+++ b/qt/scientific_interfaces/Indirect/IndirectBayesTab.cpp
@@ -13,7 +13,6 @@ IndirectBayesTab::IndirectBayesTab(QWidget *parent)
     : IndirectTab(parent), m_propTree(new QtTreePropertyBrowser()) {
   m_propTree->setFactoryForManager(m_dblManager, m_dblEdFac);
 
-  // cppcheck-suppress pureVirtualCall
   connect(m_dblManager, SIGNAL(valueChanged(QtProperty *, double)), this,
           // cppcheck-suppress pureVirtualCall
           SLOT(updateProperties(QtProperty *, double)));
diff --git a/qt/widgets/common/src/FunctionTreeView.cpp b/qt/widgets/common/src/FunctionTreeView.cpp
index 734ce0f4ba9..3969cf380a9 100644
--- a/qt/widgets/common/src/FunctionTreeView.cpp
+++ b/qt/widgets/common/src/FunctionTreeView.cpp
@@ -904,10 +904,6 @@ void FunctionTreeView::addTieProperty(QtProperty *prop, const QString &tie) {
   if (!prop) {
     throw std::runtime_error("FunctionTreeView: null property pointer");
   }
-  AProperty ap;
-  ap.item = nullptr;
-  ap.prop = nullptr;
-  ap.parent = nullptr;
 
   if (!isParameter(prop))
     return;
@@ -918,7 +914,7 @@ void FunctionTreeView::addTieProperty(QtProperty *prop, const QString &tie) {
   m_tieManager->blockSignals(true);
   QtProperty *tieProp = m_tieManager->addProperty("Tie");
   m_tieManager->setValue(tieProp, tie);
-  ap = addProperty(prop, tieProp);
+  addProperty(prop, tieProp);
   m_tieManager->blockSignals(false);
 
   const auto parName = getParameterName(prop);
diff --git a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/ScaleEngine.h b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/ScaleEngine.h
index 8a666705028..937e569189b 100644
--- a/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/ScaleEngine.h
+++ b/qt/widgets/plotting/inc/MantidQtWidgets/Plotting/Qwt/ScaleEngine.h
@@ -45,8 +45,8 @@ public:
       : QwtScaleTransformation(Other), d_engine(engine){};
   double xForm(double x, double /*s1*/, double /*s2*/, double p1,
                double p2) const override;
-  double invXForm(double x, double s1, double s2, double p1,
-                  double p2) const override;
+  double invXForm(double p, double p1, double p2, double s1,
+                  double s2) const override;
   QwtScaleTransformation *copy() const override;
   ~ScaleTransformation() override;
 
diff --git a/qt/widgets/plugins/algorithm_dialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp b/qt/widgets/plugins/algorithm_dialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp
index c9a665b7e45..016e947c58a 100644
--- a/qt/widgets/plugins/algorithm_dialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp
+++ b/qt/widgets/plugins/algorithm_dialogs/src/ConvertTableToMatrixWorkspaceDialog.cpp
@@ -103,7 +103,9 @@ void ConvertTableToMatrixWorkspaceDialog::fillColumnNames(
 /// Initialize the layout
 void ConvertTableToMatrixWorkspaceDialog::initLayout() {
   m_form.setupUi(this);
-  ((QVBoxLayout *)this->layout())->addLayout(createDefaultButtonLayout());
+
+  static_cast<QVBoxLayout *>(this->layout())
+      ->addLayout(createDefaultButtonLayout());
   tie(m_form.cbInputWorkspace, "InputWorkspace", m_form.gridLayout);
   tie(m_form.leOutputWorkspace, "OutputWorkspace", m_form.gridLayout);
   tie(m_form.cbColumnX, "ColumnX", m_form.gridLayout);
-- 
GitLab


From 83f49f6004bab1c219ba2b82ed04b986fc8d8ecb Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Mon, 23 Mar 2020 10:04:28 +0000
Subject: [PATCH 26/30] Revert any regressions from automated tooling

---
 Framework/API/src/IFunction.cpp                              | 1 -
 Framework/Geometry/src/Instrument/XMLInstrumentParameter.cpp | 2 +-
 MantidPlot/src/ScriptingWindow.cpp                           | 2 +-
 MantidPlot/src/ScriptingWindow.h                             | 3 +--
 4 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/Framework/API/src/IFunction.cpp b/Framework/API/src/IFunction.cpp
index 3e8ca78315a..887b5dd1789 100644
--- a/Framework/API/src/IFunction.cpp
+++ b/Framework/API/src/IFunction.cpp
@@ -662,7 +662,6 @@ private:
 /// @param attr :: The attribute to copy from.
 IFunction::Attribute &IFunction::Attribute::operator=(const Attribute &attr) {
   m_data = attr.m_data;
-  m_quoteValue = attr.m_quoteValue;
   return *this;
 }
 
diff --git a/Framework/Geometry/src/Instrument/XMLInstrumentParameter.cpp b/Framework/Geometry/src/Instrument/XMLInstrumentParameter.cpp
index 17c163adb6c..ce2c5a1337b 100644
--- a/Framework/Geometry/src/Instrument/XMLInstrumentParameter.cpp
+++ b/Framework/Geometry/src/Instrument/XMLInstrumentParameter.cpp
@@ -147,7 +147,7 @@ double XMLInstrumentParameter::createParamValue(
     }
     // Looking for string: "position n", where n is an integer and is a 1-based
     // index
-    else if (m_extractSingleValueAs.compare("position") == 0 &&
+    else if (m_extractSingleValueAs.find("position") == 0 &&
              m_extractSingleValueAs.size() >= 10) {
       std::stringstream extractPosition(m_extractSingleValueAs);
       std::string dummy;
diff --git a/MantidPlot/src/ScriptingWindow.cpp b/MantidPlot/src/ScriptingWindow.cpp
index 77a54092acc..2288aa92471 100644
--- a/MantidPlot/src/ScriptingWindow.cpp
+++ b/MantidPlot/src/ScriptingWindow.cpp
@@ -61,7 +61,7 @@ Mantid::Kernel::Logger g_log("ScriptingWindow");
  * @param flags :: Window flags passed to the base class
  */
 ScriptingWindow::ScriptingWindow(ScriptingEnv *env, bool capturePrint,
-                                 QWidget *parent, const Qt::WindowFlags &flags)
+                                 QWidget *parent, Qt::WindowFlags flags)
     : QMainWindow(parent, flags), m_acceptClose(false) {
   Q_UNUSED(capturePrint);
   setObjectName("MantidScriptWindow");
diff --git a/MantidPlot/src/ScriptingWindow.h b/MantidPlot/src/ScriptingWindow.h
index 59000667824..65c5c861c5b 100644
--- a/MantidPlot/src/ScriptingWindow.h
+++ b/MantidPlot/src/ScriptingWindow.h
@@ -40,8 +40,7 @@ class ScriptingWindow : public QMainWindow {
 public:
   /// Constructor
   ScriptingWindow(ScriptingEnv *env, bool capturePrint = true,
-                  QWidget *parent = nullptr,
-                  const Qt::WindowFlags &flags = nullptr);
+                  QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr);
   /// Destructor
   ~ScriptingWindow() override;
   /// Override the closeEvent
-- 
GitLab


From 18672c6104dfefecf7d55b7f1ca7da5bc241c696 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Tue, 24 Mar 2020 15:24:16 +0000
Subject: [PATCH 27/30] Remove unused vars and methods following tooling
 changes

---
 Framework/API/test/RunTest.h                  |  1 -
 Framework/Algorithms/test/RingProfileTest.h   | 13 ++++--
 .../Crystal/src/PeakAlgorithmHelpers.cpp      |  2 +
 .../src/CostFunctions/CostFuncFitting.cpp     |  2 +-
 .../test/Algorithms/LeBailFitTest.h           | 41 -------------------
 5 files changed, 13 insertions(+), 46 deletions(-)

diff --git a/Framework/API/test/RunTest.h b/Framework/API/test/RunTest.h
index caaf5d0a9db..a41f319a7ea 100644
--- a/Framework/API/test/RunTest.h
+++ b/Framework/API/test/RunTest.h
@@ -630,7 +630,6 @@ public:
   }
 
   void test_Accessing_Single_Value_From_Times_Series_A_Large_Number_Of_Times() {
-    double value(0.0);
     for (size_t i = 0; i < 20000; ++i) {
       m_testRun.getPropertyAsSingleValue(m_propName);
     }
diff --git a/Framework/Algorithms/test/RingProfileTest.h b/Framework/Algorithms/test/RingProfileTest.h
index 6081a76e993..3580725c7c2 100644
--- a/Framework/Algorithms/test/RingProfileTest.h
+++ b/Framework/Algorithms/test/RingProfileTest.h
@@ -39,6 +39,14 @@ public:
                      const std::invalid_argument &);
 
     // centre must be 2 or 3 values (x,y) or (x,y,z)
+    std::vector<double> justOne(1);
+    justOne[0] = -0.35;
+    TS_ASSERT_THROWS(alg.setProperty("Centre", justOne),
+                     const std::invalid_argument &);
+
+    std::vector<double> fourInputs(4, -0.45);
+    TS_ASSERT_THROWS(alg.setProperty("Centre", fourInputs),
+                     const std::invalid_argument &);
 
     TS_ASSERT_THROWS_NOTHING(
         alg.setPropertyValue("OutputWorkspace", outWSName));
@@ -140,9 +148,8 @@ public:
     return goodWS;
   }
 
-  void configure_ring_profile(RingProfile &alg,
-                              const MatrixWorkspace_sptr &inws,
-                              const std::vector<double> &centre, int num_bins,
+  void configure_ring_profile(RingProfile &alg, MatrixWorkspace_sptr inws,
+                              std::vector<double> centre, int num_bins,
                               double start_angle = 0, double min_radius = 0,
                               double max_radius = 1000, bool anticlock = true) {
     TS_ASSERT_THROWS_NOTHING(alg.initialize());
diff --git a/Framework/Crystal/src/PeakAlgorithmHelpers.cpp b/Framework/Crystal/src/PeakAlgorithmHelpers.cpp
index 6d01489f6c8..684e7601304 100644
--- a/Framework/Crystal/src/PeakAlgorithmHelpers.cpp
+++ b/Framework/Crystal/src/PeakAlgorithmHelpers.cpp
@@ -203,6 +203,8 @@ generateOffsetVectors(const std::vector<double> &hOffsets,
       std::transform(
           lOffsets.begin(), lOffsets.end(), std::back_inserter(offsets),
           [&hOffset, &kOffset](double lOffset) {
+            // it's not quite clear how to interpret them as mnp
+            // indices so set to 0, 0, 0
             return std::make_tuple(0, 0, 0, V3D(hOffset, kOffset, lOffset));
           });
     }
diff --git a/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp b/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp
index d458a539489..9e8effe8584 100644
--- a/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp
+++ b/Framework/CurveFitting/src/CostFunctions/CostFuncFitting.cpp
@@ -136,7 +136,7 @@ void CostFuncFitting::calActiveCovarianceMatrix(GSLMatrix &covar,
   m_function->functionDeriv(*m_domain, J);
 
   // let the GSL to compute the covariance matrix
-  gsl_multifit_covar(J.getJ(), epsrel, covar.gsl());
+  gsl_multifit_covar(j, epsrel, covar.gsl());
 }
 
 /** Calculates covariance matrix
diff --git a/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h b/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h
index 1977a54d00d..b43f134bd99 100644
--- a/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h
+++ b/Framework/CurveFitting/test/Algorithms/LeBailFitTest.h
@@ -424,47 +424,6 @@ API::MatrixWorkspace_sptr generateArgSiPeak220() {
   return dataws;
 }
 
-//----------------------------------------------------------------------------------------------
-/** Import data from a column data file
- */
-void importDataFromColumnFile(const std::string &filename,
-                              const std::string &wsname) {
-  DataHandling::LoadAscii2 load;
-  load.initialize();
-
-  load.setProperty("FileName", filename);
-  load.setProperty("OutputWorkspace", wsname);
-  load.setProperty("Separator", "Automatic");
-  load.setProperty("Unit", "TOF");
-
-  load.execute();
-  if (!load.isExecuted()) {
-    stringstream errss;
-    errss << "Data file " << filename << " cannot be opened. ";
-    std::cout << errss.str() << '\n';
-    throw std::runtime_error(errss.str());
-  }
-
-  MatrixWorkspace_sptr ws = boost::dynamic_pointer_cast<MatrixWorkspace>(
-      AnalysisDataService::Instance().retrieve(wsname));
-  if (!ws) {
-    stringstream errss;
-    errss << "LoadAscii failed to generate workspace";
-    std::cout << errss.str() << '\n';
-    throw std::runtime_error(errss.str());
-  }
-
-  // Set error
-  const MantidVec &vecY = ws->readY(0);
-  MantidVec &vecE = ws->dataE(0);
-  size_t numpts = vecY.size();
-  for (size_t i = 0; i < numpts; ++i) {
-    vecE[i] = std::max(1.0, sqrt(vecY[i]));
-  }
-
-  return;
-}
-
 //----------------------------------------------------------------------------------------------
 /** Create data workspace without background
  */
-- 
GitLab


From 9b6ac432c6f89f2c1586cd133877719ddcff6d3f Mon Sep 17 00:00:00 2001
From: Harriet Brown <harriet.brown@stfc.ac.uk>
Date: Thu, 26 Mar 2020 13:23:45 +0000
Subject: [PATCH 28/30] remove unneeded debugging print statement

This commit removes a print statement initial added for debugging that was missed on cleaning up before pushing.
---
 scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py b/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
index bc121452505..844a7b17521 100644
--- a/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
+++ b/scripts/Diffraction/isis_powder/polaris_routines/polaris_algs.py
@@ -132,7 +132,6 @@ def generate_ts_pdf(run_number, focus_file_path, merge_banks=False, q_lims=None,
     mantid.RenameWorkspace(InputWorkspace='focused_ws', OutputWorkspace=run_number+'_focused_Q')
     if isinstance(focused_ws, WorkspaceGroup):
         for i in range(len(focused_ws)):
-            print(focused_ws[i])
             mantid.RenameWorkspace(InputWorkspace=focused_ws[i], OutputWorkspace=run_number+'_focused_Q_'+str(i+1))
     mantid.RenameWorkspace(InputWorkspace='pdf_output', OutputWorkspace=run_number+'_pdf_R')
     if isinstance(pdf_output, WorkspaceGroup):
-- 
GitLab


From 14cc482ecd6d755e12b9511746275a8817e6f020 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Wed, 25 Mar 2020 15:18:06 +0000
Subject: [PATCH 29/30] Fix cppcheck warnings introduced into master

---
 Framework/Nexus/src/NexusHDF5Descriptor.cpp | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/Framework/Nexus/src/NexusHDF5Descriptor.cpp b/Framework/Nexus/src/NexusHDF5Descriptor.cpp
index 39e0bbe6b12..266397764a7 100644
--- a/Framework/Nexus/src/NexusHDF5Descriptor.cpp
+++ b/Framework/Nexus/src/NexusHDF5Descriptor.cpp
@@ -28,15 +28,12 @@ namespace {
  */
 herr_t readStringAttribute(hid_t attr, char **data) {
   herr_t iRet = 0;
-  hid_t atype = -1;
-  hid_t space;
-  int ndims;
-  hsize_t thedims[H5S_MAX_RANK], sdim;
-
-  atype = H5Aget_type(attr);
-  sdim = H5Tget_size(atype);
-  space = H5Aget_space(attr);
-  ndims = H5Sget_simple_extent_dims(space, thedims, NULL);
+  hsize_t thedims[H5S_MAX_RANK];
+
+  hid_t atype = H5Aget_type(attr);
+  hsize_t sdim = H5Tget_size(atype);
+  hid_t space = H5Aget_space(attr);
+  int ndims = H5Sget_simple_extent_dims(space, thedims, NULL);
 
   if (ndims == 0) {
     if (H5Tis_variable_str(atype)) {
-- 
GitLab


From 959a1b3a94852e631c5fa6944b2c771abedc0ee1 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Fri, 27 Mar 2020 10:35:31 +0000
Subject: [PATCH 30/30] Remove Bash 4.2 feature breaking Mac OSX

Removes a check that uses the -v flag, this was introduced in BASH 4.2,
so apparently breaks certain Mac builders
---
 buildconfig/Jenkins/buildscript | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/buildconfig/Jenkins/buildscript b/buildconfig/Jenkins/buildscript
index 10343ba8c7a..09c68128ccb 100755
--- a/buildconfig/Jenkins/buildscript
+++ b/buildconfig/Jenkins/buildscript
@@ -312,8 +312,6 @@ fi
 # Figure out if were doing a sanitizer build and setup any steps we need
 ###############################################################################
 
-SANITIZER_FLAGS=''
-
 if [[ ${JOB_NAME} == *address* ]]; then
     SANITIZER_FLAGS="-DUSE_SANITIZER=Address"
     
@@ -327,7 +325,7 @@ elif [[ ${JOB_NAME} == *undefined* ]]; then
     SANITIZER_FLAGS="-DUSE_SANITIZER=undefined"
 fi
 
-if [[ -v ${SANITIZER_FLAGS} ]]; then
+if [[ -n "${SANITIZER_FLAGS}" ]]; then
     # Force build to RelWithDebInfo
     BUILD_CONFIG="RelWithDebInfo"
 fi
-- 
GitLab