200ok-ch/organice

View on GitHub

Showing 85 of 1,494 total issues

Function ActionDrawer has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
Open

const ActionDrawer = ({
  org,
  selectedHeaderId,
  base,
  staticFile,
Severity: Minor
Found in src/components/OrgFile/components/ActionDrawer/index.js - About 1 day 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 computeCompletions has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
Open

export const computeCompletions = (todoKeywords, tagNames, allProperties) => (
  filterExpr,
  filterString,
  curserPosition
) => {
Severity: Minor
Found in src/lib/headline_filter.js - About 1 day 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

OrgFile has 44 functions (exceeds 20 allowed). Consider refactoring.
Open

class OrgFile extends PureComponent {
  constructor(props) {
    super(props);

    _.bindAll(this, [
Severity: Minor
Found in src/components/OrgFile/index.js - About 6 hrs to fix

    Function parseRawText has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
    Open

    export const parseRawText = (rawText, { excludeContentElements = false } = {}) => {
      const lines = rawText.split('\n');
    
      const LIST_HEADER_REGEX = /^\s*([-+*]|(\d+(\.|\)))) (.*)/;
    
    
    Severity: Minor
    Found in src/lib/parse_org.js - About 5 hrs 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

    Header has 35 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Header extends PureComponent {
      SWIPE_ACTION_ACTIVATION_DISTANCE = 80;
      FREE_DRAG_ACTIVATION_DISTANCE = 10;
    
      constructor(props) {
    Severity: Minor
    Found in src/components/OrgFile/components/Header/index.js - About 4 hrs to fix

      Function AttributedString has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      const AttributedString = ({ org, parts, subPartDataAndHandlers }) => {
        let className;
      
        let location = useLocation();
      
      
      Severity: Minor
      Found in src/components/OrgFile/components/AttributedString/index.js - About 2 hrs 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 setSearchFilterInformation has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      export const setSearchFilterInformation = (state, action) => {
        const { searchFilter, cursorPosition, context } = action;
      
        let files = state.get('files');
        state = state.asMutable();
      Severity: Minor
      Found in src/reducers/org.js - About 2 hrs 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

      TableEditorModal has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class TableEditorModal extends PureComponent {
        constructor(props) {
          super(props);
          _.bindAll(this, [
            'handleCellSelect',
      Severity: Minor
      Found in src/components/OrgFile/components/TableEditorModal/index.js - About 2 hrs to fix

        Function constructor has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

          constructor(props) {
            super(props);
        
            runAllMigrations();
        
        
        Severity: Minor
        Found in src/App.js - About 2 hrs 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 parseMarkupAndCookies has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        export const parseMarkupAndCookies = (rawText, { shouldAppendNewline = false } = {}) => {
          const matches = [];
          let match = markupAndCookieRegex.exec(rawText);
          while (match) {
            if (!!match[2]) {
        Severity: Minor
        Found in src/lib/parse_org.js - About 2 hrs 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 timeFilter has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        export const timeFilter = (filterDescription) => {
          const timeFilterDescription = filterDescription.field.timerange;
          let lower;
          let upper;
          if (timeFilterDescription.type === 'point') {
        Severity: Minor
        Found in src/lib/headline_filter.js - About 2 hrs 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

        HeaderContent has 22 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class HeaderContent extends PureComponent {
          constructor(props) {
            super(props);
        
            _.bindAll(this, [
        Severity: Minor
        Found in src/components/OrgFile/components/HeaderContent/index.js - About 2 hrs to fix

          Function loadContentFromLocalStorage has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

          const loadContentFromLocalStorage = (initialState) => {
            persistableFields.forEach((field) => {
              let value = localStorage.getItem(field.name);
          
              if (field.type === 'nullable') {
          Severity: Minor
          Found in src/util/settings_persister.js - About 2 hrs 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 subscribeToChanges has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

          export const subscribeToChanges = (store) => {
            if (!localStorageAvailable) {
              return () => {};
            } else {
              return () => {
          Severity: Minor
          Found in src/util/settings_persister.js - About 2 hrs 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

          HeaderBar has 21 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class HeaderBar extends PureComponent {
            constructor(props) {
              super(props);
          
              _.bindAll(this, [
          Severity: Minor
          Found in src/components/HeaderBar/index.js - About 2 hrs to fix

            TimestampEditor has 21 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class TimestampEditor extends PureComponent {
              constructor(props) {
                super(props);
            
                _.bindAll(this, [

              Function createRawDescriptionText has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              export const createRawDescriptionText = (header, includeTitle, dontIndent) => {
                // To simplify access to properties:
                const immutableHeader = header;
                header = header.toJS();
              
              
              Severity: Minor
              Found in src/lib/export_org.js - About 2 hrs 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 pathAndPartOfListItemWithIdInAttributedString has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

              export const pathAndPartOfListItemWithIdInAttributedString = (parts, listItemId) =>
                parts
                  .map((part, partIndex) => {
                    if (part.get('type') === 'list') {
                      return part
              Severity: Minor
              Found in src/lib/org_utils.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 determineIncludedFiles has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

              export const determineIncludedFiles = (files, fileSettings, path, settingValue, includeByDefault) =>
                files.mapEntries(([filePath, file]) => [
                  filePath,
                  file.update('headers', (headers) => {
                    const fileSetting = fileSettings.find((setting) => filePath === setting.get('path'));
              Severity: Minor
              Found in src/reducers/org.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 componentDidUpdate has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                componentDidUpdate(prevProps) {
                  const {
                    subPartDataAndHandlers: {
                      onListTitleValueUpdate,
                      onListContentsValueUpdate,

              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