Showing 459 of 459 total issues
Function SignIn
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const SignIn: CustomNextPage = () => {
const render = useGuestCheck();
const signInMutation = useSignInMutation();
const setupCheck = useSetupCheck([
Function Toaster
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Toaster() {
const { toasts } = useToast();
const { _ } = useLingui();
return (
Function EntityUpdate
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function EntityUpdate() {
const entityId = useEntityId();
const entity = useEntitySlug();
useDataUpdateActions({ entity, entityId });
Function ThemeSettings
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ThemeSettings() {
const themeColor = useAppConfiguration("theme_color");
const domainMessages = useAppConfigurationDomainMessages("theme_color");
const upsertConfigurationMutation =
Function VersionInfo
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function VersionInfo() {
const domainMessages = useDomainMessages({
plural: msg`System Info`,
singular: msg`System Info`,
});
Function UserSetup
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const UserSetup: CustomNextPage = () => {
const setupUserMutation = useSetupUserMutation();
const isChecking = useSetupCheck([
{
Function FormCodeEditor
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function FormCodeEditor(formInput: IFormCodeEditor) {
const {
input: { onFocus, name, onBlur, ...inputProps },
meta,
language,
Function IconInputField
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function IconInputField() {
return (
<Field name="icon" validateFields={[]} validate={required}>
{({ input, meta }) =>
SystemIconsList.includes(input.value as SystemIconsKeys) ? (
Function assertConfiguration
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
assertConfiguration() {
if (ConfigApiService.isInitialized) {
return;
}
ConfigApiService.isInitialized = true;
Function update
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
async update(
entity: string,
id: string,
data: Record<string, unknown>,
accountProfile: IAccountProfile,
Function NavigationSkeleton
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function NavigationSkeleton() {
const SCHEMA = [
"header",
"item",
"item",
Function reducer
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const reducer = (state: State, action: Action): State => {
switch (action.type) {
case "ADD_TOAST":
return {
...state,
- 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 Table
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function Table<T extends unknown>({
overridePaginatedDataState,
tableData,
syncPaginatedDataStateOut,
columns,
- 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 runValidationError
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
(fields: IAppliedSchemaFormConfig<any>) =>
(values: Record<string, unknown>) => {
const validations = Object.fromEntries(
typescriptSafeObjectDotEntries(fields).map(([field, config]) => {
const validationsToRun = config.validations || [];
- 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 BaseManageVariables
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function BaseManageVariables() {
const [currentTab, setCurrentTab] = useState<IntegrationsConfigurationGroup>(
IntegrationsConfigurationGroup.Constants
);
const constantsDomainMessages = useDomainMessages(
Function MetaDataSettings
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MetaDataSettings() {
const domainMessages = useAppConfigurationDomainMessages("metadata_columns");
const metaDataColumns = useAppConfiguration("metadata_columns");
Function runValidationError
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
(values: Record<string, unknown>) => {
const validations = Object.fromEntries(
typescriptSafeObjectDotEntries(fields).map(([field, config]) => {
const validationsToRun = config.validations || [];
Function hexToOklch
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const hexToOklch = (hex: string) => {
const hexToRGB = (h: string): TRGB => {
const r: number = parseInt(h.slice(1, 3), 16);
const g: number = parseInt(h.slice(3, 5), 16);
const b: number = parseInt(h.slice(5, 7), 16);
Similar blocks of code found in 2 locations. Consider refactoring. Open
<Input
type="number"
value={filterValue?.value2 || ""}
onChange={(e) =>
setFilter({
- 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 66.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
<Input
type="number"
value={filterValue?.value || ""}
onChange={(e) =>
setFilter({
- 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 66.
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