gitlabhq/gitlabhq

View on GitHub

Showing 1,532 of 1,532 total issues

Function validate has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  validate() {
    var errorMessage, errors, formatter, unique, validator;
    const indexOf = [].indexOf;

    this.branchNameError.empty();
Severity: Minor
Found in app/assets/javascripts/new_branch_form.js - About 1 hr to fix

    Function drawLines has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      BranchGraph.prototype.drawLines = function(x, y, commit) {
        var arrow, color, i, j, len, offset, parent, parentCommit, parentX1, parentX2, parentY, r, ref, results, route;
        r = this.r;
        ref = commit.parents;
        results = [];
    Severity: Minor
    Found in app/assets/javascripts/network/branch_graph.js - About 1 hr to fix

      Function logProjectAccess has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        logProjectAccess(project) {
          let matchFound = false;
          let storedFrequentProjects;
      
          if (this.isLocalStorageAvailable) {

        Function keydownNoteText has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          keydownNoteText(e) {
            var $textarea, discussionNoteForm, editNote, myLastNote, myLastNoteEditBtn, newText, originalText;
            if (isMetaKey(e)) {
              return;
            }
        Severity: Minor
        Found in app/assets/javascripts/notes.js - About 1 hr to fix

          Method system_usage_data has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def system_usage_data
                  {
                    counts: {
                      boards: Board.count,
                      ci_builds: ::Ci::Build.count,
          Severity: Minor
          Found in lib/gitlab/usage_data.rb - About 1 hr to fix

            Method fields has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def fields
                [
                  { type: 'text', name: 'api_key', placeholder: 'Your application key', required: true },
                  { type: 'text', name: 'user_key', placeholder: 'Your user key', required: true },
                  { type: 'text', name: 'device', placeholder: 'Leave blank for all active devices' },
            Severity: Minor
            Found in app/models/project_services/pushover_service.rb - About 1 hr to fix

              Method create_note_message has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def create_note_message(data)
                  data = HashWithIndifferentAccess.new(data)
                  user_name = data[:user][:name]
              
                  obj_attr = HashWithIndifferentAccess.new(data[:object_attributes])
              Severity: Minor
              Found in app/models/project_services/hipchat_service.rb - About 1 hr to fix

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

                    $('.hide-no-ssh-message').on('click', function(e) {
                      Cookies.set('hide_no_ssh_message', 'false');
                      $(this).parents('.no-ssh-key-message').remove();
                      return e.preventDefault();
                    });
                Severity: Major
                Found in app/assets/javascripts/pages/projects/project.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/pages/projects/project.js on lines 45..49

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

                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

                    $('.hide-no-password-message').on('click', function(e) {
                      Cookies.set('hide_no_password_message', 'false');
                      $(this).parents('.no-password-message').remove();
                      return e.preventDefault();
                    });
                Severity: Major
                Found in app/assets/javascripts/pages/projects/project.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/pages/projects/project.js on lines 40..44

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

                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

                  ContributorsAuthorGraph.prototype.draw_path = function(data) {
                    return this.svg.append("path").datum(data).attr("class", "area-contributor").attr("d", this.area);
                  };
                app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js on lines 169..171

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

                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

                  ContributorsMasterGraph.prototype.draw_path = function(data) {
                    return this.svg.append("path").datum(data).attr("class", "area").attr("d", this.area);
                  };
                app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_graph.js on lines 270..272

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

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

                  constructor(wrapperEl) {
                    this.wrapperEl = wrapperEl;
                    this.availableButton = this.wrapperEl.querySelector('.available');
                    this.branchInput = this.wrapperEl.querySelector('.js-branch-name');
                    this.branchMessage = this.wrapperEl.querySelector('.js-branch-message');
                Severity: Minor
                Found in app/assets/javascripts/create_merge_request_dropdown.js - About 1 hr to fix

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

                        def predefined_variables
                          config = YAML.dump(kubeconfig)
                  
                          variables = [
                            { key: 'KUBE_URL', value: api_url, public: true },
                  Severity: Major
                  Found in app/models/clusters/platforms/kubernetes.rb and 1 other location - About 1 hr to fix
                  app/models/project_services/kubernetes_service.rb on lines 105..120

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

                  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

                    def predefined_variables
                      config = YAML.dump(kubeconfig)
                  
                      variables = [
                        { key: 'KUBE_URL', value: api_url, public: true },
                  Severity: Major
                  Found in app/models/project_services/kubernetes_service.rb and 1 other location - About 1 hr to fix
                  app/models/clusters/platforms/kubernetes.rb on lines 56..71

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

                  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

                      Object.assign(file, {
                        blamePath: data.blame_path,
                        commitsPath: data.commits_path,
                        permalink: data.permalink,
                        rawPath: data.raw_path,
                  Severity: Major
                  Found in app/assets/javascripts/ide/stores/mutations/file.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/smart_interval.js on lines 21..29

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

                  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.cfg = {
                        callback: opts.callback,
                        startingInterval: opts.startingInterval,
                        maxInterval: opts.maxInterval,
                        hiddenInterval: opts.hiddenInterval,
                  Severity: Major
                  Found in app/assets/javascripts/smart_interval.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/ide/stores/mutations/file.js on lines 26..34

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

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

                    constructor(currentUser) {
                      this.userSelect = new UsersSelect(currentUser);
                  
                      $('select.select2').select2({
                        width: 'resolve',
                  Severity: Minor
                  Found in app/assets/javascripts/issuable_context.js - About 1 hr to fix

                    Function adminInit has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function adminInit() {
                      const modal = $('.change-owner-holder');
                    
                      $('input#user_force_random_password').on('change', function randomPasswordClick() {
                        const $elems = $('#user_password, #user_password_confirmation');
                    Severity: Minor
                    Found in app/assets/javascripts/pages/admin/admin.js - About 1 hr to fix

                      Function initKeyNav has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        initKeyNav() {
                          var li, liSelected;
                          li = $("tr.tree-item");
                          liSelected = null;
                          return $('body').keydown(function(e) {
                      Severity: Minor
                      Found in app/assets/javascripts/tree.js - About 1 hr to fix

                        Method update_column_in_batches has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def update_column_in_batches(table, column, value)
                                if transaction_open?
                                  raise 'update_column_in_batches can not be run inside a transaction, ' \
                                    'you can disable transactions by calling disable_ddl_transaction! ' \
                                    'in the body of your migration class'
                        Severity: Minor
                        Found in lib/gitlab/database/migration_helpers.rb - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language