UpdateNode.java

Index Score
org.apache.derby.impl.sql.compile
Apache Derby

View: Reasons, Metrics, Source Code

These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.

MetricDescription
EXEC_COMMENTSComments in executable code
EXITSProcedure exits
SIZESize of the file in bytes
BLOCK_COMMENTNumber of block comment lines
COMMENTSComment lines
LINESNumber of lines in the source file
RETURNSNumber of return points from functions
LOCLines of code
ELOCEffective lines of code
UNIQUE_OPERANDSNumber of unique operands
OPERATORSNumber of operators
PROGRAM_LENGTHHalstead program length
OPERANDSNumber of operands
PROGRAM_VOCABHalstead program vocabulary
JAVA0145JAVA0145 Tab character used in source file
LOGICAL_LINESNumber of statements
JAVA0285JAVA0285 Dereference of potentially null variable
JAVA0034JAVA0034 Missing braces in if statement
INTERFACE_COMPLEXITYInterface complexity
COMPARISONSNumber of comparison operators
LOOPSNumber of loops
CYCLOMATICCyclomatic complexity
JAVA0177JAVA0177 Variable declaration missing initializer
BLOCKSNumber of blocks
LINE_COMMENTNumber of line comments
JAVA0009JAVA0009 Protected member in final class
JAVA0080JAVA0080 Import declaration not used
DOC_COMMENTNumber of javadoc comment lines
JAVA0116JAVA0116 Missing javadoc: field 'field'
JAVA0081JAVA0081 Boolean literal in comparison
WHITESPACENumber of whitespace lines
JAVA0007JAVA0007 Should not declare public field
JAVA0270JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
JAVA0075JAVA0075 Method parameter hides field
JAVA0108JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
UNIQUE_OPERATORSNumber of unique operators
DECL_COMMENTSComments in declarations
JAVA0117JAVA0117 Missing javadoc: method 'method'
JAVA0094JAVA0094 Field hides a superclass field
PROGRAM_VOLUMEHalstead program volume
JAVA0174JAVA0174 Assigned local variable never used
JAVA0106JAVA0106 Unnecessary import from current package
JAVA0288JAVA0288 Inconsistent null check
JAVA0126JAVA0126 Method declares unchecked exception in throws
JAVA0179JAVA0179 Local variable hides visible field
JAVA0123JAVA0123 Use all three components of for loop
JAVA0173JAVA0173 Unused method parameter
JAVA0130JAVA0130 Non-static method does not use instance fields
NEST_DEPTHMaximum nesting depth
JAVA0110JAVA0110 Incorrect javadoc: no @return tag
/* Derby - Class org.apache.derby.impl.sql.compile.UpdateNode Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.apache.derby.impl.sql.compile; import org.apache.derby.iapi.services.context.ContextManager; import org.apache.derby.iapi.services.loader.GeneratedMethod; import org.apache.derby.iapi.services.compiler.MethodBuilder; import org.apache.derby.impl.sql.compile.ActivationClassBuilder; import org.apache.derby.iapi.sql.conn.Authorizer; import org.apache.derby.iapi.sql.conn.LanguageConnectionContext; import org.apache.derby.impl.sql.execute.FKInfo; import org.apache.derby.iapi.services.compiler.MethodBuilder; import org.apache.derby.iapi.services.sanity.SanityManager; import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.sql.compile.CompilerContext; import org.apache.derby.iapi.sql.compile.C_NodeTypes; import org.apache.derby.iapi.sql.compile.Visitable; import org.apache.derby.iapi.sql.compile.Visitor; import org.apache.derby.iapi.sql.conn.LanguageConnectionContext; import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor; import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList; import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor; import org.apache.derby.iapi.sql.dictionary.CheckConstraintDescriptor; import org.apache.derby.iapi.sql.dictionary.DataDictionary; import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator; import org.apache.derby.iapi.sql.dictionary.TableDescriptor; import org.apache.derby.iapi.sql.dictionary.GenericDescriptorList; import org.apache.derby.iapi.reference.SQLState; import org.apache.derby.iapi.sql.execute.ConstantAction; import org.apache.derby.iapi.sql.execute.CursorResultSet; import org.apache.derby.iapi.sql.execute.ExecPreparedStatement; import org.apache.derby.iapi.sql.execute.ExecRow; import org.apache.derby.iapi.sql.Activation; import org.apache.derby.iapi.sql.ResultSet; import org.apache.derby.iapi.sql.StatementType; import org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo; import org.apache.derby.iapi.store.access.TransactionController; import org.apache.derby.vti.DeferModification; import org.apache.derby.iapi.services.io.FormatableBitSet; import org.apache.derby.iapi.reference.ClassName; import org.apache.derby.iapi.util.ReuseFactory; import org.apache.derby.iapi.services.classfile.VMOpcode; import java.lang.reflect.Modifier; import java.sql.SQLException; import java.util.Properties; import java.util.Vector; /** * An UpdateNode represents an UPDATE statement. It is the top node of the * query tree for that statement. * For positioned update, there may be no from table specified. * The from table will be derived from the cursor specification of * the named cursor. * */ public final class UpdateNode extends DMLModStatementNode { //Note: These are public so they will be visible to //the RepUpdateNode. public int[] changedColumnIds; public ExecRow emptyHeapRow; public boolean deferred; public ValueNode checkConstraints; public FKInfo fkInfo; protected FromTable targetTable; protected FormatableBitSet readColsBitSet; protected boolean positionedUpdate; /* Column name for the RowLocation in the ResultSet */ public static final String COLUMNNAME = "###RowLocationToUpdate"; /** * Initializer for an UpdateNode. * * @param targetTableName The name of the table to update * @param resultSet The ResultSet that will generate * the rows to update from the given table */ public void init( Object targetTableName, Object resultSet) { super.init(resultSet); this.targetTableName = (TableName) targetTableName; } /** * Convert this object to a String. See comments in QueryTreeNode.java * for how this should be done for tree printing. * * @return This object as a String */ public String toString() { if (SanityManager.DEBUG) { return targetTableName.toString() + "\n" + super.toString(); } else { return ""; } } public String statementToString() { return "UPDATE"; } /** * Prints the sub-nodes of this object. See QueryTreeNode.java for * how tree printing is supposed to work. * * @param depth The depth of this node in the tree */ public void printSubNodes(int depth) { if (SanityManager.DEBUG) { super.printSubNodes(depth); if (targetTableName != null) { printLabel(depth, "targetTableName: "); targetTableName.treePrint(depth + 1); } /* RESOLVE - need to print out targetTableDescriptor */ } } /** * Bind this UpdateNode. This means looking up tables and columns and * getting their types, and figuring out the result types of all * expressions, as well as doing view resolution, permissions checking, * etc. * <p> * Binding an update will also massage the tree so that * the ResultSetNode has a set of columns to contain the old row * value, followed by a set of columns to contain the new row * value, followed by a column to contain the RowLocation of the * row to be updated. * * * @exception StandardException Thrown on error */ public void bindStatement() throws StandardException { // We just need select privilege on the expressions getCompilerContext().pushCurrentPrivType( Authorizer.SELECT_PRIV); FromList fromList = (FromList) getNodeFactory().getNode( C_NodeTypes.FROM_LIST, getNodeFactory().doJoinOrderOptimization(), getContextManager()); ResultColumn rowLocationColumn = null; ValueNode rowLocationNode = null; TableName cursorTargetTableName = null; CurrentOfNode currentOfNode = null; FromList resultFromList; ResultColumnList afterColumns = null; DataDictionary dataDictionary = getDataDictionary(); // check if targetTable is a synonym if (targetTableName != null) { TableName synonymTab = resolveTableToSynonym(this.targetTableName); if (synonymTab != null) { this.synonymTableName = targetTableName; this.targetTableName = synonymTab; } } bindTables(dataDictionary); // wait to bind named target table until the cursor // binding is done, so that we can get it from the // cursor if this is a positioned update. // for positioned update, get the cursor's target table. if (SanityManager.DEBUG) { SanityManager.ASSERT((resultSet!=null && resultSet instanceof SelectNode), "Update must have a select result set"); } SelectNode sel; sel = (SelectNode)resultSet; targetTable = (FromTable) sel.fromList.elementAt(0); if (targetTable instanceof CurrentOfNode) { positionedUpdate = true; currentOfNode = (CurrentOfNode) targetTable; cursorTargetTableName = currentOfNode.getBaseCursorTargetTableName(); // instead of an assert, we might say the cursor is not updatable. if (SanityManager.DEBUG) { SanityManager.ASSERT(cursorTargetTableName != null); } } if (targetTable instanceof FromVTI) { targetVTI = (FromVTI) targetTable; targetVTI.setTarget(); } else { // positioned update can leave off the target table. // we get it from the cursor supplying the position. if (targetTableName == null) { // verify we have current of if (SanityManager.DEBUG) SanityManager.ASSERT(cursorTargetTableName!=null); targetTableName = cursorTargetTableName; } // for positioned update, we need to verify that // the named table is the same as the cursor's target. else if (cursorTargetTableName != null) { // this match requires that the named table in the update // be the same as a correlation name in the cursor. if ( !targetTableName.equals(cursorTargetTableName)) { throw StandardException.newException(SQLState.LANG_CURSOR_UPDATE_MISMATCH, targetTableName, currentOfNode.getCursorName()); } } } // because we verified that the tables match // and we already bound the cursor or the select, // the table descriptor should always be found. verifyTargetTable(); /* OVERVIEW - We generate a new ResultColumn, CurrentRowLocation(), and * prepend it to the beginning of the source ResultColumnList. This * will tell us which row(s) to update at execution time. However, * we must defer prepending this generated column until the other * ResultColumns are bound since there will be no ColumnDescriptor * for the generated column. Thus, the sequence of actions is: * * o Bind existing ResultColumnList (columns in SET clause) * o If this is a positioned update with a FOR UPDATE OF list, * then verify that all of the target columns are in the * FOR UPDATE OF list. * o Get the list of indexes that need to be updated. * o Create a ResultColumnList of all the columns in the target * table - this represents the old row. * o If we don't know which columns are being updated, * expand the original ResultColumnList to include all the * columns in the target table, and sort it to be in the * order of the columns in the target table. This represents * the new row. Append it to the ResultColumnList representing * the old row. * o Construct the changedColumnIds array sorted by column position. * o Generate the read column bit map and append any columns * needed for index maint, etc. * o Generate a new ResultColumn for CurrentRowLocation() and * mark it as a generated column. * o Append the new ResultColumn to the ResultColumnList * (This must be done before binding the expressions, so * that the proper type info gets propagated to the new * ResultColumn.) * o Bind the expressions. * o Bind the generated ResultColumn. */ /* Verify that all underlying ResultSets reclaimed their FromList */ if (SanityManager.DEBUG) { SanityManager.ASSERT(fromList.size() == 0, "fromList.size() is expected to be 0, not " + fromList.size() + " on return from RS.bindExpressions()"); } /* ** The current result column list is the one supplied by the user. ** Mark these columns as "updated", so we can tell later which ** columns are really being updated, and which have been added ** but are not really being updated. */ resultSet.getResultColumns().markUpdated(); /* Prepend CurrentRowLocation() to the select's result column list. */ if (SanityManager.DEBUG) SanityManager.ASSERT((resultSet.resultColumns != null), "resultColumns is expected not to be null at bind time"); /* ** Get the result FromTable, which should be the only table in the ** from list. */ resultFromList = resultSet.getFromList(); if (SanityManager.DEBUG) SanityManager.ASSERT(resultFromList.size() == 1, "More than one table in result from list in an update."); /* Normalize the SET clause's result column list for synonym */ if (synonymTableName != null) normalizeSynonymColumns( resultSet.resultColumns, targetTable ); /* Bind the original result columns by column name */ normalizeCorrelatedColumns( resultSet.resultColumns, targetTable ); getCompilerContext().pushCurrentPrivType(getPrivType()); // Update privilege resultSet.bindResultColumns(targetTableDescriptor, targetVTI, resultSet.resultColumns, this, fromList); getCompilerContext().popCurrentPrivType(); LanguageConnectionContext lcc = getLanguageConnectionContext(); if (lcc.getAutoincrementUpdate() == false) resultSet.getResultColumns().checkAutoincrement(null); /* ** Mark the columns in this UpdateNode's result column list as ** updateable in the ResultColumnList of the table being updated. ** only do this for FromBaseTables - if the result table is a ** CurrentOfNode, it already knows what columns in its cursor ** are updateable. */ boolean allColumns = false; if (targetTable instanceof FromBaseTable) { ((FromBaseTable) targetTable).markUpdated( resultSet.getResultColumns()); } else if (targetTable instanceof FromVTI) { resultColumnList = resultSet.getResultColumns(); } else { /* ** Positioned update: WHERE CURRENT OF */ if (SanityManager.DEBUG) { SanityManager.ASSERT(currentOfNode != null, "currentOfNode is null"); } ExecPreparedStatement cursorStmt = currentOfNode.getCursorStatement(); String[] ucl = cursorStmt.getUpdateColumns(); /* ** If there is no update column list, we need to build ** out the result column list to have all columns. */ if (ucl == null || (ucl.length == 0)) { /* ** Get the resultColumnList representing ALL of the columns in the ** base table. This is the "before" portion of the result row. */ getResultColumnList(); /* ** Add the "after" portion of the result row. This is the update ** list augmented to include every column in the target table. ** Those columns that are not being updated are set to themselves. ** The expanded list will be in the order of the columns in the base ** table. */ afterColumns = resultSet.getResultColumns().expandToAll( targetTableDescriptor, targetTable.getTableName()); /* ** Need to get all indexes here since we aren't calling ** getReadMap(). */ getAffectedIndexes(targetTableDescriptor, (ResultColumnList)null, (FormatableBitSet)null); allColumns = true; } else { /* Check the updatability */ resultSet.getResultColumns().checkColumnUpdateability(ucl, currentOfNode.getCursorName()); } } changedColumnIds = getChangedColumnIds(resultSet.getResultColumns()); /* ** We need to add in all the columns that are needed ** by the constraints on this table. */ if (!allColumns && targetVTI == null) { getCompilerContext().pushCurrentPrivType( Authorizer.NULL_PRIV); try { readColsBitSet = new FormatableBitSet(); FromBaseTable fbt = getResultColumnList(resultSet.getResultColumns()); afterColumns = resultSet.getResultColumns().copyListAndObjects(); readColsBitSet = getReadMap(dataDictionary, targetTableDescriptor, afterColumns); afterColumns = fbt.addColsToList(afterColumns, readColsBitSet); resultColumnList = fbt.addColsToList(resultColumnList, readColsBitSet); /* ** If all bits are set, then behave as if we chose all ** in the first place */ int i = 1; int size = targetTableDescriptor.getMaxColumnID(); for (; i <= size; i++) { if (!readColsBitSet.get(i)) { break; } } if (i > size) { readColsBitSet = null; allColumns = true; } } finally { getCompilerContext().popCurrentPrivType(); } } if (targetVTI == null) { /* ** Construct an empty heap row for use in our constant action. */ emptyHeapRow = targetTableDescriptor.getEmptyExecRow(); /* Append the list of "after" columns to the list of "before" columns, * preserving the afterColumns list. (Necessary for binding * check constraints.) */ resultColumnList.appendResultColumns(afterColumns, false); /* Generate the RowLocation column */ rowLocationNode = (CurrentRowLocationNode) getNodeFactory().getNode( C_NodeTypes.CURRENT_ROW_LOCATION_NODE, getContextManager()); } else { rowLocationNode = (NumericConstantNode) getNodeFactory().getNode( C_NodeTypes.INT_CONSTANT_NODE, ReuseFactory.getInteger( 0), getContextManager()); } rowLocationColumn = (ResultColumn) getNodeFactory().getNode( C_NodeTypes.RESULT_COLUMN, COLUMNNAME, rowLocationNode, getContextManager()); rowLocationColumn.markGenerated(); /* Append to the ResultColumnList */ resultColumnList.addResultColumn(rowLocationColumn); /* * The last thing that we do to the generated RCL is to clear * the table name out from each RC. See comment on * checkTableNameAndScrubResultColumns(). */ checkTableNameAndScrubResultColumns(resultColumnList); /* Set the new result column list in the result set */ resultSet.setResultColumns(resultColumnList); /* Bind the expressions */ getCompilerContext().pushCurrentPrivType(getPrivType()); // Update privilege super.bindExpressions(); getCompilerContext().popCurrentPrivType(); /* Bind untyped nulls directly under the result columns */ resultSet. getResultColumns(). bindUntypedNullsToResultColumns(resultColumnList); if (null != rowLocationColumn) { /* Bind the new ResultColumn */ rowLocationColumn.bindResultColumnToExpression(); } resultColumnList.checkStorableExpressions(); /* Insert a NormalizeResultSetNode above the source if the source * and target column types and lengths do not match. */ if (! resultColumnList.columnTypesAndLengthsMatch()) { resultSet = (NormalizeResultSetNode) getNodeFactory().getNode( C_NodeTypes.NORMALIZE_RESULT_SET_NODE, resultSet, resultColumnList, null, Boolean.TRUE, getContextManager()); if (hasCheckConstraints(dataDictionary, targetTableDescriptor)) { /* Get and bind all check constraints on the columns * being updated. We want to bind the check constraints against * the after columns. We need to bind against the portion of the * resultColumns in the new NormalizeResultSet that point to * afterColumns. Create an RCL composed of just those RCs in * order to bind the check constraints. */ int afterColumnsSize = afterColumns.size(); afterColumns = (ResultColumnList) getNodeFactory().getNode( C_NodeTypes.RESULT_COLUMN_LIST, getContextManager()); ResultColumnList normalizedRCs = resultSet.getResultColumns(); for (int index = 0; index < afterColumnsSize; index++) { afterColumns.addElement(normalizedRCs.elementAt(index + afterColumnsSize)); } } } if( null != targetVTI) { deferred = VTIDeferModPolicy.deferIt( DeferModification.UPDATE_STATEMENT, targetVTI, resultColumnList.getColumnNames(), sel.getWhereClause()); } else // not VTI { /* we always include triggers in core language */ boolean hasTriggers = (getAllRelevantTriggers(dataDictionary, targetTableDescriptor, changedColumnIds, true).size() > 0); /* Get and bind all constraints on the columns being updated */ checkConstraints = bindConstraints( dataDictionary, getNodeFactory(), targetTableDescriptor, null, hasTriggers ? resultColumnList : afterColumns, changedColumnIds, readColsBitSet, false, true); /* we always include triggers in core language */ /* If the target table is also a source table, then * the update will have to be in deferred mode * For updates, this means that the target table appears in a * subquery. Also, self referencing foreign keys are * deferred. And triggers cause an update to be deferred. */ if (resultSet.subqueryReferencesTarget( targetTableDescriptor.getName(), true) || requiresDeferredProcessing()) { deferred = true; } } getCompilerContext().popCurrentPrivType(); } // end of bind() int getPrivType() { return Authorizer.UPDATE_PRIV; } /** * Return true if the node references SESSION schema tables (temporary or permanent) * * @return true if references SESSION schema tables, else false * * @exception StandardException Thrown on error */ public boolean referencesSessionSchema() throws StandardException { //If this node references a SESSION schema table, then return true. return(resultSet.referencesSessionSchema()); } /** * Compile constants that Execution will use * * @exception StandardException Thrown on failure */ public ConstantAction makeConstantAction() throws StandardException { /* ** Updates are also deferred if they update a column in the index ** used to scan the table being updated. */ if (! deferred ) { ConglomerateDescriptor updateCD = targetTable. getTrulyTheBestAccessPath(). getConglomerateDescriptor(); if (updateCD != null && updateCD.isIndex()) { int [] baseColumns = updateCD.getIndexDescriptor().baseColumnPositions(); if (resultSet. getResultColumns(). updateOverlaps(baseColumns)) { deferred = true; } } } if( null == targetTableDescriptor) { /* Return constant action for VTI * NOTE: ConstantAction responsible for preserving instantiated * VTIs for in-memory queries and for only preserving VTIs * that implement Serializable for SPSs. */ return getGenericConstantActionFactory().getUpdatableVTIConstantAction( DeferModification.UPDATE_STATEMENT, deferred, changedColumnIds); } int lockMode = resultSet.updateTargetLockMode(); long heapConglomId = targetTableDescriptor.getHeapConglomerateId(); TransactionController tc = getLanguageConnectionContext().getTransactionCompile(); StaticCompiledOpenConglomInfo[] indexSCOCIs = new StaticCompiledOpenConglomInfo[indexConglomerateNumbers.length]; for (int index = 0; index < indexSCOCIs.length; index++) { indexSCOCIs[index] = tc.getStaticCompiledConglomInfo(indexConglomerateNumbers[index]); } /* ** Do table locking if the table's lock granularity is ** set to table. */ if (targetTableDescriptor.getLockGranularity() == TableDescriptor.TABLE_LOCK_GRANULARITY) { lockMode = TransactionController.MODE_TABLE; } return getGenericConstantActionFactory().getUpdateConstantAction ( heapConglomId, targetTableDescriptor.getTableType(), tc.getStaticCompiledConglomInfo(heapConglomId), indicesToMaintain, indexConglomerateNumbers, indexSCOCIs, indexNames, emptyHeapRow, deferred, targetTableDescriptor.getUUID(), lockMode, false, changedColumnIds, null, null, getFKInfo(), getTriggerInfo(), (readColsBitSet == null) ? (FormatableBitSet)null : new FormatableBitSet(readColsBitSet), getReadColMap(targetTableDescriptor.getNumberOfColumns(),readColsBitSet), resultColumnList.getStreamStorableColIds(targetTableDescriptor.getNumberOfColumns()), (readColsBitSet == null) ? targetTableDescriptor.getNumberOfColumns() : readColsBitSet.getNumBitsSet(), positionedUpdate, resultSet.isOneRowResultSet() ); } /** * Updates are deferred if they update a column in the index * used to scan the table being updated. */ protected void setDeferredForUpdateOfIndexColumn() { /* Don't bother checking if we're already deferred */ if (! deferred ) { /* Get the conglomerate descriptor for the target table */ ConglomerateDescriptor updateCD = targetTable. getTrulyTheBestAccessPath(). getConglomerateDescriptor(); /* If it an index? */ if (updateCD != null && updateCD.isIndex()) { int [] baseColumns = updateCD.getIndexDescriptor().baseColumnPositions(); /* Are any of the index columns updated? */ if (resultSet. getResultColumns(). updateOverlaps(baseColumns)) { deferred = true; } } } } /** * Code generation for update. * The generated code will contain: * o A static member for the (xxx)ResultSet with the RowLocations and * new update values * o The static member will be assigned the appropriate ResultSet within * the nested calls to get the ResultSets. (The appropriate cast to the * (xxx)ResultSet will be generated.) * o The CurrentRowLocation() in SelectNode's select list will generate * a new method for returning the RowLocation as well as a call to * that method when generating the (xxx)ResultSet. * * @param acb The ActivationClassBuilder for the class being built * @param mb The method for the execute() method to be built * * * @exception StandardException Thrown on error */ public void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException { // If the DML is on the temporary table, generate the code to // mark temporary table as modified in the current UOW. After // DERBY-827 this must be done in execute() since // fillResultSet() will only be called once. generateCodeForTemporaryTable(acb, acb.getExecuteMethod()); /* generate the parameters */ if(!isDependentTable) generateParameterValueSet(acb); /* Create the static declaration for the scan ResultSet which generates the * RowLocations to be updated * RESOLVE - Need to deal with the type of the static member. */ acb.newFieldDeclaration(Modifier.PRIVATE, ClassName.CursorResultSet, acb.newRowLocationScanResultSetName()); /* ** Generate the update result set, giving it either the original ** source or the normalize result set, the constant action. */ acb.pushGetResultSetFactoryExpression(mb); resultSet.generate(acb, mb); // arg 1 if( null != targetVTI) { targetVTI.assignCostEstimate(resultSet.getNewCostEstimate()); mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getUpdateVTIResultSet", ClassName.ResultSet, 1); } else { // generate code to evaluate CHECK CONSTRAINTS generateCheckConstraints( checkConstraints, acb, mb ); // arg 2 if(isDependentTable) { mb.push(acb.addItem(makeConstantAction())); mb.push(acb.addItem(makeResultDescription())); mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getDeleteCascadeUpdateResultSet", ClassName.ResultSet, 4); }else { mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getUpdateResultSet", ClassName.ResultSet, 2); } } } /** * Return the type of statement, something from * StatementType. * * @return the type of statement */ protected final int getStatementType() { return StatementType.UPDATE; } /** * Gets the map of all columns which must be read out of the base table. * These are the columns needed to<UL>: * <LI>maintain indices</LI> * <LI>maintain foreign keys</LI> * <LI>support Replication's Delta Optimization</LI></UL> * <p> * The returned map is a FormatableBitSet with 1 bit for each column in the * table plus an extra, unsued 0-bit. If a 1-based column id must * be read from the base table, then the corresponding 1-based bit * is turned ON in the returned FormatableBitSet. * <p> * <B>NOTE</B>: this method is not expected to be called when * all columns are being updated (i.e. updateColumnList is null). * * @param dd the data dictionary to look in * @param baseTable the base table descriptor * @param updateColumnList the rcl for the update. CANNOT BE NULL * * @return a FormatableBitSet of columns to be read out of the base table * * @exception StandardException Thrown on error */ public FormatableBitSet getReadMap ( DataDictionary dd, TableDescriptor baseTable, ResultColumnList updateColumnList ) throws StandardException { boolean[] needsDeferredProcessing = new boolean[1]; needsDeferredProcessing[0] = requiresDeferredProcessing(); Vector conglomVector = new Vector(); relevantCdl = new ConstraintDescriptorList(); relevantTriggers = new GenericDescriptorList(); FormatableBitSet columnMap = UpdateNode.getUpdateReadMap(baseTable, updateColumnList, conglomVector, relevantCdl, relevantTriggers, needsDeferredProcessing ); markAffectedIndexes( conglomVector ); adjustDeferredFlag( needsDeferredProcessing[0] ); return columnMap; } /** * Construct the changedColumnIds array. Note we sort its entries by * columnId. */ private int[] getChangedColumnIds(ResultColumnList rcl) { if (rcl == null) { return (int[])null; } else { return rcl.sortMe(); } } /** * Builds a bitmap of all columns which should be read from the * Store in order to satisfy an UPDATE statement. * * Is passed a list of updated columns. Does the following: * * 1) finds all indices which overlap the updated columns * 2) adds the index columns to a bitmap of affected columns * 3) adds the index descriptors to a list of conglomerate * descriptors. * 4) finds all constraints which overlap the updated columns * and adds the constrained columns to the bitmap * 5) finds all triggers which overlap the updated columns. * 6) if there are any triggers, marks all columns in the bitmap * 7) adds the triggers to an evolving list of triggers * * @param updateColumnList a list of updated columns * @param conglomVector OUT: vector of affected indices * @param relevantConstraints IN/OUT. Empty list is passed in. We hang constraints on it as we go. * @param relevantTriggers IN/OUT. Passed in as an empty list. Filled in as we go. * @param needsDeferredProcessing IN/OUT. true if the statement already needs * deferred processing. set while evaluating this * routine if a trigger or constraint requires * deferred processing * * @return a FormatableBitSet of columns to be read out of the base table * * @exception StandardException Thrown on error */ public static FormatableBitSet getUpdateReadMap ( TableDescriptor baseTable, ResultColumnList updateColumnList, Vector conglomVector, ConstraintDescriptorList relevantConstraints, GenericDescriptorList relevantTriggers, boolean[] needsDeferredProcessing ) throws StandardException { if (SanityManager.DEBUG) { SanityManager.ASSERT(updateColumnList != null, "updateColumnList is null"); } int columnCount = baseTable.getMaxColumnID(); FormatableBitSet columnMap = new FormatableBitSet(columnCount + 1); /* ** Add all the changed columns. We don't strictly ** need the before image of the changed column in all cases, ** but it makes life much easier since things are set ** up around the assumption that we have the before ** and after image of the column. */ int[] changedColumnIds = updateColumnList.sortMe(); for (int ix = 0; ix < changedColumnIds.length; ix++) { columnMap.set(changedColumnIds[ix]); } /* ** Get a list of the indexes that need to be ** updated. ColumnMap contains all indexed ** columns where 1 or more columns in the index ** are going to be modified. */ DMLModStatementNode.getXAffectedIndexes(baseTable, updateColumnList, columnMap, conglomVector ); /* ** Add all columns needed for constraints. We don't ** need to bother with foreign key/primary key constraints ** because they are added as a side effect of adding ** their indexes above. */ baseTable.getAllRelevantConstraints ( StatementType.UPDATE, false, changedColumnIds, needsDeferredProcessing, relevantConstraints ); int rclSize = relevantConstraints.size(); for (int index = 0; index < rclSize; index++) { ConstraintDescriptor cd = relevantConstraints.elementAt(index); if (cd.getConstraintType() != DataDictionary.CHECK_CONSTRAINT) { continue; } int[] refColumns = ((CheckConstraintDescriptor)cd).getReferencedColumns(); for (int i = 0; i < refColumns.length; i++) { columnMap.set(refColumns[i]); } } /* ** If we have any triggers, then get all the columns ** because we don't know what the user will ultimately ** reference. */ baseTable.getAllRelevantTriggers( StatementType.UPDATE, changedColumnIds, relevantTriggers ); if ( relevantTriggers.size() > 0 ) { needsDeferredProcessing[0] = true; } if (relevantTriggers.size() > 0) { for (int i = 1; i <= columnCount; i++) { columnMap.set(i); } } return columnMap; } /* * Force correlated column references in the SET clause to have the * name of the base table. This dances around the problem alluded to * in scrubResultColumn(). */ private void normalizeCorrelatedColumns( ResultColumnList rcl, FromTable fromTable ) throws StandardException { String correlationName = fromTable.getCorrelationName(); if ( correlationName == null ) { return; } TableName tableNameNode; if ( fromTable instanceof CurrentOfNode ) { tableNameNode = ((CurrentOfNode) fromTable).getBaseCursorTargetTableName(); } else { tableNameNode = makeTableName( null, fromTable.getBaseTableName() ); } int count = rcl.size(); for ( int i = 0; i < count; i++ ) { ResultColumn column = (ResultColumn) rcl.elementAt( i ); ColumnReference reference = column.getReference(); if ( (reference != null) && correlationName.equals( reference.getTableName() ) ) { reference.setTableNameNode( tableNameNode ); } } } /** * Check table name and then clear it from the result set columns. * * @exception StandardExcepion if invalid column/table is specified. */ private void checkTableNameAndScrubResultColumns(ResultColumnList rcl) throws StandardException { int columnCount = rcl.size(); int tableCount = ((SelectNode)resultSet).fromList.size(); for ( int i = 0; i < columnCount; i++ ) { boolean foundMatchingTable = false; ResultColumn column = (ResultColumn) rcl.elementAt( i ); if (column.getTableName() != null) { for (int j = 0; j < tableCount; j++) { FromTable fromTable = (FromTable) ((SelectNode)resultSet). fromList.elementAt(j); final String tableName; if ( fromTable instanceof CurrentOfNode ) { tableName = ((CurrentOfNode)fromTable). getBaseCursorTargetTableName().getTableName(); } else { tableName = fromTable.getBaseTableName(); } if (column.getTableName().equals(tableName)) { foundMatchingTable = true; break; } } if (!foundMatchingTable) { throw StandardException.newException( SQLState.LANG_COLUMN_NOT_FOUND, column.getTableName() + "." + column.getName()); } } /* The table name is * unnecessary for an update. More importantly, though, it * creates a problem in the degenerate case with a positioned * update. The user must specify the base table name for a * positioned update. If a correlation name was specified for * the cursor, then a match for the ColumnReference would not * be found if we didn't null out the name. (Aren't you * glad you asked?) */ column.clearTableName(); } } /** * Normalize synonym column references to have the name of the base table. * * @param rcl The result column list of the target table * @param fromTable The table name to set the column refs to * * @exception StandardException Thrown on error */ private void normalizeSynonymColumns( ResultColumnList rcl, FromTable fromTable) throws StandardException { if (fromTable.getCorrelationName() != null) { return; } TableName tableNameNode; if (fromTable instanceof CurrentOfNode) { tableNameNode = ((CurrentOfNode) fromTable).getBaseCursorTargetTableName(); } else { tableNameNode = makeTableName(null, fromTable.getBaseTableName()); } super.normalizeSynonymColumns(rcl, tableNameNode); } } // end of UpdateNode

The table below shows all metrics for UpdateNode.java.

MetricValueDescription
BLOCKS91.00Number of blocks
BLOCK_COMMENT206.00Number of block comment lines
COMMENTS382.00Comment lines
COMMENT_DENSITY 0.85Comment density
COMPARISONS66.00Number of comparison operators
CYCLOMATIC93.00Cyclomatic complexity
DECL_COMMENTS19.00Comments in declarations
DOC_COMMENT151.00Number of javadoc comment lines
ELOC450.00Effective lines of code
EXEC_COMMENTS59.00Comments in executable code
EXITS135.00Procedure exits
FUNCTIONS17.00Number of function declarations
HALSTEAD_DIFFICULTY83.00Halstead difficulty
HALSTEAD_EFFORT 0.00Halstead effort
INTERFACE_COMPLEXITY102.00Interface complexity
JAVA0001 0.00JAVA0001 Package name does not contain only lower case letters
JAVA0002 0.00JAVA0002 Package name does not begin with a top level domain name or country code
JAVA0003 0.00JAVA0003 Minimize use of on-demand (.*) imports
JAVA0004 0.00JAVA0004 Unnecessary import from java.lang
JAVA0005 1.00JAVA0005 Imports not in specified order
JAVA0006 0.00JAVA0006 Empty finally block
JAVA0007 5.00JAVA0007 Should not declare public field
JAVA0008 0.00JAVA0008 Empty catch block
JAVA0009 4.00JAVA0009 Protected member in final class
JAVA0010 0.00JAVA0010 Non-instantiable class does not contain a non-private static member
JAVA0011 0.00JAVA0011 Abstract class does not contain an abstract method
JAVA0012 0.00JAVA0012 Non-constructor method with same name as declaring class
JAVA0013 0.00JAVA0013 Non-blank final field is not static
JAVA0014 0.00JAVA0014 Class with only static members has non-private constructor
JAVA0015 0.00JAVA0015 Package class contains public nested type
JAVA0016 0.00JAVA0016 Abstract class contains public constructor
JAVA0017 0.00JAVA0017 Class name does not have required form
JAVA0018 0.00JAVA0018 Method name does not have required form
JAVA0019 0.00JAVA0019 Interface name does not have required form
JAVA0020 0.00JAVA0020 Field name does not have required form
JAVA0021 0.00JAVA0021 Interface method name does not have required form
JAVA0022 0.00JAVA0022 Static final field name does not have required form
JAVA0023 0.00JAVA0023 Empty finalize method
JAVA0024 0.00JAVA0024 Empty class
JAVA0025 0.00JAVA0025 Method override is empty
JAVA0026 0.00JAVA0026 Finalize method with parameters
JAVA0029 0.00JAVA0029 Private method not used
JAVA0030 0.00JAVA0030 Private field not used
JAVA0031 0.00JAVA0031 Case statement not properly closed
JAVA0032 0.00JAVA0032 Switch statement missing default
JAVA0033 0.00JAVA0033 default: not last case in switch statement
JAVA0034 6.00JAVA0034 Missing braces in if statement
JAVA0035 0.00JAVA0035 Missing braces in for statement
JAVA0036 0.00JAVA0036 Missing braces in while statement
JAVA0038 0.00JAVA0038 Non-case label in switch statement
JAVA0039 0.00JAVA0039 Break statement with label
JAVA0040 0.00JAVA0040 Switch statement contains N cases (maximum: M)
JAVA0041 0.00JAVA0041 Nested synchronized block
JAVA0042 0.00JAVA0042 Empty synchronized statement
JAVA0043 0.00JAVA0043 Inner class does not use outer class
JAVA0044 0.00JAVA0044 Serializable class with no instance variables
JAVA0045 0.00JAVA0045 Serializable class with only transient fields
JAVA0046 0.00JAVA0046 Name of class not derived from Exception ends with 'Exception'
JAVA0047 0.00JAVA0047 Serializable class derives from invalid base class
JAVA0048 0.00JAVA0048 Name of class derived from Exception does not end with 'Exception'
JAVA0049 0.00JAVA0049 Nested block at depth N (maximum: M)
JAVA0050 0.00JAVA0050 Class derives from java.lang.Error
JAVA0051 0.00JAVA0051 Class derives from java.lang.RuntimeException
JAVA0052 0.00JAVA0052 Class derives from java.lang.Throwable
JAVA0053 0.00JAVA0053 Unused label
JAVA0054 1.00JAVA0054 Inheritance depth N exceeds maximum M
JAVA0055 0.00JAVA0055 Class should be interface
JAVA0056 0.00JAVA0056 Unnecessary abstract modifier for interface or annotation
JAVA0057 0.00JAVA0057 Unnecessary default constructor
JAVA0058 0.00JAVA0058 Constructor calls super()
JAVA0059 0.00JAVA0059 Method override only calls super()
JAVA0061 0.00JAVA0061 Inaccessible member in anonymous class
JAVA0062 0.00JAVA0062 Public class missing public member or protected constructor
JAVA0063 0.00JAVA0063 Identifier name should not contain '$'
JAVA0064 0.00JAVA0064 N variations of identifier name (maximum: M)
JAVA0065 1.00JAVA0065 Unnecessary final modifier for method in final class
JAVA0066 0.00JAVA0066 Unnecessary modifier for interface nested type
JAVA0067 0.00JAVA0067 Array descriptor on identifier name
JAVA0068 0.00JAVA0068 Modifiers not declared in recommended order
JAVA0071 0.00JAVA0071 Strings compared with ==
JAVA0073 0.00JAVA0073 Integer division in floating-point context
JAVA0074 0.00JAVA0074 Use of Object.notify()
JAVA0075 2.00JAVA0075 Method parameter hides field
JAVA0076 0.00JAVA0076 Use of magic number
JAVA0077 0.00JAVA0077 Private field not used in declaring class
JAVA0078 0.00JAVA0078 Floating point values compared with ==
JAVA0079 0.00JAVA0079 Use of instance to reference static member
JAVA008011.00JAVA0080 Import declaration not used
JAVA0081 1.00JAVA0081 Boolean literal in comparison
JAVA0082 0.00JAVA0082 Unnecessary widening cast
JAVA0083 0.00JAVA0083 Unnecessary instanceof test
JAVA0084 0.00JAVA0084 Should use compound assignment operator
JAVA0085 0.00JAVA0085 Use of sun.* class
JAVA0087 0.00JAVA0087 Use of Thread.sleep()
JAVA0089 0.00JAVA0089 Use of restricted package
JAVA0092 0.00JAVA0092 Use of restricted type
JAVA0093 0.00JAVA0093 Redundant assignment
JAVA0094 1.00JAVA0094 Field hides a superclass field
JAVA0095 0.00JAVA0095 Uninitialized private field
JAVA0096 0.00JAVA0096 Field in nested class hides outer field
JAVA0098 1.00JAVA0098 Minimize use of implicit field initializers
JAVA0100 0.00JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0101 0.00JAVA0101 Unnecessary modifier for field in interface
JAVA0102 0.00JAVA0102 Last statement in finalize() not super.finalize()
JAVA0103 0.00JAVA0103 Explicit call to finalize()
JAVA0104 0.00JAVA0104 finalize() only calls super.finalize()
JAVA0105 2.00JAVA0105 Duplicate import declaration
JAVA0106 1.00JAVA0106 Unnecessary import from current package
JAVA0108 3.00JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
JAVA0109 0.00JAVA0109 Incorrect javadoc: no parameter 'parameter'
JAVA0110 2.00JAVA0110 Incorrect javadoc: no @return tag
JAVA0111 0.00JAVA0111 Incorrect javadoc: @return tag for void method
JAVA0112 1.00JAVA0112 Incorrect javadoc: no exception 'exception' in throws
JAVA0113 1.00JAVA0113 Incorrect javadoc: no @author tag
JAVA0114 1.00JAVA0114 Incorrect javadoc: no @version tag
JAVA0115 1.00JAVA0115 Incorrect javadoc: no @throws or @exception tag for 'exception'
JAVA0116 6.00JAVA0116 Missing javadoc: field 'field'
JAVA0117 0.00JAVA0117 Missing javadoc: method 'method'
JAVA0118 0.00JAVA0118 Missing javadoc: type 'type'
JAVA0119 0.00JAVA0119 Control variable changed within body of for loop
JAVA0123 1.00JAVA0123 Use all three components of for loop
JAVA0125 0.00JAVA0125 Continue statement with label
JAVA0126 0.00JAVA0126 Method declares unchecked exception in throws
JAVA0128 0.00JAVA0128 Public constructor in non-public class
JAVA0130 1.00JAVA0130 Non-static method does not use instance fields
JAVA0131 0.00JAVA0131 Compatible method does not override base
JAVA0132 0.00JAVA0132 Method overload with compatible signature
JAVA0133 0.00JAVA0133 Non-synchronized method overrides synchronized method
JAVA0135 0.00JAVA0135 Only one of Object.equals and Object.hashCode defined: missing 'method'
JAVA0136 0.00JAVA0136 N methods defined in class (maximum: M)
JAVA0137 1.00JAVA0137 Non-abstract class missing constructor
JAVA0138 1.00JAVA0138 N parameters defined for method (maximum: M)
JAVA0139 0.00JAVA0139 Definition of main other than public static void main(java.lang.String[])
JAVA0141 0.00JAVA0141 Unnecessary modifier for method in interface
JAVA0143 0.00JAVA0143 Synchronized method
JAVA0144 0.00JAVA0144 Line exceeds maximum M characters
JAVA01452515.00JAVA0145 Tab character used in source file
JAVA0150 0.00JAVA0150 java.lang.Error (or subclass) thrown
JAVA0153 0.00JAVA0153 Inefficient conversion of integer to string
JAVA0159 0.00JAVA0159 Inefficient conversion of string to integer
JAVA0160 0.00JAVA0160 Method does not throw specified exception
JAVA0161 0.00JAVA0161 Conditional wait() not in loop
JAVA0163 0.00JAVA0163 Empty statement
JAVA0165 0.00JAVA0165 Conflicting return statement in finally block
JAVA0166 0.00JAVA0166 Generic exception caught
JAVA0167 0.00JAVA0167 ThreadDeath not rethrown
JAVA0169 0.00JAVA0169 Unnecessary catch block: exception 'exception'
JAVA0170 0.00JAVA0170 Caught exception not derived from java.lang.Exception
JAVA0171 0.00JAVA0171 Unused local variable
JAVA0173 1.00JAVA0173 Unused method parameter
JAVA0174 1.00JAVA0174 Assigned local variable never used
JAVA0175 0.00JAVA0175 Successive assignment to variable
JAVA0176 0.00JAVA0176 Local variable name does not have required form
JAVA0177 5.00JAVA0177 Variable declaration missing initializer
JAVA0179 1.00JAVA0179 Local variable hides visible field
JAVA0233 0.00JAVA0233 Definition of serialVersionUID other than 'private static final long serialVersionUID'
JAVA0234 0.00JAVA0234 Class is Serializable but does not define serialVersionUID
JAVA0235 0.00JAVA0235 Class defines serialVersionUID but does not implement Serializable
JAVA0236 0.00JAVA0236 Attempt to clone an object which does not implement Cloneable
JAVA0237 0.00JAVA0237 Class implements Cloneable but does not have public clone method
JAVA0238 0.00JAVA0238 Clone method does not call super.clone()
JAVA0239 0.00JAVA0239 Class declares 'readObject' or 'writeObject' but does not implement Serializable
JAVA0240 0.00JAVA0240 Serializable class which declares readObject or writeObject but not both
JAVA0241 0.00JAVA0241 'readObject' or 'writeObject' should be declared private in Serializable class
JAVA0242 0.00JAVA0242 Transient field in non-Serializable class
JAVA0243 0.00JAVA0243 'readResolve' or 'writeReplace' should be declared private or protected
JAVA0244 0.00JAVA0244 Field or method name in subclass differs only by case from inherited field or method
JAVA0245 0.00JAVA0245 JUnit TestCase with non-trivial constructor
JAVA0246 0.00JAVA0246 JUnit assertXXX statement missing message parameter
JAVA0247 0.00JAVA0247 JUnit 'setUp()' and 'tearDown()' should call super method
JAVA0248 0.00JAVA0248 JUnit method 'setUp' or 'tearDown' with incorrect signature
JAVA0249 0.00JAVA0249 JUnit TestCase 'suite()' should be declared static
JAVA0250 0.00JAVA0250 JUnit TestCase declares testXXX method with incorrect signature
JAVA0251 0.00JAVA0251 Use '%n' for line breaks in printf/format for platform independence
JAVA0252 0.00JAVA0252 'enum' is a Java 1.5 reserved word
JAVA0253 0.00JAVA0253 Not all enum constants consumed in switch statement
JAVA0254 0.00JAVA0254 Use enhanced for loop construct instead of Iterator
JAVA0255 0.00JAVA0255 Result of method invocation not used
JAVA0256 0.00JAVA0256 Assignment of external collection/array to field
JAVA0257 0.00JAVA0257 Use of 'Constant Interface' anti-pattern
JAVA0258 0.00JAVA0258 Implement Iterable for foreach compatibility
JAVA0259 0.00JAVA0259 Return of collection/array field
JAVA0260 0.00JAVA0260 Use 'enum' instead of Enumerated Type pattern
JAVA0261 0.00JAVA0261 Use specialized Enum collection types
JAVA0262 0.00JAVA0262 Use of char in integer context
JAVA0263 0.00JAVA0263 Long literal ends with 'l' instead of 'L'
JAVA0264 0.00JAVA0264 Integer math in long context - check for overflow
JAVA0265 0.00JAVA0265 Use of Throwable.printStackTrace()
JAVA0266 0.00JAVA0266 Use of System.out
JAVA0267 0.00JAVA0267 Use of System.err
JAVA0269 0.00JAVA0269 Contents of StringBuffer never used
JAVA0270 2.00JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
JAVA0271 0.00JAVA0271 Minimize use of on-demand (.*) static imports
JAVA0272 0.00JAVA0272 Thread.run() called
JAVA0273 0.00JAVA0273 Non-final derivative of Thread calls start() in constructor
JAVA0274 0.00JAVA0274 Serializable class has a synchronized readObject()
JAVA0275 0.00JAVA0275 Serializable class has a synchronized writeObject() and no other synchronized methods
JAVA0276 0.00JAVA0276 Unnecessary use of String constructor
JAVA0277 0.00JAVA0277 Iterator.next() implementation does not throw NoSuchElementException
JAVA0278 0.00JAVA0278 Unnecessary use of Boolean constructor
JAVA0279 0.00JAVA0279 Serialization method readObject or readObjectNoData calls an overridable method
JAVA0280 0.00JAVA0280 IllegalMonitorStateException caught
JAVA0281 0.00JAVA0281 Iterator.next() not called in loop
JAVA0282 0.00JAVA0282 Call to Iterator.next() in loop which does not test Iterator.hasNext()
JAVA0283 0.00JAVA0283 Control variable not updated in loop body
JAVA0284 0.00JAVA0284 Explicit garbage collection
JAVA0285 5.00JAVA0285 Dereference of potentially null variable
JAVA0286 0.00JAVA0286 Dereference of null variable
JAVA0287 0.00JAVA0287 Unnecessary null check
JAVA0288 1.00JAVA0288 Inconsistent null check
LINES1141.00Number of lines in the source file
LINE_COMMENT25.00Number of line comments
LOC616.00Lines of code
LOGICAL_LINES251.00Number of statements
LOOPS10.00Number of loops
NEST_DEPTH 5.00Maximum nesting depth
OPERANDS1229.00Number of operands
OPERATORS2300.00Number of operators
PARAMS20.00Number of formal parameter declarations
PROGRAM_LENGTH3529.00Halstead program length
PROGRAM_VOCAB437.00Halstead program vocabulary
PROGRAM_VOLUME 0.00Halstead program volume
RETURNS82.00Number of return points from functions
SIZE37212.00Size of the file in bytes
UNIQUE_OPERANDS385.00Number of unique operands
UNIQUE_OPERATORS52.00Number of unique operators
WHITESPACE143.00Number of whitespace lines