Showing 12 of 32 total issues
Function config
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
const config = async (env): Promise<Configuration> => {
const baseConfig: Configuration = {
cache: {
type: 'filesystem',
buildDependencies: {
Function ColumnAliasesEditor
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ColumnAliasesEditor(props: StandardEditorProps<ColumnAliasField[]>) {
const { onChange, value = [] } = props;
const dataFields = getDataFramesFields(props.context.data);
const availableFields = dataFields.reduce<SelectableValue[]>((acc, field) => {
// Filter out fields that already have an alias
Function ColumnWidthHints
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ColumnWidthHints(props: StandardEditorProps<ColumnWidthHint[]>) {
const { onChange, value = [] } = props;
const dataFields = getDataFramesFields(props.context.data);
const availableFields = dataFields.reduce<SelectableValue[]>((acc, field) => {
// Filter out fields that already have an width
Function optionsBuilder
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function optionsBuilder(
builder: PanelOptionsEditorBuilder<SimpleOptions>,
builderContext: StandardEditorContext<SimpleOptions>
) {
builder.addSelect({
Function ColumnSortingEditor
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ColumnSortingEditor(props: StandardEditorProps<ColumnSorting[]>) {
const { onChange, value = [] } = props;
function handleNewColumnSorting() {
const newIndex = value.length ? Math.max(...value.map((item) => item.index)) + 1 : 0;
Function ColumnStylesEditor
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ColumnStylesEditor(props: StandardEditorProps<ColumnStyling[]>) {
const { onChange, value = [] } = props;
// @ts-ignore
function handleRemoveColumnStyle(index: number) {
Function DataTablePanel
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const DataTablePanel: React.FC<Props> = (props: Props) => {
const { data, height } = props;
const dataTableId = `data-table-renderer-${props.id}`;
Function ColumnWidthHints
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function ColumnWidthHints(props: StandardEditorProps<ColumnWidthHint[]>) {
const { onChange, value = [] } = props;
const dataFields = getDataFramesFields(props.context.data);
const availableFields = dataFields.reduce<SelectableValue[]>((acc, field) => {
// Filter out fields that already have an width
- 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 ColumnAliasesEditor
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function ColumnAliasesEditor(props: StandardEditorProps<ColumnAliasField[]>) {
const { onChange, value = [] } = props;
const dataFields = getDataFramesFields(props.context.data);
const availableFields = dataFields.reduce<SelectableValue[]>((acc, field) => {
// Filter out fields that already have an alias
- 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 currentAliases
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const currentAliases = value.map((alias: ColumnAliasField, index: number) => {
const options =
alias.name === '' ? availableFields : [...availableFields, { value: alias.name, label: alias.name }];
// TODO: fix the styling so all fields align. Currently
return (
Function ColumnSortingEditor
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function ColumnSortingEditor(props: StandardEditorProps<ColumnSorting[]>) {
const { onChange, value = [] } = props;
function handleNewColumnSorting() {
const newIndex = value.length ? Math.max(...value.map((item) => item.index)) + 1 : 0;
- 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 config
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const config = async (env): Promise<Configuration> => {
const baseConfig: Configuration = {
cache: {
type: 'filesystem',
buildDependencies: {
- 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"