File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -138,16 +138,15 @@ impl Wmc for JavaCode {
138138 fn compute ( space_kind : SpaceKind , cyclomatic : & cyclomatic:: Stats , stats : & mut Stats ) {
139139 use SpaceKind :: * ;
140140
141- match space_kind {
142- Function => {
141+ if let Unit | Class | Interface | Function = space_kind {
142+ if stats . space_kind == Unknown {
143143 stats. space_kind = space_kind;
144- // Saves the cyclomatic complexity of the method
145- stats. cyclomatic = cyclomatic. cyclomatic_sum ( ) ;
146144 }
147- Class | Interface | Unit => {
148- stats. space_kind = space_kind;
149- }
150- _ => { }
145+ }
146+
147+ if space_kind == Function {
148+ // Saves the cyclomatic complexity of the method
149+ stats. cyclomatic = cyclomatic. cyclomatic_sum ( ) ;
151150 }
152151 }
153152}
You can’t perform that action at this time.
0 commit comments