mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Add CodeQL for GitHub code scanning (#1548)
* Create codeql.yml * Addressing codeql findings
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user