int (TableRenderer table) { int argumentsNumber = 0; for (TableRow row : table.rows) { if (row instanceof DescriptorRow) { int valueParametersNumber = ((DescriptorRow) row).descriptor.getValueParameters().size(); if (valueParametersNumber > argumentsNumber) { argumentsNumber = valueParametersNumber; } } else if (row instanceof FunctionArgumentsRow) { int argumentTypesNumber = ((FunctionArgumentsRow) row).argumentTypes.size(); if (argumentTypesNumber > argumentsNumber) { argumentsNumber = argumentTypesNumber; } } } //magical number 6: // <td> white-space </td> <td> receiver: ___ </td> <td> arguments: </td> <td> ( </td> arguments <td> ) </td> <td> : return_type </td> return argumentsNumber + 6; }