Showing 407 of 1,235 total issues
Function EventsPage
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const EventsPage = () => {
const pages = usePages();
const namespace = useNamespace();
const { t } = useTranslation();
const { isEventsHistoryPage, isEventsListenersPage } =
Function GatewayPage
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const GatewayPage = () => {
const pages = usePages();
const namespace = useNamespace();
const { t } = useTranslation();
const {
Method engine.newIsolateRequest
has 75 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (engine *engine) newIsolateRequest(im *instanceMemory, stateID string, timeout int,
fn model.FunctionDefinition, inputData []byte,
uid uuid.UUID, async bool, files []model.FunctionFileDefinition, iterator int,
) (*functionRequest, *enginerefactor.ActionRequest, error) {
ar := new(functionRequest)
Method instanceDataQuery.UpdateInstanceData
has 74 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (q *instanceDataQuery) UpdateInstanceData(ctx context.Context, args *instancestore.UpdateInstanceDataArgs) error {
var vals []interface{}
var clauses []string
query := fmt.Sprintf("UPDATE %s", table)
Function UpdateWorkflow
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const UpdateWorkflow = () => {
const [workflow, setWorkflow] = useState(exampleWorkflow);
const [orientation, setOrientation] = useState<Orientation>("horizontal");
return (
Function useEventSource
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
export const useEventSource = ({
url,
apiKey,
onOpen,
onMessage,
- 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 setterLogic.Run
has 72 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (logic *setterLogic) Run(ctx context.Context, wakedata []byte) (*Transition, error) {
err := scheduleOnce(logic, wakedata)
if err != nil {
return nil, err
}
Method logController.mountRouter
has 72 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (m *logController) mountRouter(r chi.Router) {
r.Get("/subscribe", m.stream)
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
params := extractLogRequestParams(r)
Method instanceMemory.GetVariables
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (im *instanceMemory) GetVariables(ctx context.Context, vars []states.VariableSelector) ([]states.Variable, error) {
x := make([]states.Variable, 0)
tx, err := im.engine.flow.beginSQLTx(ctx)
if err != nil {
Method Pubsub.flush
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (pubsub *Pubsub) flush() {
slice := pubsub.buffer[:pubsub.bufferIdx]
clusterMessages := make([]string, pubsub.bufferIdx)
messageIndex := 0
pubsub.bufferIdx = 0
Method LocalServer.logHandler
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (srv *LocalServer) logHandler(w http.ResponseWriter, r *http.Request) {
actionId := r.URL.Query().Get("aid")
srv.requestsLock.Lock()
req, ok := srv.requests[actionId]
Method flow.cronHandler
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (flow *flow) cronHandler(data []byte) {
ctx := context.Background()
t := time.Now().Truncate(time.Minute).UTC()
Function ConsumerPage
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ConsumerPage: FC = () => {
const pages = usePages();
const { path } = pages.explorer.useParams();
const namespace = useNamespace();
const { segments } = analyzePath(path);
Function Run
has 70 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func Run(circuit *core.Circuit) error {
config := &core.Config{}
if err := env.Parse(config); err != nil {
return fmt.Errorf("parsing env variables: %w", err)
}
Method sqlRuntimeVariablesStore.Set
has 70 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (s *sqlRuntimeVariablesStore) Set(ctx context.Context, variable *datastore.RuntimeVariable) (*datastore.RuntimeVariable, error) {
if variable.Name == "" {
return nil, datastore.ErrInvalidRuntimeVariableName
}
if matched, _ := regexp.MatchString(datastore.RuntimeVariableNameRegexPattern, variable.Name); !matched {
Method JSInboundPlugin.Execute
has 69 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (js *JSInboundPlugin) Execute(w http.ResponseWriter, r *http.Request) *http.Request {
var (
err error
b []byte
)
Method RootQuery.CreateFile
has 69 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (q *RootQuery) CreateFile(ctx context.Context, path string, typ filestore.FileType, mimeType string, data []byte) (*filestore.File, error) {
path, err := filestore.SanitizePath(path)
if err != nil {
return nil, fmt.Errorf("%w: %w", filestore.ErrInvalidPathParameter, err)
}
Function ComplexWorkflowDiagram
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const ComplexWorkflowDiagram = () => {
const allStates = [
"validate-input-2",
"request-prediction",
"evaluate-created-prediction",
Function WorkflowDiagram
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function WorkflowDiagram(props: WorkflowDiagramProps) {
const {
workflow,
flow = [],
instanceStatus = "pending",
Method instController.list
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
Open
func (e *instController) list(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
ns := extractContextNamespace(r)
pagination, err := e.getPagination(r)
- 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"