Showing 33 of 112 total issues
Function NavigationMenu
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const NavigationMenu = () => {
const translate = useTranslate();
return (
<Menu>
<Menu.DashboardItem primaryText={translate("dashboard")} />
Function VariableEdit
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const VariableEdit = () => {
const translate = useTranslate();
return (
<Edit
resource="data-variable-blueprints"
Function DataTableField
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const DataTableField = (props: DataTableFieldProps) => {
const record = useRecordContext(props);
const { dataTableRowBlueprints, dataTableColumnBlueprints } = record;
Function WorkbookShow
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const WorkbookShow = () => {
const translate = useTranslate();
return (
<Show resource="workbooks" title={translate("workbook")}>
<TabbedShowLayout>
Function StudioShowActions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const StudioShowActions = () => {
return (
<TopToolbar>
{!editingLayout && <EditButton />}
{!editingLayout && (
Function StudioList
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const StudioList = () => {
const translate = useTranslate();
const filters = [
<TextInput
Function TableEdit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const TableEdit = () => {
const translate = useTranslate();
return (
<Edit
resource="data-table-blueprints"
Avoid deeply nested control flow statements. Open
Open
for (const dataTableBlueprint of dataTableBlueprints) {
localOnlyCellValue = localOnlyCellValue.replace(dataTableBlueprint.name, '');
}
Avoid deeply nested control flow statements. Open
Open
for (let i = start.c; i <= end.c; i++) {
const key = utils.encode_range({ s: { c: i, r: j }, e: { c: i, r: j } })
const cellObject = wb.Sheets[worksheetName][key];
const value = cellObject.w;
dataTableRowBlueprint.dataTableCellBlueprints.push({
Avoid deeply nested control flow statements. Open
Open
if (localOnlyCellValue.includes(dataVariableBlueprint.name)) {
inputDataVariableBlueprints.push({
name: dataVariableBlueprint.name,
namespace: dataVariableBlueprint.namespace,
type: dataVariableBlueprint.type
Avoid deeply nested control flow statements. Open
Open
for (const globalDataVariableBlueprint of allDataVariableBlueprints) {
localOnlyCellValue = localOnlyCellValue.replace(globalDataVariableBlueprint.name, '');
}
Consider simplifying this complex logical expression. Open
Open
if (cell.isDynamic && cell.value.includes(":")) {
console.log("Cell has a range in it:")
console.log(cell)
const parts = cell.value.split(':');
const pairs = parts.length / 2;
Function WorkbookTree
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
export const WorkbookTree = ({
// selectedElement,
onBlueprintSelected,
onElementSelected,
}: {
- 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"