{"id":398869,"date":"2024-06-29T14:19:48","date_gmt":"2024-06-29T14:19:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=398869"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=398869","title":{"rendered":"<span>\u0422\u0440\u0435\u0442\u044c\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 Umbraco \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c PVS-Studio<\/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>6 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0431\u044b\u043b\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio \u0434\u043b\u044f C#. \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043e\u0433\u043b\u044f\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430\u0437\u0430\u0434 \u0438 \u0432\u043d\u043e\u0432\u044c \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u0442\u0443\u0434\u0430, \u043e\u0442\u043a\u0443\u0434\u0430 \u0432\u0441\u0451 \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u2013 \u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 Umbraco CMS.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ad8\/afc\/00e\/ad8afc00ed7018bface4fb28b288dc17.png\" width=\"580\" height=\"327\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ad8\/afc\/00e\/ad8afc00ed7018bface4fb28b288dc17.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u0440\u0430\u043d\u0435\u0435 \u043c\u044b \u0443\u0436\u0435 \u043f\u043e\u0441\u0432\u044f\u0442\u0438\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0443 Umbraco \u0434\u0432\u0435 \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0357\/\">\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 C# \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>,<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0461\/\">\u0421\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Umbraco<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0438\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u0438\u043f\u044b \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u0441 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0430 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Umbraco, \u043d\u043e \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c. Umbraco \u2013 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u043e\u043c \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u043e\u043f\u044b\u0442 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430. \u0421\u0430\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/umbraco\/Umbraco-CMS\">GitHub<\/a>.<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c \u0438 \u043f\u0440\u043e PVS-Studio. \ud83d\ude09<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/\">PVS-Studio<\/a> \u2013 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430, \u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u043e\u0441\u0442\u0438 (SAST) \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 C, C++, C#, Java \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Windows, Linux, macOS.<\/p>\n<p>\u0414\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0431\u044b\u043b\u0430 \u0432\u0437\u044f\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u0442 12.11.2021 \u0438 \u0441\u043a\u0430\u0447\u0430\u043d\u0430 \u0430\u0440\u0445\u0438\u0432\u043e\u043c \u0441 <a href=\"https:\/\/github.com\/umbraco\/Umbraco-CMS\">GitHub<\/a>.  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f PVS-Studio \u2013 7.15.54288.<\/p>\n<p>\u0421\u0440\u0435\u0434\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u043c\u044b, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043e\u0442\u043e\u0431\u0440\u0430\u043b\u0438 \u0441\u0430\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435. \u041a\u0430\u043a\u0438\u0435-\u0442\u043e \u0438\u0437 \u043d\u0438\u0445 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u044f\u0432\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0430 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u2013 \u043d\u0430 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u0431\u043b\u0438\u0436\u0435 \u043a \u0434\u0435\u043b\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0436\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c.<\/p>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043c \u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u043c\u0438?<\/h3>\n<p><strong>Issue 1<\/strong><\/p>\n<p>\u0410 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435?<\/p>\n<pre><code>protected virtual string VisitMethodCall(MethodCallExpression m) {   ....   case \"SqlText\":     if (m.Method.DeclaringType != typeof(SqlExtensionsStatics))       goto default;     if (m.Arguments.Count == 2)     {       var n1 = Visit(m.Arguments[0]);       var f = m.Arguments[2];       if (!(f is Expression&lt;Func&lt;string, string>> fl))         throw new NotSupportedException(\"Expression is not a proper                                           lambda.\");       var ff = fl.Compile();       return ff(n1);     }     else if (m.Arguments.Count == 3)     {       var n1 = Visit(m.Arguments[0]);       var n2 = Visit(m.Arguments[1]);       var f = m.Arguments[2];       if (!(f is Expression&lt;Func&lt;string, string, string>> fl))         throw new NotSupportedException(\"Expression is not a proper                                           lambda.\");       var ff = fl.Compile();       return ff(n1, n2);     }     else if (m.Arguments.Count == 4)     {       var n1 = Visit(m.Arguments[0]);       var n2 = Visit(m.Arguments[1]);       var n3 = Visit(m.Arguments[3]);       var f = m.Arguments[3];       if (!(f is Expression&lt;Func&lt;string, string, string, string>> fl))         throw new NotSupportedException(\"Expression is not a proper                                           lambda.\");       var ff = fl.Compile();       return ff(n1, n2, n3);     }     else       throw new NotSupportedException(\"Expression is not a proper lambda.\");      .... } <\/code><\/pre>\n<p>\u041b\u0430\u0434\u043d\u043e-\u043b\u0430\u0434\u043d\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0443\u043a\u043e\u0440\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430.<\/p>\n<pre><code>protected virtual string VisitMethodCall(MethodCallExpression m) {   ....   case \"SqlText\":     ....     if (m.Arguments.Count == 2)     {       var n1 = Visit(m.Arguments[0]);       var f = m.Arguments[2];       ....     } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3106\/\">V3106<\/a> Possibly index is out of bound. The &#8216;2&#8217; index is pointing beyond &#8216;m.Arguments&#8217; bound. ExpressionVisitorBase.cs 632<\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0432\u0441\u0435 \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u0432 \u0436\u0438\u0437\u043d\u0438 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u043c\u0430\u0445\u0430\u043c\u0438. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442, \u0447\u0442\u043e <em>m.Arguments.Count<\/em> \u0440\u0430\u0432\u043d\u043e 2, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u0447\u0442\u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a 3-\u0435\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e <em>IndexOutOfRangeException<\/em>.<\/p>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0438, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, Umbraco \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p><strong>Issue 2<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u0421\u0440\u0430\u0437\u0443 \u0437\u0430 \u043a\u043e\u0434\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430, \u0430 \u0443\u0436\u0435 \u0437\u0430 \u043d\u0435\u0439 \u2013 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<pre><code>public static string ToXmlString(this object value, Type type) {   if (value == null) return string.Empty;   if (type == typeof(string))      return (value.ToString().IsNullOrWhiteSpace() ? \"\" : value.ToString());   if (type == typeof(bool)) return XmlConvert.ToString((bool)value);   if (type == typeof(byte)) return XmlConvert.ToString((byte)value);   if (type == typeof(char)) return XmlConvert.ToString((char)value);   if (type == typeof(DateTime)) return XmlConvert.ToString((DateTime)value,   XmlDateTimeSerializationMode.Unspecified);   if (type == typeof(DateTimeOffset))      return XmlConvert.ToString((DateTimeOffset)value);   if (type == typeof(decimal)) return XmlConvert.ToString((decimal)value);   if (type == typeof(double)) return XmlConvert.ToString((double)value);   if (type == typeof(float)) return XmlConvert.ToString((float)value);   if (type == typeof(Guid)) return XmlConvert.ToString((Guid)value);   if (type == typeof(int)) return XmlConvert.ToString((int)value);   if (type == typeof(long)) return XmlConvert.ToString((long)value);   if (type == typeof(sbyte)) return XmlConvert.ToString((sbyte)value);   if (type == typeof(short)) return XmlConvert.ToString((short)value);   if (type == typeof(TimeSpan)) return XmlConvert.ToString((TimeSpan)value);   if (type == typeof(bool)) return XmlConvert.ToString((bool)value);   if (type == typeof(uint)) return XmlConvert.ToString((uint)value);   if (type == typeof(ulong)) return XmlConvert.ToString((ulong)value);   if (type == typeof(ushort)) return XmlConvert.ToString((ushort)value);   .... } <\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/286\/087\/ee6\/286087ee6c60553c9c57a53d351ee8e3.png\" width=\"450\" height=\"388\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/286\/087\/ee6\/286087ee6c60553c9c57a53d351ee8e3.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u0441 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u043a\u043e\u0439, \u0442\u043e \u0443 \u0432\u0430\u0441 \u043e\u0440\u043b\u0438\u043d\u043e\u0435 \u0437\u0440\u0435\u043d\u0438\u0435! \u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0441\u043e\u043a\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code>public static string ToXmlString(this object value, Type type) {   ....   if (type == typeof(bool)) return XmlConvert.ToString((bool)value);   ....   if (type == typeof(bool)) return XmlConvert.ToString((bool)value);   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3021\/\">V3021<\/a> There are two &#8216;if&#8217; statements with identical conditional expressions. The first &#8216;if&#8217; statement contains method return. This means that the second &#8216;if&#8217; statement is senseless ObjectExtensions.cs 615<\/p>\n<p>\u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0430 code review, \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438?<\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0432\u0435\u0437\u043b\u043e \u0438 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435. \u041a \u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0439\u0442\u0438 \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a \u043c\u0435\u0442\u043e\u0434\u0430 <em>XmlConvert.ToString<\/em>. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0435\u0437\u0451\u0442 \u043d\u0435 \u0432\u0441\u0435\u043c \u0438 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u2013 \u043f\u043e\u0440\u043e\u0439 \u0437\u0430 copy-paste \u043c\u043e\u0433\u0443\u0442 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/examples\/v3021\/\">\u0441\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043f\u0440\u0438\u043c\u0435\u0442\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/a>.<\/p>\n<p><strong>Issue 3<\/strong><\/p>\n<pre><code>public bool FlagOutOfDateModels {   get => _flagOutOfDateModels;    set   {     if (!ModelsMode.IsAuto())     {       _flagOutOfDateModels = false;     }      _flagOutOfDateModels = value;   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3008\/\">V3008<\/a> The &#8216;_flagOutOfDateModels&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 54, 51. ModelsBuilderSettings.cs 54<\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0432 set accessor \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>_flagOutOfDateModels<\/em>, \u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0451 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u043e\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0431\u043b\u043e\u043a <em>if<\/em> \u043d\u0435 \u043d\u0435\u0441\u0451\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u044b.<\/p>\n<p><strong>Issue 4<\/strong><\/p>\n<pre><code>private bool MatchesEndpoint(string absPath) {   IEnumerable&lt;RouteEndpoint> routeEndpoints = _endpointDataSource     ?.Endpoints     .OfType&lt;RouteEndpoint>()     .Where(x =>     {       ....     });    var routeValues = new RouteValueDictionary();    RouteEndpoint matchedEndpoint = routeEndpoints     .Where(e => new TemplateMatcher(         TemplateParser.Parse(e.RoutePattern.RawText),         new RouteValueDictionary())       .TryMatch(absPath, routeValues))     .OrderBy(c => c.Order)     .FirstOrDefault();    return matchedEndpoint != null; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3105\/\">V3105<\/a> The &#8216;routeEndpoints&#8217; variable was used after it was assigned through null-conditional operator. NullReferenceException is possible. RoutableDocumentFilter.cs 198<\/p>\n<p>\u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3105\/\">V3105<\/a> \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f <em>NullReferenceException<\/em>. <em>_endpointDataSource<\/em> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>null<\/em> \u0437\u0430 \u0441\u0447\u0451\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;?.&#8217;. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>_endpointDataSource<\/em> \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>, \u0442\u043e \u0438 \u0432 <em>routeEndpoints<\/em> \u0431\u0443\u0434\u0435\u0442 <em>null.<\/em><\/p>\n<p>\u0421\u0442\u0440\u0430\u043d\u043d\u044b\u043c \u0437\u0434\u0435\u0441\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u043e, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a <em>routeEndpoints<\/em> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0443\u0436\u0435 \u0431\u0435\u0437 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;?.&#8217;. \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0435\u0441\u043b\u0438 <em>routeEndpoints<\/em> \u2013 <em>null<\/em>, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <em>NullReferenceException<\/em>.<\/p>\n<p><strong>Issue 5<\/strong><\/p>\n<pre><code>public void Handle(ContentCopiedNotification notification) {   ....   if (relationType == null)   {     relationType = new RelationType(       Constants.Conventions.RelationTypes.RelateDocumentOnCopyAlias,       Constants.Conventions.RelationTypes.RelateDocumentOnCopyName,       true,       Constants.ObjectTypes.Document,       Constants.ObjectTypes.Document);      _relationService.Save(relationType);   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3066\/\">V3066<\/a> Possible incorrect order of arguments passed to &#8216;RelationType&#8217; constructor. RelateOnCopyNotificationHandler.cs 32<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0435\u043c\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0435\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443:<\/p>\n<pre><code>public RelationType(string name,                     string alias,                     bool isBidrectional,                     Guid? parentObjectType,                     Guid? childObjectType) <\/code><\/pre>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u043d\u0435 \u0432 \u0442\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <em>RelateDocumentOnCopy<\/em><strong><em>Alias<\/em><\/strong> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 <em>name<\/em>, \u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <em>RelateDocumentOnCopy<\/em><strong><em>Name<\/em><\/strong> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>alias<\/em>.<\/p>\n<p><strong>Issue 6<\/strong><\/p>\n<pre><code>private static async Task&lt;Attempt&lt;UrlInfo>> DetectCollisionAsync(....) {   ....   if (pcr.IgnorePublishedContentCollisions)   {     logger.LogDebug(logMsg, url, uri, culture);   }   else   {     logger.LogDebug(logMsg, url, uri, culture);   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3004\/\">V3004<\/a> The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. UrlProviderExtensions.cs 274<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430\u0448\u0451\u043b \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0442\u0432\u0438 <em>then<\/em> \u0438 <em>else<\/em> \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u043a\u043e\u0434 \u0438 \u0437\u0430\u0431\u044b\u043b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/198\/10b\/551\/19810b5513fecb88849a9fc4c2386923.png\" width=\"400\" height=\"345\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/198\/10b\/551\/19810b5513fecb88849a9fc4c2386923.png\"\/><figcaption><\/figcaption><\/figure>\n<p><strong>Issue 7<\/strong><\/p>\n<pre><code>public async Task&lt;bool> IsMemberAuthorizedAsync(....) {   ....   if (IsLoggedIn() == false)   {     allowAction = false;   }   else   {      string username;     ....     username = currentMember.UserName;     IList&lt;string> allowTypesList = allowTypes as IList&lt;string> ??                                                allowTypes.ToList();     if (allowTypesList.Any(allowType => allowType != string.Empty))     {       allowAction = allowTypesList.Select(x => x.ToLowerInvariant())                                                 .Contains(currentMember                                                 .MemberTypeAlias                                                 .ToLowerInvariant());     }      if (allowAction &amp;&amp; allowMembers.Any())     {       allowAction = allowMembers.Contains(memberId);     }     ....   }   return allowAction; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3137\/\">V3137<\/a> The &#8216;username&#8217; variable is assigned but is not used by the end of the function. MemberManager.cs 87<\/p>\n<p>\u0411\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <em>username<\/em> \u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0435\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e <em>username<\/em> \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0443\u0431\u0440\u0430\u043b\u0438 \u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043a\u043e\u0434\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f (\u043f\u0443\u0441\u0442\u044c \u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f) \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0435 \u0431\u044b\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0438\u043b\u0438 \u0433\u0434\u0435-\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0437\u0430\u043f\u0440\u044f\u0442\u0430\u043b\u0430\u0441\u044c \u0445\u0438\u0442\u0440\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430.<\/p>\n<p><strong>Issue 8<\/strong><\/p>\n<pre><code>public async Task&lt;ActionResult&lt;UserDisplay>> PostInviteUser(UserInvite userSave) {   if (_securitySettings.UsernameIsEmail)   {     userSave.Username = userSave.Email;   }   else   {     var userResult = CheckUniqueUsername(userSave.Username, u =>                                            u.LastLoginDate != default                                         || u.EmailConfirmedDate.HasValue);                                               if (!(userResult.Result is null))     {       return userResult.Result;     }      user = userResult.Value;   }   user = CheckUniqueEmail(userSave.Email, u => u.LastLoginDate != default ||                                               u.EmailConfirmedDate.HasValue);   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3008\/\">V3008<\/a> The &#8216;user&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 446, 444. UsersController.cs 446<\/p>\n<p>\u0412 \u0431\u043b\u043e\u043a\u0435 <em>else<\/em> \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>user.<\/em> \u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043e\u043f\u044f\u0442\u044c \u0438\u0434\u0451\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 <em>user<\/em>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0437\u0430\u0442\u0438\u0440\u0430\u0435\u0442\u0441\u044f. \u0414\u043e\u043b\u0436\u043d\u043e \u043b\u0438 \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>userResult.Value,<\/em> \u0438 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u0430 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0430, \u0438\u043b\u0438 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434 \u2013 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439. \u041d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0447\u0451\u0442 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043a\u0440\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p><strong>Issue 9<\/strong><\/p>\n<pre><code>public ActionResult&lt;PagedResult&lt;EntityBasic>> GetPagedChildren(....                                                                int pageNumber,                                                                ....) {   if (pageNumber &lt;= 0)   {     return NotFound();   }   ....   if (objectType.HasValue)   {     if (id == Constants.System.Root &amp;&amp;         startNodes.Length > 0 &amp;&amp;         startNodes.Contains(Constants.System.Root) == false &amp;&amp;         !ignoreUserStartNodes)     {       if (pageNumber > 0)  \/\/ &lt;=       {         return new PagedResult&lt;EntityBasic>(0, 0, 0);       }       IEntitySlim[] nodes = _entityService.GetAll(objectType.Value,                                                    startNodes).ToArray();       if (nodes.Length == 0)       {         return new PagedResult&lt;EntityBasic>(0, 0, 0);       }        if (pageSize &lt; nodes.Length)       {         pageSize = nodes.Length; \/\/ bah       }        var pr = new PagedResult&lt;EntityBasic>(nodes.Length, pageNumber, pageSize)       {         Items = nodes.Select(_umbracoMapper.Map&lt;EntityBasic>)       };       return pr;     }   } }<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;pageNumber > 0&#8217; is always true. EntityController.cs 625<\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0447\u0442\u043e <em>pageNumber<\/em> \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u0435\u043d 0, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0430\u043a, \u0442\u043e \u043c\u044b \u0432\u044b\u0445\u043e\u0434\u0438\u043c. \u0421\u043b\u0435\u0434\u0443\u044f \u043f\u043e \u043a\u043e\u0434\u0443 \u0434\u0430\u043b\u0435\u0435, \u043c\u044b \u043d\u0430\u0442\u044b\u043a\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 <em>pageNumber<\/em> \u0431\u043e\u043b\u044c\u0448\u0435 0<em>.<\/em> \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u0442\u0438\u043d\u043d\u044b\u043c, \u0430 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u043d <em>return<\/em>. \u041a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>if<\/em> (\u0430 \u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e)<em>,<\/em> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f. <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0436\u0435, \u043a\u0441\u0442\u0430\u0442\u0438, \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0430\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0438\u0436\u0438\u043c\u044b\u0439 \u043a\u043e\u0434: <a href=\"https:\/\/pvs-studio.com\/ru\/docs\/warnings\/v3142\/\">V3142<\/a> Unreachable code detected. It is possible that an error is present. EntityController.cs 630<\/p>\n<p><strong>Issue 10<\/strong><\/p>\n<p>\u0410 \u0437\u0434\u0435\u0441\u044c \u0443 \u043d\u0430\u0441 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0442\u0435\u0441\u0442\u0435. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u0432\u0430\u0436\u043d\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0435\u0441\u0442\u044b \u2013 \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0434\u0430\u0451\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432 \u043d\u0438\u0445 \u043e\u0448\u0438\u0431\u043a\u0430 \u2013 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0431\u044b\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u043c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e? \u0418 \u0432\u043e\u0442 \u0432 \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/cpp\/a0080\/\">\u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c<\/a> \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437.<\/p>\n<pre><code>Public void SimpleConverter3Test() {   ....   IpublishedContentType contentType1 =     contentTypeFactory.CreateContentType(Guid.NewGuid(),     1002, \"content1\", t => CreatePropertyTypes(t, 1));    IpublishedContentType contentType2 =     contentTypeFactory.CreateContentType(Guid.NewGuid(),     1003, \"content2\", t => CreatePropertyTypes(t, 2));   ....   var cnt1 = new InternalPublishedContent(contentType1) \/\/ &lt;=   {     Id = 1003,     Properties = new[]     {       new InternalPublishedProperty {Alias = \"prop1\",         SolidHasValue = true, SolidValue = \"val1\"}     }   };   var cnt2 = new InternalPublishedContent(contentType1) \/\/ &lt;=   {     Id = 1004,     Properties = new[]     {       new InternalPublishedProperty {Alias = \"prop2\",         SolidHasValue = true, SolidValue = \"1003\"}     }   }; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3056\/\">V3056<\/a> Consider reviewing the correctness of &#8216;contentType1&#8217; item&#8217;s usage. ConvertersTests.cs 115<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0442\u043e copy-paste \u043e\u0448\u0438\u0431\u043a\u0430: \u0432\u043c\u0435\u0441\u0442\u043e <em>contentType2<\/em> \u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>cnt2<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <em>contentType1.<\/em> \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u043d\u0435 \u0442\u0430\u043a \u043b\u0438? <\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0411\u044b\u043b\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u044d\u0441\u0442\u0430\u0444\u0435\u0442\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043a\u043e\u0434\u0430 Umbraco. \u041a\u0441\u0442\u0430\u0442\u0438, \u0441\u0443\u0434\u044f \u043f\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c, \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0449\u0438\u043c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u0437\u044f\u043b\u0438 \u043d\u0430 \u0441\u0432\u043e\u0451 \u0432\u043e\u043e\u0440\u0443\u0436\u0435\u043d\u0438\u0435 ReSharper. \u0427\u0442\u043e, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u043d\u0435 \u043f\u043e\u043c\u0435\u0448\u0430\u043b\u043e PVS-Studio \u043d\u0430\u0439\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u0412\u044b\u0432\u043e\u0434 \u2013 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0444\u0438\u0442\u0430. \ud83d\ude09<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u0443 \u0432\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043f\u0440\u043e\u0431\u043d\u044b\u0439 \u043a\u043b\u044e\u0447\u0438\u043a \u0443 \u043d\u0430\u0441 \u043d\u0430 <a href=\"https:\/\/pvs-studio.com\/pvs-studio\/try-free\/?utm_source=habr&amp;utm_medium=articles&amp;utm_content=umbraco&amp;utm_term=link_try-free\">\u0441\u0430\u0439\u0442\u0435<\/a>.<\/p>\n<p>\u0418 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0440\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u2013 \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u0438\u0445 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435, \u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u043b\u044c\u0437\u0430 \u043e\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b.<\/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:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/595507\/\">PVS-Studio checks Umbraco code for the third time<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/595509\/\"> https:\/\/habr.com\/ru\/articles\/595509\/<\/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>6 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u0431\u044b\u043b\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 PVS-Studio \u0434\u043b\u044f C#. \u041c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043e\u0433\u043b\u044f\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430\u0437\u0430\u0434 \u0438 \u0432\u043d\u043e\u0432\u044c \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u0442\u0443\u0434\u0430, \u043e\u0442\u043a\u0443\u0434\u0430 \u0432\u0441\u0451 \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u2013 \u043a \u0430\u043d\u0430\u043b\u0438\u0437\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 Umbraco CMS.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u0440\u0430\u043d\u0435\u0435 \u043c\u044b \u0443\u0436\u0435 \u043f\u043e\u0441\u0432\u044f\u0442\u0438\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0443 Umbraco \u0434\u0432\u0435 \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0357\/\">\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 C# \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>,<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/blog\/posts\/csharp\/0461\/\">\u0421\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 Umbraco<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0438\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u0438\u043f\u044b \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u0441 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0430 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Umbraco, \u043d\u043e \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043c. Umbraco \u2013 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u043e\u043c \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u043e\u043f\u044b\u0442 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430. \u0421\u0430\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/umbraco\/Umbraco-CMS\">GitHub<\/a>.<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c \u0438 \u043f\u0440\u043e PVS-Studio. \ud83d\ude09<\/p>\n<p><a href=\"https:\/\/pvs-studio.com\/ru\/\">PVS-Studio<\/a> \u2013 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430, \u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u043e\u0441\u0442\u0438 (SAST) \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 C, C++, C#, Java \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Windows, Linux, macOS.<\/p>\n<p>\u0414\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0431\u044b\u043b\u0430 \u0432\u0437\u044f\u0442\u0430 \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u0442 12.11.2021 \u0438 \u0441\u043a\u0430\u0447\u0430\u043d\u0430 \u0430\u0440\u0445\u0438\u0432\u043e\u043c \u0441 <a href=\"https:\/\/github.com\/umbraco\/Umbraco-CMS\">GitHub<\/a>.  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f PVS-Studio \u2013 7.15.54288.<\/p>\n<p>\u0421\u0440\u0435\u0434\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u043c\u044b, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043e\u0442\u043e\u0431\u0440\u0430\u043b\u0438 \u0441\u0430\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435. \u041a\u0430\u043a\u0438\u0435-\u0442\u043e \u0438\u0437 \u043d\u0438\u0445 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u044f\u0432\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0430 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u2013 \u043d\u0430 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u0431\u043b\u0438\u0436\u0435 \u043a \u0434\u0435\u043b\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0436\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c.<\/p>\n<h3>\u0427\u0442\u043e \u0442\u0430\u043c \u0441 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f\u043c\u0438?<\/h3>\n<p><strong>Issue 1<\/strong><\/p>\n<p>\u0410 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435?<\/p>\n<pre><code>protected virtual string VisitMethodCall(MethodCallExpression m) {   ....   case \"SqlText\":     if (m.Method.DeclaringType != typeof(SqlExtensionsStatics))       goto default;     if (m.Arguments.Count == 2)     {       var n1 = Visit(m.Arguments[0]);       var f = m.Arguments[2];       if (!(f is Expression&lt;Func&lt;string, string>> fl))         throw new NotSupportedException(\"Expression is not a proper                                           lambda.\");       var ff = fl.Compile();       return ff(n1);     }     else if (m.Arguments.Count == 3)     {       var n1 = Visit(m.Arguments[0]);       var n2 = Visit(m.Arguments[1]);       var f = m.Arguments[2];       if (!(f is Expression&lt;Func&lt;string, string, string>> fl))         throw new NotSupportedException(\"Expression is not a proper                                           lambda.\");       var ff = fl.Compile();       return ff(n1, n2);     }     else if (m.Arguments.Count == 4)     {       var n1 = Visit(m.Arguments[0]);       var n2 = Visit(m.Arguments[1]);       var n3 = Visit(m.Arguments[3]);       var f = m.Arguments[3];       if (!(f is Expression&lt;Func&lt;string, string, string, string>> fl))         throw new NotSupportedException(\"Expression is not a proper                                           lambda.\");       var ff = fl.Compile();       return ff(n1, n2, n3);     }     else       throw new NotSupportedException(\"Expression is not a proper lambda.\");      .... } <\/code><\/pre>\n<p>\u041b\u0430\u0434\u043d\u043e-\u043b\u0430\u0434\u043d\u043e, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0443\u043a\u043e\u0440\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0430.<\/p>\n<pre><code>protected virtual string VisitMethodCall(MethodCallExpression m) {   ....   case \"SqlText\":     ....     if (m.Arguments.Count == 2)     {       var n1 = Visit(m.Arguments[0]);       var f = m.Arguments[2];       ....     } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3106\/\">V3106<\/a> Possibly index is out of bound. The &#8216;2&#8217; index is pointing beyond &#8216;m.Arguments&#8217; bound. ExpressionVisitorBase.cs 632<\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0432\u0441\u0435 \u043a\u043e\u0433\u0434\u0430-\u043b\u0438\u0431\u043e \u0432 \u0436\u0438\u0437\u043d\u0438 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u043c\u0430\u0445\u0430\u043c\u0438. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442, \u0447\u0442\u043e <em>m.Arguments.Count<\/em> \u0440\u0430\u0432\u043d\u043e 2, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u0447\u0442\u0438 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a 3-\u0435\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044e <em>IndexOutOfRangeException<\/em>.<\/p>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0438, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, Umbraco \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p><strong>Issue 2<\/strong><\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u0421\u0440\u0430\u0437\u0443 \u0437\u0430 \u043a\u043e\u0434\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430, \u0430 \u0443\u0436\u0435 \u0437\u0430 \u043d\u0435\u0439 \u2013 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<pre><code>public static string ToXmlString(this object value, Type type) {   if (value == null) return string.Empty;   if (type == typeof(string))      return (value.ToString().IsNullOrWhiteSpace() ? \"\" : value.ToString());   if (type == typeof(bool)) return XmlConvert.ToString((bool)value);   if (type == typeof(byte)) return XmlConvert.ToString((byte)value);   if (type == typeof(char)) return XmlConvert.ToString((char)value);   if (type == typeof(DateTime)) return XmlConvert.ToString((DateTime)value,   XmlDateTimeSerializationMode.Unspecified);   if (type == typeof(DateTimeOffset))      return XmlConvert.ToString((DateTimeOffset)value);   if (type == typeof(decimal)) return XmlConvert.ToString((decimal)value);   if (type == typeof(double)) return XmlConvert.ToString((double)value);   if (type == typeof(float)) return XmlConvert.ToString((float)value);   if (type == typeof(Guid)) return XmlConvert.ToString((Guid)value);   if (type == typeof(int)) return XmlConvert.ToString((int)value);   if (type == typeof(long)) return XmlConvert.ToString((long)value);   if (type == typeof(sbyte)) return XmlConvert.ToString((sbyte)value);   if (type == typeof(short)) return XmlConvert.ToString((short)value);   if (type == typeof(TimeSpan)) return XmlConvert.ToString((TimeSpan)value);   if (type == typeof(bool)) return XmlConvert.ToString((bool)value);   if (type == typeof(uint)) return XmlConvert.ToString((uint)value);   if (type == typeof(ulong)) return XmlConvert.ToString((ulong)value);   if (type == typeof(ushort)) return XmlConvert.ToString((ushort)value);   .... } <\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u0441 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u043a\u043e\u0439, \u0442\u043e \u0443 \u0432\u0430\u0441 \u043e\u0440\u043b\u0438\u043d\u043e\u0435 \u0437\u0440\u0435\u043d\u0438\u0435! \u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0441\u043e\u043a\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code>public static string ToXmlString(this object value, Type type) {   ....   if (type == typeof(bool)) return XmlConvert.ToString((bool)value);   ....   if (type == typeof(bool)) return XmlConvert.ToString((bool)value);   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3021\/\">V3021<\/a> There are two &#8216;if&#8217; statements with identical conditional expressions. The first &#8216;if&#8217; statement contains method return. This means that the second &#8216;if&#8217; statement is senseless ObjectExtensions.cs 615<\/p>\n<p>\u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0430 code review, \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438?<\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0432\u0435\u0437\u043b\u043e \u0438 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435. \u041a \u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0432\u043e\u0434\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0439\u0442\u0438 \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043e\u043a \u043c\u0435\u0442\u043e\u0434\u0430 <em>XmlConvert.ToString<\/em>. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0435\u0437\u0451\u0442 \u043d\u0435 \u0432\u0441\u0435\u043c \u0438 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u2013 \u043f\u043e\u0440\u043e\u0439 \u0437\u0430 copy-paste \u043c\u043e\u0433\u0443\u0442 <a href=\"https:\/\/pvs-studio.com\/ru\/blog\/examples\/v3021\/\">\u0441\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u043f\u0440\u0438\u043c\u0435\u0442\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/a>.<\/p>\n<p><strong>Issue 3<\/strong><\/p>\n<pre><code>public bool FlagOutOfDateModels {   get => _flagOutOfDateModels;    set   {     if (!ModelsMode.IsAuto())     {       _flagOutOfDateModels = false;     }      _flagOutOfDateModels = value;   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3008\/\">V3008<\/a> The &#8216;_flagOutOfDateModels&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 54, 51. ModelsBuilderSettings.cs 54<\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0432 set accessor \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>_flagOutOfDateModels<\/em>, \u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0451 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u043e\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0431\u043b\u043e\u043a <em>if<\/em> \u043d\u0435 \u043d\u0435\u0441\u0451\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u044b.<\/p>\n<p><strong>Issue 4<\/strong><\/p>\n<pre><code>private bool MatchesEndpoint(string absPath) {   IEnumerable&lt;RouteEndpoint> routeEndpoints = _endpointDataSource     ?.Endpoints     .OfType&lt;RouteEndpoint>()     .Where(x =>     {       ....     });    var routeValues = new RouteValueDictionary();    RouteEndpoint matchedEndpoint = routeEndpoints     .Where(e => new TemplateMatcher(         TemplateParser.Parse(e.RoutePattern.RawText),         new RouteValueDictionary())       .TryMatch(absPath, routeValues))     .OrderBy(c => c.Order)     .FirstOrDefault();    return matchedEndpoint != null; } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3105\/\">V3105<\/a> The &#8216;routeEndpoints&#8217; variable was used after it was assigned through null-conditional operator. NullReferenceException is possible. RoutableDocumentFilter.cs 198<\/p>\n<p>\u0414\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3105\/\">V3105<\/a> \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f <em>NullReferenceException<\/em>. <em>_endpointDataSource<\/em> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>null<\/em> \u0437\u0430 \u0441\u0447\u0451\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;?.&#8217;. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>_endpointDataSource<\/em> \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>, \u0442\u043e \u0438 \u0432 <em>routeEndpoints<\/em> \u0431\u0443\u0434\u0435\u0442 <em>null.<\/em><\/p>\n<p>\u0421\u0442\u0440\u0430\u043d\u043d\u044b\u043c \u0437\u0434\u0435\u0441\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u043e, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a <em>routeEndpoints<\/em> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0443\u0436\u0435 \u0431\u0435\u0437 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;?.&#8217;. \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u0435\u0441\u043b\u0438 <em>routeEndpoints<\/em> \u2013 <em>null<\/em>, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <em>NullReferenceException<\/em>.<\/p>\n<p><strong>Issue 5<\/strong><\/p>\n<pre><code>public void Handle(ContentCopiedNotification notification) {   ....   if (relationType == null)   {     relationType = new RelationType(       Constants.Conventions.RelationTypes.RelateDocumentOnCopyAlias,       Constants.Conventions.RelationTypes.RelateDocumentOnCopyName,       true,       Constants.ObjectTypes.Document,       Constants.ObjectTypes.Document);      _relationService.Save(relationType);   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3066\/\">V3066<\/a> Possible incorrect order of arguments passed to &#8216;RelationType&#8217; constructor. RelateOnCopyNotificationHandler.cs 32<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0435\u043c\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0435\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443:<\/p>\n<pre><code>public RelationType(string name,                     string alias,                     bool isBidrectional,                     Guid? parentObjectType,                     Guid? childObjectType) <\/code><\/pre>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u043d\u0435 \u0432 \u0442\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <em>RelateDocumentOnCopy<\/em><strong><em>Alias<\/em><\/strong> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 <em>name<\/em>, \u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <em>RelateDocumentOnCopy<\/em><strong><em>Name<\/em><\/strong> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>alias<\/em>.<\/p>\n<p><strong>Issue 6<\/strong><\/p>\n<pre><code>private static async Task&lt;Attempt&lt;UrlInfo>> DetectCollisionAsync(....) {   ....   if (pcr.IgnorePublishedContentCollisions)   {     logger.LogDebug(logMsg, url, uri, culture);   }   else   {     logger.LogDebug(logMsg, url, uri, culture);   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.com\/ru\/w\/v3004\/\">V3004<\/a> The &#8216;then&#8217; statement is equivalent to the &#8216;else&#8217; statement. UrlProviderExtensions.cs 274<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0430\u0448\u0451\u043b \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0442\u0432\u0438 <em>then<\/em> \u0438 <em>else<\/em> \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a, \u0447\u0442\u043e \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u043a\u043e\u0434 \u0438 \u0437\u0430\u0431\u044b\u043b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p><strong>Issue 7<\/strong><\/p>\n<pre><code>public async Task&lt;bool> IsMemberAuthorizedAsync(....) {   ....   if (IsLoggedIn() == false)   {     allowAction = false;   }   else   {      string username;     ....     username =<\/code><\/pre>\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-398869","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/398869","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=398869"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/398869\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=398869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=398869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=398869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}