Showing 130 of 130 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
y: dragState.startY + e.clientY - dragState.offsetY + (document.body.scrollTop - dragState.scrollTop)
- Read upRead up
Function hovering
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function hovering<T>( dragState: Drag.State<T>, target: Drag.DraggableOrFiles<T> | React.MutableRefObject<HTMLDivElement>) { const { x, y } = dragState;
- Read upRead up
Function relativeUrl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function relativeUrl(str: string): string { let url: URL = null; if (!str.match(/^https:\/\//) || !document || !document.location) { return str;
- Read upRead up
Function collectionOrder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function collectionOrder<T>( collection: Drag.Collection<T>, dragState: Drag.State<T>): Array<Drag.DraggableOrFiles<T>> { const { draggables, ref } = collection;
- Read upRead up
Function unconfiguredBlocks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function unconfiguredBlocks(state: PageEditor.State): Template.Block[] { const allBlocks: Record<string, Template.Block> = state.templates .flatMap((t) => t.blocks) .reduce((bs, b) => ({ [b.name]: b, ...bs }), {});
- Read upRead up
Function modifyDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function modifyDate(original: Date, options: ModifyOptions = {}): Date { const newDate = new Date(original); if ("year" in options) { newDate.setFullYear(options.year); }
- Read upRead up
Method reify_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def reify_options(block) return block unless block.key?(:options) opts = block[:options] opts = opts.call if opts.is_a?(Proc)
- Read upRead up
Method setting
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.setting(key, type, default = nil) settings[key] = SettingStruct.new(type, default) define_method key do |*args| args.any? ? set(key, *args) : get(key)
- Read upRead up
Method redirect_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def redirect_path(params = {}) path = redirect_to.dup if path.start_with? "/" params.each do |key, value| unless value.is_a?(String) || value.is_a?(Symbol)
- Read upRead up
Function DragElement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function DragElement(props: Props) { const { draggable, dragState, container } = props; if (draggable === "Files") { return "";
- Read upRead up