Showing 56 of 208 total issues
Method executionServer.Stream
has 8 return statements (exceeds 6 allowed). Open
func (s *executionServer) Stream(req *ExecutionStreamRequest, stream Execution_StreamServer) error {
// check authorization
if err := s.auth.IsAuthorized(stream.Context(), req); err != nil {
return err
}
Method Process.Validate
has 8 return statements (exceeds 6 allowed). Open
func (w *Process) Validate() error {
if err := xvalidator.Struct(w); err != nil {
return err
}
if err := w.validate(); err != nil {
Method Orchestrator.resolveRef
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func (s *Orchestrator) resolveRef(wf *process.Process, exec *execution.Execution, nodeKey string, data *types.Struct, ref *process.Process_Node_Reference) (*types.Value, error) {
Method Orchestrator.filterMatch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func (s *Orchestrator) filterMatch(f *process.Process_Node_Filter, wf *process.Process, n *process.Process_Node, exec *execution.Execution, data *types.Struct) bool {
Method Orchestrator.executeNode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func (s *Orchestrator) executeNode(wf *process.Process, n *process.Process_Node, exec *execution.Execution, event *event.Event, data *types.Struct) error {
Method Orchestrator.processMap
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func (s *Orchestrator) processMap(nodeKey string, outputs map[string]*process.Process_Node_Map_Output, wf *process.Process, exec *execution.Execution, data *types.Struct) (*types.Struct, error) {
Function keyvals
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func keyvals(proc *process.Process, node *process.Process_Node, parentExec *execution.Execution, event *event.Event, data *types.Struct) []interface{} {
Method Orchestrator.outputToValue
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func (s *Orchestrator) outputToValue(nodeKey string, output *process.Process_Node_Map_Output, wf *process.Process, exec *execution.Execution, data *types.Struct) (*types.Value, error) {
Method Keeper.Set
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func (k Keeper) Set(ctx sdk.Context, owner sdk.AccAddress, resourceHash hash.Hash, resource ownership.Ownership_Resource, resourceAddress sdk.AccAddress) (*ownership.Ownership, error) {
Method ExecutionStreamRequest_Filter.Match
has 7 return statements (exceeds 6 allowed). Open
func (f *ExecutionStreamRequest_Filter) Match(e *execution.Execution) bool {
if f == nil {
return true
}
if !f.ExecutorHash.IsZero() && !f.ExecutorHash.Equal(e.ExecutorHash) {
Method ListFilter.Match
has 7 return statements (exceeds 6 allowed). Open
func (f ListFilter) Match(exec *execution.Execution) bool {
if f.Status != execution.Status_Unknown && f.Status != exec.Status {
return false
}
if !f.ProcessHash.IsZero() && !f.ProcessHash.Equal(exec.ProcessHash) {
Method LCD.BroadcastMsgs
has 7 return statements (exceeds 6 allowed). Open
func (lcd *LCD) BroadcastMsgs(msgs []sdk.Msg) ([]byte, error) {
// Lock the getAccount + create and sign tx + broadcast
lcd.broadcastMutex.Lock()
defer lcd.broadcastMutex.Unlock()
Method Authorizer.IsAuthorized
has 7 return statements (exceeds 6 allowed). Open
func (a *Authorizer) IsAuthorized(ctx context.Context, payload interface{}) error {
md, ok := metadata.FromIncomingContext(ctx)
if !ok {
return fmt.Errorf("signature not found in metadata, make sure to set it using the key %q", RequestSignature)
}
Method Process_Node_Reference_Path.Resolve
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (path *Process_Node_Reference_Path) Resolve(data *types.Struct) (*types.Value, error) {
if path == nil {
return &types.Value{Kind: &types.Value_StructValue{StructValue: data}}, nil
}
- 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 startOrchestratorCmd
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func startOrchestratorCmd(cdc *codec.Codec) *cobra.Command {
cmd := &cobra.Command{
Use: "start",
Short: "Start the Orchestrator",
RunE: func(cmd *cobra.Command, args []string) error {
- 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
Method Keeper.Update
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (k *Keeper) Update(ctx sdk.Context, msg types.MsgUpdate) (*executionpb.Execution, error) {
store := ctx.KVStore(k.storeKey)
if !store.Has(msg.Hash) {
return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "execution %q doesn't exist", msg.Hash)
}
- 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"