Showing 95 of 132 total issues
Method close
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public synchronized void close() {
realWriter.close();
// check if headers were dynamically modified
if (outputFilename != null && this.getFieldNamesSize() != this.realWriter.getFieldNamesSize()) {
try {
- 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 update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function update() {
$.ajax({
url:'https://moocchat.herokuapp.com/get_current_timestamp_utc/',
dataType: 'jsonp',
type: 'GET',
- 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 receiveMessages
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
receiveMessages: function() {
var self = this;
this.ws.onmessage = function(message) {
var data = JSON.parse(message.data)
if (data.type == "message" & self.isBoth()) {
- 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 makeTemplate
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private void makeTemplate(String template, String target, String type, String os,
String templateRootDirPath, String targetRootDirPath, String scriptTemplateDir) throws Exception {
Method makeTemplate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void makeTemplate(String template, String target, String type, String os,
String templateRootDirPath, String targetRootDirPath, String scriptTemplateDir) throws Exception {
String targetDirPath = targetRootDirPath + File.separator + target;
File targetDir = new File(targetDirPath);
- 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 redistribute_message
has a Cognitive Complexity of 8 (exceeds 5 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
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
protected void runCommand(CommandLine cmdLine) throws Exception {
if (!cmdLine.hasOption(ARG_TEMPLATE)) {
log.error("Missing: -" + ARG_TEMPLATE);
printHelp();
- 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 rejectQualRequests
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void rejectQualRequests(String[] qualReqs, String[] comments) {
// If we're not given anything, just no-op
if (qualReqs == null) {
return;
- 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 loadHITs
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public HIT[] loadHITs(String input, String question, String props,
String previewFile, int maxHITs, boolean preview) throws Exception {
Method grantQualRequestsInFile
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void grantQualRequestsInFile(String fileName, Integer defaultValue) 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
Avoid deeply nested control flow statements. Open
if (learners == '') {
learners = i + 1;
} else {
learners = learners + " and " + (i + 1);
}
Method updateHITs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public HIT[] updateHITs(String successFile, String props) throws Exception {
HITProperties hc = new HITProperties(props);
// Output initializing message
- 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 rejectAssignments
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void rejectAssignments(String[] assignments, String[] comments) {
// If we're not given anything, just no-op
if (assignments == null) {
return;
- 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 generateScript
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private static void generateScript(String scriptTemplateDir, String target,
String targetDirPath, String command, CreateScriptUtil.ScriptType type) throws Exception {
Method updateQualificationType
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public void updateQualificationType( String qualTypeId, String statusString,
String questionFile, String answerFile,
String propertiesFile ) throws Exception
Method generateScripts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static void generateScripts(List<String> commands, String scriptDir, CreateScriptUtil.ScriptType type)
throws Exception
{
for (String command : commands) {
if (type == null) { // All
- 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 grantQualRequests
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void grantQualRequests(String[] qualReqs, Integer[] values) {
// If we're not given anything, just no-op
if (qualReqs == null) {
return;
- 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 eventlog_sessions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def eventlog_sessions(eventlog)
result = []
eventlog_ordered = eventlog.joins(:task).order('tasks.original_chat_group', :created_at)
current_session = []
prev_orig_chat_group = nil
- 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 extractQuestion
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static Map<String, String> extractQuestion(Map<String, List<String[]>> hitAssignments, int questionIndex) {
Map<String, String> hitQuestions = new LinkedHashMap<String, String>();
for(Map.Entry<String, List<String[]>> hitResults : hitAssignments.entrySet()){
String hitId = hitResults.getKey();
List<String[]> assignmentsDetails = hitResults.getValue();
- 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 copyTemplateFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void copyTemplateFile(String sourceRoot, String targetRoot, String extension) throws Exception {
String inputFileName = sourceRoot + extension;
String outputFileName = targetRoot + extension;
System.out.println("Copying resource file: " + outputFileName);
- 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"