gitlabhq/gitlabhq

View on GitHub

Showing 1,950 of 2,852 total issues

Method fk_from_spec has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def fk_from_spec(from_table, to_table, from_column, to_column, cascade_delete)

    Method update_page has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def update_page(page_path, title, format, content, commit_details)
    Severity: Minor
    Found in lib/gitlab/git/wiki.rb - About 35 mins to fix

      Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def initialize(repo, fb_session, namespace, current_user, user_map = nil)
      Severity: Minor
      Found in lib/gitlab/fogbugz_import/project_creator.rb - About 35 mins to fix

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

        export const restoreOriginalFile = ({ dispatch, state, commit }, path) => {
          const file = state.entries[path];
          const isDestructiveDiscard = file.tempFile || file.prevPath;
        
          if (file.deleted && file.parentPath) {
        Severity: Minor
        Found in app/assets/javascripts/ide/stores/actions/file.js - 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 loadFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export const loadFile = ({ dispatch, state }, { basePath }) => {
          if (basePath) {
            const path = basePath.slice(-1) === '/' ? basePath.slice(0, -1) : basePath;
            const treeEntryKey = Object.keys(state.entries).find(
              key => key === path && !state.entries[key].pending,
        Severity: Minor
        Found in app/assets/javascripts/ide/stores/actions/project.js - 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 addNewDesignToStore has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        const addNewDesignToStore = (store, designManagementUpload, query) => {
          const data = store.readQuery(query);
        
          const newDesigns = data.project.issue.designCollection.designs.edges.reduce((acc, design) => {
            if (!acc.find(d => d.filename === design.node.filename)) {
        Severity: Minor
        Found in app/assets/javascripts/design_management_new/utils/cache_update.js - 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 moveToFilePermalink has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          moveToFilePermalink() {
            const permalink = this.options.fileBlobPermalinkUrl;
        
            if (permalink) {
              const hash = getLocationHash();
        Severity: Minor
        Found in app/assets/javascripts/behaviors/shortcuts/shortcuts_blob.js - 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 logLinesParser has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export const logLinesParser = (lines = [], accumulator = []) =>
          lines.reduce(
            (acc, line, index) => {
              const lineNumber = accumulator.length > 0 ? getIncrementalLineNumber(acc) : index;
        
        
        Severity: Minor
        Found in app/assets/javascripts/jobs/store/utils.js - 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 getMetricStates has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export const getMetricStates = state => groupKey => {
          let groups = state.dashboard.panelGroups;
          if (groupKey) {
            groups = groups.filter(group => group.key === groupKey);
          }
        Severity: Minor
        Found in app/assets/javascripts/monitoring/stores/getters.js - 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 fetchClusters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export const fetchClusters = ({ state, commit, dispatch }) => {
          let retryCount = 0;
        
          commit(types.SET_LOADING_NODES, true);
        
        
        Severity: Minor
        Found in app/assets/javascripts/clusters_list/store/actions.js - 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 types.RENAME_ENTRY has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          [types.RENAME_ENTRY](state, { path, name, parentPath }) {
            const oldEntry = state.entries[path];
            const newPath = parentPath ? `${parentPath}/${name}` : name;
            const isRevert = newPath === oldEntry.prevPath;
        
        
        Severity: Minor
        Found in app/assets/javascripts/ide/stores/mutations.js - 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 message has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          message() {
            if (this.errorCode === window.u2f.ErrorCodes.BAD_REQUEST && this.httpsDisabled) {
              return __(
                'U2F only works with HTTPS-enabled websites. Contact your administrator for more details.',
              );
        Severity: Minor
        Found in app/assets/javascripts/authentication/u2f/error.js - 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 getFormData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export function getFormData(params) {
          const {
            commit,
            note,
            noteableType,
        Severity: Minor
        Found in app/assets/javascripts/diffs/store/utils.js - 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 constructor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          constructor(opts) {
            const isFilter = parseBoolean(opts.dropdown.dataset.isFilter);
            const fieldName = opts.dropdown.dataset.fieldName || 'namespace_id';
        
            $(opts.dropdown).glDropdown({
        Severity: Minor
        Found in app/assets/javascripts/namespace_select.js - 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 addNewDesignToStore has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        const addNewDesignToStore = (store, designManagementUpload, query) => {
          const data = store.readQuery(query);
        
          const newDesigns = data.project.issue.designCollection.designs.edges.reduce((acc, design) => {
            if (!acc.find(d => d.filename === design.node.filename)) {
        Severity: Minor
        Found in app/assets/javascripts/design_management/utils/cache_update.js - 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 selectRowAtIndex has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          selectRowAtIndex(index) {
            // If we pass an option index
            let selector;
            if (typeof index !== 'undefined') {
              selector = `${SELECTABLE_CLASSES}:eq(${index}) a`;
        Severity: Minor
        Found in app/assets/javascripts/gl_dropdown.js - 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 showDefinition has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          showDefinition({ commit, state }, { target: el }) {
            let definition;
            let position;
        
            if (!state.data) return;
        Severity: Minor
        Found in app/assets/javascripts/code_navigation/store/actions.js - 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 trigger has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          trigger: function trigger(getEntireList) {
            var config = this.hook.config.AjaxFilter;
            var searchValue = this.trigger.value;
            if (!config || !config.endpoint || !config.searchKey) {
              return;
        Severity: Minor
        Found in app/assets/javascripts/droplab/plugins/ajax_filter.js - 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 fileLineCoverage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export const fileLineCoverage = state => (file, line) => {
          if (!state.coverageFiles.files) return {};
          const fileCoverage = state.coverageFiles.files[file];
          if (!fileCoverage) return {};
          const lineCoverage = fileCoverage[String(line)];
        Severity: Minor
        Found in app/assets/javascripts/diffs/store/getters.js - 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 highlighter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        const highlighter = function(element, text, matches) {
          let j = 0;
          let len = 0;
          let lastIndex = 0;
          let matchedChars = [];
        Severity: Minor
        Found in app/assets/javascripts/project_find_file.js - 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

        Severity
        Category
        Status
        Source
        Language