Thanks to visit codestin.com
Credit goes to github.com

Skip to content

getMetrics appears to be miscounting blank lines in docstrings #20766

@Derek-Jones

Description

@Derek-Jones

The definition of the python function combine_docs starts on line 227 in combine_documents/map_reduce.py and ends on line 259.

func-def.txt
Running the above QL script on the latest langchain database produces the values:

func.getMetrics().getNumberOfLines() = 33
func.getMetrics().getNumberOfLinesOfCode() = 27 # Should be 26
func.getMetrics().getNumberOfLinesOfComments() = 2
func.getMetrics().getNumberOfLinesOfDocStrings() = 5

I suspect that the number of blank line in the docstring might be a factor.
The above function contains one blank line in a docstring, while the example below contains two blank lines in a docstring.

The function collapse_docs starts on line 67 in combine_documents/reduce.py and ends on line 96.

The above QL script produces the values:

func.getMetrics().getNumberOfLines() = 30
func.getMetrics().getNumberOfLinesOfCode() = 12 # Should be 14
func.getMetrics().getNumberOfLinesOfComments() = 0
func.getMetrics().getNumberOfLinesOfDocStrings() = 16

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions