{"results":{"result":{"added-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-url":"https://github.com/umbraco/Umbraco-CMS/pull/22506","old-code-health":9.560358892870028,"modified-files":{"code-health":9.019200610402596,"old-code-health":9.560358892870028,"files":[{"file":"src/Umbraco.Core/UdiParser.cs","loc":144,"old-loc":144,"code-health":8.882578852711319,"old-code-health":8.882578852711319},{"file":"tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/UdiTests.cs","loc":254,"old-loc":222,"code-health":9.096655465156704,"old-code-health":10.0}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"22506","analysis-time":"2026-04-17T05:10:38Z","negative-impact-count":1,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["226de72890c4b1118423f398e5bdf96221466399","57c9dcbc70cfdcc30c5b1578342d2b74d75283ec"],"is-negative-review":true,"negative-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"why-it-occurs":"Measures the number of lines with consecutive assert statements in a unit test. The more consecutive assert statements, the lower the code health. The threshold for the C# language is 4 consecutive lines of assert statements.","name":"Large Assertion Blocks","file":"tests/Umbraco.Tests.UnitTests/Umbraco.Core/CoreThings/UdiTests.cs","refactoring-examples":[{"architectural-component-id":null,"author-name":"Nikolaj E. Lauridsen","training-data":{"loc-added":"13","loc-deleted":"44","delta-cc-mean":"0.0","delta-cc-total":"0","delta-penalties":"2.0","delta-n-functions":"0","current-file-score":"8.816158827775617"},"author-email":"nikolajlauridsen@protonmail.ch","commit-full-message":"* Remove nucache reference from Web.Common\r\n\r\n* Get tests building-ish\r\n\r\n* Move ReservedFieldNamesService to the right project\r\n\r\n* Remove IPublishedSnapshotStatus\r\n\r\n* Added functionality to the INavigationQueryService to get root keys\r\n\r\n* Fixed issue with navigation\r\n\r\n* Remove IPublishedSnapshot from UmbracoContext\r\n\r\n* Begin removing usage of IPublishedSnapshot from PublishedContentExtensions\r\n\r\n* Fix PublishedContentExtensions.cs\r\n\r\n* Don't use snapshots in delivery media api\r\n\r\n* Use IPublishedMediaCache in QueryMediaApiController\r\n\r\n* Remove more usages of IPublishedSnapshotAccessor\r\n\r\n* Comment out tests\r\n\r\n* Remove more usages of PublishedSnapshotAccessor\r\n\r\n* Remove PublishedSnapshot from property\r\n\r\n* Fixed test build\r\n\r\n* Fix errors\r\n\r\n* Fix some tests\r\n\r\n* Delete NuCache 🎉\r\n\r\n* Implement DatabaseCacheRebuilder\r\n\r\n* Remove usage of IPublishedSnapshotService\r\n\r\n* Remove IPublishedSnapshotService\r\n\r\n* Remove TestPublishedSnapshotAccessor and make tests build\r\n\r\n* Don't test Snapshot cachelevel\r\n\r\nIt's no longer supported\r\n\r\n* Fix BlockEditorConverter\r\n\r\nElement != Element document type\r\n\r\n* Remember to set cachemanager\r\n\r\n* Fix RichTextParserTests\r\n\r\n* Implement TryGetLevel on INavigationQueryService\r\n\r\n* Fake level and obsolete it in PublishedContent\r\n\r\n* Remove ChildrenForAllCultures\r\n\r\n* Hack Path property on PublishedContent\r\n\r\n* Remove usages of IPublishedSnapshot in tests\r\n\r\n* More ConvertersTests\r\n\r\n* Add hybrid cache to integration tests\r\n\r\nWe can actually do this now because we no longer save files on disk\r\n\r\n* Rename IPublishedSnapshotRebuilder to ICacheRebuilder\r\n\r\n* Comment out tests\r\n\r\n* V15: Replacing the usages of Parent (navigation data) from IPublishedContent (#17125)\r\n\r\n* Fix .Parent references in PublishedContentExtensions\r\n\r\n* Add missing methods to FriendlyPublishedContentExtensions (ones that you were able to call on the content directly as they now require extra params)\r\n\r\n* Fix references from the extension methods\r\n\r\n* Fix dependencies in tests\r\n\r\n* Replace IPublishedSnapshotAccessor with the content cache in tests\r\n\r\n* Resolving more .Parent references\r\n\r\n* Fix unit tests\r\n\r\n* Obsolete and use extension methods\r\n\r\n* Remove private method and use extension instead\r\n\r\n* Moving code around\r\n\r\n* Fix tests\r\n\r\n* Fix more references\r\n\r\n* Cleanup\r\n\r\n* Fix more usages\r\n\r\n* Resolve merge conflict\r\n\r\n* Fix tests\r\n\r\n* Cleanup\r\n\r\n* Fix more tests\r\n\r\n* Fixed unit tests\r\n\r\n* Cleanup\r\n\r\n* Replace last usages\r\n\r\n---------\r\n\r\nCo-authored-by: Bjarke Berg <mail@bergmania.dk>\r\n\r\n* Remove usage of IPublishedSnapshotAccessor from IRequestItemProvider\r\n\r\n* Post merge fixup\r\n\r\n* Remo IPublishedSnapshot\r\n\r\n* Add HasAny to IDocumentUrlService\r\n\r\n* Fix TextBuilder\r\n\r\n* Fix modelsbuilder tests\r\n\r\n* Use explicit types\r\n\r\n* Implement GetByContentType\r\n\r\n* Support element types in PublishedContentTypeCache\r\n\r\n* Run enlistments before publishing notifications\r\n\r\n* Fix elements cache refreshing\r\n\r\n* Implement GetByUdi\r\n\r\n* Implement GetAtRoot\r\n\r\n* Implement GetByRoute\r\n\r\n* Reimplement GetRouteById\r\n\r\n* Fix blocks unit tests\r\n\r\n* Initialize domain cache on boot\r\n\r\n* Only return routes with domains on non default lanauges\r\n\r\n* V15: Replacing the usages of `Children` (navigation data) from `IPublishedContent` (#17159)\r\n\r\n* Update params in PublishedContentExtensions to the general interfaces for the published cache and navigation service, so that we can use the extension methods on both documents and media\r\n\r\n* Introduce GetParent() which uses the right services\r\n\r\n* Fix obsolete message on .Parent\r\n\r\n* Obsolete .Children\r\n\r\n* Fix usages of Children for ApiMediaQueryService\r\n\r\n* Fix usage in internal\r\n\r\n* Fix usages in views\r\n\r\n* Fix indentation\r\n\r\n* Fix issue with delete language\r\n\r\n* Update nuget pacakges\r\n\r\n* Clear elements cache when content is deleted\r\n\r\ninstead of trying to update it\r\n\r\n* Reset publishedModelFactory\r\n\r\n* Fixed publishing\r\n\r\n---------\r\n\r\nCo-authored-by: Bjarke Berg <mail@bergmania.dk>\r\nCo-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>\r\nCo-authored-by: kjac <kja@umbraco.dk>","commit-date":"2024-10-01T13:03:02Z","current-rev":"1258962429","filename":"Umbraco-CMS/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/PropertyCacheLevelTests.cs","previous-rev":"7ca96423f8","commit-title":"V15: Remove Nucache (#17166)","language":"C#","id":"317e3b4696aecdc2bc9cb9235de62738fda392f3","model-score":0.16,"author-id":null,"project-id":33308,"delta-file-score":0.53217775,"diff":"diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/PropertyCacheLevelTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/PropertyCacheLevelTests.cs\nindex bf786bbc98..ada873977c 100644\n--- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/PropertyCacheLevelTests.cs\n+++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/PropertyCacheLevelTests.cs\n@@ -73,6 +73,5 @@ IEnumerable<IPublishedPropertyType> CreatePropertyTypes(IPublishedContentType co\n     //  /None = not cached at all\n-    [TestCase(PropertyCacheLevel.None, PropertyCacheLevel.None, 2, 0, 0, 0, 0)]\n-    [TestCase(PropertyCacheLevel.None, PropertyCacheLevel.Element, 1, 0, 0, 0, 0)]\n-    [TestCase(PropertyCacheLevel.None, PropertyCacheLevel.Elements, 1, 0, 0, 0, 0)]\n-    [TestCase(PropertyCacheLevel.None, PropertyCacheLevel.Snapshot, 1, 0, 0, 0, 0)]\n+    [TestCase(PropertyCacheLevel.None, PropertyCacheLevel.None, 2, 0, 0)]\n+    [TestCase(PropertyCacheLevel.None, PropertyCacheLevel.Element, 1, 0, 0)]\n+    [TestCase(PropertyCacheLevel.None, PropertyCacheLevel.Elements, 1, 0, 0)]\n \n@@ -83,6 +82,5 @@ IEnumerable<IPublishedPropertyType> CreatePropertyTypes(IPublishedContentType co\n     //  /Elements = in elements\n-    [TestCase(PropertyCacheLevel.Element, PropertyCacheLevel.None, 2, 0, 0, 0, 0)]\n-    [TestCase(PropertyCacheLevel.Element, PropertyCacheLevel.Element, 1, 0, 0, 0, 0)]\n-    [TestCase(PropertyCacheLevel.Element, PropertyCacheLevel.Elements, 1, 1, 0, 1, 0)]\n-    [TestCase(PropertyCacheLevel.Element, PropertyCacheLevel.Snapshot, 1, 0, 1, 0, 1)]\n+    [TestCase(PropertyCacheLevel.Element, PropertyCacheLevel.None, 2, 0, 0)]\n+    [TestCase(PropertyCacheLevel.Element, PropertyCacheLevel.Element, 1, 0, 0)]\n+    [TestCase(PropertyCacheLevel.Element, PropertyCacheLevel.Elements, 1, 1, 1)]\n \n@@ -91,13 +89,5 @@ IEnumerable<IPublishedPropertyType> CreatePropertyTypes(IPublishedContentType co\n     //  /Snapshot = cached in snapshot\n-    [TestCase(PropertyCacheLevel.Elements, PropertyCacheLevel.None, 2, 0, 0, 0, 0)]\n-    [TestCase(PropertyCacheLevel.Elements, PropertyCacheLevel.Element, 1, 0, 0, 0, 0)]\n-    [TestCase(PropertyCacheLevel.Elements, PropertyCacheLevel.Elements, 1, 0, 0, 0, 0)]\n-    [TestCase(PropertyCacheLevel.Elements, PropertyCacheLevel.Snapshot, 1, 0, 1, 0, 1)]\n-\n-    // property is cached at snapshot level, converted cached at Element, exept\n-    //  /None = not cached at all\n-    [TestCase(PropertyCacheLevel.Snapshot, PropertyCacheLevel.None, 2, 0, 0, 0, 0)]\n-    [TestCase(PropertyCacheLevel.Snapshot, PropertyCacheLevel.Element, 1, 0, 0, 0, 0)]\n-    [TestCase(PropertyCacheLevel.Snapshot, PropertyCacheLevel.Elements, 1, 0, 0, 0, 0)]\n-    [TestCase(PropertyCacheLevel.Snapshot, PropertyCacheLevel.Snapshot, 1, 0, 0, 0, 0)]\n+    [TestCase(PropertyCacheLevel.Elements, PropertyCacheLevel.None, 2, 0, 0)]\n+    [TestCase(PropertyCacheLevel.Elements, PropertyCacheLevel.Element, 1, 0, 0)]\n+    [TestCase(PropertyCacheLevel.Elements, PropertyCacheLevel.Elements, 1, 0, 0)]\n     public void CachePublishedSnapshotTest(\n@@ -107,5 +97,3 @@ public void CachePublishedSnapshotTest(\n         int elementsCount1,\n-        int snapshotCount1,\n-        int elementsCount2,\n-        int snapshotCount2)\n+        int elementsCount2)\n     {\n@@ -131,11 +119,5 @@ IEnumerable<IPublishedPropertyType> CreatePropertyTypes(IPublishedContentType co\n         var elementsCache = new FastDictionaryAppCache();\n-        var snapshotCache = new FastDictionaryAppCache();\n \n-        var publishedSnapshot = new Mock<IPublishedSnapshot>();\n-        publishedSnapshot.Setup(x => x.SnapshotCache).Returns(snapshotCache);\n-        publishedSnapshot.Setup(x => x.ElementsCache).Returns(elementsCache);\n-\n-        var publishedSnapshotAccessor = new Mock<IPublishedSnapshotAccessor>();\n-        var localPublishedSnapshot = publishedSnapshot.Object;\n-        publishedSnapshotAccessor.Setup(x => x.TryGetPublishedSnapshot(out localPublishedSnapshot)).Returns(true);\n+        var cacheManager = new Mock<ICacheManager>();\n+        cacheManager.Setup(x => x.ElementsCache).Returns(elementsCache);\n \n@@ -153,3 +135,3 @@ IEnumerable<IPublishedPropertyType> CreatePropertyTypes(IPublishedContentType co\n             referenceCacheLevel,\n-            publishedSnapshotAccessor.Object);\n+            cacheManager.Object);\n \n@@ -160,4 +142,2 @@ IEnumerable<IPublishedPropertyType> CreatePropertyTypes(IPublishedContentType co\n         Assert.AreEqual(elementsCount1, elementsCache.Count);\n-        Assert.AreEqual(snapshotCount1, snapshotCache.Count);\n-\n         Assert.AreEqual(1234, set1.Value(Mock.Of<IPublishedValueFallback>(), \"prop1\"));\n@@ -167,6 +147,2 @@ IEnumerable<IPublishedPropertyType> CreatePropertyTypes(IPublishedContentType co\n         Assert.AreEqual(elementsCount2, elementsCache.Count);\n-        Assert.AreEqual(snapshotCount2, snapshotCache.Count);\n-\n-        var oldSnapshotCache = snapshotCache;\n-        snapshotCache.Clear();\n \n@@ -176,6 +152,2 @@ IEnumerable<IPublishedPropertyType> CreatePropertyTypes(IPublishedContentType co\n         Assert.AreEqual(elementsCount2, elementsCache.Count);\n-        Assert.AreEqual(snapshotCount2, snapshotCache.Count);\n-        Assert.AreEqual(snapshotCount2, oldSnapshotCache.Count);\n-\n-        Assert.AreEqual((interConverts == 1 ? 1 : 3) + snapshotCache.Count, converter.InterConverts);\n \n@@ -189,5 +161,2 @@ IEnumerable<IPublishedPropertyType> CreatePropertyTypes(IPublishedContentType co\n         Assert.AreEqual(elementsCount2, oldElementsCache.Count);\n-        Assert.AreEqual(snapshotCount2, snapshotCache.Count);\n-\n-        Assert.AreEqual((interConverts == 1 ? 1 : 4) + snapshotCache.Count + elementsCache.Count, converter.InterConverts);\n     }\n","improvement-type":"Large Assertion Blocks"}],"change-level":"warning","is-hotspot?":false,"line":41,"what-changed":"The test suite contains 5 assertion blocks with at least 4 assertions, threshold = 4","how-to-fix":"Consider to encapsulate the assertions (i.e. test criteria) in a custom assert statement. This simplifies the test by letting you communicate the test criteria in the language of your domain.  We also recommend to consider the granularity of the tests; sometimes a single test tests too many things; extracting smaller tests often help to simplify the test criteria. Finally, large assertion blocks can also signal missing functionality in the code under test: instead of fetching and comparing individual properties of an object, maybe that class should encapsulate what equality means in an Equals() method?","change-type":"introduced"}]},"positive-impact-count":0,"repo":"Umbraco-CMS","code-health":9.019200610402596,"version":"3.0","authors":["Henrik Gedionsen","Andy Butland"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2026-04-17T05:10:37.000Z","project-name":"Umbraco-CMS","repository":"https://github.com/umbraco/Umbraco-CMS.git"}}