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