Codefactor review
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@
|
|||||||
${playqueue class="nav-link"}
|
${playqueue class="nav-link"}
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
${filters class="py-2 d-flex align-items-center"}
|
${filters class="nav-link d-flex align-items-center"}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="navbar-nav align-items-md-center mb-lg-0">
|
<div class="navbar-nav align-items-md-center mb-lg-0">
|
||||||
|
|||||||
+1
-1
@@ -89,7 +89,7 @@ body {
|
|||||||
.Lms-notification-container {
|
.Lms-notification-container {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 78px;
|
bottom: 78px;
|
||||||
right: 0px;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Lms-player {
|
.Lms-player {
|
||||||
|
|||||||
@@ -226,7 +226,6 @@ AvFormatParser::parse(const std::filesystem::path& p, bool debug)
|
|||||||
track.clusters[tag] = std::move(values);
|
track.clusters[tag] = std::move(values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
track.artists = getArtists(metadataMap);
|
track.artists = getArtists(metadataMap);
|
||||||
|
|||||||
@@ -148,7 +148,6 @@ getAlbum(const TagLib::PropertyMap& properties)
|
|||||||
void
|
void
|
||||||
TagLibParser::processTag(Track& track, const std::string& tag, const TagLib::StringList& values, bool debug)
|
TagLibParser::processTag(Track& track, const std::string& tag, const TagLib::StringList& values, bool debug)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
std::vector<std::string> strs;
|
std::vector<std::string> strs;
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ namespace SOM
|
|||||||
class DataNormalizer
|
class DataNormalizer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
struct MinMax
|
struct MinMax
|
||||||
{
|
{
|
||||||
InputVector::value_type min;
|
InputVector::value_type min;
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ class InputVector
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
friend class InputVector operator-(const InputVector& a, const InputVector& b)
|
friend class InputVector operator-(const InputVector& a, const InputVector& b)
|
||||||
{
|
{
|
||||||
if (!a.hasSameDimension(b.getNbDimensions()))
|
if (!a.hasSameDimension(b.getNbDimensions()))
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ template <typename T>
|
|||||||
class Matrix
|
class Matrix
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Matrix() = default;
|
Matrix() = default;
|
||||||
|
|
||||||
Matrix(Coordinate width, Coordinate height)
|
Matrix(Coordinate width, Coordinate height)
|
||||||
@@ -109,7 +108,6 @@ class Matrix
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Coordinate _width {};
|
Coordinate _width {};
|
||||||
Coordinate _height {};
|
Coordinate _height {};
|
||||||
std::vector<T> _values;
|
std::vector<T> _values;
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ std::ostream& operator<<(std::ostream& os, const InputVector& a);
|
|||||||
class Network
|
class Network
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Init a network with random values
|
// Init a network with random values
|
||||||
Network(Coordinate width, Coordinate height, std::size_t inputDimCount);
|
Network(Coordinate width, Coordinate height, std::size_t inputDimCount);
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,6 @@ class Response
|
|||||||
void addArrayChild(const std::string& key, Node node);
|
void addArrayChild(const std::string& key, Node node);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void setVersionAttribute(ProtocolVersion version);
|
void setVersionAttribute(ProtocolVersion version);
|
||||||
|
|
||||||
friend class Response;
|
friend class Response;
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ class FileResourceHandler final : public IResourceHandler
|
|||||||
FileResourceHandler(const std::filesystem::path& filePath);
|
FileResourceHandler(const std::filesystem::path& filePath);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Wt::Http::ResponseContinuation* processRequest(const Wt::Http::Request& request, Wt::Http::Response& response) override;
|
Wt::Http::ResponseContinuation* processRequest(const Wt::Http::Request& request, Wt::Http::Response& response) override;
|
||||||
|
|
||||||
static constexpr std::size_t _chunkSize {65536};
|
static constexpr std::size_t _chunkSize {65536};
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
class IConfig
|
class IConfig
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual ~IConfig() = default;
|
virtual ~IConfig() = default;
|
||||||
|
|
||||||
// Default values are returned in case of setting not found
|
// Default values are returned in case of setting not found
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
class UUID
|
class UUID
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static std::optional<UUID> fromString(std::string_view str);
|
static std::optional<UUID> fromString(std::string_view str);
|
||||||
|
|
||||||
std::string_view getAsString() const { return _value; }
|
std::string_view getAsString() const { return _value; }
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ namespace Zip
|
|||||||
class Zipper
|
class Zipper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Zipper(const std::map<std::string, std::filesystem::path>& files, const Wt::WDateTime& lastModifiedTime = {});
|
Zipper(const std::map<std::string, std::filesystem::path>& files, const Wt::WDateTime& lastModifiedTime = {});
|
||||||
|
|
||||||
static constexpr SizeType minOutputBufferSize {64};
|
static constexpr SizeType minOutputBufferSize {64};
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ processAuthToken(const Wt::WEnvironment& env)
|
|||||||
class AuthModel : public Wt::WFormModel
|
class AuthModel : public Wt::WFormModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Associate each field with a unique string literal.
|
// Associate each field with a unique string literal.
|
||||||
static const Field LoginNameField;
|
static const Field LoginNameField;
|
||||||
static const Field PasswordField;
|
static const Field PasswordField;
|
||||||
@@ -160,7 +159,6 @@ class AuthModel : public Wt::WFormModel
|
|||||||
std::optional<Database::UserId> getUserId() const { return _userId; }
|
std::optional<Database::UserId> getUserId() const { return _userId; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::optional<Database::UserId> _userId;
|
std::optional<Database::UserId> _userId;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -168,7 +166,6 @@ const AuthModel::Field AuthModel::LoginNameField {"login-name"};
|
|||||||
const AuthModel::Field AuthModel::PasswordField {"password"};
|
const AuthModel::Field AuthModel::PasswordField {"password"};
|
||||||
const AuthModel::Field AuthModel::RememberMeField {"remember-me"};
|
const AuthModel::Field AuthModel::RememberMeField {"remember-me"};
|
||||||
|
|
||||||
|
|
||||||
Auth::Auth()
|
Auth::Auth()
|
||||||
: Wt::WTemplateFormView {Wt::WString::tr("Lms.Auth.template")}
|
: Wt::WTemplateFormView {Wt::WString::tr("Lms.Auth.template")}
|
||||||
{
|
{
|
||||||
@@ -217,7 +214,6 @@ Auth::Auth()
|
|||||||
loginBtn->clicked().connect(this, processAuth);
|
loginBtn->clicked().connect(this, processAuth);
|
||||||
|
|
||||||
updateView(model.get());
|
updateView(model.get());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace UserInterface
|
} // namespace UserInterface
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ class ModalManager;
|
|||||||
class LmsApplication : public Wt::WApplication
|
class LmsApplication : public Wt::WApplication
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
LmsApplication(const Wt::WEnvironment& env, Database::Db& db, LmsApplicationManager& appManager, std::optional<Database::UserId> userId = std::nullopt);
|
LmsApplication(const Wt::WEnvironment& env, Database::Db& db, LmsApplicationManager& appManager, std::optional<Database::UserId> userId = std::nullopt);
|
||||||
~LmsApplication();
|
~LmsApplication();
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,6 @@ class SettingsModel : public Wt::WFormModel
|
|||||||
{
|
{
|
||||||
_authPasswordService->setPassword(user->getId(), valueText(PasswordField).toUTF8());
|
_authPasswordService->setPassword(user->getId(), valueText(PasswordField).toUTF8());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadData()
|
void loadData()
|
||||||
|
|||||||
@@ -143,7 +143,6 @@ class DatabaseSettingsModel : public Wt::WFormModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void initializeModels()
|
void initializeModels()
|
||||||
{
|
{
|
||||||
_updatePeriodModel = std::make_shared<ValueStringModel<ScanSettings::UpdatePeriod>>();
|
_updatePeriodModel = std::make_shared<ValueStringModel<ScanSettings::UpdatePeriod>>();
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ namespace UserInterface {
|
|||||||
class InitWizardModel : public Wt::WFormModel
|
class InitWizardModel : public Wt::WFormModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Associate each field with a unique string literal.
|
// Associate each field with a unique string literal.
|
||||||
static inline const Field AdminLoginField {"admin-login"};
|
static inline const Field AdminLoginField {"admin-login"};
|
||||||
static inline const Field PasswordField {"password"};
|
static inline const Field PasswordField {"password"};
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ class InitWizardView : public Wt::WTemplateFormView
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InitWizardView();
|
InitWizardView();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace UserInterface
|
} // namespace UserInterface
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ durationToString(const Wt::WDateTime& begin, const Wt::WDateTime& end)
|
|||||||
class ReportResource : public Wt::WResource
|
class ReportResource : public Wt::WResource
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ReportResource()
|
ReportResource()
|
||||||
{
|
{
|
||||||
suggestFileName("report.txt");
|
suggestFileName("report.txt");
|
||||||
@@ -268,7 +267,6 @@ ScannerController::refreshContents()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace UserInterface
|
} // namespace UserInterface
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ using namespace Database;
|
|||||||
|
|
||||||
class UserModel : public Wt::WFormModel
|
class UserModel : public Wt::WFormModel
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static inline const Field LoginField {"login"};
|
static inline const Field LoginField {"login"};
|
||||||
static inline const Field PasswordField {"password"};
|
static inline const Field PasswordField {"password"};
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ template <typename T>
|
|||||||
class ValueStringModel : public Wt::WStringListModel
|
class ValueStringModel : public Wt::WStringListModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
T getValue(std::size_t row) const
|
T getValue(std::size_t row) const
|
||||||
{
|
{
|
||||||
return Wt::cpp17::any_cast<T>(data(index(static_cast<int>(row), 0), Wt::ItemDataRole::User));
|
return Wt::cpp17::any_cast<T>(data(index(static_cast<int>(row), 0), Wt::ItemDataRole::User));
|
||||||
@@ -78,7 +77,6 @@ class ValueStringModel : public Wt::WStringListModel
|
|||||||
{
|
{
|
||||||
removeRows(0, rowCount());
|
removeRows(0, rowCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace UserInterface
|
} // namespace UserInterface
|
||||||
|
|||||||
@@ -124,7 +124,6 @@ Filters::showDialog()
|
|||||||
void
|
void
|
||||||
Filters::add(ClusterId clusterId)
|
Filters::add(ClusterId clusterId)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (std::find(std::cbegin(_clusterIds), std::cend(_clusterIds), clusterId) != std::cend(_clusterIds))
|
if (std::find(std::cbegin(_clusterIds), std::cend(_clusterIds), clusterId) != std::cend(_clusterIds))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ namespace UserInterface::TrackListHelpers
|
|||||||
starBtn->setText(Wt::WString::tr("Lms.Explore.unstar"));
|
starBtn->setText(Wt::WString::tr("Lms.Explore.unstar"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
entry->bindNew<Wt::WPushButton>("download", Wt::WString::tr("Lms.Explore.download"))
|
entry->bindNew<Wt::WPushButton>("download", Wt::WString::tr("Lms.Explore.download"))
|
||||||
|
|||||||
@@ -194,7 +194,6 @@ int main(int argc, char *argv[])
|
|||||||
parse(parser, file);
|
parse(parser, file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ class GeneticAlgorithm
|
|||||||
Individual simulate(const std::vector<Individual>& initialPopulation);
|
Individual simulate(const std::vector<Individual>& initialPopulation);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
struct ScoredIndividual
|
struct ScoredIndividual
|
||||||
{
|
{
|
||||||
Individual individual;
|
Individual individual;
|
||||||
|
|||||||
@@ -324,7 +324,6 @@ static
|
|||||||
void
|
void
|
||||||
printBadlyClassifiedTracks(Database::Session& session, FeaturesSearcher::TrainSettings trainSettings)
|
printBadlyClassifiedTracks(Database::Session& session, FeaturesSearcher::TrainSettings trainSettings)
|
||||||
{
|
{
|
||||||
|
|
||||||
FeaturesSearcher searcher {session, trainSettings};
|
FeaturesSearcher searcher {session, trainSettings};
|
||||||
|
|
||||||
const std::vector<Database::IdType> trackIds = std::invoke([&]()
|
const std::vector<Database::IdType> trackIds = std::invoke([&]()
|
||||||
@@ -384,7 +383,6 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
// log to stdout
|
// log to stdout
|
||||||
// ServiceProvider<Logger>::create<StreamLogger>(std::cout);
|
// ServiceProvider<Logger>::create<StreamLogger>(std::cout);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user