Add CodeQL for GitHub code scanning (#1548)

* Create codeql.yml

* Addressing codeql findings
This commit is contained in:
LordGrey
2022-12-27 08:36:10 +01:00
committed by GitHub
parent 1189f86c1a
commit 6fa7bab6f7
83 changed files with 1984 additions and 2094 deletions

View File

@@ -21,13 +21,6 @@
#include <utils/DefaultSignalHandler.h>
// Constants
namespace {
const char SERVICE_TYPE[] = "flatbuffer";
} //End of constants
using namespace commandline;
// save the image as screenshot

View File

@@ -22,13 +22,6 @@
//flatbuf sending
#include <flatbufserver/FlatBufferConnection.h>
// Constants
namespace {
const char SERVICE_TYPE[] = "flatbuffer";
} //End of constants
using namespace commandline;
// save the image as screenshot
@@ -49,7 +42,6 @@ int main(int argc, char ** argv)
<< "\tVersion : " << HYPERION_VERSION << " (" << HYPERION_BUILD_ID << ")" << std::endl
<< "\tbuild time: " << __DATE__ << " " << __TIME__ << std::endl;
//QCoreApplication app(argc, argv);
QGuiApplication app(argc, argv);
try

View File

@@ -29,14 +29,6 @@
#include <utils/DefaultSignalHandler.h>
// Constants
namespace {
const char SERVICE_TYPE[] = "jsonapi";
} //End of constants
using namespace commandline;
/// Count the number of true values in a list of booleans

View File

@@ -1,3 +1,5 @@
#include <cmath>
// Qt includes
#include <QImage>
#include <QCoreApplication>
@@ -102,7 +104,6 @@ bool ScreenshotHandler::findNoSignalSettings(const Image<ColorRgb> & image)
auto itG = std::max_element(std::begin(greenCounts), std::end(greenCounts));
auto itB = std::max_element(std::begin(blueCounts), std::end(blueCounts));
//std::cout << *itR << " " << *itG << " " << *itB << std::endl;
double xOffsetSuggested = xOffset;
double yOffsetSuggested = yOffset;
double xMaxSuggested = xMax;
@@ -138,7 +139,7 @@ bool ScreenshotHandler::findNoSignalSettings(const Image<ColorRgb> & image)
if (!noSignalBlack)
{
unsigned xMid = (xMaxSuggested + xOffsetSuggested) / 2;
for (unsigned y = yMid; y >= yOffset && yOffsetSuggested != y; --y)
for (unsigned y = yMid; y >= yOffset && (fabs(yOffsetSuggested - y) > std::numeric_limits<double>::epsilon()); --y)
{
ColorRgb rgb = image(xMid, y);
if (rgb <= noSignalThresholdColor)
@@ -147,7 +148,7 @@ bool ScreenshotHandler::findNoSignalSettings(const Image<ColorRgb> & image)
}
}
for (unsigned y = yMid; y <= yMax && yMaxSuggested != y; ++y)
for (unsigned y = yMid; y <= yMax && (fabs(yMaxSuggested - y) > std::numeric_limits<double>::epsilon()); ++y)
{
ColorRgb rgb = image(xMid, y);
if (rgb <= noSignalThresholdColor)

View File

@@ -33,13 +33,6 @@
#include <utils/DefaultSignalHandler.h>
// Constants
namespace {
const char SERVICE_TYPE[] = "flatbuffer";
} //End of constants
using namespace commandline;
int main(int argc, char** argv)

View File

@@ -19,13 +19,6 @@
#endif
#include <utils/NetUtils.h>
// Constants
namespace {
const char SERVICE_TYPE[] = "flatbuffer";
} //End of constants
using namespace commandline;
// save the image as screenshot

View File

@@ -19,13 +19,6 @@
#endif
#include <utils/NetUtils.h>
// Constants
namespace {
const char SERVICE_TYPE[] = "flatbuffer";
} //End of constants
using namespace commandline;
// save the image as screenshot