Fork me on GitHub

CPD Results

The following document contains the results of PMD's CPD 7.7.0.

Duplications

File Line
gov/nist/secauto/metaschema/core/metapath/impl/AbstractArrayItem.java 64
gov/nist/secauto/metaschema/core/metapath/impl/AbstractMapItem.java 76
return (IArrayItem<T>) EMPTY;
  }

  @Override
  public boolean isDeterministic() {
    return true;
  }

  @Override
  public boolean isContextDepenent() {
    return false;
  }

  @Override
  public boolean isFocusDepenent() {
    return false;
  }

  @Override
  public IEnhancedQName getQName() {
    return QNAME;
  }

  @Override
  public Set<FunctionProperty> getProperties() {
    return PROPERTIES;
  }

  @Override
  public List<IArgument> getArguments() {
    return ARGUMENTS;
  }

  @Override
  public int arity() {
    return 1;
  }

  @Override
  public boolean isArityUnbounded() {
    return false;
  }

  @Override
  public ISequenceType getResult() {
    return RESULT;
  }

  @Override
  public ISequence<?> execute(List<? extends ISequence<?>> arguments, DynamicContext dynamicContext,
      ISequence<?> focus) {
    ISequence<? extends IIntegerItem> arg = FunctionUtils.asType(
        ObjectUtils.notNull(arguments.get(0)));
File Line
gov/nist/secauto/metaschema/core/model/IFeatureContainerModelAbsolute.java 40
gov/nist/secauto/metaschema/core/model/IFeatureContainerModelGrouped.java 32
return getModelContainer().getModelInstances();
  }

  @Override
  default NMI getNamedModelInstanceByName(Integer name) {
    return getModelContainer().getNamedModelInstanceMap().get(name);
  }

  @SuppressWarnings("null")
  @Override
  default Collection<NMI> getNamedModelInstances() {
    return getModelContainer().getNamedModelInstanceMap().values();
  }

  @Override
  default FI getFieldInstanceByName(Integer name) {
    return getModelContainer().getFieldInstanceMap().get(name);
  }

  @SuppressWarnings("null")
  @Override
  default Collection<FI> getFieldInstances() {
    return getModelContainer().getFieldInstanceMap().values();
  }

  @Override
  default AI getAssemblyInstanceByName(Integer name) {
    return getModelContainer().getAssemblyInstanceMap().get(name);
  }

  @SuppressWarnings("null")
  @Override
  default Collection<AI> getAssemblyInstances() {
    return getModelContainer().getAssemblyInstanceMap().values();
  }
}
File Line
gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringAfter.java 55
gov/nist/secauto/metaschema/core/metapath/function/library/FnSubstringBefore.java 55
private FnSubstringAfter() {
    // disable construction
  }

  @SuppressWarnings({ "unused", "PMD.OnlyOneReturn" })
  @NonNull
  private static ISequence<IStringItem> executeTwoArg(
      @NonNull IFunction function,
      @NonNull List<ISequence<?>> arguments,
      @NonNull DynamicContext dynamicContext,
      IItem focus) {

    // From the XPath 3.1 specification:
    // If the value of $arg1 or $arg2 is the empty sequence, or contains only
    // ignorable collation units, it is interpreted as the zero-length string.
    IStringItem arg1 = arguments.get(0).isEmpty()
        ? IStringItem.valueOf("")
        : FunctionUtils.asType(ObjectUtils.notNull(arguments.get(0).getFirstItem(true)));
    IStringItem arg2 = arguments.get(1).isEmpty()
        ? IStringItem.valueOf("")
        : FunctionUtils.asType(ObjectUtils.notNull(arguments.get(1).getFirstItem(true)));

    return ISequence.of(IStringItem.valueOf(fnSubstringAfter(arg1.asString(), arg2.asString())));
File Line
gov/nist/secauto/metaschema/core/metapath/function/library/FnMatches.java 102
gov/nist/secauto/metaschema/core/metapath/function/library/FnTokenize.java 136
private static ISequence<IBooleanItem> executeThreeArg(
      @NonNull IFunction function,
      @NonNull List<ISequence<?>> arguments,
      @NonNull DynamicContext dynamicContext,
      IItem focus) {
    IStringItem input = FunctionUtils.asTypeOrNull(arguments.get(0).getFirstItem(true));
    IStringItem pattern = ObjectUtils.requireNonNull(FunctionUtils.asTypeOrNull(arguments.get(1).getFirstItem(true)));
    IStringItem flags = ObjectUtils.requireNonNull(FunctionUtils.asTypeOrNull(arguments.get(2).getFirstItem(true)));

    return execute(input, pattern, flags);
  }

  @NonNull
File Line
gov/nist/secauto/metaschema/core/metapath/function/library/MapContains.java 32
gov/nist/secauto/metaschema/core/metapath/function/library/MapGet.java 32
@NonNull
  static final IFunction SIGNATURE = IFunction.builder()
      .name(NAME)
      .namespace(MetapathConstants.NS_METAPATH_FUNCTIONS_MAP)
      .deterministic()
      .contextIndependent()
      .focusIndependent()
      .argument(IArgument.builder()
          .name("map")
          .type(IMapItem.type())
          .one()
          .build())
      .argument(IArgument.builder()
          .name("key")
          .type(IAnyAtomicItem.type())
          .one()
          .build())
      .returnType(IBooleanItem.type())