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