largefunc

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

@index Large function and test detection that returns nodes exceeding a line-count threshold in descending size order.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Threshold  int
	PathPrefix string
	Page       paging.Request
}

Options controls bounded large-function detection. @intent keep large-function filtering and pagination rules in one typed input.

type Result

type Result struct {
	Items      []model.Node
	Pagination paging.Page
}

Result carries one large-function page plus pagination metadata. @intent let MCP handlers expose bounded large-function results without recomputing has_more.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service finds oversized functions and tests. @intent highlight large code units that may need refactoring or review

func New

func New(db *gorm.DB) *Service

New creates a large function analysis service. @intent construct a service for querying nodes above a line threshold

func (*Service) Find

func (s *Service) Find(ctx context.Context, threshold int) ([]model.Node, error)

Find returns functions and tests longer than the threshold. @intent identify oversized executable nodes for maintainability analysis @param threshold minimum line-count threshold that results must strictly exceed @return functions and tests ordered from longest to shortest @domainRule only function and test nodes participate in large-function analysis @domainRule line count is computed as (end_line - start_line + 1) and must strictly exceed threshold @see mcp.handlers.findLargeFunctions

func (*Service) FindPage

func (s *Service) FindPage(ctx context.Context, opts Options) (Result, error)

FindPage returns a bounded page of functions and tests longer than the threshold. @intent apply pagination at the query layer so large-function analysis stays bounded. @domainRule results are sorted by descending line count with deterministic file/name tiebreakers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL