@@ -17,11 +17,12 @@ export default async function({login, data, imports, q, rest, account}, {enabled
1717 }
1818
1919 //Load inputs
20- let { ignored, skipped, other, colors, aliases, details, threshold, limit, indepth, "analysis.timeout" :timeout , sections, categories, "recent.categories" :_recent_categories , "recent.load" :_recent_load , "recent.days" :_recent_days } = imports . metadata . plugins . languages . inputs ( {
21- data,
22- account,
23- q,
24- } )
20+ let { ignored, skipped, other, colors, aliases, details, threshold, limit, indepth, "analysis.timeout" :timeout , sections, categories, "recent.categories" :_recent_categories , "recent.load" :_recent_load , "recent.days" :_recent_days } = imports . metadata . plugins . languages
21+ . inputs ( {
22+ data,
23+ account,
24+ q,
25+ } )
2526 threshold = ( Number ( threshold . replace ( / % $ / , "" ) ) || 0 ) / 100
2627 skipped . push ( ...data . shared [ "repositories.skipped" ] )
2728 if ( ! limit )
@@ -127,7 +128,8 @@ export default async function({login, data, imports, q, rest, account}, {enabled
127128 //Compute languages stats
128129 for ( const { section, stats = { } , lines = { } , missed = { bytes :0 } , total = 0 } of [ { section :"favorites" , stats :languages . stats , lines :languages . lines , total :languages . total , missed :languages . missed } , { section :"recent" , ...languages [ "stats.recent" ] } ] ) {
129130 console . debug ( `metrics/compute/${ login } /plugins > languages > computing stats ${ section } ` )
130- languages [ section ] = Object . entries ( stats ) . filter ( ( [ name ] ) => ! ignored . includes ( name . toLocaleLowerCase ( ) ) ) . sort ( ( [ _an , a ] , [ _bn , b ] ) => b - a ) . slice ( 0 , limit ) . map ( ( [ name , value ] ) => ( { name, value, size :value , color :languages . colors [ name ] , x :0 } ) ) . filter ( ( { value} ) => value / total > threshold )
131+ languages [ section ] = Object . entries ( stats ) . filter ( ( [ name ] ) => ! ignored . includes ( name . toLocaleLowerCase ( ) ) ) . sort ( ( [ _an , a ] , [ _bn , b ] ) => b - a ) . slice ( 0 , limit ) . map ( ( [ name , value ] ) => ( { name, value, size :value , color :languages . colors [ name ] , x :0 } ) ) . filter ( ( { value} ) => value / total > threshold
132+ )
131133 if ( other ) {
132134 let value = indepth ? missed . bytes : Object . entries ( stats ) . filter ( ( [ name ] ) => ! Object . values ( languages [ section ] ) . map ( ( { name} ) => name ) . includes ( name ) ) . reduce ( ( a , [ _ , b ] ) => a + b , 0 )
133135 if ( value ) {
0 commit comments