ilscipio/scipio-erp

View on GitHub
framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java

Summary

Maintainability
C
1 day
Test Coverage

Avoid deeply nested control flow statements.
Open

                        if (fkNames.contains(index.getName())) {
                            warningList.add("[IndexFKDupName] Index on entity "
                                            + entity.getEntityName()
                                            + " has an index-name \""
                                            + index.getName()
Severity: Major
Found in framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (indexNames.contains(index.getName())) {
                                warningList.add("[IndexDuplicateName] Index on entity "
                                                + entity.getEntityName() + " has a duplicate index-name \""
                                                + index.getName() + "\".");
                            } else {
    Severity: Major
    Found in framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (tableNames.contains(index.getName())) {
                                  warningList.add("[IndexTableDupName] Index on entity "
                                                  + entity.getEntityName() + " has an index-name \""
                                                  + index.getName() + "\" that is also being used as a table name.");
                              }
      Severity: Major
      Found in framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if (relation.getFkName().length() > 0) {
                                    if (fkNames.contains(relation.getFkName())) {
                                        warningList.add("[RelationFkDuplicate] Relation to "+ relation.getRelEntityName()
                                                        + " from entity " + entity.getEntityName() + " has a duplicate fk-name \""
                                                        + relation.getFkName() + "\".");
        Severity: Major
        Found in framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (!entityNames.contains(relation.getRelEntityName())) {
                                      warningList.add("[RelatedEntityNotFound] Related entity " + relation.getRelEntityName()
                                                      + " of entity " + entity.getEntityName() + " not found.");
                                  }
          Severity: Major
          Found in framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    for (ModelKeyMap keyMap : relation.getKeyMaps()) {
            
                                        ModelField field = entity.getField(keyMap.getFieldName());
                                        ModelField rfield = null;
                                        if (relatedEntity != null) {
            Severity: Major
            Found in framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (helperName == null) {
                                          warningMsg.append(" (no helper definition found)");
                                      }
              Severity: Major
              Found in framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (index.getName().length() > 18) {
                                            warningList.add("[IndexNameGT18] The index name " + index.getName() + " (length:" + index.getName().length()
                                                            + ") was greater than 18 characters in length for entity " + entity.getEntityName() + ".");
                                        }
                Severity: Major
                Found in framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if (relations.contains(relation.getTitle() + relation.getRelEntityName())) {
                                              warningList.add("[RelationNameNotUnique] Relation " + relation.getTitle() + relation.getRelEntityName()
                                                              + " of entity "+ entity.getEntityName() + " is not unique for that entity.");
                                          } else {
                                              relations.add(relation.getTitle() + relation.getRelEntityName());
                  Severity: Major
                  Found in framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (relatedEntity != null) {
                                                //if relation is of type one, make sure keyMaps
                                                // match the PK of the relatedEntity
                                                if ("one".equals(relation.getType()) || "one-nofk".equals(relation.getType())) {
                                                    if (relatedEntity.getPksSize() != relation.getKeyMaps().size())
                    Severity: Major
                    Found in framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (relation.getFkName().length() > 18) {
                                                  warningList.add("[RelFKNameGT18] The foreign key named " + relation.getFkName()
                                                                  + " (length:" + relation.getFkName().length()
                                                                  + ") was greater than 18 characters in length for relation " + relation.getTitle() + relation.getRelEntityName()
                                                                  + " of entity " + entity.getEntityName() + ".");
                      Severity: Major
                      Found in framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java - About 45 mins to fix

                        There are no issues that match your filters.

                        Category
                        Status