Skip to content

[SYNCOPE-1804] Introducing syncope-core-persistence-neo4j #628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 23, 2024

Conversation

ilgrosso
Copy link
Member

@ilgrosso ilgrosso commented Feb 21, 2024

This PR is just the first step to have Syncope Core fully running on Neo4j.

Missing items include at least:

  • replacing Quartz - see SYNCOPE-1801
  • refactoring of audit mechanisms to remove log4j for a proper DAO
  • Keymaster: domain, self-keymaster, defaultContent.xml
  • profile to run IT cases


List<PlainAttrValue> anyAttrValues = new ArrayList<>();
anyAttrValues.add(anyUtils.newPlainAttrValue());
switch (anyAttrValue) {

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [anyAttrValue](1) may be null at this access as suggested by [this](2) null guard. Variable [anyAttrValue](1) may be null at this access as suggested by [this](3) null guard.
}

protected void getQueryForCustomConds(
final AnyTypeKind kind,

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'kind' is never used.

protected void getQueryForCustomConds(
final AnyTypeKind kind,
final SearchCond cond,

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'cond' is never used.
protected void getQueryForCustomConds(
final AnyTypeKind kind,
final SearchCond cond,
final Map<String, Object> parameters,

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'parameters' is never used.
final AnyTypeKind kind,
final SearchCond cond,
final Map<String, Object> parameters,
final boolean not,

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'not' is never used.
TextStringBuilder query = new TextStringBuilder("MATCH (n) WHERE ");

plainSchemaDAO.findById(cond.getSchema()).ifPresentOrElse(
schema -> fillAttrQuery(

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'schema' is never used.
PolicyUtils getInstance(Policy policy);
public PolicyUtils getInstance(final Policy policy) {
PolicyType type;
if (policy instanceof AccountPolicy) {

Check notice

Code scanning / CodeQL

Chain of 'instanceof' tests

This if block performs a chain of 9 type tests - consider alternatives, e.g. polymorphism or the visitor pattern.

protected abstract void relationshipFieldMatches(PropertyDescriptor pd, AnyCond cond, PlainSchema schema);

protected boolean matches(final Any<?> any, final AnyCond cond, final boolean not) {

Check notice

Code scanning / CodeQL

Confusing overloading of methods

Method AbstractAnyMatchDAO.matches(..) could be confused with overloaded method [matches](1), since dispatch depends on static types.
}
}

protected Pair<String, String> getQuery(

Check notice

Code scanning / CodeQL

Confusing overloading of methods

Method Neo4jAnySearchDAO.getQuery(..) could be confused with overloaded method [getQuery](1), since dispatch depends on static types.
private final Map<String, Driver> domains = new ConcurrentHashMap<>();

@Override
public Map<String, Driver> getDomains() {

Check notice

Code scanning / CodeQL

Exposing internal representation

getDomains exposes the internal representation stored in field domains. The value may be modified [after this call to getDomains](1).
@ilgrosso ilgrosso marked this pull request as draft February 21, 2024 12:49
@ilgrosso ilgrosso marked this pull request as ready for review February 23, 2024 05:42
}

public String getOrm() {
return orm;
public void setDiscriminator(final String discriminator) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'discriminator' is never used.
@ilgrosso ilgrosso merged commit c9072b6 into apache:master Feb 23, 2024
@ilgrosso ilgrosso deleted the SYNCOPE-1804 branch February 23, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant