Showing 199 of 9,537 total issues
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { div, id, methods, style } = this.props;
if (div === true) {
return (
<div
Function BrandTag
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BrandTag = () => {
const [showBranding, setShowBranding] = useState(false);
useEffect(() => {
checkEntitlement({ setShowBranding });
}, []);
Function reducer
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function reducer(state, action) {
switch (action.type) {
case 'increment':
return {
...state,
Function hasValues
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const hasValues = (val) => {
switch (type.typeOf(val)) {
case 'boolean':
case 'date':
case 'function':
Function build
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function build(options) {
const context = createContext(options);
const components = await buildRefs({ context });
testSchema({ components, context });
buildApp({ components, context });
Function fetch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
async fetch(request) {
request.loading = true;
const startTime = Date.now();
try {
Function wrappedHandler
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
return async function wrappedHandler(req, res) {
const context = {
// Important to give absolute path so Next can trace build files
rid: crypto.randomUUID(),
buildDirectory: path.join(process.cwd(), 'build'),
Function wrappedHandler
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
return async function wrappedHandler(req, res) {
const context = {
// Important to give absolute path so Next can trace build files
rid: crypto.randomUUID(),
buildDirectory: path.join(process.cwd(), 'build'),
Function PaginationBlock
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const PaginationBlock = ({ blockId, loading, methods, properties, value }) => {
const [state, setState] = useState(() =>
calculateState({
defaultCurrent: 1,
defaultPageSize: properties.pageSizeOptions?.[0] ?? 10,
- 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 _regex
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Confirmed
function _regex({ location, params, state }) {
const pattern = type.isObject(params) ? params.pattern : params;
if (!type.isString(pattern)) {
throw new Error(
`Operator Error: _regex.pattern must be a string. Received: ${JSON.stringify(
- 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 _random
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Confirmed
function _random({ location, params }) {
if (!type.isString(params) && !type.isObject(params)) {
throw new Error(
`Operator Error: _random takes an string or object type. Received: ${JSON.stringify(
params
- 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 MultipleSelector
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const MultipleSelector = ({
blockId,
components: { Icon },
events,
loading,
- 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 _nunjucks
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function _nunjucks({ location, params, state, payload, runtime }) {
let templateString;
let on;
if (type.isObject(params) && type.isString(params.template)) {
templateString = params.template;
- 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 dateFilter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const dateFilter = (date, format, ...args) => {
// for no date, return undefined.
if (type.isNone(date)) {
return '';
}
- 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 validateVersion
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function validateVersion({ cliVersion, lowdefyVersion, print, requiresLowdefyYaml }) {
if (!requiresLowdefyYaml) {
return;
}
if (lowdefyVersion === 'local') {
- 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 apiWrapper
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function apiWrapper(handler) {
return async function wrappedHandler(req, res) {
const context = {
// Important to give absolute path so Next can trace build files
rid: crypto.randomUUID(),
Function provideDocumentLinks
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async provideDocumentLinks(
document: vscode.TextDocument,
token: vscode.CancellationToken
): Promise<vscode.DocumentLink[] | undefined> {
let links: vscode.DocumentLink[] = [];
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
constructor({ arrayIndices = [], areas, context }) {
this.id = Math.random()
.toString(36)
.replace(/[^a-z]+/g, '')
.substring(0, 5);
Consider simplifying this complex logical expression. Confirmed
if (type.isObject(item)) {
let path = `${key}.${nextKey}[${index}]`;
// TODO: Convert all artifacts to not modify id.
const id =
item.blockId ??
Function getHue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const getHue = (hsv, i, isLight) => {
let hue;
if (hsv.h >= 60 && hsv.h <= 240) {
hue = isLight ? hsv.h - hueStep * i : hsv.h + hueStep * i;
} else {
- 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"