79196056

Date: 2024-11-16 21:17:34
Score: 3
Natty:
Report link

You are right, the build does not detect those problems. Why? Because it would dramatically compromise build performance.

What could be the approaches? I can see two:

  1. Static analysis. By static I mean inspecting assemblies using Reflection without re-building them. The analysis can be performed against the root of the object graph. Collect all types and members, create associations related to the usage of other types in each type, and then find out all members included in Data Contract. And then search for possible inconsistencies like the one you show. This is quite a solvable problem, but the code will be too big for a single question. If you have questions about some specific inconsistencies, most likely I could answer and build a code sample detecting them, but I would not take so much time to create an entire utility.

  2. Testing. :-(

Reasons:
  • Blacklisted phrase (0.5): Why?
  • Blacklisted phrase (1): What could be
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Sergey A Kryukov