ReCreateJS/txtjs

View on GitHub
tools/font_export/main.py

Summary

Maintainability
F
1 wk
Test Coverage

Function svg_to_txt has a Cognitive Complexity of 194 (exceeds 5 allowed). Consider refactoring.
Open

def svg_to_txt():
    files = glob.glob( SVG_PATH + os.sep + '*.svg' )
    #target = 8
    #target_count = 0
    font_id = ""
Severity: Minor
Found in tools/font_export/main.py - About 3 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File main.py has 257 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/python
# -*- coding: latin-1 -*-

import os
import shutil
Severity: Minor
Found in tools/font_export/main.py - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                if i.has_attr('u1') and i.has_attr('u2') and i.has_attr('k'):
                    #print( i['u1'] + ":" + i['u2'] + ":" + i['k'] )
                    
                    if "," in i['u1'] and len( i['u1'] ) > 1:
                        char_1 = i['u1'].split( ',' )
    Severity: Critical
    Found in tools/font_export/main.py - About 1 hr to fix

      Avoid deeply nested control flow statements.
      Open

                          for k in char_2:
                              c_2 = k
                              if CHARS.has_key( c_2 ) and CHARS[ c_2 ] != 1:
                                  c_2 = CHARS[ c_2 ]
                              
      Severity: Major
      Found in tools/font_export/main.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if i.has_attr('horiz-adv-x') and i.has_attr('d'):
                                out += '1|' + unicode_str + '|' + i['horiz-adv-x'] + '|' + i['d']  + '\n'
        
                            elif i.has_attr('d') and i.has_attr('horiz-adv-x') == False:
                                out += '1|' + unicode_str + '|' + str( default ) + '|' + i['d']  + '\n'
        Severity: Major
        Found in tools/font_export/main.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if i.has_attr('glyph-name'):
                                  print( 'CHARS[ "' + unicode_str + '" ] = 1' )
                              else:
                                  print( 'CHARS[ "' + unicode_str + '" ] = 1 ' )
                              continue
          Severity: Major
          Found in tools/font_export/main.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if CHARS.has_key( unicode_str ) and CHARS[ unicode_str ] != 1:
                                    unicode_str = CHARS[ unicode_str ]
            
            
            Severity: Major
            Found in tools/font_export/main.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if i.has_attr('d') and i.has_attr('horiz-adv-x'):
                                      out += '1|' + CHARS[ unicode_str ] + '|' + i['horiz-adv-x'] + '|' + i['d']  + '\n'
              
                                  elif i.has_attr('d') and i.has_attr('horiz-adv-x') == False:
                                      out += '1|' + CHARS[ unicode_str ] + '|' + str( default ) + '|' + i['d']  + '\n'
              Severity: Major
              Found in tools/font_export/main.py - About 45 mins to fix

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            elif i.has_attr('u1') and i.has_attr('g2') and i.has_attr('k'):
                                #print( i['u1'] + ":" + i['g2'] + ":" + i['k'] )
                                
                                if "," in i['u1'] and len( i['u1'] ) > 1:
                                    char_1 = i['u1'].split( ',' )
                Severity: Major
                Found in tools/font_export/main.py and 3 other locations - About 1 day to fix
                tools/font_export/main.py on lines 260..275
                tools/font_export/main.py on lines 294..309
                tools/font_export/main.py on lines 311..325

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 178.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            elif i.has_attr('g1') and i.has_attr('u2') and i.has_attr('k'):
                                #print( i['g1'] + ":" + i['u2'] + ":" + i['k'] )
                                
                                if "," in i['g1'] and len( i['g1'] ) > 1:
                                    char_1 = i['g1'].split( ',' )
                Severity: Major
                Found in tools/font_export/main.py and 3 other locations - About 1 day to fix
                tools/font_export/main.py on lines 260..275
                tools/font_export/main.py on lines 277..292
                tools/font_export/main.py on lines 311..325

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 178.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            if i.has_attr('u1') and i.has_attr('u2') and i.has_attr('k'):
                                #print( i['u1'] + ":" + i['u2'] + ":" + i['k'] )
                                
                                if "," in i['u1'] and len( i['u1'] ) > 1:
                                    char_1 = i['u1'].split( ',' )
                Severity: Major
                Found in tools/font_export/main.py and 3 other locations - About 1 day to fix
                tools/font_export/main.py on lines 277..292
                tools/font_export/main.py on lines 294..309
                tools/font_export/main.py on lines 311..325

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 178.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                            elif i.has_attr('g1') and i.has_attr('g2') and i.has_attr('k'):
                                #print( i['g1'] + ":" + i['g2'] + ":" + i['k'] )
                                if "," in i['g1'] and len( i['g1'] ) > 1:
                                    char_1 = i['g1'].split( ',' )
                                    char_1 = map( gconvert , char_1 )
                Severity: Major
                Found in tools/font_export/main.py and 3 other locations - About 1 day to fix
                tools/font_export/main.py on lines 260..275
                tools/font_export/main.py on lines 277..292
                tools/font_export/main.py on lines 294..309

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 178.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                            if target.has_key( 'bottom' ):
                                out += '0|bottom|' + str( target[ 'bottom' ] ) + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 2 other locations - About 1 hr to fix
                tools/font_export/main.py on lines 127..128
                tools/font_export/main.py on lines 130..131

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 39.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                            if target.has_key( 'middle' ):
                                out += '0|middle|' + str( target[ 'middle' ] ) + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 2 other locations - About 1 hr to fix
                tools/font_export/main.py on lines 127..128
                tools/font_export/main.py on lines 133..134

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 39.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                            if target.has_key( 'top' ):
                                out += '0|top|' + str( target[ 'top' ] ) + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 2 other locations - About 1 hr to fix
                tools/font_export/main.py on lines 130..131
                tools/font_export/main.py on lines 133..134

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 39.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                                if CHARS.has_key( c_1 ) and CHARS[ c_1 ] != 1:
                                    c_1 = CHARS[ c_1 ]
                Severity: Major
                Found in tools/font_export/main.py and 2 other locations - About 1 hr to fix
                tools/font_export/main.py on lines 208..209
                tools/font_export/main.py on lines 340..341

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 38.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                                    if CHARS.has_key( unicode_str ) and CHARS[ unicode_str ] != 1:
                                        unicode_str = CHARS[ unicode_str ]
                Severity: Major
                Found in tools/font_export/main.py and 2 other locations - About 1 hr to fix
                tools/font_export/main.py on lines 334..335
                tools/font_export/main.py on lines 340..341

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 38.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                                        if CHARS.has_key( c_2 ) and CHARS[ c_2 ] != 1:
                                            c_2 = CHARS[ c_2 ]
                Severity: Major
                Found in tools/font_export/main.py and 2 other locations - About 1 hr to fix
                tools/font_export/main.py on lines 208..209
                tools/font_export/main.py on lines 334..335

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 38.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                        out += '1|' + CHARS[ unicode_str ] + '|' + i['horiz-adv-x'] + '|\n'
                Severity: Minor
                Found in tools/font_export/main.py and 1 other location - About 55 mins to fix
                tools/font_export/main.py on lines 239..239

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 37.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                        out += '1|' + CHARS[ unicode_str ] + '|' + i['horiz-adv-x'] + '|' + i['d']  + '\n'
                Severity: Minor
                Found in tools/font_export/main.py and 1 other location - About 55 mins to fix
                tools/font_export/main.py on lines 245..245

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 37.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('id'):
                                out += '0|id|' + i['id'] + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 191..192
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                        for i in target:
                            if i.has_attr('horiz-adv-x'):
                                out += '0|missing|' + i['horiz-adv-x'] + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 191..192
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('panose-1'):
                                out += '0|panose|' + i['panose-1'] + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 191..192
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('font-stretch'):
                                out += '0|font-stretch|' + i['font-stretch']  + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 191..192
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('x-height'):
                                out += '0|x-height|' + i['x-height']  + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 191..192
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('font-weight'):
                                out += '0|font-weight|' + i['font-weight']  + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 191..192
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('cap-height'):
                                out += '0|cap-height|' + i['cap-height']  + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 191..192
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('units-per-em'):
                                out += '0|units|' + i['units-per-em']  + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 191..192
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('alphabetic'):
                                out += '0|alphabetic|' + i['alphabetic']  + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 191..192
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('descent'):
                                out += '0|descent|' + i['descent'] + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 191..192
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('underline-position'):
                                out += '0|underline-position|' + i['underline-position']  + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('font-style'):
                                out += '0|font-style|' + i['font-style']  + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 191..192
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('underline-thickness'):
                                out += '0|underline-thickness|' + i['underline-thickness']  + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 167..168
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 191..192

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 14 locations. Consider refactoring.
                Open

                            if i.has_attr('ascent'):
                                out += '0|ascent|' + i['ascent'] + '\n'
                Severity: Major
                Found in tools/font_export/main.py and 13 other locations - About 45 mins to fix
                tools/font_export/main.py on lines 140..142
                tools/font_export/main.py on lines 151..152
                tools/font_export/main.py on lines 161..162
                tools/font_export/main.py on lines 164..165
                tools/font_export/main.py on lines 170..171
                tools/font_export/main.py on lines 173..174
                tools/font_export/main.py on lines 176..177
                tools/font_export/main.py on lines 179..180
                tools/font_export/main.py on lines 182..183
                tools/font_export/main.py on lines 185..186
                tools/font_export/main.py on lines 188..189
                tools/font_export/main.py on lines 191..192
                tools/font_export/main.py on lines 194..195

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                There are no issues that match your filters.

                Category
                Status