{"id":336734,"date":"2022-08-08T15:00:51","date_gmt":"2022-08-08T15:00:51","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=336734"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=336734","title":{"rendered":"<span>\u0410\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 PVS-Studio \u0440\u0430\u0441\u043f\u0443\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0432 PVS-Studio. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e\u0431 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430, \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438 \u0443\u0432\u0438\u0434\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u044d\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b6e\/ca7\/207\/b6eca72074742e1301f6c737e7dc01fc.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b6e\/ca7\/207\/b6eca72074742e1301f6c737e7dc01fc.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435?<\/h3>\n<p>\u0413\u043e\u0432\u043e\u0440\u044f \u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0432 \u0432\u0438\u0434\u0443 \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u043e\u0439. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441 <em>null<\/em>.<\/p>\n<pre><code class=\"cs\">var variable = GetPotentialNull(); bool flag = variable != null; <\/code><\/pre>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>flag<\/em> \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>variable<\/em>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u0438 \u0447\u0443\u0442\u044c \u0434\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u0432\u044f\u0437\u0435\u0439. \u0421\u0435\u0439\u0447\u0430\u0441 \u0436\u0435 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u0435\u043c \u2013 \u0447\u0435\u043c \u0442\u0430\u043a\u0438\u0435 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0448\u0430\u044e\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443?<\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e PVS-Studio \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u0430 \u043d\u0430 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e <em>null<\/em>, \u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u2013 \u0432 then-\u0432\u0435\u0442\u043a\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u043d\u0443\u043b\u0435\u0432\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443.<\/p>\n<p>\u041a\u0443\u0434\u0430 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u043d\u0435\u044f\u0432\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0434\u0440\u0443\u0433\u043e\u0439. \u0415\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439.<\/p>\n<p>\u041f\u043e\u0434 \u044d\u0442\u0438\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0430 \u0431\u0435\u0437\u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434. \u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0440\u0438\u0447\u0438\u043d \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e <em>null<\/em> \u0438 \u0434\u0430\u043b\u0435\u0435 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<pre><code class=\"cs\">public void Test() {   var variable = GetPotentialNull();   bool check = variable != null;   if (check)   {     _ = variable.GetHashCode(); \/\/ &lt;=   } } <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0441\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 false positive.<\/p>\n<p>\u041b\u043e\u0436\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u044e\u0442 \u0447\u0442\u0435\u043d\u0438\u0435 \u043e\u0442\u0447\u0451\u0442\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u0430 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043f\u0440\u043e\u0432\u043e\u0446\u0438\u0440\u0443\u044e\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043d\u0430 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u043e\u043a. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f\u0445 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u043d\u0438\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u0439 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0488\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u0434\u0440\u0443\u0433\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \u043c\u0435\u0434\u0430\u043b\u0438. \u0415\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0432\u044b\u0434\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043a\u043e\u0434\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 :(.<\/p>\n<p>\u0412\u044b\u0448\u0435\u0434\u0448\u0430\u044f \u0432 \u0430\u043f\u0440\u0435\u043b\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0942\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u043f\u0440\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0432 PVS-Studio \u0431\u044b\u043b\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439. \u041e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0448\u0438\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432, \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u0432\u044f\u0437\u0435\u0439, \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0435\u0451 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u043c\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0443 \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <em>if&#8230;else<\/em>. \u0418, \u0435\u0441\u043b\u0438 \u0432\u044b \u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0434\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u043c\u0435\u0442\u043a\u0443, \u0442\u043e \u043c\u044b \u043c\u043e\u043b\u043e\u0434\u0446\u044b \u0438 \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 :).<\/p>\n<h3>\u0421\u0438\u043d\u0442\u0435\u0442\u0438\u043a\u0430<\/h3>\n<p>\u041b\u0435\u0433\u0447\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0441\u0432\u044f\u0437\u0435\u0439 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u041f\u043e\u0441\u043b\u0435 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u043a\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<pre><code class=\"cs\">public void TestRelations(bool condition) {   object variable = condition ? \"notNull\" : GetPotentialNull();   if (condition)     _ = variable.GetHashCode(); } <\/code><\/pre>\n<p>\u041a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <em>null<\/em>:<\/p>\n<pre><code class=\"cs\">private static string GetPotentialNull() {   return random.NextDouble() > 0.5 ? \"str\" : null; } <\/code><\/pre>\n<p>\u0420\u0430\u043d\u0435\u0435 PVS-Studio \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043b\u043e\u0436\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432 \u0442\u0435\u043b\u0435 <em>if<\/em>. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e, \u043a\u043e\u0433\u0434\u0430 <em>condition<\/em> \u0440\u0430\u0432\u0435\u043d <em>true<\/em>, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>variable<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043e\u0442 <em>null<\/em>. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u044d\u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0441, \u043d\u043e \u043d\u0435 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043d\u043e\u0432\u044b\u043c \u043f\u0440\u0430\u0432\u043a\u0430\u043c \u043e\u043d \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>condition<\/em> \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>variable<\/em>.<\/p>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>variable<\/em> \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>condition<\/em>:<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 <em>condition == true<\/em>, \u0442\u043e \u0432 <em>variable<\/em> \u0442\u043e\u0447\u043d\u043e \u043d\u0435 <em>null<\/em>;<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 <em>condition == false<\/em>, \u0442\u043e \u0432 <em>variable<\/em> \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u0437\u043d\u0430\u0451\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>condition<\/em>, \u0442\u043e \u043e\u043d \u0443\u0437\u043d\u0430\u0451\u0442 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>variable<\/em>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0432 \u0442\u0435\u043b\u043e \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>condition<\/em> \u0442\u0430\u043c \u0440\u0430\u0432\u043d\u0430 <em>true<\/em>, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 <em>variable<\/em> \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0431\u044b\u043b\u0438 \u0441\u0432\u044f\u0437\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0440\u043e\u0438\u043b\u0438\u0441\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <em>if<\/em>. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439.<\/p>\n<pre><code class=\"cs\">public void TestRelations2(bool condition) {   object variable;   if (condition)     variable = \"notNull\";   else     variable = GetPotentialNull();    if (condition)     _ = variable.GetHashCode(); } <\/code><\/pre>\n<p>PVS-Studio \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u0447\u0442\u043e \u044f \u043e\u043f\u0438\u0441\u0430\u043b \u0440\u0430\u043d\u0435\u0435 \u0441 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c. \u041f\u043e\u0434 \u0432\u0442\u043e\u0440\u044b\u043c <em>if<\/em> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>variable<\/em> \u043d\u0435 \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>. \u0422\u0435\u043f\u0435\u0440\u044c PVS-Studio \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0438 \u044d\u0442\u043e\u0442 \u0442\u0438\u043f \u0441\u0432\u044f\u0437\u0435\u0439.<\/p>\n<h3>\u041a\u0430\u043a \u0436\u0435 \u043c\u044b \u044d\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c?<\/h3>\n<p>\u0420\u0430\u0431\u043e\u0442\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043c\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u043a\u0435, \u043d\u043e \u0438 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 Open Source \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0430\u043f\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u043c\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u044d\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u0447\u0451\u0442\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u0442\u0435\u043c \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u043a\u0438, \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0439\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u043e\u0442\u0447\u0451\u0442\u044b;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0438 \u0441\u0442\u0430\u0440\u044b\u0445 \u043e\u0442\u0447\u0451\u0442\u043e\u0432 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043e\u0442\u0447\u0451\u0442 \u0441 \u0434\u0432\u0443\u043c\u044f \u0442\u0438\u043f\u0430\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439: missing \u2013 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0438\u0441\u0447\u0435\u0437\u043b\u043e, additional \u2013 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>\u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0434 \u043d\u043e\u0432\u044b\u043c\u0438 \u0438\u043b\u0438 \u043f\u0440\u043e\u043f\u0430\u0432\u0448\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c. \u041f\u0440\u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u044f \u043f\u043e\u0447\u0442\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438: \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043b\u0438 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435? \u0434\u043e\u043b\u0436\u043d\u043e \u043b\u0438 \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u043f\u0430\u0441\u0442\u044c \u0438\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f? \u043a\u0430\u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u044d\u0442\u043e \u043f\u043e\u043d\u044f\u043b?<\/p>\n<h3>\u0422\u0430\u043a \u0441\u0442\u0430\u043b\u043e \u043b\u0438 \u043b\u0443\u0447\u0448\u0435?<\/h3>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u043b\u0430\u043b\u0430\u0441\u044c \u0434\u043b\u044f \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0432\u044f\u0437\u0435\u0439 \u043f\u043e\u043c\u043e\u0433\u043b\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u043f\u043b\u043e\u0445\u0438\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0435. &#171;\u0420\u0430\u0441\u043f\u0443\u0442\u044b\u0432\u0430\u043d\u0438\u0435&#187; \u0441\u0432\u044f\u0437\u0435\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 PVS-Studio \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u043e\u0433 \u043d\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043f\u0440\u043e \u0441\u0432\u044f\u0437\u044c \u0438\u043b\u0438 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u0435\u0451, \u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c. \u0412 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u043a\u043e\u0434\u0430 \u0438, \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0432\u043e\u0435\u0433\u043e. \u041f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u043b \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443, \u0430 \u0443 \u0442\u0435\u0431\u044f \u0443\u0436\u0435 \u0432\u0441\u0451 \u043d\u0435 \u0442\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0433\u0434\u0435-\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b. \u0421 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437.<\/p>\n<p>\u0412\u044b\u0448\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0442\u0435\u0440\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0434\u0435\u043b\u0443 :).<\/p>\n<h4>Additional<\/h4>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u043d\u043e\u0432\u044b\u0445 \u0441\u0432\u044f\u0437\u0435\u0439.<\/p>\n<p><strong>Issue 1<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0430\u043d\u043e \u043d\u0430 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <a href=\"https:\/\/github.com\/KeenSoftwareHouse\/SpaceEngineers\">SpaceEngineers<\/a>.<\/p>\n<pre><code class=\"cs\">public bool RemovePilot() {   bool usePilotOriginalWorld = false;   ....   Vector3D? allowedPosition = null;   if (!usePilotOriginalWorld)   {     allowedPosition = FindFreeNeighbourPosition();      if (!allowedPosition.HasValue)       allowedPosition = PositionComp.GetPosition();   }    RemovePilotFromSeat(m_pilot);   EndShootAll();    if (usePilotOriginalWorld || allowedPosition.HasValue)  \/\/ &lt;=   {     ....   } } <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;usePilotOriginalWorld || allowedPosition.HasValue&#8217; is always true. MyCockpit.cs 666<\/p>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <em>usePilotOriginalWorld || allowedPosition.HasValue<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>true.<\/em> \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p>\u041f\u043e\u0434\u043d\u0438\u043c\u0435\u043c\u0441\u044f \u043f\u043e \u043a\u043e\u0434\u0443 \u0447\u0443\u0442\u044c \u0432\u044b\u0448\u0435. \u0417\u0430\u043c\u0435\u0447\u0430\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>usePilotOriginalWorld<\/em> \u0440\u0430\u0432\u043d\u0430 <em>false<\/em>, \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>allowedPosition<\/em> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>FindFreeNeighbourPosition<\/em>. \u041e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 nullable-\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\n<p><em>allowedPosition.HasValue<\/em> \u0440\u0430\u0432\u043d\u043e <em>true<\/em>;<\/p>\n<\/li>\n<li>\n<p><em>allowedPosition.HasValue<\/em> \u0440\u0430\u0432\u043d\u043e <em>false<\/em>. \u0422\u043e\u0433\u0434\u0430 <em>allowedPosition<\/em> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <em>GetPosition<\/em>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <em>HasValue<\/em> \u0443 <em>allowedPosition<\/em> \u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 <em>true<\/em>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u0435\u0442\u043e\u0434 <em>GetPosition<\/em>:<\/p>\n<pre><code class=\"cs\">public Vector3D GetPosition() {   return this.m_worldMatrix.Translation; } <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>usePilotOriginalWorld<\/em> \u0440\u0430\u0432\u043d\u0430 <em>false<\/em>, \u0442\u043e \u0432 <em>allowedPosition<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 nullable-\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>HasValue<\/em> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e <em>true<\/em>.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 <em>usePilotOriginalWorld<\/em> \u0440\u0430\u0432\u043d\u043e <em>true<\/em>, \u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u043e;<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 <em>usePilotOriginalWorld<\/em> \u0440\u0430\u0432\u043d\u043e <em>false<\/em>, \u0442\u043e <em>allowedPosition.HasValue<\/em> \u0432\u0435\u0440\u043d\u0451\u0442 <em>true<\/em> \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u0442\u0438\u043d\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0430\u043d\u043e \u043d\u0430 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434.<\/p>\n<pre><code class=\"cs\">if (usePilotOriginalWorld || allowedPosition.HasValue) {   ....   return true; } return false;    \/\/ &lt;= <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3142\/\">V3142<\/a> Unreachable code detected. It is possible that an error is present. MyCockpit.cs 728<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0442\u0435\u043b\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>return<\/em>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, <em>return false<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 \u0432\u0441\u0451 \u0442\u0430\u043a \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c?<\/p>\n<p><strong>Issue 2<\/strong><\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u043e \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435&#8230; PVS-Studio. \u0414\u0430, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043d\u043e\u0432\u044b\u043c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u043d\u0435\u0434\u043e\u0447\u0451\u0442 \u0443 \u0441\u0435\u0431\u044f \u0436\u0435. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0448\u0438 \u043d\u043e\u0447\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0433\u0434\u0430 PVS-Studio \u0438\u0449\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 PVS-Studio.<\/p>\n<pre><code class=\"cs\">private static bool? IsTrivialProperty_internal(....) {   AssignmentExpressionSyntax setBody = null;   if (!checkOnlyRead)   {     var setBodyFirst = setAccessorBody?.ChildNodes().FirstOrDefault();     setBody = ....;     if (setBody == null)       return false;     ....   }    getValue = ....;    try   {     if (checkOnlyRead)     {       return IsTrivialGetterField(model, ref getValue, maybeTrue);     }     else     {       ExpressionSyntax setValue = setBody?.Left.SkipParenthesize();    \/\/ &lt;=       ....     }   }    catch (ArgumentException)   {....} } <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;setBody&#8217; is always not null. The operator &#8216;?.&#8217; is excessive. TypeUtils.cs 309<\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <em>Left<\/em> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>setBody<\/em> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u043f\u0430\u043b\u0438 \u0432 \u0432\u0435\u0442\u0432\u044c else, \u0442\u043e <em>checkOnlyRead<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>false<\/em>. \u041f\u043e\u0434\u043d\u0438\u043c\u0435\u043c\u0441\u044f \u0447\u0443\u0442\u044c \u0432\u044b\u0448\u0435, \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u043c\u0443 <em>if<\/em>. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 <em>checkOnlyRead<\/em>, \u0440\u0430\u0432\u043d\u043e\u043c <em>false<\/em>, \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>setBody == null<\/em>. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>true<\/em>, \u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430, \u0438 \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e <em>if<\/em> \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0434\u043e\u0439\u0434\u0451\u0442. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 <em>checkOnlyRead<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>false<\/em>, \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>setBody<\/em> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;?.&#8217; \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0438 \u0435\u0433\u043e \u0441\u0442\u043e\u0438\u0442 \u0443\u0431\u0440\u0430\u0442\u044c. \u0427\u0442\u043e \u043c\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 :).<\/p>\n<p><strong>Issue 3<\/strong><\/p>\n<p>\u0410 \u0432\u043e\u0442 \u044d\u0442\u043e \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <a href=\"https:\/\/github.com\/umbraco\/Umbraco-CMS\">Umbraco<\/a> \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043b\u043e \u043c\u0435\u043d\u044f \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0434\u0430\u0436\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u043b, \u0447\u0442\u043e \u043e\u043d\u043e \u043b\u043e\u0436\u043d\u043e\u0435.<\/p>\n<pre><code class=\"cs\">private PublishResult CommitDocumentChangesInternal(....) {   ....   if (unpublishing)   {     ....                     if (content.Published)     {       unpublishResult = StrategyCanUnpublish(....);       if (unpublishResult.Success)       {         unpublishResult = StrategyUnpublish(....);       }       else{....}     }      else     {       throw new InvalidOperationException(\"Concurrency collision.\");     }   }   ....   if (unpublishing)   {     if (unpublishResult?.Success ?? false)                       \/\/ &lt;=     {       ....     }     ....   }   .... } <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;unpublishResult&#8217; is always not null. The operator &#8216;?.&#8217; is excessive. ContentService.cs 1553<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;?.&#8217; \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u0435\u043d. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f. \u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <em>Success<\/em> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>unpublishing<\/em> \u0440\u0430\u0432\u043d\u0430 <em>true<\/em>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c, \u043a\u0430\u043a \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n<p>\u041f\u043e\u0434\u043d\u0438\u043c\u0435\u043c\u0441\u044f \u043f\u043e\u0432\u044b\u0448\u0435 \u0438 \u0443\u0432\u0438\u0434\u0438\u043c \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435, \u043a\u0430\u043a \u043c\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c <em>true<\/em>. \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432\u043d\u0443\u0442\u0440\u044c \u0438 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043f\u0443\u0442\u0438 <em>if (content.Published)<\/em>. \u0421\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0432\u0435\u0440\u043d\u0451\u0442 <em>true<\/em>, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u041f\u043e\u0434 \u044d\u0442\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>unpublishResult<\/em> \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430. \u041e\u0431\u0430 \u0432\u044b\u0437\u043e\u0432\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u043e\u0442 <em>null<\/em>.<\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <em>StrategyCanUnpublish<\/em>:<\/p>\n<pre><code class=\"cs\">private PublishResult StrategyCanUnpublish(....) {   if (scope.Notifications.PublishCancelable(....)   {     ....     return new PublishResult(....);   }   return new PublishResult(....); } <\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 <em>StrategyUnpublish<\/em>:<\/p>\n<pre><code class=\"cs\">private PublishResult StrategyUnpublish(....) {   var attempt = new PublishResult(....);   if (attempt.Success == false)   {     return attempt;   }   ....   return attempt; } <\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>unpublishing<\/em> \u0440\u0430\u0432\u043d\u0430 <em>true<\/em>, \u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>\u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435;<\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>unpublishResult<\/em> \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043e\u0442 <em>null<\/em>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 <em>null<\/em> \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c. \u0424\u0443\u0445, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0443\u0442\u0430\u043b\u0441\u044f.<\/p>\n<p>\u0421\u0430\u043c\u044b\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;??&#8217; \u0432 \u0442\u043e\u043c \u0436\u0435 \u043c\u0435\u0441\u0442\u0435 \u0442\u043e\u0436\u0435 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435:<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;unpublishResult?.Success&#8217; is always not null. The operator &#8216;??&#8217; is excessive. ContentService.cs 1553<\/p>\n<h4>Missing<\/h4>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u0447\u0435\u0437\u043b\u0438 \u0438\u0437-\u0437\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.<\/p>\n<p><strong>Issue 1<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0432\u044b\u0441\u0442\u0443\u043f\u0438\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <a href=\"https:\/\/github.com\/Unity-Technologies\/UnityCsReference\">Unity<\/a>:<\/p>\n<pre><code class=\"cs\">public void DoGUI(....) {   using (var iter = fetchData ? new ProfilerFrameDataIterator() : null)   {     int threadCount = fetchData ? iter.GetThreadCount(frameIndex) : 0; \/\/ &lt;=     iter?.SetRoot(frameIndex, 0);     ....   } } <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3095\/\">V3095<\/a> The &#8216;iter&#8217; object was used before it was verified against null. Check lines: 2442, 2443. ProfilerTimelineGUI.cs 2442<\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 PVS-Studio \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 <em>iter<\/em> \u043d\u0430 <em>null<\/em>, \u0430 \u0432\u043e\u0442 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>iter<\/em> \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u0430 <em>null<\/em> \u0432 then-\u0432\u0435\u0442\u043a\u0435 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430. \u0412\u0441\u0451 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <em>iter<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em> \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>fetchData<\/em> \u0440\u0430\u0432\u043d\u0430 <em>false<\/em>, \u0430 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043f\u0440\u0438 <em>fetchData<\/em> == <em>true<\/em>.<\/p>\n<p><strong>Issue 2<\/strong><\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043b\u043e\u0436\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 <a href=\"https:\/\/github.com\/pascalabcnet\/pascalabcnet\">PascalABC.NET<\/a> \u0438\u0441\u0447\u0435\u0437\u043b\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043d\u043e\u0432\u044b\u043c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c.<\/p>\n<pre><code class=\"cs\">private void ConvertTypeHeader(ICommonTypeNode value) {   ....   TypeInfo ti = helper.GetTypeReference(value);   bool not_exist = ti == null;   ....   if (not_exist)   {     ti = helper.AddType(value, tb);   }   if (value.type_special_kind == type_special_kind.array_wrapper)   {     ti.is_arr = true;        \/\/ &lt;=   }   .... } <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3080\/\">V3080<\/a> Possible null dereference. Consider inspecting &#8216;ti&#8217;. NETGenerator.cs 2391<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438. \u0418\u0441\u0447\u0435\u0437\u043b\u043e \u043e\u043d\u043e, \u043a\u0441\u0442\u0430\u0442\u0438, \u043d\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u043d\u043e\u0432\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0441\u0432\u044f\u0437\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u043d\u0430 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u043a\u0435. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0442\u0443\u0442 \u0441\u0432\u044f\u0437\u044c \u0431\u044b\u043b\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430\u043c\u0438 \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0942\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>, \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c. \u041f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u043e\u043d\u043e \u043f\u0440\u043e\u043f\u0430\u043b\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0439\u0447\u0430\u0441? \u0412\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e: \u043c\u044b \u0441\u043b\u0435\u0433\u043a\u0430 \u0434\u043e\u043f\u0438\u043b\u0438\u043b\u0438 \u043e\u0431\u0449\u0438\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0443\u0447\u0451\u0442\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0432\u044f\u0437\u0435\u0439.<\/p>\n<p>\u0414\u043e \u043c\u0435\u0441\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440, \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>if (not_exist)<\/em>. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>true<\/em>, \u0442\u043e <em>ti<\/em> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>AddType<\/em>.<\/p>\n<pre><code class=\"cs\">public TypeInfo AddType(ITypeNode type, TypeBuilder tb) {   TypeInfo ti = new TypeInfo(tb);   defs[type] = ti;   return ti; } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>null<\/em>.<\/p>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u0443\u043a\u043e\u0440\u043e\u0447\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0432\u0441\u0451 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c, \u043d\u043e \u044d\u0442\u0438 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a. \u042d\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043f\u0440\u0438\u0447\u0451\u043c \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \u043a\u043e\u0434\u0430. \u0414\u0430\u043d\u043d\u043e\u0435 \u043b\u043e\u0436\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0433\u043b\u043e \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430, \u0438 \u0434\u0430\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0432 \u043a\u043e\u0434 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u043e\u0448\u0438\u0431\u043e\u043a. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u0432\u044f\u0437\u0435\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0436\u0438\u0437\u043d\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0449\u0435.<\/p>\n<p><strong>Issue 3<\/strong><\/p>\n<p>\u0414\u0432\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 <a href=\"https:\/\/github.com\/pascalabcnet\/pascalabcnet\">PascalABC.NET<\/a> \u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044e \u0432 \u043e\u0434\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u043b\u0443\u0447\u0448\u0435 \u0432\u043c\u0435\u0441\u0442\u0435.<\/p>\n<pre><code class=\"cs\">public common_type_node instance(....) {   class_definition cl_def = tc.type_dec.type_def as class_definition;   template_type_name ttn = tc.type_dec.type_name as template_type_name;   if (!tc.is_synonym)   {    if (cl_def == null)    {      throw new CompilerInternalError(....);    }    if (cl_def.template_args == null || cl_def.template_args.idents == null)    {      throw new CompilerInternalError(....);    }   }   else   {     if (ttn == null)                                               \/\/ &lt;=     {       throw new CompilerInternalError(\"No template name.\");     }   }    List&lt;SyntaxTree.ident> template_formals = (tc.is_synonym) ?     ttn.template_args.idents : cl_def.template_args.idents;        \/\/ &lt;=      if (template_formals.Count != ttn.template_args.idents.Count)   {     ....   } } <\/code><\/pre>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043b\u043e\u0436\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u043e\u043f\u0430\u043b\u043e \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043e\u043a.<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3125\/\">V3125<\/a> The &#8216;ttn&#8217; object was used after it was verified against null. Check lines: 18887, 18880. syntax_tree_visitor.cs 18887<\/p>\n<p>PVS-Studio \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>null<\/em>, \u0430 \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u0420\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 <em>ttn<\/em> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e, \u0442\u043e \u0435\u0441\u0442\u044c <em>tc.is_synonym<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>true<\/em>. \u0412\u044b\u0448\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <em>if<\/em>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <em>!tc.is_synonim<\/em>.<\/p>\n<p>\u0412 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 <em>tc.is_synonym<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>true<\/em>, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u0442 \u0432 \u0432\u0435\u0442\u0432\u044c <em>else<\/em>. \u0412 \u043d\u0435\u0439 <em>ttn<\/em> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e <em>null<\/em>. \u0415\u0441\u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <em>ttn == null<\/em> \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u0442\u0438\u043d\u043d\u043e, \u0442\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043e \u043c\u0435\u0441\u0442\u0430 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f <em>ttn<\/em>.<\/p>\n<p>\u041f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 <em>cl_def<\/em>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <em>tc.is_synonym<\/em> \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>false<\/em>. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u0431\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043d\u0435 \u0440\u0430\u0432\u043d\u044b <em>null<\/em>.<\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u0442\u0430\u043b \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043b\u043e\u0436\u043d\u044b\u043c \u0443\u0436\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f. \u041e\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043d\u0438\u0436\u0435 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e.<\/p>\n<pre><code class=\"cs\">if (template_formals.Count != ttn.template_args.idents.Count) {   .... } <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3125\/\">V3125<\/a> The &#8216;ttn&#8217; object was used after it was verified against null. Check lines: 18888, 18880. syntax_tree_visitor.cs 18888<\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043b\u043e \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c PVS-Studio \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0432\u044f\u0437\u0438 \u0438 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 <em>ttn<\/em> \u0432 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a <em>ttn<\/em> \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e. \u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u044b\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c: &#171;\u0410 \u043f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u044b\u043b\u043e \u0440\u0430\u043d\u044c\u0448\u0435?&#187;. \u041a\u0430\u043a \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0432 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0435. \u0412\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0436\u0435 \u043a\u0443\u0447\u0443 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439 \u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0411\u043e\u0440\u044c\u0431\u0430 \u0441 \u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u2013 \u043d\u0430\u0448\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043e\u043f\u044b\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f PVS-Studio \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u0435\u0436\u0434\u0435. \u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0440\u0430\u0441\u043f\u0443\u0442\u044b\u0432\u0430\u0442\u044c \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0432\u044f\u0437\u0435\u0439.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0432\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043c\u043d\u043e\u0433\u043e \u0441\u0432\u044f\u0437\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043a\u0430\u043a \u0441 \u043d\u0438\u043c\u0438 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f PVS-Studio. \u041e\u043d\u0430 \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u043d\u0430\u0448\u0435\u043c <a href=\"https:\/\/pvs-studio.com\/pvs-studio\/try-free\/?utm_source=habr&amp;utm_medium=articles&amp;utm_content=related_variables_2&amp;utm_term=link_try-free\">\u0441\u0430\u0439\u0442\u0435<\/a>.<\/p>\n<p>\u0423\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f!<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Artem Rovenskii. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/csharp\/0976\/\">PVS-Studio&#8217;s data flow analysis untangles more and more related variables<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/681378\/\"> https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/681378\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0432 PVS-Studio. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e\u0431 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430, \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438 \u0443\u0432\u0438\u0434\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u044d\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435?<\/h3>\n<p>\u0413\u043e\u0432\u043e\u0440\u044f \u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0432 \u0432\u0438\u0434\u0443 \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u043e\u0439. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441 <em>null<\/em>.<\/p>\n<pre><code class=\"cs\">var variable = GetPotentialNull(); bool flag = variable != null; <\/code><\/pre>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>flag<\/em> \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>variable<\/em>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u0438 \u0447\u0443\u0442\u044c \u0434\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0442\u0430\u043a\u0438\u0445 \u0441\u0432\u044f\u0437\u0435\u0439. \u0421\u0435\u0439\u0447\u0430\u0441 \u0436\u0435 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u0435\u043c \u2013 \u0447\u0435\u043c \u0442\u0430\u043a\u0438\u0435 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0448\u0430\u044e\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443?<\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e PVS-Studio \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u0430 \u043d\u0430 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e <em>null<\/em>, \u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u2013 \u0432 then-\u0432\u0435\u0442\u043a\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u0442 \u043d\u0443\u043b\u0435\u0432\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443.<\/p>\n<p>\u041a\u0443\u0434\u0430 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0434\u0435\u043b\u0430 \u043e\u0431\u0441\u0442\u043e\u044f\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u043d\u0435\u044f\u0432\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0434\u0440\u0443\u0433\u043e\u0439. \u0415\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438, \u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439.<\/p>\n<p>\u041f\u043e\u0434 \u044d\u0442\u0438\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0430 \u0431\u0435\u0437\u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434. \u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0440\u0438\u0447\u0438\u043d \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e <em>null<\/em> \u0438 \u0434\u0430\u043b\u0435\u0435 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<pre><code class=\"cs\">public void Test() {   var variable = GetPotentialNull();   bool check = variable != null;   if (check)   {     _ = variable.GetHashCode(); \/\/ &lt;=   } } <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0441\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 false positive.<\/p>\n<p>\u041b\u043e\u0436\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u044e\u0442 \u0447\u0442\u0435\u043d\u0438\u0435 \u043e\u0442\u0447\u0451\u0442\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430, \u0430 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043f\u0440\u043e\u0432\u043e\u0446\u0438\u0440\u0443\u044e\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043d\u0430 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u043e\u043a. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f\u0445 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u043d\u0438\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u0439 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/0488\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u0434\u0440\u0443\u0433\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \u043c\u0435\u0434\u0430\u043b\u0438. \u0415\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0432\u044b\u0434\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043a\u043e\u0434\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 :(.<\/p>\n<p>\u0412\u044b\u0448\u0435\u0434\u0448\u0430\u044f \u0432 \u0430\u043f\u0440\u0435\u043b\u0435 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0942\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u043f\u0440\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0432 PVS-Studio \u0431\u044b\u043b\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439. \u041e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0448\u0438\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432, \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u0432\u044f\u0437\u0435\u0439, \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0435\u0451 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u043e\u043c\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0443 \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <em>if&#8230;else<\/em>. \u0418, \u0435\u0441\u043b\u0438 \u0432\u044b \u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0434\u0430\u043d\u043d\u0443\u044e \u0437\u0430\u043c\u0435\u0442\u043a\u0443, \u0442\u043e \u043c\u044b \u043c\u043e\u043b\u043e\u0434\u0446\u044b \u0438 \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 :).<\/p>\n<h3>\u0421\u0438\u043d\u0442\u0435\u0442\u0438\u043a\u0430<\/h3>\n<p>\u041b\u0435\u0433\u0447\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0441\u0432\u044f\u0437\u0435\u0439 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u041f\u043e\u0441\u043b\u0435 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u043a\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<pre><code class=\"cs\">public void TestRelations(bool condition) {   object variable = condition ? \"notNull\" : GetPotentialNull();   if (condition)     _ = variable.GetHashCode(); } <\/code><\/pre>\n<p>\u041a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <em>null<\/em>:<\/p>\n<pre><code class=\"cs\">private static string GetPotentialNull() {   return random.NextDouble() > 0.5 ? \"str\" : null; } <\/code><\/pre>\n<p>\u0420\u0430\u043d\u0435\u0435 PVS-Studio \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043b\u043e\u0436\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \u0432 \u0442\u0435\u043b\u0435 <em>if<\/em>. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e, \u043a\u043e\u0433\u0434\u0430 <em>condition<\/em> \u0440\u0430\u0432\u0435\u043d <em>true<\/em>, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>variable<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043e\u0442 <em>null<\/em>. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u044d\u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0441, \u043d\u043e \u043d\u0435 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043d\u043e\u0432\u044b\u043c \u043f\u0440\u0430\u0432\u043a\u0430\u043c \u043e\u043d \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>condition<\/em> \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>variable<\/em>.<\/p>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>variable<\/em> \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>condition<\/em>:<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 <em>condition == true<\/em>, \u0442\u043e \u0432 <em>variable<\/em> \u0442\u043e\u0447\u043d\u043e \u043d\u0435 <em>null<\/em>;<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 <em>condition == false<\/em>, \u0442\u043e \u0432 <em>variable<\/em> \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0443\u0437\u043d\u0430\u0451\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>condition<\/em>, \u0442\u043e \u043e\u043d \u0443\u0437\u043d\u0430\u0451\u0442 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>variable<\/em>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0432 \u0442\u0435\u043b\u043e \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>condition<\/em> \u0442\u0430\u043c \u0440\u0430\u0432\u043d\u0430 <em>true<\/em>, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 <em>variable<\/em> \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0431\u044b\u043b\u0438 \u0441\u0432\u044f\u0437\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0440\u043e\u0438\u043b\u0438\u0441\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f <em>if<\/em>. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439.<\/p>\n<pre><code class=\"cs\">public void TestRelations2(bool condition) {   object variable;   if (condition)     variable = \"notNull\";   else     variable = GetPotentialNull();    if (condition)     _ = variable.GetHashCode(); } <\/code><\/pre>\n<p>PVS-Studio \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u0447\u0442\u043e \u044f \u043e\u043f\u0438\u0441\u0430\u043b \u0440\u0430\u043d\u0435\u0435 \u0441 \u0442\u0435\u0440\u043d\u0430\u0440\u043d\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c. \u041f\u043e\u0434 \u0432\u0442\u043e\u0440\u044b\u043c <em>if<\/em> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>variable<\/em> \u043d\u0435 \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>. \u0422\u0435\u043f\u0435\u0440\u044c PVS-Studio \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0438 \u044d\u0442\u043e\u0442 \u0442\u0438\u043f \u0441\u0432\u044f\u0437\u0435\u0439.<\/p>\n<h3>\u041a\u0430\u043a \u0436\u0435 \u043c\u044b \u044d\u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c?<\/h3>\n<p>\u0420\u0430\u0431\u043e\u0442\u0443 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043c\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u043a\u0435, \u043d\u043e \u0438 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 Open Source \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0430\u043f\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u043c\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u044d\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u0447\u0451\u0442\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u0442\u0435\u043c \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u043a\u0438, \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0439\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u043e\u0442\u0447\u0451\u0442\u044b;<\/p>\n<\/li>\n<li>\n<p>\u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0438 \u0441\u0442\u0430\u0440\u044b\u0445 \u043e\u0442\u0447\u0451\u0442\u043e\u0432 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f\u0445.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043e\u0442\u0447\u0451\u0442 \u0441 \u0434\u0432\u0443\u043c\u044f \u0442\u0438\u043f\u0430\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439: missing \u2013 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0438\u0441\u0447\u0435\u0437\u043b\u043e, additional \u2013 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>\u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0434 \u043d\u043e\u0432\u044b\u043c\u0438 \u0438\u043b\u0438 \u043f\u0440\u043e\u043f\u0430\u0432\u0448\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c. \u041f\u0440\u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u044f \u043f\u043e\u0447\u0442\u0438 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438: \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043b\u0438 \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435? \u0434\u043e\u043b\u0436\u043d\u043e \u043b\u0438 \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u043f\u0430\u0441\u0442\u044c \u0438\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f? \u043a\u0430\u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u044d\u0442\u043e \u043f\u043e\u043d\u044f\u043b?<\/p>\n<h3>\u0422\u0430\u043a \u0441\u0442\u0430\u043b\u043e \u043b\u0438 \u043b\u0443\u0447\u0448\u0435?<\/h3>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u043b\u0430\u043b\u0430\u0441\u044c \u0434\u043b\u044f \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0432\u044f\u0437\u0435\u0439 \u043f\u043e\u043c\u043e\u0433\u043b\u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0431\u0440\u0430\u0442\u044c \u043f\u043b\u043e\u0445\u0438\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0435. &#171;\u0420\u0430\u0441\u043f\u0443\u0442\u044b\u0432\u0430\u043d\u0438\u0435&#187; \u0441\u0432\u044f\u0437\u0435\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 PVS-Studio \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043c\u043e\u0433 \u043d\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c \u043f\u0440\u043e \u0441\u0432\u044f\u0437\u044c \u0438\u043b\u0438 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u0435\u0451, \u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c. \u0412 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u043a\u043e\u0434\u0430 \u0438, \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0432\u043e\u0435\u0433\u043e. \u041f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u043b \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443, \u0430 \u0443 \u0442\u0435\u0431\u044f \u0443\u0436\u0435 \u0432\u0441\u0451 \u043d\u0435 \u0442\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0433\u0434\u0435-\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b. \u0421 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437.<\/p>\n<p>\u0412\u044b\u0448\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0442\u0435\u0440\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0434\u0435\u043b\u0443 :).<\/p>\n<h4>Additional<\/h4>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u043d\u043e\u0432\u044b\u0445 \u0441\u0432\u044f\u0437\u0435\u0439.<\/p>\n<p><strong>Issue 1<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0430\u043d\u043e \u043d\u0430 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <a href=\"https:\/\/github.com\/KeenSoftwareHouse\/SpaceEngineers\">SpaceEngineers<\/a>.<\/p>\n<pre><code class=\"cs\">public bool RemovePilot() {   bool usePilotOriginalWorld = false;   ....   Vector3D? allowedPosition = null;   if (!usePilotOriginalWorld)   {     allowedPosition = FindFreeNeighbourPosition();      if (!allowedPosition.HasValue)       allowedPosition = PositionComp.GetPosition();   }    RemovePilotFromSeat(m_pilot);   EndShootAll();    if (usePilotOriginalWorld || allowedPosition.HasValue)  \/\/ &lt;=   {     ....   } } <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;usePilotOriginalWorld || allowedPosition.HasValue&#8217; is always true. MyCockpit.cs 666<\/p>\n<p>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <em>usePilotOriginalWorld || allowedPosition.HasValue<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>true.<\/em> \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<p>\u041f\u043e\u0434\u043d\u0438\u043c\u0435\u043c\u0441\u044f \u043f\u043e \u043a\u043e\u0434\u0443 \u0447\u0443\u0442\u044c \u0432\u044b\u0448\u0435. \u0417\u0430\u043c\u0435\u0447\u0430\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>usePilotOriginalWorld<\/em> \u0440\u0430\u0432\u043d\u0430 <em>false<\/em>, \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>allowedPosition<\/em> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>FindFreeNeighbourPosition<\/em>. \u041e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 nullable-\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\n<p><em>allowedPosition.HasValue<\/em> \u0440\u0430\u0432\u043d\u043e <em>true<\/em>;<\/p>\n<\/li>\n<li>\n<p><em>allowedPosition.HasValue<\/em> \u0440\u0430\u0432\u043d\u043e <em>false<\/em>. \u0422\u043e\u0433\u0434\u0430 <em>allowedPosition<\/em> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 <em>GetPosition<\/em>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <em>HasValue<\/em> \u0443 <em>allowedPosition<\/em> \u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 <em>true<\/em>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u0435\u0442\u043e\u0434 <em>GetPosition<\/em>:<\/p>\n<pre><code class=\"cs\">public Vector3D GetPosition() {   return this.m_worldMatrix.Translation; } <\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>usePilotOriginalWorld<\/em> \u0440\u0430\u0432\u043d\u0430 <em>false<\/em>, \u0442\u043e \u0432 <em>allowedPosition<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u0430 nullable-\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>HasValue<\/em> \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u043e <em>true<\/em>.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 <em>usePilotOriginalWorld<\/em> \u0440\u0430\u0432\u043d\u043e <em>true<\/em>, \u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u043e;<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 <em>usePilotOriginalWorld<\/em> \u0440\u0430\u0432\u043d\u043e <em>false<\/em>, \u0442\u043e <em>allowedPosition.HasValue<\/em> \u0432\u0435\u0440\u043d\u0451\u0442 <em>true<\/em> \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u0442\u0438\u043d\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0430\u043d\u043e \u043d\u0430 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434.<\/p>\n<pre><code class=\"cs\">if (usePilotOriginalWorld || allowedPosition.HasValue) {   ....   return true; } return false;    \/\/ &lt;= <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3142\/\">V3142<\/a> Unreachable code detected. It is possible that an error is present. MyCockpit.cs 728<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u043e. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0442\u0435\u043b\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>return<\/em>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, <em>return false<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 \u0432\u0441\u0451 \u0442\u0430\u043a \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c?<\/p>\n<p><strong>Issue 2<\/strong><\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u043e \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435&#8230; PVS-Studio. \u0414\u0430, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043d\u043e\u0432\u044b\u043c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u043d\u0435\u0434\u043e\u0447\u0451\u0442 \u0443 \u0441\u0435\u0431\u044f \u0436\u0435. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0448\u0438 \u043d\u043e\u0447\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0433\u0434\u0430 PVS-Studio \u0438\u0449\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 PVS-Studio.<\/p>\n<pre><code class=\"cs\">private static bool? IsTrivialProperty_internal(....) {   AssignmentExpressionSyntax setBody = null;   if (!checkOnlyRead)   {     var setBodyFirst = setAccessorBody?.ChildNodes().FirstOrDefault();     setBody = ....;     if (setBody == null)       return false;     ....   }    getValue = ....;    try   {     if (checkOnlyRead)     {       return IsTrivialGetterField(model, ref getValue, maybeTrue);     }     else     {       ExpressionSyntax setValue = setBody?.Left.SkipParenthesize();    \/\/ &lt;=       ....     }   }    catch (ArgumentException)   {....} } <\/code><\/pre>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;setBody&#8217; is always not null. The operator &#8216;?.&#8217; is excessive. TypeUtils.cs 309<\/p>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <em>Left<\/em> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>setBody<\/em> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u043f\u0430\u043b\u0438 \u0432 \u0432\u0435\u0442\u0432\u044c else, \u0442\u043e <em>checkOnlyRead<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>false<\/em>. \u041f\u043e\u0434\u043d\u0438\u043c\u0435\u043c\u0441\u044f \u0447\u0443\u0442\u044c \u0432\u044b\u0448\u0435, \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u043c\u0443 <em>if<\/em>. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 <em>checkOnlyRead<\/em>, \u0440\u0430\u0432\u043d\u043e\u043c <em>false<\/em>, \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 <em>setBody == null<\/em>. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>true<\/em>, \u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430, \u0438 \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e <em>if<\/em> \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0434\u043e\u0439\u0434\u0451\u0442. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 <em>checkOnlyRead<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>false<\/em>, \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>setBody<\/em> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u0430 <em>null<\/em>.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;?.&#8217; \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0438 \u0435\u0433\u043e \u0441\u0442\u043e\u0438\u0442 \u0443\u0431\u0440\u0430\u0442\u044c. \u0427\u0442\u043e \u043c\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 :).<\/p>\n<p><strong>Issue 3<\/strong><\/p>\n<p>\u0410<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-336734","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=336734"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336734\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=336734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=336734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=336734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}