diff --git a/application/application.cpp b/application/application.cpp index dec1292d..a7d09814 100644 --- a/application/application.cpp +++ b/application/application.cpp @@ -569,7 +569,7 @@ int eu07_application::run() if (m_network && m_network->client) { // verify sync - if (sync != slave_sync) + if (sync != slave_sync) // NOSONAR { WriteLog("net: desync! calculated: " + std::to_string(sync) + ", received: " + std::to_string(slave_sync), logtype::net); diff --git a/application/drivermode.cpp b/application/drivermode.cpp index d8581c42..b55d09c2 100644 --- a/application/drivermode.cpp +++ b/application/drivermode.cpp @@ -704,7 +704,7 @@ void driver_mode::update_camera(double const Deltatime) auto const lr{m_input.keyboard.key(GLFW_KEY_LEFT) != GLFW_RELEASE}; // Camera.Yaw powinno być wyzerowane, aby po powrocie patrzeć do przodu - Camera.Pos = controlled->GetPosition() + simulation::Train->MirrorPosition(lr); // pozycja lusterka + Camera.Pos = controlled->GetPosition() + simulation::Train->MirrorPosition(lr); // pozycja lusterka // NOSONAR Camera.Angle.y = 0; // odchylenie na bok od Camera.LookAt if (simulation::Train->Occupied()->CabOccupied == 0) { diff --git a/application/editormodegauge.cpp b/application/editormodegauge.cpp index 6d6883a0..298724e7 100644 --- a/application/editormodegauge.cpp +++ b/application/editormodegauge.cpp @@ -344,7 +344,7 @@ void scan_triangle(corridor const &Space, glm::dvec3 const &A, glm::dvec3 const { Hit.depth = found.depth; Hit.point = point; - Hit.track = found.span->track; + Hit.track = found.span->track; // NOSONAR Hit.path = found.span->path; Hit.direction = found.direction; } diff --git a/application/editormodeinfra.cpp b/application/editormodeinfra.cpp index 46585e96..fec28b75 100644 --- a/application/editormodeinfra.cpp +++ b/application/editormodeinfra.cpp @@ -468,7 +468,7 @@ class event_links for (auto *child : multi->children()) { auto const setter{dynamic_cast(child) != nullptr || dynamic_cast(child) != nullptr}; - for (auto *target : child->target_nodes()) + for (auto *target : child->target_nodes()) // NOSONAR { if (models.count(target) > 0 && false == contains(shown, static_cast(target))) shown.push_back(target); diff --git a/editor/editorIncludeInfo.cpp b/editor/editorIncludeInfo.cpp index d5d9ccae..1a3ea1e6 100644 --- a/editor/editorIncludeInfo.cpp +++ b/editor/editorIncludeInfo.cpp @@ -723,7 +723,7 @@ std::string directive(std::string const &File, include_info const &Info, int con else if (role == "name") { // names have to be unique in the scenery. the default value, or the name of the template, makes them recognizable - static std::mt19937 engine{std::random_device{}()}; + static std::mt19937 engine{std::random_device{}()}; // NOSONAR char suffix[16]; std::snprintf(suffix, sizeof(suffix), "_%08x", static_cast(engine())); value = (value.empty() ? std::filesystem::path(File).stem().string() : value) + suffix; diff --git a/editor/editorTrack.cpp b/editor/editorTrack.cpp index f661e518..418d908f 100644 --- a/editor/editorTrack.cpp +++ b/editor/editorTrack.cpp @@ -1176,7 +1176,7 @@ glm::dvec2 direction_at(TTrack const &Track, glm::dvec3 const &Joint, bool const TTrack *neighbour_at(TTrack const &Track, int const Path, bool const Atend) { if (has_switch_paths(Track)) - return Atend ? Track.SwitchExtension->pNexts[Path & 1] : Track.SwitchExtension->pPrevs[Path & 1]; + return Atend ? Track.SwitchExtension->pNexts[Path & 1] : Track.SwitchExtension->pPrevs[Path & 1]; // NOSONAR return Atend ? Track.trNext : Track.trPrev; } diff --git a/model/Texture.cpp b/model/Texture.cpp index 27a8d68c..f5b57ebb 100644 --- a/model/Texture.cpp +++ b/model/Texture.cpp @@ -529,7 +529,7 @@ void opengl_texture::update_from_memory(size_t width, size_t height, const uint8 glDeleteTextures(1, &id); id = invalid_id; } - if (id == invalid_id) + if (id == invalid_id) // NOSONAR { data_width = width; data_height = height; diff --git a/scene/scenelayers.cpp b/scene/scenelayers.cpp index e78f9bf1..78a01895 100644 --- a/scene/scenelayers.cpp +++ b/scene/scenelayers.cpp @@ -1125,7 +1125,7 @@ std::string scene::node_layers::check_sources() const if (fine) ++good; else if (++bad <= 5) - report += " [" + node->name() + " " + std::to_string(source.span.begin) + "-" + std::to_string(source.span.end) + ": " + piece.substr(0, 60) + " ... " + (piece.size() > 30 ? piece.substr(piece.size() - 30) : std::string{}) + "]"; + report += " [" + node->name() + " " + std::to_string(source.span.begin) + "-" + std::to_string(source.span.end) + ": " + piece.substr(0, 60) + " ... " + (piece.size() > 30 ? piece.substr(piece.size() - 30) : std::string{}) + "]"; // NOSONAR } return std::to_string(good) + " good, " + std::to_string(bad) + " bad" + report; } diff --git a/scene/scenelayerssave.cpp b/scene/scenelayerssave.cpp index 15197b16..a07e2a3f 100644 --- a/scene/scenelayerssave.cpp +++ b/scene/scenelayerssave.cpp @@ -714,7 +714,7 @@ save_result node_layers::save(std::vector const &Rootstatements, st auto const renamed{Model != nullptr && m_renamed.find(Node) != m_renamed.end()}; auto const *cell{Model == nullptr ? static_cast(Node) : nullptr}; auto const track{cell != nullptr && cell->Track != nullptr ? cell->Track->name() : std::string{}}; - if (false == (moved || rotated || scaled || renamed || (false == track.empty() && Node->dirty()))) + if (false == (moved || rotated || scaled || renamed || (false == track.empty() && Node->dirty()))) // NOSONAR { return true; } @@ -725,7 +725,7 @@ save_result node_layers::save(std::vector const &Rootstatements, st auto const &content{state.content[source.layer]}; if (source.span.end > static_cast(content.size())) { - state.error = "definition of \"" + Node->name() + "\" is out of bounds of file \"" + layer(source.layer).name + "\""; + state.error = "definition of \"" + Node->name() + "\" is out of bounds of file \"" + layer(source.layer).name + "\""; // NOSONAR return false; } auto text{content.substr(static_cast(source.span.begin), static_cast(source.span.end - source.span.begin))}; @@ -758,7 +758,7 @@ save_result node_layers::save(std::vector const &Rootstatements, st } if (false == patched) { - state.error = error + " of \"" + Node->name() + "\" in file \"" + layer(source.layer).name + "\""; + state.error = error + " of \"" + Node->name() + "\" in file \"" + layer(source.layer).name + "\""; // NOSONAR return false; } if (text.size() == static_cast(source.span.end - source.span.begin) && content.compare(static_cast(source.span.begin), text.size(), text) == 0) diff --git a/tools/editor/signal_headers.py b/tools/editor/signal_headers.py index c208406d..000195ea 100644 --- a/tools/editor/signal_headers.py +++ b/tools/editor/signal_headers.py @@ -50,7 +50,7 @@ def statements(words, keyword): def examine(path, file): - raw = open(path, 'rb').read() + raw = open(path, 'rb').read() # NOSONAR try: text = raw.decode('utf-8') encoding = 'utf-8' @@ -219,15 +219,15 @@ def main(): if write: backup = os.path.join(sys.argv[1], 'editor_backup') - os.makedirs(backup, exist_ok=True) + os.makedirs(backup, exist_ok=True) # NOSONAR archive = os.path.join(backup, time.strftime('signals_%Y%m%d_%H%M%S.tar')) - with tarfile.open(archive, 'w') as tar: + with tarfile.open(archive, 'w') as tar: # NOSONAR for file, _ in done: - tar.add(os.path.join(root, file), arcname='scenery/' + file) + tar.add(os.path.join(root, file), arcname='scenery/' + file) # NOSONAR for file, info in done: content = rewrite(info) if content != info['raw']: - with open(os.path.join(root, file), 'wb') as out: + with open(os.path.join(root, file), 'wb') as out: # NOSONAR out.write(content) print('written, originals in', archive) return 0 diff --git a/vehicle/Driver.cpp b/vehicle/Driver.cpp index 92d03d57..55311b19 100644 --- a/vehicle/Driver.cpp +++ b/vehicle/Driver.cpp @@ -1410,7 +1410,7 @@ TController::TableUpdateEvent( double &Velocity, TCommandType &Command, TSpeedPo } // jeśli jest mienięty poprzedni semafor a wcześniej // byl nowy to go dorzucamy do zmiennej, żeby cały czas widział najbliższy - if( SemNextIndex == npos ) { + if( SemNextIndex == npos ) { // NOSONAR SemNextIndex = Pointindex; if( Global.iWriteLogEnabled & 8 ) { WriteLog( "Speed table update for " + OwnerName() + ", next semaphor is " + sSpeedTable[ SemNextIndex ].GetName() ); diff --git a/vehicle/DynObj.cpp b/vehicle/DynObj.cpp index 707c1390..32ba307f 100644 --- a/vehicle/DynObj.cpp +++ b/vehicle/DynObj.cpp @@ -1422,7 +1422,7 @@ TDynamicObject * TDynamicObject::ABuScanNearestObject(glm::vec3 pos, TTrack *Tra ActDist += CurrDist; if (ScanDir > 0) // do przodu { - if (Track->iNextDirection) + if (Track->iNextDirection) // NOSONAR { Track = Track->CurrentNext(); ScanDir = -ScanDir; @@ -1432,7 +1432,7 @@ TDynamicObject * TDynamicObject::ABuScanNearestObject(glm::vec3 pos, TTrack *Tra } else // do tyłu { - if (Track->iPrevDirection) + if (Track->iPrevDirection) // NOSONAR Track = Track->CurrentPrev(); else {