Showing 10 of 69 total issues
Function createPopup
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createPopup = (formId: string, userOptions: PopupOptions): Popup => {
if (!hasDom()) {
return {
open: () => {},
close: () => {},
Function createSlider
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createSlider = (formId: string, userOptions: SliderOptions): Slider => {
if (!hasDom()) {
return {
open: () => {},
close: () => {},
Function createPopover
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createPopover = (formId: string, userOptions: PopoverOptions = {}): Popover => {
const options = { ...defaultOptions, ...userOptions }
const iframe = createIframe(formId, 'popover', options)
const popover = buildPopover()
Function createSidetab
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createSidetab = (formId: string, userOptions: SidetabOptions = {}): Sidetab => {
const options = { ...defaultOptions, ...userOptions }
const iframe = createIframe(formId, 'side-tab', options)
const sidetab = buildSidetab()
Function Home
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Home() {
const container = useRef();
const widgetContainerStyle = {
width: 500,
Function createPopup
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const createPopup = (formId: string, userOptions: PopupOptions): Popup => {
if (!hasDom()) {
return {
open: () => {},
close: () => {},
- 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 Slider
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Slider() {
const openSlider = (position) => {
createSlider("moe6aa", { position, medium: "demo-test" }).open();
};
Function createSidetab
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const createSidetab = (formId: string, userOptions: SidetabOptions = {}): Sidetab => {
const options = { ...defaultOptions, ...userOptions }
const iframe = createIframe(formId, 'side-tab', options)
const sidetab = buildSidetab()
- 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 createSlider
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const createSlider = (formId: string, userOptions: SliderOptions): Slider => {
if (!hasDom()) {
return {
open: () => {},
close: () => {},
- 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 createPopover
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const createPopover = (formId: string, userOptions: PopoverOptions = {}): Popover => {
const options = { ...defaultOptions, ...userOptions }
const iframe = createIframe(formId, 'popover', options)
const popover = buildPopover()
- 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"