stakwork / stakwork/stakgraph

Ignoring certain types of function and flagging for test purposes

Open
#674 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
112
Forks
21
Avg merge
5h 55m
Merged PRs (30d)
115

Description

Task

Goal: During ingestion/sync, can we distinguish between simple setters/getters to actual logic? for test coverage perspective.

This example only works with js/ts but maybe we can abstract it out.

interface FunctionPriority {
  priority: 'ignore' | 'low' | 'medium' | 'high';
  reason: string;
}

function analyzeFunctionPriority(node: FunctionNode): FunctionPriority {
  // Ignore completely
  if (isSimpleGetter(node) || 
      isSimpleSetter(node) ||
      isToStringMethod(node)) {
    return { priority: 'ignore', reason: 'Trivial implementation' };
  }
  
  // Low priority
  if (isTypeGuard(node) ||
      isSimpleFactory(node) ||
      isLifecycleMethod(node)) {
    return { priority: 'low', reason: 'Test through usage' };
  }
  
  // Medium priority
  if (hasValidation(node) ||
      hasConditionalLogic(node)) {
    return { priority: 'medium', reason: 'Contains logic' };
  }
  
  // High priority
  if (isBusinessLogic(node) ||
      hasComplexCalculations(node) ||
      hasErrorHandling(node)) {
    return { priority: 'high', reason: 'Critical functionality' };
  }
}
const FUNCTION_CATEGORIES = {
  // Don't show in untested list at all
  IGNORE: [
    'constructor (simple)',
    'getter (no logic)',
    'setter (no logic)', 
    'toString',
    'toJSON',
    'Symbol.iterator'
  ],
  
  // Show but mark as low priority
  LOW_PRIORITY: [
    'constructor (with validation)',
    'type guards',
    'simple factories',
    'lifecycle methods',
    'event handlers (simple)'
  ],
  
  // Always show as needing tests
  HIGH_PRIORITY: [
    'business logic methods',
    'calculation methods',
    'validation methods',
    'transformation methods',
    'methods with external calls'
  ]
};

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating the ingestion/sync code that builds the untested-function list and any existing function-category or coverage tests, then clarify supported languages, classification rules, and expected handling for each category before defining what completion means.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.