talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

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

  def add_audience(xml)
    xml.audience do 
      users.each do |user|
        user.devices.sms.each do |sms_device|
          xml.contact do
Severity: Minor
Found in app/models/service/tfcc/sms/alert.rb and 1 other location - About 30 mins to fix
app/models/service/tfcc/fax/alert.rb on lines 53..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

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

        rescue StandardError => e
          message = %Q{report "#{report.name}" erred in building supporting view: (#{e})}
          full_message = "#{message}\n#{e.backtrace.collect{|b| "#{b}\n"}}"
          fatal_logging(logger,report,full_message)
        end
Severity: Minor
Found in lib/reporters/reporter.rb and 1 other location - About 30 mins to fix
lib/reporters/reporter.rb on lines 65..69

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

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

        rescue StandardError => e
          message = %Q{Report "#{report.name}" erred in rendering html: (#{e})}
          full_message = "#{message}\n#{e.backtrace.collect{|b| "#{b}\n"}}"
          fatal_logging(logger,report,full_message)
        end
Severity: Minor
Found in lib/reporters/reporter.rb and 1 other location - About 30 mins to fix
lib/reporters/reporter.rb on lines 36..40

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

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

  def add_audience(xml)
    xml.audience do 
      users.each do |user|
        user.devices.fax.each do |fax_device|
          xml.contact do
Severity: Minor
Found in app/models/service/tfcc/fax/alert.rb and 1 other location - About 30 mins to fix
app/models/service/tfcc/sms/alert.rb on lines 60..67

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

Avoid too many return statements within this function.
Open

        return elem[ name ];
Severity: Major
Found in app/assets/javascripts/jquery.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return jQuery( document ).ready( selector );
    Severity: Major
    Found in app/assets/javascripts/jquery.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return this.each(function(){
                  if ( this.nodeType != 1 )
                      return;
      
                  if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) )
      Severity: Major
      Found in app/assets/javascripts/jquery.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return attr === null ? undefined : attr;
        Severity: Major
        Found in app/assets/javascripts/jquery.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                                  return true;
          Severity: Major
          Found in app/assets/javascripts/jquery.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return this.setArray(jQuery.isArray( selector ) ?
                        selector :
                        jQuery.makeArray(selector));
            Severity: Major
            Found in app/assets/javascripts/jquery.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return undefined;
              Severity: Major
              Found in app/assets/javascripts/jquery.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return (elem.value || "").replace(/\r/g, "");
                Severity: Major
                Found in app/assets/javascripts/jquery.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return jQuery.attr( elem.style, "cssText", value );
                  Severity: Major
                  Found in app/assets/javascripts/jquery.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                            return diff == 0;
                    Severity: Major
                    Found in app/assets/javascripts/jquery.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
                                      (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
                                      "";
                      Severity: Major
                      Found in app/assets/javascripts/jquery.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                                return ( diff % first == 0 && diff / first >= 0 );
                        Severity: Major
                        Found in app/assets/javascripts/jquery.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return false;
                          Severity: Major
                          Found in app/assets/javascripts/alerts.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                                return;
                            Severity: Major
                            Found in app/assets/javascripts/ext/src/dd/ScrollManager.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                                  return Date.parseDate(v, df);
                              Severity: Major
                              Found in app/assets/javascripts/ext/src/data/Types.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return node;
                                Severity: Major
                                Found in app/assets/javascripts/ext/src/data/Tree.js - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language