vzakharchenko/dynamic-orm

View on GitHub

Showing 41 of 98 total issues

Method getAliasFromExpression has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

public static Expression getAliasFromExpression(Expression<?> expression) {
if (expression instanceof Path) {
return null;
} else {
if (expression instanceof Operation) {

Method createRawModelExpression has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

protected MappingProjection<RawModel> createRawModelExpression(SQLQuery query,
List<Expression<?>> columns) {
 
if (mappingProjection == null) {
if (CollectionUtils.isEmpty(columns)) {

Method publishEvent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

@Override
public void publishEvent(final Object event) {
Assert.notNull(publisher);
Assert.notNull(event);
TransactionEventType transactionEventType = getTransactionType(event);

Method validateQuery has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

protected SQLCommonQuery<?> validateQuery(SQLCommonQuery<?> sqlQuery, RelationalPath<?> qTable,
Class<? extends DMLModel> modelClass) {
SQLCommonQuery<?> sqlQuery0 = sqlQuery;
if (!searchQModel(sqlQuery0, qTable)) {
if (CollectionUtils.isEmpty(DBHelper.castProjectionQueryToSqlQuery(sqlQuery0)

Method transformObjectValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

public static <T> T transformObjectValue(Object value, Class<T> valueClass) {
try {
T ret;
if (value instanceof String && !valueClass.equals(String.class)) {
Constructor<T> constructor = valueClass.getConstructor(String.class);

Avoid too many return statements within this method.
Open

return new PostgreSQLTemplates(quote);

    Avoid too many return statements within this method.
    Open

    return new H2Templates(quote);

      Avoid too many return statements within this method.
      Open

      return StringUtils.equalsIgnoreCase(this.getTableName(), that.getTableName());

        Avoid too many return statements within this method.
        Open

        return new OracleTemplates(quote);

          Avoid too many return statements within this method.
          Open

          return false;

            Avoid too many return statements within this method.
            Open

            return new MySQLTemplates(quote);

              Avoid too many return statements within this method.
              Open

              return true;

                Method updateModelsById has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                @Override
                public Long updateModelsById(List<MODEL> models) {
                if (CollectionUtils.isEmpty(models)) {
                return 0L;
                }

                Method getQTable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                public RelationalPath<?> getQTable() {
                if (qTable == null && isAnnotationQueryDslModelPresent()) {
                try {
                qTable = queryDslModel.qTableClass().getConstructor(String.class)
                .newInstance(queryDslModel.tableName());

                Method getFromTargetCache has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                @Override
                public <T> T getFromTargetCache(Serializable key, Class<T> tClass) {
                 
                if (TransactionSynchronizationManager.isSynchronizationActive()) {
                TransactionalCache transactionalCache = getTransactionCache();

                Method newInstance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                public static <MODEL extends DMLModel> MODEL newInstance(
                RelationalPath<?> qTable, Class<MODEL> modelClass) {
                if (qTable instanceof QDynamicTable) {
                if (ObjectUtils.notEqual(DynamicTableModel.class, modelClass)) {
                throw new IllegalStateException("for dynamic Table use only " +

                Method setNextPrimaryKey has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                protected void setNextPrimaryKey(Collection<MODEL> batchModels) {
                PKGenerator<?> pkGenerator0 = this.pkGenerator;
                for (MODEL batchModel : batchModels) {
                CompositeKey compositeKey = PrimaryKeyHelper
                .getOnePrimaryKeyValues(batchModel, qTable);

                Method searchQModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                private boolean searchQModel(SQLCommonQuery<?> sqlQuery, RelationalPath<?> qTable) {
                List<JoinExpression> joinExpressions = DBHelper.castProjectionQueryToSqlQuery(sqlQuery)
                .getMetadata().getJoins();
                for (JoinExpression joinExpression : joinExpressions) {
                if (joinExpression.getTarget() instanceof RelationalPath) {

                Method getTableName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                public static String getTableName(Path path) {
                if (path == null) {
                return null;
                }
                if (path instanceof RelationalPath) {

                Method addSoftDeleteColumn has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                protected QDynamicTable addSoftDeleteColumn(
                String columnName, Serializable value, Serializable defaultValue) {
                Path<Serializable> softDeleteColumn = ModelHelper
                .getColumnByName(this, StringUtils.upperCase(columnName));
                if (softDeleteColumn == null) {
                Severity
                Category
                Status
                Source
                Language