Showing 9,449 of 9,537 total issues
Function parse
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
parse({ actions, args, arrayIndices, event, input, location, operatorPrefix = '_' }) {
if (type.isUndefined(input)) {
return { output: input, errors: [] };
}
if (event && !type.isObject(event)) {
Identical blocks of code found in 2 locations. Consider refactoring. Open
useEffect(() => {
methods.setValue({ file: null, fileList: [] });
methods.registerEvent({
name: '__getS3PostPolicy',
actions: [
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 83.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
useEffect(() => {
methods.setValue({ file: null, fileList: [] });
methods.registerEvent({
name: '__getS3PostPolicy',
actions: [
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 83.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function buildEvents
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function buildEvents(block, pageContext) {
if (block.events) {
Object.keys(block.events).map((key) => {
if (
(!type.isArray(block.events[key]) && !type.isObject(block.events[key])) ||
Identical blocks of code found in 11 locations. Consider refactoring. Confirmed
Object.keys(blocks).forEach((block) => {
icons[block] = blocks[block].meta.icons ?? [];
styles[block] = blocks[block].meta.styles ?? [];
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 81.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 11 locations. Consider refactoring. Open
Object.keys(blocks).forEach((block) => {
icons[block] = blocks[block].meta.icons ?? [];
styles[block] = blocks[block].meta.styles ?? [];
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 81.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function labelLogic
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const labelLogic = ({
blockId,
content,
methods,
properties = {},
- 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 parse
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
parse({ args, input, location, operatorPrefix = '_' }) {
if (type.isUndefined(input)) {
return { output: input, errors: [] };
}
if (args && !type.isArray(args)) {
- 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 stubBlockProps
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const stubBlockProps = ({ block, meta, logger = () => null, initialValue, schema }) => {
const [value, setState] = useState(type.enforceType(meta.valueType, block.value || initialValue));
const setValue = (val) => {
setState(type.enforceType(meta.valueType, val));
};
- 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 getter
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getter(target, path, options) {
if (typeTest.isNone(path) || !isValidObject(target)) {
return typeof options.default !== 'undefined' ? options.default : undefined;
}
Function stableStringify
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function stableStringify(obj, opts) {
if (!opts) opts = {};
if (typeof opts === 'function') opts = { cmp: opts };
let space = opts.space || '';
if (typeof space === 'number') space = Array(space + 1).join(' ');
Function createIcon
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
const createIcon = (Icons) => {
const AiOutlineLoading3Quarters = Icons['AiOutlineLoading3Quarters'];
const AiOutlineExclamationCircle = Icons['AiOutlineExclamationCircle'];
const IconBlock = ({ blockId, events, methods, onClick, properties, ...props }) => {
Function setupLink
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Confirmed
function setupLink(lowdefy) {
const { router } = lowdefy._internal;
const { window } = lowdefy._internal.globals;
const backLink = () => router.back();
const disabledLink = () => {};
- 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 parse
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Confirmed
parse({ actions, args, arrayIndices, event, input, location, operatorPrefix = '_' }) {
if (type.isUndefined(input)) {
return { output: input, errors: [] };
}
if (event && !type.isObject(event)) {
- 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 makeReplacer
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const makeReplacer = (customReplacer, isoStringDates) => (key, value) => {
let dateReplacer = (date) => ({ '~d': date.valueOf() });
if (isoStringDates) {
dateReplacer = (date) => ({ '~d': date.toISOString() });
}
- 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 getFromArray
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Confirmed
function getFromArray({ params, array, key, operator, location }) {
if (params === true) return array;
if (type.isString(params)) {
return array.find((item) => item[key] === 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 refReviver
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Confirmed
function refReviver(key, value) {
if (type.isObject(value)) {
if (!type.isUndefined(value._ref)) {
return this.parsedFiles[value._ref.id];
}
- 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 validateAuthConfig
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Confirmed
async function validateAuthConfig({ components }) {
if (type.isNone(components.auth)) {
components.auth = {};
}
if (!type.isObject(components.auth)) {
- 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 callActions
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
async callActions({ actions, arrayIndices, block, catchActions, event, eventName, progress }) {
const startTimestamp = new Date();
const responses = {};
try {
await this.callActionLoop({ actions, arrayIndices, block, event, responses, progress });
Function makeReplacer
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const makeReplacer = (customReplacer, isoStringDates) => (key, value) => {
let dateReplacer = (date) => ({ '~d': date.valueOf() });
if (isoStringDates) {
dateReplacer = (date) => ({ '~d': date.toISOString() });
}