Showing 561 of 707 total issues
Function renderRelationFields
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = `${getVariableName(field.key, "Data")}?.data`;
const variableIsLoading = getVariableName(field.key, "IsLoading");
Function renderRelationFields
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = getVariableName(field.key, "Data");
const variableIsLoading = getVariableName(field.key, "IsLoading");
Function LoginForm
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LoginForm = (props: { className?: string }) => {
const { ws } = React.useContext(DevToolsContext);
const [searchParams] = useSearchParams();
const [flowData, setFlowData] = React.useState<LoginFlow | null>(null);
Function renderRelationFields
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = `${getVariableName(field.key, "Data")}?.data`;
if (Array.isArray(field.accessor)) {
Function reorderImports
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const reorderImports = (content: string): string => {
let newContent = content;
// imports can have comments before them, we need to preserve those comments and import statements.
// so we need to filter out the imports with comments before.
const allImports = getImports(content);
Function renderRelationFields
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = `${getVariableName(field.key, "Data")}?.data`;
if (Array.isArray(field.accessor)) {
Function checkPackage
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
export const checkPackage = (code = "") => {
const set = new Set<string>();
const hasAntd =
code.includes("@refinedev/antd") ||
- 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 Preview
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Preview: NextPage = () => {
const [ready, setReady] = React.useState(false);
const {
code,
css,
Function ReadyPage
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ReadyPage: React.FC<RefineReadyPageProps> = () => {
const renderCode = (text: string) => (
<Typography
sx={{
backgroundColor: (theme) => theme.palette.secondary.contrastText,
Function basicInputFields
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
const basicInputFields = (field: InferField) => {
if (
field.type === "text" ||
field.type === "url" ||
field.type === "email" ||
Function basicInputFields
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
const basicInputFields = (field: InferField) => {
if (
field.type === "text" ||
field.type === "url" ||
field.type === "email" ||
Function FeatureSlide
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const FeatureSlide = (props: { className?: string }) => {
const slideTimeout = useRef<NodeJS.Timeout | null | undefined>(undefined);
const [slideIndex, setSlideIndex] = useState(0);
useEffect(() => {
Function OnboardingForm
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
const OnboardingForm = () => {
const [values, setValues] = React.useState<MeUpdateVariables>({
name: "",
jobTitle: "",
company: "",
Function useSelector
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useSelector = (active: boolean) => {
const { devtoolsUrl } = React.useContext(DevToolsContext);
const [selectableElements, setSelectableElements] = React.useState<
SelectableElement[]
>([]);
Function createResources
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createResources = async (
params: { actions?: string; path?: string },
resources: string[],
) => {
const destinationPath =
Function action
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const action = async ({
port,
target,
domain,
rewriteUrl,
- 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 liveProvider
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export const liveProvider = (
supabaseClient: SupabaseClient<any, any, any>,
): LiveProvider => {
return {
subscribe: ({
- 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 Authenticated
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export function Authenticated({
redirectOnFail = true,
appendCurrentPathToQuery = true,
children,
fallback: fallbackContent,
- 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 renderRelationFields
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
imports.push(
["Autocomplete", "@mui/material"],
["Controller", "react-hook-form"],
Function renderRelationFields
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
imports.push(
["Autocomplete", "@mui/material"],
["Controller", "react-hook-form"],