code: function () {
        var doUniqueConnectionIdsCheck = function (compound) {
          var duplicateConnectionIds = [];
          compound.connections.forEach(function (connection) {
            var connectionId = connection.connectionId;
  
            function filterByConnectionId (connection) {
              return connection.connectionId === connectionId;
            }
  
            var arrayByConnectionId = compound.connections.filter(filterByConnectionId);
            if (arrayByConnectionId.length > 1 && duplicateConnectionIds.indexOf(connectionId) < 0) {
              duplicateConnectionIds.push(connectionId);
            }
          });
          duplicateConnectionIds.forEach(function (connectionId) {
            errors.push('RuleViolation identified: Artifact \'' + compound.artifactId +
              '\' contains multiple connections with \'connectionId\'=\'' + connectionId + '\'');
          });
        };
        //
        if (doc.artifacts && doc.artifacts.compoundComponents) {
          doc.artifacts.compoundComponents.forEach(doUniqueConnectionIdsCheck);
        }
      }
docs: Rule 5: Check compound member definitions to have unique memberId's.