hack4impact/maps4all

View on GitHub

Showing 457 of 457 total issues

Consider simplifying this complex logical expression.
Open

        if (deltaY === -1 && isRowHeader(tableMap, currCell, x, y) ||
        deltaX === -1 && isColumnHeader(tableMap, currCell, x, y)) {
          blocked = true;

        } else {
Severity: Major
Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 40 mins to fix

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

        def validate_email(self, field):
            if User.query.filter_by(email=field.data).first():
                raise ValidationError('Email already registered.')
    Severity: Major
    Found in app/account/forms.py and 2 other locations - About 40 mins to fix
    app/admin/forms.py on lines 20..22
    app/admin/forms.py on lines 48..50

    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 34.

    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

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

        def validate_email(self, field):
            if User.query.filter_by(email=field.data).first():
                raise ValidationError('Email already registered.')
    Severity: Major
    Found in app/admin/forms.py and 2 other locations - About 40 mins to fix
    app/account/forms.py on lines 83..85
    app/admin/forms.py on lines 48..50

    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 34.

    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

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

        def validate_email(self, field):
            if User.query.filter_by(email=field.data).first():
                raise ValidationError('Email already registered.')
    Severity: Major
    Found in app/admin/forms.py and 2 other locations - About 40 mins to fix
    app/account/forms.py on lines 83..85
    app/admin/forms.py on lines 20..22

    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 34.

    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

    Function colorBackgroundImageContrast has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      function colorBackgroundImageContrast(test, Case, options, $this, element) {
    Severity: Minor
    Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 35 mins to fix

      Function colorBackgroundGradientContrast has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        function colorBackgroundGradientContrast(test, Case, options, $this, element) {
      Severity: Minor
      Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 35 mins to fix

        Function scanHeaders has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          function scanHeaders(tableMap, x, y, deltaX, deltaY) {
        Severity: Minor
        Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 35 mins to fix

          Function colorElementBehindBackgroundImageContrast has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            function colorElementBehindBackgroundImageContrast(test, Case, options, $this, element) {
          Severity: Minor
          Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 35 mins to fix

            Function colorFontContrast has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              function colorFontContrast(test, Case, options, $this, element) {
            Severity: Minor
            Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 35 mins to fix

              Function colorElementBehindBackgroundGradientContrast has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                function colorElementBehindBackgroundGradientContrast(test, Case, options, $this, element) {
              Severity: Minor
              Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 35 mins to fix

                Function colorElementBehindContrast has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  function colorElementBehindContrast(test, Case, options, $this, element) {
                Severity: Minor
                Found in app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js - About 35 mins to fix

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

                      this.each(function (index, _case) {
                        if (!_case.get('status')) {
                          complete = false;
                        }
                      });
                  app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js on lines 7901..7905

                  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 47.

                  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

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

                          if ($el.length === 1 && element === $el.get(0)) {
                            if (!condition[1] || condition[1] === 'ignore') {
                              return;
                            }
                            else {
                  app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js on lines 1918..1926

                  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 47.

                  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

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

                          if (condition[0] === caseID) {
                            if (!condition[1] || condition[1] === 'ignore') {
                              return;
                            }
                            else {
                  app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js on lines 1931..1939

                  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 47.

                  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

                      this.each(function (index, test) {
                        if (!test.get('complete')) {
                          complete = false;
                        }
                      });
                  app/static/ckeditor/plugins/a11ychecker/libs/quail/quail.jquery.js on lines 7586..7590

                  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 47.

                  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

                  Function change_option_values_index has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def change_option_values_index(desc_id):
                      """Shows the page to add/edit/remove a descriptor's option values."""
                      descriptor = Descriptor.query.get(desc_id)
                      if descriptor is None:
                          abort(404)
                  Severity: Minor
                  Found in app/descriptor/views.py - About 35 mins 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

                  Function reset_password has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def reset_password(token):
                      """Reset an existing user's password."""
                      if not current_user.is_anonymous():
                          return redirect(url_for('main.index'))
                      form = ResetPasswordForm()
                  Severity: Minor
                  Found in app/account/views.py - About 35 mins 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

                  Function get_associations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def get_associations(resource_id):
                      resource = Resource.query.get(resource_id)
                      associations = {} # map from descriptor name -> {descriptor value(s), descriptor type}
                      if resource is None:
                          return json.dumps(associations)
                  Severity: Minor
                  Found in app/main/views.py - About 35 mins 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

                  Function index has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def index():
                      editable_html_obj = EditableHTML.get_editable_html('contact')
                  
                      if editable_html_obj is False:
                          edit = EditableHTML(editor_name='contact', page_name='Contact', value='')
                  Severity: Minor
                  Found in app/contact/views.py - About 35 mins 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

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

                      SQLALCHEMY_DATABASE_URI = os.environ.get('TEST_DATABASE_URL') or \
                          'sqlite:///' + os.path.join(basedir, 'data-test.sqlite')
                  Severity: Minor
                  Found in config.py and 2 other locations - About 35 mins to fix
                  config.py on lines 47..48
                  config.py on lines 59..60

                  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 33.

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language