From c9a429c1e420aee0b53e3ca14470a8a49372fb1e Mon Sep 17 00:00:00 2001
From: Amy Stamile <74275278+amystamile-usgs@users.noreply.github.com>
Date: Tue, 19 Nov 2024 09:15:05 -0700
Subject: [PATCH] Build Warnings Cleanup (#5671)

* remove unused variable warnings

* fix linux warnings

* addressed PR feedback

* fixes hinoise tests

* Fix tests
---
 isis/src/base/apps/cubediff/WriteTabular.cpp       |  2 --
 .../base/apps/isisminer/AssetSidebarStrategy.cpp   |  2 --
 .../src/base/apps/isisminer/RunCommandStrategy.cpp |  2 --
 isis/src/base/apps/makeflat/main.cpp               |  2 --
 .../objs/EmbreeTargetShape/EmbreeTargetShape.cpp   |  2 +-
 .../base/objs/ExportPdsTable/ExportPdsTable.cpp    |  3 ---
 isis/src/base/objs/Pipeline/Pipeline.cpp           |  4 ----
 isis/src/base/objs/PolygonTools/PolygonTools.cpp   |  2 +-
 .../ProcessGroundPolygons.cpp                      |  2 +-
 .../base/objs/ProgramLauncher/ProgramLauncher.cpp  | 10 +++++++++-
 isis/src/base/objs/UserInterface/UserInterface.cpp |  2 --
 isis/src/cassini/objs/VimsCamera/VimsCamera.cpp    | 14 --------------
 isis/src/clementine/apps/clemnirnoise/main.cpp     |  3 ---
 isis/src/clementine/apps/clemuvviscal/main.cpp     |  4 ++--
 isis/src/control/apps/autoseed/autoseed.cpp        |  4 ----
 .../control/apps/cnetthinner/CnetSuppression.cpp   |  2 +-
 .../control/apps/findfeatures/RobustMatcher.cpp    |  2 --
 .../src/control/objs/BundleAdjust/BundleAdjust.cpp |  7 -------
 isis/src/kaguya/apps/kaguyasp2ascii/main.cpp       |  2 +-
 isis/src/lro/apps/lronaccal/lronaccal.cpp          |  2 --
 .../messenger/apps/mdisedrinfo/MdisGeometry.cpp    |  2 --
 isis/src/mgs/apps/mocuncompress/main.cpp           |  6 +++---
 isis/src/mro/apps/hicrop/hicrop.cpp                |  3 ---
 isis/src/system/apps/isisdataeval/isisdataeval.cpp |  2 --
 isis/src/viking/apps/vikfixtrx/main.cpp            |  2 --
 isis/tests/FunctionalTestsMsi2isis.cpp             |  4 ----
 26 files changed, 19 insertions(+), 73 deletions(-)

diff --git a/isis/src/base/apps/cubediff/WriteTabular.cpp b/isis/src/base/apps/cubediff/WriteTabular.cpp
index dd0173c9b4..cb0d9dbdd0 100644
--- a/isis/src/base/apps/cubediff/WriteTabular.cpp
+++ b/isis/src/base/apps/cubediff/WriteTabular.cpp
@@ -74,7 +74,6 @@ namespace Isis {
         throw IException(IException::User, message, _FILEINFO_);
       }
 
-      int iteration = 0;
       while((int)thisTitle.length() < (int)thisCol.Width()) {
         if(thisCol.Alignment() == Column::Left) {
           thisTitle += " ";
@@ -87,7 +86,6 @@ namespace Isis {
           QString message = "Alignment is improperly set";
           throw IException(IException::User, message, _FILEINFO_);
         }
-        iteration++;
       }//end while
 
       p_cols.push_back(thisCol);
diff --git a/isis/src/base/apps/isisminer/AssetSidebarStrategy.cpp b/isis/src/base/apps/isisminer/AssetSidebarStrategy.cpp
index 0b8c9e93f6..e2f566d4ab 100644
--- a/isis/src/base/apps/isisminer/AssetSidebarStrategy.cpp
+++ b/isis/src/base/apps/isisminer/AssetSidebarStrategy.cpp
@@ -195,7 +195,6 @@ namespace Isis {
                                           const ResourceList &globals) {
 
     // Set up incoming asset handling conditions
-    int nremoved = 0;
     if ( m_removeEmpties ) {
       BOOST_FOREACH ( SharedResource resource, resources ) {
         if ( resource->isActive() ) {
@@ -208,7 +207,6 @@ namespace Isis {
               ResourceList assetList = asset.value<ResourceList>();
               if ( assetList.size() == 0) {
                 resource->removeAsset(m_asset);
-                nremoved++;
               }
             }
           }
diff --git a/isis/src/base/apps/isisminer/RunCommandStrategy.cpp b/isis/src/base/apps/isisminer/RunCommandStrategy.cpp
index ebcf3e6d81..0f7d42774a 100644
--- a/isis/src/base/apps/isisminer/RunCommandStrategy.cpp
+++ b/isis/src/base/apps/isisminer/RunCommandStrategy.cpp
@@ -223,7 +223,6 @@ namespace Isis {
   int RunCommandStrategy::apply(SharedResource &resource, 
                                 const ResourceList &globals) { 
 
-    int n_good(0);
     BOOST_FOREACH ( Command command, m_commands ) {
       QString cmd = processArgs(command.m_command, m_argKeys, 
                                 getGlobals(resource, globals));
@@ -248,7 +247,6 @@ namespace Isis {
       if ( isDebug() ) { 
         cout << "Command " << command.m_name << " succeeded\n"; 
       }
-        n_good++;
       }
     }
     return (1); 
diff --git a/isis/src/base/apps/makeflat/main.cpp b/isis/src/base/apps/makeflat/main.cpp
index 408f815139..39e1d72904 100644
--- a/isis/src/base/apps/makeflat/main.cpp
+++ b/isis/src/base/apps/makeflat/main.cpp
@@ -381,7 +381,6 @@ void IsisMain() {
   oLineMgr->SetLine(1);
 
   ProcessByBrick p;
-  int excludedCnt = 0;
 
   if(cameraType == LineScan) {
     outputTmpAverages.resize(numOutputSamples);
@@ -392,7 +391,6 @@ void IsisMain() {
   cubeInitialized = false;
   for(currImage = 0; currImage < inList.size(); currImage++) {
     if(Excluded(currImage)) {
-      excludedCnt ++;
       continue;
     }
 
diff --git a/isis/src/base/objs/EmbreeTargetShape/EmbreeTargetShape.cpp b/isis/src/base/objs/EmbreeTargetShape/EmbreeTargetShape.cpp
index 3ef47feecc..e3d6e61435 100644
--- a/isis/src/base/objs/EmbreeTargetShape/EmbreeTargetShape.cpp
+++ b/isis/src/base/objs/EmbreeTargetShape/EmbreeTargetShape.cpp
@@ -486,7 +486,7 @@ namespace Isis {
     rtcSetGeometryOccludedFilterFunction(rtcMesh, EmbreeTargetShape::occlusionFilter);
 
     rtcCommitGeometry(rtcMesh);
-    unsigned int geomID = rtcAttachGeometry(m_scene, rtcMesh);
+    rtcAttachGeometry(m_scene, rtcMesh);
     rtcReleaseGeometry(rtcMesh);
 
     // Done, now we can perform some ray tracing
diff --git a/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp b/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp
index 551ee43ca5..3d6a0517e7 100644
--- a/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp
+++ b/isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp
@@ -102,7 +102,6 @@ namespace Isis {
     // fill rowBuffer with packed record values, then fill with padding
     EndianSwapper *endianSwap = new EndianSwapper(m_pdsByteOrder);
 
-    int buffsize = 0;
     for(int recIndex = 0; recIndex < m_isisTable->Records(); recIndex++) {
       TableRecord record = (*m_isisTable)[recIndex];
       char rowBuffer[record.RecordSize()];
@@ -110,8 +109,6 @@ namespace Isis {
       int i = recIndex*m_outputRecordBytes;
       memmove(pdsTableBuffer + i, &rowBuffer, record.RecordSize());
       memmove(pdsTableBuffer + i + m_rowBytes, &endRowPadding, numRowNulls);
-      buffsize+=record.RecordSize();
-      buffsize+=numRowNulls;
     }
     return fillMetaData();
   }
diff --git a/isis/src/base/objs/Pipeline/Pipeline.cpp b/isis/src/base/objs/Pipeline/Pipeline.cpp
index 2d21b00a4c..df1fdb5f90 100644
--- a/isis/src/base/objs/Pipeline/Pipeline.cpp
+++ b/isis/src/base/objs/Pipeline/Pipeline.cpp
@@ -600,12 +600,8 @@ namespace Isis {
     }
 
     //Check for non nulls instead of size ie. find last non null or use this
-    int appsSize = 0;
     QString pauseAppId = "";
 
-    for (int iapp = 0; iapp < (int) p_apps.size(); iapp++)
-      if (p_apps[iapp] != NULL) appsSize++;
-
     // Add the new application
     if (p_apps.size() == 0) {
       p_apps.push_back(new PipelineApplication(appname, this));
diff --git a/isis/src/base/objs/PolygonTools/PolygonTools.cpp b/isis/src/base/objs/PolygonTools/PolygonTools.cpp
index dc7431db56..6fc12fb192 100644
--- a/isis/src/base/objs/PolygonTools/PolygonTools.cpp
+++ b/isis/src/base/objs/PolygonTools/PolygonTools.cpp
@@ -705,7 +705,7 @@ namespace Isis {
       catch(IException &e) {
         // Sometimes despike and fix fail, but the input is really valid. We can just go
         // with the non-despiked polygon.
-        if(ls->isValid() && ls->getGeometryTypeId() == geos::geom::GEOS_LINEARRING) {
+        if (ls && ls->isValid() && ls->getGeometryTypeId() == geos::geom::GEOS_LINEARRING) {
           lr.reset(ls.release());
         }
         else {
diff --git a/isis/src/base/objs/ProcessGroundPolygons/ProcessGroundPolygons.cpp b/isis/src/base/objs/ProcessGroundPolygons/ProcessGroundPolygons.cpp
index 60c03752ec..c68c58807d 100644
--- a/isis/src/base/objs/ProcessGroundPolygons/ProcessGroundPolygons.cpp
+++ b/isis/src/base/objs/ProcessGroundPolygons/ProcessGroundPolygons.cpp
@@ -196,7 +196,7 @@ geos::geom::Geometry* ProcessGroundPolygons::Vectorize(std::vector<double> &lat,
 
     return singlePoly;
   }
-  
+  return nullptr;
 }
 
   /**
diff --git a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp
index b728767a93..dad28f8a3a 100644
--- a/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp
+++ b/isis/src/base/objs/ProgramLauncher/ProgramLauncher.cpp
@@ -18,6 +18,7 @@ find files of those names at the top level of this repository. **/
 #include "FileName.h"
 #include "IException.h"
 #include "IString.h"
+#include "Preference.h"
 
 using namespace std;
 namespace Isis {
@@ -44,6 +45,9 @@ namespace Isis {
       program = isisExecutableFileName;
     }
 
+    PvlGroup &dataDir = Preference::Preferences().findGroup("DataDirectory");
+    QString tempDir = dataDir["Temporary"];
+
     QString command = program.expanded() + " " + parameters +
         " -pid=" + toString(getpid());
 
@@ -59,9 +63,13 @@ namespace Isis {
     QLocalServer server;
     server.listen(serverName);
 
+    QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
+    env.insert("TEMPORARY", tempDir);
+
     QProcess childProcess;
+    childProcess.setProcessEnvironment(env);
     childProcess.setProcessChannelMode(QProcess::ForwardedChannels);
-    childProcess.start(command);
+    childProcess.start("bash", QStringList() << "-c" << command);
     childProcess.waitForStarted();
 
     bool connected = false;
diff --git a/isis/src/base/objs/UserInterface/UserInterface.cpp b/isis/src/base/objs/UserInterface/UserInterface.cpp
index bc22e5ac89..7b87b62cce 100644
--- a/isis/src/base/objs/UserInterface/UserInterface.cpp
+++ b/isis/src/base/objs/UserInterface/UserInterface.cpp
@@ -1150,12 +1150,10 @@ namespace Isis {
         else if (nextElementStarted && arrayString[strPos] == ' ') {
           // Make sure there's something before the next ',' or ')'
           bool onlyWhite = true;
-          int closingPos = strPos + 1;
 
           for( int pos = strPos;
                onlyWhite && arrayString[pos] != ',' && arrayString[pos] != ')' &&
                pos < arrayString.size(); pos++) {
-            closingPos++;
             onlyWhite &= (arrayString[pos] == ' ');
           }
 
diff --git a/isis/src/cassini/objs/VimsCamera/VimsCamera.cpp b/isis/src/cassini/objs/VimsCamera/VimsCamera.cpp
index 25ab7a752b..77591550f9 100644
--- a/isis/src/cassini/objs/VimsCamera/VimsCamera.cpp
+++ b/isis/src/cassini/objs/VimsCamera/VimsCamera.cpp
@@ -117,25 +117,11 @@ namespace Isis {
     QString intTime = stime.split(".").first();
     stime = stime.split(".").last();
 
-    double etStart = getClockTime(intTime).Et();
-
-    //  Add 2 seconds to either side of time range because the time are for IR
-    // channel, the VIS may actually start integrating before NATIVE_START_TIME.
-    //  This insures the cache is large enough.
-    etStart += toDouble(stime) / 15959.0 - 2.;
-
     // Get the end time in et
     QString etime = (QString) inst ["NativeStopTime"];
     intTime = etime.split(".").first();
     etime = etime.split(".").last();
 
-    double etStop = getClockTime(intTime).Et();
-
-    //  Add 2 seconds to either side of time range because the time are for IR
-    // channel, the VIS may actually start integrating before NATIVE_START_TIME.
-    //  This insures the cache is large enough.
-    etStop += toDouble(stime) / 15959.0 + 2.;
-
     //  Setup detector map
     new CameraDetectorMap(this);
 
diff --git a/isis/src/clementine/apps/clemnirnoise/main.cpp b/isis/src/clementine/apps/clemnirnoise/main.cpp
index fb862dd09b..d6cced980e 100644
--- a/isis/src/clementine/apps/clemnirnoise/main.cpp
+++ b/isis/src/clementine/apps/clemnirnoise/main.cpp
@@ -42,7 +42,6 @@ void NoiseFilter(Buffer &in, Buffer &out) {
   double diffSum;
   double diffAvg;
   int dCount;
-  int LCOUNT = 0;
 
   for(int il = 0; il < in.LineDimension(); il++) {
     for(int is = 0; is < in.SampleDimension(); is++) {
@@ -67,7 +66,6 @@ void NoiseFilter(Buffer &in, Buffer &out) {
       diffAvg = diffSum / dCount;
     }
     if(diffAvg > TOL1) {
-      LCOUNT++;
       for(int is = 1; is < in.SampleDimension() - 4; is += 4) {
         int index = in.SampleDimension() * il + is;
         out[index] = Isis::Null;
@@ -94,7 +92,6 @@ void NoiseFilter(Buffer &in, Buffer &out) {
       diffAvg = diffSum / dCount;
     }
     if(diffAvg > TOL2 && dCount > NPOS) {
-      LCOUNT++;
       for(int is = 4; is < in.SampleDimension() - 4; is += 4) {
         int index = in.SampleDimension() * il + is;
         out[index] = Isis::Null;
diff --git a/isis/src/clementine/apps/clemuvviscal/main.cpp b/isis/src/clementine/apps/clemuvviscal/main.cpp
index 1df043e9dc..232d42cdca 100644
--- a/isis/src/clementine/apps/clemuvviscal/main.cpp
+++ b/isis/src/clementine/apps/clemuvviscal/main.cpp
@@ -301,8 +301,8 @@ void UvVisCal(std::vector< Isis::Buffer * > &in, std::vector< Isis::Buffer * > &
     }
   }
 
-  delete sum;
-  delete ro;
+  delete[] sum;
+  delete[] ro;
 }
 
 /*
diff --git a/isis/src/control/apps/autoseed/autoseed.cpp b/isis/src/control/apps/autoseed/autoseed.cpp
index 7be0d37bf5..1787f9c1e9 100644
--- a/isis/src/control/apps/autoseed/autoseed.cpp
+++ b/isis/src/control/apps/autoseed/autoseed.cpp
@@ -201,8 +201,6 @@ namespace Isis {
     overlaps.ReadImageOverlaps(ui.GetFileName("OVERLAPLIST"));
 
     // Create a Universal Ground Map (UGM) for each image in the list
-    int stats_noOverlap = 0;
-    int stats_tolerance = 0;
 
     map<QString, UniversalGroundMap *> gMaps;
     for (int sn = 0; sn < serialNumbers.size(); ++sn) {
@@ -259,7 +257,6 @@ namespace Isis {
       progress.CheckStatus();
 
       if (overlaps[ov]->Size() == 1) {
-        stats_noOverlap++;
         continue;
       }
 
@@ -322,7 +319,6 @@ namespace Isis {
 
       // No points were seeded in this polygon, so collect some stats and move on
       if (points.size() == 0) {
-        stats_tolerance++;
         continue;
       }
 
diff --git a/isis/src/control/apps/cnetthinner/CnetSuppression.cpp b/isis/src/control/apps/cnetthinner/CnetSuppression.cpp
index ca8dc1b4dc..ef6de55152 100644
--- a/isis/src/control/apps/cnetthinner/CnetSuppression.cpp
+++ b/isis/src/control/apps/cnetthinner/CnetSuppression.cpp
@@ -673,7 +673,7 @@ namespace Isis {
     BOOST_ASSERT ( b1.dim1() == b2.dim1() );
     BitMask omask(b1.dim1());
     for (int i = 0 ; i < b1.dim1() ; i++) {
-      omask[i] = b1[i] | b2[i];
+      omask[i] = b1[i] || b2[i];
     }
     return (omask);
   }
diff --git a/isis/src/control/apps/findfeatures/RobustMatcher.cpp b/isis/src/control/apps/findfeatures/RobustMatcher.cpp
index ddecd87593..0bc6674f2a 100644
--- a/isis/src/control/apps/findfeatures/RobustMatcher.cpp
+++ b/isis/src/control/apps/findfeatures/RobustMatcher.cpp
@@ -670,7 +670,6 @@ int RobustMatcher::ratioTest(std::vector<std::vector<cv::DMatch> > &matches,
 
   int removed(0);
   int nInput(0);
-  int noTwoNN(0);
   int nfailed(0);
   // for all matches
   for (std::vector<std::vector<cv::DMatch> >::iterator matchIterator= matches.begin();
@@ -689,7 +688,6 @@ int RobustMatcher::ratioTest(std::vector<std::vector<cv::DMatch> > &matches,
     else { // does not have 2 neighbours
       matchIterator->clear(); // remove match
       removed++;
-      noTwoNN++;
     }
     nInput++;
   }
diff --git a/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp b/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp
index 23a66ca2bf..8f12d71f8a 100644
--- a/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp
+++ b/isis/src/control/objs/BundleAdjust/BundleAdjust.cpp
@@ -1228,7 +1228,6 @@ namespace Isis {
     // loop over 3D points
     int numObservations = 0;
     int numGood3DPoints = 0;
-    int numRejected3DPoints = 0;
     int numConstrainedCoordinates = 0;
     int num3DPoints = m_bundleControlPoints.size();
 
@@ -1239,7 +1238,6 @@ namespace Isis {
       BundleControlPointQsp point = m_bundleControlPoints.at(i);
 
       if (point->isRejected()) {
-        numRejected3DPoints++;
         continue;
       }
 
@@ -1285,8 +1283,6 @@ namespace Isis {
     m_bundleResults.setNumberConstrainedPointParameters(numConstrainedCoordinates);
     m_bundleResults.setNumberImageObservations(numObservations);
 
-    int numRejectedLidarPoints = 0.0;
-    int numGoodLidarPoints = 0.0;
     numObservations = 0;
     numConstrainedCoordinates = 0;
 
@@ -1300,7 +1296,6 @@ namespace Isis {
       BundleLidarControlPointQsp point = m_bundleLidarControlPoints.at(i);
 
       if (point->isRejected()) {
-        numRejectedLidarPoints++;
         continue;
       }
 
@@ -1336,8 +1331,6 @@ namespace Isis {
       m_numLidarConstraints += point->applyLidarRangeConstraints(m_sparseNormals, N22, N12, n1, n2);
 
       numConstrainedCoordinates += formLidarPointNormals(N22, N12, n2, m_RHS, point);
-
-      numGoodLidarPoints++;
     } // end loop over lidar 3D points
 
     m_bundleResults.setNumberLidarRangeConstraints(m_numLidarConstraints);
diff --git a/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp b/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp
index a298615b59..def372984d 100644
--- a/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp
+++ b/isis/src/kaguya/apps/kaguyasp2ascii/main.cpp
@@ -402,7 +402,7 @@ void IsisMain() {
       }
       os << endl;
      }
-     delete ref2;
+     delete[] ref2;
   }
   else {
     for (int i=minobs; i<=maxobs; i++) {
diff --git a/isis/src/lro/apps/lronaccal/lronaccal.cpp b/isis/src/lro/apps/lronaccal/lronaccal.cpp
index 6f9bf917eb..95aaa47245 100644
--- a/isis/src/lro/apps/lronaccal/lronaccal.cpp
+++ b/isis/src/lro/apps/lronaccal/lronaccal.cpp
@@ -492,10 +492,8 @@ namespace Isis {
     }
     TextFile file(filename.expanded());
     QString lineString;
-    unsigned int line = 0;
     while(file.GetLine(lineString)) {
       data.push_back(toDouble(lineString.split(QRegExp("[ ,;]")).first()));
-      line++;
     }
     fileString = filename.original();
   }
diff --git a/isis/src/messenger/apps/mdisedrinfo/MdisGeometry.cpp b/isis/src/messenger/apps/mdisedrinfo/MdisGeometry.cpp
index 22a58cac74..4d565e1906 100644
--- a/isis/src/messenger/apps/mdisedrinfo/MdisGeometry.cpp
+++ b/isis/src/messenger/apps/mdisedrinfo/MdisGeometry.cpp
@@ -737,9 +737,7 @@ namespace Isis {
     //  Determine instrument ID (inst)
     PvlKeyword &key = _label.findKeyword("NaifIkCode", PvlObject::Traverse);
     QString iCode = key[0];
-    SpiceInt inst = (int) key;
     key = _label.findKeyword("Number", PvlObject::Traverse);
-    inst -= (int) key;
 
     // Get CK time tolerance (tol)
     SpiceDouble tol;
diff --git a/isis/src/mgs/apps/mocuncompress/main.cpp b/isis/src/mgs/apps/mocuncompress/main.cpp
index 29828f1e5e..655ce79b05 100644
--- a/isis/src/mgs/apps/mocuncompress/main.cpp
+++ b/isis/src/mgs/apps/mocuncompress/main.cpp
@@ -497,8 +497,8 @@ int main(int argc, char **argv)
     lasth = h;
     fseek(infile, total + 2048, 0);
     count = fread(&h, sizeof(h), 1, infile);
-    MAKELONG(h.len);
-    if(count && MAKELONG(h.len) == 0) {
+    int32_t h_len = MAKELONG(h.len);
+    if(count && h_len == 0) {
       // simulate the EOF even though there's padding
       count = 0;
       h = lasth;
@@ -511,7 +511,7 @@ int main(int argc, char **argv)
       total_image += len;
     }
     if(count == 0) break;
-    if(MAKELONG(h.len) == 0) break;
+    if(h_len == 0) break;
     sequence += 1;
 
     if(first && !multi) {
diff --git a/isis/src/mro/apps/hicrop/hicrop.cpp b/isis/src/mro/apps/hicrop/hicrop.cpp
index b0c66f6f73..f6bd38efce 100644
--- a/isis/src/mro/apps/hicrop/hicrop.cpp
+++ b/isis/src/mro/apps/hicrop/hicrop.cpp
@@ -397,7 +397,6 @@ namespace Isis {
   void crop(Buffer &out) {
     // Read the input line
     int iline = g_cropStartLine + (out.Line() - 1);
-    int band = 1;
     g_in->SetLine(iline, 1);
     g_cube->read(*g_in);
 
@@ -405,8 +404,6 @@ namespace Isis {
     for (int i = 0; i < out.size(); i++) {
       out[i] = (*g_in)[i];
     }
-
-    if (out.Line() == g_cropLineCount) band++;
   }
 
   /**
diff --git a/isis/src/system/apps/isisdataeval/isisdataeval.cpp b/isis/src/system/apps/isisdataeval/isisdataeval.cpp
index 4d21fb1c95..4503fa3c92 100644
--- a/isis/src/system/apps/isisdataeval/isisdataeval.cpp
+++ b/isis/src/system/apps/isisdataeval/isisdataeval.cpp
@@ -276,7 +276,6 @@ namespace Isis {
         v_progress.SetText("inventory+"+hashtag);
         v_progress.SetMaximumSteps( v_isisdatadir.size() );
         v_progress.CheckStatus();
-        BigInt n_symlinks = 0;
         QCryptographicHash volume_hash( hash_algorithm );
 
         // Determine size (MB) of file buffer for hashing only if requested
@@ -297,7 +296,6 @@ namespace Isis {
 
             // Check for symbolic links
             if ( dbfile.isSymbolicLink() ) {
-              n_symlinks++;
 
               QString symtarget = dbfile.info().symLinkTarget();
               DBFileStatus symfile( symtarget );
diff --git a/isis/src/viking/apps/vikfixtrx/main.cpp b/isis/src/viking/apps/vikfixtrx/main.cpp
index c62f009249..68ee572385 100644
--- a/isis/src/viking/apps/vikfixtrx/main.cpp
+++ b/isis/src/viking/apps/vikfixtrx/main.cpp
@@ -64,8 +64,6 @@ void fixtrx(Buffer &in, Buffer &out) {
   }
 
   // Go fix the bad tracks
-  int trxflag = 0;
-  for(trk = 0; trk < 7; trxflag += badtrx[trk++]);
   for(trk = 0; trk < 7; trk++) {
     if(badtrx[trk] == true) {
       for(isamp = trk; isamp < nsamps; isamp += 7) {
diff --git a/isis/tests/FunctionalTestsMsi2isis.cpp b/isis/tests/FunctionalTestsMsi2isis.cpp
index 89f90b2a42..a5006e8a45 100644
--- a/isis/tests/FunctionalTestsMsi2isis.cpp
+++ b/isis/tests/FunctionalTestsMsi2isis.cpp
@@ -158,8 +158,6 @@ TEST_F(TempTestingFiles, Msi2isisTestGblIngestNoTrim) {
   EXPECT_NEAR(hist->StandardDeviation(), 0.017675184374796, .0001);
 
   // This section tests that the edge was not trimmed (TRIM=FALSE)
-  // Count the number of edge pixels
-  int total_edge_pixels = 0;
 
   const int trimSize = 33;
   const int expectValid = cube.sampleCount() - ( 2 * trimSize);
@@ -176,14 +174,12 @@ TEST_F(TempTestingFiles, Msi2isisTestGblIngestNoTrim) {
     const double *lbuf = line.DoubleBuffer();
     if ( (line.Line() <= trimSize) || ( line.Line() > end_l ) ) {
       trimEdge.AddData(&lbuf[0], line.size());
-      total_edge_pixels += line.size();
     }
     else {
 
       // This is past full line trimming and is on the edges only
       trimEdge.AddData(&lbuf[0], trimSize);
       trimEdge.AddData(&lbuf[end_s], trimSize);
-      total_edge_pixels += (trimSize + trimSize);
 
       // Add valid data in untrimmed area which should match the image
       // histogram data of whole trimmed image in the first test
-- 
GitLab