Questions tagged [lines-of-code]

The number of code lines. Can be used as a metric.

The number of code lines. Generally, a set of metrics are placed to estimate the quality of coding. lines-of-code is one of the metrics used to determine for example if a class is too long or too short. This metric is not an accurate one and is most of the time used with other metrics such as the number of methods, number of static fields, etc.

170 questions
1
vote
1 answer

Filter a dataframe using values from a dict

I have a dataframe DF, I want to filter rows based on values on a dictionary fruits = {'BN':'Banana', 'LM': 'Lemon', 'AP':'Apple', 'MG': 'Mango'} I tried the following, but it didn't work df = df.loc[df['FruitName'] in fruits.values()] I get the…
dxtr
  • 685
  • 1
  • 7
  • 16
1
vote
1 answer

Create extra column with conditional pandas dataframe

I have a dataframe with employee IDs, the job they perform, the location the job is performed and a column that designates if that job is the primary job of that employee, like this one: ID Job Location Main Job? 10 Driver Peru street …
Paulo Cortez
  • 609
  • 4
  • 10
1
vote
1 answer

Find matching value in column and create another column pandas dataframe

Suppose I have the following dataframe: ID Country Employee Location 1 AE Jay AAA 2 AE Mary aa 3 AE Peter bbb 3 AE Peter ddd 6 DK Donk ddd 7 CZ Cesar fff 7 CZ …
Paulo Cortez
  • 609
  • 4
  • 10
1
vote
2 answers

Remove/Drop Rows if both different column values have same value

df snip,Fbuffmeal_beta,Mbuffmeal_beta rs11571877,-4.4,-5.9 kgp17983401,63.4,-2.1 kgp17731494,1.2,1.0 kgp2277054,-8.66333,-29.222 How to remove/drop rows only if both Fbuffmeal_beta & Mbuffmeal_beta column values are less than 0.1? Desired…
paul raj
  • 13
  • 6
1
vote
1 answer

How to Fill Column Cells with Column Name by Position

I am an amateur Python user (aka beginner), and want to solve the following problem: Use a column name based on its position and not its name, and then fill the column with the name of that column. Here is the original data: data = {'col1': [1, 2],…
Sam
  • 209
  • 2
  • 11
1
vote
6 answers

How might I determine the number of lines of code in a C++ project?

Is there a quick way, in Visual Studio, to know how many lines of code exist in a project?
pra che
1
vote
3 answers

Windows diff tool to extract lines of code written and time spend

Is there a tool for Windows that can read the Delphi history files. and extract the lines-of-code written per session along with the timestamps of the sessions. What info do I want session_id date+time filename lines_of_code…
Johan
  • 74,508
  • 24
  • 191
  • 319
1
vote
1 answer

How to calculate lines of code, comments and docstrings for a Python module?

Is there a tool or snippet that produces the following output in some form: lines_of_code = 98 lines_of_comments = 24 lines_of_documentation = 11 NOTE 1: I will then try to feed this data to Jenkins to graph. NOTE 2: I am aware that CLOC counts…
muhuk
  • 15,777
  • 9
  • 59
  • 98
1
vote
2 answers

Get lines of code in src folder skipping comments and empty lines

Hi I already have something to get the lines of code but still it out puts the count having empty lines and comments counted. git ls-files | grep "\.java$" | xargs wc -l Can you modify this to skip comments and blank lines..? Thanks in advance
Juliyanage Silva
  • 2,529
  • 1
  • 21
  • 33
1
vote
1 answer

CLOC - how to count loc in a specific (unique) directory using match-d

I need to count lines of code in a specific directory named 'gen' and I cannot just hard code the path to this directory because it can be anywhere inside a root directory (the path is variable). Would be possible to use match-d? I don't want…
user10157300
1
vote
4 answers

Countlines of code : include deleted lines?

Should we need to consider deleted lines of code , along with inserted(added)/modified lines of code while taking metrics? ( say revision's to code made me to delete some lines of code)
srinannapa
  • 3,085
  • 8
  • 49
  • 66
1
vote
3 answers

How to skip specific files while calculating Lines of Code?

I have a user case where I need to calculate Lines of Code per BUC-ID. I have achieved the same using git log --shortstat --grep=BUC3565-EPIC16 |grep -E "fil(e|es) changed" | awk -v BUC=$i '{ inserted+=$4; deleted+=$6; delta+=$4-$6i }…
user3256114
  • 119
  • 1
  • 13
1
vote
5 answers

count lines of code between two versions

Is there any way to compare lines of code between two clearcase versions , or for that matter whatever the version controller , I want to compare two different version say compare main branch with the development branch. I'm looking this topic for…
srinannapa
  • 3,085
  • 8
  • 49
  • 66
1
vote
0 answers

a single eclipse plugin for counting the logical lines of code in a J2EE project

Is there a way to get the count of logical lines of code in .java, .js, .jsp, .xml files? I have tried Metrics. It only counts the logical lines of code in .java files.
ryog
  • 122
  • 4
1
vote
2 answers

How to create LOC data in git?

I want to track the improvement of a project over time in git. I need line of code statistics by time. For example. Time LOC ----- ----- 01/01/2015 29021 01/08/2015 29987 ...... gitstats is throwing some weird error. So I need another…
emredmrl
  • 103
  • 1
  • 3
  • 9