Showing 580 of 800 total issues
Function separateImports
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function separateImports(payload: {
j: JSCodeshift;
source: Collection<any>;
imports: string[];
renameImports: { [key: string]: string };
Function createResources
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createResources = async (
params: { actions?: string; path?: string },
resources: string[],
) => {
const destinationPath =
Function ConfigErrorPage
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ConfigErrorPage = () => {
return (
<div
style={{
position: "fixed",
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 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 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 reorderImports
has 107 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 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 LoginForm
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LoginForm = (props: { className?: string }) => {
const { ws } = React.useContext(DevToolsContext);
const [searchParams] = useSearchParams();
const errorParam = searchParams.get("error");
const [sentError, setSentError] = React.useState<string | null>(null);
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 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 HeaderAuthStatus
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const HeaderAuthStatus = () => {
const [me, setMe] = React.useState<MeResponse | null>(null);
const [logoutVisible, setLogoutVisible] = React.useState(false);
const buttonRef = React.useRef<HTMLButtonElement>(null);
const navigate = useNavigate();
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"],