vzakharchenko/dynamic-orm

View on GitHub

Showing 41 of 98 total issues

LiquibaseStructure has 23 methods (exceeds 20 allowed). Consider refactoring.
Open

public abstract class LiquibaseStructure implements DBStructure {
protected static final String CONTEXT_NAME = "production";
protected static final String AUTHOR_NAME = System.getProperty("user.name") + "(generate)";
private static final Logger LOGGER = LoggerFactory.getLogger(LiquibaseStructure.class);
private Comparator<String> fileNameComporator = StringComparator.getStringComparator();

    File UpdateModelBuilderImpl.java has 265 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package com.github.vzakharchenko.dynamic.orm.core.query.crud;
     
    import com.github.vzakharchenko.dynamic.orm.core.DMLModel;
    import com.github.vzakharchenko.dynamic.orm.core.cache.DiffColumn;
    import com.github.vzakharchenko.dynamic.orm.core.cache.DiffColumnModel;

      ModifyEvent has 21 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public abstract class ModifyEvent<EVENT extends ModifyEvent<EVENT>>
      extends ApplicationEvent
      implements TransactionalCombinedEvent<EVENT>,
      ModifyEventBuilder<EVENT>,
      Cloneable {

        Method insert has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

        @Override
        public Long insert(List<MODEL> models) {
        DBHelper.transactionCheck();
        Assert.notEmpty(models);
        if (PrimaryKeyHelper.hasPrimaryKey(qTable) &&

        Method updateWithCache has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        private Long updateWithCache() {
        List<Serializable> pkeys = new ArrayList<>();
        for (ModifyItem<MODEL> modifyItem : setsBatch) {
        if (!modifyItem.isEmpty()) {
        Object pkValue = modifyItem.getPrimaryKeyValue();

          Method insert has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          @Override
          public Long insert(List<MODEL> models) {
          DBHelper.transactionCheck();
          Assert.notEmpty(models);
          if (PrimaryKeyHelper.hasPrimaryKey(qTable) &&

            Method updateCacheAll has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            private SQLUpdateClause updateCacheAll(SQLUpdateClause sqlUpdateClause) {
            SQLUpdateClause sqlUpdateClause0 = sqlUpdateClause;
            for (ModifyItem<MODEL> modifyItem : setsBatch) {
            if (!modifyItem.isEmpty()) {
            BooleanExpression where = modifyItem.getWhere();

            Method getDialect has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            public static SQLTemplates getDialect(Database database, boolean quote) {
            if (database instanceof OracleDatabase) {
            return new OracleTemplates(quote);
            } else if (database instanceof PostgresDatabase) {
            return new PostgreSQLTemplates(quote);

            Method updateWithCache has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            private Long updateWithCache() {
            List<Serializable> pkeys = new ArrayList<>();
            for (ModifyItem<MODEL> modifyItem : setsBatch) {
            if (!modifyItem.isEmpty()) {
            Object pkValue = modifyItem.getPrimaryKeyValue();

            Method mergedDatabase has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            public void mergedDatabase(DatabaseSnapshot referenceDatabaseSnapshot) {
            DatabaseObjectCollection referenceObjectCollection =
            getDatabaseObjectCollection(referenceDatabaseSnapshot);
            mergedDynamicTables(referenceObjectCollection);
            mergedDatabase(referenceObjectCollection, Table.class, true);

            Method getExpressions has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            private List<Expression<?>> getExpressions() {
            List<Expression<?>> columns = new ArrayList<>();
            SubQueryExpression listSubQuery = listSubQueries.get(0);
            Expression<?> projection = listSubQuery.getMetadata().getProjection();
            if (projection instanceof QTuple) {

              Method read has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              @Override
              public void read(DatabaseChangeLog databaseChangeLog, String path,
              Comparator<String> comporator)
              throws IOException, LiquibaseException {
              Collection<String> unsortedResources = resourceAccessor

              Method fillStatistic has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              public static void fillStatistic(QueryStatisticRegistrator queryStatistic, Object object) {
              if (object instanceof QueryMetadata) {
              QUERY_METADATA_RESOLVER.resolve(queryStatistic, (QueryMetadata) object);
              } else if (object instanceof RelationalPath) {
              RELATIONAL_PATH_BASE_RESOLVER.resolve(queryStatistic, (RelationalPath<?>) object);

              Method getExpressions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              private List<Expression<?>> getExpressions() {
              List<Expression<?>> columns = new ArrayList<>();
              SubQueryExpression listSubQuery = listSubQueries.get(0);
              Expression<?> projection = listSubQuery.getMetadata().getProjection();
              if (projection instanceof QTuple) {

              Method equals has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              @Override
              public boolean equals(Object o) { //NOPMD
              if (o instanceof QDynamicTable) {
              if (this == o) {
              return true;

              Method getFromActiveTransaction has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              public <T> T getFromActiveTransaction(Serializable key, Class<T> tClass) {
              TransactionalCache transactionalCache = getTransactionCache();
              T value = transactionalCache.getFromCache(key, tClass);
              if (value == null) {
              if (transactionalCache.getEvictObjects().contains(key)) {

              Method updateSimpleAll has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              private SQLUpdateClause updateSimpleAll(SQLUpdateClause sqlUpdateClause) {
              SQLUpdateClause sqlUpdateClause0 = sqlUpdateClause;
              for (ModifyItem<MODEL> updateBatch : setsBatch) {
              if (!updateBatch.isEmpty()) {
              for (Map.Entry<Path<?>, Object> entry : updateBatch.getSetMap().entrySet()) {

              Method setTransactionName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              private void setTransactionName(DefaultTransactionStatus status,
              TransactionDefinition definition) {
              try {
              String transactionName;
              if (status.isNewSynchronization()) {

              Method list has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              public SortedSet<String> list(String relativeTo, String path, boolean includeFiles,
              boolean includeDirectories, boolean recursive) throws IOException {

                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) {
                Severity
                Category
                Status
                Source
                Language