Showing 1,235 of 1,235 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
await expect(
page.getByTestId("sync-row").first().getByRole("cell", { name: "failed" }),
"The sync has failed"
).toBeVisible();
- 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 47.
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
<div className="flex grow flex-col">
<Header syncId={syncId} />
<Logs syncId={syncId} />
</div>
- 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 47.
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
<h3 className="flex items-center gap-x-2 font-bold text-primary-500">
<Box className="h-5" /> {instance.id.slice(0, 8)}
</h3>
- 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 47.
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 4 locations. Consider refactoring. Open
<Dialog
open={dialogOpen}
onOpenChange={(isOpen) => {
if (isOpen === false) setEditIndex(undefined);
setDialogOpen(isOpen);
- 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 47.
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
<div className="flex grow justify-end gap-4">
<EditDialog mirror={mirror} />
<SyncDialog loading={loading} />
</div>
- 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 47.
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
Method events.deleteWorkflowEventListeners
has 5 return statements (exceeds 4 allowed). Open
func (events *events) deleteWorkflowEventListeners(ctx context.Context, nsID uuid.UUID, fileID uuid.UUID) error {
err := events.runSQLTx(ctx, func(tx *database.SQLStore) error {
ids, err := tx.DataStore().EventListener().DeleteAllForWorkflow(ctx, fileID)
if err != nil {
return err
Method events.deleteInstanceEventListeners
has 5 return statements (exceeds 4 allowed). Open
func (events *events) deleteInstanceEventListeners(ctx context.Context, im *instanceMemory) error {
err := events.runSQLTx(ctx, func(tx *database.SQLStore) error {
ids, err := tx.DataStore().EventListener().DeleteAllForWorkflow(ctx, im.instance.Instance.ID)
if err != nil {
return err
Method delayLogic.Run
has 5 return statements (exceeds 4 allowed). Open
func (logic *delayLogic) Run(ctx context.Context, wakedata []byte) (*Transition, error) {
first, err := scheduleTwiceConst(logic, wakedata, `""`)
if err != nil {
return nil, err
}
Method FlowVarPlugin.Execute
has 5 return statements (exceeds 4 allowed). Open
func (tnv *FlowVarPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
currentNS := gateway.ExtractContextEndpoint(r).Namespace
if tnv.Namespace == "" {
tnv.Namespace = currentNS
}
Method errorLogic.Run
has 5 return statements (exceeds 4 allowed). Open
func (logic *errorLogic) Run(ctx context.Context, wakedata []byte) (*Transition, error) {
err := scheduleOnce(logic, wakedata)
if err != nil {
return nil, err
}
Function findProjectRoot
has 5 return statements (exceeds 4 allowed). Open
func findProjectRoot(path string) (string, error) {
fi, err := os.Stat(path)
if err != nil {
return "", err
}
Method Manager.Execute
has 5 return statements (exceeds 4 allowed). Open
func (d *Manager) Execute(ctx context.Context, p *datastore.MirrorProcess, m *datastore.MirrorConfig, applyer Applyer) {
ctx, cancel := context.WithCancel(ctx)
defer func() {
cancel()
// TODO: find a way to store a separate status 'cancelled' instead of 'error'?
Method KeyAuthPlugin.Execute
has 5 return statements (exceeds 4 allowed). Open
func (ka *KeyAuthPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
// check request is already authenticated
if gateway.ExtractContextActiveConsumer(r) != nil {
return r
}
Function getVariables
has 5 return statements (exceeds 4 allowed). Open
func getVariables(ctx context.Context, flowToken, addr string) (*variablesResponse, int, error) {
resp, err := doRequest(ctx, http.MethodGet, flowToken, addr, nil)
if err != nil {
return nil, resp.StatusCode, err
}
Function getVariableDataViaID
has 5 return statements (exceeds 4 allowed). Open
func getVariableDataViaID(ctx context.Context, flowToken string, flowAddr string, namespace string, id string) (variable, error) {
addr := fmt.Sprintf("http://%v/api/v2/namespaces/%v/variables/%v", flowAddr, namespace, id)
client := &http.Client{}
req, err := http.NewRequestWithContext(ctx, http.MethodGet, addr, nil)
if err != nil {
Method BasicAuthPlugin.Execute
has 5 return statements (exceeds 4 allowed). Open
func (ba *BasicAuthPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
// check request is already authenticated
if gateway.ExtractContextActiveConsumer(r) != nil {
return r
}
Method FlowPlugin.Execute
has 5 return statements (exceeds 4 allowed). Open
func (tf *FlowPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
currentNS := gateway.ExtractContextEndpoint(r).Namespace
if tf.Namespace == "" {
tf.Namespace = currentNS
}
Function parseFetchSecretExpressionTwoArgs
has 5 return statements (exceeds 4 allowed). Open
func parseFetchSecretExpressionTwoArgs(callExpression string) (*fetchSecretArgs, error) {
// parse fetchSecret( g1 ) pattern
pattern := `^[ ]{0,}fetchSecret[ ]{0,}\((.*)\)[ ]{0,}$`
regex := regexp.MustCompile(pattern)
matches := regex.FindStringSubmatch(callExpression)
Function handleResponse
has 5 return statements (exceeds 4 allowed). Open
func handleResponse(resp *http.Response, next func(resp *http.Response) (int, error)) (int, error) {
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
var apiErrorResp apiError
Method events.addInstanceEventListener
has 5 return statements (exceeds 4 allowed). Open
func (events *events) addInstanceEventListener(ctx context.Context, namespace uuid.UUID, nsName string, instance uuid.UUID, sevents []*model.ConsumeEventDefinition, all bool) error {
// var ev []map[string]interface{}
fEv := &datastore.EventListener{
ID: uuid.New(),