Showing 2,136 of 2,138 total issues
Method register
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def register
result = get_portal_clazz_by_id(params)
return error(result[:error]) if result[:error]
portal_clazz = result[:portal_clazz]
- 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 detailed_learner_info
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.detailed_learner_info(learner)
teacherIds = learner.teachers_id
teachers = teacherIds.each_with_index.map do |id, i|
{
user_id: id,
- 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 build_onSearch_message
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def build_onSearch_message(form_model)
investigations_count = form_model.total_entries['Investigation'] || 0
activities_count = form_model.total_entries['Activity'] || 0
interactives_count = form_model.total_entries['Interactive'] || 0
show_message_onSearch= ""
- 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 batch_import_status
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def batch_import_status
# PUNDIT_REVIEW_AUTHORIZE
# PUNDIT_CHOOSE_AUTHORIZE
# no authorization needed ...
# authorize Import::Import
- 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 bulk_update
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def bulk_update
class_id = params[:class_id]
student_ids = params[:student_ids]
add_permission_form_ids = params[:add_permission_form_ids] || []
remove_permission_form_ids = params[:remove_permission_form_ids] || []
- 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 truncate_xhtml
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def truncate_xhtml
if (self.respond_to? 'name')
self.html_tables.each do |tablename|
if self.respond_to? tablename
truncated_xhtml = truncate_from_xhtml(self.send(tablename))
- 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 changeable?
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def changeable?(user)
# the Anonymous user can't change anything, always return false
if(user.anonymous?)
return false
- 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 create
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def create
authorize ExternalActivity
@external_activity = ExternalActivity.new(external_activity_strong_params(params[:external_activity]))
@external_activity.user = current_visitor
- 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 getQueryParams
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
getQueryParams () {
const params: any = { remove_cc_teachers: this.state.removeCCTeachers };
for (const filter of ["teachers", "cohorts", "runnables"]) {
if ((this.state[filter] != null ? this.state[filter].length : undefined) > 0) {
params[filter] = this.state[filter].map((v: any) => v.value).sort().join(",");
- 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 render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { dataProvider } = this.state;
if (!dataProvider) {
return <div>Loading</div>;
Function hideBorder
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
hideBorder: function() {
var el = this.targetElement,
cs = el.currentStyle,
rs = el.runtimeStyle,
tag = el.tagName,
Function parseString
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseString: function(dateString, format) {
var date = new Date(), i18n = Date.default_i18n;
format=format.replace('%D','%m/%d/%y');
format=format.replace('%T','%H:%M:%S').replace('%r','%I:%M:%S %p').replace('%R','%H:%M:%S');
Function parseString
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseString: function(dateString, format) {
var date = new Date(), i18n = Date.default_i18n;
format=format.replace('%D','%m/%d/%y');
format=format.replace('%T','%H:%M:%S').replace('%r','%I:%M:%S %p').replace('%R','%H:%M:%S');
Function BgSize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
PIE.BgSize = (function() {
var CONTAIN = 'contain',
COVER = 'cover',
AUTO = 'auto';
Function preview_home_page
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function preview_home_page(homePageContentId, homePageContent){
var previewContent = null;
if(homePageContentId){
previewContent = $(homePageContentId).value;
Function parseString
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseString: function(dateString, format) {
var date = new Date(), i18n = Date.default_i18n;
format=format.replace('%D','%m/%d/%y');
format=format.replace('%T','%H:%M:%S').replace('%r','%I:%M:%S %p').replace('%R','%H:%M:%S');
Function parseString
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseString: function(dateString, format) {
var date = new Date(), i18n = Date.default_i18n;
format=format.replace('%D','%m/%d/%y');
format=format.replace('%T','%H:%M:%S').replace('%r','%I:%M:%S %p').replace('%R','%H:%M:%S');
Function preview_about_page
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function preview_about_page(aboutPageContentId, aboutPageContent){
var previewContent = null;
if(aboutPageContentId){
previewContent = $(aboutPageContentId).value;
Function keydown_checker
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Chosen.prototype.keydown_checker = function(evt) {
var stroke, _ref1;
stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
this.search_field_scale();
if (stroke !== 8 && this.pending_backstroke) {
Method create
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
authorize ExternalActivity
@external_activity = ExternalActivity.new(external_activity_strong_params(params[:external_activity]))
@external_activity.user = current_visitor