codevise/pageflow

View on GitHub

Showing 451 of 1,081 total issues

Function pageflowPagedReact has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const pageflowPagedReact = ['client', 'server'].map(target => {
  var targetGlobals = {
    client: {
      'backbone': 'Backbone',
      'react-dom': 'ReactDOM'
Severity: Minor
Found in rollup.config.js - About 1 hr to fix

    Method build has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def build(user, parent, entity_type)
            if parent.is_a?(User)
              button_label = I18n.t("pageflow.admin.#{entity_type}.add")
              path = new_admin_user_membership_path(
                parent, entity_type: to_class_name(entity_type)
    Severity: Minor
    Found in app/views/components/pageflow/admin/add_membership_button.rb - About 1 hr to fix

      Function classMethods has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Base.classMethods = function(Constructor) {
        return {
          find: function(viewOrParentElement) {
            var selector = Constructor.prototype.selector;
            var parentElement = viewOrParentElement.$el || viewOrParentElement;
      Severity: Minor
      Found in package/src/testHelpers/dominos/Base.js - About 1 hr to fix

        Method build has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def build(user)
                embedded_index_table(user.memberships.on_accounts
                                       .includes(:account).references(:pageflow_accounts)
                                       .accessible_by(current_ability, :index),
                                     blank_slate_text: t('pageflow.admin.users.no_accounts')) do
        Severity: Minor
        Found in app/views/components/pageflow/admin/user_accounts_tab.rb - About 1 hr to fix

          Function pageSplitLayout has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const pageSplitLayout = (function() {
            return {
              /**
               * Determine if the page is wide enough to display two columns.
               *

            Function add has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              add: function(upload, options) {
                options = options || {};
                var editor = options.editor || editorApi;
                var fileType = this.fileTypes.findByUpload(upload);
                var file = new fileType.model({
            Severity: Minor
            Found in package/src/editor/models/FileUploader.js - About 1 hr to fix

              Function detectFeatures has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  detectFeatures: function() {
                    var promises = {};
              
                    var asyncHas = function(name) {
                      var runTest = function() {
              Severity: Minor
              Found in package/src/frontend/browser/browser.js - About 1 hr to fix

                Method webpack_config has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def webpack_config
                        gsub_file(
                          'config/webpack/webpack.config.js',
                          "const { generateWebpackConfig } = require('shakapacker')",
                          "const { generateWebpackConfig, merge, mergeWithRules } = require('shakapacker')"

                  Function phoneLandscapeFullscreen has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const phoneLandscapeFullscreen = function() {
                    if (window.screen.orientation) {
                      if (browser.has('phone platform') && !browser.has('iphone platform')) {
                        window.screen.orientation.onchange = function() {
                          if (isLandscape()) {

                  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 HotspotsImage has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function HotspotsImage({
                    contentElementId, contentElementWidth, customMargin, configuration,
                    keepTooltipsInViewport, floatingStrategy, tooltipsAboveNavigationWidgets,
                    displayFullscreenToggle, onFullscreenEnter,
                    children = children => children

                  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 onRender has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                    onRender: function() {
                      this.ui.input.addClass(this.options.size);
                      this.load();
                      this.updatePlaceholder();
                  
                  
                  Severity: Minor
                  Found in package/src/ui/views/inputs/TextAreaInputView.js - About 1 hr 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

                  Method build has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def build(entry)
                          embedded_index_table(entry.memberships.includes(:user).references(:users),
                                               blank_slate_text: I18n.t('pageflow.admin.entries.no_members')) do
                            table_for_collection class: 'memberships', sortable: true, i18n: Pageflow::Membership do
                              column :user, sortable: 'users.last_name', class: 'name' do |membership|
                  Severity: Minor
                  Found in app/views/components/pageflow/admin/members_tab.rb - About 1 hr 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 browser has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const browser = (function(){
                    var tests = {},
                        results = {},
                        featureDetectionComplete = false;
                  
                  
                  Severity: Minor
                  Found in package/src/frontend/browser/browser.js - About 1 hr 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 renderToolbar has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function renderToolbar(editor, t, selectLinkDestination) {
                    const buttons = [
                      {
                        name: 'bold',
                        text: t('pageflow_scrolled.inline_editing.formats.bold'),

                    Method configure has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def configure(config)
                          config.features.register('scrolled_entry_type') do |feature_config|
                            feature_config.entry_types.register(PageflowScrolled.entry_type)
                          end
                    
                    
                    Severity: Minor
                    Found in entry_types/scrolled/lib/pageflow_scrolled/plugin.rb - About 1 hr to fix

                      Function render has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        render() {
                          const {editing, t, requestedVendors, visible} = this.props;
                      
                          if (visible || editing) {
                            return (

                        Function exampleSeed has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function exampleSeed(transition1, transition2) {
                          return normalizeAndMergeFixture({
                            sections: [
                              {
                                id: 1,

                          Function onRender has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            onRender: function() {
                              var fileType = this.model.fileType();
                              var entry = this.options.entry || state.entry;
                          
                              var tab = new ConfigurationEditorTabView({
                          Severity: Minor
                          Found in package/src/editor/views/EditFileView.js - About 1 hr to fix

                            Function initialize has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              initialize: function(options) {
                                this.theme = options.theme;
                            
                                this.files = _(_.keys(options.files || {})).reduce(function(memo, collectionName) {
                                  memo[collectionName] = _(options.files[collectionName]).reduce(function(result, file) {

                              Function configurationEditor has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                configurationEditor({entry, contentElement}) {
                                  this.listenTo(contentElement.transientState,
                                                'change:exampleNode',
                                                () => this.refresh());
                              
                              
                                Severity
                                Category
                                Status
                                Source
                                Language