Showing 95 of 132 total issues
Method sessions_show
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sessions_show
eventlog_sessions = eventlog_sessions(EventLog.where(created_at: parse_datetime_picker_date(params[:datetime_start])..parse_datetime_picker_date(params[:datetime_end])))
@sessions = []
eventlog_sessions.each do |session_events|
Function showWelcomeMessage
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
showWelcomeMessage: function(){
if (this.group.length == 1) {
this.showMessage("No one is currently available to chat with you. You may use this chatroom to reflect on the question. Click the end button above when done.", "system");
} else if (this.group.length == 2) {
var you_learner = '';
Method parseHitAssignments
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static Map<String, List<String[]>> parseHitAssignments(
String resultsFile, String[] requiredFields, int[] fieldIndicesPlaceholder, char fieldSeparator) {
Map<String, List<String[]>> hitAssignments = new LinkedHashMap<String, List<String[]>>();
try {
Method runCommand
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected void runCommand(CommandLine cmdLine) throws Exception {
if (!cmdLine.hasOption(QUAL_TYPE) &&
!cmdLine.hasOption(INPUT_FILE)) {
log.error("Either -" + QUAL_TYPE + " or -" + INPUT_FILE + " should be passed");
Method getHits
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private String[] getHits() {
HIT[] hits = null;
List<String> ret = new ArrayList<String>();
SearchHITsResult result = null;
String[] responseGroup = new String [] { "Minimal", "HITDetail" };
Function keyboardEvent
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
keyboardEvent: function(type, options) {
var evt;
var e = $.extend({ bubbles: true, cancelable: true, view: window,
ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
Method approveAssignmentsInFile
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void approveAssignmentsInFile(String fileName) throws IOException {
if (fileName == null) {
throw new IllegalArgumentException("fileName must not be null");
}
Method getFieldValuesFromFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected String[] getFieldValuesFromFile(String fileName, String fieldName) throws IOException {
HITDataCSVReader csvReader = new HITDataCSVReader(fileName);
// check that we have a header
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method approveHitsInFile
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void approveHitsInFile(String fileName) throws IOException {
if (fileName == null) {
throw new IllegalArgumentException("fileName must not be null");
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getHeaderRow
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private String[] getHeaderRow(HITResults r) {
if (headerFields == null) {
headerFields = new ArrayList<String>();
for (HITProperties.HITField field : HITProperties.HIT_FIELDS) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method ensure_setup_socket_for
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def ensure_setup_socket_for(env)
channel, my_position, my_id = channel_and_position_from_url(env['ORIGINAL_FULLPATH'])
unless @groups.has_key?(channel) && @groups[channel][my_position]
ws = Faye::WebSocket.new(env, nil, {ping: KEEPALIVE_TIME })
@groups[channel] ||= []
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function initialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
initialize: function(chatGroup,taskid,rails_mode, type) {
this.type = type;
if(typeof chatGroup == "number"){
this.group = [chatGroup];
} else{
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getValues
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static <T> T[] getValues(Class<T> wsdlEnumClass) {
List<T> values = new ArrayList<T>();
for (Field field : wsdlEnumClass.getFields()) {
if (Modifier.isPublic(field.getModifiers()) &&
Modifier.isFinal(field.getModifiers()) &&
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method runCommand
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected void runCommand(CommandLine cmdLine) throws Exception {
if (!cmdLine.hasOption(ARG_QUALTYPE) &&
!cmdLine.hasOption(ARG_INPUT_FILE)) {
log.error("Either -" + ARG_QUALTYPE + " or -" + ARG_INPUT_FILE + " should be passed");
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method runCommand
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected void runCommand(CommandLine cmdLine) throws Exception {
if (!cmdLine.hasOption(ARG_WORKERID)) {
log.fatal("Missing: -" + ARG_WORKERID + " [worker to grant bonus to]");
System.exit(-1);
Method ensure_setup_socket_for
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ensure_setup_socket_for(env)
channel, my_position, my_id = channel_and_position_from_url(env['ORIGINAL_FULLPATH'])
unless @groups.has_key?(channel) && @groups[channel][my_position]
ws = Faye::WebSocket.new(env, nil, {ping: KEEPALIVE_TIME })
@groups[channel] ||= []
Method grantQualRequestsInFile
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void grantQualRequestsInFile(String fileName, Integer defaultValue) throws IOException {
if (fileName == null) {
throw new IllegalArgumentException("fileName must not be null");
}
Method redistribute_message
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def redistribute_message(websocket_data, channel, my_position)
message = extract_text(websocket_data)
type = extract_type(websocket_data)
taskid = extract_taskid(websocket_data)
if type != "heartbeat" # Heartbeat too spammy
Method loadHITs
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public HIT[] loadHITs(String input, String question, String props,
String previewFile, int maxHITs, boolean preview, String outputFile, boolean append) throws Exception {
Method initService
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected void initService() {
if (service == null) {
if (ClientConfig.SANDBOX_SERVICE_URL.equalsIgnoreCase(config.getServiceURL())) {
// configure sandbox/throttling friendly settings
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"