Showing 5,781 of 10,536 total issues
Avoid deeply nested control flow statements. Open
if (
!xa &&
(2 < c || 2 < d) &&
da &&
a.isItemEnabled(da)
Avoid deeply nested control flow statements. Open
if ((bb(), a.isDragAllowed(c))) {
a.dragDropStatus(!0);
a.addDropMark();
b.dataTransfer
? ((b.dataTransfer.effectAllowed = "move"),
Avoid deeply nested control flow statements. Open
switch (b.keyCode) {
case 13:
g[a.options.dataFields.text] = B[0].value
? B[0].value
: "null";
Function app
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function($controllerProvider, $compileProvider, $filterProvider, $provide, $httpProvider,$cookiesProvider) {
Function MessageTextArea
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const MessageTextArea = ({ thread }) => {
const { isDark, isRTL } = useContext(AppContext);
const { messages, messagesDispatch, threadsDispatch, textAreaInitialHeight, setTextAreaInitialHeight } = useContext(
ChatContext
);
- 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 ReactBootstrapTable2
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const ReactBootstrapTable2 = () => {
const [data, setData] = useState({ items: getItems(10), selected: getItems(5, 10) });
const id2List = {
droppable: 'items',
- 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 (json[route.to].indexOf(child.to) !== -1) {
showChildren.push(child);
}
Function addPair
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
addPair: function (combinedequipmentID, meterID, metertype, is_output, headers, callback) {
Function addPair
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
addPair: function(equipmentID, meterID, metertype, is_output, headers, callback) {
Avoid deeply nested control flow statements. Open
if (json[route.to].indexOf(child.to) !== -1) {
showChildren.push(child);
}
Function Calendar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const Calendar = () => {
const calendarRef = useRef();
const [calendarApi, setCalendarApi] = useState({});
const [title, setTitle] = useState('');
const [currentFilter, setCurrentFilter] = useState('Month View');
- 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 getIcon
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const getIcon = type => {
const icon = ['far'];
if (type.includes('image')) {
icon.push('file-image');
}
- 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 cursor:
cursor.close()
if cnx:
Avoid deeply nested control flow statements. Open
if len(carbon_dict[current_datetime_utc]) == 0:
del carbon_dict[current_datetime_utc]
############################################################################################################
# Step 6: save carbon dioxide emissions data to database
Avoid deeply nested control flow statements. Open
for energy_category_id in energy_category_list:
current_tariff = tariff_dict[energy_category_id].get(current_datetime_utc)
current_energy = energy_dict[current_datetime_utc].get(energy_category_id)
if current_tariff is not None \
and isinstance(current_tariff, Decimal) \
Avoid deeply nested control flow statements. Open
if common_start_datetime_utc < min(energy_hourly.keys()):
common_start_datetime_utc = min(energy_hourly.keys())
if common_end_datetime_utc > max(energy_hourly.keys()):
Avoid deeply nested control flow statements. Open
if current_carbon is not None and isinstance(current_carbon, Decimal):
add_values += " (" + str(energy_storage_container['id']) + ","
add_values += "'" + current_datetime_utc.isoformat()[0:19] + "',"
add_values += str(current_carbon) + "), "
Avoid deeply nested control flow statements. Open
for cell in row:
col_num += 1
print(cell.value)
if col_num == 1:
# get offline meter ID
Avoid deeply nested control flow statements. Open
if cnx:
cnx.close()
time.sleep(60)
Avoid deeply nested control flow statements. Open
for energy_data_item in energy_data_list:
add_values = (" INSERT INTO tbl_energy_value "
" (point_id, utc_date_time, actual_value, is_bad) "
" VALUES ")
add_values += " (" + str(point_id) + ","