Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rename spec to workflow #424

Merged
merged 1 commit into from
Nov 6, 2024
Merged

feat: rename spec to workflow #424

merged 1 commit into from
Nov 6, 2024

Conversation

islxyqwe
Copy link
Member

@islxyqwe islxyqwe commented Nov 6, 2024

No description provided.

Copy link

vercel bot commented Nov 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
graphic-walker ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 9:37am

Copy link
Contributor

github-actions bot commented Nov 6, 2024

Risk Level 2 - /home/runner/work/graphic-walker/graphic-walker/packages/graphic-walker/src/utils/workflow.ts

  1. The function walkExpression has a cyclomatic complexity of 6, which is a bit high. Consider refactoring this function to reduce its complexity and improve readability. For example, you could extract the logic inside each if condition into separate functions.
const handleFieldParam = (param: IExpression, each: (field: string) => void) => {
    each(param.value);
};

const handleExpressionParam = (param: IExpression, each: (field: string) => void) => {
    walkExpression(param.value, each);
};

// ... and so on for each param type

const walkExpression = (expression: IExpression, each: (field: string) => void): void => {
    for (const param of expression.params) {
        if (param.type === 'field') {
            handleFieldParam(param, each);
        } else if (param.type === 'expression') {
            handleExpressionParam(param, each);
        } // ... and so on for each param type
    }
};
  1. The function createFilter has a cyclomatic complexity of 6, which is a bit high. Consider refactoring this function to reduce its complexity and improve readability. For example, you could extract the logic inside each if condition into separate functions.

  2. The function toWorkflow is quite long and complex. Consider breaking it down into smaller, more manageable functions to improve readability and maintainability.

  3. The function specToWorkflow is deprecated. If this function is no longer in use, consider removing it to reduce clutter in the codebase.

  4. The function processExpression has a cyclomatic complexity of 4, which is a bit high. Consider refactoring this function to reduce its complexity and improve readability. For example, you could extract the logic inside each if condition into separate functions.


🔄📚🧹


Powered by Code Review GPT

@islxyqwe islxyqwe merged commit 8407514 into main Nov 6, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants