concord-consortium/rigse

View on GitHub

Showing 2,136 of 2,138 total issues

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

    return (
      <li key={gradeLevel.key} id={css[filterId]} className={className} onClick={clicked}>
        { gradeLevel.title }
      </li>
    );
rails/react-components/src/library/components/stem-finder.tsx on lines 445..449

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

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

    return (
      <li key={subjectArea.key} id={css[filterId]} className={className} onClick={clicked}>
        { subjectArea.title }
      </li>
    );
rails/react-components/src/library/components/stem-finder.tsx on lines 490..494

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

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

  @Authorized()
  @Query(() => [PortalPermissionForm])
  async allPortalPermissionForms(@Args() searchParams:PermissionSearch) {
    return await fuzzyFetch<PortalPermissionForm>(PortalPermissionForm, 'portalPermissionForm', searchParams);
  }
admin-panel/graphql-backend/src/resolvers/AdminProjectResolver.ts on lines 54..58
admin-panel/graphql-backend/src/resolvers/PortalStudentResolver.ts on lines 46..50
admin-panel/graphql-backend/src/resolvers/UserResolver.ts on lines 63..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 58.

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

  @Authorized()
  @Query(() => [User])
  async allUsers(@Args() searchParams:UserPaginationAndFilter) {
    return await fuzzyFetch<User>(User, 'user', searchParams);
  }
Severity: Major
Found in admin-panel/graphql-backend/src/resolvers/UserResolver.ts and 3 other locations - About 1 hr to fix
admin-panel/graphql-backend/src/resolvers/AdminProjectResolver.ts on lines 54..58
admin-panel/graphql-backend/src/resolvers/PortalPermissionFormResolver.ts on lines 45..49
admin-panel/graphql-backend/src/resolvers/PortalStudentResolver.ts on lines 46..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 58.

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

  @Authorized()
  @Query(() => [PortalStudent])
  async allPortalStudents(@Args() searchParams:PortalStudentPaginationAndFilter) {
    return await fuzzyFetch<PortalStudent>(PortalStudent, 'PortalStudent', searchParams);
  }
admin-panel/graphql-backend/src/resolvers/AdminProjectResolver.ts on lines 54..58
admin-panel/graphql-backend/src/resolvers/PortalPermissionFormResolver.ts on lines 45..49
admin-panel/graphql-backend/src/resolvers/UserResolver.ts on lines 63..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 58.

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 draw has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    draw: function() {
        var me = this,
            props = me.styleInfos.backgroundInfo.getProps(),
            bg, images, i = 0, img, bgAreaSize, bgSize;

Severity: Minor
Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 hr to fix

    Function calculateRange has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        calculateRange: function(axis){
            var o = axis.options,
                min = o.min != null ? o.min : axis.datamin,
                max = o.max != null ? o.max : axis.datamax,
                margin;
    Severity: Minor
    Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 1 hr to fix

      Function calculateRange has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          calculateRange: function(axis){
              var o = axis.options,
                  min = o.min != null ? o.min : axis.datamin,
                  max = o.max != null ? o.max : axis.datamax,
                  margin;
      Severity: Minor
      Found in rails/app/assets/javascripts/flotr/flotr.js - About 1 hr to fix

        Function results_option_build has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            AbstractChosen.prototype.results_option_build = function(options) {
              var content, data, data_content, shown_results, _i, _len, _ref;
              content = '';
              shown_results = 0;
              _ref = this.results_data;
        Severity: Minor
        Found in rails/app/assets/javascripts/chosen.proto.js - About 1 hr to fix

          Function scroll has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            scroll: function() {
              var current = new Date();
              var delta = current - this.lastScrolled;
              this.lastScrolled = current;
              if(this.options.scroll == window) {
          Severity: Minor
          Found in rails/app/assets/javascripts/dragdrop.js - About 1 hr to fix

            Function add_option has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
                  if (option.nodeName.toUpperCase() === "OPTION") {
                    if (option.text !== "") {
                      if (group_position != null) {
                        this.parsed[group_position].children += 1;
            Severity: Minor
            Found in rails/app/assets/javascripts/chosen.proto.js - About 1 hr to fix

              Method index has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def index
                  authorize Interactive
              
                  search_params = {
                    :material_types       => [Search::InteractiveMaterial],
              Severity: Minor
              Found in rails/app/controllers/interactives_controller.rb - About 1 hr to fix

                Method index has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def index
                    authorize User
                
                    user_type_conditions = []
                
                
                Severity: Minor
                Found in rails/app/controllers/users_controller.rb - About 1 hr to fix

                  Method remove_favorite has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def remove_favorite
                  
                      if !current_user || current_user.anonymous?
                        render json: {:message => "Cannot remove favorite for non-logged in user."}, :status => 400
                        return
                  Severity: Minor
                  Found in rails/app/controllers/api/v1/materials_controller.rb - About 1 hr to fix

                    Method accordion_for has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def accordion_for(model, title, dom_prefix='', options={})
                        show_hide_text = options[:show_hide_text]
                        capture_haml do
                          haml_tag :div, :id => dom_id_for(model, dom_prefix), :class => 'accordion_container' do
                            haml_tag :div, :class => 'accordion_name' do
                    Severity: Minor
                    Found in rails/app/helpers/application_helper.rb - About 1 hr to fix

                      Method show has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def show
                      
                          type            = params[:material_type]
                          id              = params[:id]
                          include_related = params.has_key?(:include_related)     ?
                      Severity: Minor
                      Found in rails/app/controllers/api/v1/materials_controller.rb - About 1 hr to fix

                        Function main has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        async function main() {
                          // Connect to TypeOrm DB
                          await createConnection()
                          const schema = await buildSchema({
                            nullableByDefault: true,
                        Severity: Minor
                        Found in admin-panel/graphql-backend/src/index.ts - About 1 hr to fix

                          Method up has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def up
                              create_table :admin_cohorts do |t|
                                t.integer :project_id
                                t.string  :name
                              end
                          Severity: Minor
                          Found in rails/db/migrate/20151105163615_convert_cohorts_to_model.rb - About 1 hr to fix

                            Function getGroupedDiv has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                const getGroupedDiv = function (groupMap: any, heading: any) {
                                  if (Object.keys(groupMap).length > 0) {
                                    //
                                    // For each statement display:
                                    //
                            Severity: Minor
                            Found in rails/react-components/src/library/helpers/standards-helpers.tsx - About 1 hr to fix

                              Function renderLink has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                renderLink (linkDef: any) {
                                  const { popOut, iconName, label, url, onClick } = linkDef;
                                  const { location } = this.state;
                                  const target = popOut ? "_blank" : "_self";
                                  const icon = popOut && iconName !== "icon-help" ? "icon-arrow-circle-right" : iconName;
                              Severity: Minor
                              Found in rails/react-components/src/library/components/navigation/index.tsx - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language